p&&(m=E,p=n.rowWidth[E]);return m},O.prototype.canAddHorizontal=function(n,m,p){if(n.idealRowWidth){var E=n.rows.length-1,y=n.rowWidth[E];return y+m+n.horizontalPadding<=n.idealRowWidth}var R=this.getShortestRowIndex(n);if(R<0)return!0;var M=n.rowWidth[R];if(M+n.horizontalPadding+m<=n.width)return!0;var S=0;n.rowHeight[R]0&&(S=p+n.verticalPadding-n.rowHeight[R]);var W;n.width-M>=m+n.horizontalPadding?W=(n.height+S)/(M+m+n.horizontalPadding):W=(n.height+S)/n.width,S=p+n.verticalPadding;var D;return n.widthR&&m!=p){E.splice(-1,1),n.rows[p].push(y),n.rowWidth[m]=n.rowWidth[m]-R,n.rowWidth[p]=n.rowWidth[p]+R,n.width=n.rowWidth[instance.getLongestRowIndex(n)];for(var M=Number.MIN_VALUE,S=0;SM&&(M=E[S].height);m>0&&(M+=n.verticalPadding);var W=n.rowHeight[m]+n.rowHeight[p];n.rowHeight[m]=M,n.rowHeight[p]0)for(var et=y;et<=R;et++)X[0]+=this.grid[et][M-1].length+this.grid[et][M].length-1;if(R0)for(var et=M;et<=S;et++)X[3]+=this.grid[y-1][et].length+this.grid[y][et].length-1;for(var z=C.MAX_VALUE,w,H,B=0;B{var l=r(551).FDLayoutNode,i=r(551).IMath;function g(o,s,c,f){l.call(this,o,s,c,f)}g.prototype=Object.create(l.prototype);for(var t in l)g[t]=l[t];g.prototype.calculateDisplacement=function(){var o=this.graphManager.getLayout();this.getChild()!=null&&this.fixedNodeWeight?(this.displacementX+=o.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=o.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=o.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=o.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>o.coolingFactor*o.maxNodeDisplacement&&(this.displacementX=o.coolingFactor*o.maxNodeDisplacement*i.sign(this.displacementX)),Math.abs(this.displacementY)>o.coolingFactor*o.maxNodeDisplacement&&(this.displacementY=o.coolingFactor*o.maxNodeDisplacement*i.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},g.prototype.propogateDisplacementToChildren=function(o,s){for(var c=this.getChild().getNodes(),f,T=0;T{function l(c){if(Array.isArray(c)){for(var f=0,T=Array(c.length);f0){var Lt=0;ot.forEach(function(st){$=="horizontal"?(tt.set(st,d.has(st)?v[d.get(st)]:Z.get(st)),Lt+=tt.get(st)):(tt.set(st,d.has(st)?L[d.get(st)]:Z.get(st)),Lt+=tt.get(st))}),Lt=Lt/ot.length,lt.forEach(function(st){J.has(st)||tt.set(st,Lt)})}else{var ft=0;lt.forEach(function(st){$=="horizontal"?ft+=d.has(st)?v[d.get(st)]:Z.get(st):ft+=d.has(st)?L[d.get(st)]:Z.get(st)}),ft=ft/lt.length,lt.forEach(function(st){tt.set(st,ft)})}});for(var Mt=function(){var ot=ut.shift(),Lt=U.get(ot);Lt.forEach(function(ft){if(tt.get(ft.id)st&&(st=Zt),KtXt&&(Xt=Kt)}}catch(ee){Ct=!0,Bt=ee}finally{try{!Tt&&bt.return&&bt.return()}finally{if(Ct)throw Bt}}var ce=(Lt+st)/2-(ft+Xt)/2,Qt=!0,jt=!1,_t=void 0;try{for(var Jt=lt[Symbol.iterator](),oe;!(Qt=(oe=Jt.next()).done);Qt=!0){var te=oe.value;tt.set(te,tt.get(te)+ce)}}catch(ee){jt=!0,_t=ee}finally{try{!Qt&&Jt.return&&Jt.return()}finally{if(jt)throw _t}}})}return tt},it=function(U){var $=0,J=0,Z=0,at=0;if(U.forEach(function(j){j.left?v[d.get(j.left)]-v[d.get(j.right)]>=0?$++:J++:L[d.get(j.top)]-L[d.get(j.bottom)]>=0?Z++:at++}),$>J&&Z>at)for(var ct=0;ctJ)for(var nt=0;ntat)for(var tt=0;tt1)f.fixedNodeConstraint.forEach(function(F,U){E[U]=[F.position.x,F.position.y],y[U]=[v[d.get(F.nodeId)],L[d.get(F.nodeId)]]}),R=!0;else if(f.alignmentConstraint)(function(){var F=0;if(f.alignmentConstraint.vertical){for(var U=f.alignmentConstraint.vertical,$=function(tt){var j=new Set;U[tt].forEach(function(pt){j.add(pt)});var ut=new Set([].concat(l(j)).filter(function(pt){return S.has(pt)})),Mt=void 0;ut.size>0?Mt=v[d.get(ut.values().next().value)]:Mt=K(j).x,U[tt].forEach(function(pt){E[F]=[Mt,L[d.get(pt)]],y[F]=[v[d.get(pt)],L[d.get(pt)]],F++})},J=0;J0?Mt=v[d.get(ut.values().next().value)]:Mt=K(j).y,Z[tt].forEach(function(pt){E[F]=[v[d.get(pt)],Mt],y[F]=[v[d.get(pt)],L[d.get(pt)]],F++})},ct=0;ctV&&(V=q[et].length,X=et);if(V0){var Et={x:0,y:0};f.fixedNodeConstraint.forEach(function(F,U){var $={x:v[d.get(F.nodeId)],y:L[d.get(F.nodeId)]},J=F.position,Z=Y(J,$);Et.x+=Z.x,Et.y+=Z.y}),Et.x/=f.fixedNodeConstraint.length,Et.y/=f.fixedNodeConstraint.length,v.forEach(function(F,U){v[U]+=Et.x}),L.forEach(function(F,U){L[U]+=Et.y}),f.fixedNodeConstraint.forEach(function(F){v[d.get(F.nodeId)]=F.position.x,L[d.get(F.nodeId)]=F.position.y})}if(f.alignmentConstraint){if(f.alignmentConstraint.vertical)for(var Dt=f.alignmentConstraint.vertical,Rt=function(U){var $=new Set;Dt[U].forEach(function(at){$.add(at)});var J=new Set([].concat(l($)).filter(function(at){return S.has(at)})),Z=void 0;J.size>0?Z=v[d.get(J.values().next().value)]:Z=K($).x,$.forEach(function(at){S.has(at)||(v[d.get(at)]=Z)})},Ht=0;Ht0?Z=L[d.get(J.values().next().value)]:Z=K($).y,$.forEach(function(at){S.has(at)||(L[d.get(at)]=Z)})},Ft=0;Ft{a.exports=A})},N={};function u(a){var e=N[a];if(e!==void 0)return e.exports;var r=N[a]={exports:{}};return P[a](r,r.exports,u),r.exports}var h=u(45);return h})()})})(le)),le.exports}var pr=he.exports,De;function yr(){return De||(De=1,(function(I,x){(function(P,N){I.exports=N(vr())})(pr,function(A){return(()=>{var P={658:(a=>{a.exports=Object.assign!=null?Object.assign.bind(Object):function(e){for(var r=arguments.length,l=Array(r>1?r-1:0),i=1;i{var l=(function(){function t(o,s){var c=[],f=!0,T=!1,d=void 0;try{for(var v=o[Symbol.iterator](),L;!(f=(L=v.next()).done)&&(c.push(L.value),!(s&&c.length===s));f=!0);}catch(b){T=!0,d=b}finally{try{!f&&v.return&&v.return()}finally{if(T)throw d}}return c}return function(o,s){if(Array.isArray(o))return o;if(Symbol.iterator in Object(o))return t(o,s);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),i=r(140).layoutBase.LinkedList,g={};g.getTopMostNodes=function(t){for(var o={},s=0;s0&&R.merge(D)});for(var M=0;M1){L=d[0],b=L.connectedEdges().length,d.forEach(function(y){y.connectedEdges().length0&&c.set("dummy"+(c.size+1),k),Y},g.relocateComponent=function(t,o,s){if(!s.fixedNodeConstraint){var c=Number.POSITIVE_INFINITY,f=Number.NEGATIVE_INFINITY,T=Number.POSITIVE_INFINITY,d=Number.NEGATIVE_INFINITY;if(s.quality=="draft"){var v=!0,L=!1,b=void 0;try{for(var C=o.nodeIndexes[Symbol.iterator](),G;!(v=(G=C.next()).done);v=!0){var k=G.value,Y=l(k,2),K=Y[0],O=Y[1],it=s.cy.getElementById(K);if(it){var n=it.boundingBox(),m=o.xCoords[O]-n.w/2,p=o.xCoords[O]+n.w/2,E=o.yCoords[O]-n.h/2,y=o.yCoords[O]+n.h/2;mf&&(f=p),Ed&&(d=y)}}}catch(D){L=!0,b=D}finally{try{!v&&C.return&&C.return()}finally{if(L)throw b}}var R=t.x-(f+c)/2,M=t.y-(d+T)/2;o.xCoords=o.xCoords.map(function(D){return D+R}),o.yCoords=o.yCoords.map(function(D){return D+M})}else{Object.keys(o).forEach(function(D){var q=o[D],V=q.getRect().x,X=q.getRect().x+q.getRect().width,et=q.getRect().y,z=q.getRect().y+q.getRect().height;Vf&&(f=X),etd&&(d=z)});var S=t.x-(f+c)/2,W=t.y-(d+T)/2;Object.keys(o).forEach(function(D){var q=o[D];q.setCenter(q.getCenterX()+S,q.getCenterY()+W)})}}},g.calcBoundingBox=function(t,o,s,c){for(var f=Number.MAX_SAFE_INTEGER,T=Number.MIN_SAFE_INTEGER,d=Number.MAX_SAFE_INTEGER,v=Number.MIN_SAFE_INTEGER,L=void 0,b=void 0,C=void 0,G=void 0,k=t.descendants().not(":parent"),Y=k.length,K=0;KL&&(f=L),TC&&(d=C),v{var l=r(548),i=r(140).CoSELayout,g=r(140).CoSENode,t=r(140).layoutBase.PointD,o=r(140).layoutBase.DimensionD,s=r(140).layoutBase.LayoutConstants,c=r(140).layoutBase.FDLayoutConstants,f=r(140).CoSEConstants,T=function(v,L){var b=v.cy,C=v.eles,G=C.nodes(),k=C.edges(),Y=void 0,K=void 0,O=void 0,it={};v.randomize&&(Y=L.nodeIndexes,K=L.xCoords,O=L.yCoords);var n=function(D){return typeof D=="function"},m=function(D,q){return n(D)?D(q):D},p=l.calcParentsWithoutChildren(b,C),E=function W(D,q,V,X){for(var et=q.length,z=0;z0){var Q=void 0;Q=V.getGraphManager().add(V.newGraph(),B),W(Q,H,V,X)}}},y=function(D,q,V){for(var X=0,et=0,z=0;z0?f.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=X/et:n(v.idealEdgeLength)?f.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=50:f.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=v.idealEdgeLength,f.MIN_REPULSION_DIST=c.MIN_REPULSION_DIST=c.DEFAULT_EDGE_LENGTH/10,f.DEFAULT_RADIAL_SEPARATION=c.DEFAULT_EDGE_LENGTH)},R=function(D,q){q.fixedNodeConstraint&&(D.constraints.fixedNodeConstraint=q.fixedNodeConstraint),q.alignmentConstraint&&(D.constraints.alignmentConstraint=q.alignmentConstraint),q.relativePlacementConstraint&&(D.constraints.relativePlacementConstraint=q.relativePlacementConstraint)};v.nestingFactor!=null&&(f.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=c.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=v.nestingFactor),v.gravity!=null&&(f.DEFAULT_GRAVITY_STRENGTH=c.DEFAULT_GRAVITY_STRENGTH=v.gravity),v.numIter!=null&&(f.MAX_ITERATIONS=c.MAX_ITERATIONS=v.numIter),v.gravityRange!=null&&(f.DEFAULT_GRAVITY_RANGE_FACTOR=c.DEFAULT_GRAVITY_RANGE_FACTOR=v.gravityRange),v.gravityCompound!=null&&(f.DEFAULT_COMPOUND_GRAVITY_STRENGTH=c.DEFAULT_COMPOUND_GRAVITY_STRENGTH=v.gravityCompound),v.gravityRangeCompound!=null&&(f.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=c.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=v.gravityRangeCompound),v.initialEnergyOnIncremental!=null&&(f.DEFAULT_COOLING_FACTOR_INCREMENTAL=c.DEFAULT_COOLING_FACTOR_INCREMENTAL=v.initialEnergyOnIncremental),v.tilingCompareBy!=null&&(f.TILING_COMPARE_BY=v.tilingCompareBy),v.quality=="proof"?s.QUALITY=2:s.QUALITY=0,f.NODE_DIMENSIONS_INCLUDE_LABELS=c.NODE_DIMENSIONS_INCLUDE_LABELS=s.NODE_DIMENSIONS_INCLUDE_LABELS=v.nodeDimensionsIncludeLabels,f.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=s.DEFAULT_INCREMENTAL=!v.randomize,f.ANIMATE=c.ANIMATE=s.ANIMATE=v.animate,f.TILE=v.tile,f.TILING_PADDING_VERTICAL=typeof v.tilingPaddingVertical=="function"?v.tilingPaddingVertical.call():v.tilingPaddingVertical,f.TILING_PADDING_HORIZONTAL=typeof v.tilingPaddingHorizontal=="function"?v.tilingPaddingHorizontal.call():v.tilingPaddingHorizontal,f.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=s.DEFAULT_INCREMENTAL=!0,f.PURE_INCREMENTAL=!v.randomize,s.DEFAULT_UNIFORM_LEAF_NODE_SIZES=v.uniformNodeDimensions,v.step=="transformed"&&(f.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,f.ENFORCE_CONSTRAINTS=!1,f.APPLY_LAYOUT=!1),v.step=="enforced"&&(f.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,f.ENFORCE_CONSTRAINTS=!0,f.APPLY_LAYOUT=!1),v.step=="cose"&&(f.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,f.ENFORCE_CONSTRAINTS=!1,f.APPLY_LAYOUT=!0),v.step=="all"&&(v.randomize?f.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:f.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,f.ENFORCE_CONSTRAINTS=!0,f.APPLY_LAYOUT=!0),v.fixedNodeConstraint||v.alignmentConstraint||v.relativePlacementConstraint?f.TREE_REDUCTION_ON_INCREMENTAL=!1:f.TREE_REDUCTION_ON_INCREMENTAL=!0;var M=new i,S=M.newGraphManager();return E(S.addRoot(),l.getTopMostNodes(G),M,v),y(M,S,k),R(M,v),M.runLayout(),it};a.exports={coseLayout:T}}),212:((a,e,r)=>{var l=(function(){function v(L,b){for(var C=0;C0)if(p){var R=t.getTopMostNodes(C.eles.nodes());if(O=t.connectComponents(G,C.eles,R),O.forEach(function(vt){var rt=vt.boundingBox();it.push({x:rt.x1+rt.w/2,y:rt.y1+rt.h/2})}),C.randomize&&O.forEach(function(vt){C.eles=vt,Y.push(s(C))}),C.quality=="default"||C.quality=="proof"){var M=G.collection();if(C.tile){var S=new Map,W=[],D=[],q=0,V={nodeIndexes:S,xCoords:W,yCoords:D},X=[];if(O.forEach(function(vt,rt){vt.edges().length==0&&(vt.nodes().forEach(function(gt,mt){M.merge(vt.nodes()[mt]),gt.isParent()||(V.nodeIndexes.set(vt.nodes()[mt].id(),q++),V.xCoords.push(vt.nodes()[0].position().x),V.yCoords.push(vt.nodes()[0].position().y))}),X.push(rt))}),M.length>1){var et=M.boundingBox();it.push({x:et.x1+et.w/2,y:et.y1+et.h/2}),O.push(M),Y.push(V);for(var z=X.length-1;z>=0;z--)O.splice(X[z],1),Y.splice(X[z],1),it.splice(X[z],1)}}O.forEach(function(vt,rt){C.eles=vt,K.push(f(C,Y[rt])),t.relocateComponent(it[rt],K[rt],C)})}else O.forEach(function(vt,rt){t.relocateComponent(it[rt],Y[rt],C)});var w=new Set;if(O.length>1){var H=[],B=k.filter(function(vt){return vt.css("display")=="none"});O.forEach(function(vt,rt){var gt=void 0;if(C.quality=="draft"&&(gt=Y[rt].nodeIndexes),vt.nodes().not(B).length>0){var mt={};mt.edges=[],mt.nodes=[];var At=void 0;vt.nodes().not(B).forEach(function(Ot){if(C.quality=="draft")if(!Ot.isParent())At=gt.get(Ot.id()),mt.nodes.push({x:Y[rt].xCoords[At]-Ot.boundingbox().w/2,y:Y[rt].yCoords[At]-Ot.boundingbox().h/2,width:Ot.boundingbox().w,height:Ot.boundingbox().h});else{var Et=t.calcBoundingBox(Ot,Y[rt].xCoords,Y[rt].yCoords,gt);mt.nodes.push({x:Et.topLeftX,y:Et.topLeftY,width:Et.width,height:Et.height})}else K[rt][Ot.id()]&&mt.nodes.push({x:K[rt][Ot.id()].getLeft(),y:K[rt][Ot.id()].getTop(),width:K[rt][Ot.id()].getWidth(),height:K[rt][Ot.id()].getHeight()})}),vt.edges().forEach(function(Ot){var Et=Ot.source(),Dt=Ot.target();if(Et.css("display")!="none"&&Dt.css("display")!="none")if(C.quality=="draft"){var Rt=gt.get(Et.id()),Ht=gt.get(Dt.id()),Ut=[],Pt=[];if(Et.isParent()){var Ft=t.calcBoundingBox(Et,Y[rt].xCoords,Y[rt].yCoords,gt);Ut.push(Ft.topLeftX+Ft.width/2),Ut.push(Ft.topLeftY+Ft.height/2)}else Ut.push(Y[rt].xCoords[Rt]),Ut.push(Y[rt].yCoords[Rt]);if(Dt.isParent()){var Yt=t.calcBoundingBox(Dt,Y[rt].xCoords,Y[rt].yCoords,gt);Pt.push(Yt.topLeftX+Yt.width/2),Pt.push(Yt.topLeftY+Yt.height/2)}else Pt.push(Y[rt].xCoords[Ht]),Pt.push(Y[rt].yCoords[Ht]);mt.edges.push({startX:Ut[0],startY:Ut[1],endX:Pt[0],endY:Pt[1]})}else K[rt][Et.id()]&&K[rt][Dt.id()]&&mt.edges.push({startX:K[rt][Et.id()].getCenterX(),startY:K[rt][Et.id()].getCenterY(),endX:K[rt][Dt.id()].getCenterX(),endY:K[rt][Dt.id()].getCenterY()})}),mt.nodes.length>0&&(H.push(mt),w.add(rt))}});var _=m.packComponents(H,C.randomize).shifts;if(C.quality=="draft")Y.forEach(function(vt,rt){var gt=vt.xCoords.map(function(At){return At+_[rt].dx}),mt=vt.yCoords.map(function(At){return At+_[rt].dy});vt.xCoords=gt,vt.yCoords=mt});else{var ht=0;w.forEach(function(vt){Object.keys(K[vt]).forEach(function(rt){var gt=K[vt][rt];gt.setCenter(gt.getCenterX()+_[ht].dx,gt.getCenterY()+_[ht].dy)}),ht++})}}}else{var E=C.eles.boundingBox();if(it.push({x:E.x1+E.w/2,y:E.y1+E.h/2}),C.randomize){var y=s(C);Y.push(y)}C.quality=="default"||C.quality=="proof"?(K.push(f(C,Y[0])),t.relocateComponent(it[0],K[0],C)):t.relocateComponent(it[0],Y[0],C)}var Q=function(rt,gt){if(C.quality=="default"||C.quality=="proof"){typeof rt=="number"&&(rt=gt);var mt=void 0,At=void 0,Ot=rt.data("id");return K.forEach(function(Dt){Ot in Dt&&(mt={x:Dt[Ot].getRect().getCenterX(),y:Dt[Ot].getRect().getCenterY()},At=Dt[Ot])}),C.nodeDimensionsIncludeLabels&&(At.labelWidth&&(At.labelPosHorizontal=="left"?mt.x+=At.labelWidth/2:At.labelPosHorizontal=="right"&&(mt.x-=At.labelWidth/2)),At.labelHeight&&(At.labelPosVertical=="top"?mt.y+=At.labelHeight/2:At.labelPosVertical=="bottom"&&(mt.y-=At.labelHeight/2))),mt==null&&(mt={x:rt.position("x"),y:rt.position("y")}),{x:mt.x,y:mt.y}}else{var Et=void 0;return Y.forEach(function(Dt){var Rt=Dt.nodeIndexes.get(rt.id());Rt!=null&&(Et={x:Dt.xCoords[Rt],y:Dt.yCoords[Rt]})}),Et==null&&(Et={x:rt.position("x"),y:rt.position("y")}),{x:Et.x,y:Et.y}}};if(C.quality=="default"||C.quality=="proof"||C.randomize){var It=t.calcParentsWithoutChildren(G,k),Nt=k.filter(function(vt){return vt.css("display")=="none"});C.eles=k.not(Nt),k.nodes().not(":parent").not(Nt).layoutPositions(b,C,Q),It.length>0&&It.forEach(function(vt){vt.position(Q(vt))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),v})();a.exports=d}),657:((a,e,r)=>{var l=r(548),i=r(140).layoutBase.Matrix,g=r(140).layoutBase.SVD,t=function(s){var c=s.cy,f=s.eles,T=f.nodes(),d=f.nodes(":parent"),v=new Map,L=new Map,b=new Map,C=[],G=[],k=[],Y=[],K=[],O=[],it=[],n=[],m=void 0,p=1e8,E=1e-9,y=s.piTol,R=s.samplingType,M=s.nodeSeparation,S=void 0,W=function(){for(var U=0,$=0,J=!1;$=at;){nt=Z[at++];for(var xt=C[nt],lt=0;ltut&&(ut=K[Lt],Mt=Lt)}return Mt},q=function(U){var $=void 0;if(U){$=Math.floor(Math.random()*m);for(var Z=0;Z=1)break;j=tt}for(var pt=0;pt=1)break;j=tt}for(var lt=0;lt0&&($.isParent()?C[U].push(b.get($.id())):C[U].push($.id()))})});var Nt=function(U){var $=L.get(U),J=void 0;v.get(U).forEach(function(Z){c.getElementById(Z).isParent()?J=b.get(Z):J=Z,C[$].push(J),C[L.get(J)].push(U)})},vt=!0,rt=!1,gt=void 0;try{for(var mt=v.keys()[Symbol.iterator](),At;!(vt=(At=mt.next()).done);vt=!0){var Ot=At.value;Nt(Ot)}}catch(F){rt=!0,gt=F}finally{try{!vt&&mt.return&&mt.return()}finally{if(rt)throw gt}}m=L.size;var Et=void 0;if(m>2){S=m{var l=r(212),i=function(t){t&&t("layout","fcose",l)};typeof cytoscape<"u"&&i(cytoscape),a.exports=i}),140:(a=>{a.exports=A})},N={};function u(a){var e=N[a];if(e!==void 0)return e.exports;var r=N[a]={exports:{}};return P[a](r,r.exports,u),r.exports}var h=u(579);return h})()})})(he)),he.exports}var Er=yr();const mr=Ze(Er);var xe={L:"left",R:"right",T:"top",B:"bottom"},Ie={L:dt(I=>`${I},${I/2} 0,${I} 0,0`,"L"),R:dt(I=>`0,${I/2} ${I},0 ${I},${I}`,"R"),T:dt(I=>`0,0 ${I},0 ${I/2},${I}`,"T"),B:dt(I=>`${I/2},0 ${I},${I} 0,${I}`,"B")},se={L:dt((I,x)=>I-x+2,"L"),R:dt((I,x)=>I-2,"R"),T:dt((I,x)=>I-x+2,"T"),B:dt((I,x)=>I-2,"B")},Tr=dt(function(I){return Wt(I)?I==="L"?"R":"L":I==="T"?"B":"T"},"getOppositeArchitectureDirection"),Re=dt(function(I){const x=I;return x==="L"||x==="R"||x==="T"||x==="B"},"isArchitectureDirection"),Wt=dt(function(I){const x=I;return x==="L"||x==="R"},"isArchitectureDirectionX"),qt=dt(function(I){const x=I;return x==="T"||x==="B"},"isArchitectureDirectionY"),Te=dt(function(I,x){const A=Wt(I)&&qt(x),P=qt(I)&&Wt(x);return A||P},"isArchitectureDirectionXY"),Nr=dt(function(I){const x=I[0],A=I[1],P=Wt(x)&&qt(A),N=qt(x)&&Wt(A);return P||N},"isArchitecturePairXY"),Lr=dt(function(I){return I!=="LL"&&I!=="RR"&&I!=="TT"&&I!=="BB"},"isValidArchitectureDirectionPair"),ye=dt(function(I,x){const A=`${I}${x}`;return Lr(A)?A:void 0},"getArchitectureDirectionPair"),Cr=dt(function([I,x],A){const P=A[0],N=A[1];return Wt(P)?qt(N)?[I+(P==="L"?-1:1),x+(N==="T"?1:-1)]:[I+(P==="L"?-1:1),x]:Wt(N)?[I+(N==="L"?1:-1),x+(P==="T"?1:-1)]:[I,x+(P==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),Ar=dt(function(I){return I==="LT"||I==="TL"?[1,1]:I==="BL"||I==="LB"?[1,-1]:I==="BR"||I==="RB"?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),Mr=dt(function(I,x){return Te(I,x)?"bend":Wt(I)?"horizontal":"vertical"},"getArchitectureDirectionAlignment"),wr=dt(function(I){return I.type==="service"},"isArchitectureService"),Or=dt(function(I){return I.type==="junction"},"isArchitectureJunction"),be=dt(I=>I.data(),"edgeData"),ie=dt(I=>I.data(),"nodeData"),Dr=ar.architecture,ae,Pe=(ae=class{constructor(){this.nodes={},this.groups={},this.edges=[],this.registeredIds={},this.elements={},this.setAccTitle=Qe,this.getAccTitle=Je,this.setDiagramTitle=Ke,this.getDiagramTitle=je,this.getAccDescription=_e,this.setAccDescription=tr,this.clear()}clear(){this.nodes={},this.groups={},this.edges=[],this.registeredIds={},this.dataStructures=void 0,this.elements={},er()}addService({id:x,icon:A,in:P,title:N,iconText:u}){if(this.registeredIds[x]!==void 0)throw new Error(`The service id [${x}] is already in use by another ${this.registeredIds[x]}`);if(P!==void 0){if(x===P)throw new Error(`The service [${x}] cannot be placed within itself`);if(this.registeredIds[P]===void 0)throw new Error(`The service [${x}]'s parent does not exist. Please make sure the parent is created before this service`);if(this.registeredIds[P]==="node")throw new Error(`The service [${x}]'s parent is not a group`)}this.registeredIds[x]="node",this.nodes[x]={id:x,type:"service",icon:A,iconText:u,title:N,edges:[],in:P}}getServices(){return Object.values(this.nodes).filter(wr)}addJunction({id:x,in:A}){this.registeredIds[x]="node",this.nodes[x]={id:x,type:"junction",edges:[],in:A}}getJunctions(){return Object.values(this.nodes).filter(Or)}getNodes(){return Object.values(this.nodes)}getNode(x){return this.nodes[x]??null}addGroup({id:x,icon:A,in:P,title:N}){if(this.registeredIds?.[x]!==void 0)throw new Error(`The group id [${x}] is already in use by another ${this.registeredIds[x]}`);if(P!==void 0){if(x===P)throw new Error(`The group [${x}] cannot be placed within itself`);if(this.registeredIds?.[P]===void 0)throw new Error(`The group [${x}]'s parent does not exist. Please make sure the parent is created before this group`);if(this.registeredIds?.[P]==="node")throw new Error(`The group [${x}]'s parent is not a group`)}this.registeredIds[x]="group",this.groups[x]={id:x,icon:A,title:N,in:P}}getGroups(){return Object.values(this.groups)}addEdge({lhsId:x,rhsId:A,lhsDir:P,rhsDir:N,lhsInto:u,rhsInto:h,lhsGroup:a,rhsGroup:e,title:r}){if(!Re(P))throw new Error(`Invalid direction given for left hand side of edge ${x}--${A}. Expected (L,R,T,B) got ${String(P)}`);if(!Re(N))throw new Error(`Invalid direction given for right hand side of edge ${x}--${A}. Expected (L,R,T,B) got ${String(N)}`);if(this.nodes[x]===void 0&&this.groups[x]===void 0)throw new Error(`The left-hand id [${x}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(this.nodes[A]===void 0&&this.groups[A]===void 0)throw new Error(`The right-hand id [${A}] does not yet exist. Please create the service/group before declaring an edge to it.`);const l=this.nodes[x].in,i=this.nodes[A].in;if(a&&l&&i&&l==i)throw new Error(`The left-hand id [${x}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(e&&l&&i&&l==i)throw new Error(`The right-hand id [${A}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);const g={lhsId:x,lhsDir:P,lhsInto:u,lhsGroup:a,rhsId:A,rhsDir:N,rhsInto:h,rhsGroup:e,title:r};this.edges.push(g),this.nodes[x]&&this.nodes[A]&&(this.nodes[x].edges.push(this.edges[this.edges.length-1]),this.nodes[A].edges.push(this.edges[this.edges.length-1]))}getEdges(){return this.edges}getDataStructures(){if(this.dataStructures===void 0){const x={},A=Object.entries(this.nodes).reduce((e,[r,l])=>(e[r]=l.edges.reduce((i,g)=>{const t=this.getNode(g.lhsId)?.in,o=this.getNode(g.rhsId)?.in;if(t&&o&&t!==o){const s=Mr(g.lhsDir,g.rhsDir);s!=="bend"&&(x[t]??={},x[t][o]=s,x[o]??={},x[o][t]=s)}if(g.lhsId===r){const s=ye(g.lhsDir,g.rhsDir);s&&(i[s]=g.rhsId)}else{const s=ye(g.rhsDir,g.lhsDir);s&&(i[s]=g.lhsId)}return i},{}),e),{}),P=Object.keys(A)[0],N={[P]:1},u=Object.keys(A).reduce((e,r)=>r===P?e:{...e,[r]:1},{}),h=dt(e=>{const r={[e]:[0,0]},l=[e];for(;l.length>0;){const i=l.shift();if(i){N[i]=1,delete u[i];const g=A[i],[t,o]=r[i];Object.entries(g).forEach(([s,c])=>{N[c]||(r[c]=Cr([t,o],s),l.push(c))})}}return r},"BFS"),a=[h(P)];for(;Object.keys(u).length>0;)a.push(h(Object.keys(u)[0]));this.dataStructures={adjList:A,spatialMaps:a,groupAlignments:x}}return this.dataStructures}setElementForId(x,A){this.elements[x]=A}getElementById(x){return this.elements[x]}getConfig(){return rr({...Dr,...ir().architecture})}getConfigField(x){return this.getConfig()[x]}},dt(ae,"ArchitectureDB"),ae),xr=dt((I,x)=>{fr(I,x),I.groups.map(A=>x.addGroup(A)),I.services.map(A=>x.addService({...A,type:"service"})),I.junctions.map(A=>x.addJunction({...A,type:"junction"})),I.edges.map(A=>x.addEdge(A))},"populateDb"),Ge={parser:{yy:void 0},parse:dt(async I=>{const x=await cr("architecture",I);Se.debug(x);const A=Ge.parser?.yy;if(!(A instanceof Pe))throw new Error("parser.parser?.yy was not a ArchitectureDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");xr(x,A)},"parse")},Ir=dt(I=>`
+ .edge {
+ stroke-width: ${I.archEdgeWidth};
+ stroke: ${I.archEdgeColor};
+ fill: none;
+ }
+
+ .arrow {
+ fill: ${I.archEdgeArrowColor};
+ }
+
+ .node-bkg {
+ fill: none;
+ stroke: ${I.archGroupBorderColor};
+ stroke-width: ${I.archGroupBorderWidth};
+ stroke-dasharray: 8;
+ }
+ .node-icon-text {
+ display: flex;
+ align-items: center;
+ }
+
+ .node-icon-text > div {
+ color: #fff;
+ margin: 1px;
+ height: fit-content;
+ text-align: center;
+ overflow: hidden;
+ display: -webkit-box;
+ -webkit-box-orient: vertical;
+ }
+`,"getStyles"),Rr=Ir,re=dt(I=>`${I}`,"wrapIcon"),ne={prefix:"mermaid-architecture",height:80,width:80,icons:{database:{body:re('')},server:{body:re('')},disk:{body:re('')},internet:{body:re('')},cloud:{body:re('')},unknown:lr,blank:{body:re("")}}},Sr=dt(async function(I,x,A){const P=A.getConfigField("padding"),N=A.getConfigField("iconSize"),u=N/2,h=N/6,a=h/2;await Promise.all(x.edges().map(async e=>{const{source:r,sourceDir:l,sourceArrow:i,sourceGroup:g,target:t,targetDir:o,targetArrow:s,targetGroup:c,label:f}=be(e);let{x:T,y:d}=e[0].sourceEndpoint();const{x:v,y:L}=e[0].midpoint();let{x:b,y:C}=e[0].targetEndpoint();const G=P+4;if(g&&(Wt(l)?T+=l==="L"?-G:G:d+=l==="T"?-G:G+18),c&&(Wt(o)?b+=o==="L"?-G:G:C+=o==="T"?-G:G+18),!g&&A.getNode(r)?.type==="junction"&&(Wt(l)?T+=l==="L"?u:-u:d+=l==="T"?u:-u),!c&&A.getNode(t)?.type==="junction"&&(Wt(o)?b+=o==="L"?u:-u:C+=o==="T"?u:-u),e[0]._private.rscratch){const k=I.insert("g");if(k.insert("path").attr("d",`M ${T},${d} L ${v},${L} L${b},${C} `).attr("class","edge").attr("id",sr(r,t,{prefix:"L"})),i){const Y=Wt(l)?se[l](T,h):T-a,K=qt(l)?se[l](d,h):d-a;k.insert("polygon").attr("points",Ie[l](h)).attr("transform",`translate(${Y},${K})`).attr("class","arrow")}if(s){const Y=Wt(o)?se[o](b,h):b-a,K=qt(o)?se[o](C,h):C-a;k.insert("polygon").attr("points",Ie[o](h)).attr("transform",`translate(${Y},${K})`).attr("class","arrow")}if(f){const Y=Te(l,o)?"XY":Wt(l)?"X":"Y";let K=0;Y==="X"?K=Math.abs(T-b):Y==="Y"?K=Math.abs(d-C)/1.5:K=Math.abs(T-b)/2;const O=k.append("g");if(await me(O,f,{useHtmlLabels:!1,width:K,classes:"architecture-service-label"},Ee()),O.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),Y==="X")O.attr("transform","translate("+v+", "+L+")");else if(Y==="Y")O.attr("transform","translate("+v+", "+L+") rotate(-90)");else if(Y==="XY"){const it=ye(l,o);if(it&&Nr(it)){const n=O.node().getBoundingClientRect(),[m,p]=Ar(it);O.attr("dominant-baseline","auto").attr("transform",`rotate(${-1*m*p*45})`);const E=O.node().getBoundingClientRect();O.attr("transform",`
+ translate(${v}, ${L-n.height/2})
+ translate(${m*E.width/2}, ${p*E.height/2})
+ rotate(${-1*m*p*45}, 0, ${n.height/2})
+ `)}}}}}))},"drawEdges"),Fr=dt(async function(I,x,A){const N=A.getConfigField("padding")*.75,u=A.getConfigField("fontSize"),a=A.getConfigField("iconSize")/2;await Promise.all(x.nodes().map(async e=>{const r=ie(e);if(r.type==="group"){const{h:l,w:i,x1:g,y1:t}=e.boundingBox(),o=I.append("rect");o.attr("id",`group-${r.id}`).attr("x",g+a).attr("y",t+a).attr("width",i).attr("height",l).attr("class","node-bkg");const s=I.append("g");let c=g,f=t;if(r.icon){const T=s.append("g");T.html(`${await pe(r.icon,{height:N,width:N,fallbackPrefix:ne.prefix})}`),T.attr("transform","translate("+(c+a+1)+", "+(f+a+1)+")"),c+=N,f+=u/2-1-2}if(r.label){const T=s.append("g");await me(T,r.label,{useHtmlLabels:!1,width:i,classes:"architecture-service-label"},Ee()),T.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start"),T.attr("transform","translate("+(c+a+4)+", "+(f+a+2)+")")}A.setElementForId(r.id,o)}}))},"drawGroups"),br=dt(async function(I,x,A){const P=Ee();for(const N of A){const u=x.append("g"),h=I.getConfigField("iconSize");if(N.title){const l=u.append("g");await me(l,N.title,{useHtmlLabels:!1,width:h*1.5,classes:"architecture-service-label"},P),l.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),l.attr("transform","translate("+h/2+", "+h+")")}const a=u.append("g");if(N.icon)a.html(`${await pe(N.icon,{height:h,width:h,fallbackPrefix:ne.prefix})}`);else if(N.iconText){a.html(`${await pe("blank",{height:h,width:h,fallbackPrefix:ne.prefix})}`);const g=a.append("g").append("foreignObject").attr("width",h).attr("height",h).append("div").attr("class","node-icon-text").attr("style",`height: ${h}px;`).append("div").html(nr(N.iconText,P)),t=parseInt(window.getComputedStyle(g.node(),null).getPropertyValue("font-size").replace(/\D/g,""))??16;g.attr("style",`-webkit-line-clamp: ${Math.floor((h-2)/t)};`)}else a.append("path").attr("class","node-bkg").attr("id","node-"+N.id).attr("d",`M0 ${h} v${-h} q0,-5 5,-5 h${h} q5,0 5,5 v${h} H0 Z`);u.attr("id",`service-${N.id}`).attr("class","architecture-service");const{width:e,height:r}=u.node().getBBox();N.width=e,N.height=r,I.setElementForId(N.id,u)}return 0},"drawServices"),Pr=dt(function(I,x,A){A.forEach(P=>{const N=x.append("g"),u=I.getConfigField("iconSize");N.append("g").append("rect").attr("id","node-"+P.id).attr("fill-opacity","0").attr("width",u).attr("height",u),N.attr("class","architecture-junction");const{width:a,height:e}=N._groups[0][0].getBBox();N.width=a,N.height=e,I.setElementForId(P.id,N)})},"drawJunctions");hr([{name:ne.prefix,icons:ne}]);Fe.use(mr);function Ue(I,x,A){I.forEach(P=>{x.add({group:"nodes",data:{type:"service",id:P.id,icon:P.icon,label:P.title,parent:P.in,width:A.getConfigField("iconSize"),height:A.getConfigField("iconSize")},classes:"node-service"})})}dt(Ue,"addServices");function Ye(I,x,A){I.forEach(P=>{x.add({group:"nodes",data:{type:"junction",id:P.id,parent:P.in,width:A.getConfigField("iconSize"),height:A.getConfigField("iconSize")},classes:"node-junction"})})}dt(Ye,"addJunctions");function Xe(I,x){x.nodes().map(A=>{const P=ie(A);if(P.type==="group")return;P.x=A.position().x,P.y=A.position().y,I.getElementById(P.id).attr("transform","translate("+(P.x||0)+","+(P.y||0)+")")})}dt(Xe,"positionNodes");function He(I,x){I.forEach(A=>{x.add({group:"nodes",data:{type:"group",id:A.id,icon:A.icon,label:A.title,parent:A.in},classes:"node-group"})})}dt(He,"addGroups");function We(I,x){I.forEach(A=>{const{lhsId:P,rhsId:N,lhsInto:u,lhsGroup:h,rhsInto:a,lhsDir:e,rhsDir:r,rhsGroup:l,title:i}=A,g=Te(A.lhsDir,A.rhsDir)?"segments":"straight",t={id:`${P}-${N}`,label:i,source:P,sourceDir:e,sourceArrow:u,sourceGroup:h,sourceEndpoint:e==="L"?"0 50%":e==="R"?"100% 50%":e==="T"?"50% 0":"50% 100%",target:N,targetDir:r,targetArrow:a,targetGroup:l,targetEndpoint:r==="L"?"0 50%":r==="R"?"100% 50%":r==="T"?"50% 0":"50% 100%"};x.add({group:"edges",data:t,classes:g})})}dt(We,"addEdges");function Ve(I,x,A){const P=dt((a,e)=>Object.entries(a).reduce((r,[l,i])=>{let g=0;const t=Object.entries(i);if(t.length===1)return r[l]=t[0][1],r;for(let o=0;o{const e={},r={};return Object.entries(a).forEach(([l,[i,g]])=>{const t=I.getNode(l)?.in??"default";e[g]??={},e[g][t]??=[],e[g][t].push(l),r[i]??={},r[i][t]??=[],r[i][t].push(l)}),{horiz:Object.values(P(e,"horizontal")).filter(l=>l.length>1),vert:Object.values(P(r,"vertical")).filter(l=>l.length>1)}}),[u,h]=N.reduce(([a,e],{horiz:r,vert:l})=>[[...a,...r],[...e,...l]],[[],[]]);return{horizontal:u,vertical:h}}dt(Ve,"getAlignments");function ze(I,x){const A=[],P=dt(u=>`${u[0]},${u[1]}`,"posToStr"),N=dt(u=>u.split(",").map(h=>parseInt(h)),"strToPos");return I.forEach(u=>{const h=Object.fromEntries(Object.entries(u).map(([l,i])=>[P(i),l])),a=[P([0,0])],e={},r={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};for(;a.length>0;){const l=a.shift();if(l){e[l]=1;const i=h[l];if(i){const g=N(l);Object.entries(r).forEach(([t,o])=>{const s=P([g[0]+o[0],g[1]+o[1]]),c=h[s];c&&!e[s]&&(a.push(s),A.push({[xe[t]]:c,[xe[Tr(t)]]:i,gap:1.5*x.getConfigField("iconSize")}))})}}}}),A}dt(ze,"getRelativeConstraints");function Be(I,x,A,P,N,{spatialMaps:u,groupAlignments:h}){return new Promise(a=>{const e=or("body").append("div").attr("id","cy").attr("style","display:none"),r=Fe({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"straight",label:"data(label)","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"edge.segments",style:{"curve-style":"segments","segment-weights":"0","segment-distances":[.5],"edge-distances":"endpoints","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"node",style:{"compound-sizing-wrt-labels":"include"}},{selector:"node[label]",style:{"text-valign":"bottom","text-halign":"center","font-size":`${N.getConfigField("fontSize")}px`}},{selector:".node-service",style:{label:"data(label)",width:"data(width)",height:"data(height)"}},{selector:".node-junction",style:{width:"data(width)",height:"data(height)"}},{selector:".node-group",style:{padding:`${N.getConfigField("padding")}px`}}],layout:{name:"grid",boundingBox:{x1:0,x2:100,y1:0,y2:100}}});e.remove(),He(A,r),Ue(I,r,N),Ye(x,r,N),We(P,r);const l=Ve(N,u,h),i=ze(u,N),g=r.layout({name:"fcose",quality:"proof",styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1,idealEdgeLength(t){const[o,s]=t.connectedNodes(),{parent:c}=ie(o),{parent:f}=ie(s);return c===f?1.5*N.getConfigField("iconSize"):.5*N.getConfigField("iconSize")},edgeElasticity(t){const[o,s]=t.connectedNodes(),{parent:c}=ie(o),{parent:f}=ie(s);return c===f?.45:.001},alignmentConstraint:l,relativePlacementConstraint:i});g.one("layoutstop",()=>{function t(o,s,c,f){let T,d;const{x:v,y:L}=o,{x:b,y:C}=s;d=(f-L+(v-c)*(L-C)/(v-b))/Math.sqrt(1+Math.pow((L-C)/(v-b),2)),T=Math.sqrt(Math.pow(f-L,2)+Math.pow(c-v,2)-Math.pow(d,2));const G=Math.sqrt(Math.pow(b-v,2)+Math.pow(C-L,2));T=T/G;let k=(b-v)*(f-L)-(C-L)*(c-v);switch(!0){case k>=0:k=1;break;case k<0:k=-1;break}let Y=(b-v)*(c-v)+(C-L)*(f-L);switch(!0){case Y>=0:Y=1;break;case Y<0:Y=-1;break}return d=Math.abs(d)*k,T=T*Y,{distances:d,weights:T}}dt(t,"getSegmentWeights"),r.startBatch();for(const o of Object.values(r.edges()))if(o.data?.()){const{x:s,y:c}=o.source().position(),{x:f,y:T}=o.target().position();if(s!==f&&c!==T){const d=o.sourceEndpoint(),v=o.targetEndpoint(),{sourceDir:L}=be(o),[b,C]=qt(L)?[d.x,v.y]:[v.x,d.y],{weights:G,distances:k}=t(d,v,b,C);o.style("segment-distances",k),o.style("segment-weights",G)}}r.endBatch(),g.run()}),g.run(),r.ready(t=>{Se.info("Ready",t),a(r)})})}dt(Be,"layoutArchitecture");var Gr=dt(async(I,x,A,P)=>{const N=P.db,u=N.getServices(),h=N.getJunctions(),a=N.getGroups(),e=N.getEdges(),r=N.getDataStructures(),l=ke(x),i=l.append("g");i.attr("class","architecture-edges");const g=l.append("g");g.attr("class","architecture-services");const t=l.append("g");t.attr("class","architecture-groups"),await br(N,g,u),Pr(N,g,h);const o=await Be(u,h,a,e,N,r);await Sr(i,o,N),await Fr(t,o,N),Xe(N,o),qe(void 0,l,N.getConfigField("padding"),N.getConfigField("useMaxWidth"))},"draw"),Ur={draw:Gr},qr={parser:Ge,get db(){return new Pe},renderer:Ur,styles:Rr};export{qr as diagram};
diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/authStore-BJzDjplU.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/authStore-BJzDjplU.js
new file mode 100644
index 0000000000..29d7c86c6a
--- /dev/null
+++ b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/authStore-BJzDjplU.js
@@ -0,0 +1 @@
+import{s,t as r}from"./index-DpOBiJiD.js";const i=s(r(t=>({user:null,isAuthenticated:!1,hasHydrated:!1,login:e=>t(a=>{a.user=e,a.isAuthenticated=!0}),logout:()=>t(e=>{e.user=null,e.isAuthenticated=!1}),setHydrated:()=>t(e=>{e.hasHydrated=!0})})));export{i as a};
diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/authStore-BfGlL8rp.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/authStore-BfGlL8rp.js
deleted file mode 100644
index 023e09cb93..0000000000
--- a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/authStore-BfGlL8rp.js
+++ /dev/null
@@ -1 +0,0 @@
-import{bu as s,bv as r}from"./index-BZLU40Mk.js";const i=s(r(t=>({user:null,isAuthenticated:!1,hasHydrated:!1,login:e=>t(a=>{a.user=e,a.isAuthenticated=!0}),logout:()=>t(e=>{e.user=null,e.isAuthenticated=!1}),setHydrated:()=>t(e=>{e.hasHydrated=!0})})));export{i as a};
diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/blockDiagram-VD42YOAC-U9iGLyTC.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/blockDiagram-VD42YOAC-U9iGLyTC.js
new file mode 100644
index 0000000000..e69f24a858
--- /dev/null
+++ b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/blockDiagram-VD42YOAC-U9iGLyTC.js
@@ -0,0 +1,122 @@
+import{g as oe}from"./chunk-FMBD7UC4-fSM8np9_.js";import{_ as d,a5 as rt,B as O,G as he,E as L,$ as de,a1 as ge,z as R,aS as ue,ai as pe,aj as fe,af as xe,aT as j,aU as Wt,aV as ye,T as $,O as be,aW as we,aX as xt,L as yt,aY as me}from"./index-DpOBiJiD.js";import{c as Le}from"./clone-CQ2NOoIB.js";import{G as Se}from"./graph-C2pZo5Z6.js";import{c as ke}from"./channel-D6izjHHp.js";import"./forEach-CTOHlvm6.js";import"./isUndefined-B80uo2Th.js";import"./union-CR4sFk7V.js";var bt=(function(){var e=d(function(D,y,g,f){for(g=g||{},f=D.length;f--;g[D[f]]=y);return g},"o"),t=[1,15],a=[1,7],i=[1,13],l=[1,14],s=[1,19],r=[1,16],n=[1,17],c=[1,18],u=[8,30],o=[8,10,21,28,29,30,31,39,43,46],x=[1,23],w=[1,24],b=[8,10,15,16,21,28,29,30,31,39,43,46],S=[8,10,15,16,21,27,28,29,30,31,39,43,46],v=[1,49],k={trace:d(function(){},"trace"),yy:{},symbols_:{error:2,spaceLines:3,SPACELINE:4,NL:5,separator:6,SPACE:7,EOF:8,start:9,BLOCK_DIAGRAM_KEY:10,document:11,stop:12,statement:13,link:14,LINK:15,START_LINK:16,LINK_LABEL:17,STR:18,nodeStatement:19,columnsStatement:20,SPACE_BLOCK:21,blockStatement:22,classDefStatement:23,cssClassStatement:24,styleStatement:25,node:26,SIZE:27,COLUMNS:28,"id-block":29,end:30,NODE_ID:31,nodeShapeNLabel:32,dirList:33,DIR:34,NODE_DSTART:35,NODE_DEND:36,BLOCK_ARROW_START:37,BLOCK_ARROW_END:38,classDef:39,CLASSDEF_ID:40,CLASSDEF_STYLEOPTS:41,DEFAULT:42,class:43,CLASSENTITY_IDS:44,STYLECLASS:45,style:46,STYLE_ENTITY_IDS:47,STYLE_DEFINITION_DATA:48,$accept:0,$end:1},terminals_:{2:"error",4:"SPACELINE",5:"NL",7:"SPACE",8:"EOF",10:"BLOCK_DIAGRAM_KEY",15:"LINK",16:"START_LINK",17:"LINK_LABEL",18:"STR",21:"SPACE_BLOCK",27:"SIZE",28:"COLUMNS",29:"id-block",30:"end",31:"NODE_ID",34:"DIR",35:"NODE_DSTART",36:"NODE_DEND",37:"BLOCK_ARROW_START",38:"BLOCK_ARROW_END",39:"classDef",40:"CLASSDEF_ID",41:"CLASSDEF_STYLEOPTS",42:"DEFAULT",43:"class",44:"CLASSENTITY_IDS",45:"STYLECLASS",46:"style",47:"STYLE_ENTITY_IDS",48:"STYLE_DEFINITION_DATA"},productions_:[0,[3,1],[3,2],[3,2],[6,1],[6,1],[6,1],[9,3],[12,1],[12,1],[12,2],[12,2],[11,1],[11,2],[14,1],[14,4],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[19,3],[19,2],[19,1],[20,1],[22,4],[22,3],[26,1],[26,2],[33,1],[33,2],[32,3],[32,4],[23,3],[23,3],[24,3],[25,3]],performAction:d(function(y,g,f,m,E,h,W){var p=h.length-1;switch(E){case 4:m.getLogger().debug("Rule: separator (NL) ");break;case 5:m.getLogger().debug("Rule: separator (Space) ");break;case 6:m.getLogger().debug("Rule: separator (EOF) ");break;case 7:m.getLogger().debug("Rule: hierarchy: ",h[p-1]),m.setHierarchy(h[p-1]);break;case 8:m.getLogger().debug("Stop NL ");break;case 9:m.getLogger().debug("Stop EOF ");break;case 10:m.getLogger().debug("Stop NL2 ");break;case 11:m.getLogger().debug("Stop EOF2 ");break;case 12:m.getLogger().debug("Rule: statement: ",h[p]),typeof h[p].length=="number"?this.$=h[p]:this.$=[h[p]];break;case 13:m.getLogger().debug("Rule: statement #2: ",h[p-1]),this.$=[h[p-1]].concat(h[p]);break;case 14:m.getLogger().debug("Rule: link: ",h[p],y),this.$={edgeTypeStr:h[p],label:""};break;case 15:m.getLogger().debug("Rule: LABEL link: ",h[p-3],h[p-1],h[p]),this.$={edgeTypeStr:h[p],label:h[p-1]};break;case 18:const I=parseInt(h[p]),Z=m.generateId();this.$={id:Z,type:"space",label:"",width:I,children:[]};break;case 23:m.getLogger().debug("Rule: (nodeStatement link node) ",h[p-2],h[p-1],h[p]," typestr: ",h[p-1].edgeTypeStr);const V=m.edgeStrToEdgeData(h[p-1].edgeTypeStr);this.$=[{id:h[p-2].id,label:h[p-2].label,type:h[p-2].type,directions:h[p-2].directions},{id:h[p-2].id+"-"+h[p].id,start:h[p-2].id,end:h[p].id,label:h[p-1].label,type:"edge",directions:h[p].directions,arrowTypeEnd:V,arrowTypeStart:"arrow_open"},{id:h[p].id,label:h[p].label,type:m.typeStr2Type(h[p].typeStr),directions:h[p].directions}];break;case 24:m.getLogger().debug("Rule: nodeStatement (abc88 node size) ",h[p-1],h[p]),this.$={id:h[p-1].id,label:h[p-1].label,type:m.typeStr2Type(h[p-1].typeStr),directions:h[p-1].directions,widthInColumns:parseInt(h[p],10)};break;case 25:m.getLogger().debug("Rule: nodeStatement (node) ",h[p]),this.$={id:h[p].id,label:h[p].label,type:m.typeStr2Type(h[p].typeStr),directions:h[p].directions,widthInColumns:1};break;case 26:m.getLogger().debug("APA123",this?this:"na"),m.getLogger().debug("COLUMNS: ",h[p]),this.$={type:"column-setting",columns:h[p]==="auto"?-1:parseInt(h[p])};break;case 27:m.getLogger().debug("Rule: id-block statement : ",h[p-2],h[p-1]),m.generateId(),this.$={...h[p-2],type:"composite",children:h[p-1]};break;case 28:m.getLogger().debug("Rule: blockStatement : ",h[p-2],h[p-1],h[p]);const at=m.generateId();this.$={id:at,type:"composite",label:"",children:h[p-1]};break;case 29:m.getLogger().debug("Rule: node (NODE_ID separator): ",h[p]),this.$={id:h[p]};break;case 30:m.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",h[p-1],h[p]),this.$={id:h[p-1],label:h[p].label,typeStr:h[p].typeStr,directions:h[p].directions};break;case 31:m.getLogger().debug("Rule: dirList: ",h[p]),this.$=[h[p]];break;case 32:m.getLogger().debug("Rule: dirList: ",h[p-1],h[p]),this.$=[h[p-1]].concat(h[p]);break;case 33:m.getLogger().debug("Rule: nodeShapeNLabel: ",h[p-2],h[p-1],h[p]),this.$={typeStr:h[p-2]+h[p],label:h[p-1]};break;case 34:m.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",h[p-3],h[p-2]," #3:",h[p-1],h[p]),this.$={typeStr:h[p-3]+h[p],label:h[p-2],directions:h[p-1]};break;case 35:case 36:this.$={type:"classDef",id:h[p-1].trim(),css:h[p].trim()};break;case 37:this.$={type:"applyClass",id:h[p-1].trim(),styleClass:h[p].trim()};break;case 38:this.$={type:"applyStyles",id:h[p-1].trim(),stylesStr:h[p].trim()};break}},"anonymous"),table:[{9:1,10:[1,2]},{1:[3]},{10:t,11:3,13:4,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:i,29:l,31:s,39:r,43:n,46:c},{8:[1,20]},e(u,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,10:t,21:a,28:i,29:l,31:s,39:r,43:n,46:c}),e(o,[2,16],{14:22,15:x,16:w}),e(o,[2,17]),e(o,[2,18]),e(o,[2,19]),e(o,[2,20]),e(o,[2,21]),e(o,[2,22]),e(b,[2,25],{27:[1,25]}),e(o,[2,26]),{19:26,26:12,31:s},{10:t,11:27,13:4,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:i,29:l,31:s,39:r,43:n,46:c},{40:[1,28],42:[1,29]},{44:[1,30]},{47:[1,31]},e(S,[2,29],{32:32,35:[1,33],37:[1,34]}),{1:[2,7]},e(u,[2,13]),{26:35,31:s},{31:[2,14]},{17:[1,36]},e(b,[2,24]),{10:t,11:37,13:4,14:22,15:x,16:w,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:i,29:l,31:s,39:r,43:n,46:c},{30:[1,38]},{41:[1,39]},{41:[1,40]},{45:[1,41]},{48:[1,42]},e(S,[2,30]),{18:[1,43]},{18:[1,44]},e(b,[2,23]),{18:[1,45]},{30:[1,46]},e(o,[2,28]),e(o,[2,35]),e(o,[2,36]),e(o,[2,37]),e(o,[2,38]),{36:[1,47]},{33:48,34:v},{15:[1,50]},e(o,[2,27]),e(S,[2,33]),{38:[1,51]},{33:52,34:v,38:[2,31]},{31:[2,15]},e(S,[2,34]),{38:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:d(function(y,g){if(g.recoverable)this.trace(y);else{var f=new Error(y);throw f.hash=g,f}},"parseError"),parse:d(function(y){var g=this,f=[0],m=[],E=[null],h=[],W=this.table,p="",I=0,Z=0,V=2,at=1,ne=h.slice.call(arguments,1),z=Object.create(this.lexer),q={yy:{}};for(var gt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,gt)&&(q.yy[gt]=this.yy[gt]);z.setInput(y,q.yy),q.yy.lexer=z,q.yy.parser=this,typeof z.yylloc>"u"&&(z.yylloc={});var ut=z.yylloc;h.push(ut);var le=z.options&&z.options.ranges;typeof q.yy.parseError=="function"?this.parseError=q.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ce(P){f.length=f.length-2*P,E.length=E.length-P,h.length=h.length-P}d(ce,"popStack");function Tt(){var P;return P=m.pop()||z.lex()||at,typeof P!="number"&&(P instanceof Array&&(m=P,P=m.pop()),P=g.symbols_[P]||P),P}d(Tt,"lex");for(var F,J,H,pt,Q={},st,G,Nt,it;;){if(J=f[f.length-1],this.defaultActions[J]?H=this.defaultActions[J]:((F===null||typeof F>"u")&&(F=Tt()),H=W[J]&&W[J][F]),typeof H>"u"||!H.length||!H[0]){var ft="";it=[];for(st in W[J])this.terminals_[st]&&st>V&&it.push("'"+this.terminals_[st]+"'");z.showPosition?ft="Parse error on line "+(I+1)+`:
+`+z.showPosition()+`
+Expecting `+it.join(", ")+", got '"+(this.terminals_[F]||F)+"'":ft="Parse error on line "+(I+1)+": Unexpected "+(F==at?"end of input":"'"+(this.terminals_[F]||F)+"'"),this.parseError(ft,{text:z.match,token:this.terminals_[F]||F,line:z.yylineno,loc:ut,expected:it})}if(H[0]instanceof Array&&H.length>1)throw new Error("Parse Error: multiple actions possible at state: "+J+", token: "+F);switch(H[0]){case 1:f.push(F),E.push(z.yytext),h.push(z.yylloc),f.push(H[1]),F=null,Z=z.yyleng,p=z.yytext,I=z.yylineno,ut=z.yylloc;break;case 2:if(G=this.productions_[H[1]][1],Q.$=E[E.length-G],Q._$={first_line:h[h.length-(G||1)].first_line,last_line:h[h.length-1].last_line,first_column:h[h.length-(G||1)].first_column,last_column:h[h.length-1].last_column},le&&(Q._$.range=[h[h.length-(G||1)].range[0],h[h.length-1].range[1]]),pt=this.performAction.apply(Q,[p,Z,I,q.yy,H[1],E,h].concat(ne)),typeof pt<"u")return pt;G&&(f=f.slice(0,-1*G*2),E=E.slice(0,-1*G),h=h.slice(0,-1*G)),f.push(this.productions_[H[1]][0]),E.push(Q.$),h.push(Q._$),Nt=W[f[f.length-2]][f[f.length-1]],f.push(Nt);break;case 3:return!0}}return!0},"parse")},B=(function(){var D={EOF:1,parseError:d(function(g,f){if(this.yy.parser)this.yy.parser.parseError(g,f);else throw new Error(g)},"parseError"),setInput:d(function(y,g){return this.yy=g||this.yy||{},this._input=y,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:d(function(){var y=this._input[0];this.yytext+=y,this.yyleng++,this.offset++,this.match+=y,this.matched+=y;var g=y.match(/(?:\r\n?|\n).*/g);return g?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),y},"input"),unput:d(function(y){var g=y.length,f=y.split(/(?:\r\n?|\n)/g);this._input=y+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-g),this.offset-=g;var m=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),f.length-1&&(this.yylineno-=f.length-1);var E=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:f?(f.length===m.length?this.yylloc.first_column:0)+m[m.length-f.length].length-f[0].length:this.yylloc.first_column-g},this.options.ranges&&(this.yylloc.range=[E[0],E[0]+this.yyleng-g]),this.yyleng=this.yytext.length,this},"unput"),more:d(function(){return this._more=!0,this},"more"),reject:d(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
+`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:d(function(y){this.unput(this.match.slice(y))},"less"),pastInput:d(function(){var y=this.matched.substr(0,this.matched.length-this.match.length);return(y.length>20?"...":"")+y.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:d(function(){var y=this.match;return y.length<20&&(y+=this._input.substr(0,20-y.length)),(y.substr(0,20)+(y.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:d(function(){var y=this.pastInput(),g=new Array(y.length+1).join("-");return y+this.upcomingInput()+`
+`+g+"^"},"showPosition"),test_match:d(function(y,g){var f,m,E;if(this.options.backtrack_lexer&&(E={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&&(E.yylloc.range=this.yylloc.range.slice(0))),m=y[0].match(/(?:\r\n?|\n).*/g),m&&(this.yylineno+=m.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:m?m[m.length-1].length-m[m.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+y[0].length},this.yytext+=y[0],this.match+=y[0],this.matches=y,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(y[0].length),this.matched+=y[0],f=this.performAction.call(this,this.yy,this,g,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),f)return f;if(this._backtrack){for(var h in E)this[h]=E[h];return!1}return!1},"test_match"),next:d(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var y,g,f,m;this._more||(this.yytext="",this.match="");for(var E=this._currentRules(),h=0;hg[0].length)){if(g=f,m=h,this.options.backtrack_lexer){if(y=this.test_match(f,E[h]),y!==!1)return y;if(this._backtrack){g=!1;continue}else return!1}else if(!this.options.flex)break}return g?(y=this.test_match(g,E[m]),y!==!1?y:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
+`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:d(function(){var g=this.next();return g||this.lex()},"lex"),begin:d(function(g){this.conditionStack.push(g)},"begin"),popState:d(function(){var g=this.conditionStack.length-1;return g>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:d(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:d(function(g){return g=this.conditionStack.length-1-Math.abs(g||0),g>=0?this.conditionStack[g]:"INITIAL"},"topState"),pushState:d(function(g){this.begin(g)},"pushState"),stateStackSize:d(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:d(function(g,f,m,E){switch(m){case 0:return g.getLogger().debug("Found block-beta"),10;case 1:return g.getLogger().debug("Found id-block"),29;case 2:return g.getLogger().debug("Found block"),10;case 3:g.getLogger().debug(".",f.yytext);break;case 4:g.getLogger().debug("_",f.yytext);break;case 5:return 5;case 6:return f.yytext=-1,28;case 7:return f.yytext=f.yytext.replace(/columns\s+/,""),g.getLogger().debug("COLUMNS (LEX)",f.yytext),28;case 8:this.pushState("md_string");break;case 9:return"MD_STR";case 10:this.popState();break;case 11:this.pushState("string");break;case 12:g.getLogger().debug("LEX: POPPING STR:",f.yytext),this.popState();break;case 13:return g.getLogger().debug("LEX: STR end:",f.yytext),"STR";case 14:return f.yytext=f.yytext.replace(/space\:/,""),g.getLogger().debug("SPACE NUM (LEX)",f.yytext),21;case 15:return f.yytext="1",g.getLogger().debug("COLUMNS (LEX)",f.yytext),21;case 16:return 42;case 17:return"LINKSTYLE";case 18:return"INTERPOLATE";case 19:return this.pushState("CLASSDEF"),39;case 20:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 21:return this.popState(),this.pushState("CLASSDEFID"),40;case 22:return this.popState(),41;case 23:return this.pushState("CLASS"),43;case 24:return this.popState(),this.pushState("CLASS_STYLE"),44;case 25:return this.popState(),45;case 26:return this.pushState("STYLE_STMNT"),46;case 27:return this.popState(),this.pushState("STYLE_DEFINITION"),47;case 28:return this.popState(),48;case 29:return this.pushState("acc_title"),"acc_title";case 30:return this.popState(),"acc_title_value";case 31:return this.pushState("acc_descr"),"acc_descr";case 32:return this.popState(),"acc_descr_value";case 33:this.pushState("acc_descr_multiline");break;case 34:this.popState();break;case 35:return"acc_descr_multiline_value";case 36:return 30;case 37:return this.popState(),g.getLogger().debug("Lex: (("),"NODE_DEND";case 38:return this.popState(),g.getLogger().debug("Lex: (("),"NODE_DEND";case 39:return this.popState(),g.getLogger().debug("Lex: ))"),"NODE_DEND";case 40:return this.popState(),g.getLogger().debug("Lex: (("),"NODE_DEND";case 41:return this.popState(),g.getLogger().debug("Lex: (("),"NODE_DEND";case 42:return this.popState(),g.getLogger().debug("Lex: (-"),"NODE_DEND";case 43:return this.popState(),g.getLogger().debug("Lex: -)"),"NODE_DEND";case 44:return this.popState(),g.getLogger().debug("Lex: (("),"NODE_DEND";case 45:return this.popState(),g.getLogger().debug("Lex: ]]"),"NODE_DEND";case 46:return this.popState(),g.getLogger().debug("Lex: ("),"NODE_DEND";case 47:return this.popState(),g.getLogger().debug("Lex: ])"),"NODE_DEND";case 48:return this.popState(),g.getLogger().debug("Lex: /]"),"NODE_DEND";case 49:return this.popState(),g.getLogger().debug("Lex: /]"),"NODE_DEND";case 50:return this.popState(),g.getLogger().debug("Lex: )]"),"NODE_DEND";case 51:return this.popState(),g.getLogger().debug("Lex: )"),"NODE_DEND";case 52:return this.popState(),g.getLogger().debug("Lex: ]>"),"NODE_DEND";case 53:return this.popState(),g.getLogger().debug("Lex: ]"),"NODE_DEND";case 54:return g.getLogger().debug("Lexa: -)"),this.pushState("NODE"),35;case 55:return g.getLogger().debug("Lexa: (-"),this.pushState("NODE"),35;case 56:return g.getLogger().debug("Lexa: ))"),this.pushState("NODE"),35;case 57:return g.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 58:return g.getLogger().debug("Lex: ((("),this.pushState("NODE"),35;case 59:return g.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 60:return g.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 61:return g.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 62:return g.getLogger().debug("Lexc: >"),this.pushState("NODE"),35;case 63:return g.getLogger().debug("Lexa: (["),this.pushState("NODE"),35;case 64:return g.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 65:return this.pushState("NODE"),35;case 66:return this.pushState("NODE"),35;case 67:return this.pushState("NODE"),35;case 68:return this.pushState("NODE"),35;case 69:return this.pushState("NODE"),35;case 70:return this.pushState("NODE"),35;case 71:return this.pushState("NODE"),35;case 72:return g.getLogger().debug("Lexa: ["),this.pushState("NODE"),35;case 73:return this.pushState("BLOCK_ARROW"),g.getLogger().debug("LEX ARR START"),37;case 74:return g.getLogger().debug("Lex: NODE_ID",f.yytext),31;case 75:return g.getLogger().debug("Lex: EOF",f.yytext),8;case 76:this.pushState("md_string");break;case 77:this.pushState("md_string");break;case 78:return"NODE_DESCR";case 79:this.popState();break;case 80:g.getLogger().debug("Lex: Starting string"),this.pushState("string");break;case 81:g.getLogger().debug("LEX ARR: Starting string"),this.pushState("string");break;case 82:return g.getLogger().debug("LEX: NODE_DESCR:",f.yytext),"NODE_DESCR";case 83:g.getLogger().debug("LEX POPPING"),this.popState();break;case 84:g.getLogger().debug("Lex: =>BAE"),this.pushState("ARROW_DIR");break;case 85:return f.yytext=f.yytext.replace(/^,\s*/,""),g.getLogger().debug("Lex (right): dir:",f.yytext),"DIR";case 86:return f.yytext=f.yytext.replace(/^,\s*/,""),g.getLogger().debug("Lex (left):",f.yytext),"DIR";case 87:return f.yytext=f.yytext.replace(/^,\s*/,""),g.getLogger().debug("Lex (x):",f.yytext),"DIR";case 88:return f.yytext=f.yytext.replace(/^,\s*/,""),g.getLogger().debug("Lex (y):",f.yytext),"DIR";case 89:return f.yytext=f.yytext.replace(/^,\s*/,""),g.getLogger().debug("Lex (up):",f.yytext),"DIR";case 90:return f.yytext=f.yytext.replace(/^,\s*/,""),g.getLogger().debug("Lex (down):",f.yytext),"DIR";case 91:return f.yytext="]>",g.getLogger().debug("Lex (ARROW_DIR end):",f.yytext),this.popState(),this.popState(),"BLOCK_ARROW_END";case 92:return g.getLogger().debug("Lex: LINK","#"+f.yytext+"#"),15;case 93:return g.getLogger().debug("Lex: LINK",f.yytext),15;case 94:return g.getLogger().debug("Lex: LINK",f.yytext),15;case 95:return g.getLogger().debug("Lex: LINK",f.yytext),15;case 96:return g.getLogger().debug("Lex: START_LINK",f.yytext),this.pushState("LLABEL"),16;case 97:return g.getLogger().debug("Lex: START_LINK",f.yytext),this.pushState("LLABEL"),16;case 98:return g.getLogger().debug("Lex: START_LINK",f.yytext),this.pushState("LLABEL"),16;case 99:this.pushState("md_string");break;case 100:return g.getLogger().debug("Lex: Starting string"),this.pushState("string"),"LINK_LABEL";case 101:return this.popState(),g.getLogger().debug("Lex: LINK","#"+f.yytext+"#"),15;case 102:return this.popState(),g.getLogger().debug("Lex: LINK",f.yytext),15;case 103:return this.popState(),g.getLogger().debug("Lex: LINK",f.yytext),15;case 104:return g.getLogger().debug("Lex: COLON",f.yytext),f.yytext=f.yytext.slice(1),27}},"anonymous"),rules:[/^(?:block-beta\b)/,/^(?:block:)/,/^(?:block\b)/,/^(?:[\s]+)/,/^(?:[\n]+)/,/^(?:((\u000D\u000A)|(\u000A)))/,/^(?:columns\s+auto\b)/,/^(?:columns\s+[\d]+)/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:space[:]\d+)/,/^(?:space\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\s+)/,/^(?:DEFAULT\s+)/,/^(?:\w+\s+)/,/^(?:[^\n]*)/,/^(?:class\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:style\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:end\b\s*)/,/^(?:\(\(\()/,/^(?:\)\)\))/,/^(?:[\)]\))/,/^(?:\}\})/,/^(?:\})/,/^(?:\(-)/,/^(?:-\))/,/^(?:\(\()/,/^(?:\]\])/,/^(?:\()/,/^(?:\]\))/,/^(?:\\\])/,/^(?:\/\])/,/^(?:\)\])/,/^(?:[\)])/,/^(?:\]>)/,/^(?:[\]])/,/^(?:-\))/,/^(?:\(-)/,/^(?:\)\))/,/^(?:\))/,/^(?:\(\(\()/,/^(?:\(\()/,/^(?:\{\{)/,/^(?:\{)/,/^(?:>)/,/^(?:\(\[)/,/^(?:\()/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\[\\)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:\[)/,/^(?:<\[)/,/^(?:[^\(\[\n\-\)\{\}\s\<\>:]+)/,/^(?:$)/,/^(?:["][`])/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:\]>\s*\()/,/^(?:,?\s*right\s*)/,/^(?:,?\s*left\s*)/,/^(?:,?\s*x\s*)/,/^(?:,?\s*y\s*)/,/^(?:,?\s*up\s*)/,/^(?:,?\s*down\s*)/,/^(?:\)\s*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*~~[\~]+\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:["][`])/,/^(?:["])/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?::\d+)/],conditions:{STYLE_DEFINITION:{rules:[28],inclusive:!1},STYLE_STMNT:{rules:[27],inclusive:!1},CLASSDEFID:{rules:[22],inclusive:!1},CLASSDEF:{rules:[20,21],inclusive:!1},CLASS_STYLE:{rules:[25],inclusive:!1},CLASS:{rules:[24],inclusive:!1},LLABEL:{rules:[99,100,101,102,103],inclusive:!1},ARROW_DIR:{rules:[85,86,87,88,89,90,91],inclusive:!1},BLOCK_ARROW:{rules:[76,81,84],inclusive:!1},NODE:{rules:[37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,77,80],inclusive:!1},md_string:{rules:[9,10,78,79],inclusive:!1},space:{rules:[],inclusive:!1},string:{rules:[12,13,82,83],inclusive:!1},acc_descr_multiline:{rules:[34,35],inclusive:!1},acc_descr:{rules:[32],inclusive:!1},acc_title:{rules:[30],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,11,14,15,16,17,18,19,23,26,29,31,33,36,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,92,93,94,95,96,97,98,104],inclusive:!0}}};return D})();k.lexer=B;function _(){this.yy={}}return d(_,"Parser"),_.prototype=k,k.Parser=_,new _})();bt.parser=bt;var ve=bt,X=new Map,kt=[],wt=new Map,Bt="color",Ct="fill",Ee="bgFill",Pt=",",_e=R(),ct=new Map,De=d(e=>be.sanitizeText(e,_e),"sanitizeText"),Te=d(function(e,t=""){let a=ct.get(e);a||(a={id:e,styles:[],textStyles:[]},ct.set(e,a)),t?.split(Pt).forEach(i=>{const l=i.replace(/([^;]*);/,"$1").trim();if(RegExp(Bt).exec(i)){const r=l.replace(Ct,Ee).replace(Bt,Ct);a.textStyles.push(r)}a.styles.push(l)})},"addStyleClass"),Ne=d(function(e,t=""){const a=X.get(e);t!=null&&(a.styles=t.split(Pt))},"addStyle2Node"),Be=d(function(e,t){e.split(",").forEach(function(a){let i=X.get(a);if(i===void 0){const l=a.trim();i={id:l,type:"na",children:[]},X.set(l,i)}i.classes||(i.classes=[]),i.classes.push(t)})},"setCssClass"),Yt=d((e,t)=>{const a=e.flat(),i=[],s=a.find(r=>r?.type==="column-setting")?.columns??-1;for(const r of a){if(typeof s=="number"&&s>0&&r.type!=="column-setting"&&typeof r.widthInColumns=="number"&&r.widthInColumns>s&&L.warn(`Block ${r.id} width ${r.widthInColumns} exceeds configured column width ${s}`),r.label&&(r.label=De(r.label)),r.type==="classDef"){Te(r.id,r.css);continue}if(r.type==="applyClass"){Be(r.id,r?.styleClass??"");continue}if(r.type==="applyStyles"){r?.stylesStr&&Ne(r.id,r?.stylesStr);continue}if(r.type==="column-setting")t.columns=r.columns??-1;else if(r.type==="edge"){const n=(wt.get(r.id)??0)+1;wt.set(r.id,n),r.id=n+"-"+r.id,kt.push(r)}else{r.label||(r.type==="composite"?r.label="":r.label=r.id);const n=X.get(r.id);if(n===void 0?X.set(r.id,r):(r.type!=="na"&&(n.type=r.type),r.label!==r.id&&(n.label=r.label)),r.children&&Yt(r.children,r),r.type==="space"){const c=r.width??1;for(let u=0;u{L.debug("Clear called"),de(),et={id:"root",type:"composite",children:[],columns:-1},X=new Map([["root",et]]),vt=[],ct=new Map,kt=[],wt=new Map},"clear");function Ht(e){switch(L.debug("typeStr2Type",e),e){case"[]":return"square";case"()":return L.debug("we have a round"),"round";case"(())":return"circle";case">]":return"rect_left_inv_arrow";case"{}":return"diamond";case"{{}}":return"hexagon";case"([])":return"stadium";case"[[]]":return"subroutine";case"[()]":return"cylinder";case"((()))":return"doublecircle";case"[//]":return"lean_right";case"[\\\\]":return"lean_left";case"[/\\]":return"trapezoid";case"[\\/]":return"inv_trapezoid";case"<[]>":return"block_arrow";default:return"na"}}d(Ht,"typeStr2Type");function Kt(e){return L.debug("typeStr2Type",e),e==="=="?"thick":"normal"}d(Kt,"edgeTypeStr2Type");function Xt(e){switch(e.replace(/^[\s-]+|[\s-]+$/g,"")){case"x":return"arrow_cross";case"o":return"arrow_circle";case">":return"arrow_point";default:return""}}d(Xt,"edgeStrToEdgeData");var It=0,Ie=d(()=>(It++,"id-"+Math.random().toString(36).substr(2,12)+"-"+It),"generateId"),Oe=d(e=>{et.children=e,Yt(e,et),vt=et.children},"setHierarchy"),Re=d(e=>{const t=X.get(e);return t?t.columns?t.columns:t.children?t.children.length:-1:-1},"getColumns"),ze=d(()=>[...X.values()],"getBlocksFlat"),Ae=d(()=>vt||[],"getBlocks"),Me=d(()=>kt,"getEdges"),Fe=d(e=>X.get(e),"getBlock"),We=d(e=>{X.set(e.id,e)},"setBlock"),Pe=d(()=>L,"getLogger"),Ye=d(function(){return ct},"getClasses"),He={getConfig:d(()=>rt().block,"getConfig"),typeStr2Type:Ht,edgeTypeStr2Type:Kt,edgeStrToEdgeData:Xt,getLogger:Pe,getBlocksFlat:ze,getBlocks:Ae,getEdges:Me,setHierarchy:Oe,getBlock:Fe,setBlock:We,getColumns:Re,getClasses:Ye,clear:Ce,generateId:Ie},Ke=He,nt=d((e,t)=>{const a=ke,i=a(e,"r"),l=a(e,"g"),s=a(e,"b");return ge(i,l,s,t)},"fade"),Xe=d(e=>`.label {
+ font-family: ${e.fontFamily};
+ color: ${e.nodeTextColor||e.textColor};
+ }
+ .cluster-label text {
+ fill: ${e.titleColor};
+ }
+ .cluster-label span,p {
+ color: ${e.titleColor};
+ }
+
+
+
+ .label text,span,p {
+ fill: ${e.nodeTextColor||e.textColor};
+ color: ${e.nodeTextColor||e.textColor};
+ }
+
+ .node rect,
+ .node circle,
+ .node ellipse,
+ .node polygon,
+ .node path {
+ fill: ${e.mainBkg};
+ stroke: ${e.nodeBorder};
+ stroke-width: 1px;
+ }
+ .flowchart-label text {
+ text-anchor: middle;
+ }
+ // .flowchart-label .text-outer-tspan {
+ // text-anchor: middle;
+ // }
+ // .flowchart-label .text-inner-tspan {
+ // text-anchor: start;
+ // }
+
+ .node .label {
+ text-align: center;
+ }
+ .node.clickable {
+ cursor: pointer;
+ }
+
+ .arrowheadPath {
+ fill: ${e.arrowheadColor};
+ }
+
+ .edgePath .path {
+ stroke: ${e.lineColor};
+ stroke-width: 2.0px;
+ }
+
+ .flowchart-link {
+ stroke: ${e.lineColor};
+ fill: none;
+ }
+
+ .edgeLabel {
+ background-color: ${e.edgeLabelBackground};
+ rect {
+ opacity: 0.5;
+ background-color: ${e.edgeLabelBackground};
+ fill: ${e.edgeLabelBackground};
+ }
+ text-align: center;
+ }
+
+ /* For html labels only */
+ .labelBkg {
+ background-color: ${nt(e.edgeLabelBackground,.5)};
+ // background-color:
+ }
+
+ .node .cluster {
+ // fill: ${nt(e.mainBkg,.5)};
+ fill: ${nt(e.clusterBkg,.5)};
+ stroke: ${nt(e.clusterBorder,.2)};
+ box-shadow: rgba(50, 50, 93, 0.25) 0px 13px 27px -5px, rgba(0, 0, 0, 0.3) 0px 8px 16px -8px;
+ stroke-width: 1px;
+ }
+
+ .cluster text {
+ fill: ${e.titleColor};
+ }
+
+ .cluster span,p {
+ color: ${e.titleColor};
+ }
+ /* .cluster div {
+ color: ${e.titleColor};
+ } */
+
+ div.mermaidTooltip {
+ position: absolute;
+ text-align: center;
+ max-width: 200px;
+ padding: 2px;
+ font-family: ${e.fontFamily};
+ font-size: 12px;
+ background: ${e.tertiaryColor};
+ border: 1px solid ${e.border2};
+ border-radius: 2px;
+ pointer-events: none;
+ z-index: 100;
+ }
+
+ .flowchartTitleText {
+ text-anchor: middle;
+ font-size: 18px;
+ fill: ${e.textColor};
+ }
+ ${oe()}
+`,"getStyles"),Ue=Xe,je=d((e,t,a,i)=>{t.forEach(l=>{rr[l](e,a,i)})},"insertMarkers"),Ve=d((e,t,a)=>{L.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")},"extension"),Ge=d((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")},"composition"),Ze=d((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")},"aggregation"),qe=d((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")},"dependency"),Je=d((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)},"lollipop"),Qe=d((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")},"point"),$e=d((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")},"circle"),tr=d((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")},"cross"),er=d((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")},"barb"),rr={extension:Ve,composition:Ge,aggregation:Ze,dependency:qe,lollipop:Je,point:Qe,circle:$e,cross:tr,barb:er},ar=je,C=R()?.block?.padding??8;function Ut(e,t){if(e===0||!Number.isInteger(e))throw new Error("Columns must be an integer !== 0.");if(t<0||!Number.isInteger(t))throw new Error("Position must be a non-negative integer."+t);if(e<0)return{px:t,py:0};if(e===1)return{px:0,py:t};const a=t%e,i=Math.floor(t/e);return{px:a,py:i}}d(Ut,"calculateBlockPosition");var sr=d(e=>{let t=0,a=0;for(const i of e.children){const{width:l,height:s,x:r,y:n}=i.size??{width:0,height:0,x:0,y:0};L.debug("getMaxChildSize abc95 child:",i.id,"width:",l,"height:",s,"x:",r,"y:",n,i.type),i.type!=="space"&&(l>t&&(t=l/(e.widthInColumns??1)),s>a&&(a=s))}return{width:t,height:a}},"getMaxChildSize");function ot(e,t,a=0,i=0){L.debug("setBlockSizes abc95 (start)",e.id,e?.size?.x,"block width =",e?.size,"siblingWidth",a),e?.size?.width||(e.size={width:a,height:i,x:0,y:0});let l=0,s=0;if(e.children?.length>0){for(const b of e.children)ot(b,t);const r=sr(e);l=r.width,s=r.height,L.debug("setBlockSizes abc95 maxWidth of",e.id,":s children is ",l,s);for(const b of e.children)b.size&&(L.debug(`abc95 Setting size of children of ${e.id} id=${b.id} ${l} ${s} ${JSON.stringify(b.size)}`),b.size.width=l*(b.widthInColumns??1)+C*((b.widthInColumns??1)-1),b.size.height=s,b.size.x=0,b.size.y=0,L.debug(`abc95 updating size of ${e.id} children child:${b.id} maxWidth:${l} maxHeight:${s}`));for(const b of e.children)ot(b,t,l,s);const n=e.columns??-1;let c=0;for(const b of e.children)c+=b.widthInColumns??1;let u=e.children.length;n>0&&n0?Math.min(e.children.length,n):e.children.length;if(b>0){const S=(x-b*C-C)/b;L.debug("abc95 (growing to fit) width",e.id,x,e.size?.width,S);for(const v of e.children)v.size&&(v.size.width=S)}}e.size={width:x,height:w,x:0,y:0}}L.debug("setBlockSizes abc94 (done)",e.id,e?.size?.x,e?.size?.width,e?.size?.y,e?.size?.height)}d(ot,"setBlockSizes");function Et(e,t){L.debug(`abc85 layout blocks (=>layoutBlocks) ${e.id} x: ${e?.size?.x} y: ${e?.size?.y} width: ${e?.size?.width}`);const a=e.columns??-1;if(L.debug("layoutBlocks columns abc95",e.id,"=>",a,e),e.children&&e.children.length>0){const i=e?.children[0]?.size?.width??0,l=e.children.length*i+(e.children.length-1)*C;L.debug("widthOfChildren 88",l,"posX");let s=0;L.debug("abc91 block?.size?.x",e.id,e?.size?.x);let r=e?.size?.x?e?.size?.x+(-e?.size?.width/2||0):-C,n=0;for(const c of e.children){const u=e;if(!c.size)continue;const{width:o,height:x}=c.size,{px:w,py:b}=Ut(a,s);if(b!=n&&(n=b,r=e?.size?.x?e?.size?.x+(-e?.size?.width/2||0):-C,L.debug("New row in layout for block",e.id," and child ",c.id,n)),L.debug(`abc89 layout blocks (child) id: ${c.id} Pos: ${s} (px, py) ${w},${b} (${u?.size?.x},${u?.size?.y}) parent: ${u.id} width: ${o}${C}`),u.size){const v=o/2;c.size.x=r+C+v,L.debug(`abc91 layout blocks (calc) px, pyid:${c.id} startingPos=X${r} new startingPosX${c.size.x} ${v} padding=${C} width=${o} halfWidth=${v} => x:${c.size.x} y:${c.size.y} ${c.widthInColumns} (width * (child?.w || 1)) / 2 ${o*(c?.widthInColumns??1)/2}`),r=c.size.x+v,c.size.y=u.size.y-u.size.height/2+b*(x+C)+x/2+C,L.debug(`abc88 layout blocks (calc) px, pyid:${c.id}startingPosX${r}${C}${v}=>x:${c.size.x}y:${c.size.y}${c.widthInColumns}(width * (child?.w || 1)) / 2${o*(c?.widthInColumns??1)/2}`)}c.children&&Et(c);let S=c?.widthInColumns??1;a>0&&(S=Math.min(S,a-s%a)),s+=S,L.debug("abc88 columnsPos",c,s)}}L.debug(`layout blocks (<==layoutBlocks) ${e.id} x: ${e?.size?.x} y: ${e?.size?.y} width: ${e?.size?.width}`)}d(Et,"layoutBlocks");function _t(e,{minX:t,minY:a,maxX:i,maxY:l}={minX:0,minY:0,maxX:0,maxY:0}){if(e.size&&e.id!=="root"){const{x:s,y:r,width:n,height:c}=e.size;s-n/2i&&(i=s+n/2),r+c/2>l&&(l=r+c/2)}if(e.children)for(const s of e.children)({minX:t,minY:a,maxX:i,maxY:l}=_t(s,{minX:t,minY:a,maxX:i,maxY:l}));return{minX:t,minY:a,maxX:i,maxY:l}}d(_t,"findBounds");function jt(e){const t=e.getBlock("root");if(!t)return;ot(t,e,0,0),Et(t),L.debug("getBlocks",JSON.stringify(t,null,2));const{minX:a,minY:i,maxX:l,maxY:s}=_t(t),r=s-i,n=l-a;return{x:a,y:i,width:n,height:r}}d(jt,"layout");function mt(e,t){t&&e.attr("style",t)}d(mt,"applyStyle");function Vt(e,t){const a=O(document.createElementNS("http://www.w3.org/2000/svg","foreignObject")),i=a.append("xhtml:div"),l=e.label,s=e.isNode?"nodeLabel":"edgeLabel",r=i.append("span");return r.html(yt(l,t)),mt(r,e.labelStyle),r.attr("class",s),mt(i,e.labelStyle),i.style("display","inline-block"),i.style("white-space","nowrap"),i.attr("xmlns","http://www.w3.org/1999/xhtml"),a.node()}d(Vt,"addHtmlLabel");var ir=d(async(e,t,a,i)=>{let l=e||"";typeof l=="object"&&(l=l[0]);const s=R();if(j(s.flowchart.htmlLabels)){l=l.replace(/\\n|\n/g,"
"),L.debug("vertexText"+l);const r=await we(xt(l)),n={isNode:i,label:r,labelStyle:t.replace("fill:","color:")};return Vt(n,s)}else{const r=document.createElementNS("http://www.w3.org/2000/svg","text");r.setAttribute("style",t.replace("color:","fill:"));let n=[];typeof l=="string"?n=l.split(/\\n|\n|
/gi):Array.isArray(l)?n=l:n=[];for(const c of n){const u=document.createElementNS("http://www.w3.org/2000/svg","tspan");u.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),u.setAttribute("dy","1em"),u.setAttribute("x","0"),a?u.setAttribute("class","title-row"):u.setAttribute("class","row"),u.textContent=c.trim(),r.appendChild(u)}return r}},"createLabel"),K=ir,nr=d((e,t,a,i,l)=>{t.arrowTypeStart&&Ot(e,"start",t.arrowTypeStart,a,i,l),t.arrowTypeEnd&&Ot(e,"end",t.arrowTypeEnd,a,i,l)},"addEdgeMarkers"),lr={arrow_cross:"cross",arrow_point:"point",arrow_barb:"barb",arrow_circle:"circle",aggregation:"aggregation",extension:"extension",composition:"composition",dependency:"dependency",lollipop:"lollipop"},Ot=d((e,t,a,i,l,s)=>{const r=lr[a];if(!r){L.warn(`Unknown arrow type: ${a}`);return}const n=t==="start"?"Start":"End";e.attr(`marker-${t}`,`url(${i}#${l}_${s}-${r}${n})`)},"addEdgeMarker"),Lt={},M={},cr=d(async(e,t)=>{const a=R(),i=j(a.flowchart.htmlLabels),l=t.labelType==="markdown"?Wt(e,t.label,{style:t.labelStyle,useHtmlLabels:i,addSvgBackground:!0},a):await K(t.label,t.labelStyle),s=e.insert("g").attr("class","edgeLabel"),r=s.insert("g").attr("class","label");r.node().appendChild(l);let n=l.getBBox();if(i){const u=l.children[0],o=O(l);n=u.getBoundingClientRect(),o.attr("width",n.width),o.attr("height",n.height)}r.attr("transform","translate("+-n.width/2+", "+-n.height/2+")"),Lt[t.id]=s,t.width=n.width,t.height=n.height;let c;if(t.startLabelLeft){const u=await K(t.startLabelLeft,t.labelStyle),o=e.insert("g").attr("class","edgeTerminals"),x=o.insert("g").attr("class","inner");c=x.node().appendChild(u);const w=u.getBBox();x.attr("transform","translate("+-w.width/2+", "+-w.height/2+")"),M[t.id]||(M[t.id]={}),M[t.id].startLeft=o,tt(c,t.startLabelLeft)}if(t.startLabelRight){const u=await K(t.startLabelRight,t.labelStyle),o=e.insert("g").attr("class","edgeTerminals"),x=o.insert("g").attr("class","inner");c=o.node().appendChild(u),x.node().appendChild(u);const w=u.getBBox();x.attr("transform","translate("+-w.width/2+", "+-w.height/2+")"),M[t.id]||(M[t.id]={}),M[t.id].startRight=o,tt(c,t.startLabelRight)}if(t.endLabelLeft){const u=await K(t.endLabelLeft,t.labelStyle),o=e.insert("g").attr("class","edgeTerminals"),x=o.insert("g").attr("class","inner");c=x.node().appendChild(u);const w=u.getBBox();x.attr("transform","translate("+-w.width/2+", "+-w.height/2+")"),o.node().appendChild(u),M[t.id]||(M[t.id]={}),M[t.id].endLeft=o,tt(c,t.endLabelLeft)}if(t.endLabelRight){const u=await K(t.endLabelRight,t.labelStyle),o=e.insert("g").attr("class","edgeTerminals"),x=o.insert("g").attr("class","inner");c=x.node().appendChild(u);const w=u.getBBox();x.attr("transform","translate("+-w.width/2+", "+-w.height/2+")"),o.node().appendChild(u),M[t.id]||(M[t.id]={}),M[t.id].endRight=o,tt(c,t.endLabelRight)}return l},"insertEdgeLabel");function tt(e,t){R().flowchart.htmlLabels&&e&&(e.style.width=t.length*9+"px",e.style.height="12px")}d(tt,"setTerminalWidth");var or=d((e,t)=>{L.debug("Moving label abc88 ",e.id,e.label,Lt[e.id],t);let a=t.updatedPath?t.updatedPath:t.originalPath;const i=R(),{subGraphTitleTotalMargin:l}=ye(i);if(e.label){const s=Lt[e.id];let r=e.x,n=e.y;if(a){const c=$.calcLabelPosition(a);L.debug("Moving label "+e.label+" from (",r,",",n,") to (",c.x,",",c.y,") abc88"),t.updatedPath&&(r=c.x,n=c.y)}s.attr("transform",`translate(${r}, ${n+l/2})`)}if(e.startLabelLeft){const s=M[e.id].startLeft;let r=e.x,n=e.y;if(a){const c=$.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_left",a);r=c.x,n=c.y}s.attr("transform",`translate(${r}, ${n})`)}if(e.startLabelRight){const s=M[e.id].startRight;let r=e.x,n=e.y;if(a){const c=$.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_right",a);r=c.x,n=c.y}s.attr("transform",`translate(${r}, ${n})`)}if(e.endLabelLeft){const s=M[e.id].endLeft;let r=e.x,n=e.y;if(a){const c=$.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_left",a);r=c.x,n=c.y}s.attr("transform",`translate(${r}, ${n})`)}if(e.endLabelRight){const s=M[e.id].endRight;let r=e.x,n=e.y;if(a){const c=$.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_right",a);r=c.x,n=c.y}s.attr("transform",`translate(${r}, ${n})`)}},"positionEdgeLabel"),hr=d((e,t)=>{const a=e.x,i=e.y,l=Math.abs(t.x-a),s=Math.abs(t.y-i),r=e.width/2,n=e.height/2;return l>=r||s>=n},"outsideNode"),dr=d((e,t,a)=>{L.debug(`intersection calc abc89:
+ outsidePoint: ${JSON.stringify(t)}
+ insidePoint : ${JSON.stringify(a)}
+ node : x:${e.x} y:${e.y} w:${e.width} h:${e.height}`);const i=e.x,l=e.y,s=Math.abs(i-a.x),r=e.width/2;let n=a.xMath.abs(i-t.x)*c){let x=a.y{L.debug("abc88 cutPathAtIntersect",e,t);let a=[],i=e[0],l=!1;return e.forEach(s=>{if(!hr(t,s)&&!l){const r=dr(t,i,s);let n=!1;a.forEach(c=>{n=n||c.x===r.x&&c.y===r.y}),a.some(c=>c.x===r.x&&c.y===r.y)||a.push(r),l=!0}else i=s,l||a.push(s)}),a},"cutPathAtIntersect"),gr=d(function(e,t,a,i,l,s,r){let n=a.points;L.debug("abc88 InsertEdge: edge=",a,"e=",t);let c=!1;const u=s.node(t.v);var o=s.node(t.w);o?.intersect&&u?.intersect&&(n=n.slice(1,a.points.length-1),n.unshift(u.intersect(n[0])),n.push(o.intersect(n[n.length-1]))),a.toCluster&&(L.debug("to cluster abc88",i[a.toCluster]),n=Rt(a.points,i[a.toCluster].node),c=!0),a.fromCluster&&(L.debug("from cluster abc88",i[a.fromCluster]),n=Rt(n.reverse(),i[a.fromCluster].node).reverse(),c=!0);const x=n.filter(y=>!Number.isNaN(y.y));let w=fe;a.curve&&(l==="graph"||l==="flowchart")&&(w=a.curve);const{x:b,y:S}=ue(a),v=pe().x(b).y(S).curve(w);let k;switch(a.thickness){case"normal":k="edge-thickness-normal";break;case"thick":k="edge-thickness-thick";break;case"invisible":k="edge-thickness-thick";break;default:k=""}switch(a.pattern){case"solid":k+=" edge-pattern-solid";break;case"dotted":k+=" edge-pattern-dotted";break;case"dashed":k+=" edge-pattern-dashed";break}const B=e.append("path").attr("d",v(x)).attr("id",a.id).attr("class"," "+k+(a.classes?" "+a.classes:"")).attr("style",a.style);let _="";(R().flowchart.arrowMarkerAbsolute||R().state.arrowMarkerAbsolute)&&(_=xe(!0)),nr(B,a,_,r,l);let D={};return c&&(D.updatedPath=n),D.originalPath=a.points,D},"insertEdge"),ur=d(e=>{const t=new Set;for(const 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},"expandAndDeduplicateDirections"),pr=d((e,t,a)=>{const i=ur(e),l=2,s=t.height+2*a.padding,r=s/l,n=t.width+2*r+a.padding,c=a.padding/2;return i.has("right")&&i.has("left")&&i.has("up")&&i.has("down")?[{x:0,y:0},{x:r,y:0},{x:n/2,y:2*c},{x:n-r,y:0},{x:n,y:0},{x:n,y:-s/3},{x:n+2*c,y:-s/2},{x:n,y:-2*s/3},{x:n,y:-s},{x:n-r,y:-s},{x:n/2,y:-s-2*c},{x:r,y:-s},{x:0,y:-s},{x:0,y:-2*s/3},{x:-2*c,y:-s/2},{x:0,y:-s/3}]:i.has("right")&&i.has("left")&&i.has("up")?[{x:r,y:0},{x:n-r,y:0},{x:n,y:-s/2},{x:n-r,y:-s},{x:r,y:-s},{x:0,y:-s/2}]:i.has("right")&&i.has("left")&&i.has("down")?[{x:0,y:0},{x:r,y:-s},{x:n-r,y:-s},{x:n,y:0}]:i.has("right")&&i.has("up")&&i.has("down")?[{x:0,y:0},{x:n,y:-r},{x:n,y:-s+r},{x:0,y:-s}]:i.has("left")&&i.has("up")&&i.has("down")?[{x:n,y:0},{x:0,y:-r},{x:0,y:-s+r},{x:n,y:-s}]:i.has("right")&&i.has("left")?[{x:r,y:0},{x:r,y:-c},{x:n-r,y:-c},{x:n-r,y:0},{x:n,y:-s/2},{x:n-r,y:-s},{x:n-r,y:-s+c},{x:r,y:-s+c},{x:r,y:-s},{x:0,y:-s/2}]:i.has("up")&&i.has("down")?[{x:n/2,y:0},{x:0,y:-c},{x:r,y:-c},{x:r,y:-s+c},{x:0,y:-s+c},{x:n/2,y:-s},{x:n,y:-s+c},{x:n-r,y:-s+c},{x:n-r,y:-c},{x:n,y:-c}]:i.has("right")&&i.has("up")?[{x:0,y:0},{x:n,y:-r},{x:0,y:-s}]:i.has("right")&&i.has("down")?[{x:0,y:0},{x:n,y:0},{x:0,y:-s}]:i.has("left")&&i.has("up")?[{x:n,y:0},{x:0,y:-r},{x:n,y:-s}]:i.has("left")&&i.has("down")?[{x:n,y:0},{x:0,y:0},{x:n,y:-s}]:i.has("right")?[{x:r,y:-c},{x:r,y:-c},{x:n-r,y:-c},{x:n-r,y:0},{x:n,y:-s/2},{x:n-r,y:-s},{x:n-r,y:-s+c},{x:r,y:-s+c},{x:r,y:-s+c}]:i.has("left")?[{x:r,y:0},{x:r,y:-c},{x:n-r,y:-c},{x:n-r,y:-s+c},{x:r,y:-s+c},{x:r,y:-s},{x:0,y:-s/2}]:i.has("up")?[{x:r,y:-c},{x:r,y:-s+c},{x:0,y:-s+c},{x:n/2,y:-s},{x:n,y:-s+c},{x:n-r,y:-s+c},{x:n-r,y:-c}]:i.has("down")?[{x:n/2,y:0},{x:0,y:-c},{x:r,y:-c},{x:r,y:-s+c},{x:n-r,y:-s+c},{x:n-r,y:-c},{x:n,y:-c}]:[{x:0,y:0}]},"getArrowPoints");function Gt(e,t){return e.intersect(t)}d(Gt,"intersectNode");var fr=Gt;function Zt(e,t,a,i){var l=e.x,s=e.y,r=l-i.x,n=s-i.y,c=Math.sqrt(t*t*n*n+a*a*r*r),u=Math.abs(t*a*r/c);i.x0}d(St,"sameSign");var yr=Qt,br=$t;function $t(e,t,a){var i=e.x,l=e.y,s=[],r=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY;typeof t.forEach=="function"?t.forEach(function(S){r=Math.min(r,S.x),n=Math.min(n,S.y)}):(r=Math.min(r,t.x),n=Math.min(n,t.y));for(var c=i-e.width/2-r,u=l-e.height/2-n,o=0;o1&&s.sort(function(S,v){var k=S.x-a.x,B=S.y-a.y,_=Math.sqrt(k*k+B*B),D=v.x-a.x,y=v.y-a.y,g=Math.sqrt(D*D+y*y);return _{var a=e.x,i=e.y,l=t.x-a,s=t.y-i,r=e.width/2,n=e.height/2,c,u;return Math.abs(s)*r>Math.abs(l)*n?(s<0&&(n=-n),c=s===0?0:n*l/s,u=n):(l<0&&(r=-r),c=r,u=l===0?0:r*s/l),{x:a+c,y:i+u}},"intersectRect"),mr=wr,T={node:fr,circle:xr,ellipse:qt,polygon:br,rect:mr},A=d(async(e,t,a,i)=>{const l=R();let s;const r=t.useHtmlLabels||j(l.flowchart.htmlLabels);a?s=a:s="node default";const n=e.insert("g").attr("class",s).attr("id",t.domId||t.id),c=n.insert("g").attr("class","label").attr("style",t.labelStyle);let u;t.labelText===void 0?u="":u=typeof t.labelText=="string"?t.labelText:t.labelText[0];const o=c.node();let x;t.labelType==="markdown"?x=Wt(c,yt(xt(u),l),{useHtmlLabels:r,width:t.width||l.flowchart.wrappingWidth,classes:"markdown-node-label"},l):x=o.appendChild(await K(yt(xt(u),l),t.labelStyle,!1,i));let w=x.getBBox();const b=t.padding/2;if(j(l.flowchart.htmlLabels)){const S=x.children[0],v=O(x),k=S.getElementsByTagName("img");if(k){const B=u.replace(/
]*>/g,"").trim()==="";await Promise.all([...k].map(_=>new Promise(D=>{function y(){if(_.style.display="flex",_.style.flexDirection="column",B){const g=l.fontSize?l.fontSize:window.getComputedStyle(document.body).fontSize,m=parseInt(g,10)*5+"px";_.style.minWidth=m,_.style.maxWidth=m}else _.style.width="100%";D(_)}d(y,"setupImage"),setTimeout(()=>{_.complete&&y()}),_.addEventListener("error",y),_.addEventListener("load",y)})))}w=S.getBoundingClientRect(),v.attr("width",w.width),v.attr("height",w.height)}return r?c.attr("transform","translate("+-w.width/2+", "+-w.height/2+")"):c.attr("transform","translate(0, "+-w.height/2+")"),t.centerLabel&&c.attr("transform","translate("+-w.width/2+", "+-w.height/2+")"),c.insert("rect",":first-child"),{shapeSvg:n,bbox:w,halfPadding:b,label:c}},"labelHelper"),N=d((e,t)=>{const a=t.node().getBBox();e.width=a.width,e.height=a.height},"updateNodeBounds");function U(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+")")}d(U,"insertPolygonShape");var Lr=d(async(e,t)=>{t.useHtmlLabels||R().flowchart.htmlLabels||(t.centerLabel=!0);const{shapeSvg:i,bbox:l,halfPadding:s}=await A(e,t,"node "+t.classes,!0);L.info("Classes = ",t.classes);const r=i.insert("rect",":first-child");return r.attr("rx",t.rx).attr("ry",t.ry).attr("x",-l.width/2-s).attr("y",-l.height/2-s).attr("width",l.width+t.padding).attr("height",l.height+t.padding),N(t,r),t.intersect=function(n){return T.rect(t,n)},i},"note"),Sr=Lr,zt=d(e=>e?" "+e:"","formatClass"),Y=d((e,t)=>`${t||"node default"}${zt(e.classes)} ${zt(e.class)}`,"getClassesFromNode"),At=d(async(e,t)=>{const{shapeSvg:a,bbox:i}=await A(e,t,Y(t,void 0),!0),l=i.width+t.padding,s=i.height+t.padding,r=l+s,n=[{x:r/2,y:0},{x:r,y:-r/2},{x:r/2,y:-r},{x:0,y:-r/2}];L.info("Question main (Circle)");const c=U(a,r,r,n);return c.attr("style",t.style),N(t,c),t.intersect=function(u){return L.warn("Intersect called"),T.polygon(t,n,u)},a},"question"),kr=d((e,t)=>{const 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(r){return r.x+","+r.y}).join(" ")).attr("class","state-start").attr("r",7).attr("width",28).attr("height",28),t.width=28,t.height=28,t.intersect=function(r){return T.circle(t,14,r)},a},"choice"),vr=d(async(e,t)=>{const{shapeSvg:a,bbox:i}=await A(e,t,Y(t,void 0),!0),l=4,s=i.height+t.padding,r=s/l,n=i.width+2*r+t.padding,c=[{x:r,y:0},{x:n-r,y:0},{x:n,y:-s/2},{x:n-r,y:-s},{x:r,y:-s},{x:0,y:-s/2}],u=U(a,n,s,c);return u.attr("style",t.style),N(t,u),t.intersect=function(o){return T.polygon(t,c,o)},a},"hexagon"),Er=d(async(e,t)=>{const{shapeSvg:a,bbox:i}=await A(e,t,void 0,!0),l=2,s=i.height+2*t.padding,r=s/l,n=i.width+2*r+t.padding,c=pr(t.directions,i,t),u=U(a,n,s,c);return u.attr("style",t.style),N(t,u),t.intersect=function(o){return T.polygon(t,c,o)},a},"block_arrow"),_r=d(async(e,t)=>{const{shapeSvg:a,bbox:i}=await A(e,t,Y(t,void 0),!0),l=i.width+t.padding,s=i.height+t.padding,r=[{x:-s/2,y:0},{x:l,y:0},{x:l,y:-s},{x:-s/2,y:-s},{x:0,y:-s/2}];return U(a,l,s,r).attr("style",t.style),t.width=l+s,t.height=s,t.intersect=function(c){return T.polygon(t,r,c)},a},"rect_left_inv_arrow"),Dr=d(async(e,t)=>{const{shapeSvg:a,bbox:i}=await A(e,t,Y(t),!0),l=i.width+t.padding,s=i.height+t.padding,r=[{x:-2*s/6,y:0},{x:l-s/6,y:0},{x:l+2*s/6,y:-s},{x:s/6,y:-s}],n=U(a,l,s,r);return n.attr("style",t.style),N(t,n),t.intersect=function(c){return T.polygon(t,r,c)},a},"lean_right"),Tr=d(async(e,t)=>{const{shapeSvg:a,bbox:i}=await A(e,t,Y(t,void 0),!0),l=i.width+t.padding,s=i.height+t.padding,r=[{x:2*s/6,y:0},{x:l+s/6,y:0},{x:l-2*s/6,y:-s},{x:-s/6,y:-s}],n=U(a,l,s,r);return n.attr("style",t.style),N(t,n),t.intersect=function(c){return T.polygon(t,r,c)},a},"lean_left"),Nr=d(async(e,t)=>{const{shapeSvg:a,bbox:i}=await A(e,t,Y(t,void 0),!0),l=i.width+t.padding,s=i.height+t.padding,r=[{x:-2*s/6,y:0},{x:l+2*s/6,y:0},{x:l-s/6,y:-s},{x:s/6,y:-s}],n=U(a,l,s,r);return n.attr("style",t.style),N(t,n),t.intersect=function(c){return T.polygon(t,r,c)},a},"trapezoid"),Br=d(async(e,t)=>{const{shapeSvg:a,bbox:i}=await A(e,t,Y(t,void 0),!0),l=i.width+t.padding,s=i.height+t.padding,r=[{x:s/6,y:0},{x:l-s/6,y:0},{x:l+2*s/6,y:-s},{x:-2*s/6,y:-s}],n=U(a,l,s,r);return n.attr("style",t.style),N(t,n),t.intersect=function(c){return T.polygon(t,r,c)},a},"inv_trapezoid"),Cr=d(async(e,t)=>{const{shapeSvg:a,bbox:i}=await A(e,t,Y(t,void 0),!0),l=i.width+t.padding,s=i.height+t.padding,r=[{x:0,y:0},{x:l+s/2,y:0},{x:l,y:-s/2},{x:l+s/2,y:-s},{x:0,y:-s}],n=U(a,l,s,r);return n.attr("style",t.style),N(t,n),t.intersect=function(c){return T.polygon(t,r,c)},a},"rect_right_inv_arrow"),Ir=d(async(e,t)=>{const{shapeSvg:a,bbox:i}=await A(e,t,Y(t,void 0),!0),l=i.width+t.padding,s=l/2,r=s/(2.5+l/50),n=i.height+r+t.padding,c="M 0,"+r+" a "+s+","+r+" 0,0,0 "+l+" 0 a "+s+","+r+" 0,0,0 "+-l+" 0 l 0,"+n+" a "+s+","+r+" 0,0,0 "+l+" 0 l 0,"+-n,u=a.attr("label-offset-y",r).insert("path",":first-child").attr("style",t.style).attr("d",c).attr("transform","translate("+-l/2+","+-(n/2+r)+")");return N(t,u),t.intersect=function(o){const x=T.rect(t,o),w=x.x-t.x;if(s!=0&&(Math.abs(w)t.height/2-r)){let b=r*r*(1-w*w/(s*s));b!=0&&(b=Math.sqrt(b)),b=r-b,o.y-t.y>0&&(b=-b),x.y+=b}return x},a},"cylinder"),Or=d(async(e,t)=>{const{shapeSvg:a,bbox:i,halfPadding:l}=await A(e,t,"node "+t.classes+" "+t.class,!0),s=a.insert("rect",":first-child"),r=t.positioned?t.width:i.width+t.padding,n=t.positioned?t.height:i.height+t.padding,c=t.positioned?-r/2:-i.width/2-l,u=t.positioned?-n/2:-i.height/2-l;if(s.attr("class","basic label-container").attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("x",c).attr("y",u).attr("width",r).attr("height",n),t.props){const o=new Set(Object.keys(t.props));t.props.borders&&(ht(s,t.props.borders,r,n),o.delete("borders")),o.forEach(x=>{L.warn(`Unknown node property ${x}`)})}return N(t,s),t.intersect=function(o){return T.rect(t,o)},a},"rect"),Rr=d(async(e,t)=>{const{shapeSvg:a,bbox:i,halfPadding:l}=await A(e,t,"node "+t.classes,!0),s=a.insert("rect",":first-child"),r=t.positioned?t.width:i.width+t.padding,n=t.positioned?t.height:i.height+t.padding,c=t.positioned?-r/2:-i.width/2-l,u=t.positioned?-n/2:-i.height/2-l;if(s.attr("class","basic cluster composite label-container").attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("x",c).attr("y",u).attr("width",r).attr("height",n),t.props){const o=new Set(Object.keys(t.props));t.props.borders&&(ht(s,t.props.borders,r,n),o.delete("borders")),o.forEach(x=>{L.warn(`Unknown node property ${x}`)})}return N(t,s),t.intersect=function(o){return T.rect(t,o)},a},"composite"),zr=d(async(e,t)=>{const{shapeSvg:a}=await A(e,t,"label",!0);L.trace("Classes = ",t.class);const i=a.insert("rect",":first-child"),l=0,s=0;if(i.attr("width",l).attr("height",s),a.attr("class","label edgeLabel"),t.props){const r=new Set(Object.keys(t.props));t.props.borders&&(ht(i,t.props.borders,l,s),r.delete("borders")),r.forEach(n=>{L.warn(`Unknown node property ${n}`)})}return N(t,i),t.intersect=function(r){return T.rect(t,r)},a},"labelRect");function ht(e,t,a,i){const l=[],s=d(n=>{l.push(n,0)},"addBorder"),r=d(n=>{l.push(0,n)},"skipBorder");t.includes("t")?(L.debug("add top border"),s(a)):r(a),t.includes("r")?(L.debug("add right border"),s(i)):r(i),t.includes("b")?(L.debug("add bottom border"),s(a)):r(a),t.includes("l")?(L.debug("add left border"),s(i)):r(i),e.attr("stroke-dasharray",l.join(" "))}d(ht,"applyNodePropertyBorders");var Ar=d(async(e,t)=>{let a;t.classes?a="node "+t.classes:a="node default";const i=e.insert("g").attr("class",a).attr("id",t.domId||t.id),l=i.insert("rect",":first-child"),s=i.insert("line"),r=i.insert("g").attr("class","label"),n=t.labelText.flat?t.labelText.flat():t.labelText;let c="";typeof n=="object"?c=n[0]:c=n,L.info("Label text abc79",c,n,typeof n=="object");const u=r.node().appendChild(await K(c,t.labelStyle,!0,!0));let o={width:0,height:0};if(j(R().flowchart.htmlLabels)){const v=u.children[0],k=O(u);o=v.getBoundingClientRect(),k.attr("width",o.width),k.attr("height",o.height)}L.info("Text 2",n);const x=n.slice(1,n.length);let w=u.getBBox();const b=r.node().appendChild(await K(x.join?x.join("
"):x,t.labelStyle,!0,!0));if(j(R().flowchart.htmlLabels)){const v=b.children[0],k=O(b);o=v.getBoundingClientRect(),k.attr("width",o.width),k.attr("height",o.height)}const S=t.padding/2;return O(b).attr("transform","translate( "+(o.width>w.width?0:(w.width-o.width)/2)+", "+(w.height+S+5)+")"),O(u).attr("transform","translate( "+(o.width{const{shapeSvg:a,bbox:i}=await A(e,t,Y(t,void 0),!0),l=i.height+t.padding,s=i.width+l/4+t.padding,r=a.insert("rect",":first-child").attr("style",t.style).attr("rx",l/2).attr("ry",l/2).attr("x",-s/2).attr("y",-l/2).attr("width",s).attr("height",l);return N(t,r),t.intersect=function(n){return T.rect(t,n)},a},"stadium"),Fr=d(async(e,t)=>{const{shapeSvg:a,bbox:i,halfPadding:l}=await A(e,t,Y(t,void 0),!0),s=a.insert("circle",":first-child");return s.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),L.info("Circle main"),N(t,s),t.intersect=function(r){return L.info("Circle intersect",t,i.width/2+l,r),T.circle(t,i.width/2+l,r)},a},"circle"),Wr=d(async(e,t)=>{const{shapeSvg:a,bbox:i,halfPadding:l}=await A(e,t,Y(t,void 0),!0),s=5,r=a.insert("g",":first-child"),n=r.insert("circle"),c=r.insert("circle");return r.attr("class",t.class),n.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("r",i.width/2+l+s).attr("width",i.width+t.padding+s*2).attr("height",i.height+t.padding+s*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),L.info("DoubleCircle main"),N(t,n),t.intersect=function(u){return L.info("DoubleCircle intersect",t,i.width/2+l+s,u),T.circle(t,i.width/2+l+s,u)},a},"doublecircle"),Pr=d(async(e,t)=>{const{shapeSvg:a,bbox:i}=await A(e,t,Y(t,void 0),!0),l=i.width+t.padding,s=i.height+t.padding,r=[{x:0,y:0},{x:l,y:0},{x:l,y:-s},{x:0,y:-s},{x:0,y:0},{x:-8,y:0},{x:l+8,y:0},{x:l+8,y:-s},{x:-8,y:-s},{x:-8,y:0}],n=U(a,l,s,r);return n.attr("style",t.style),N(t,n),t.intersect=function(c){return T.polygon(t,r,c)},a},"subroutine"),Yr=d((e,t)=>{const 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),N(t,i),t.intersect=function(l){return T.circle(t,7,l)},a},"start"),Mt=d((e,t,a)=>{const i=e.insert("g").attr("class","node default").attr("id",t.domId||t.id);let l=70,s=10;a==="LR"&&(l=10,s=70);const r=i.append("rect").attr("x",-1*l/2).attr("y",-1*s/2).attr("width",l).attr("height",s).attr("class","fork-join");return N(t,r),t.height=t.height+t.padding/2,t.width=t.width+t.padding/2,t.intersect=function(n){return T.rect(t,n)},i},"forkJoin"),Hr=d((e,t)=>{const 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),N(t,l),t.intersect=function(s){return T.circle(t,7,s)},a},"end"),Kr=d(async(e,t)=>{const a=t.padding/2,i=4,l=8;let s;t.classes?s="node "+t.classes:s="node default";const r=e.insert("g").attr("class",s).attr("id",t.domId||t.id),n=r.insert("rect",":first-child"),c=r.insert("line"),u=r.insert("line");let o=0,x=i;const w=r.insert("g").attr("class","label");let b=0;const S=t.classData.annotations?.[0],v=t.classData.annotations[0]?"«"+t.classData.annotations[0]+"»":"",k=w.node().appendChild(await K(v,t.labelStyle,!0,!0));let B=k.getBBox();if(j(R().flowchart.htmlLabels)){const E=k.children[0],h=O(k);B=E.getBoundingClientRect(),h.attr("width",B.width),h.attr("height",B.height)}t.classData.annotations[0]&&(x+=B.height+i,o+=B.width);let _=t.classData.label;t.classData.type!==void 0&&t.classData.type!==""&&(R().flowchart.htmlLabels?_+="<"+t.classData.type+">":_+="<"+t.classData.type+">");const D=w.node().appendChild(await K(_,t.labelStyle,!0,!0));O(D).attr("class","classTitle");let y=D.getBBox();if(j(R().flowchart.htmlLabels)){const E=D.children[0],h=O(D);y=E.getBoundingClientRect(),h.attr("width",y.width),h.attr("height",y.height)}x+=y.height+i,y.width>o&&(o=y.width);const g=[];t.classData.members.forEach(async E=>{const h=E.getDisplayDetails();let W=h.displayText;R().flowchart.htmlLabels&&(W=W.replace(//g,">"));const p=w.node().appendChild(await K(W,h.cssStyle?h.cssStyle:t.labelStyle,!0,!0));let I=p.getBBox();if(j(R().flowchart.htmlLabels)){const Z=p.children[0],V=O(p);I=Z.getBoundingClientRect(),V.attr("width",I.width),V.attr("height",I.height)}I.width>o&&(o=I.width),x+=I.height+i,g.push(p)}),x+=l;const f=[];if(t.classData.methods.forEach(async E=>{const h=E.getDisplayDetails();let W=h.displayText;R().flowchart.htmlLabels&&(W=W.replace(//g,">"));const p=w.node().appendChild(await K(W,h.cssStyle?h.cssStyle:t.labelStyle,!0,!0));let I=p.getBBox();if(j(R().flowchart.htmlLabels)){const Z=p.children[0],V=O(p);I=Z.getBoundingClientRect(),V.attr("width",I.width),V.attr("height",I.height)}I.width>o&&(o=I.width),x+=I.height+i,f.push(p)}),x+=l,S){let E=(o-B.width)/2;O(k).attr("transform","translate( "+(-1*o/2+E)+", "+-1*x/2+")"),b=B.height+i}let m=(o-y.width)/2;return O(D).attr("transform","translate( "+(-1*o/2+m)+", "+(-1*x/2+b)+")"),b+=y.height+i,c.attr("class","divider").attr("x1",-o/2-a).attr("x2",o/2+a).attr("y1",-x/2-a+l+b).attr("y2",-x/2-a+l+b),b+=l,g.forEach(E=>{O(E).attr("transform","translate( "+-o/2+", "+(-1*x/2+b+l/2)+")");const h=E?.getBBox();b+=(h?.height??0)+i}),b+=l,u.attr("class","divider").attr("x1",-o/2-a).attr("x2",o/2+a).attr("y1",-x/2-a+l+b).attr("y2",-x/2-a+l+b),b+=l,f.forEach(E=>{O(E).attr("transform","translate( "+-o/2+", "+(-1*x/2+b)+")");const h=E?.getBBox();b+=(h?.height??0)+i}),n.attr("style",t.style).attr("class","outer title-state").attr("x",-o/2-a).attr("y",-(x/2)-a).attr("width",o+t.padding).attr("height",x+t.padding),N(t,n),t.intersect=function(E){return T.rect(t,E)},r},"class_box"),Ft={rhombus:At,composite:Rr,question:At,rect:Or,labelRect:zr,rectWithTitle:Ar,choice:kr,circle:Fr,doublecircle:Wr,stadium:Mr,hexagon:vr,block_arrow:Er,rect_left_inv_arrow:_r,lean_right:Dr,lean_left:Tr,trapezoid:Nr,inv_trapezoid:Br,rect_right_inv_arrow:Cr,cylinder:Ir,start:Yr,end:Hr,note:Sr,subroutine:Pr,fork:Mt,join:Mt,class_box:Kr},lt={},te=d(async(e,t,a)=>{let i,l;if(t.link){let s;R().securityLevel==="sandbox"?s="_top":t.linkTarget&&(s=t.linkTarget||"_blank"),i=e.insert("svg:a").attr("xlink:href",t.link).attr("target",s),l=await Ft[t.shape](i,t,a)}else l=await Ft[t.shape](e,t,a),i=l;return t.tooltip&&l.attr("title",t.tooltip),t.class&&l.attr("class","node default "+t.class),lt[t.id]=i,t.haveCallback&<[t.id].attr("class",lt[t.id].attr("class")+" clickable"),i},"insertNode"),Xr=d(e=>{const t=lt[e.id];L.trace("Transforming node",e.diff,e,"translate("+(e.x-e.width/2-5)+", "+e.width/2+")");const a=8,i=e.diff||0;return e.clusterNode?t.attr("transform","translate("+(e.x+i-e.width/2)+", "+(e.y-e.height/2-a)+")"):t.attr("transform","translate("+e.x+", "+e.y+")"),i},"positionNode");function Dt(e,t,a=!1){const i=e;let l="default";(i?.classes?.length||0)>0&&(l=(i?.classes??[]).join(" ")),l=l+" flowchart-label";let s=0,r="",n;switch(i.type){case"round":s=5,r="rect";break;case"composite":s=0,r="composite",n=0;break;case"square":r="rect";break;case"diamond":r="question";break;case"hexagon":r="hexagon";break;case"block_arrow":r="block_arrow";break;case"odd":r="rect_left_inv_arrow";break;case"lean_right":r="lean_right";break;case"lean_left":r="lean_left";break;case"trapezoid":r="trapezoid";break;case"inv_trapezoid":r="inv_trapezoid";break;case"rect_left_inv_arrow":r="rect_left_inv_arrow";break;case"circle":r="circle";break;case"ellipse":r="ellipse";break;case"stadium":r="stadium";break;case"subroutine":r="subroutine";break;case"cylinder":r="cylinder";break;case"group":r="rect";break;case"doublecircle":r="doublecircle";break;default:r="rect"}const c=me(i?.styles??[]),u=i.label,o=i.size??{width:0,height:0,x:0,y:0};return{labelStyle:c.labelStyle,shape:r,labelText:u,rx:s,ry:s,class:l,style:c.style,id:i.id,directions:i.directions,width:o.width,height:o.height,x:o.x,y:o.y,positioned:a,intersect:void 0,type:i.type,padding:n??rt()?.block?.padding??0}}d(Dt,"getNodeFromBlock");async function ee(e,t,a){const i=Dt(t,a,!1);if(i.type==="group")return;const l=rt(),s=await te(e,i,{config:l}),r=s.node().getBBox(),n=a.getBlock(i.id);n.size={width:r.width,height:r.height,x:0,y:0,node:s},a.setBlock(n),s.remove()}d(ee,"calculateBlockSize");async function re(e,t,a){const i=Dt(t,a,!0);if(a.getBlock(i.id).type!=="space"){const s=rt();await te(e,i,{config:s}),t.intersect=i?.intersect,Xr(i)}}d(re,"insertBlockPositioned");async function dt(e,t,a,i){for(const l of t)await i(e,l,a),l.children&&await dt(e,l.children,a,i)}d(dt,"performOperations");async function ae(e,t,a){await dt(e,t,a,ee)}d(ae,"calculateBlockSizes");async function se(e,t,a){await dt(e,t,a,re)}d(se,"insertBlocks");async function ie(e,t,a,i,l){const s=new Se({multigraph:!0,compound:!0});s.setGraph({rankdir:"TB",nodesep:10,ranksep:10,marginx:8,marginy:8});for(const r of a)r.size&&s.setNode(r.id,{width:r.size.width,height:r.size.height,intersect:r.intersect});for(const r of t)if(r.start&&r.end){const n=i.getBlock(r.start),c=i.getBlock(r.end);if(n?.size&&c?.size){const u=n.size,o=c.size,x=[{x:u.x,y:u.y},{x:u.x+(o.x-u.x)/2,y:u.y+(o.y-u.y)/2},{x:o.x,y:o.y}];gr(e,{v:r.start,w:r.end,name:r.id},{...r,arrowTypeEnd:r.arrowTypeEnd,arrowTypeStart:r.arrowTypeStart,points:x,classes:"edge-thickness-normal edge-pattern-solid flowchart-link LS-a1 LE-b1"},void 0,"block",s,l),r.label&&(await cr(e,{...r,label:r.label,labelStyle:"stroke: #333; stroke-width: 1.5px;fill:none;",arrowTypeEnd:r.arrowTypeEnd,arrowTypeStart:r.arrowTypeStart,points:x,classes:"edge-thickness-normal edge-pattern-solid flowchart-link LS-a1 LE-b1"}),or({...r,x:x[1].x,y:x[1].y},{originalPath:x}))}}}d(ie,"insertEdges");var Ur=d(function(e,t){return t.db.getClasses()},"getClasses"),jr=d(async function(e,t,a,i){const{securityLevel:l,block:s}=rt(),r=i.db;let n;l==="sandbox"&&(n=O("#i"+t));const c=l==="sandbox"?O(n.nodes()[0].contentDocument.body):O("body"),u=l==="sandbox"?c.select(`[id="${t}"]`):O(`[id="${t}"]`);ar(u,["point","circle","cross"],i.type,t);const x=r.getBlocks(),w=r.getBlocksFlat(),b=r.getEdges(),S=u.insert("g").attr("class","block");await ae(S,x,r);const v=jt(r);if(await se(S,x,r),await ie(S,b,w,r,t),v){const k=v,B=Math.max(1,Math.round(.125*(k.width/k.height))),_=k.height+B+10,D=k.width+10,{useMaxWidth:y}=s;he(u,_,D,!!y),L.debug("Here Bounds",v,k),u.attr("viewBox",`${k.x-5} ${k.y-5} ${k.width+10} ${k.height+10}`)}},"draw"),Vr={draw:jr,getClasses:Ur},ra={parser:ve,db:Ke,renderer:Vr,styles:Ue};export{ra as diagram};
diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/c4Diagram-YG6GDRKO-BaEi9NAL.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/c4Diagram-YG6GDRKO-BaEi9NAL.js
new file mode 100644
index 0000000000..379ca1429a
--- /dev/null
+++ b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/c4Diagram-YG6GDRKO-BaEi9NAL.js
@@ -0,0 +1,10 @@
+import{g as Se,d as De}from"./chunk-TZMSLE5B-DMZmIkT7.js";import{_ as g,v as Pe,w as Be,x as Ie,y as Me,z as Bt,B as jt,E as de,G as Le,J as Ne,K as Tt,L as ge,M as Ye,N as je,O as $t,P as fe}from"./index-DpOBiJiD.js";var Ft=(function(){var e=g(function(_t,x,m,v){for(m=m||{},v=_t.length;v--;m[_t[v]]=x);return m},"o"),t=[1,24],s=[1,25],o=[1,26],l=[1,27],a=[1,28],r=[1,63],n=[1,64],i=[1,65],u=[1,66],d=[1,67],y=[1,68],p=[1,69],E=[1,29],O=[1,30],S=[1,31],P=[1,32],M=[1,33],U=[1,34],H=[1,35],q=[1,36],G=[1,37],K=[1,38],J=[1,39],Z=[1,40],$=[1,41],tt=[1,42],et=[1,43],at=[1,44],it=[1,45],nt=[1,46],rt=[1,47],st=[1,48],lt=[1,50],ot=[1,51],ct=[1,52],ht=[1,53],ut=[1,54],dt=[1,55],ft=[1,56],pt=[1,57],yt=[1,58],gt=[1,59],bt=[1,60],Ct=[14,42],Qt=[14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],St=[12,14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],A=[1,82],k=[1,83],C=[1,84],w=[1,85],T=[12,14,42],le=[12,14,33,42],Mt=[12,14,33,42,76,77,79,80],vt=[12,33],Ht=[34,36,37,38,39,40,41,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],qt={trace:g(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,direction:5,direction_tb:6,direction_bt:7,direction_rl:8,direction_lr:9,graphConfig:10,C4_CONTEXT:11,NEWLINE:12,statements:13,EOF:14,C4_CONTAINER:15,C4_COMPONENT:16,C4_DYNAMIC:17,C4_DEPLOYMENT:18,otherStatements:19,diagramStatements:20,otherStatement:21,title:22,accDescription:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,boundaryStatement:29,boundaryStartStatement:30,boundaryStopStatement:31,boundaryStart:32,LBRACE:33,ENTERPRISE_BOUNDARY:34,attributes:35,SYSTEM_BOUNDARY:36,BOUNDARY:37,CONTAINER_BOUNDARY:38,NODE:39,NODE_L:40,NODE_R:41,RBRACE:42,diagramStatement:43,PERSON:44,PERSON_EXT:45,SYSTEM:46,SYSTEM_DB:47,SYSTEM_QUEUE:48,SYSTEM_EXT:49,SYSTEM_EXT_DB:50,SYSTEM_EXT_QUEUE:51,CONTAINER:52,CONTAINER_DB:53,CONTAINER_QUEUE:54,CONTAINER_EXT:55,CONTAINER_EXT_DB:56,CONTAINER_EXT_QUEUE:57,COMPONENT:58,COMPONENT_DB:59,COMPONENT_QUEUE:60,COMPONENT_EXT:61,COMPONENT_EXT_DB:62,COMPONENT_EXT_QUEUE:63,REL:64,BIREL:65,REL_U:66,REL_D:67,REL_L:68,REL_R:69,REL_B:70,REL_INDEX:71,UPDATE_EL_STYLE:72,UPDATE_REL_STYLE:73,UPDATE_LAYOUT_CONFIG:74,attribute:75,STR:76,STR_KEY:77,STR_VALUE:78,ATTRIBUTE:79,ATTRIBUTE_EMPTY:80,$accept:0,$end:1},terminals_:{2:"error",6:"direction_tb",7:"direction_bt",8:"direction_rl",9:"direction_lr",11:"C4_CONTEXT",12:"NEWLINE",14:"EOF",15:"C4_CONTAINER",16:"C4_COMPONENT",17:"C4_DYNAMIC",18:"C4_DEPLOYMENT",22:"title",23:"accDescription",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"LBRACE",34:"ENTERPRISE_BOUNDARY",36:"SYSTEM_BOUNDARY",37:"BOUNDARY",38:"CONTAINER_BOUNDARY",39:"NODE",40:"NODE_L",41:"NODE_R",42:"RBRACE",44:"PERSON",45:"PERSON_EXT",46:"SYSTEM",47:"SYSTEM_DB",48:"SYSTEM_QUEUE",49:"SYSTEM_EXT",50:"SYSTEM_EXT_DB",51:"SYSTEM_EXT_QUEUE",52:"CONTAINER",53:"CONTAINER_DB",54:"CONTAINER_QUEUE",55:"CONTAINER_EXT",56:"CONTAINER_EXT_DB",57:"CONTAINER_EXT_QUEUE",58:"COMPONENT",59:"COMPONENT_DB",60:"COMPONENT_QUEUE",61:"COMPONENT_EXT",62:"COMPONENT_EXT_DB",63:"COMPONENT_EXT_QUEUE",64:"REL",65:"BIREL",66:"REL_U",67:"REL_D",68:"REL_L",69:"REL_R",70:"REL_B",71:"REL_INDEX",72:"UPDATE_EL_STYLE",73:"UPDATE_REL_STYLE",74:"UPDATE_LAYOUT_CONFIG",76:"STR",77:"STR_KEY",78:"STR_VALUE",79:"ATTRIBUTE",80:"ATTRIBUTE_EMPTY"},productions_:[0,[3,1],[3,1],[5,1],[5,1],[5,1],[5,1],[4,1],[10,4],[10,4],[10,4],[10,4],[10,4],[13,1],[13,1],[13,2],[19,1],[19,2],[19,3],[21,1],[21,1],[21,2],[21,2],[21,1],[29,3],[30,3],[30,3],[30,4],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[31,1],[20,1],[20,2],[20,3],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,1],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[35,1],[35,2],[75,1],[75,2],[75,1],[75,1]],performAction:g(function(x,m,v,b,R,h,Dt){var f=h.length-1;switch(R){case 3:b.setDirection("TB");break;case 4:b.setDirection("BT");break;case 5:b.setDirection("RL");break;case 6:b.setDirection("LR");break;case 8:case 9:case 10:case 11:case 12:b.setC4Type(h[f-3]);break;case 19:b.setTitle(h[f].substring(6)),this.$=h[f].substring(6);break;case 20:b.setAccDescription(h[f].substring(15)),this.$=h[f].substring(15);break;case 21:this.$=h[f].trim(),b.setTitle(this.$);break;case 22:case 23:this.$=h[f].trim(),b.setAccDescription(this.$);break;case 28:h[f].splice(2,0,"ENTERPRISE"),b.addPersonOrSystemBoundary(...h[f]),this.$=h[f];break;case 29:h[f].splice(2,0,"SYSTEM"),b.addPersonOrSystemBoundary(...h[f]),this.$=h[f];break;case 30:b.addPersonOrSystemBoundary(...h[f]),this.$=h[f];break;case 31:h[f].splice(2,0,"CONTAINER"),b.addContainerBoundary(...h[f]),this.$=h[f];break;case 32:b.addDeploymentNode("node",...h[f]),this.$=h[f];break;case 33:b.addDeploymentNode("nodeL",...h[f]),this.$=h[f];break;case 34:b.addDeploymentNode("nodeR",...h[f]),this.$=h[f];break;case 35:b.popBoundaryParseStack();break;case 39:b.addPersonOrSystem("person",...h[f]),this.$=h[f];break;case 40:b.addPersonOrSystem("external_person",...h[f]),this.$=h[f];break;case 41:b.addPersonOrSystem("system",...h[f]),this.$=h[f];break;case 42:b.addPersonOrSystem("system_db",...h[f]),this.$=h[f];break;case 43:b.addPersonOrSystem("system_queue",...h[f]),this.$=h[f];break;case 44:b.addPersonOrSystem("external_system",...h[f]),this.$=h[f];break;case 45:b.addPersonOrSystem("external_system_db",...h[f]),this.$=h[f];break;case 46:b.addPersonOrSystem("external_system_queue",...h[f]),this.$=h[f];break;case 47:b.addContainer("container",...h[f]),this.$=h[f];break;case 48:b.addContainer("container_db",...h[f]),this.$=h[f];break;case 49:b.addContainer("container_queue",...h[f]),this.$=h[f];break;case 50:b.addContainer("external_container",...h[f]),this.$=h[f];break;case 51:b.addContainer("external_container_db",...h[f]),this.$=h[f];break;case 52:b.addContainer("external_container_queue",...h[f]),this.$=h[f];break;case 53:b.addComponent("component",...h[f]),this.$=h[f];break;case 54:b.addComponent("component_db",...h[f]),this.$=h[f];break;case 55:b.addComponent("component_queue",...h[f]),this.$=h[f];break;case 56:b.addComponent("external_component",...h[f]),this.$=h[f];break;case 57:b.addComponent("external_component_db",...h[f]),this.$=h[f];break;case 58:b.addComponent("external_component_queue",...h[f]),this.$=h[f];break;case 60:b.addRel("rel",...h[f]),this.$=h[f];break;case 61:b.addRel("birel",...h[f]),this.$=h[f];break;case 62:b.addRel("rel_u",...h[f]),this.$=h[f];break;case 63:b.addRel("rel_d",...h[f]),this.$=h[f];break;case 64:b.addRel("rel_l",...h[f]),this.$=h[f];break;case 65:b.addRel("rel_r",...h[f]),this.$=h[f];break;case 66:b.addRel("rel_b",...h[f]),this.$=h[f];break;case 67:h[f].splice(0,1),b.addRel("rel",...h[f]),this.$=h[f];break;case 68:b.updateElStyle("update_el_style",...h[f]),this.$=h[f];break;case 69:b.updateRelStyle("update_rel_style",...h[f]),this.$=h[f];break;case 70:b.updateLayoutConfig("update_layout_config",...h[f]),this.$=h[f];break;case 71:this.$=[h[f]];break;case 72:h[f].unshift(h[f-1]),this.$=h[f];break;case 73:case 75:this.$=h[f].trim();break;case 74:let Et={};Et[h[f-1].trim()]=h[f].trim(),this.$=Et;break;case 76:this.$="";break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],7:[1,6],8:[1,7],9:[1,8],10:4,11:[1,9],15:[1,10],16:[1,11],17:[1,12],18:[1,13]},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,7]},{1:[2,3]},{1:[2,4]},{1:[2,5]},{1:[2,6]},{12:[1,14]},{12:[1,15]},{12:[1,16]},{12:[1,17]},{12:[1,18]},{13:19,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:a,29:49,30:61,32:62,34:r,36:n,37:i,38:u,39:d,40:y,41:p,43:23,44:E,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:rt,63:st,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:70,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:a,29:49,30:61,32:62,34:r,36:n,37:i,38:u,39:d,40:y,41:p,43:23,44:E,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:rt,63:st,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:71,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:a,29:49,30:61,32:62,34:r,36:n,37:i,38:u,39:d,40:y,41:p,43:23,44:E,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:rt,63:st,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:72,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:a,29:49,30:61,32:62,34:r,36:n,37:i,38:u,39:d,40:y,41:p,43:23,44:E,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:rt,63:st,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:73,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:a,29:49,30:61,32:62,34:r,36:n,37:i,38:u,39:d,40:y,41:p,43:23,44:E,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:rt,63:st,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{14:[1,74]},e(Ct,[2,13],{43:23,29:49,30:61,32:62,20:75,34:r,36:n,37:i,38:u,39:d,40:y,41:p,44:E,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:rt,63:st,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt}),e(Ct,[2,14]),e(Qt,[2,16],{12:[1,76]}),e(Ct,[2,36],{12:[1,77]}),e(St,[2,19]),e(St,[2,20]),{25:[1,78]},{27:[1,79]},e(St,[2,23]),{35:80,75:81,76:A,77:k,79:C,80:w},{35:86,75:81,76:A,77:k,79:C,80:w},{35:87,75:81,76:A,77:k,79:C,80:w},{35:88,75:81,76:A,77:k,79:C,80:w},{35:89,75:81,76:A,77:k,79:C,80:w},{35:90,75:81,76:A,77:k,79:C,80:w},{35:91,75:81,76:A,77:k,79:C,80:w},{35:92,75:81,76:A,77:k,79:C,80:w},{35:93,75:81,76:A,77:k,79:C,80:w},{35:94,75:81,76:A,77:k,79:C,80:w},{35:95,75:81,76:A,77:k,79:C,80:w},{35:96,75:81,76:A,77:k,79:C,80:w},{35:97,75:81,76:A,77:k,79:C,80:w},{35:98,75:81,76:A,77:k,79:C,80:w},{35:99,75:81,76:A,77:k,79:C,80:w},{35:100,75:81,76:A,77:k,79:C,80:w},{35:101,75:81,76:A,77:k,79:C,80:w},{35:102,75:81,76:A,77:k,79:C,80:w},{35:103,75:81,76:A,77:k,79:C,80:w},{35:104,75:81,76:A,77:k,79:C,80:w},e(T,[2,59]),{35:105,75:81,76:A,77:k,79:C,80:w},{35:106,75:81,76:A,77:k,79:C,80:w},{35:107,75:81,76:A,77:k,79:C,80:w},{35:108,75:81,76:A,77:k,79:C,80:w},{35:109,75:81,76:A,77:k,79:C,80:w},{35:110,75:81,76:A,77:k,79:C,80:w},{35:111,75:81,76:A,77:k,79:C,80:w},{35:112,75:81,76:A,77:k,79:C,80:w},{35:113,75:81,76:A,77:k,79:C,80:w},{35:114,75:81,76:A,77:k,79:C,80:w},{35:115,75:81,76:A,77:k,79:C,80:w},{20:116,29:49,30:61,32:62,34:r,36:n,37:i,38:u,39:d,40:y,41:p,43:23,44:E,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:rt,63:st,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{12:[1,118],33:[1,117]},{35:119,75:81,76:A,77:k,79:C,80:w},{35:120,75:81,76:A,77:k,79:C,80:w},{35:121,75:81,76:A,77:k,79:C,80:w},{35:122,75:81,76:A,77:k,79:C,80:w},{35:123,75:81,76:A,77:k,79:C,80:w},{35:124,75:81,76:A,77:k,79:C,80:w},{35:125,75:81,76:A,77:k,79:C,80:w},{14:[1,126]},{14:[1,127]},{14:[1,128]},{14:[1,129]},{1:[2,8]},e(Ct,[2,15]),e(Qt,[2,17],{21:22,19:130,22:t,23:s,24:o,26:l,28:a}),e(Ct,[2,37],{19:20,20:21,21:22,43:23,29:49,30:61,32:62,13:131,22:t,23:s,24:o,26:l,28:a,34:r,36:n,37:i,38:u,39:d,40:y,41:p,44:E,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:rt,63:st,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt}),e(St,[2,21]),e(St,[2,22]),e(T,[2,39]),e(le,[2,71],{75:81,35:132,76:A,77:k,79:C,80:w}),e(Mt,[2,73]),{78:[1,133]},e(Mt,[2,75]),e(Mt,[2,76]),e(T,[2,40]),e(T,[2,41]),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(T,[2,52]),e(T,[2,53]),e(T,[2,54]),e(T,[2,55]),e(T,[2,56]),e(T,[2,57]),e(T,[2,58]),e(T,[2,60]),e(T,[2,61]),e(T,[2,62]),e(T,[2,63]),e(T,[2,64]),e(T,[2,65]),e(T,[2,66]),e(T,[2,67]),e(T,[2,68]),e(T,[2,69]),e(T,[2,70]),{31:134,42:[1,135]},{12:[1,136]},{33:[1,137]},e(vt,[2,28]),e(vt,[2,29]),e(vt,[2,30]),e(vt,[2,31]),e(vt,[2,32]),e(vt,[2,33]),e(vt,[2,34]),{1:[2,9]},{1:[2,10]},{1:[2,11]},{1:[2,12]},e(Qt,[2,18]),e(Ct,[2,38]),e(le,[2,72]),e(Mt,[2,74]),e(T,[2,24]),e(T,[2,35]),e(Ht,[2,25]),e(Ht,[2,26],{12:[1,138]}),e(Ht,[2,27])],defaultActions:{2:[2,1],3:[2,2],4:[2,7],5:[2,3],6:[2,4],7:[2,5],8:[2,6],74:[2,8],126:[2,9],127:[2,10],128:[2,11],129:[2,12]},parseError:g(function(x,m){if(m.recoverable)this.trace(x);else{var v=new Error(x);throw v.hash=m,v}},"parseError"),parse:g(function(x){var m=this,v=[0],b=[],R=[null],h=[],Dt=this.table,f="",Et=0,oe=0,we=2,ce=1,Te=h.slice.call(arguments,1),D=Object.create(this.lexer),At={yy:{}};for(var Gt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Gt)&&(At.yy[Gt]=this.yy[Gt]);D.setInput(x,At.yy),At.yy.lexer=D,At.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var Kt=D.yylloc;h.push(Kt);var Oe=D.options&&D.options.ranges;typeof At.yy.parseError=="function"?this.parseError=At.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Re(L){v.length=v.length-2*L,R.length=R.length-L,h.length=h.length-L}g(Re,"popStack");function he(){var L;return L=b.pop()||D.lex()||ce,typeof L!="number"&&(L instanceof Array&&(b=L,L=b.pop()),L=m.symbols_[L]||L),L}g(he,"lex");for(var I,kt,N,Jt,wt={},Nt,W,ue,Yt;;){if(kt=v[v.length-1],this.defaultActions[kt]?N=this.defaultActions[kt]:((I===null||typeof I>"u")&&(I=he()),N=Dt[kt]&&Dt[kt][I]),typeof N>"u"||!N.length||!N[0]){var Zt="";Yt=[];for(Nt in Dt[kt])this.terminals_[Nt]&&Nt>we&&Yt.push("'"+this.terminals_[Nt]+"'");D.showPosition?Zt="Parse error on line "+(Et+1)+`:
+`+D.showPosition()+`
+Expecting `+Yt.join(", ")+", got '"+(this.terminals_[I]||I)+"'":Zt="Parse error on line "+(Et+1)+": Unexpected "+(I==ce?"end of input":"'"+(this.terminals_[I]||I)+"'"),this.parseError(Zt,{text:D.match,token:this.terminals_[I]||I,line:D.yylineno,loc:Kt,expected:Yt})}if(N[0]instanceof Array&&N.length>1)throw new Error("Parse Error: multiple actions possible at state: "+kt+", token: "+I);switch(N[0]){case 1:v.push(I),R.push(D.yytext),h.push(D.yylloc),v.push(N[1]),I=null,oe=D.yyleng,f=D.yytext,Et=D.yylineno,Kt=D.yylloc;break;case 2:if(W=this.productions_[N[1]][1],wt.$=R[R.length-W],wt._$={first_line:h[h.length-(W||1)].first_line,last_line:h[h.length-1].last_line,first_column:h[h.length-(W||1)].first_column,last_column:h[h.length-1].last_column},Oe&&(wt._$.range=[h[h.length-(W||1)].range[0],h[h.length-1].range[1]]),Jt=this.performAction.apply(wt,[f,oe,Et,At.yy,N[1],R,h].concat(Te)),typeof Jt<"u")return Jt;W&&(v=v.slice(0,-1*W*2),R=R.slice(0,-1*W),h=h.slice(0,-1*W)),v.push(this.productions_[N[1]][0]),R.push(wt.$),h.push(wt._$),ue=Dt[v[v.length-2]][v[v.length-1]],v.push(ue);break;case 3:return!0}}return!0},"parse")},Ce=(function(){var _t={EOF:1,parseError:g(function(m,v){if(this.yy.parser)this.yy.parser.parseError(m,v);else throw new Error(m)},"parseError"),setInput:g(function(x,m){return this.yy=m||this.yy||{},this._input=x,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:g(function(){var x=this._input[0];this.yytext+=x,this.yyleng++,this.offset++,this.match+=x,this.matched+=x;var m=x.match(/(?:\r\n?|\n).*/g);return m?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),x},"input"),unput:g(function(x){var m=x.length,v=x.split(/(?:\r\n?|\n)/g);this._input=x+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-m),this.offset-=m;var b=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),v.length-1&&(this.yylineno-=v.length-1);var R=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:v?(v.length===b.length?this.yylloc.first_column:0)+b[b.length-v.length].length-v[0].length:this.yylloc.first_column-m},this.options.ranges&&(this.yylloc.range=[R[0],R[0]+this.yyleng-m]),this.yyleng=this.yytext.length,this},"unput"),more:g(function(){return this._more=!0,this},"more"),reject:g(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
+`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:g(function(x){this.unput(this.match.slice(x))},"less"),pastInput:g(function(){var x=this.matched.substr(0,this.matched.length-this.match.length);return(x.length>20?"...":"")+x.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:g(function(){var x=this.match;return x.length<20&&(x+=this._input.substr(0,20-x.length)),(x.substr(0,20)+(x.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:g(function(){var x=this.pastInput(),m=new Array(x.length+1).join("-");return x+this.upcomingInput()+`
+`+m+"^"},"showPosition"),test_match:g(function(x,m){var v,b,R;if(this.options.backtrack_lexer&&(R={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&&(R.yylloc.range=this.yylloc.range.slice(0))),b=x[0].match(/(?:\r\n?|\n).*/g),b&&(this.yylineno+=b.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:b?b[b.length-1].length-b[b.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+x[0].length},this.yytext+=x[0],this.match+=x[0],this.matches=x,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(x[0].length),this.matched+=x[0],v=this.performAction.call(this,this.yy,this,m,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),v)return v;if(this._backtrack){for(var h in R)this[h]=R[h];return!1}return!1},"test_match"),next:g(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var x,m,v,b;this._more||(this.yytext="",this.match="");for(var R=this._currentRules(),h=0;hm[0].length)){if(m=v,b=h,this.options.backtrack_lexer){if(x=this.test_match(v,R[h]),x!==!1)return x;if(this._backtrack){m=!1;continue}else return!1}else if(!this.options.flex)break}return m?(x=this.test_match(m,R[b]),x!==!1?x:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
+`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:g(function(){var m=this.next();return m||this.lex()},"lex"),begin:g(function(m){this.conditionStack.push(m)},"begin"),popState:g(function(){var m=this.conditionStack.length-1;return m>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:g(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:g(function(m){return m=this.conditionStack.length-1-Math.abs(m||0),m>=0?this.conditionStack[m]:"INITIAL"},"topState"),pushState:g(function(m){this.begin(m)},"pushState"),stateStackSize:g(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:g(function(m,v,b,R){switch(b){case 0:return 6;case 1:return 7;case 2:return 8;case 3:return 9;case 4:return 22;case 5:return 23;case 6:return this.begin("acc_title"),24;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),26;case 9:return this.popState(),"acc_descr_value";case 10:this.begin("acc_descr_multiline");break;case 11:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:break;case 14:c;break;case 15:return 12;case 16:break;case 17:return 11;case 18:return 15;case 19:return 16;case 20:return 17;case 21:return 18;case 22:return this.begin("person_ext"),45;case 23:return this.begin("person"),44;case 24:return this.begin("system_ext_queue"),51;case 25:return this.begin("system_ext_db"),50;case 26:return this.begin("system_ext"),49;case 27:return this.begin("system_queue"),48;case 28:return this.begin("system_db"),47;case 29:return this.begin("system"),46;case 30:return this.begin("boundary"),37;case 31:return this.begin("enterprise_boundary"),34;case 32:return this.begin("system_boundary"),36;case 33:return this.begin("container_ext_queue"),57;case 34:return this.begin("container_ext_db"),56;case 35:return this.begin("container_ext"),55;case 36:return this.begin("container_queue"),54;case 37:return this.begin("container_db"),53;case 38:return this.begin("container"),52;case 39:return this.begin("container_boundary"),38;case 40:return this.begin("component_ext_queue"),63;case 41:return this.begin("component_ext_db"),62;case 42:return this.begin("component_ext"),61;case 43:return this.begin("component_queue"),60;case 44:return this.begin("component_db"),59;case 45:return this.begin("component"),58;case 46:return this.begin("node"),39;case 47:return this.begin("node"),39;case 48:return this.begin("node_l"),40;case 49:return this.begin("node_r"),41;case 50:return this.begin("rel"),64;case 51:return this.begin("birel"),65;case 52:return this.begin("rel_u"),66;case 53:return this.begin("rel_u"),66;case 54:return this.begin("rel_d"),67;case 55:return this.begin("rel_d"),67;case 56:return this.begin("rel_l"),68;case 57:return this.begin("rel_l"),68;case 58:return this.begin("rel_r"),69;case 59:return this.begin("rel_r"),69;case 60:return this.begin("rel_b"),70;case 61:return this.begin("rel_index"),71;case 62:return this.begin("update_el_style"),72;case 63:return this.begin("update_rel_style"),73;case 64:return this.begin("update_layout_config"),74;case 65:return"EOF_IN_STRUCT";case 66:return this.begin("attribute"),"ATTRIBUTE_EMPTY";case 67:this.begin("attribute");break;case 68:this.popState(),this.popState();break;case 69:return 80;case 70:break;case 71:return 80;case 72:this.begin("string");break;case 73:this.popState();break;case 74:return"STR";case 75:this.begin("string_kv");break;case 76:return this.begin("string_kv_key"),"STR_KEY";case 77:this.popState(),this.begin("string_kv_value");break;case 78:return"STR_VALUE";case 79:this.popState(),this.popState();break;case 80:return"STR";case 81:return"LBRACE";case 82:return"RBRACE";case 83:return"SPACE";case 84:return"EOL";case 85:return 14}},"anonymous"),rules:[/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:title\s[^#\n;]+)/,/^(?:accDescription\s[^#\n;]+)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/,/^(?:%%[^\n]*(\r?\n)*)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:C4Context\b)/,/^(?:C4Container\b)/,/^(?:C4Component\b)/,/^(?:C4Dynamic\b)/,/^(?:C4Deployment\b)/,/^(?:Person_Ext\b)/,/^(?:Person\b)/,/^(?:SystemQueue_Ext\b)/,/^(?:SystemDb_Ext\b)/,/^(?:System_Ext\b)/,/^(?:SystemQueue\b)/,/^(?:SystemDb\b)/,/^(?:System\b)/,/^(?:Boundary\b)/,/^(?:Enterprise_Boundary\b)/,/^(?:System_Boundary\b)/,/^(?:ContainerQueue_Ext\b)/,/^(?:ContainerDb_Ext\b)/,/^(?:Container_Ext\b)/,/^(?:ContainerQueue\b)/,/^(?:ContainerDb\b)/,/^(?:Container\b)/,/^(?:Container_Boundary\b)/,/^(?:ComponentQueue_Ext\b)/,/^(?:ComponentDb_Ext\b)/,/^(?:Component_Ext\b)/,/^(?:ComponentQueue\b)/,/^(?:ComponentDb\b)/,/^(?:Component\b)/,/^(?:Deployment_Node\b)/,/^(?:Node\b)/,/^(?:Node_L\b)/,/^(?:Node_R\b)/,/^(?:Rel\b)/,/^(?:BiRel\b)/,/^(?:Rel_Up\b)/,/^(?:Rel_U\b)/,/^(?:Rel_Down\b)/,/^(?:Rel_D\b)/,/^(?:Rel_Left\b)/,/^(?:Rel_L\b)/,/^(?:Rel_Right\b)/,/^(?:Rel_R\b)/,/^(?:Rel_Back\b)/,/^(?:RelIndex\b)/,/^(?:UpdateElementStyle\b)/,/^(?:UpdateRelStyle\b)/,/^(?:UpdateLayoutConfig\b)/,/^(?:$)/,/^(?:[(][ ]*[,])/,/^(?:[(])/,/^(?:[)])/,/^(?:,,)/,/^(?:,)/,/^(?:[ ]*["]["])/,/^(?:[ ]*["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:[ ]*[\$])/,/^(?:[^=]*)/,/^(?:[=][ ]*["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:[^,]+)/,/^(?:\{)/,/^(?:\})/,/^(?:[\s]+)/,/^(?:[\n\r]+)/,/^(?:$)/],conditions:{acc_descr_multiline:{rules:[11,12],inclusive:!1},acc_descr:{rules:[9],inclusive:!1},acc_title:{rules:[7],inclusive:!1},string_kv_value:{rules:[78,79],inclusive:!1},string_kv_key:{rules:[77],inclusive:!1},string_kv:{rules:[76],inclusive:!1},string:{rules:[73,74],inclusive:!1},attribute:{rules:[68,69,70,71,72,75,80],inclusive:!1},update_layout_config:{rules:[65,66,67,68],inclusive:!1},update_rel_style:{rules:[65,66,67,68],inclusive:!1},update_el_style:{rules:[65,66,67,68],inclusive:!1},rel_b:{rules:[65,66,67,68],inclusive:!1},rel_r:{rules:[65,66,67,68],inclusive:!1},rel_l:{rules:[65,66,67,68],inclusive:!1},rel_d:{rules:[65,66,67,68],inclusive:!1},rel_u:{rules:[65,66,67,68],inclusive:!1},rel_bi:{rules:[],inclusive:!1},rel:{rules:[65,66,67,68],inclusive:!1},node_r:{rules:[65,66,67,68],inclusive:!1},node_l:{rules:[65,66,67,68],inclusive:!1},node:{rules:[65,66,67,68],inclusive:!1},index:{rules:[],inclusive:!1},rel_index:{rules:[65,66,67,68],inclusive:!1},component_ext_queue:{rules:[],inclusive:!1},component_ext_db:{rules:[65,66,67,68],inclusive:!1},component_ext:{rules:[65,66,67,68],inclusive:!1},component_queue:{rules:[65,66,67,68],inclusive:!1},component_db:{rules:[65,66,67,68],inclusive:!1},component:{rules:[65,66,67,68],inclusive:!1},container_boundary:{rules:[65,66,67,68],inclusive:!1},container_ext_queue:{rules:[65,66,67,68],inclusive:!1},container_ext_db:{rules:[65,66,67,68],inclusive:!1},container_ext:{rules:[65,66,67,68],inclusive:!1},container_queue:{rules:[65,66,67,68],inclusive:!1},container_db:{rules:[65,66,67,68],inclusive:!1},container:{rules:[65,66,67,68],inclusive:!1},birel:{rules:[65,66,67,68],inclusive:!1},system_boundary:{rules:[65,66,67,68],inclusive:!1},enterprise_boundary:{rules:[65,66,67,68],inclusive:!1},boundary:{rules:[65,66,67,68],inclusive:!1},system_ext_queue:{rules:[65,66,67,68],inclusive:!1},system_ext_db:{rules:[65,66,67,68],inclusive:!1},system_ext:{rules:[65,66,67,68],inclusive:!1},system_queue:{rules:[65,66,67,68],inclusive:!1},system_db:{rules:[65,66,67,68],inclusive:!1},system:{rules:[65,66,67,68],inclusive:!1},person_ext:{rules:[65,66,67,68],inclusive:!1},person:{rules:[65,66,67,68],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,8,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,81,82,83,84,85],inclusive:!0}}};return _t})();qt.lexer=Ce;function Lt(){this.yy={}}return g(Lt,"Parser"),Lt.prototype=qt,qt.Parser=Lt,new Lt})();Ft.parser=Ft;var Ue=Ft,V=[],xt=[""],B="global",F="",X=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],It=[],ie="",ne=!1,Vt=4,zt=2,be,Fe=g(function(){return be},"getC4Type"),Ve=g(function(e){be=ge(e,Bt())},"setC4Type"),ze=g(function(e,t,s,o,l,a,r,n,i){if(e==null||t===void 0||t===null||s===void 0||s===null||o===void 0||o===null)return;let u={};const d=It.find(y=>y.from===t&&y.to===s);if(d?u=d:It.push(u),u.type=e,u.from=t,u.to=s,u.label={text:o},l==null)u.techn={text:""};else if(typeof l=="object"){let[y,p]=Object.entries(l)[0];u[y]={text:p}}else u.techn={text:l};if(a==null)u.descr={text:""};else if(typeof a=="object"){let[y,p]=Object.entries(a)[0];u[y]={text:p}}else u.descr={text:a};if(typeof r=="object"){let[y,p]=Object.entries(r)[0];u[y]=p}else u.sprite=r;if(typeof n=="object"){let[y,p]=Object.entries(n)[0];u[y]=p}else u.tags=n;if(typeof i=="object"){let[y,p]=Object.entries(i)[0];u[y]=p}else u.link=i;u.wrap=mt()},"addRel"),Xe=g(function(e,t,s,o,l,a,r){if(t===null||s===null)return;let n={};const i=V.find(u=>u.alias===t);if(i&&t===i.alias?n=i:(n.alias=t,V.push(n)),s==null?n.label={text:""}:n.label={text:s},o==null)n.descr={text:""};else if(typeof o=="object"){let[u,d]=Object.entries(o)[0];n[u]={text:d}}else n.descr={text:o};if(typeof l=="object"){let[u,d]=Object.entries(l)[0];n[u]=d}else n.sprite=l;if(typeof a=="object"){let[u,d]=Object.entries(a)[0];n[u]=d}else n.tags=a;if(typeof r=="object"){let[u,d]=Object.entries(r)[0];n[u]=d}else n.link=r;n.typeC4Shape={text:e},n.parentBoundary=B,n.wrap=mt()},"addPersonOrSystem"),We=g(function(e,t,s,o,l,a,r,n){if(t===null||s===null)return;let i={};const u=V.find(d=>d.alias===t);if(u&&t===u.alias?i=u:(i.alias=t,V.push(i)),s==null?i.label={text:""}:i.label={text:s},o==null)i.techn={text:""};else if(typeof o=="object"){let[d,y]=Object.entries(o)[0];i[d]={text:y}}else i.techn={text:o};if(l==null)i.descr={text:""};else if(typeof l=="object"){let[d,y]=Object.entries(l)[0];i[d]={text:y}}else i.descr={text:l};if(typeof a=="object"){let[d,y]=Object.entries(a)[0];i[d]=y}else i.sprite=a;if(typeof r=="object"){let[d,y]=Object.entries(r)[0];i[d]=y}else i.tags=r;if(typeof n=="object"){let[d,y]=Object.entries(n)[0];i[d]=y}else i.link=n;i.wrap=mt(),i.typeC4Shape={text:e},i.parentBoundary=B},"addContainer"),Qe=g(function(e,t,s,o,l,a,r,n){if(t===null||s===null)return;let i={};const u=V.find(d=>d.alias===t);if(u&&t===u.alias?i=u:(i.alias=t,V.push(i)),s==null?i.label={text:""}:i.label={text:s},o==null)i.techn={text:""};else if(typeof o=="object"){let[d,y]=Object.entries(o)[0];i[d]={text:y}}else i.techn={text:o};if(l==null)i.descr={text:""};else if(typeof l=="object"){let[d,y]=Object.entries(l)[0];i[d]={text:y}}else i.descr={text:l};if(typeof a=="object"){let[d,y]=Object.entries(a)[0];i[d]=y}else i.sprite=a;if(typeof r=="object"){let[d,y]=Object.entries(r)[0];i[d]=y}else i.tags=r;if(typeof n=="object"){let[d,y]=Object.entries(n)[0];i[d]=y}else i.link=n;i.wrap=mt(),i.typeC4Shape={text:e},i.parentBoundary=B},"addComponent"),He=g(function(e,t,s,o,l){if(e===null||t===null)return;let a={};const r=X.find(n=>n.alias===e);if(r&&e===r.alias?a=r:(a.alias=e,X.push(a)),t==null?a.label={text:""}:a.label={text:t},s==null)a.type={text:"system"};else if(typeof s=="object"){let[n,i]=Object.entries(s)[0];a[n]={text:i}}else a.type={text:s};if(typeof o=="object"){let[n,i]=Object.entries(o)[0];a[n]=i}else a.tags=o;if(typeof l=="object"){let[n,i]=Object.entries(l)[0];a[n]=i}else a.link=l;a.parentBoundary=B,a.wrap=mt(),F=B,B=e,xt.push(F)},"addPersonOrSystemBoundary"),qe=g(function(e,t,s,o,l){if(e===null||t===null)return;let a={};const r=X.find(n=>n.alias===e);if(r&&e===r.alias?a=r:(a.alias=e,X.push(a)),t==null?a.label={text:""}:a.label={text:t},s==null)a.type={text:"container"};else if(typeof s=="object"){let[n,i]=Object.entries(s)[0];a[n]={text:i}}else a.type={text:s};if(typeof o=="object"){let[n,i]=Object.entries(o)[0];a[n]=i}else a.tags=o;if(typeof l=="object"){let[n,i]=Object.entries(l)[0];a[n]=i}else a.link=l;a.parentBoundary=B,a.wrap=mt(),F=B,B=e,xt.push(F)},"addContainerBoundary"),Ge=g(function(e,t,s,o,l,a,r,n){if(t===null||s===null)return;let i={};const u=X.find(d=>d.alias===t);if(u&&t===u.alias?i=u:(i.alias=t,X.push(i)),s==null?i.label={text:""}:i.label={text:s},o==null)i.type={text:"node"};else if(typeof o=="object"){let[d,y]=Object.entries(o)[0];i[d]={text:y}}else i.type={text:o};if(l==null)i.descr={text:""};else if(typeof l=="object"){let[d,y]=Object.entries(l)[0];i[d]={text:y}}else i.descr={text:l};if(typeof r=="object"){let[d,y]=Object.entries(r)[0];i[d]=y}else i.tags=r;if(typeof n=="object"){let[d,y]=Object.entries(n)[0];i[d]=y}else i.link=n;i.nodeType=e,i.parentBoundary=B,i.wrap=mt(),F=B,B=t,xt.push(F)},"addDeploymentNode"),Ke=g(function(){B=F,xt.pop(),F=xt.pop(),xt.push(F)},"popBoundaryParseStack"),Je=g(function(e,t,s,o,l,a,r,n,i,u,d){let y=V.find(p=>p.alias===t);if(!(y===void 0&&(y=X.find(p=>p.alias===t),y===void 0))){if(s!=null)if(typeof s=="object"){let[p,E]=Object.entries(s)[0];y[p]=E}else y.bgColor=s;if(o!=null)if(typeof o=="object"){let[p,E]=Object.entries(o)[0];y[p]=E}else y.fontColor=o;if(l!=null)if(typeof l=="object"){let[p,E]=Object.entries(l)[0];y[p]=E}else y.borderColor=l;if(a!=null)if(typeof a=="object"){let[p,E]=Object.entries(a)[0];y[p]=E}else y.shadowing=a;if(r!=null)if(typeof r=="object"){let[p,E]=Object.entries(r)[0];y[p]=E}else y.shape=r;if(n!=null)if(typeof n=="object"){let[p,E]=Object.entries(n)[0];y[p]=E}else y.sprite=n;if(i!=null)if(typeof i=="object"){let[p,E]=Object.entries(i)[0];y[p]=E}else y.techn=i;if(u!=null)if(typeof u=="object"){let[p,E]=Object.entries(u)[0];y[p]=E}else y.legendText=u;if(d!=null)if(typeof d=="object"){let[p,E]=Object.entries(d)[0];y[p]=E}else y.legendSprite=d}},"updateElStyle"),Ze=g(function(e,t,s,o,l,a,r){const n=It.find(i=>i.from===t&&i.to===s);if(n!==void 0){if(o!=null)if(typeof o=="object"){let[i,u]=Object.entries(o)[0];n[i]=u}else n.textColor=o;if(l!=null)if(typeof l=="object"){let[i,u]=Object.entries(l)[0];n[i]=u}else n.lineColor=l;if(a!=null)if(typeof a=="object"){let[i,u]=Object.entries(a)[0];n[i]=parseInt(u)}else n.offsetX=parseInt(a);if(r!=null)if(typeof r=="object"){let[i,u]=Object.entries(r)[0];n[i]=parseInt(u)}else n.offsetY=parseInt(r)}},"updateRelStyle"),$e=g(function(e,t,s){let o=Vt,l=zt;if(typeof t=="object"){const a=Object.values(t)[0];o=parseInt(a)}else o=parseInt(t);if(typeof s=="object"){const a=Object.values(s)[0];l=parseInt(a)}else l=parseInt(s);o>=1&&(Vt=o),l>=1&&(zt=l)},"updateLayoutConfig"),t0=g(function(){return Vt},"getC4ShapeInRow"),e0=g(function(){return zt},"getC4BoundaryInRow"),a0=g(function(){return B},"getCurrentBoundaryParse"),i0=g(function(){return F},"getParentBoundaryParse"),_e=g(function(e){return e==null?V:V.filter(t=>t.parentBoundary===e)},"getC4ShapeArray"),n0=g(function(e){return V.find(t=>t.alias===e)},"getC4Shape"),r0=g(function(e){return Object.keys(_e(e))},"getC4ShapeKeys"),xe=g(function(e){return e==null?X:X.filter(t=>t.parentBoundary===e)},"getBoundaries"),s0=xe,l0=g(function(){return It},"getRels"),o0=g(function(){return ie},"getTitle"),c0=g(function(e){ne=e},"setWrap"),mt=g(function(){return ne},"autoWrap"),h0=g(function(){V=[],X=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],F="",B="global",xt=[""],It=[],xt=[""],ie="",ne=!1,Vt=4,zt=2},"clear"),u0={SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,LOOP_START:10,LOOP_END:11,ALT_START:12,ALT_ELSE:13,ALT_END:14,OPT_START:15,OPT_END:16,ACTIVE_START:17,ACTIVE_END:18,PAR_START:19,PAR_AND:20,PAR_END:21,RECT_START:22,RECT_END:23,SOLID_POINT:24,DOTTED_POINT:25},d0={FILLED:0,OPEN:1},f0={LEFTOF:0,RIGHTOF:1,OVER:2},p0=g(function(e){ie=ge(e,Bt())},"setTitle"),te={addPersonOrSystem:Xe,addPersonOrSystemBoundary:He,addContainer:We,addContainerBoundary:qe,addComponent:Qe,addDeploymentNode:Ge,popBoundaryParseStack:Ke,addRel:ze,updateElStyle:Je,updateRelStyle:Ze,updateLayoutConfig:$e,autoWrap:mt,setWrap:c0,getC4ShapeArray:_e,getC4Shape:n0,getC4ShapeKeys:r0,getBoundaries:xe,getBoundarys:s0,getCurrentBoundaryParse:a0,getParentBoundaryParse:i0,getRels:l0,getTitle:o0,getC4Type:Fe,getC4ShapeInRow:t0,getC4BoundaryInRow:e0,setAccTitle:Me,getAccTitle:Ie,getAccDescription:Be,setAccDescription:Pe,getConfig:g(()=>Bt().c4,"getConfig"),clear:h0,LINETYPE:u0,ARROWTYPE:d0,PLACEMENT:f0,setTitle:p0,setC4Type:Ve},re=g(function(e,t){return De(e,t)},"drawRect"),me=g(function(e,t,s,o,l,a){const r=e.append("image");r.attr("width",t),r.attr("height",s),r.attr("x",o),r.attr("y",l);let n=a.startsWith("data:image/png;base64")?a:Ye.sanitizeUrl(a);r.attr("xlink:href",n)},"drawImage"),y0=g((e,t,s)=>{const o=e.append("g");let l=0;for(let a of t){let r=a.textColor?a.textColor:"#444444",n=a.lineColor?a.lineColor:"#444444",i=a.offsetX?parseInt(a.offsetX):0,u=a.offsetY?parseInt(a.offsetY):0,d="";if(l===0){let p=o.append("line");p.attr("x1",a.startPoint.x),p.attr("y1",a.startPoint.y),p.attr("x2",a.endPoint.x),p.attr("y2",a.endPoint.y),p.attr("stroke-width","1"),p.attr("stroke",n),p.style("fill","none"),a.type!=="rel_b"&&p.attr("marker-end","url("+d+"#arrowhead)"),(a.type==="birel"||a.type==="rel_b")&&p.attr("marker-start","url("+d+"#arrowend)"),l=-1}else{let p=o.append("path");p.attr("fill","none").attr("stroke-width","1").attr("stroke",n).attr("d","Mstartx,starty Qcontrolx,controly stopx,stopy ".replaceAll("startx",a.startPoint.x).replaceAll("starty",a.startPoint.y).replaceAll("controlx",a.startPoint.x+(a.endPoint.x-a.startPoint.x)/2-(a.endPoint.x-a.startPoint.x)/4).replaceAll("controly",a.startPoint.y+(a.endPoint.y-a.startPoint.y)/2).replaceAll("stopx",a.endPoint.x).replaceAll("stopy",a.endPoint.y)),a.type!=="rel_b"&&p.attr("marker-end","url("+d+"#arrowhead)"),(a.type==="birel"||a.type==="rel_b")&&p.attr("marker-start","url("+d+"#arrowend)")}let y=s.messageFont();Q(s)(a.label.text,o,Math.min(a.startPoint.x,a.endPoint.x)+Math.abs(a.endPoint.x-a.startPoint.x)/2+i,Math.min(a.startPoint.y,a.endPoint.y)+Math.abs(a.endPoint.y-a.startPoint.y)/2+u,a.label.width,a.label.height,{fill:r},y),a.techn&&a.techn.text!==""&&(y=s.messageFont(),Q(s)("["+a.techn.text+"]",o,Math.min(a.startPoint.x,a.endPoint.x)+Math.abs(a.endPoint.x-a.startPoint.x)/2+i,Math.min(a.startPoint.y,a.endPoint.y)+Math.abs(a.endPoint.y-a.startPoint.y)/2+s.messageFontSize+5+u,Math.max(a.label.width,a.techn.width),a.techn.height,{fill:r,"font-style":"italic"},y))}},"drawRels"),g0=g(function(e,t,s){const o=e.append("g");let l=t.bgColor?t.bgColor:"none",a=t.borderColor?t.borderColor:"#444444",r=t.fontColor?t.fontColor:"black",n={"stroke-width":1,"stroke-dasharray":"7.0,7.0"};t.nodeType&&(n={"stroke-width":1});let i={x:t.x,y:t.y,fill:l,stroke:a,width:t.width,height:t.height,rx:2.5,ry:2.5,attrs:n};re(o,i);let u=s.boundaryFont();u.fontWeight="bold",u.fontSize=u.fontSize+2,u.fontColor=r,Q(s)(t.label.text,o,t.x,t.y+t.label.Y,t.width,t.height,{fill:"#444444"},u),t.type&&t.type.text!==""&&(u=s.boundaryFont(),u.fontColor=r,Q(s)(t.type.text,o,t.x,t.y+t.type.Y,t.width,t.height,{fill:"#444444"},u)),t.descr&&t.descr.text!==""&&(u=s.boundaryFont(),u.fontSize=u.fontSize-2,u.fontColor=r,Q(s)(t.descr.text,o,t.x,t.y+t.descr.Y,t.width,t.height,{fill:"#444444"},u))},"drawBoundary"),b0=g(function(e,t,s){let o=t.bgColor?t.bgColor:s[t.typeC4Shape.text+"_bg_color"],l=t.borderColor?t.borderColor:s[t.typeC4Shape.text+"_border_color"],a=t.fontColor?t.fontColor:"#FFFFFF",r="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII=";switch(t.typeC4Shape.text){case"person":r="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII=";break;case"external_person":r="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAAB6ElEQVR4Xu2YLY+EMBCG9+dWr0aj0Wg0Go1Go0+j8Xdv2uTCvv1gpt0ebHKPuhDaeW4605Z9mJvx4AdXUyTUdd08z+u6flmWZRnHsWkafk9DptAwDPu+f0eAYtu2PEaGWuj5fCIZrBAC2eLBAnRCsEkkxmeaJp7iDJ2QMDdHsLg8SxKFEJaAo8lAXnmuOFIhTMpxxKATebo4UiFknuNo4OniSIXQyRxEA3YsnjGCVEjVXD7yLUAqxBGUyPv/Y4W2beMgGuS7kVQIBycH0fD+oi5pezQETxdHKmQKGk1eQEYldK+jw5GxPfZ9z7Mk0Qnhf1W1m3w//EUn5BDmSZsbR44QQLBEqrBHqOrmSKaQAxdnLArCrxZcM7A7ZKs4ioRq8LFC+NpC3WCBJsvpVw5edm9iEXFuyNfxXAgSwfrFQ1c0iNda8AdejvUgnktOtJQQxmcfFzGglc5WVCj7oDgFqU18boeFSs52CUh8LE8BIVQDT1ABrB0HtgSEYlX5doJnCwv9TXocKCaKbnwhdDKPq4lf3SwU3HLq4V/+WYhHVMa/3b4IlfyikAduCkcBc7mQ3/z/Qq/cTuikhkzB12Ae/mcJC9U+Vo8Ej1gWAtgbeGgFsAMHr50BIWOLCbezvhpBFUdY6EJuJ/QDW0XoMX60zZ0AAAAASUVORK5CYII=";break}const n=e.append("g");n.attr("class","person-man");const i=Se();switch(t.typeC4Shape.text){case"person":case"external_person":case"system":case"external_system":case"container":case"external_container":case"component":case"external_component":i.x=t.x,i.y=t.y,i.fill=o,i.width=t.width,i.height=t.height,i.stroke=l,i.rx=2.5,i.ry=2.5,i.attrs={"stroke-width":.5},re(n,i);break;case"system_db":case"external_system_db":case"container_db":case"external_container_db":case"component_db":case"external_component_db":n.append("path").attr("fill",o).attr("stroke-width","0.5").attr("stroke",l).attr("d","Mstartx,startyc0,-10 half,-10 half,-10c0,0 half,0 half,10l0,heightc0,10 -half,10 -half,10c0,0 -half,0 -half,-10l0,-height".replaceAll("startx",t.x).replaceAll("starty",t.y).replaceAll("half",t.width/2).replaceAll("height",t.height)),n.append("path").attr("fill","none").attr("stroke-width","0.5").attr("stroke",l).attr("d","Mstartx,startyc0,10 half,10 half,10c0,0 half,0 half,-10".replaceAll("startx",t.x).replaceAll("starty",t.y).replaceAll("half",t.width/2));break;case"system_queue":case"external_system_queue":case"container_queue":case"external_container_queue":case"component_queue":case"external_component_queue":n.append("path").attr("fill",o).attr("stroke-width","0.5").attr("stroke",l).attr("d","Mstartx,startylwidth,0c5,0 5,half 5,halfc0,0 0,half -5,halfl-width,0c-5,0 -5,-half -5,-halfc0,0 0,-half 5,-half".replaceAll("startx",t.x).replaceAll("starty",t.y).replaceAll("width",t.width).replaceAll("half",t.height/2)),n.append("path").attr("fill","none").attr("stroke-width","0.5").attr("stroke",l).attr("d","Mstartx,startyc-5,0 -5,half -5,halfc0,half 5,half 5,half".replaceAll("startx",t.x+t.width).replaceAll("starty",t.y).replaceAll("half",t.height/2));break}let u=w0(s,t.typeC4Shape.text);switch(n.append("text").attr("fill",a).attr("font-family",u.fontFamily).attr("font-size",u.fontSize-2).attr("font-style","italic").attr("lengthAdjust","spacing").attr("textLength",t.typeC4Shape.width).attr("x",t.x+t.width/2-t.typeC4Shape.width/2).attr("y",t.y+t.typeC4Shape.Y).text("<<"+t.typeC4Shape.text+">>"),t.typeC4Shape.text){case"person":case"external_person":me(n,48,48,t.x+t.width/2-24,t.y+t.image.Y,r);break}let d=s[t.typeC4Shape.text+"Font"]();return d.fontWeight="bold",d.fontSize=d.fontSize+2,d.fontColor=a,Q(s)(t.label.text,n,t.x,t.y+t.label.Y,t.width,t.height,{fill:a},d),d=s[t.typeC4Shape.text+"Font"](),d.fontColor=a,t.techn&&t.techn?.text!==""?Q(s)(t.techn.text,n,t.x,t.y+t.techn.Y,t.width,t.height,{fill:a,"font-style":"italic"},d):t.type&&t.type.text!==""&&Q(s)(t.type.text,n,t.x,t.y+t.type.Y,t.width,t.height,{fill:a,"font-style":"italic"},d),t.descr&&t.descr.text!==""&&(d=s.personFont(),d.fontColor=a,Q(s)(t.descr.text,n,t.x,t.y+t.descr.Y,t.width,t.height,{fill:a},d)),t.height},"drawC4Shape"),_0=g(function(e){e.append("defs").append("symbol").attr("id","database").attr("fill-rule","evenodd").attr("clip-rule","evenodd").append("path").attr("transform","scale(.5)").attr("d","M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z")},"insertDatabaseIcon"),x0=g(function(e){e.append("defs").append("symbol").attr("id","computer").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z")},"insertComputerIcon"),m0=g(function(e){e.append("defs").append("symbol").attr("id","clock").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z")},"insertClockIcon"),v0=g(function(e){e.append("defs").append("marker").attr("id","arrowhead").attr("refX",9).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")},"insertArrowHead"),E0=g(function(e){e.append("defs").append("marker").attr("id","arrowend").attr("refX",1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 z")},"insertArrowEnd"),A0=g(function(e){e.append("defs").append("marker").attr("id","filled-head").attr("refX",18).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")},"insertArrowFilledHead"),k0=g(function(e){e.append("defs").append("marker").attr("id","sequencenumber").attr("refX",15).attr("refY",15).attr("markerWidth",60).attr("markerHeight",40).attr("orient","auto").append("circle").attr("cx",15).attr("cy",15).attr("r",6)},"insertDynamicNumber"),C0=g(function(e){const s=e.append("defs").append("marker").attr("id","crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",16).attr("refY",4);s.append("path").attr("fill","black").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1px").attr("d","M 9,2 V 6 L16,4 Z"),s.append("path").attr("fill","none").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1px").attr("d","M 0,1 L 6,7 M 6,1 L 0,7")},"insertArrowCrossHead"),w0=g((e,t)=>({fontFamily:e[t+"FontFamily"],fontSize:e[t+"FontSize"],fontWeight:e[t+"FontWeight"]}),"getC4ShapeFont"),Q=(function(){function e(l,a,r,n,i,u,d){const y=a.append("text").attr("x",r+i/2).attr("y",n+u/2+5).style("text-anchor","middle").text(l);o(y,d)}g(e,"byText");function t(l,a,r,n,i,u,d,y){const{fontSize:p,fontFamily:E,fontWeight:O}=y,S=l.split($t.lineBreakRegex);for(let P=0;P=this.data.widthLimit||o>=this.data.widthLimit||this.nextData.cnt>ve)&&(s=this.nextData.startx+t.margin+_.nextLinePaddingX,l=this.nextData.stopy+t.margin*2,this.nextData.stopx=o=s+t.width,this.nextData.starty=this.nextData.stopy,this.nextData.stopy=a=l+t.height,this.nextData.cnt=1),t.x=s,t.y=l,this.updateVal(this.data,"startx",s,Math.min),this.updateVal(this.data,"starty",l,Math.min),this.updateVal(this.data,"stopx",o,Math.max),this.updateVal(this.data,"stopy",a,Math.max),this.updateVal(this.nextData,"startx",s,Math.min),this.updateVal(this.nextData,"starty",l,Math.min),this.updateVal(this.nextData,"stopx",o,Math.max),this.updateVal(this.nextData,"stopy",a,Math.max)}init(t){this.name="",this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0,widthLimit:void 0},this.nextData={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0,cnt:0},ae(t.db.getConfig())}bumpLastMargin(t){this.data.stopx+=t,this.data.stopy+=t}},g(Ot,"Bounds"),Ot),ae=g(function(e){Ne(_,e),e.fontFamily&&(_.personFontFamily=_.systemFontFamily=_.messageFontFamily=e.fontFamily),e.fontSize&&(_.personFontSize=_.systemFontSize=_.messageFontSize=e.fontSize),e.fontWeight&&(_.personFontWeight=_.systemFontWeight=_.messageFontWeight=e.fontWeight)},"setConf"),Pt=g((e,t)=>({fontFamily:e[t+"FontFamily"],fontSize:e[t+"FontSize"],fontWeight:e[t+"FontWeight"]}),"c4ShapeFont"),Ut=g(e=>({fontFamily:e.boundaryFontFamily,fontSize:e.boundaryFontSize,fontWeight:e.boundaryFontWeight}),"boundaryFont"),T0=g(e=>({fontFamily:e.messageFontFamily,fontSize:e.messageFontSize,fontWeight:e.messageFontWeight}),"messageFont");function j(e,t,s,o,l){if(!t[e].width)if(s)t[e].text=je(t[e].text,l,o),t[e].textLines=t[e].text.split($t.lineBreakRegex).length,t[e].width=l,t[e].height=fe(t[e].text,o);else{let a=t[e].text.split($t.lineBreakRegex);t[e].textLines=a.length;let r=0;t[e].height=0,t[e].width=0;for(const n of a)t[e].width=Math.max(Tt(n,o),t[e].width),r=fe(n,o),t[e].height=t[e].height+r}}g(j,"calcC4ShapeTextWH");var Ae=g(function(e,t,s){t.x=s.data.startx,t.y=s.data.starty,t.width=s.data.stopx-s.data.startx,t.height=s.data.stopy-s.data.starty,t.label.y=_.c4ShapeMargin-35;let o=t.wrap&&_.wrap,l=Ut(_);l.fontSize=l.fontSize+2,l.fontWeight="bold";let a=Tt(t.label.text,l);j("label",t,o,l,a),z.drawBoundary(e,t,_)},"drawBoundary"),ke=g(function(e,t,s,o){let l=0;for(const a of o){l=0;const r=s[a];let n=Pt(_,r.typeC4Shape.text);switch(n.fontSize=n.fontSize-2,r.typeC4Shape.width=Tt("«"+r.typeC4Shape.text+"»",n),r.typeC4Shape.height=n.fontSize+2,r.typeC4Shape.Y=_.c4ShapePadding,l=r.typeC4Shape.Y+r.typeC4Shape.height-4,r.image={width:0,height:0,Y:0},r.typeC4Shape.text){case"person":case"external_person":r.image.width=48,r.image.height=48,r.image.Y=l,l=r.image.Y+r.image.height;break}r.sprite&&(r.image.width=48,r.image.height=48,r.image.Y=l,l=r.image.Y+r.image.height);let i=r.wrap&&_.wrap,u=_.width-_.c4ShapePadding*2,d=Pt(_,r.typeC4Shape.text);if(d.fontSize=d.fontSize+2,d.fontWeight="bold",j("label",r,i,d,u),r.label.Y=l+8,l=r.label.Y+r.label.height,r.type&&r.type.text!==""){r.type.text="["+r.type.text+"]";let E=Pt(_,r.typeC4Shape.text);j("type",r,i,E,u),r.type.Y=l+5,l=r.type.Y+r.type.height}else if(r.techn&&r.techn.text!==""){r.techn.text="["+r.techn.text+"]";let E=Pt(_,r.techn.text);j("techn",r,i,E,u),r.techn.Y=l+5,l=r.techn.Y+r.techn.height}let y=l,p=r.label.width;if(r.descr&&r.descr.text!==""){let E=Pt(_,r.typeC4Shape.text);j("descr",r,i,E,u),r.descr.Y=l+20,l=r.descr.Y+r.descr.height,p=Math.max(r.label.width,r.descr.width),y=l-r.descr.textLines*5}p=p+_.c4ShapePadding,r.width=Math.max(r.width||_.width,p,_.width),r.height=Math.max(r.height||_.height,y,_.height),r.margin=r.margin||_.c4ShapeMargin,e.insert(r),z.drawC4Shape(t,r,_)}e.bumpLastMargin(_.c4ShapeMargin)},"drawC4ShapeArray"),Rt,Y=(Rt=class{constructor(t,s){this.x=t,this.y=s}},g(Rt,"Point"),Rt),pe=g(function(e,t){let s=e.x,o=e.y,l=t.x,a=t.y,r=s+e.width/2,n=o+e.height/2,i=Math.abs(s-l),u=Math.abs(o-a),d=u/i,y=e.height/e.width,p=null;return o==a&&sl?p=new Y(s,n):s==l&&oa&&(p=new Y(r,o)),s>l&&o=d?p=new Y(s,n+d*e.width/2):p=new Y(r-i/u*e.height/2,o+e.height):s=d?p=new Y(s+e.width,n+d*e.width/2):p=new Y(r+i/u*e.height/2,o+e.height):sa?y>=d?p=new Y(s+e.width,n-d*e.width/2):p=new Y(r+e.height/2*i/u,o):s>l&&o>a&&(y>=d?p=new Y(s,n-e.width/2*d):p=new Y(r-e.height/2*i/u,o)),p},"getIntersectPoint"),O0=g(function(e,t){let s={x:0,y:0};s.x=t.x+t.width/2,s.y=t.y+t.height/2;let o=pe(e,s);s.x=e.x+e.width/2,s.y=e.y+e.height/2;let l=pe(t,s);return{startPoint:o,endPoint:l}},"getIntersectPoints"),R0=g(function(e,t,s,o){let l=0;for(let a of t){l=l+1;let r=a.wrap&&_.wrap,n=T0(_);o.db.getC4Type()==="C4Dynamic"&&(a.label.text=l+": "+a.label.text);let u=Tt(a.label.text,n);j("label",a,r,n,u),a.techn&&a.techn.text!==""&&(u=Tt(a.techn.text,n),j("techn",a,r,n,u)),a.descr&&a.descr.text!==""&&(u=Tt(a.descr.text,n),j("descr",a,r,n,u));let d=s(a.from),y=s(a.to),p=O0(d,y);a.startPoint=p.startPoint,a.endPoint=p.endPoint}z.drawRels(e,t,_)},"drawRels");function se(e,t,s,o,l){let a=new Ee(l);a.data.widthLimit=s.data.widthLimit/Math.min(ee,o.length);for(let[r,n]of o.entries()){let i=0;n.image={width:0,height:0,Y:0},n.sprite&&(n.image.width=48,n.image.height=48,n.image.Y=i,i=n.image.Y+n.image.height);let u=n.wrap&&_.wrap,d=Ut(_);if(d.fontSize=d.fontSize+2,d.fontWeight="bold",j("label",n,u,d,a.data.widthLimit),n.label.Y=i+8,i=n.label.Y+n.label.height,n.type&&n.type.text!==""){n.type.text="["+n.type.text+"]";let O=Ut(_);j("type",n,u,O,a.data.widthLimit),n.type.Y=i+5,i=n.type.Y+n.type.height}if(n.descr&&n.descr.text!==""){let O=Ut(_);O.fontSize=O.fontSize-2,j("descr",n,u,O,a.data.widthLimit),n.descr.Y=i+20,i=n.descr.Y+n.descr.height}if(r==0||r%ee===0){let O=s.data.startx+_.diagramMarginX,S=s.data.stopy+_.diagramMarginY+i;a.setData(O,O,S,S)}else{let O=a.data.stopx!==a.data.startx?a.data.stopx+_.diagramMarginX:a.data.startx,S=a.data.starty;a.setData(O,O,S,S)}a.name=n.alias;let y=l.db.getC4ShapeArray(n.alias),p=l.db.getC4ShapeKeys(n.alias);p.length>0&&ke(a,e,y,p),t=n.alias;let E=l.db.getBoundaries(t);E.length>0&&se(e,t,a,E,l),n.alias!=="global"&&Ae(e,n,a),s.data.stopy=Math.max(a.data.stopy+_.c4ShapeMargin,s.data.stopy),s.data.stopx=Math.max(a.data.stopx+_.c4ShapeMargin,s.data.stopx),Xt=Math.max(Xt,s.data.stopx),Wt=Math.max(Wt,s.data.stopy)}}g(se,"drawInsideBoundary");var S0=g(function(e,t,s,o){_=Bt().c4;const l=Bt().securityLevel;let a;l==="sandbox"&&(a=jt("#i"+t));const r=l==="sandbox"?jt(a.nodes()[0].contentDocument.body):jt("body");let n=o.db;o.db.setWrap(_.wrap),ve=n.getC4ShapeInRow(),ee=n.getC4BoundaryInRow(),de.debug(`C:${JSON.stringify(_,null,2)}`);const i=l==="sandbox"?r.select(`[id="${t}"]`):jt(`[id="${t}"]`);z.insertComputerIcon(i),z.insertDatabaseIcon(i),z.insertClockIcon(i);let u=new Ee(o);u.setData(_.diagramMarginX,_.diagramMarginX,_.diagramMarginY,_.diagramMarginY),u.data.widthLimit=screen.availWidth,Xt=_.diagramMarginX,Wt=_.diagramMarginY;const d=o.db.getTitle();let y=o.db.getBoundaries("");se(i,"",u,y,o),z.insertArrowHead(i),z.insertArrowEnd(i),z.insertArrowCrossHead(i),z.insertArrowFilledHead(i),R0(i,o.db.getRels(),o.db.getC4Shape,o),u.data.stopx=Xt,u.data.stopy=Wt;const p=u.data;let O=p.stopy-p.starty+2*_.diagramMarginY;const P=p.stopx-p.startx+2*_.diagramMarginX;d&&i.append("text").text(d).attr("x",(p.stopx-p.startx)/2-4*_.diagramMarginX).attr("y",p.starty+_.diagramMarginY),Le(i,O,P,_.useMaxWidth);const M=d?60:0;i.attr("viewBox",p.startx-_.diagramMarginX+" -"+(_.diagramMarginY+M)+" "+P+" "+(O+M)),de.debug("models:",p)},"draw"),ye={drawPersonOrSystemArray:ke,drawBoundary:Ae,setConf:ae,draw:S0},D0=g(e=>`.person {
+ stroke: ${e.personBorder};
+ fill: ${e.personBkg};
+ }
+`,"getStyles"),P0=D0,M0={parser:Ue,db:te,renderer:ye,styles:P0,init:g(({c4:e,wrap:t})=>{ye.setConf(e),te.setWrap(t)},"init")};export{M0 as diagram};
diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/channel-D6izjHHp.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/channel-D6izjHHp.js
new file mode 100644
index 0000000000..551a93cd48
--- /dev/null
+++ b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/channel-D6izjHHp.js
@@ -0,0 +1 @@
+import{aN as o,aO as n}from"./index-DpOBiJiD.js";const t=(a,r)=>o.lang.round(n.parse(a)[r]);export{t as c};
diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-4BX2VUAB-D7HUlyWF.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-4BX2VUAB-D7HUlyWF.js
new file mode 100644
index 0000000000..ee376927f6
--- /dev/null
+++ b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-4BX2VUAB-D7HUlyWF.js
@@ -0,0 +1 @@
+import{_ as i}from"./index-DpOBiJiD.js";function t(c,e){c.accDescr&&e.setAccDescription?.(c.accDescr),c.accTitle&&e.setAccTitle?.(c.accTitle),c.title&&e.setDiagramTitle?.(c.title)}i(t,"populateCommonDb");export{t as p};
diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-55IACEB6-DUaTCW0f.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-55IACEB6-DUaTCW0f.js
new file mode 100644
index 0000000000..725251bbfb
--- /dev/null
+++ b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-55IACEB6-DUaTCW0f.js
@@ -0,0 +1 @@
+import{_ as a,B as o}from"./index-DpOBiJiD.js";var g=a((t,e)=>{let n;return e==="sandbox"&&(n=o("#i"+t)),(e==="sandbox"?o(n.nodes()[0].contentDocument.body):o("body")).select(`[id="${t}"]`)},"getDiagramElement");export{g};
diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-B4BG7PRW-DtfSht4V.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-B4BG7PRW-DtfSht4V.js
new file mode 100644
index 0000000000..d5b9dd9529
--- /dev/null
+++ b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-B4BG7PRW-DtfSht4V.js
@@ -0,0 +1,165 @@
+import{g as et}from"./chunk-FMBD7UC4-fSM8np9_.js";import{g as tt}from"./chunk-55IACEB6-DUaTCW0f.js";import{s as st}from"./chunk-QN33PNHL-Cb84mGB3.js";import{_ as A,E as Oe,z as D,R as it,S as at,T as we,B as ee,y as nt,x as rt,v as ut,w as lt,U as ot,V as ct,O as v,$ as ht,Z as dt,L as pt,ah as R}from"./index-DpOBiJiD.js";var Ve=(function(){var s=A(function(I,o,c,d){for(c=c||{},d=I.length;d--;c[I[d]]=o);return c},"o"),i=[1,18],a=[1,19],u=[1,20],l=[1,41],n=[1,42],p=[1,26],f=[1,24],C=[1,25],B=[1,32],L=[1,33],Ae=[1,34],m=[1,45],fe=[1,35],ge=[1,36],Ce=[1,37],me=[1,38],be=[1,27],Ee=[1,28],ye=[1,29],Te=[1,30],ke=[1,31],b=[1,44],E=[1,46],y=[1,43],T=[1,47],De=[1,9],h=[1,8,9],te=[1,58],se=[1,59],ie=[1,60],ae=[1,61],ne=[1,62],Fe=[1,63],Be=[1,64],z=[1,8,9,41],Pe=[1,76],P=[1,8,9,12,13,22,39,41,44,68,69,70,71,72,73,74,79,81],re=[1,8,9,12,13,18,20,22,39,41,44,50,60,68,69,70,71,72,73,74,79,81,86,100,102,103],ue=[13,60,86,100,102,103],K=[13,60,73,74,86,100,102,103],Me=[13,60,68,69,70,71,72,86,100,102,103],_e=[1,100],Y=[1,117],Q=[1,113],W=[1,109],j=[1,115],X=[1,110],H=[1,111],q=[1,112],J=[1,114],Z=[1,116],Re=[22,48,60,61,82,86,87,88,89,90],Se=[1,8,9,39,41,44],le=[1,8,9,22],Ge=[1,145],Ue=[1,8,9,61],N=[1,8,9,22,48,60,61,82,86,87,88,89,90],Ne={trace:A(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,statements:5,graphConfig:6,CLASS_DIAGRAM:7,NEWLINE:8,EOF:9,statement:10,classLabel:11,SQS:12,STR:13,SQE:14,namespaceName:15,alphaNumToken:16,classLiteralName:17,DOT:18,className:19,GENERICTYPE:20,relationStatement:21,LABEL:22,namespaceStatement:23,classStatement:24,memberStatement:25,annotationStatement:26,clickStatement:27,styleStatement:28,cssClassStatement:29,noteStatement:30,classDefStatement:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,namespaceIdentifier:38,STRUCT_START:39,classStatements:40,STRUCT_STOP:41,NAMESPACE:42,classIdentifier:43,STYLE_SEPARATOR:44,members:45,CLASS:46,emptyBody:47,SPACE:48,ANNOTATION_START:49,ANNOTATION_END:50,MEMBER:51,SEPARATOR:52,relation:53,NOTE_FOR:54,noteText:55,NOTE:56,CLASSDEF:57,classList:58,stylesOpt:59,ALPHA:60,COMMA:61,direction_tb:62,direction_bt:63,direction_rl:64,direction_lr:65,relationType:66,lineType:67,AGGREGATION:68,EXTENSION:69,COMPOSITION:70,DEPENDENCY:71,LOLLIPOP:72,LINE:73,DOTTED_LINE:74,CALLBACK:75,LINK:76,LINK_TARGET:77,CLICK:78,CALLBACK_NAME:79,CALLBACK_ARGS:80,HREF:81,STYLE:82,CSSCLASS:83,style:84,styleComponent:85,NUM:86,COLON:87,UNIT:88,BRKT:89,PCT:90,commentToken:91,textToken:92,graphCodeTokens:93,textNoTagsToken:94,TAGSTART:95,TAGEND:96,"==":97,"--":98,DEFAULT:99,MINUS:100,keywords:101,UNICODE_TEXT:102,BQUOTE_STR:103,$accept:0,$end:1},terminals_:{2:"error",7:"CLASS_DIAGRAM",8:"NEWLINE",9:"EOF",12:"SQS",13:"STR",14:"SQE",18:"DOT",20:"GENERICTYPE",22:"LABEL",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",39:"STRUCT_START",41:"STRUCT_STOP",42:"NAMESPACE",44:"STYLE_SEPARATOR",46:"CLASS",48:"SPACE",49:"ANNOTATION_START",50:"ANNOTATION_END",51:"MEMBER",52:"SEPARATOR",54:"NOTE_FOR",56:"NOTE",57:"CLASSDEF",60:"ALPHA",61:"COMMA",62:"direction_tb",63:"direction_bt",64:"direction_rl",65:"direction_lr",68:"AGGREGATION",69:"EXTENSION",70:"COMPOSITION",71:"DEPENDENCY",72:"LOLLIPOP",73:"LINE",74:"DOTTED_LINE",75:"CALLBACK",76:"LINK",77:"LINK_TARGET",78:"CLICK",79:"CALLBACK_NAME",80:"CALLBACK_ARGS",81:"HREF",82:"STYLE",83:"CSSCLASS",86:"NUM",87:"COLON",88:"UNIT",89:"BRKT",90:"PCT",93:"graphCodeTokens",95:"TAGSTART",96:"TAGEND",97:"==",98:"--",99:"DEFAULT",100:"MINUS",101:"keywords",102:"UNICODE_TEXT",103:"BQUOTE_STR"},productions_:[0,[3,1],[3,1],[4,1],[6,4],[5,1],[5,2],[5,3],[11,3],[15,1],[15,1],[15,3],[15,2],[19,1],[19,3],[19,1],[19,2],[19,2],[19,2],[10,1],[10,2],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,2],[10,2],[10,1],[23,4],[23,5],[38,2],[40,1],[40,2],[40,3],[24,1],[24,3],[24,4],[24,3],[24,6],[43,2],[43,3],[47,0],[47,2],[47,2],[26,4],[45,1],[45,2],[25,1],[25,2],[25,1],[25,1],[21,3],[21,4],[21,4],[21,5],[30,3],[30,2],[31,3],[58,1],[58,3],[32,1],[32,1],[32,1],[32,1],[53,3],[53,2],[53,2],[53,1],[66,1],[66,1],[66,1],[66,1],[66,1],[67,1],[67,1],[27,3],[27,4],[27,3],[27,4],[27,4],[27,5],[27,3],[27,4],[27,4],[27,5],[27,4],[27,5],[27,5],[27,6],[28,3],[29,3],[59,1],[59,3],[84,1],[84,2],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[91,1],[91,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[94,1],[94,1],[94,1],[94,1],[16,1],[16,1],[16,1],[16,1],[17,1],[55,1]],performAction:A(function(o,c,d,r,g,e,$){var t=e.length-1;switch(g){case 8:this.$=e[t-1];break;case 9:case 10:case 13:case 15:this.$=e[t];break;case 11:case 14:this.$=e[t-2]+"."+e[t];break;case 12:case 16:this.$=e[t-1]+e[t];break;case 17:case 18:this.$=e[t-1]+"~"+e[t]+"~";break;case 19:r.addRelation(e[t]);break;case 20:e[t-1].title=r.cleanupLabel(e[t]),r.addRelation(e[t-1]);break;case 31:this.$=e[t].trim(),r.setAccTitle(this.$);break;case 32:case 33:this.$=e[t].trim(),r.setAccDescription(this.$);break;case 34:r.addClassesToNamespace(e[t-3],e[t-1]);break;case 35:r.addClassesToNamespace(e[t-4],e[t-1]);break;case 36:this.$=e[t],r.addNamespace(e[t]);break;case 37:this.$=[e[t]];break;case 38:this.$=[e[t-1]];break;case 39:e[t].unshift(e[t-2]),this.$=e[t];break;case 41:r.setCssClass(e[t-2],e[t]);break;case 42:r.addMembers(e[t-3],e[t-1]);break;case 44:r.setCssClass(e[t-5],e[t-3]),r.addMembers(e[t-5],e[t-1]);break;case 45:this.$=e[t],r.addClass(e[t]);break;case 46:this.$=e[t-1],r.addClass(e[t-1]),r.setClassLabel(e[t-1],e[t]);break;case 50:r.addAnnotation(e[t],e[t-2]);break;case 51:case 64:this.$=[e[t]];break;case 52:e[t].push(e[t-1]),this.$=e[t];break;case 53:break;case 54:r.addMember(e[t-1],r.cleanupLabel(e[t]));break;case 55:break;case 56:break;case 57:this.$={id1:e[t-2],id2:e[t],relation:e[t-1],relationTitle1:"none",relationTitle2:"none"};break;case 58:this.$={id1:e[t-3],id2:e[t],relation:e[t-1],relationTitle1:e[t-2],relationTitle2:"none"};break;case 59:this.$={id1:e[t-3],id2:e[t],relation:e[t-2],relationTitle1:"none",relationTitle2:e[t-1]};break;case 60:this.$={id1:e[t-4],id2:e[t],relation:e[t-2],relationTitle1:e[t-3],relationTitle2:e[t-1]};break;case 61:r.addNote(e[t],e[t-1]);break;case 62:r.addNote(e[t]);break;case 63:this.$=e[t-2],r.defineClass(e[t-1],e[t]);break;case 65:this.$=e[t-2].concat([e[t]]);break;case 66:r.setDirection("TB");break;case 67:r.setDirection("BT");break;case 68:r.setDirection("RL");break;case 69:r.setDirection("LR");break;case 70:this.$={type1:e[t-2],type2:e[t],lineType:e[t-1]};break;case 71:this.$={type1:"none",type2:e[t],lineType:e[t-1]};break;case 72:this.$={type1:e[t-1],type2:"none",lineType:e[t]};break;case 73:this.$={type1:"none",type2:"none",lineType:e[t]};break;case 74:this.$=r.relationType.AGGREGATION;break;case 75:this.$=r.relationType.EXTENSION;break;case 76:this.$=r.relationType.COMPOSITION;break;case 77:this.$=r.relationType.DEPENDENCY;break;case 78:this.$=r.relationType.LOLLIPOP;break;case 79:this.$=r.lineType.LINE;break;case 80:this.$=r.lineType.DOTTED_LINE;break;case 81:case 87:this.$=e[t-2],r.setClickEvent(e[t-1],e[t]);break;case 82:case 88:this.$=e[t-3],r.setClickEvent(e[t-2],e[t-1]),r.setTooltip(e[t-2],e[t]);break;case 83:this.$=e[t-2],r.setLink(e[t-1],e[t]);break;case 84:this.$=e[t-3],r.setLink(e[t-2],e[t-1],e[t]);break;case 85:this.$=e[t-3],r.setLink(e[t-2],e[t-1]),r.setTooltip(e[t-2],e[t]);break;case 86:this.$=e[t-4],r.setLink(e[t-3],e[t-2],e[t]),r.setTooltip(e[t-3],e[t-1]);break;case 89:this.$=e[t-3],r.setClickEvent(e[t-2],e[t-1],e[t]);break;case 90:this.$=e[t-4],r.setClickEvent(e[t-3],e[t-2],e[t-1]),r.setTooltip(e[t-3],e[t]);break;case 91:this.$=e[t-3],r.setLink(e[t-2],e[t]);break;case 92:this.$=e[t-4],r.setLink(e[t-3],e[t-1],e[t]);break;case 93:this.$=e[t-4],r.setLink(e[t-3],e[t-1]),r.setTooltip(e[t-3],e[t]);break;case 94:this.$=e[t-5],r.setLink(e[t-4],e[t-2],e[t]),r.setTooltip(e[t-4],e[t-1]);break;case 95:this.$=e[t-2],r.setCssStyle(e[t-1],e[t]);break;case 96:r.setCssClass(e[t-1],e[t]);break;case 97:this.$=[e[t]];break;case 98:e[t-2].push(e[t]),this.$=e[t-2];break;case 100:this.$=e[t-1]+e[t];break}},"anonymous"),table:[{3:1,4:2,5:3,6:4,7:[1,6],10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:i,35:a,37:u,38:22,42:l,43:23,46:n,49:p,51:f,52:C,54:B,56:L,57:Ae,60:m,62:fe,63:ge,64:Ce,65:me,75:be,76:Ee,78:ye,82:Te,83:ke,86:b,100:E,102:y,103:T},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,3]},s(De,[2,5],{8:[1,48]}),{8:[1,49]},s(h,[2,19],{22:[1,50]}),s(h,[2,21]),s(h,[2,22]),s(h,[2,23]),s(h,[2,24]),s(h,[2,25]),s(h,[2,26]),s(h,[2,27]),s(h,[2,28]),s(h,[2,29]),s(h,[2,30]),{34:[1,51]},{36:[1,52]},s(h,[2,33]),s(h,[2,53],{53:53,66:56,67:57,13:[1,54],22:[1,55],68:te,69:se,70:ie,71:ae,72:ne,73:Fe,74:Be}),{39:[1,65]},s(z,[2,40],{39:[1,67],44:[1,66]}),s(h,[2,55]),s(h,[2,56]),{16:68,60:m,86:b,100:E,102:y},{16:39,17:40,19:69,60:m,86:b,100:E,102:y,103:T},{16:39,17:40,19:70,60:m,86:b,100:E,102:y,103:T},{16:39,17:40,19:71,60:m,86:b,100:E,102:y,103:T},{60:[1,72]},{13:[1,73]},{16:39,17:40,19:74,60:m,86:b,100:E,102:y,103:T},{13:Pe,55:75},{58:77,60:[1,78]},s(h,[2,66]),s(h,[2,67]),s(h,[2,68]),s(h,[2,69]),s(P,[2,13],{16:39,17:40,19:80,18:[1,79],20:[1,81],60:m,86:b,100:E,102:y,103:T}),s(P,[2,15],{20:[1,82]}),{15:83,16:84,17:85,60:m,86:b,100:E,102:y,103:T},{16:39,17:40,19:86,60:m,86:b,100:E,102:y,103:T},s(re,[2,123]),s(re,[2,124]),s(re,[2,125]),s(re,[2,126]),s([1,8,9,12,13,20,22,39,41,44,68,69,70,71,72,73,74,79,81],[2,127]),s(De,[2,6],{10:5,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,19:21,38:22,43:23,16:39,17:40,5:87,33:i,35:a,37:u,42:l,46:n,49:p,51:f,52:C,54:B,56:L,57:Ae,60:m,62:fe,63:ge,64:Ce,65:me,75:be,76:Ee,78:ye,82:Te,83:ke,86:b,100:E,102:y,103:T}),{5:88,10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:i,35:a,37:u,38:22,42:l,43:23,46:n,49:p,51:f,52:C,54:B,56:L,57:Ae,60:m,62:fe,63:ge,64:Ce,65:me,75:be,76:Ee,78:ye,82:Te,83:ke,86:b,100:E,102:y,103:T},s(h,[2,20]),s(h,[2,31]),s(h,[2,32]),{13:[1,90],16:39,17:40,19:89,60:m,86:b,100:E,102:y,103:T},{53:91,66:56,67:57,68:te,69:se,70:ie,71:ae,72:ne,73:Fe,74:Be},s(h,[2,54]),{67:92,73:Fe,74:Be},s(ue,[2,73],{66:93,68:te,69:se,70:ie,71:ae,72:ne}),s(K,[2,74]),s(K,[2,75]),s(K,[2,76]),s(K,[2,77]),s(K,[2,78]),s(Me,[2,79]),s(Me,[2,80]),{8:[1,95],24:96,40:94,43:23,46:n},{16:97,60:m,86:b,100:E,102:y},{41:[1,99],45:98,51:_e},{50:[1,101]},{13:[1,102]},{13:[1,103]},{79:[1,104],81:[1,105]},{22:Y,48:Q,59:106,60:W,82:j,84:107,85:108,86:X,87:H,88:q,89:J,90:Z},{60:[1,118]},{13:Pe,55:119},s(h,[2,62]),s(h,[2,128]),{22:Y,48:Q,59:120,60:W,61:[1,121],82:j,84:107,85:108,86:X,87:H,88:q,89:J,90:Z},s(Re,[2,64]),{16:39,17:40,19:122,60:m,86:b,100:E,102:y,103:T},s(P,[2,16]),s(P,[2,17]),s(P,[2,18]),{39:[2,36]},{15:124,16:84,17:85,18:[1,123],39:[2,9],60:m,86:b,100:E,102:y,103:T},{39:[2,10]},s(Se,[2,45],{11:125,12:[1,126]}),s(De,[2,7]),{9:[1,127]},s(le,[2,57]),{16:39,17:40,19:128,60:m,86:b,100:E,102:y,103:T},{13:[1,130],16:39,17:40,19:129,60:m,86:b,100:E,102:y,103:T},s(ue,[2,72],{66:131,68:te,69:se,70:ie,71:ae,72:ne}),s(ue,[2,71]),{41:[1,132]},{24:96,40:133,43:23,46:n},{8:[1,134],41:[2,37]},s(z,[2,41],{39:[1,135]}),{41:[1,136]},s(z,[2,43]),{41:[2,51],45:137,51:_e},{16:39,17:40,19:138,60:m,86:b,100:E,102:y,103:T},s(h,[2,81],{13:[1,139]}),s(h,[2,83],{13:[1,141],77:[1,140]}),s(h,[2,87],{13:[1,142],80:[1,143]}),{13:[1,144]},s(h,[2,95],{61:Ge}),s(Ue,[2,97],{85:146,22:Y,48:Q,60:W,82:j,86:X,87:H,88:q,89:J,90:Z}),s(N,[2,99]),s(N,[2,101]),s(N,[2,102]),s(N,[2,103]),s(N,[2,104]),s(N,[2,105]),s(N,[2,106]),s(N,[2,107]),s(N,[2,108]),s(N,[2,109]),s(h,[2,96]),s(h,[2,61]),s(h,[2,63],{61:Ge}),{60:[1,147]},s(P,[2,14]),{15:148,16:84,17:85,60:m,86:b,100:E,102:y,103:T},{39:[2,12]},s(Se,[2,46]),{13:[1,149]},{1:[2,4]},s(le,[2,59]),s(le,[2,58]),{16:39,17:40,19:150,60:m,86:b,100:E,102:y,103:T},s(ue,[2,70]),s(h,[2,34]),{41:[1,151]},{24:96,40:152,41:[2,38],43:23,46:n},{45:153,51:_e},s(z,[2,42]),{41:[2,52]},s(h,[2,50]),s(h,[2,82]),s(h,[2,84]),s(h,[2,85],{77:[1,154]}),s(h,[2,88]),s(h,[2,89],{13:[1,155]}),s(h,[2,91],{13:[1,157],77:[1,156]}),{22:Y,48:Q,60:W,82:j,84:158,85:108,86:X,87:H,88:q,89:J,90:Z},s(N,[2,100]),s(Re,[2,65]),{39:[2,11]},{14:[1,159]},s(le,[2,60]),s(h,[2,35]),{41:[2,39]},{41:[1,160]},s(h,[2,86]),s(h,[2,90]),s(h,[2,92]),s(h,[2,93],{77:[1,161]}),s(Ue,[2,98],{85:146,22:Y,48:Q,60:W,82:j,86:X,87:H,88:q,89:J,90:Z}),s(Se,[2,8]),s(z,[2,44]),s(h,[2,94])],defaultActions:{2:[2,1],3:[2,2],4:[2,3],83:[2,36],85:[2,10],124:[2,12],127:[2,4],137:[2,52],148:[2,11],152:[2,39]},parseError:A(function(o,c){if(c.recoverable)this.trace(o);else{var d=new Error(o);throw d.hash=c,d}},"parseError"),parse:A(function(o){var c=this,d=[0],r=[],g=[null],e=[],$=this.table,t="",ce=0,ze=0,qe=2,Ke=1,Je=e.slice.call(arguments,1),k=Object.create(this.lexer),O={yy:{}};for(var Le in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Le)&&(O.yy[Le]=this.yy[Le]);k.setInput(o,O.yy),O.yy.lexer=k,O.yy.parser=this,typeof k.yylloc>"u"&&(k.yylloc={});var xe=k.yylloc;e.push(xe);var Ze=k.options&&k.options.ranges;typeof O.yy.parseError=="function"?this.parseError=O.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function $e(_){d.length=d.length-2*_,g.length=g.length-_,e.length=e.length-_}A($e,"popStack");function Ye(){var _;return _=r.pop()||k.lex()||Ke,typeof _!="number"&&(_ instanceof Array&&(r=_,_=r.pop()),_=c.symbols_[_]||_),_}A(Ye,"lex");for(var F,w,S,ve,M={},he,x,Qe,de;;){if(w=d[d.length-1],this.defaultActions[w]?S=this.defaultActions[w]:((F===null||typeof F>"u")&&(F=Ye()),S=$[w]&&$[w][F]),typeof S>"u"||!S.length||!S[0]){var Ie="";de=[];for(he in $[w])this.terminals_[he]&&he>qe&&de.push("'"+this.terminals_[he]+"'");k.showPosition?Ie="Parse error on line "+(ce+1)+`:
+`+k.showPosition()+`
+Expecting `+de.join(", ")+", got '"+(this.terminals_[F]||F)+"'":Ie="Parse error on line "+(ce+1)+": Unexpected "+(F==Ke?"end of input":"'"+(this.terminals_[F]||F)+"'"),this.parseError(Ie,{text:k.match,token:this.terminals_[F]||F,line:k.yylineno,loc:xe,expected:de})}if(S[0]instanceof Array&&S.length>1)throw new Error("Parse Error: multiple actions possible at state: "+w+", token: "+F);switch(S[0]){case 1:d.push(F),g.push(k.yytext),e.push(k.yylloc),d.push(S[1]),F=null,ze=k.yyleng,t=k.yytext,ce=k.yylineno,xe=k.yylloc;break;case 2:if(x=this.productions_[S[1]][1],M.$=g[g.length-x],M._$={first_line:e[e.length-(x||1)].first_line,last_line:e[e.length-1].last_line,first_column:e[e.length-(x||1)].first_column,last_column:e[e.length-1].last_column},Ze&&(M._$.range=[e[e.length-(x||1)].range[0],e[e.length-1].range[1]]),ve=this.performAction.apply(M,[t,ze,ce,O.yy,S[1],g,e].concat(Je)),typeof ve<"u")return ve;x&&(d=d.slice(0,-1*x*2),g=g.slice(0,-1*x),e=e.slice(0,-1*x)),d.push(this.productions_[S[1]][0]),g.push(M.$),e.push(M._$),Qe=$[d[d.length-2]][d[d.length-1]],d.push(Qe);break;case 3:return!0}}return!0},"parse")},He=(function(){var I={EOF:1,parseError:A(function(c,d){if(this.yy.parser)this.yy.parser.parseError(c,d);else throw new Error(c)},"parseError"),setInput:A(function(o,c){return this.yy=c||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},"setInput"),input:A(function(){var o=this._input[0];this.yytext+=o,this.yyleng++,this.offset++,this.match+=o,this.matched+=o;var c=o.match(/(?:\r\n?|\n).*/g);return c?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),o},"input"),unput:A(function(o){var c=o.length,d=o.split(/(?:\r\n?|\n)/g);this._input=o+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-c),this.offset-=c;var r=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),d.length-1&&(this.yylineno-=d.length-1);var g=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:d?(d.length===r.length?this.yylloc.first_column:0)+r[r.length-d.length].length-d[0].length:this.yylloc.first_column-c},this.options.ranges&&(this.yylloc.range=[g[0],g[0]+this.yyleng-c]),this.yyleng=this.yytext.length,this},"unput"),more:A(function(){return this._more=!0,this},"more"),reject:A(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
+`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:A(function(o){this.unput(this.match.slice(o))},"less"),pastInput:A(function(){var o=this.matched.substr(0,this.matched.length-this.match.length);return(o.length>20?"...":"")+o.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:A(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,"")},"upcomingInput"),showPosition:A(function(){var o=this.pastInput(),c=new Array(o.length+1).join("-");return o+this.upcomingInput()+`
+`+c+"^"},"showPosition"),test_match:A(function(o,c){var d,r,g;if(this.options.backtrack_lexer&&(g={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&&(g.yylloc.range=this.yylloc.range.slice(0))),r=o[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.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],d=this.performAction.call(this,this.yy,this,c,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),d)return d;if(this._backtrack){for(var e in g)this[e]=g[e];return!1}return!1},"test_match"),next:A(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var o,c,d,r;this._more||(this.yytext="",this.match="");for(var g=this._currentRules(),e=0;ec[0].length)){if(c=d,r=e,this.options.backtrack_lexer){if(o=this.test_match(d,g[e]),o!==!1)return o;if(this._backtrack){c=!1;continue}else return!1}else if(!this.options.flex)break}return c?(o=this.test_match(c,g[r]),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})},"next"),lex:A(function(){var c=this.next();return c||this.lex()},"lex"),begin:A(function(c){this.conditionStack.push(c)},"begin"),popState:A(function(){var c=this.conditionStack.length-1;return c>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:A(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:A(function(c){return c=this.conditionStack.length-1-Math.abs(c||0),c>=0?this.conditionStack[c]:"INITIAL"},"topState"),pushState:A(function(c){this.begin(c)},"pushState"),stateStackSize:A(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:A(function(c,d,r,g){switch(r){case 0:return 62;case 1:return 63;case 2:return 64;case 3:return 65;case 4:break;case 5:break;case 6:return this.begin("acc_title"),33;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),35;case 9:return this.popState(),"acc_descr_value";case 10:this.begin("acc_descr_multiline");break;case 11:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:return 8;case 14:break;case 15:return 7;case 16:return 7;case 17:return"EDGE_STATE";case 18:this.begin("callback_name");break;case 19:this.popState();break;case 20:this.popState(),this.begin("callback_args");break;case 21:return 79;case 22:this.popState();break;case 23:return 80;case 24:this.popState();break;case 25:return"STR";case 26:this.begin("string");break;case 27:return 82;case 28:return 57;case 29:return this.begin("namespace"),42;case 30:return this.popState(),8;case 31:break;case 32:return this.begin("namespace-body"),39;case 33:return this.popState(),41;case 34:return"EOF_IN_STRUCT";case 35:return 8;case 36:break;case 37:return"EDGE_STATE";case 38:return this.begin("class"),46;case 39:return this.popState(),8;case 40:break;case 41:return this.popState(),this.popState(),41;case 42:return this.begin("class-body"),39;case 43:return this.popState(),41;case 44:return"EOF_IN_STRUCT";case 45:return"EDGE_STATE";case 46:return"OPEN_IN_STRUCT";case 47:break;case 48:return"MEMBER";case 49:return 83;case 50:return 75;case 51:return 76;case 52:return 78;case 53:return 54;case 54:return 56;case 55:return 49;case 56:return 50;case 57:return 81;case 58:this.popState();break;case 59:return"GENERICTYPE";case 60:this.begin("generic");break;case 61:this.popState();break;case 62:return"BQUOTE_STR";case 63:this.begin("bqstring");break;case 64:return 77;case 65:return 77;case 66:return 77;case 67:return 77;case 68:return 69;case 69:return 69;case 70:return 71;case 71:return 71;case 72:return 70;case 73:return 68;case 74:return 72;case 75:return 73;case 76:return 74;case 77:return 22;case 78:return 44;case 79:return 100;case 80:return 18;case 81:return"PLUS";case 82:return 87;case 83:return 61;case 84:return 89;case 85:return 89;case 86:return 90;case 87:return"EQUALS";case 88:return"EQUALS";case 89:return 60;case 90:return 12;case 91:return 14;case 92:return"PUNCTUATION";case 93:return 86;case 94:return 102;case 95:return 48;case 96:return 48;case 97:return 9}},"anonymous"),rules:[/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/,/^(?:%%[^\n]*(\r?\n)*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:classDiagram-v2\b)/,/^(?:classDiagram\b)/,/^(?:\[\*\])/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:["])/,/^(?:[^"]*)/,/^(?:["])/,/^(?:style\b)/,/^(?:classDef\b)/,/^(?:namespace\b)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:[{])/,/^(?:[}])/,/^(?:$)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:\[\*\])/,/^(?:class\b)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:[}])/,/^(?:[{])/,/^(?:[}])/,/^(?:$)/,/^(?:\[\*\])/,/^(?:[{])/,/^(?:[\n])/,/^(?:[^{}\n]*)/,/^(?:cssClass\b)/,/^(?:callback\b)/,/^(?:link\b)/,/^(?:click\b)/,/^(?:note for\b)/,/^(?:note\b)/,/^(?:<<)/,/^(?:>>)/,/^(?:href\b)/,/^(?:[~])/,/^(?:[^~]*)/,/^(?:~)/,/^(?:[`])/,/^(?:[^`]+)/,/^(?:[`])/,/^(?:_self\b)/,/^(?:_blank\b)/,/^(?:_parent\b)/,/^(?:_top\b)/,/^(?:\s*<\|)/,/^(?:\s*\|>)/,/^(?:\s*>)/,/^(?:\s*<)/,/^(?:\s*\*)/,/^(?:\s*o\b)/,/^(?:\s*\(\))/,/^(?:--)/,/^(?:\.\.)/,/^(?::{1}[^:\n;]+)/,/^(?::{3})/,/^(?:-)/,/^(?:\.)/,/^(?:\+)/,/^(?::)/,/^(?:,)/,/^(?:#)/,/^(?:#)/,/^(?:%)/,/^(?:=)/,/^(?:=)/,/^(?:\w+)/,/^(?:\[)/,/^(?:\])/,/^(?:[!"#$%&'*+,-.`?\\/])/,/^(?:[0-9]+)/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\s)/,/^(?:\s)/,/^(?:$)/],conditions:{"namespace-body":{rules:[26,33,34,35,36,37,38,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},namespace:{rules:[26,29,30,31,32,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},"class-body":{rules:[26,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},class:{rules:[26,39,40,41,42,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},acc_descr_multiline:{rules:[11,12,26,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},acc_descr:{rules:[9,26,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},acc_title:{rules:[7,26,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},callback_args:{rules:[22,23,26,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},callback_name:{rules:[19,20,21,26,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},href:{rules:[26,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},struct:{rules:[26,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},generic:{rules:[26,49,50,51,52,53,54,55,56,57,58,59,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},bqstring:{rules:[26,49,50,51,52,53,54,55,56,57,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},string:{rules:[24,25,26,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,8,10,13,14,15,16,17,18,26,27,28,29,38,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97],inclusive:!0}}};return I})();Ne.lexer=He;function oe(){this.yy={}}return A(oe,"Parser"),oe.prototype=Ne,Ne.Parser=oe,new oe})();Ve.parser=Ve;var Tt=Ve,We=["#","+","~","-",""],G,je=(G=class{constructor(i,a){this.memberType=a,this.visibility="",this.classifier="",this.text="";const u=pt(i,D());this.parseMember(u)}getDisplayDetails(){let i=this.visibility+R(this.id);this.memberType==="method"&&(i+=`(${R(this.parameters.trim())})`,this.returnType&&(i+=" : "+R(this.returnType))),i=i.trim();const a=this.parseClassifier();return{displayText:i,cssStyle:a}}parseMember(i){let a="";if(this.memberType==="method"){const n=/([#+~-])?(.+)\((.*)\)([\s$*])?(.*)([$*])?/.exec(i);if(n){const p=n[1]?n[1].trim():"";if(We.includes(p)&&(this.visibility=p),this.id=n[2],this.parameters=n[3]?n[3].trim():"",a=n[4]?n[4].trim():"",this.returnType=n[5]?n[5].trim():"",a===""){const f=this.returnType.substring(this.returnType.length-1);/[$*]/.exec(f)&&(a=f,this.returnType=this.returnType.substring(0,this.returnType.length-1))}}}else{const l=i.length,n=i.substring(0,1),p=i.substring(l-1);We.includes(n)&&(this.visibility=n),/[$*]/.exec(p)&&(a=p),this.id=i.substring(this.visibility===""?0:1,a===""?l:l-1)}this.classifier=a,this.id=this.id.startsWith(" ")?" "+this.id.trim():this.id.trim();const u=`${this.visibility?"\\"+this.visibility:""}${R(this.id)}${this.memberType==="method"?`(${R(this.parameters)})${this.returnType?" : "+R(this.returnType):""}`:""}`;this.text=u.replaceAll("<","<").replaceAll(">",">"),this.text.startsWith("\\<")&&(this.text=this.text.replace("\\<","~"))}parseClassifier(){switch(this.classifier){case"*":return"font-style:italic;";case"$":return"text-decoration:underline;";default:return""}}},A(G,"ClassMember"),G),pe="classId-",Xe=0,V=A(s=>v.sanitizeText(s,D()),"sanitizeText"),U,kt=(U=class{constructor(){this.relations=[],this.classes=new Map,this.styleClasses=new Map,this.notes=[],this.interfaces=[],this.namespaces=new Map,this.namespaceCounter=0,this.functions=[],this.lineType={LINE:0,DOTTED_LINE:1},this.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3,LOLLIPOP:4},this.setupToolTips=A(i=>{let a=ee(".mermaidTooltip");(a._groups||a)[0][0]===null&&(a=ee("body").append("div").attr("class","mermaidTooltip").style("opacity",0)),ee(i).select("svg").selectAll("g.node").on("mouseover",n=>{const p=ee(n.currentTarget);if(p.attr("title")===null)return;const C=this.getBoundingClientRect();a.transition().duration(200).style("opacity",".9"),a.text(p.attr("title")).style("left",window.scrollX+C.left+(C.right-C.left)/2+"px").style("top",window.scrollY+C.top-14+document.body.scrollTop+"px"),a.html(a.html().replace(/<br\/>/g,"
")),p.classed("hover",!0)}).on("mouseout",n=>{a.transition().duration(500).style("opacity",0),ee(n.currentTarget).classed("hover",!1)})},"setupToolTips"),this.direction="TB",this.setAccTitle=nt,this.getAccTitle=rt,this.setAccDescription=ut,this.getAccDescription=lt,this.setDiagramTitle=ot,this.getDiagramTitle=ct,this.getConfig=A(()=>D().class,"getConfig"),this.functions.push(this.setupToolTips.bind(this)),this.clear(),this.addRelation=this.addRelation.bind(this),this.addClassesToNamespace=this.addClassesToNamespace.bind(this),this.addNamespace=this.addNamespace.bind(this),this.setCssClass=this.setCssClass.bind(this),this.addMembers=this.addMembers.bind(this),this.addClass=this.addClass.bind(this),this.setClassLabel=this.setClassLabel.bind(this),this.addAnnotation=this.addAnnotation.bind(this),this.addMember=this.addMember.bind(this),this.cleanupLabel=this.cleanupLabel.bind(this),this.addNote=this.addNote.bind(this),this.defineClass=this.defineClass.bind(this),this.setDirection=this.setDirection.bind(this),this.setLink=this.setLink.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.clear=this.clear.bind(this),this.setTooltip=this.setTooltip.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setCssStyle=this.setCssStyle.bind(this)}splitClassNameAndType(i){const a=v.sanitizeText(i,D());let u="",l=a;if(a.indexOf("~")>0){const n=a.split("~");l=V(n[0]),u=V(n[1])}return{className:l,type:u}}setClassLabel(i,a){const u=v.sanitizeText(i,D());a&&(a=V(a));const{className:l}=this.splitClassNameAndType(u);this.classes.get(l).label=a,this.classes.get(l).text=`${a}${this.classes.get(l).type?`<${this.classes.get(l).type}>`:""}`}addClass(i){const a=v.sanitizeText(i,D()),{className:u,type:l}=this.splitClassNameAndType(a);if(this.classes.has(u))return;const n=v.sanitizeText(u,D());this.classes.set(n,{id:n,type:l,label:n,text:`${n}${l?`<${l}>`:""}`,shape:"classBox",cssClasses:"default",methods:[],members:[],annotations:[],styles:[],domId:pe+n+"-"+Xe}),Xe++}addInterface(i,a){const u={id:`interface${this.interfaces.length}`,label:i,classId:a};this.interfaces.push(u)}lookUpDomId(i){const a=v.sanitizeText(i,D());if(this.classes.has(a))return this.classes.get(a).domId;throw new Error("Class not found: "+a)}clear(){this.relations=[],this.classes=new Map,this.notes=[],this.interfaces=[],this.functions=[],this.functions.push(this.setupToolTips.bind(this)),this.namespaces=new Map,this.namespaceCounter=0,this.direction="TB",ht()}getClass(i){return this.classes.get(i)}getClasses(){return this.classes}getRelations(){return this.relations}getNotes(){return this.notes}addRelation(i){Oe.debug("Adding relation: "+JSON.stringify(i));const a=[this.relationType.LOLLIPOP,this.relationType.AGGREGATION,this.relationType.COMPOSITION,this.relationType.DEPENDENCY,this.relationType.EXTENSION];i.relation.type1===this.relationType.LOLLIPOP&&!a.includes(i.relation.type2)?(this.addClass(i.id2),this.addInterface(i.id1,i.id2),i.id1=`interface${this.interfaces.length-1}`):i.relation.type2===this.relationType.LOLLIPOP&&!a.includes(i.relation.type1)?(this.addClass(i.id1),this.addInterface(i.id2,i.id1),i.id2=`interface${this.interfaces.length-1}`):(this.addClass(i.id1),this.addClass(i.id2)),i.id1=this.splitClassNameAndType(i.id1).className,i.id2=this.splitClassNameAndType(i.id2).className,i.relationTitle1=v.sanitizeText(i.relationTitle1.trim(),D()),i.relationTitle2=v.sanitizeText(i.relationTitle2.trim(),D()),this.relations.push(i)}addAnnotation(i,a){const u=this.splitClassNameAndType(i).className;this.classes.get(u).annotations.push(a)}addMember(i,a){this.addClass(i);const u=this.splitClassNameAndType(i).className,l=this.classes.get(u);if(typeof a=="string"){const n=a.trim();n.startsWith("<<")&&n.endsWith(">>")?l.annotations.push(V(n.substring(2,n.length-2))):n.indexOf(")")>0?l.methods.push(new je(n,"method")):n&&l.members.push(new je(n,"attribute"))}}addMembers(i,a){Array.isArray(a)&&(a.reverse(),a.forEach(u=>this.addMember(i,u)))}addNote(i,a){const u={id:`note${this.notes.length}`,class:a,text:i};this.notes.push(u)}cleanupLabel(i){return i.startsWith(":")&&(i=i.substring(1)),V(i.trim())}setCssClass(i,a){i.split(",").forEach(u=>{let l=u;/\d/.exec(u[0])&&(l=pe+l);const n=this.classes.get(l);n&&(n.cssClasses+=" "+a)})}defineClass(i,a){for(const u of i){let l=this.styleClasses.get(u);l===void 0&&(l={id:u,styles:[],textStyles:[]},this.styleClasses.set(u,l)),a&&a.forEach(n=>{if(/color/.exec(n)){const p=n.replace("fill","bgFill");l.textStyles.push(p)}l.styles.push(n)}),this.classes.forEach(n=>{n.cssClasses.includes(u)&&n.styles.push(...a.flatMap(p=>p.split(",")))})}}setTooltip(i,a){i.split(",").forEach(u=>{a!==void 0&&(this.classes.get(u).tooltip=V(a))})}getTooltip(i,a){return a&&this.namespaces.has(a)?this.namespaces.get(a).classes.get(i).tooltip:this.classes.get(i).tooltip}setLink(i,a,u){const l=D();i.split(",").forEach(n=>{let p=n;/\d/.exec(n[0])&&(p=pe+p);const f=this.classes.get(p);f&&(f.link=we.formatUrl(a,l),l.securityLevel==="sandbox"?f.linkTarget="_top":typeof u=="string"?f.linkTarget=V(u):f.linkTarget="_blank")}),this.setCssClass(i,"clickable")}setClickEvent(i,a,u){i.split(",").forEach(l=>{this.setClickFunc(l,a,u),this.classes.get(l).haveCallback=!0}),this.setCssClass(i,"clickable")}setClickFunc(i,a,u){const l=v.sanitizeText(i,D());if(D().securityLevel!=="loose"||a===void 0)return;const p=l;if(this.classes.has(p)){const f=this.lookUpDomId(p);let C=[];if(typeof u=="string"){C=u.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let B=0;B{const B=document.querySelector(`[id="${f}"]`);B!==null&&B.addEventListener("click",()=>{we.runFunc(a,...C)},!1)})}}bindFunctions(i){this.functions.forEach(a=>{a(i)})}getDirection(){return this.direction}setDirection(i){this.direction=i}addNamespace(i){this.namespaces.has(i)||(this.namespaces.set(i,{id:i,classes:new Map,children:{},domId:pe+i+"-"+this.namespaceCounter}),this.namespaceCounter++)}getNamespace(i){return this.namespaces.get(i)}getNamespaces(){return this.namespaces}addClassesToNamespace(i,a){if(this.namespaces.has(i))for(const u of a){const{className:l}=this.splitClassNameAndType(u);this.classes.get(l).parent=i,this.namespaces.get(i).classes.set(l,this.classes.get(l))}}setCssStyle(i,a){const u=this.classes.get(i);if(!(!a||!u))for(const l of a)l.includes(",")?u.styles.push(...l.split(",")):u.styles.push(l)}getArrowMarker(i){let a;switch(i){case 0:a="aggregation";break;case 1:a="extension";break;case 2:a="composition";break;case 3:a="dependency";break;case 4:a="lollipop";break;default:a="none"}return a}getData(){const i=[],a=[],u=D();for(const n of this.namespaces.keys()){const p=this.namespaces.get(n);if(p){const f={id:p.id,label:p.id,isGroup:!0,padding:u.class.padding??16,shape:"rect",cssStyles:["fill: none","stroke: black"],look:u.look};i.push(f)}}for(const n of this.classes.keys()){const p=this.classes.get(n);if(p){const f=p;f.parentId=p.parent,f.look=u.look,i.push(f)}}let l=0;for(const n of this.notes){l++;const p={id:n.id,label:n.text,isGroup:!1,shape:"note",padding:u.class.padding??6,cssStyles:["text-align: left","white-space: nowrap",`fill: ${u.themeVariables.noteBkgColor}`,`stroke: ${u.themeVariables.noteBorderColor}`],look:u.look};i.push(p);const f=this.classes.get(n.class)?.id??"";if(f){const C={id:`edgeNote${l}`,start:n.id,end:f,type:"normal",thickness:"normal",classes:"relation",arrowTypeStart:"none",arrowTypeEnd:"none",arrowheadStyle:"",labelStyle:[""],style:["fill: none"],pattern:"dotted",look:u.look};a.push(C)}}for(const n of this.interfaces){const p={id:n.id,label:n.label,isGroup:!1,shape:"rect",cssStyles:["opacity: 0;"],look:u.look};i.push(p)}l=0;for(const n of this.relations){l++;const p={id:dt(n.id1,n.id2,{prefix:"id",counter:l}),start:n.id1,end:n.id2,type:"normal",label:n.title,labelpos:"c",thickness:"normal",classes:"relation",arrowTypeStart:this.getArrowMarker(n.relation.type1),arrowTypeEnd:this.getArrowMarker(n.relation.type2),startLabelRight:n.relationTitle1==="none"?"":n.relationTitle1,endLabelLeft:n.relationTitle2==="none"?"":n.relationTitle2,arrowheadStyle:"",labelStyle:["display: inline-block"],style:n.style||"",pattern:n.relation.lineType==1?"dashed":"solid",look:u.look};a.push(p)}return{nodes:i,edges:a,other:{},config:u,direction:this.getDirection()}}},A(U,"ClassDB"),U),At=A(s=>`g.classGroup text {
+ fill: ${s.nodeBorder||s.classText};
+ stroke: none;
+ font-family: ${s.fontFamily};
+ font-size: 10px;
+
+ .title {
+ font-weight: bolder;
+ }
+
+}
+
+.nodeLabel, .edgeLabel {
+ color: ${s.classText};
+}
+.edgeLabel .label rect {
+ fill: ${s.mainBkg};
+}
+.label text {
+ fill: ${s.classText};
+}
+
+.labelBkg {
+ background: ${s.mainBkg};
+}
+.edgeLabel .label span {
+ background: ${s.mainBkg};
+}
+
+.classTitle {
+ font-weight: bolder;
+}
+.node rect,
+ .node circle,
+ .node ellipse,
+ .node polygon,
+ .node path {
+ fill: ${s.mainBkg};
+ stroke: ${s.nodeBorder};
+ stroke-width: 1px;
+ }
+
+
+.divider {
+ stroke: ${s.nodeBorder};
+ stroke-width: 1;
+}
+
+g.clickable {
+ cursor: pointer;
+}
+
+g.classGroup rect {
+ fill: ${s.mainBkg};
+ stroke: ${s.nodeBorder};
+}
+
+g.classGroup line {
+ stroke: ${s.nodeBorder};
+ stroke-width: 1;
+}
+
+.classLabel .box {
+ stroke: none;
+ stroke-width: 0;
+ fill: ${s.mainBkg};
+ opacity: 0.5;
+}
+
+.classLabel .label {
+ fill: ${s.nodeBorder};
+ font-size: 10px;
+}
+
+.relation {
+ stroke: ${s.lineColor};
+ stroke-width: 1;
+ fill: none;
+}
+
+.dashed-line{
+ stroke-dasharray: 3;
+}
+
+.dotted-line{
+ stroke-dasharray: 1 2;
+}
+
+#compositionStart, .composition {
+ fill: ${s.lineColor} !important;
+ stroke: ${s.lineColor} !important;
+ stroke-width: 1;
+}
+
+#compositionEnd, .composition {
+ fill: ${s.lineColor} !important;
+ stroke: ${s.lineColor} !important;
+ stroke-width: 1;
+}
+
+#dependencyStart, .dependency {
+ fill: ${s.lineColor} !important;
+ stroke: ${s.lineColor} !important;
+ stroke-width: 1;
+}
+
+#dependencyStart, .dependency {
+ fill: ${s.lineColor} !important;
+ stroke: ${s.lineColor} !important;
+ stroke-width: 1;
+}
+
+#extensionStart, .extension {
+ fill: transparent !important;
+ stroke: ${s.lineColor} !important;
+ stroke-width: 1;
+}
+
+#extensionEnd, .extension {
+ fill: transparent !important;
+ stroke: ${s.lineColor} !important;
+ stroke-width: 1;
+}
+
+#aggregationStart, .aggregation {
+ fill: transparent !important;
+ stroke: ${s.lineColor} !important;
+ stroke-width: 1;
+}
+
+#aggregationEnd, .aggregation {
+ fill: transparent !important;
+ stroke: ${s.lineColor} !important;
+ stroke-width: 1;
+}
+
+#lollipopStart, .lollipop {
+ fill: ${s.mainBkg} !important;
+ stroke: ${s.lineColor} !important;
+ stroke-width: 1;
+}
+
+#lollipopEnd, .lollipop {
+ fill: ${s.mainBkg} !important;
+ stroke: ${s.lineColor} !important;
+ stroke-width: 1;
+}
+
+.edgeTerminals {
+ font-size: 11px;
+ line-height: initial;
+}
+
+.classTitleText {
+ text-anchor: middle;
+ font-size: 18px;
+ fill: ${s.textColor};
+}
+ ${et()}
+`,"getStyles"),Dt=At,ft=A((s,i="TB")=>{if(!s.doc)return i;let a=i;for(const u of s.doc)u.stmt==="dir"&&(a=u.value);return a},"getDir"),gt=A(function(s,i){return i.db.getClasses()},"getClasses"),Ct=A(async function(s,i,a,u){Oe.info("REF0:"),Oe.info("Drawing class diagram (v3)",i);const{securityLevel:l,state:n,layout:p}=D(),f=u.db.getData(),C=tt(i,l);f.type=u.type,f.layoutAlgorithm=it(p),f.nodeSpacing=n?.nodeSpacing||50,f.rankSpacing=n?.rankSpacing||50,f.markers=["aggregation","extension","composition","dependency","lollipop"],f.diagramId=i,await at(f,C);const B=8;we.insertTitle(C,"classDiagramTitleText",n?.titleTopMargin??25,u.db.getDiagramTitle()),st(C,B,"classDiagram",n?.useMaxWidth??!0)},"draw"),Ft={getClasses:gt,draw:Ct,getDir:ft};export{kt as C,Tt as a,Ft as c,Dt as s};
diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-DI55MBZ5-Ckbm5c8K.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-DI55MBZ5-Ckbm5c8K.js
new file mode 100644
index 0000000000..14604c8f4c
--- /dev/null
+++ b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-DI55MBZ5-Ckbm5c8K.js
@@ -0,0 +1,220 @@
+import{g as te}from"./chunk-55IACEB6-DUaTCW0f.js";import{s as ee}from"./chunk-QN33PNHL-Cb84mGB3.js";import{_ as u,E as b,z as w,S as se,T as ie,x as re,y as ae,w as ne,v as oe,U as le,V as ce,ak as he,O as U,$ as ue}from"./index-DpOBiJiD.js";var vt=(function(){var t=u(function(Y,o,c,n){for(c=c||{},n=Y.length;n--;c[Y[n]]=o);return c},"o"),e=[1,2],s=[1,3],a=[1,4],r=[2,4],h=[1,9],d=[1,11],S=[1,16],f=[1,17],T=[1,18],_=[1,19],m=[1,33],A=[1,20],v=[1,21],p=[1,22],k=[1,23],R=[1,24],L=[1,26],$=[1,27],I=[1,28],P=[1,29],st=[1,30],it=[1,31],rt=[1,32],at=[1,35],nt=[1,36],ot=[1,37],lt=[1,38],H=[1,34],y=[1,4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],ct=[1,4,5,14,15,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,39,40,41,45,48,51,52,53,54,57],xt=[4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],gt={trace:u(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NL:5,SD:6,document:7,line:8,statement:9,classDefStatement:10,styleStatement:11,cssClassStatement:12,idStatement:13,DESCR:14,"-->":15,HIDE_EMPTY:16,scale:17,WIDTH:18,COMPOSIT_STATE:19,STRUCT_START:20,STRUCT_STOP:21,STATE_DESCR:22,AS:23,ID:24,FORK:25,JOIN:26,CHOICE:27,CONCURRENT:28,note:29,notePosition:30,NOTE_TEXT:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,CLICK:38,STRING:39,HREF:40,classDef:41,CLASSDEF_ID:42,CLASSDEF_STYLEOPTS:43,DEFAULT:44,style:45,STYLE_IDS:46,STYLEDEF_STYLEOPTS:47,class:48,CLASSENTITY_IDS:49,STYLECLASS:50,direction_tb:51,direction_bt:52,direction_rl:53,direction_lr:54,eol:55,";":56,EDGE_STATE:57,STYLE_SEPARATOR:58,left_of:59,right_of:60,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NL",6:"SD",14:"DESCR",15:"-->",16:"HIDE_EMPTY",17:"scale",18:"WIDTH",19:"COMPOSIT_STATE",20:"STRUCT_START",21:"STRUCT_STOP",22:"STATE_DESCR",23:"AS",24:"ID",25:"FORK",26:"JOIN",27:"CHOICE",28:"CONCURRENT",29:"note",31:"NOTE_TEXT",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",38:"CLICK",39:"STRING",40:"HREF",41:"classDef",42:"CLASSDEF_ID",43:"CLASSDEF_STYLEOPTS",44:"DEFAULT",45:"style",46:"STYLE_IDS",47:"STYLEDEF_STYLEOPTS",48:"class",49:"CLASSENTITY_IDS",50:"STYLECLASS",51:"direction_tb",52:"direction_bt",53:"direction_rl",54:"direction_lr",56:";",57:"EDGE_STATE",58:"STYLE_SEPARATOR",59:"left_of",60:"right_of"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,3],[9,4],[9,1],[9,2],[9,1],[9,4],[9,3],[9,6],[9,1],[9,1],[9,1],[9,1],[9,4],[9,4],[9,1],[9,2],[9,2],[9,1],[9,5],[9,5],[10,3],[10,3],[11,3],[12,3],[32,1],[32,1],[32,1],[32,1],[55,1],[55,1],[13,1],[13,1],[13,3],[13,3],[30,1],[30,1]],performAction:u(function(o,c,n,g,E,i,J){var l=i.length-1;switch(E){case 3:return g.setRootDoc(i[l]),i[l];case 4:this.$=[];break;case 5:i[l]!="nl"&&(i[l-1].push(i[l]),this.$=i[l-1]);break;case 6:case 7:this.$=i[l];break;case 8:this.$="nl";break;case 12:this.$=i[l];break;case 13:const q=i[l-1];q.description=g.trimColon(i[l]),this.$=q;break;case 14:this.$={stmt:"relation",state1:i[l-2],state2:i[l]};break;case 15:const Tt=g.trimColon(i[l]);this.$={stmt:"relation",state1:i[l-3],state2:i[l-1],description:Tt};break;case 19:this.$={stmt:"state",id:i[l-3],type:"default",description:"",doc:i[l-1]};break;case 20:var B=i[l],z=i[l-2].trim();if(i[l].match(":")){var ut=i[l].split(":");B=ut[0],z=[z,ut[1]]}this.$={stmt:"state",id:B,type:"default",description:z};break;case 21:this.$={stmt:"state",id:i[l-3],type:"default",description:i[l-5],doc:i[l-1]};break;case 22:this.$={stmt:"state",id:i[l],type:"fork"};break;case 23:this.$={stmt:"state",id:i[l],type:"join"};break;case 24:this.$={stmt:"state",id:i[l],type:"choice"};break;case 25:this.$={stmt:"state",id:g.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:i[l-1].trim(),note:{position:i[l-2].trim(),text:i[l].trim()}};break;case 29:this.$=i[l].trim(),g.setAccTitle(this.$);break;case 30:case 31:this.$=i[l].trim(),g.setAccDescription(this.$);break;case 32:this.$={stmt:"click",id:i[l-3],url:i[l-2],tooltip:i[l-1]};break;case 33:this.$={stmt:"click",id:i[l-3],url:i[l-1],tooltip:""};break;case 34:case 35:this.$={stmt:"classDef",id:i[l-1].trim(),classes:i[l].trim()};break;case 36:this.$={stmt:"style",id:i[l-1].trim(),styleClass:i[l].trim()};break;case 37:this.$={stmt:"applyClass",id:i[l-1].trim(),styleClass:i[l].trim()};break;case 38:g.setDirection("TB"),this.$={stmt:"dir",value:"TB"};break;case 39:g.setDirection("BT"),this.$={stmt:"dir",value:"BT"};break;case 40:g.setDirection("RL"),this.$={stmt:"dir",value:"RL"};break;case 41:g.setDirection("LR"),this.$={stmt:"dir",value:"LR"};break;case 44:case 45:this.$={stmt:"state",id:i[l].trim(),type:"default",description:""};break;case 46:this.$={stmt:"state",id:i[l-2].trim(),classes:[i[l].trim()],type:"default",description:""};break;case 47:this.$={stmt:"state",id:i[l-2].trim(),classes:[i[l].trim()],type:"default",description:""};break}},"anonymous"),table:[{3:1,4:e,5:s,6:a},{1:[3]},{3:5,4:e,5:s,6:a},{3:6,4:e,5:s,6:a},t([1,4,5,16,17,19,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],r,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:h,5:d,8:8,9:10,10:12,11:13,12:14,13:15,16:S,17:f,19:T,22:_,24:m,25:A,26:v,27:p,28:k,29:R,32:25,33:L,35:$,37:I,38:P,41:st,45:it,48:rt,51:at,52:nt,53:ot,54:lt,57:H},t(y,[2,5]),{9:39,10:12,11:13,12:14,13:15,16:S,17:f,19:T,22:_,24:m,25:A,26:v,27:p,28:k,29:R,32:25,33:L,35:$,37:I,38:P,41:st,45:it,48:rt,51:at,52:nt,53:ot,54:lt,57:H},t(y,[2,7]),t(y,[2,8]),t(y,[2,9]),t(y,[2,10]),t(y,[2,11]),t(y,[2,12],{14:[1,40],15:[1,41]}),t(y,[2,16]),{18:[1,42]},t(y,[2,18],{20:[1,43]}),{23:[1,44]},t(y,[2,22]),t(y,[2,23]),t(y,[2,24]),t(y,[2,25]),{30:45,31:[1,46],59:[1,47],60:[1,48]},t(y,[2,28]),{34:[1,49]},{36:[1,50]},t(y,[2,31]),{13:51,24:m,57:H},{42:[1,52],44:[1,53]},{46:[1,54]},{49:[1,55]},t(ct,[2,44],{58:[1,56]}),t(ct,[2,45],{58:[1,57]}),t(y,[2,38]),t(y,[2,39]),t(y,[2,40]),t(y,[2,41]),t(y,[2,6]),t(y,[2,13]),{13:58,24:m,57:H},t(y,[2,17]),t(xt,r,{7:59}),{24:[1,60]},{24:[1,61]},{23:[1,62]},{24:[2,48]},{24:[2,49]},t(y,[2,29]),t(y,[2,30]),{39:[1,63],40:[1,64]},{43:[1,65]},{43:[1,66]},{47:[1,67]},{50:[1,68]},{24:[1,69]},{24:[1,70]},t(y,[2,14],{14:[1,71]}),{4:h,5:d,8:8,9:10,10:12,11:13,12:14,13:15,16:S,17:f,19:T,21:[1,72],22:_,24:m,25:A,26:v,27:p,28:k,29:R,32:25,33:L,35:$,37:I,38:P,41:st,45:it,48:rt,51:at,52:nt,53:ot,54:lt,57:H},t(y,[2,20],{20:[1,73]}),{31:[1,74]},{24:[1,75]},{39:[1,76]},{39:[1,77]},t(y,[2,34]),t(y,[2,35]),t(y,[2,36]),t(y,[2,37]),t(ct,[2,46]),t(ct,[2,47]),t(y,[2,15]),t(y,[2,19]),t(xt,r,{7:78}),t(y,[2,26]),t(y,[2,27]),{5:[1,79]},{5:[1,80]},{4:h,5:d,8:8,9:10,10:12,11:13,12:14,13:15,16:S,17:f,19:T,21:[1,81],22:_,24:m,25:A,26:v,27:p,28:k,29:R,32:25,33:L,35:$,37:I,38:P,41:st,45:it,48:rt,51:at,52:nt,53:ot,54:lt,57:H},t(y,[2,32]),t(y,[2,33]),t(y,[2,21])],defaultActions:{5:[2,1],6:[2,2],47:[2,48],48:[2,49]},parseError:u(function(o,c){if(c.recoverable)this.trace(o);else{var n=new Error(o);throw n.hash=c,n}},"parseError"),parse:u(function(o){var c=this,n=[0],g=[],E=[null],i=[],J=this.table,l="",B=0,z=0,ut=2,q=1,Tt=i.slice.call(arguments,1),D=Object.create(this.lexer),V={yy:{}};for(var Et in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Et)&&(V.yy[Et]=this.yy[Et]);D.setInput(o,V.yy),V.yy.lexer=D,V.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var _t=D.yylloc;i.push(_t);var Qt=D.options&&D.options.ranges;typeof V.yy.parseError=="function"?this.parseError=V.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Zt(O){n.length=n.length-2*O,E.length=E.length-O,i.length=i.length-O}u(Zt,"popStack");function Lt(){var O;return O=g.pop()||D.lex()||q,typeof O!="number"&&(O instanceof Array&&(g=O,O=g.pop()),O=c.symbols_[O]||O),O}u(Lt,"lex");for(var x,M,N,mt,W={},dt,F,It,ft;;){if(M=n[n.length-1],this.defaultActions[M]?N=this.defaultActions[M]:((x===null||typeof x>"u")&&(x=Lt()),N=J[M]&&J[M][x]),typeof N>"u"||!N.length||!N[0]){var bt="";ft=[];for(dt in J[M])this.terminals_[dt]&&dt>ut&&ft.push("'"+this.terminals_[dt]+"'");D.showPosition?bt="Parse error on line "+(B+1)+`:
+`+D.showPosition()+`
+Expecting `+ft.join(", ")+", got '"+(this.terminals_[x]||x)+"'":bt="Parse error on line "+(B+1)+": Unexpected "+(x==q?"end of input":"'"+(this.terminals_[x]||x)+"'"),this.parseError(bt,{text:D.match,token:this.terminals_[x]||x,line:D.yylineno,loc:_t,expected:ft})}if(N[0]instanceof Array&&N.length>1)throw new Error("Parse Error: multiple actions possible at state: "+M+", token: "+x);switch(N[0]){case 1:n.push(x),E.push(D.yytext),i.push(D.yylloc),n.push(N[1]),x=null,z=D.yyleng,l=D.yytext,B=D.yylineno,_t=D.yylloc;break;case 2:if(F=this.productions_[N[1]][1],W.$=E[E.length-F],W._$={first_line:i[i.length-(F||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(F||1)].first_column,last_column:i[i.length-1].last_column},Qt&&(W._$.range=[i[i.length-(F||1)].range[0],i[i.length-1].range[1]]),mt=this.performAction.apply(W,[l,z,B,V.yy,N[1],E,i].concat(Tt)),typeof mt<"u")return mt;F&&(n=n.slice(0,-1*F*2),E=E.slice(0,-1*F),i=i.slice(0,-1*F)),n.push(this.productions_[N[1]][0]),E.push(W.$),i.push(W._$),It=J[n[n.length-2]][n[n.length-1]],n.push(It);break;case 3:return!0}}return!0},"parse")},qt=(function(){var Y={EOF:1,parseError:u(function(c,n){if(this.yy.parser)this.yy.parser.parseError(c,n);else throw new Error(c)},"parseError"),setInput:u(function(o,c){return this.yy=c||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},"setInput"),input:u(function(){var o=this._input[0];this.yytext+=o,this.yyleng++,this.offset++,this.match+=o,this.matched+=o;var c=o.match(/(?:\r\n?|\n).*/g);return c?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),o},"input"),unput:u(function(o){var c=o.length,n=o.split(/(?:\r\n?|\n)/g);this._input=o+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-c),this.offset-=c;var g=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),n.length-1&&(this.yylineno-=n.length-1);var E=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:n?(n.length===g.length?this.yylloc.first_column:0)+g[g.length-n.length].length-n[0].length:this.yylloc.first_column-c},this.options.ranges&&(this.yylloc.range=[E[0],E[0]+this.yyleng-c]),this.yyleng=this.yytext.length,this},"unput"),more:u(function(){return this._more=!0,this},"more"),reject:u(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
+`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:u(function(o){this.unput(this.match.slice(o))},"less"),pastInput:u(function(){var o=this.matched.substr(0,this.matched.length-this.match.length);return(o.length>20?"...":"")+o.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:u(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,"")},"upcomingInput"),showPosition:u(function(){var o=this.pastInput(),c=new Array(o.length+1).join("-");return o+this.upcomingInput()+`
+`+c+"^"},"showPosition"),test_match:u(function(o,c){var n,g,E;if(this.options.backtrack_lexer&&(E={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&&(E.yylloc.range=this.yylloc.range.slice(0))),g=o[0].match(/(?:\r\n?|\n).*/g),g&&(this.yylineno+=g.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:g?g[g.length-1].length-g[g.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],n=this.performAction.call(this,this.yy,this,c,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var i in E)this[i]=E[i];return!1}return!1},"test_match"),next:u(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var o,c,n,g;this._more||(this.yytext="",this.match="");for(var E=this._currentRules(),i=0;ic[0].length)){if(c=n,g=i,this.options.backtrack_lexer){if(o=this.test_match(n,E[i]),o!==!1)return o;if(this._backtrack){c=!1;continue}else return!1}else if(!this.options.flex)break}return c?(o=this.test_match(c,E[g]),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})},"next"),lex:u(function(){var c=this.next();return c||this.lex()},"lex"),begin:u(function(c){this.conditionStack.push(c)},"begin"),popState:u(function(){var c=this.conditionStack.length-1;return c>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:u(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:u(function(c){return c=this.conditionStack.length-1-Math.abs(c||0),c>=0?this.conditionStack[c]:"INITIAL"},"topState"),pushState:u(function(c){this.begin(c)},"pushState"),stateStackSize:u(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:u(function(c,n,g,E){switch(g){case 0:return 38;case 1:return 40;case 2:return 39;case 3:return 44;case 4:return 51;case 5:return 52;case 6:return 53;case 7:return 54;case 8:break;case 9:break;case 10:return 5;case 11:break;case 12:break;case 13:break;case 14:break;case 15:return this.pushState("SCALE"),17;case 16:return 18;case 17:this.popState();break;case 18:return this.begin("acc_title"),33;case 19:return this.popState(),"acc_title_value";case 20:return this.begin("acc_descr"),35;case 21:return this.popState(),"acc_descr_value";case 22:this.begin("acc_descr_multiline");break;case 23:this.popState();break;case 24:return"acc_descr_multiline_value";case 25:return this.pushState("CLASSDEF"),41;case 26:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 27:return this.popState(),this.pushState("CLASSDEFID"),42;case 28:return this.popState(),43;case 29:return this.pushState("CLASS"),48;case 30:return this.popState(),this.pushState("CLASS_STYLE"),49;case 31:return this.popState(),50;case 32:return this.pushState("STYLE"),45;case 33:return this.popState(),this.pushState("STYLEDEF_STYLES"),46;case 34:return this.popState(),47;case 35:return this.pushState("SCALE"),17;case 36:return 18;case 37:this.popState();break;case 38:this.pushState("STATE");break;case 39:return this.popState(),n.yytext=n.yytext.slice(0,-8).trim(),25;case 40:return this.popState(),n.yytext=n.yytext.slice(0,-8).trim(),26;case 41:return this.popState(),n.yytext=n.yytext.slice(0,-10).trim(),27;case 42:return this.popState(),n.yytext=n.yytext.slice(0,-8).trim(),25;case 43:return this.popState(),n.yytext=n.yytext.slice(0,-8).trim(),26;case 44:return this.popState(),n.yytext=n.yytext.slice(0,-10).trim(),27;case 45:return 51;case 46:return 52;case 47:return 53;case 48:return 54;case 49:this.pushState("STATE_STRING");break;case 50:return this.pushState("STATE_ID"),"AS";case 51:return this.popState(),"ID";case 52:this.popState();break;case 53:return"STATE_DESCR";case 54:return 19;case 55:this.popState();break;case 56:return this.popState(),this.pushState("struct"),20;case 57:break;case 58:return this.popState(),21;case 59:break;case 60:return this.begin("NOTE"),29;case 61:return this.popState(),this.pushState("NOTE_ID"),59;case 62:return this.popState(),this.pushState("NOTE_ID"),60;case 63:this.popState(),this.pushState("FLOATING_NOTE");break;case 64:return this.popState(),this.pushState("FLOATING_NOTE_ID"),"AS";case 65:break;case 66:return"NOTE_TEXT";case 67:return this.popState(),"ID";case 68:return this.popState(),this.pushState("NOTE_TEXT"),24;case 69:return this.popState(),n.yytext=n.yytext.substr(2).trim(),31;case 70:return this.popState(),n.yytext=n.yytext.slice(0,-8).trim(),31;case 71:return 6;case 72:return 6;case 73:return 16;case 74:return 57;case 75:return 24;case 76:return n.yytext=n.yytext.trim(),14;case 77:return 15;case 78:return 28;case 79:return 58;case 80:return 5;case 81:return"INVALID"}},"anonymous"),rules:[/^(?:click\b)/i,/^(?:href\b)/i,/^(?:"[^"]*")/i,/^(?:default\b)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:classDef\s+)/i,/^(?:DEFAULT\s+)/i,/^(?:\w+\s+)/i,/^(?:[^\n]*)/i,/^(?:class\s+)/i,/^(?:(\w+)+((,\s*\w+)*))/i,/^(?:[^\n]*)/i,/^(?:style\s+)/i,/^(?:[\w,]+\s+)/i,/^(?:[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:state\s+)/i,/^(?:.*<>)/i,/^(?:.*<>)/i,/^(?:.*<>)/i,/^(?:.*\[\[fork\]\])/i,/^(?:.*\[\[join\]\])/i,/^(?:.*\[\[choice\]\])/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:["])/i,/^(?:\s*as\s+)/i,/^(?:[^\n\{]*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n\s\{]+)/i,/^(?:\n)/i,/^(?:\{)/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:\})/i,/^(?:[\n])/i,/^(?:note\s+)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:")/i,/^(?:\s*as\s*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n]*)/i,/^(?:\s*[^:\n\s\-]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:[\s\S]*?end note\b)/i,/^(?:stateDiagram\s+)/i,/^(?:stateDiagram-v2\s+)/i,/^(?:hide empty description\b)/i,/^(?:\[\*\])/i,/^(?:[^:\n\s\-\{]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:-->)/i,/^(?:--)/i,/^(?::::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{LINE:{rules:[12,13],inclusive:!1},struct:{rules:[12,13,25,29,32,38,45,46,47,48,57,58,59,60,74,75,76,77,78],inclusive:!1},FLOATING_NOTE_ID:{rules:[67],inclusive:!1},FLOATING_NOTE:{rules:[64,65,66],inclusive:!1},NOTE_TEXT:{rules:[69,70],inclusive:!1},NOTE_ID:{rules:[68],inclusive:!1},NOTE:{rules:[61,62,63],inclusive:!1},STYLEDEF_STYLEOPTS:{rules:[],inclusive:!1},STYLEDEF_STYLES:{rules:[34],inclusive:!1},STYLE_IDS:{rules:[],inclusive:!1},STYLE:{rules:[33],inclusive:!1},CLASS_STYLE:{rules:[31],inclusive:!1},CLASS:{rules:[30],inclusive:!1},CLASSDEFID:{rules:[28],inclusive:!1},CLASSDEF:{rules:[26,27],inclusive:!1},acc_descr_multiline:{rules:[23,24],inclusive:!1},acc_descr:{rules:[21],inclusive:!1},acc_title:{rules:[19],inclusive:!1},SCALE:{rules:[16,17,36,37],inclusive:!1},ALIAS:{rules:[],inclusive:!1},STATE_ID:{rules:[51],inclusive:!1},STATE_STRING:{rules:[52,53],inclusive:!1},FORK_STATE:{rules:[],inclusive:!1},STATE:{rules:[12,13,39,40,41,42,43,44,49,50,54,55,56],inclusive:!1},ID:{rules:[12,13],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,13,14,15,18,20,22,25,29,32,35,38,56,60,71,72,73,74,75,76,77,79,80,81],inclusive:!0}}};return Y})();gt.lexer=qt;function ht(){this.yy={}}return u(ht,"Parser"),ht.prototype=gt,gt.Parser=ht,new ht})();vt.parser=vt;var Be=vt,de="TB",Yt="TB",Ot="dir",X="state",K="root",Ct="relation",fe="classDef",pe="style",Se="applyClass",tt="default",Gt="divider",Bt="fill:none",Vt="fill: #333",Mt="c",Ut="text",jt="normal",Dt="rect",kt="rectWithTitle",ye="stateStart",ge="stateEnd",Rt="divider",Nt="roundedWithTitle",Te="note",Ee="noteGroup",et="statediagram",_e="state",me=`${et}-${_e}`,Ht="transition",be="note",De="note-edge",ke=`${Ht} ${De}`,ve=`${et}-${be}`,Ce="cluster",Ae=`${et}-${Ce}`,xe="cluster-alt",Le=`${et}-${xe}`,zt="parent",Wt="note",Ie="state",At="----",Oe=`${At}${Wt}`,wt=`${At}${zt}`,Kt=u((t,e=Yt)=>{if(!t.doc)return e;let s=e;for(const a of t.doc)a.stmt==="dir"&&(s=a.value);return s},"getDir"),Re=u(function(t,e){return e.db.getClasses()},"getClasses"),Ne=u(async function(t,e,s,a){b.info("REF0:"),b.info("Drawing state diagram (v2)",e);const{securityLevel:r,state:h,layout:d}=w();a.db.extract(a.db.getRootDocV2());const S=a.db.getData(),f=te(e,r);S.type=a.type,S.layoutAlgorithm=d,S.nodeSpacing=h?.nodeSpacing||50,S.rankSpacing=h?.rankSpacing||50,S.markers=["barb"],S.diagramId=e,await se(S,f);const T=8;try{(typeof a.db.getLinks=="function"?a.db.getLinks():new Map).forEach((m,A)=>{const v=typeof A=="string"?A:typeof A?.id=="string"?A.id:"";if(!v){b.warn("⚠️ Invalid or missing stateId from key:",JSON.stringify(A));return}const p=f.node()?.querySelectorAll("g");let k;if(p?.forEach(I=>{I.textContent?.trim()===v&&(k=I)}),!k){b.warn("⚠️ Could not find node matching text:",v);return}const R=k.parentNode;if(!R){b.warn("⚠️ Node has no parent, cannot wrap:",v);return}const L=document.createElementNS("http://www.w3.org/2000/svg","a"),$=m.url.replace(/^"+|"+$/g,"");if(L.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",$),L.setAttribute("target","_blank"),m.tooltip){const I=m.tooltip.replace(/^"+|"+$/g,"");L.setAttribute("title",I)}R.replaceChild(L,k),L.appendChild(k),b.info("🔗 Wrapped node in tag for:",v,m.url)})}catch(_){b.error("❌ Error injecting clickable links:",_)}ie.insertTitle(f,"statediagramTitleText",h?.titleTopMargin??25,a.db.getDiagramTitle()),ee(f,T,et,h?.useMaxWidth??!0)},"draw"),Ve={getClasses:Re,draw:Ne,getDir:Kt},St=new Map,G=0;function yt(t="",e=0,s="",a=At){const r=s!==null&&s.length>0?`${a}${s}`:"";return`${Ie}-${t}${r}-${e}`}u(yt,"stateDomId");var we=u((t,e,s,a,r,h,d,S)=>{b.trace("items",e),e.forEach(f=>{switch(f.stmt){case X:Z(t,f,s,a,r,h,d,S);break;case tt:Z(t,f,s,a,r,h,d,S);break;case Ct:{Z(t,f.state1,s,a,r,h,d,S),Z(t,f.state2,s,a,r,h,d,S);const T={id:"edge"+G,start:f.state1.id,end:f.state2.id,arrowhead:"normal",arrowTypeEnd:"arrow_barb",style:Bt,labelStyle:"",label:U.sanitizeText(f.description??"",w()),arrowheadStyle:Vt,labelpos:Mt,labelType:Ut,thickness:jt,classes:Ht,look:d};r.push(T),G++}break}})},"setupDoc"),$t=u((t,e=Yt)=>{let s=e;if(t.doc)for(const a of t.doc)a.stmt==="dir"&&(s=a.value);return s},"getDir");function Q(t,e,s){if(!e.id||e.id===""||e.id==="")return;e.cssClasses&&(Array.isArray(e.cssCompiledStyles)||(e.cssCompiledStyles=[]),e.cssClasses.split(" ").forEach(r=>{const h=s.get(r);h&&(e.cssCompiledStyles=[...e.cssCompiledStyles??[],...h.styles])}));const a=t.find(r=>r.id===e.id);a?Object.assign(a,e):t.push(e)}u(Q,"insertOrUpdateNode");function Xt(t){return t?.classes?.join(" ")??""}u(Xt,"getClassesFromDbInfo");function Jt(t){return t?.styles??[]}u(Jt,"getStylesFromDbInfo");var Z=u((t,e,s,a,r,h,d,S)=>{const f=e.id,T=s.get(f),_=Xt(T),m=Jt(T),A=w();if(b.info("dataFetcher parsedItem",e,T,m),f!=="root"){let v=Dt;e.start===!0?v=ye:e.start===!1&&(v=ge),e.type!==tt&&(v=e.type),St.get(f)||St.set(f,{id:f,shape:v,description:U.sanitizeText(f,A),cssClasses:`${_} ${me}`,cssStyles:m});const p=St.get(f);e.description&&(Array.isArray(p.description)?(p.shape=kt,p.description.push(e.description)):p.description?.length&&p.description.length>0?(p.shape=kt,p.description===f?p.description=[e.description]:p.description=[p.description,e.description]):(p.shape=Dt,p.description=e.description),p.description=U.sanitizeTextOrArray(p.description,A)),p.description?.length===1&&p.shape===kt&&(p.type==="group"?p.shape=Nt:p.shape=Dt),!p.type&&e.doc&&(b.info("Setting cluster for XCX",f,$t(e)),p.type="group",p.isGroup=!0,p.dir=$t(e),p.shape=e.type===Gt?Rt:Nt,p.cssClasses=`${p.cssClasses} ${Ae} ${h?Le:""}`);const k={labelStyle:"",shape:p.shape,label:p.description,cssClasses:p.cssClasses,cssCompiledStyles:[],cssStyles:p.cssStyles,id:f,dir:p.dir,domId:yt(f,G),type:p.type,isGroup:p.type==="group",padding:8,rx:10,ry:10,look:d};if(k.shape===Rt&&(k.label=""),t&&t.id!=="root"&&(b.trace("Setting node ",f," to be child of its parent ",t.id),k.parentId=t.id),k.centerLabel=!0,e.note){const R={labelStyle:"",shape:Te,label:e.note.text,cssClasses:ve,cssStyles:[],cssCompiledStyles:[],id:f+Oe+"-"+G,domId:yt(f,G,Wt),type:p.type,isGroup:p.type==="group",padding:A.flowchart?.padding,look:d,position:e.note.position},L=f+wt,$={labelStyle:"",shape:Ee,label:e.note.text,cssClasses:p.cssClasses,cssStyles:[],id:f+wt,domId:yt(f,G,zt),type:"group",isGroup:!0,padding:16,look:d,position:e.note.position};G++,$.id=L,R.parentId=L,Q(a,$,S),Q(a,R,S),Q(a,k,S);let I=f,P=R.id;e.note.position==="left of"&&(I=R.id,P=f),r.push({id:I+"-"+P,start:I,end:P,arrowhead:"none",arrowTypeEnd:"",style:Bt,labelStyle:"",classes:ke,arrowheadStyle:Vt,labelpos:Mt,labelType:Ut,thickness:jt,look:d})}else Q(a,k,S)}e.doc&&(b.trace("Adding nodes children "),we(e,e.doc,s,a,r,!h,d,S))},"dataFetcher"),$e=u(()=>{St.clear(),G=0},"reset"),C={START_NODE:"[*]",START_TYPE:"start",END_NODE:"[*]",END_TYPE:"end",COLOR_KEYWORD:"color",FILL_KEYWORD:"fill",BG_FILL:"bgFill",STYLECLASS_SEP:","},Pt=u(()=>new Map,"newClassesList"),Ft=u(()=>({relations:[],states:new Map,documents:{}}),"newDoc"),pt=u(t=>JSON.parse(JSON.stringify(t)),"clone"),j,Me=(j=class{constructor(e){this.version=e,this.nodes=[],this.edges=[],this.rootDoc=[],this.classes=Pt(),this.documents={root:Ft()},this.currentDocument=this.documents.root,this.startEndCount=0,this.dividerCnt=0,this.links=new Map,this.getAccTitle=re,this.setAccTitle=ae,this.getAccDescription=ne,this.setAccDescription=oe,this.setDiagramTitle=le,this.getDiagramTitle=ce,this.clear(),this.setRootDoc=this.setRootDoc.bind(this),this.getDividerId=this.getDividerId.bind(this),this.setDirection=this.setDirection.bind(this),this.trimColon=this.trimColon.bind(this)}extract(e){this.clear(!0);for(const r of Array.isArray(e)?e:e.doc)switch(r.stmt){case X:this.addState(r.id.trim(),r.type,r.doc,r.description,r.note);break;case Ct:this.addRelation(r.state1,r.state2,r.description);break;case fe:this.addStyleClass(r.id.trim(),r.classes);break;case pe:this.handleStyleDef(r);break;case Se:this.setCssClass(r.id.trim(),r.styleClass);break;case"click":this.addLink(r.id,r.url,r.tooltip);break}const s=this.getStates(),a=w();$e(),Z(void 0,this.getRootDocV2(),s,this.nodes,this.edges,!0,a.look,this.classes);for(const r of this.nodes)if(Array.isArray(r.label)){if(r.description=r.label.slice(1),r.isGroup&&r.description.length>0)throw new Error(`Group nodes can only have label. Remove the additional description for node [${r.id}]`);r.label=r.label[0]}}handleStyleDef(e){const s=e.id.trim().split(","),a=e.styleClass.split(",");for(const r of s){let h=this.getState(r);if(!h){const d=r.trim();this.addState(d),h=this.getState(d)}h&&(h.styles=a.map(d=>d.replace(/;/g,"")?.trim()))}}setRootDoc(e){b.info("Setting root doc",e),this.rootDoc=e,this.version===1?this.extract(e):this.extract(this.getRootDocV2())}docTranslator(e,s,a){if(s.stmt===Ct){this.docTranslator(e,s.state1,!0),this.docTranslator(e,s.state2,!1);return}if(s.stmt===X&&(s.id===C.START_NODE?(s.id=e.id+(a?"_start":"_end"),s.start=a):s.id=s.id.trim()),s.stmt!==K&&s.stmt!==X||!s.doc)return;const r=[];let h=[];for(const d of s.doc)if(d.type===Gt){const S=pt(d);S.doc=pt(h),r.push(S),h=[]}else h.push(d);if(r.length>0&&h.length>0){const d={stmt:X,id:he(),type:"divider",doc:pt(h)};r.push(pt(d)),s.doc=r}s.doc.forEach(d=>this.docTranslator(s,d,!0))}getRootDocV2(){return this.docTranslator({id:K,stmt:K},{id:K,stmt:K,doc:this.rootDoc},!0),{id:K,doc:this.rootDoc}}addState(e,s=tt,a=void 0,r=void 0,h=void 0,d=void 0,S=void 0,f=void 0){const T=e?.trim();if(!this.currentDocument.states.has(T))b.info("Adding state ",T,r),this.currentDocument.states.set(T,{stmt:X,id:T,descriptions:[],type:s,doc:a,note:h,classes:[],styles:[],textStyles:[]});else{const _=this.currentDocument.states.get(T);if(!_)throw new Error(`State not found: ${T}`);_.doc||(_.doc=a),_.type||(_.type=s)}if(r&&(b.info("Setting state description",T,r),(Array.isArray(r)?r:[r]).forEach(m=>this.addDescription(T,m.trim()))),h){const _=this.currentDocument.states.get(T);if(!_)throw new Error(`State not found: ${T}`);_.note=h,_.note.text=U.sanitizeText(_.note.text,w())}d&&(b.info("Setting state classes",T,d),(Array.isArray(d)?d:[d]).forEach(m=>this.setCssClass(T,m.trim()))),S&&(b.info("Setting state styles",T,S),(Array.isArray(S)?S:[S]).forEach(m=>this.setStyle(T,m.trim()))),f&&(b.info("Setting state styles",T,S),(Array.isArray(f)?f:[f]).forEach(m=>this.setTextStyle(T,m.trim())))}clear(e){this.nodes=[],this.edges=[],this.documents={root:Ft()},this.currentDocument=this.documents.root,this.startEndCount=0,this.classes=Pt(),e||(this.links=new Map,ue())}getState(e){return this.currentDocument.states.get(e)}getStates(){return this.currentDocument.states}logDocuments(){b.info("Documents = ",this.documents)}getRelations(){return this.currentDocument.relations}addLink(e,s,a){this.links.set(e,{url:s,tooltip:a}),b.warn("Adding link",e,s,a)}getLinks(){return this.links}startIdIfNeeded(e=""){return e===C.START_NODE?(this.startEndCount++,`${C.START_TYPE}${this.startEndCount}`):e}startTypeIfNeeded(e="",s=tt){return e===C.START_NODE?C.START_TYPE:s}endIdIfNeeded(e=""){return e===C.END_NODE?(this.startEndCount++,`${C.END_TYPE}${this.startEndCount}`):e}endTypeIfNeeded(e="",s=tt){return e===C.END_NODE?C.END_TYPE:s}addRelationObjs(e,s,a=""){const r=this.startIdIfNeeded(e.id.trim()),h=this.startTypeIfNeeded(e.id.trim(),e.type),d=this.startIdIfNeeded(s.id.trim()),S=this.startTypeIfNeeded(s.id.trim(),s.type);this.addState(r,h,e.doc,e.description,e.note,e.classes,e.styles,e.textStyles),this.addState(d,S,s.doc,s.description,s.note,s.classes,s.styles,s.textStyles),this.currentDocument.relations.push({id1:r,id2:d,relationTitle:U.sanitizeText(a,w())})}addRelation(e,s,a){if(typeof e=="object"&&typeof s=="object")this.addRelationObjs(e,s,a);else if(typeof e=="string"&&typeof s=="string"){const r=this.startIdIfNeeded(e.trim()),h=this.startTypeIfNeeded(e),d=this.endIdIfNeeded(s.trim()),S=this.endTypeIfNeeded(s);this.addState(r,h),this.addState(d,S),this.currentDocument.relations.push({id1:r,id2:d,relationTitle:a?U.sanitizeText(a,w()):void 0})}}addDescription(e,s){const a=this.currentDocument.states.get(e),r=s.startsWith(":")?s.replace(":","").trim():s;a?.descriptions?.push(U.sanitizeText(r,w()))}cleanupLabel(e){return e.startsWith(":")?e.slice(2).trim():e.trim()}getDividerId(){return this.dividerCnt++,`divider-id-${this.dividerCnt}`}addStyleClass(e,s=""){this.classes.has(e)||this.classes.set(e,{id:e,styles:[],textStyles:[]});const a=this.classes.get(e);s&&a&&s.split(C.STYLECLASS_SEP).forEach(r=>{const h=r.replace(/([^;]*);/,"$1").trim();if(RegExp(C.COLOR_KEYWORD).exec(r)){const S=h.replace(C.FILL_KEYWORD,C.BG_FILL).replace(C.COLOR_KEYWORD,C.FILL_KEYWORD);a.textStyles.push(S)}a.styles.push(h)})}getClasses(){return this.classes}setCssClass(e,s){e.split(",").forEach(a=>{let r=this.getState(a);if(!r){const h=a.trim();this.addState(h),r=this.getState(h)}r?.classes?.push(s)})}setStyle(e,s){this.getState(e)?.styles?.push(s)}setTextStyle(e,s){this.getState(e)?.textStyles?.push(s)}getDirectionStatement(){return this.rootDoc.find(e=>e.stmt===Ot)}getDirection(){return this.getDirectionStatement()?.value??de}setDirection(e){const s=this.getDirectionStatement();s?s.value=e:this.rootDoc.unshift({stmt:Ot,value:e})}trimColon(e){return e.startsWith(":")?e.slice(1).trim():e.trim()}getData(){const e=w();return{nodes:this.nodes,edges:this.edges,other:{},config:e,direction:Kt(this.getRootDocV2())}}getConfig(){return w().state}},u(j,"StateDB"),j.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3},j),Pe=u(t=>`
+defs #statediagram-barbEnd {
+ fill: ${t.transitionColor};
+ stroke: ${t.transitionColor};
+ }
+g.stateGroup text {
+ fill: ${t.nodeBorder};
+ stroke: none;
+ font-size: 10px;
+}
+g.stateGroup text {
+ fill: ${t.textColor};
+ stroke: none;
+ font-size: 10px;
+
+}
+g.stateGroup .state-title {
+ font-weight: bolder;
+ fill: ${t.stateLabelColor};
+}
+
+g.stateGroup rect {
+ fill: ${t.mainBkg};
+ stroke: ${t.nodeBorder};
+}
+
+g.stateGroup line {
+ stroke: ${t.lineColor};
+ stroke-width: 1;
+}
+
+.transition {
+ stroke: ${t.transitionColor};
+ stroke-width: 1;
+ fill: none;
+}
+
+.stateGroup .composit {
+ fill: ${t.background};
+ border-bottom: 1px
+}
+
+.stateGroup .alt-composit {
+ fill: #e0e0e0;
+ border-bottom: 1px
+}
+
+.state-note {
+ stroke: ${t.noteBorderColor};
+ fill: ${t.noteBkgColor};
+
+ text {
+ fill: ${t.noteTextColor};
+ stroke: none;
+ font-size: 10px;
+ }
+}
+
+.stateLabel .box {
+ stroke: none;
+ stroke-width: 0;
+ fill: ${t.mainBkg};
+ opacity: 0.5;
+}
+
+.edgeLabel .label rect {
+ fill: ${t.labelBackgroundColor};
+ opacity: 0.5;
+}
+.edgeLabel {
+ background-color: ${t.edgeLabelBackground};
+ p {
+ background-color: ${t.edgeLabelBackground};
+ }
+ rect {
+ opacity: 0.5;
+ background-color: ${t.edgeLabelBackground};
+ fill: ${t.edgeLabelBackground};
+ }
+ text-align: center;
+}
+.edgeLabel .label text {
+ fill: ${t.transitionLabelColor||t.tertiaryTextColor};
+}
+.label div .edgeLabel {
+ color: ${t.transitionLabelColor||t.tertiaryTextColor};
+}
+
+.stateLabel text {
+ fill: ${t.stateLabelColor};
+ font-size: 10px;
+ font-weight: bold;
+}
+
+.node circle.state-start {
+ fill: ${t.specialStateColor};
+ stroke: ${t.specialStateColor};
+}
+
+.node .fork-join {
+ fill: ${t.specialStateColor};
+ stroke: ${t.specialStateColor};
+}
+
+.node circle.state-end {
+ fill: ${t.innerEndBackground};
+ stroke: ${t.background};
+ stroke-width: 1.5
+}
+.end-state-inner {
+ fill: ${t.compositeBackground||t.background};
+ // stroke: ${t.background};
+ stroke-width: 1.5
+}
+
+.node rect {
+ fill: ${t.stateBkg||t.mainBkg};
+ stroke: ${t.stateBorder||t.nodeBorder};
+ stroke-width: 1px;
+}
+.node polygon {
+ fill: ${t.mainBkg};
+ stroke: ${t.stateBorder||t.nodeBorder};;
+ stroke-width: 1px;
+}
+#statediagram-barbEnd {
+ fill: ${t.lineColor};
+}
+
+.statediagram-cluster rect {
+ fill: ${t.compositeTitleBackground};
+ stroke: ${t.stateBorder||t.nodeBorder};
+ stroke-width: 1px;
+}
+
+.cluster-label, .nodeLabel {
+ color: ${t.stateLabelColor};
+ // line-height: 1;
+}
+
+.statediagram-cluster rect.outer {
+ rx: 5px;
+ ry: 5px;
+}
+.statediagram-state .divider {
+ stroke: ${t.stateBorder||t.nodeBorder};
+}
+
+.statediagram-state .title-state {
+ rx: 5px;
+ ry: 5px;
+}
+.statediagram-cluster.statediagram-cluster .inner {
+ fill: ${t.compositeBackground||t.background};
+}
+.statediagram-cluster.statediagram-cluster-alt .inner {
+ fill: ${t.altBackground?t.altBackground:"#efefef"};
+}
+
+.statediagram-cluster .inner {
+ rx:0;
+ ry:0;
+}
+
+.statediagram-state rect.basic {
+ rx: 5px;
+ ry: 5px;
+}
+.statediagram-state rect.divider {
+ stroke-dasharray: 10,10;
+ fill: ${t.altBackground?t.altBackground:"#efefef"};
+}
+
+.note-edge {
+ stroke-dasharray: 5;
+}
+
+.statediagram-note rect {
+ fill: ${t.noteBkgColor};
+ stroke: ${t.noteBorderColor};
+ stroke-width: 1px;
+ rx: 0;
+ ry: 0;
+}
+.statediagram-note rect {
+ fill: ${t.noteBkgColor};
+ stroke: ${t.noteBorderColor};
+ stroke-width: 1px;
+ rx: 0;
+ ry: 0;
+}
+
+.statediagram-note text {
+ fill: ${t.noteTextColor};
+}
+
+.statediagram-note .nodeLabel {
+ color: ${t.noteTextColor};
+}
+.statediagram .edgeLabel {
+ color: red; // ${t.noteTextColor};
+}
+
+#dependencyStart, #dependencyEnd {
+ fill: ${t.lineColor};
+ stroke: ${t.lineColor};
+ stroke-width: 1;
+}
+
+.statediagramTitleText {
+ text-anchor: middle;
+ font-size: 18px;
+ fill: ${t.textColor};
+}
+`,"getStyles"),Ue=Pe;export{Me as S,Be as a,Ve as b,Ue as s};
diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-FMBD7UC4-fSM8np9_.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-FMBD7UC4-fSM8np9_.js
new file mode 100644
index 0000000000..82b44f820a
--- /dev/null
+++ b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-FMBD7UC4-fSM8np9_.js
@@ -0,0 +1,15 @@
+import{_ as e}from"./index-DpOBiJiD.js";var l=e(()=>`
+ /* Font Awesome icon styling - consolidated */
+ .label-icon {
+ display: inline-block;
+ height: 1em;
+ overflow: visible;
+ vertical-align: -0.125em;
+ }
+
+ .node .label-icon path {
+ fill: currentColor;
+ stroke: revert;
+ stroke-width: revert;
+ }
+`,"getIconStyles");export{l as g};
diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-IGSAU2ZA-BcGvhJAc.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-IGSAU2ZA-BcGvhJAc.js
new file mode 100644
index 0000000000..888f4f50ae
--- /dev/null
+++ b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-IGSAU2ZA-BcGvhJAc.js
@@ -0,0 +1 @@
+import{i as h,k as i,l as p,r as x,j as M,n as H}from"./index-DpOBiJiD.js";var s=h((r,o)=>{const{as:t,children:d,className:l,...n}=r,{slots:c,classNames:a,headerId:m,setHeaderMounted:e}=i(),f=p(o),u=t||"header";return x.useEffect(()=>(e(!0),()=>e(!1)),[e]),M.jsx(u,{ref:f,className:c.header({class:H(a?.header,l)}),id:m,...n,children:d})});s.displayName="HeroUI.ModalHeader";var R=s;export{R as m};
diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-IGSAU2ZA-NXd1g0Qd.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-IGSAU2ZA-NXd1g0Qd.js
deleted file mode 100644
index 0831e92f07..0000000000
--- a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-IGSAU2ZA-NXd1g0Qd.js
+++ /dev/null
@@ -1 +0,0 @@
-import{l as h,be as p,R as x,r as i,j as M,Z as R}from"./index-BZLU40Mk.js";var s=h((r,o)=>{const{as:t,children:d,className:l,...n}=r,{slots:c,classNames:a,headerId:m,setHeaderMounted:e}=p(),f=x(o),u=t||"header";return i.useEffect(()=>(e(!0),()=>e(!1)),[e]),M.jsx(u,{ref:f,className:c.header({class:R(a?.header,l)}),id:m,...n,children:d})});s.displayName="HeroUI.ModalHeader";var N=s;export{N as m};
diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-QN33PNHL-Cb84mGB3.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-QN33PNHL-Cb84mGB3.js
new file mode 100644
index 0000000000..eee3be2380
--- /dev/null
+++ b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-QN33PNHL-Cb84mGB3.js
@@ -0,0 +1 @@
+import{_ as a,G as w,E as x}from"./index-DpOBiJiD.js";var g=a((e,t,i,r)=>{e.attr("class",i);const{width:o,height:h,x:n,y:c}=u(e,t);w(e,h,o,r);const s=B(n,c,o,h,t);e.attr("viewBox",s),x.debug(`viewBox configured: ${s} with padding: ${t}`)},"setupViewPortForSVG"),u=a((e,t)=>{const i=e.node()?.getBBox()||{width:0,height:0,x:0,y:0};return{width:i.width+t*2,height:i.height+t*2,x:i.x,y:i.y}},"calculateDimensionsWithPadding"),B=a((e,t,i,r,o)=>`${e-o} ${t-o} ${i} ${r}`,"createViewBox");export{g as s};
diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-QZHKN3VN-D5XXShj3.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-QZHKN3VN-D5XXShj3.js
new file mode 100644
index 0000000000..951c211fc8
--- /dev/null
+++ b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-QZHKN3VN-D5XXShj3.js
@@ -0,0 +1 @@
+import{_ as s}from"./index-DpOBiJiD.js";var t,e=(t=class{constructor(i){this.init=i,this.records=this.init()}reset(){this.records=this.init()}},s(t,"ImperativeState"),t);export{e as I};
diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-SSA7SXE4-CH4dnGpZ.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-SSA7SXE4-CH4dnGpZ.js
new file mode 100644
index 0000000000..509f41dd25
--- /dev/null
+++ b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-SSA7SXE4-CH4dnGpZ.js
@@ -0,0 +1 @@
+import{i as q,q as y,j as e,r as t,C as D}from"./index-DpOBiJiD.js";var E=q((B,H)=>{const{Component:L,label:u,description:r,isClearable:d,startContent:c,endContent:h,labelPlacement:O,hasHelper:x,isOutsideLeft:j,isOutsideTop:g,shouldLabelBeOutside:m,errorMessage:s,isInvalid:P,getBaseProps:w,getLabelProps:F,getInputProps:v,getInnerWrapperProps:C,getInputWrapperProps:o,getMainWrapperProps:I,getHelperWrapperProps:b,getDescriptionProps:i,getErrorMessageProps:l,getClearButtonProps:f}=y({...B,ref:H}),n=u?e.jsx("label",{...F(),children:u}):null,M=t.useMemo(()=>d?e.jsx("button",{...f(),children:h||e.jsx(D,{})}):h,[d,f]),p=t.useMemo(()=>{const W=P&&s;return!x||!(W||r)?null:e.jsx("div",{...b(),children:W?e.jsx("div",{...l(),children:s}):e.jsx("div",{...i(),children:r})})},[x,P,s,r,b,l,i]),a=t.useMemo(()=>e.jsxs("div",{...C(),children:[c,e.jsx("input",{...v()}),M]}),[c,M,v,C]),R=t.useMemo(()=>m?e.jsxs("div",{...I(),children:[e.jsxs("div",{...o(),children:[!j&&!g?n:null,a]}),p]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{...o(),children:[n,a]}),p]}),[O,p,m,n,a,s,r,I,o,l,i]);return e.jsxs(L,{...w(),children:[j||g?n:null,R]})});E.displayName="HeroUI.Input";var T=E;export{T as i};
diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-SSA7SXE4-CJa0HuAU.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-SSA7SXE4-CJa0HuAU.js
deleted file mode 100644
index 9c271739b1..0000000000
--- a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-SSA7SXE4-CJa0HuAU.js
+++ /dev/null
@@ -1 +0,0 @@
-import{l as y,bn as D,j as e,r as t,am as N}from"./index-BZLU40Mk.js";var E=y((B,H)=>{const{Component:L,label:u,description:r,isClearable:d,startContent:c,endContent:h,labelPlacement:O,hasHelper:x,isOutsideLeft:j,isOutsideTop:g,shouldLabelBeOutside:m,errorMessage:s,isInvalid:P,getBaseProps:w,getLabelProps:F,getInputProps:v,getInnerWrapperProps:b,getInputWrapperProps:o,getMainWrapperProps:C,getHelperWrapperProps:I,getDescriptionProps:l,getErrorMessageProps:i,getClearButtonProps:f}=D({...B,ref:H}),n=u?e.jsx("label",{...F(),children:u}):null,M=t.useMemo(()=>d?e.jsx("button",{...f(),children:h||e.jsx(N,{})}):h,[d,f]),p=t.useMemo(()=>{const W=P&&s;return!x||!(W||r)?null:e.jsx("div",{...I(),children:W?e.jsx("div",{...i(),children:s}):e.jsx("div",{...l(),children:r})})},[x,P,s,r,I,i,l]),a=t.useMemo(()=>e.jsxs("div",{...b(),children:[c,e.jsx("input",{...v()}),M]}),[c,M,v,b]),R=t.useMemo(()=>m?e.jsxs("div",{...C(),children:[e.jsxs("div",{...o(),children:[!j&&!g?n:null,a]}),p]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{...o(),children:[n,a]}),p]}),[O,p,m,n,a,s,r,C,o,i,l]);return e.jsxs(L,{...w(),children:[j||g?n:null,R]})});E.displayName="HeroUI.Input";var U=E;export{U as i};
diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-TZMSLE5B-DMZmIkT7.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-TZMSLE5B-DMZmIkT7.js
new file mode 100644
index 0000000000..64a336d6e7
--- /dev/null
+++ b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-TZMSLE5B-DMZmIkT7.js
@@ -0,0 +1 @@
+import{_ as n,al as o,M as l}from"./index-DpOBiJiD.js";var x=n((a,t)=>{const e=a.append("rect");if(e.attr("x",t.x),e.attr("y",t.y),e.attr("fill",t.fill),e.attr("stroke",t.stroke),e.attr("width",t.width),e.attr("height",t.height),t.name&&e.attr("name",t.name),t.rx&&e.attr("rx",t.rx),t.ry&&e.attr("ry",t.ry),t.attrs!==void 0)for(const r in t.attrs)e.attr(r,t.attrs[r]);return t.class&&e.attr("class",t.class),e},"drawRect"),d=n((a,t)=>{const e={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(a,e).lower()},"drawBackgroundRect"),g=n((a,t)=>{const e=t.text.replace(o," "),r=a.append("text");r.attr("x",t.x),r.attr("y",t.y),r.attr("class","legend"),r.style("text-anchor",t.anchor),t.class&&r.attr("class",t.class);const s=r.append("tspan");return s.attr("x",t.x+t.textMargin*2),s.text(e),r},"drawText"),h=n((a,t,e,r)=>{const s=a.append("image");s.attr("x",t),s.attr("y",e);const i=l.sanitizeUrl(r);s.attr("xlink:href",i)},"drawImage"),m=n((a,t,e,r)=>{const s=a.append("use");s.attr("x",t),s.attr("y",e);const i=l.sanitizeUrl(r);s.attr("xlink:href",`#${i}`)},"drawEmbeddedImage"),y=n(()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0}),"getNoteRect"),p=n(()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0}),"getTextObj");export{d as a,p as b,m as c,x as d,h as e,g as f,y as g};
diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/classDiagram-2ON5EDUG-DRA-t-oi.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/classDiagram-2ON5EDUG-DRA-t-oi.js
new file mode 100644
index 0000000000..711c0d7971
--- /dev/null
+++ b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/classDiagram-2ON5EDUG-DRA-t-oi.js
@@ -0,0 +1 @@
+import{s as a,c as s,a as e,C as t}from"./chunk-B4BG7PRW-DtfSht4V.js";import{_ as i}from"./index-DpOBiJiD.js";import"./chunk-FMBD7UC4-fSM8np9_.js";import"./chunk-55IACEB6-DUaTCW0f.js";import"./chunk-QN33PNHL-Cb84mGB3.js";var p={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{p as diagram};
diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/classDiagram-v2-WZHVMYZB-DRA-t-oi.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/classDiagram-v2-WZHVMYZB-DRA-t-oi.js
new file mode 100644
index 0000000000..711c0d7971
--- /dev/null
+++ b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/classDiagram-v2-WZHVMYZB-DRA-t-oi.js
@@ -0,0 +1 @@
+import{s as a,c as s,a as e,C as t}from"./chunk-B4BG7PRW-DtfSht4V.js";import{_ as i}from"./index-DpOBiJiD.js";import"./chunk-FMBD7UC4-fSM8np9_.js";import"./chunk-55IACEB6-DUaTCW0f.js";import"./chunk-QN33PNHL-Cb84mGB3.js";var p={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{p as diagram};
diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/clone-CQ2NOoIB.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/clone-CQ2NOoIB.js
new file mode 100644
index 0000000000..51126b5cc5
--- /dev/null
+++ b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/clone-CQ2NOoIB.js
@@ -0,0 +1 @@
+import{c as r}from"./forEach-CTOHlvm6.js";var e=4;function a(o){return r(o,e)}export{a as c};
diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/cose-bilkent-S5V4N54A-CCAC2cqm.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/cose-bilkent-S5V4N54A-CCAC2cqm.js
new file mode 100644
index 0000000000..8461000717
--- /dev/null
+++ b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/cose-bilkent-S5V4N54A-CCAC2cqm.js
@@ -0,0 +1 @@
+import{bw as lt,_ as V,E as k,B as gt}from"./index-DpOBiJiD.js";import{c as tt}from"./cytoscape.esm-5J0xJHOV.js";var Z={exports:{}},$={exports:{}},Q={exports:{}},ut=Q.exports,j;function ft(){return j||(j=1,(function(G,b){(function(I,L){G.exports=L()})(ut,function(){return(function(N){var I={};function L(o){if(I[o])return I[o].exports;var e=I[o]={i:o,l:!1,exports:{}};return N[o].call(e.exports,e,e.exports,L),e.l=!0,e.exports}return L.m=N,L.c=I,L.i=function(o){return o},L.d=function(o,e,t){L.o(o,e)||Object.defineProperty(o,e,{configurable:!1,enumerable:!0,get:t})},L.n=function(o){var e=o&&o.__esModule?function(){return o.default}:function(){return o};return L.d(e,"a",e),e},L.o=function(o,e){return Object.prototype.hasOwnProperty.call(o,e)},L.p="",L(L.s=26)})([(function(N,I,L){function o(){}o.QUALITY=1,o.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,o.DEFAULT_INCREMENTAL=!1,o.DEFAULT_ANIMATION_ON_LAYOUT=!0,o.DEFAULT_ANIMATION_DURING_LAYOUT=!1,o.DEFAULT_ANIMATION_PERIOD=50,o.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,o.DEFAULT_GRAPH_MARGIN=15,o.NODE_DIMENSIONS_INCLUDE_LABELS=!1,o.SIMPLE_NODE_SIZE=40,o.SIMPLE_NODE_HALF_SIZE=o.SIMPLE_NODE_SIZE/2,o.EMPTY_COMPOUND_NODE_SIZE=40,o.MIN_EDGE_LENGTH=1,o.WORLD_BOUNDARY=1e6,o.INITIAL_WORLD_BOUNDARY=o.WORLD_BOUNDARY/1e3,o.WORLD_CENTER_X=1200,o.WORLD_CENTER_Y=900,N.exports=o}),(function(N,I,L){var o=L(2),e=L(8),t=L(9);function i(g,n,d){o.call(this,d),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=d,this.bendpoints=[],this.source=g,this.target=n}i.prototype=Object.create(o.prototype);for(var l in o)i[l]=o[l];i.prototype.getSource=function(){return this.source},i.prototype.getTarget=function(){return this.target},i.prototype.isInterGraph=function(){return this.isInterGraph},i.prototype.getLength=function(){return this.length},i.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},i.prototype.getBendpoints=function(){return this.bendpoints},i.prototype.getLca=function(){return this.lca},i.prototype.getSourceInLca=function(){return this.sourceInLca},i.prototype.getTargetInLca=function(){return this.targetInLca},i.prototype.getOtherEnd=function(g){if(this.source===g)return this.target;if(this.target===g)return this.source;throw"Node is not incident with this edge"},i.prototype.getOtherEndInGraph=function(g,n){for(var d=this.getOtherEnd(g),r=n.getGraphManager().getRoot();;){if(d.getOwner()==n)return d;if(d.getOwner()==r)break;d=d.getOwner().getParent()}return null},i.prototype.updateLength=function(){var g=new Array(4);this.isOverlapingSourceAndTarget=e.getIntersection(this.target.getRect(),this.source.getRect(),g),this.isOverlapingSourceAndTarget||(this.lengthX=g[0]-g[2],this.lengthY=g[1]-g[3],Math.abs(this.lengthX)<1&&(this.lengthX=t.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=t.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},i.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=t.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=t.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},N.exports=i}),(function(N,I,L){function o(e){this.vGraphObject=e}N.exports=o}),(function(N,I,L){var o=L(2),e=L(10),t=L(13),i=L(0),l=L(16),g=L(4);function n(r,h,a,p){a==null&&p==null&&(p=h),o.call(this,p),r.graphManager!=null&&(r=r.graphManager),this.estimatedSize=e.MIN_VALUE,this.inclusionTreeDepth=e.MAX_VALUE,this.vGraphObject=p,this.edges=[],this.graphManager=r,a!=null&&h!=null?this.rect=new t(h.x,h.y,a.width,a.height):this.rect=new t}n.prototype=Object.create(o.prototype);for(var d in o)n[d]=o[d];n.prototype.getEdges=function(){return this.edges},n.prototype.getChild=function(){return this.child},n.prototype.getOwner=function(){return this.owner},n.prototype.getWidth=function(){return this.rect.width},n.prototype.setWidth=function(r){this.rect.width=r},n.prototype.getHeight=function(){return this.rect.height},n.prototype.setHeight=function(r){this.rect.height=r},n.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},n.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},n.prototype.getCenter=function(){return new g(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},n.prototype.getLocation=function(){return new g(this.rect.x,this.rect.y)},n.prototype.getRect=function(){return this.rect},n.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},n.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},n.prototype.setRect=function(r,h){this.rect.x=r.x,this.rect.y=r.y,this.rect.width=h.width,this.rect.height=h.height},n.prototype.setCenter=function(r,h){this.rect.x=r-this.rect.width/2,this.rect.y=h-this.rect.height/2},n.prototype.setLocation=function(r,h){this.rect.x=r,this.rect.y=h},n.prototype.moveBy=function(r,h){this.rect.x+=r,this.rect.y+=h},n.prototype.getEdgeListToNode=function(r){var h=[],a=this;return a.edges.forEach(function(p){if(p.target==r){if(p.source!=a)throw"Incorrect edge source!";h.push(p)}}),h},n.prototype.getEdgesBetween=function(r){var h=[],a=this;return a.edges.forEach(function(p){if(!(p.source==a||p.target==a))throw"Incorrect edge source and/or target";(p.target==r||p.source==r)&&h.push(p)}),h},n.prototype.getNeighborsList=function(){var r=new Set,h=this;return h.edges.forEach(function(a){if(a.source==h)r.add(a.target);else{if(a.target!=h)throw"Incorrect incidency!";r.add(a.source)}}),r},n.prototype.withChildren=function(){var r=new Set,h,a;if(r.add(this),this.child!=null)for(var p=this.child.getNodes(),v=0;vh&&(this.rect.x-=(this.labelWidth-h)/2,this.setWidth(this.labelWidth)),this.labelHeight>a&&(this.labelPos=="center"?this.rect.y-=(this.labelHeight-a)/2:this.labelPos=="top"&&(this.rect.y-=this.labelHeight-a),this.setHeight(this.labelHeight))}}},n.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==e.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},n.prototype.transform=function(r){var h=this.rect.x;h>i.WORLD_BOUNDARY?h=i.WORLD_BOUNDARY:h<-i.WORLD_BOUNDARY&&(h=-i.WORLD_BOUNDARY);var a=this.rect.y;a>i.WORLD_BOUNDARY?a=i.WORLD_BOUNDARY:a<-i.WORLD_BOUNDARY&&(a=-i.WORLD_BOUNDARY);var p=new g(h,a),v=r.inverseTransformPoint(p);this.setLocation(v.x,v.y)},n.prototype.getLeft=function(){return this.rect.x},n.prototype.getRight=function(){return this.rect.x+this.rect.width},n.prototype.getTop=function(){return this.rect.y},n.prototype.getBottom=function(){return this.rect.y+this.rect.height},n.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},N.exports=n}),(function(N,I,L){function o(e,t){e==null&&t==null?(this.x=0,this.y=0):(this.x=e,this.y=t)}o.prototype.getX=function(){return this.x},o.prototype.getY=function(){return this.y},o.prototype.setX=function(e){this.x=e},o.prototype.setY=function(e){this.y=e},o.prototype.getDifference=function(e){return new DimensionD(this.x-e.x,this.y-e.y)},o.prototype.getCopy=function(){return new o(this.x,this.y)},o.prototype.translate=function(e){return this.x+=e.width,this.y+=e.height,this},N.exports=o}),(function(N,I,L){var o=L(2),e=L(10),t=L(0),i=L(6),l=L(3),g=L(1),n=L(13),d=L(12),r=L(11);function h(p,v,D){o.call(this,D),this.estimatedSize=e.MIN_VALUE,this.margin=t.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=p,v!=null&&v instanceof i?this.graphManager=v:v!=null&&v instanceof Layout&&(this.graphManager=v.graphManager)}h.prototype=Object.create(o.prototype);for(var a in o)h[a]=o[a];h.prototype.getNodes=function(){return this.nodes},h.prototype.getEdges=function(){return this.edges},h.prototype.getGraphManager=function(){return this.graphManager},h.prototype.getParent=function(){return this.parent},h.prototype.getLeft=function(){return this.left},h.prototype.getRight=function(){return this.right},h.prototype.getTop=function(){return this.top},h.prototype.getBottom=function(){return this.bottom},h.prototype.isConnected=function(){return this.isConnected},h.prototype.add=function(p,v,D){if(v==null&&D==null){var u=p;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(u)>-1)throw"Node already in graph!";return u.owner=this,this.getNodes().push(u),u}else{var T=p;if(!(this.getNodes().indexOf(v)>-1&&this.getNodes().indexOf(D)>-1))throw"Source or target not in graph!";if(!(v.owner==D.owner&&v.owner==this))throw"Both owners must be this graph!";return v.owner!=D.owner?null:(T.source=v,T.target=D,T.isInterGraph=!1,this.getEdges().push(T),v.edges.push(T),D!=v&&D.edges.push(T),T)}},h.prototype.remove=function(p){var v=p;if(p instanceof l){if(v==null)throw"Node is null!";if(!(v.owner!=null&&v.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var D=v.edges.slice(),u,T=D.length,y=0;y-1&&f>-1))throw"Source and/or target doesn't know this edge!";u.source.edges.splice(s,1),u.target!=u.source&&u.target.edges.splice(f,1);var O=u.source.owner.getEdges().indexOf(u);if(O==-1)throw"Not in owner's edge list!";u.source.owner.getEdges().splice(O,1)}},h.prototype.updateLeftTop=function(){for(var p=e.MAX_VALUE,v=e.MAX_VALUE,D,u,T,y=this.getNodes(),O=y.length,s=0;sD&&(p=D),v>u&&(v=u)}return p==e.MAX_VALUE?null:(y[0].getParent().paddingLeft!=null?T=y[0].getParent().paddingLeft:T=this.margin,this.left=v-T,this.top=p-T,new d(this.left,this.top))},h.prototype.updateBounds=function(p){for(var v=e.MAX_VALUE,D=-e.MAX_VALUE,u=e.MAX_VALUE,T=-e.MAX_VALUE,y,O,s,f,c,E=this.nodes,A=E.length,m=0;my&&(v=y),Ds&&(u=s),Ty&&(v=y),Ds&&(u=s),T=this.nodes.length){var A=0;D.forEach(function(m){m.owner==p&&A++}),A==this.nodes.length&&(this.isConnected=!0)}},N.exports=h}),(function(N,I,L){var o,e=L(1);function t(i){o=L(5),this.layout=i,this.graphs=[],this.edges=[]}t.prototype.addRoot=function(){var i=this.layout.newGraph(),l=this.layout.newNode(null),g=this.add(i,l);return this.setRootGraph(g),this.rootGraph},t.prototype.add=function(i,l,g,n,d){if(g==null&&n==null&&d==null){if(i==null)throw"Graph is null!";if(l==null)throw"Parent node is null!";if(this.graphs.indexOf(i)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(i),i.parent!=null)throw"Already has a parent!";if(l.child!=null)throw"Already has a child!";return i.parent=l,l.child=i,i}else{d=g,n=l,g=i;var r=n.getOwner(),h=d.getOwner();if(!(r!=null&&r.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(h!=null&&h.getGraphManager()==this))throw"Target not in this graph mgr!";if(r==h)return g.isInterGraph=!1,r.add(g,n,d);if(g.isInterGraph=!0,g.source=n,g.target=d,this.edges.indexOf(g)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(g),!(g.source!=null&&g.target!=null))throw"Edge source and/or target is null!";if(!(g.source.edges.indexOf(g)==-1&&g.target.edges.indexOf(g)==-1))throw"Edge already in source and/or target incidency list!";return g.source.edges.push(g),g.target.edges.push(g),g}},t.prototype.remove=function(i){if(i instanceof o){var l=i;if(l.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(l==this.rootGraph||l.parent!=null&&l.parent.graphManager==this))throw"Invalid parent node!";var g=[];g=g.concat(l.getEdges());for(var n,d=g.length,r=0;r=i.getRight()?l[0]+=Math.min(i.getX()-t.getX(),t.getRight()-i.getRight()):i.getX()<=t.getX()&&i.getRight()>=t.getRight()&&(l[0]+=Math.min(t.getX()-i.getX(),i.getRight()-t.getRight())),t.getY()<=i.getY()&&t.getBottom()>=i.getBottom()?l[1]+=Math.min(i.getY()-t.getY(),t.getBottom()-i.getBottom()):i.getY()<=t.getY()&&i.getBottom()>=t.getBottom()&&(l[1]+=Math.min(t.getY()-i.getY(),i.getBottom()-t.getBottom()));var d=Math.abs((i.getCenterY()-t.getCenterY())/(i.getCenterX()-t.getCenterX()));i.getCenterY()===t.getCenterY()&&i.getCenterX()===t.getCenterX()&&(d=1);var r=d*l[0],h=l[1]/d;l[0]r)return l[0]=g,l[1]=a,l[2]=d,l[3]=E,!1;if(nd)return l[0]=h,l[1]=n,l[2]=f,l[3]=r,!1;if(gd?(l[0]=v,l[1]=D,R=!0):(l[0]=p,l[1]=a,R=!0):S===w&&(g>d?(l[0]=h,l[1]=a,R=!0):(l[0]=u,l[1]=D,R=!0)),-Y===w?d>g?(l[2]=c,l[3]=E,M=!0):(l[2]=f,l[3]=s,M=!0):Y===w&&(d>g?(l[2]=O,l[3]=s,M=!0):(l[2]=A,l[3]=E,M=!0)),R&&M)return!1;if(g>d?n>r?(x=this.getCardinalDirection(S,w,4),F=this.getCardinalDirection(Y,w,2)):(x=this.getCardinalDirection(-S,w,3),F=this.getCardinalDirection(-Y,w,1)):n>r?(x=this.getCardinalDirection(-S,w,1),F=this.getCardinalDirection(-Y,w,3)):(x=this.getCardinalDirection(S,w,2),F=this.getCardinalDirection(Y,w,4)),!R)switch(x){case 1:P=a,U=g+-y/w,l[0]=U,l[1]=P;break;case 2:U=u,P=n+T*w,l[0]=U,l[1]=P;break;case 3:P=D,U=g+y/w,l[0]=U,l[1]=P;break;case 4:U=v,P=n+-T*w,l[0]=U,l[1]=P;break}if(!M)switch(F){case 1:X=s,_=d+-C/w,l[2]=_,l[3]=X;break;case 2:_=A,X=r+m*w,l[2]=_,l[3]=X;break;case 3:X=E,_=d+C/w,l[2]=_,l[3]=X;break;case 4:_=c,X=r+-m*w,l[2]=_,l[3]=X;break}}return!1},e.getCardinalDirection=function(t,i,l){return t>i?l:1+l%4},e.getIntersection=function(t,i,l,g){if(g==null)return this.getIntersection2(t,i,l);var n=t.x,d=t.y,r=i.x,h=i.y,a=l.x,p=l.y,v=g.x,D=g.y,u=void 0,T=void 0,y=void 0,O=void 0,s=void 0,f=void 0,c=void 0,E=void 0,A=void 0;return y=h-d,s=n-r,c=r*d-n*h,O=D-p,f=a-v,E=v*p-a*D,A=y*f-O*s,A===0?null:(u=(s*E-f*c)/A,T=(O*c-y*E)/A,new o(u,T))},e.angleOfVector=function(t,i,l,g){var n=void 0;return t!==l?(n=Math.atan((g-i)/(l-t)),l0?1:e<0?-1:0},o.floor=function(e){return e<0?Math.ceil(e):Math.floor(e)},o.ceil=function(e){return e<0?Math.floor(e):Math.ceil(e)},N.exports=o}),(function(N,I,L){function o(){}o.MAX_VALUE=2147483647,o.MIN_VALUE=-2147483648,N.exports=o}),(function(N,I,L){var o=(function(){function n(d,r){for(var h=0;h"u"?"undefined":o(t);return t==null||i!="object"&&i!="function"},N.exports=e}),(function(N,I,L){function o(a){if(Array.isArray(a)){for(var p=0,v=Array(a.length);p0&&p;){for(y.push(s[0]);y.length>0&&p;){var f=y[0];y.splice(0,1),T.add(f);for(var c=f.getEdges(),u=0;u-1&&s.splice(C,1)}T=new Set,O=new Map}}return a},h.prototype.createDummyNodesForBendpoints=function(a){for(var p=[],v=a.source,D=this.graphManager.calcLowestCommonAncestor(a.source,a.target),u=0;u0){for(var D=this.edgeToDummyNodes.get(v),u=0;u=0&&p.splice(E,1);var A=O.getNeighborsList();A.forEach(function(R){if(v.indexOf(R)<0){var M=D.get(R),S=M-1;S==1&&f.push(R),D.set(R,S)}})}v=v.concat(f),(p.length==1||p.length==2)&&(u=!0,T=p[0])}return T},h.prototype.setGraphManager=function(a){this.graphManager=a},N.exports=h}),(function(N,I,L){function o(){}o.seed=1,o.x=0,o.nextDouble=function(){return o.x=Math.sin(o.seed++)*1e4,o.x-Math.floor(o.x)},N.exports=o}),(function(N,I,L){var o=L(4);function e(t,i){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}e.prototype.getWorldOrgX=function(){return this.lworldOrgX},e.prototype.setWorldOrgX=function(t){this.lworldOrgX=t},e.prototype.getWorldOrgY=function(){return this.lworldOrgY},e.prototype.setWorldOrgY=function(t){this.lworldOrgY=t},e.prototype.getWorldExtX=function(){return this.lworldExtX},e.prototype.setWorldExtX=function(t){this.lworldExtX=t},e.prototype.getWorldExtY=function(){return this.lworldExtY},e.prototype.setWorldExtY=function(t){this.lworldExtY=t},e.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},e.prototype.setDeviceOrgX=function(t){this.ldeviceOrgX=t},e.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},e.prototype.setDeviceOrgY=function(t){this.ldeviceOrgY=t},e.prototype.getDeviceExtX=function(){return this.ldeviceExtX},e.prototype.setDeviceExtX=function(t){this.ldeviceExtX=t},e.prototype.getDeviceExtY=function(){return this.ldeviceExtY},e.prototype.setDeviceExtY=function(t){this.ldeviceExtY=t},e.prototype.transformX=function(t){var i=0,l=this.lworldExtX;return l!=0&&(i=this.ldeviceOrgX+(t-this.lworldOrgX)*this.ldeviceExtX/l),i},e.prototype.transformY=function(t){var i=0,l=this.lworldExtY;return l!=0&&(i=this.ldeviceOrgY+(t-this.lworldOrgY)*this.ldeviceExtY/l),i},e.prototype.inverseTransformX=function(t){var i=0,l=this.ldeviceExtX;return l!=0&&(i=this.lworldOrgX+(t-this.ldeviceOrgX)*this.lworldExtX/l),i},e.prototype.inverseTransformY=function(t){var i=0,l=this.ldeviceExtY;return l!=0&&(i=this.lworldOrgY+(t-this.ldeviceOrgY)*this.lworldExtY/l),i},e.prototype.inverseTransformPoint=function(t){var i=new o(this.inverseTransformX(t.x),this.inverseTransformY(t.y));return i},N.exports=e}),(function(N,I,L){function o(r){if(Array.isArray(r)){for(var h=0,a=Array(r.length);ht.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*t.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(r-t.ADAPTATION_LOWER_NODE_LIMIT)/(t.ADAPTATION_UPPER_NODE_LIMIT-t.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-t.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=t.MAX_NODE_DISPLACEMENT_INCREMENTAL):(r>t.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(t.COOLING_ADAPTATION_FACTOR,1-(r-t.ADAPTATION_LOWER_NODE_LIMIT)/(t.ADAPTATION_UPPER_NODE_LIMIT-t.ADAPTATION_LOWER_NODE_LIMIT)*(1-t.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=t.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},n.prototype.calcSpringForces=function(){for(var r=this.getAllEdges(),h,a=0;a0&&arguments[0]!==void 0?arguments[0]:!0,h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,a,p,v,D,u=this.getAllNodes(),T;if(this.useFRGridVariant)for(this.totalIterations%t.GRID_CALCULATION_CHECK_PERIOD==1&&r&&this.updateGrid(),T=new Set,a=0;ay||T>y)&&(r.gravitationForceX=-this.gravityConstant*v,r.gravitationForceY=-this.gravityConstant*D)):(y=h.getEstimatedSize()*this.compoundGravityRangeFactor,(u>y||T>y)&&(r.gravitationForceX=-this.gravityConstant*v*this.compoundGravityConstant,r.gravitationForceY=-this.gravityConstant*D*this.compoundGravityConstant))},n.prototype.isConverged=function(){var r,h=!1;return this.totalIterations>this.maxIterations/3&&(h=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),r=this.totalDisplacement=u.length||y>=u[0].length)){for(var O=0;On}}]),l})();N.exports=i}),(function(N,I,L){var o=(function(){function i(l,g){for(var n=0;n2&&arguments[2]!==void 0?arguments[2]:1,d=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;e(this,i),this.sequence1=l,this.sequence2=g,this.match_score=n,this.mismatch_penalty=d,this.gap_penalty=r,this.iMax=l.length+1,this.jMax=g.length+1,this.grid=new Array(this.iMax);for(var h=0;h=0;l--){var g=this.listeners[l];g.event===t&&g.callback===i&&this.listeners.splice(l,1)}},e.emit=function(t,i){for(var l=0;lg.coolingFactor*g.maxNodeDisplacement&&(this.displacementX=g.coolingFactor*g.maxNodeDisplacement*t.sign(this.displacementX)),Math.abs(this.displacementY)>g.coolingFactor*g.maxNodeDisplacement&&(this.displacementY=g.coolingFactor*g.maxNodeDisplacement*t.sign(this.displacementY)),this.child==null?this.moveBy(this.displacementX,this.displacementY):this.child.getNodes().length==0?this.moveBy(this.displacementX,this.displacementY):this.propogateDisplacementToChildren(this.displacementX,this.displacementY),g.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},i.prototype.propogateDisplacementToChildren=function(g,n){for(var d=this.getChild().getNodes(),r,h=0;h0)this.positionNodesRadially(s);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var f=new Set(this.getAllNodes()),c=this.nodesWithGravity.filter(function(E){return f.has(E)});this.graphManager.setAllNodesToApplyGravitation(c),this.positionNodesRandomly()}}return this.initSpringEmbedder(),this.runSpringEmbedder(),!0},y.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%d.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var s=new Set(this.getAllNodes()),f=this.nodesWithGravity.filter(function(A){return s.has(A)});this.graphManager.setAllNodesToApplyGravitation(f),this.graphManager.updateBounds(),this.updateGrid(),this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var c=!this.isTreeGrowing&&!this.isGrowthFinished,E=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(c,E),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},y.prototype.getPositionsData=function(){for(var s=this.graphManager.getAllNodes(),f={},c=0;c1){var R;for(R=0;RE&&(E=Math.floor(C.y)),m=Math.floor(C.x+n.DEFAULT_COMPONENT_SEPERATION)}this.transform(new a(r.WORLD_CENTER_X-C.x/2,r.WORLD_CENTER_Y-C.y/2))},y.radialLayout=function(s,f,c){var E=Math.max(this.maxDiagonalInTree(s),n.DEFAULT_RADIAL_SEPARATION);y.branchRadialLayout(f,null,0,359,0,E);var A=u.calculateBounds(s),m=new T;m.setDeviceOrgX(A.getMinX()),m.setDeviceOrgY(A.getMinY()),m.setWorldOrgX(c.x),m.setWorldOrgY(c.y);for(var C=0;C1;){var X=_[0];_.splice(0,1);var H=w.indexOf(X);H>=0&&w.splice(H,1),U--,x--}f!=null?P=(w.indexOf(_[0])+1)%U:P=0;for(var W=Math.abs(E-c)/x,B=P;F!=x;B=++B%U){var K=w[B].getOtherEnd(s);if(K!=f){var q=(c+F*W)%360,ht=(q+W)%360;y.branchRadialLayout(K,s,q,ht,A+m,m),F++}}},y.maxDiagonalInTree=function(s){for(var f=v.MIN_VALUE,c=0;cf&&(f=A)}return f},y.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},y.prototype.groupZeroDegreeMembers=function(){var s=this,f={};this.memberGroups={},this.idToDummyNode={};for(var c=[],E=this.graphManager.getAllNodes(),A=0;A"u"&&(f[R]=[]),f[R]=f[R].concat(m)}Object.keys(f).forEach(function(M){if(f[M].length>1){var S="DummyCompound_"+M;s.memberGroups[S]=f[M];var Y=f[M][0].getParent(),w=new l(s.graphManager);w.id=S,w.paddingLeft=Y.paddingLeft||0,w.paddingRight=Y.paddingRight||0,w.paddingBottom=Y.paddingBottom||0,w.paddingTop=Y.paddingTop||0,s.idToDummyNode[S]=w;var x=s.getGraphManager().add(s.newGraph(),w),F=Y.getChild();F.add(w);for(var U=0;U=0;s--){var f=this.compoundOrder[s],c=f.id,E=f.paddingLeft,A=f.paddingTop;this.adjustLocations(this.tiledMemberPack[c],f.rect.x,f.rect.y,E,A)}},y.prototype.repopulateZeroDegreeMembers=function(){var s=this,f=this.tiledZeroDegreePack;Object.keys(f).forEach(function(c){var E=s.idToDummyNode[c],A=E.paddingLeft,m=E.paddingTop;s.adjustLocations(f[c],E.rect.x,E.rect.y,A,m)})},y.prototype.getToBeTiled=function(s){var f=s.id;if(this.toBeTiled[f]!=null)return this.toBeTiled[f];var c=s.getChild();if(c==null)return this.toBeTiled[f]=!1,!1;for(var E=c.getNodes(),A=0;A0)return this.toBeTiled[f]=!1,!1;if(m.getChild()==null){this.toBeTiled[m.id]=!1;continue}if(!this.getToBeTiled(m))return this.toBeTiled[f]=!1,!1}return this.toBeTiled[f]=!0,!0},y.prototype.getNodeDegree=function(s){s.id;for(var f=s.getEdges(),c=0,E=0;EM&&(M=Y.rect.height)}c+=M+s.verticalPadding}},y.prototype.tileCompoundMembers=function(s,f){var c=this;this.tiledMemberPack=[],Object.keys(s).forEach(function(E){var A=f[E];c.tiledMemberPack[E]=c.tileNodes(s[E],A.paddingLeft+A.paddingRight),A.rect.width=c.tiledMemberPack[E].width,A.rect.height=c.tiledMemberPack[E].height})},y.prototype.tileNodes=function(s,f){var c=n.TILING_PADDING_VERTICAL,E=n.TILING_PADDING_HORIZONTAL,A={rows:[],rowWidth:[],rowHeight:[],width:0,height:f,verticalPadding:c,horizontalPadding:E};s.sort(function(R,M){return R.rect.width*R.rect.height>M.rect.width*M.rect.height?-1:R.rect.width*R.rect.height0&&(C+=s.horizontalPadding),s.rowWidth[c]=C,s.width0&&(R+=s.verticalPadding);var M=0;R>s.rowHeight[c]&&(M=s.rowHeight[c],s.rowHeight[c]=R,M=s.rowHeight[c]-M),s.height+=M,s.rows[c].push(f)},y.prototype.getShortestRowIndex=function(s){for(var f=-1,c=Number.MAX_VALUE,E=0;Ec&&(f=E,c=s.rowWidth[E]);return f},y.prototype.canAddHorizontal=function(s,f,c){var E=this.getShortestRowIndex(s);if(E<0)return!0;var A=s.rowWidth[E];if(A+s.horizontalPadding+f<=s.width)return!0;var m=0;s.rowHeight[E]0&&(m=c+s.verticalPadding-s.rowHeight[E]);var C;s.width-A>=f+s.horizontalPadding?C=(s.height+m)/(A+f+s.horizontalPadding):C=(s.height+m)/s.width,m=c+s.verticalPadding;var R;return s.widthm&&f!=c){E.splice(-1,1),s.rows[c].push(A),s.rowWidth[f]=s.rowWidth[f]-m,s.rowWidth[c]=s.rowWidth[c]+m,s.width=s.rowWidth[instance.getLongestRowIndex(s)];for(var C=Number.MIN_VALUE,R=0;RC&&(C=E[R].height);f>0&&(C+=s.verticalPadding);var M=s.rowHeight[f]+s.rowHeight[c];s.rowHeight[f]=C,s.rowHeight[c]0)for(var F=A;F<=m;F++)x[0]+=this.grid[F][C-1].length+this.grid[F][C].length-1;if(m0)for(var F=C;F<=R;F++)x[3]+=this.grid[A-1][F].length+this.grid[A][F].length-1;for(var U=v.MAX_VALUE,P,_,X=0;X0){var R;R=T.getGraphManager().add(T.newGraph(),c),this.processChildrenList(R,f,T)}}},a.prototype.stop=function(){return this.stopped=!0,this};var v=function(u){u("layout","cose-bilkent",a)};typeof cytoscape<"u"&&v(cytoscape),I.exports=v})])})})(Z)),Z.exports}var yt=vt();const Et=lt(yt);tt.use(Et);function et(G,b){G.forEach(N=>{const I={id:N.id,labelText:N.label,height:N.height,width:N.width,padding:N.padding??0};Object.keys(N).forEach(L=>{["id","label","height","width","padding","x","y"].includes(L)||(I[L]=N[L])}),b.add({group:"nodes",data:I,position:{x:N.x??0,y:N.y??0}})})}V(et,"addNodes");function rt(G,b){G.forEach(N=>{const I={id:N.id,source:N.start,target:N.end};Object.keys(N).forEach(L=>{["id","start","end"].includes(L)||(I[L]=N[L])}),b.add({group:"edges",data:I})})}V(rt,"addEdges");function it(G){return new Promise(b=>{const N=gt("body").append("div").attr("id","cy").attr("style","display:none"),I=tt({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});N.remove(),et(G.nodes,I),rt(G.edges,I),I.nodes().forEach(function(o){o.layoutDimensions=()=>{const e=o.data();return{w:e.width,h:e.height}}});const L={name:"cose-bilkent",quality:"proof",styleEnabled:!1,animate:!1};I.layout(L).run(),I.ready(o=>{k.info("Cytoscape ready",o),b(I)})})}V(it,"createCytoscapeInstance");function nt(G){return G.nodes().map(b=>{const N=b.data(),I=b.position(),L={id:N.id,x:I.x,y:I.y};return Object.keys(N).forEach(o=>{o!=="id"&&(L[o]=N[o])}),L})}V(nt,"extractPositionedNodes");function ot(G){return G.edges().map(b=>{const N=b.data(),I=b._private.rscratch,L={id:N.id,source:N.source,target:N.target,startX:I.startX,startY:I.startY,midX:I.midX,midY:I.midY,endX:I.endX,endY:I.endY};return Object.keys(N).forEach(o=>{["id","source","target"].includes(o)||(L[o]=N[o])}),L})}V(ot,"extractPositionedEdges");async function st(G,b){k.debug("Starting cose-bilkent layout algorithm");try{at(G);const N=await it(G),I=nt(N),L=ot(N);return k.debug(`Layout completed: ${I.length} nodes, ${L.length} edges`),{nodes:I,edges:L}}catch(N){throw k.error("Error in cose-bilkent layout algorithm:",N),N}}V(st,"executeCoseBilkentLayout");function at(G){if(!G)throw new Error("Layout data is required");if(!G.config)throw new Error("Configuration is required in layout data");if(!G.rootNode)throw new Error("Root node is required");if(!G.nodes||!Array.isArray(G.nodes))throw new Error("No nodes found in layout data");if(!Array.isArray(G.edges))throw new Error("Edges array is required in layout data");return!0}V(at,"validateLayoutData");var Lt=V(async(G,b,{insertCluster:N,insertEdge:I,insertEdgeLabel:L,insertMarkers:o,insertNode:e,log:t,positionEdgeLabel:i},{algorithm:l})=>{const g={},n={},d=b.select("g");o(d,G.markers,G.type,G.diagramId);const r=d.insert("g").attr("class","subgraphs"),h=d.insert("g").attr("class","edgePaths"),a=d.insert("g").attr("class","edgeLabels"),p=d.insert("g").attr("class","nodes");t.debug("Inserting nodes into DOM for dimension calculation"),await Promise.all(G.nodes.map(async u=>{if(u.isGroup){const T={...u};n[u.id]=T,g[u.id]=T,await N(r,u)}else{const T={...u};g[u.id]=T;const y=await e(p,u,{config:G.config,dir:G.direction||"TB"}),O=y.node().getBBox();T.width=O.width,T.height=O.height,T.domId=y,t.debug(`Node ${u.id} dimensions: ${O.width}x${O.height}`)}})),t.debug("Running cose-bilkent layout algorithm");const v={...G,nodes:G.nodes.map(u=>{const T=g[u.id];return{...u,width:T.width,height:T.height}})},D=await st(v,G.config);t.debug("Positioning nodes based on layout results"),D.nodes.forEach(u=>{const T=g[u.id];T?.domId&&(T.domId.attr("transform",`translate(${u.x}, ${u.y})`),T.x=u.x,T.y=u.y,t.debug(`Positioned node ${T.id} at center (${u.x}, ${u.y})`))}),D.edges.forEach(u=>{const T=G.edges.find(y=>y.id===u.id);T&&(T.points=[{x:u.startX,y:u.startY},{x:u.midX,y:u.midY},{x:u.endX,y:u.endY}])}),t.debug("Inserting and positioning edges"),await Promise.all(G.edges.map(async u=>{await L(a,u);const T=g[u.start??""],y=g[u.end??""];if(T&&y){const O=D.edges.find(s=>s.id===u.id);if(O){t.debug("APA01 positionedEdge",O);const s={...u},f=I(h,s,n,G.type,T,y,G.diagramId);i(s,f)}else{const s={...u,points:[{x:T.x||0,y:T.y||0},{x:y.x||0,y:y.y||0}]},f=I(h,s,n,G.type,T,y,G.diagramId);i(s,f)}}})),t.debug("Cose-bilkent rendering completed")},"render"),At=Lt;export{At as render};
diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/cytoscape.esm-5J0xJHOV.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/cytoscape.esm-5J0xJHOV.js
new file mode 100644
index 0000000000..969925daae
--- /dev/null
+++ b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/cytoscape.esm-5J0xJHOV.js
@@ -0,0 +1,321 @@
+function Bs(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,a=Array(e);t=r.length?{done:!0}:{done:!1,value:r[a++]}},e:function(l){throw l},f:n}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
+In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i,s=!0,o=!1;return{s:function(){t=t.call(r)},n:function(){var l=t.next();return s=l.done,l},e:function(l){o=!0,i=l},f:function(){try{s||t.return==null||t.return()}finally{if(o)throw i}}}}function Jl(r,e,t){return(e=jl(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function ac(r){if(typeof Symbol<"u"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)}function nc(r,e){var t=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(t!=null){var a,n,i,s,o=[],l=!0,u=!1;try{if(i=(t=t.call(r)).next,e===0){if(Object(t)!==t)return;l=!1}else for(;!(l=(a=i.call(t)).done)&&(o.push(a.value),o.length!==e);l=!0);}catch(v){u=!0,n=v}finally{try{if(!l&&t.return!=null&&(s=t.return(),Object(s)!==s))return}finally{if(u)throw n}}return o}}function ic(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
+In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function sc(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
+In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Je(r,e){return ec(r)||nc(r,e)||Xs(r,e)||ic()}function mn(r){return rc(r)||ac(r)||Xs(r)||sc()}function oc(r,e){if(typeof r!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var a=t.call(r,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(r)}function jl(r){var e=oc(r,"string");return typeof e=="symbol"?e:e+""}function ar(r){"@babel/helpers - typeof";return ar=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ar(r)}function Xs(r,e){if(r){if(typeof r=="string")return Bs(r,e);var t={}.toString.call(r).slice(8,-1);return t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set"?Array.from(r):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Bs(r,e):void 0}}var rr=typeof window>"u"?null:window,To=rr?rr.navigator:null;rr&&rr.document;var uc=ar(""),ev=ar({}),lc=ar(function(){}),vc=typeof HTMLElement>"u"?"undefined":ar(HTMLElement),La=function(e){return e&&e.instanceString&&Ue(e.instanceString)?e.instanceString():null},ge=function(e){return e!=null&&ar(e)==uc},Ue=function(e){return e!=null&&ar(e)===lc},_e=function(e){return!Dr(e)&&(Array.isArray?Array.isArray(e):e!=null&&e instanceof Array)},Le=function(e){return e!=null&&ar(e)===ev&&!_e(e)&&e.constructor===Object},fc=function(e){return e!=null&&ar(e)===ev},ae=function(e){return e!=null&&ar(e)===ar(1)&&!isNaN(e)},cc=function(e){return ae(e)&&Math.floor(e)===e},bn=function(e){if(vc!=="undefined")return e!=null&&e instanceof HTMLElement},Dr=function(e){return Ia(e)||rv(e)},Ia=function(e){return La(e)==="collection"&&e._private.single},rv=function(e){return La(e)==="collection"&&!e._private.single},Ys=function(e){return La(e)==="core"},tv=function(e){return La(e)==="stylesheet"},dc=function(e){return La(e)==="event"},ut=function(e){return e==null?!0:!!(e===""||e.match(/^\s+$/))},hc=function(e){return typeof HTMLElement>"u"?!1:e instanceof HTMLElement},gc=function(e){return Le(e)&&ae(e.x1)&&ae(e.x2)&&ae(e.y1)&&ae(e.y2)},pc=function(e){return fc(e)&&Ue(e.then)},yc=function(){return To&&To.userAgent.match(/msie|trident|edge/i)},Qt=function(e,t){t||(t=function(){if(arguments.length===1)return arguments[0];if(arguments.length===0)return"undefined";for(var i=[],s=0;st?1:0},Tc=function(e,t){return-1*nv(e,t)},be=Object.assign!=null?Object.assign.bind(Object):function(r){for(var e=arguments,t=1;t1&&(g-=1),g<1/6?d+(y-d)*6*g:g<1/2?y:g<2/3?d+(y-d)*(2/3-g)*6:d}var f=new RegExp("^"+wc+"$").exec(e);if(f){if(a=parseInt(f[1]),a<0?a=(360- -1*a%360)%360:a>360&&(a=a%360),a/=360,n=parseFloat(f[2]),n<0||n>100||(n=n/100,i=parseFloat(f[3]),i<0||i>100)||(i=i/100,s=f[4],s!==void 0&&(s=parseFloat(s),s<0||s>1)))return;if(n===0)o=l=u=Math.round(i*255);else{var c=i<.5?i*(1+n):i+n-i*n,h=2*i-c;o=Math.round(255*v(h,c,a+1/3)),l=Math.round(255*v(h,c,a)),u=Math.round(255*v(h,c,a-1/3))}t=[o,l,u,s]}return t},Dc=function(e){var t,a=new RegExp("^"+mc+"$").exec(e);if(a){t=[];for(var n=[],i=1;i<=3;i++){var s=a[i];if(s[s.length-1]==="%"&&(n[i]=!0),s=parseFloat(s),n[i]&&(s=s/100*255),s<0||s>255)return;t.push(Math.floor(s))}var o=n[1]||n[2]||n[3],l=n[1]&&n[2]&&n[3];if(o&&!l)return;var u=a[4];if(u!==void 0){if(u=parseFloat(u),u<0||u>1)return;t.push(u)}}return t},Bc=function(e){return Pc[e.toLowerCase()]},iv=function(e){return(_e(e)?e:null)||Bc(e)||Sc(e)||Dc(e)||kc(e)},Pc={transparent:[0,0,0,0],aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],grey:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},sv=function(e){for(var t=e.map,a=e.keys,n=a.length,i=0;i=l||R<0||m&&L>=c}function T(){var A=e();if(x(A))return k(A);d=setTimeout(T,C(A))}function k(A){return d=void 0,b&&v?w(A):(v=f=void 0,h)}function D(){d!==void 0&&clearTimeout(d),g=0,v=y=f=d=void 0}function B(){return d===void 0?h:k(e())}function P(){var A=e(),R=x(A);if(v=arguments,f=this,y=A,R){if(d===void 0)return E(y);if(m)return clearTimeout(d),d=setTimeout(T,l),w(y)}return d===void 0&&(d=setTimeout(T,l)),h}return P.cancel=D,P.flush=B,P}return fi=s,fi}var Vc=Fc(),Fa=Oa(Vc),ci=rr?rr.performance:null,lv=ci&&ci.now?function(){return ci.now()}:function(){return Date.now()},qc=(function(){if(rr){if(rr.requestAnimationFrame)return function(r){rr.requestAnimationFrame(r)};if(rr.mozRequestAnimationFrame)return function(r){rr.mozRequestAnimationFrame(r)};if(rr.webkitRequestAnimationFrame)return function(r){rr.webkitRequestAnimationFrame(r)};if(rr.msRequestAnimationFrame)return function(r){rr.msRequestAnimationFrame(r)}}return function(r){r&&setTimeout(function(){r(lv())},1e3/60)}})(),wn=function(e){return qc(e)},Yr=lv,Tt=9261,vv=65599,Ht=5381,fv=function(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Tt,a=t,n;n=e.next(),!n.done;)a=a*vv+n.value|0;return a},Ca=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Tt;return t*vv+e|0},Ta=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ht;return(t<<5)+t+e|0},_c=function(e,t){return e*2097152+t},et=function(e){return e[0]*2097152+e[1]},Xa=function(e,t){return[Ca(e[0],t[0]),Ta(e[1],t[1])]},qo=function(e,t){var a={value:0,done:!1},n=0,i=e.length,s={next:function(){return n=0;n--)e[n]===t&&e.splice(n,1)},eo=function(e){e.splice(0,e.length)},Qc=function(e,t){for(var a=0;a"u"?"undefined":ar(Set))!==jc?Set:ed,In=function(e,t){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0||t===void 0||!Ys(e)){$e("An element must have a core reference and parameters set");return}var n=t.group;if(n==null&&(t.data&&t.data.source!=null&&t.data.target!=null?n="edges":n="nodes"),n!=="nodes"&&n!=="edges"){$e("An element must be of type `nodes` or `edges`; you specified `"+n+"`");return}this.length=1,this[0]=this;var i=this._private={cy:e,single:!0,data:t.data||{},position:t.position||{x:0,y:0},autoWidth:void 0,autoHeight:void 0,autoPadding:void 0,compoundBoundsClean:!1,listeners:[],group:n,style:{},rstyle:{},styleCxts:[],styleKeys:{},removed:!0,selected:!!t.selected,selectable:t.selectable===void 0?!0:!!t.selectable,locked:!!t.locked,grabbed:!1,grabbable:t.grabbable===void 0?!0:!!t.grabbable,pannable:t.pannable===void 0?n==="edges":!!t.pannable,active:!1,classes:new ra,animation:{current:[],queue:[]},rscratch:{},scratch:t.scratch||{},edges:[],children:[],parent:t.parent&&t.parent.isNode()?t.parent:null,traversalCache:{},backgrounding:!1,bbCache:null,bbCacheShift:{x:0,y:0},bodyBounds:null,overlayBounds:null,labelBounds:{all:null,source:null,target:null,main:null},arrowBounds:{source:null,target:null,"mid-source":null,"mid-target":null}};if(i.position.x==null&&(i.position.x=0),i.position.y==null&&(i.position.y=0),t.renderedPosition){var s=t.renderedPosition,o=e.pan(),l=e.zoom();i.position={x:(s.x-o.x)/l,y:(s.y-o.y)/l}}var u=[];_e(t.classes)?u=t.classes:ge(t.classes)&&(u=t.classes.split(/\s+/));for(var v=0,f=u.length;vm?1:0},v=function(p,m,b,w,E){var C;if(b==null&&(b=0),E==null&&(E=a),b<0)throw new Error("lo must be non-negative");for(w==null&&(w=p.length);bD;0<=D?k++:k--)T.push(k);return T}).apply(this).reverse(),x=[],w=0,E=C.length;wB;0<=B?++T:--T)P.push(s(p,b));return P},y=function(p,m,b,w){var E,C,x;for(w==null&&(w=a),E=p[b];b>m;){if(x=b-1>>1,C=p[x],w(E,C)<0){p[b]=C,b=x;continue}break}return p[b]=E},g=function(p,m,b){var w,E,C,x,T;for(b==null&&(b=a),E=p.length,T=m,C=p[m],w=2*m+1;w0;){var C=m.pop(),x=g(C),T=C.id();if(c[T]=x,x!==1/0)for(var k=C.neighborhood().intersect(d),D=0;D0)for(O.unshift(M);f[G];){var N=f[G];O.unshift(N.edge),O.unshift(N.node),V=N.node,G=V.id()}return o.spawn(O)}}}},od={kruskal:function(e){e=e||function(b){return 1};for(var t=this.byGroup(),a=t.nodes,n=t.edges,i=a.length,s=new Array(i),o=a,l=function(w){for(var E=0;E0;){if(E(),x++,w===v){for(var T=[],k=i,D=v,B=p[D];T.unshift(k),B!=null&&T.unshift(B),k=g[D],k!=null;)D=k.id(),B=p[D];return{found:!0,distance:f[w],path:this.spawn(T),steps:x}}h[w]=!0;for(var P=b._private.edges,A=0;AB&&(d[D]=B,m[D]=k,b[D]=E),!i){var P=k*v+T;!i&&d[P]>B&&(d[P]=B,m[P]=T,b[P]=E)}}}for(var A=0;A1&&arguments[1]!==void 0?arguments[1]:s,ie=b(we),de=[],he=ie;;){if(he==null)return t.spawn();var Ee=m(he),pe=Ee.edge,Se=Ee.pred;if(de.unshift(he[0]),he.same(ye)&&de.length>0)break;pe!=null&&de.unshift(pe),he=Se}return l.spawn(de)},C=0;C=0;v--){var f=u[v],c=f[1],h=f[2];(t[c]===o&&t[h]===l||t[c]===l&&t[h]===o)&&u.splice(v,1)}for(var d=0;dn;){var i=Math.floor(Math.random()*t.length);t=gd(i,e,t),a--}return t},pd={kargerStein:function(){var e=this,t=this.byGroup(),a=t.nodes,n=t.edges;n.unmergeBy(function(O){return O.isLoop()});var i=a.length,s=n.length,o=Math.ceil(Math.pow(Math.log(i)/Math.LN2,2)),l=Math.floor(i/hd);if(i<2){$e("At least 2 nodes are required for Karger-Stein algorithm");return}for(var u=[],v=0;v1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,n=1/0,i=t;i1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,n=-1/0,i=t;i1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,n=0,i=0,s=t;s1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;n?e=e.slice(t,a):(a0&&e.splice(0,t));for(var o=0,l=e.length-1;l>=0;l--){var u=e[l];s?isFinite(u)||(e[l]=-1/0,o++):e.splice(l,1)}i&&e.sort(function(c,h){return c-h});var v=e.length,f=Math.floor(v/2);return v%2!==0?e[f+1+o]:(e[f-1+o]+e[f+o])/2},Ed=function(e){return Math.PI*e/180},Ya=function(e,t){return Math.atan2(t,e)-Math.PI/2},ro=Math.log2||function(r){return Math.log(r)/Math.log(2)},to=function(e){return e>0?1:e<0?-1:0},Bt=function(e,t){return Math.sqrt(Et(e,t))},Et=function(e,t){var a=t.x-e.x,n=t.y-e.y;return a*a+n*n},Cd=function(e){for(var t=e.length,a=0,n=0;n=e.x1&&e.y2>=e.y1)return{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,w:e.x2-e.x1,h:e.y2-e.y1};if(e.w!=null&&e.h!=null&&e.w>=0&&e.h>=0)return{x1:e.x1,y1:e.y1,x2:e.x1+e.w,y2:e.y1+e.h,w:e.w,h:e.h}}},Sd=function(e){return{x1:e.x1,x2:e.x2,w:e.w,y1:e.y1,y2:e.y2,h:e.h}},kd=function(e){e.x1=1/0,e.y1=1/0,e.x2=-1/0,e.y2=-1/0,e.w=0,e.h=0},Dd=function(e,t){e.x1=Math.min(e.x1,t.x1),e.x2=Math.max(e.x2,t.x2),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,t.y1),e.y2=Math.max(e.y2,t.y2),e.h=e.y2-e.y1},mv=function(e,t,a){e.x1=Math.min(e.x1,t),e.x2=Math.max(e.x2,t),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,a),e.y2=Math.max(e.y2,a),e.h=e.y2-e.y1},un=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return e.x1-=t,e.x2+=t,e.y1-=t,e.y2+=t,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},ln=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0],a,n,i,s;if(t.length===1)a=n=i=s=t[0];else if(t.length===2)a=i=t[0],s=n=t[1];else if(t.length===4){var o=Je(t,4);a=o[0],n=o[1],i=o[2],s=o[3]}return e.x1-=s,e.x2+=n,e.y1-=a,e.y2+=i,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},Uo=function(e,t){e.x1=t.x1,e.y1=t.y1,e.x2=t.x2,e.y2=t.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1},ao=function(e,t){return!(e.x1>t.x2||t.x1>e.x2||e.x2t.y2||t.y1>e.y2)},nt=function(e,t,a){return e.x1<=t&&t<=e.x2&&e.y1<=a&&a<=e.y2},Ko=function(e,t){return nt(e,t.x,t.y)},bv=function(e,t){return nt(e,t.x1,t.y1)&&nt(e,t.x2,t.y2)},Bd=(gi=Math.hypot)!==null&&gi!==void 0?gi:function(r,e){return Math.sqrt(r*r+e*e)};function Pd(r,e){if(r.length<3)throw new Error("Need at least 3 vertices");var t=function(T,k){return{x:T.x+k.x,y:T.y+k.y}},a=function(T,k){return{x:T.x-k.x,y:T.y-k.y}},n=function(T,k){return{x:T.x*k,y:T.y*k}},i=function(T,k){return T.x*k.y-T.y*k.x},s=function(T){var k=Bd(T.x,T.y);return k===0?{x:0,y:0}:{x:T.x/k,y:T.y/k}},o=function(T){for(var k=0,D=0;D7&&arguments[7]!==void 0?arguments[7]:"auto",u=l==="auto"?vt(i,s):l,v=i/2,f=s/2;u=Math.min(u,v,f);var c=u!==v,h=u!==f,d;if(c){var y=a-v+u-o,g=n-f-o,p=a+v-u+o,m=g;if(d=it(e,t,a,n,y,g,p,m,!1),d.length>0)return d}if(h){var b=a+v+o,w=n-f+u-o,E=b,C=n+f-u+o;if(d=it(e,t,a,n,b,w,E,C,!1),d.length>0)return d}if(c){var x=a-v+u-o,T=n+f+o,k=a+v-u+o,D=T;if(d=it(e,t,a,n,x,T,k,D,!1),d.length>0)return d}if(h){var B=a-v-o,P=n-f+u-o,A=B,R=n+f-u+o;if(d=it(e,t,a,n,B,P,A,R,!1),d.length>0)return d}var L;{var I=a-v+u,M=n-f+u;if(L=ya(e,t,a,n,I,M,u+o),L.length>0&&L[0]<=I&&L[1]<=M)return[L[0],L[1]]}{var O=a+v-u,V=n-f+u;if(L=ya(e,t,a,n,O,V,u+o),L.length>0&&L[0]>=O&&L[1]<=V)return[L[0],L[1]]}{var G=a+v-u,N=n+f-u;if(L=ya(e,t,a,n,G,N,u+o),L.length>0&&L[0]>=G&&L[1]>=N)return[L[0],L[1]]}{var F=a-v+u,U=n+f-u;if(L=ya(e,t,a,n,F,U,u+o),L.length>0&&L[0]<=F&&L[1]>=U)return[L[0],L[1]]}return[]},Rd=function(e,t,a,n,i,s,o){var l=o,u=Math.min(a,i),v=Math.max(a,i),f=Math.min(n,s),c=Math.max(n,s);return u-l<=e&&e<=v+l&&f-l<=t&&t<=c+l},Md=function(e,t,a,n,i,s,o,l,u){var v={x1:Math.min(a,o,i)-u,x2:Math.max(a,o,i)+u,y1:Math.min(n,l,s)-u,y2:Math.max(n,l,s)+u};return!(ev.x2||tv.y2)},Ld=function(e,t,a,n){a-=n;var i=t*t-4*e*a;if(i<0)return[];var s=Math.sqrt(i),o=2*e,l=(-t+s)/o,u=(-t-s)/o;return[l,u]},Id=function(e,t,a,n,i){var s=1e-5;e===0&&(e=s),t/=e,a/=e,n/=e;var o,l,u,v,f,c,h,d;if(l=(3*a-t*t)/9,u=-(27*n)+t*(9*a-2*(t*t)),u/=54,o=l*l*l+u*u,i[1]=0,h=t/3,o>0){f=u+Math.sqrt(o),f=f<0?-Math.pow(-f,1/3):Math.pow(f,1/3),c=u-Math.sqrt(o),c=c<0?-Math.pow(-c,1/3):Math.pow(c,1/3),i[0]=-h+f+c,h+=(f+c)/2,i[4]=i[2]=-h,h=Math.sqrt(3)*(-c+f)/2,i[3]=h,i[5]=-h;return}if(i[5]=i[3]=0,o===0){d=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3),i[0]=-h+2*d,i[4]=i[2]=-(d+h);return}l=-l,v=l*l*l,v=Math.acos(u/Math.sqrt(v)),d=2*Math.sqrt(l),i[0]=-h+d*Math.cos(v/3),i[2]=-h+d*Math.cos((v+2*Math.PI)/3),i[4]=-h+d*Math.cos((v+4*Math.PI)/3)},Od=function(e,t,a,n,i,s,o,l){var u=1*a*a-4*a*i+2*a*o+4*i*i-4*i*o+o*o+n*n-4*n*s+2*n*l+4*s*s-4*s*l+l*l,v=9*a*i-3*a*a-3*a*o-6*i*i+3*i*o+9*n*s-3*n*n-3*n*l-6*s*s+3*s*l,f=3*a*a-6*a*i+a*o-a*e+2*i*i+2*i*e-o*e+3*n*n-6*n*s+n*l-n*t+2*s*s+2*s*t-l*t,c=1*a*i-a*a+a*e-i*e+n*s-n*n+n*t-s*t,h=[];Id(u,v,f,c,h);for(var d=1e-7,y=[],g=0;g<6;g+=2)Math.abs(h[g+1])=0&&h[g]<=1&&y.push(h[g]);y.push(1),y.push(0);for(var p=-1,m,b,w,E=0;E=0?wu?(e-i)*(e-i)+(t-s)*(t-s):v-c},Sr=function(e,t,a){for(var n,i,s,o,l,u=0,v=0;v=e&&e>=s||n<=e&&e<=s)l=(e-n)/(s-n)*(o-i)+i,l>t&&u++;else continue;return u%2!==0},Zr=function(e,t,a,n,i,s,o,l,u){var v=new Array(a.length),f;l[0]!=null?(f=Math.atan(l[1]/l[0]),l[0]<0?f=f+Math.PI/2:f=-f-Math.PI/2):f=l;for(var c=Math.cos(-f),h=Math.sin(-f),d=0;d0){var g=Cn(v,-u);y=En(g)}else y=v;return Sr(e,t,y)},zd=function(e,t,a,n,i,s,o,l){for(var u=new Array(a.length*2),v=0;v=0&&g<=1&&m.push(g),p>=0&&p<=1&&m.push(p),m.length===0)return[];var b=m[0]*l[0]+e,w=m[0]*l[1]+t;if(m.length>1){if(m[0]==m[1])return[b,w];var E=m[1]*l[0]+e,C=m[1]*l[1]+t;return[b,w,E,C]}else return[b,w]},pi=function(e,t,a){return t<=e&&e<=a||a<=e&&e<=t?e:e<=t&&t<=a||a<=t&&t<=e?t:a},it=function(e,t,a,n,i,s,o,l,u){var v=e-i,f=a-e,c=o-i,h=t-s,d=n-t,y=l-s,g=c*h-y*v,p=f*h-d*v,m=y*f-c*d;if(m!==0){var b=g/m,w=p/m,E=.001,C=0-E,x=1+E;return C<=b&&b<=x&&C<=w&&w<=x?[e+b*f,t+b*d]:u?[e+b*f,t+b*d]:[]}else return g===0||p===0?pi(e,a,o)===o?[o,l]:pi(e,a,i)===i?[i,s]:pi(i,o,a)===a?[a,n]:[]:[]},Vd=function(e,t,a,n,i){var s=[],o=n/2,l=i/2,u=t,v=a;s.push({x:u+o*e[0],y:v+l*e[1]});for(var f=1;f0){var y=Cn(f,-l);h=En(y)}else h=f}else h=a;for(var g,p,m,b,w=0;w2){for(var d=[v[0],v[1]],y=Math.pow(d[0]-e,2)+Math.pow(d[1]-t,2),g=1;gv&&(v=w)},get:function(b){return u[b]}},c=0;c0?L=R.edgesTo(A)[0]:L=A.edgesTo(R)[0];var I=n(L);A=A.id(),x[A]>x[B]+I&&(x[A]=x[B]+I,T.nodes.indexOf(A)<0?T.push(A):T.updateItem(A),C[A]=0,E[A]=[]),x[A]==x[B]+I&&(C[A]=C[A]+C[B],E[A].push(B))}else for(var M=0;M0;){for(var N=w.pop(),F=0;F0&&o.push(a[l]);o.length!==0&&i.push(n.collection(o))}return i},eh=function(e,t){for(var a=0;a5&&arguments[5]!==void 0?arguments[5]:ah,o=n,l,u,v=0;v=2?va(e,t,a,0,Jo,nh):va(e,t,a,0,Qo)},squaredEuclidean:function(e,t,a){return va(e,t,a,0,Jo)},manhattan:function(e,t,a){return va(e,t,a,0,Qo)},max:function(e,t,a){return va(e,t,a,-1/0,ih)}};Jt["squared-euclidean"]=Jt.squaredEuclidean;Jt.squaredeuclidean=Jt.squaredEuclidean;function Nn(r,e,t,a,n,i){var s;return Ue(r)?s=r:s=Jt[r]||Jt.euclidean,e===0&&Ue(r)?s(n,i):s(e,t,a,n,i)}var sh=cr({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),io=function(e){return sh(e)},Tn=function(e,t,a,n,i){var s=i!=="kMedoids",o=s?function(f){return a[f]}:function(f){return n[f](a)},l=function(c){return n[c](t)},u=a,v=t;return Nn(e,n.length,o,l,u,v)},mi=function(e,t,a){for(var n=a.length,i=new Array(n),s=new Array(n),o=new Array(t),l=null,u=0;ua)return!1}return!0},lh=function(e,t,a){for(var n=0;no&&(o=t[u][v],l=v);i[l].push(e[u])}for(var f=0;f=i.threshold||i.mode==="dendrogram"&&e.length===1)return!1;var d=t[s],y=t[n[s]],g;i.mode==="dendrogram"?g={left:d,right:y,key:d.key}:g={value:d.value.concat(y.value),key:d.key},e[d.index]=g,e.splice(y.index,1),t[d.key]=g;for(var p=0;pa[y.key][m.key]&&(l=a[y.key][m.key])):i.linkage==="max"?(l=a[d.key][m.key],a[d.key][m.key]0&&n.push(i);return n},nu=function(e,t,a){for(var n=[],i=0;io&&(s=u,o=t[i*e+u])}s>0&&n.push(s)}for(var v=0;vu&&(l=v,u=f)}a[i]=s[l]}return n=nu(e,t,a),n},iu=function(e){for(var t=this.cy(),a=this.nodes(),n=xh(e),i={},s=0;s=B?(P=B,B=R,A=L):R>P&&(P=R);for(var I=0;I0?1:0;x[k%n.minIterations*o+F]=U,N+=U}if(N>0&&(k>=n.minIterations-1||k==n.maxIterations-1)){for(var Q=0,K=0;K1||C>1)&&(o=!0),f[b]=[],m.outgoers().forEach(function(T){T.isEdge()&&f[b].push(T.id())})}else c[b]=[void 0,m.target().id()]}):s.forEach(function(m){var b=m.id();if(m.isNode()){var w=m.degree(!0);w%2&&(l?u?o=!0:u=b:l=b),f[b]=[],m.connectedEdges().forEach(function(E){return f[b].push(E.id())})}else c[b]=[m.source().id(),m.target().id()]});var h={found:!1,trail:void 0};if(o)return h;if(u&&l)if(i){if(v&&u!=v)return h;v=u}else{if(v&&u!=v&&l!=v)return h;v||(v=u)}else v||(v=s[0].id());var d=function(b){for(var w=b,E=[b],C,x,T;f[w].length;)C=f[w].shift(),x=c[C][0],T=c[C][1],w!=T?(f[T]=f[T].filter(function(k){return k!=C}),w=T):!i&&w!=x&&(f[x]=f[x].filter(function(k){return k!=C}),w=x),E.unshift(C),E.unshift(w);return E},y=[],g=[];for(g=d(v);g.length!=1;)f[g[0]].length==0?(y.unshift(s.getElementById(g.shift())),y.unshift(s.getElementById(g.shift()))):g=d(g.shift()).concat(g);y.unshift(s.getElementById(g.shift()));for(var p in f)if(f[p].length)return h;return h.found=!0,h.trail=this.spawn(y,!0),h}},Qa=function(){var e=this,t={},a=0,n=0,i=[],s=[],o={},l=function(c,h){for(var d=s.length-1,y=[],g=e.spawn();s[d].x!=c||s[d].y!=h;)y.push(s.pop().edge),d--;y.push(s.pop().edge),y.forEach(function(p){var m=p.connectedNodes().intersection(e);g.merge(p),m.forEach(function(b){var w=b.id(),E=b.connectedEdges().intersection(e);g.merge(b),t[w].cutVertex?g.merge(E.filter(function(C){return C.isLoop()})):g.merge(E)})}),i.push(g)},u=function(c,h,d){c===d&&(n+=1),t[h]={id:a,low:a++,cutVertex:!1};var y=e.getElementById(h).connectedEdges().intersection(e);if(y.size()===0)i.push(e.spawn(e.getElementById(h)));else{var g,p,m,b;y.forEach(function(w){g=w.source().id(),p=w.target().id(),m=g===h?p:g,m!==d&&(b=w.id(),o[b]||(o[b]=!0,s.push({x:h,y:m,edge:w})),m in t?t[h].low=Math.min(t[h].low,t[m].id):(u(c,m,h),t[h].low=Math.min(t[h].low,t[m].low),t[h].id<=t[m].low&&(t[h].cutVertex=!0,l(h,m))))})}};e.forEach(function(f){if(f.isNode()){var c=f.id();c in t||(n=0,u(c,c),t[c].cutVertex=n>1)}});var v=Object.keys(t).filter(function(f){return t[f].cutVertex}).map(function(f){return e.getElementById(f)});return{cut:e.spawn(v),components:i}},Ph={hopcroftTarjanBiconnected:Qa,htbc:Qa,htb:Qa,hopcroftTarjanBiconnectedComponents:Qa},Ja=function(){var e=this,t={},a=0,n=[],i=[],s=e.spawn(e),o=function(u){i.push(u),t[u]={index:a,low:a++,explored:!1};var v=e.getElementById(u).connectedEdges().intersection(e);if(v.forEach(function(y){var g=y.target().id();g!==u&&(g in t||o(g),t[g].explored||(t[u].low=Math.min(t[u].low,t[g].low)))}),t[u].index===t[u].low){for(var f=e.spawn();;){var c=i.pop();if(f.merge(e.getElementById(c)),t[c].low=t[u].index,t[c].explored=!0,c===u)break}var h=f.edgesWith(f),d=f.merge(h);n.push(d),s=s.difference(d)}};return e.forEach(function(l){if(l.isNode()){var u=l.id();u in t||o(u)}}),{cut:s,components:n}},Ah={tarjanStronglyConnected:Ja,tsc:Ja,tscc:Ja,tarjanStronglyConnectedComponents:Ja},Dv={};[Sa,sd,od,ld,fd,dd,pd,Hd,Xt,Yt,Rs,th,gh,bh,kh,Bh,Ph,Ah].forEach(function(r){be(Dv,r)});var Bv=0,Pv=1,Av=2,Nr=function(e){if(!(this instanceof Nr))return new Nr(e);this.id="Thenable/1.0.7",this.state=Bv,this.fulfillValue=void 0,this.rejectReason=void 0,this.onFulfilled=[],this.onRejected=[],this.proxy={then:this.then.bind(this)},typeof e=="function"&&e.call(this,this.fulfill.bind(this),this.reject.bind(this))};Nr.prototype={fulfill:function(e){return su(this,Pv,"fulfillValue",e)},reject:function(e){return su(this,Av,"rejectReason",e)},then:function(e,t){var a=this,n=new Nr;return a.onFulfilled.push(uu(e,n,"fulfill")),a.onRejected.push(uu(t,n,"reject")),Rv(a),n.proxy}};var su=function(e,t,a,n){return e.state===Bv&&(e.state=t,e[a]=n,Rv(e)),e},Rv=function(e){e.state===Pv?ou(e,"onFulfilled",e.fulfillValue):e.state===Av&&ou(e,"onRejected",e.rejectReason)},ou=function(e,t,a){if(e[t].length!==0){var n=e[t];e[t]=[];var i=function(){for(var o=0;o0}},clearQueue:function(){return function(){var t=this,a=t.length!==void 0,n=a?t:[t],i=this._private.cy||this;if(!i.styleEnabled())return this;for(var s=0;s-1}return qi=e,qi}var _i,Ru;function Yh(){if(Ru)return _i;Ru=1;var r=Vn();function e(t,a){var n=this.__data__,i=r(n,t);return i<0?(++this.size,n.push([t,a])):n[i][1]=a,this}return _i=e,_i}var Gi,Mu;function Zh(){if(Mu)return Gi;Mu=1;var r=$h(),e=Uh(),t=Kh(),a=Xh(),n=Yh();function i(s){var o=-1,l=s==null?0:s.length;for(this.clear();++o-1&&a%1==0&&a0&&this.spawn(n).updateStyle().emit("class"),t},addClass:function(e){return this.toggleClass(e,!0)},hasClass:function(e){var t=this[0];return t!=null&&t._private.classes.has(e)},toggleClass:function(e,t){_e(e)||(e=e.match(/\S+/g)||[]);for(var a=this,n=t===void 0,i=[],s=0,o=a.length;s