@agent-link/server 0.1.530 → 0.1.532
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/web/dist/assets/{abnfDiagram-VRR7QNED-CM_iRnGr.js → abnfDiagram-VRR7QNED-DfcHbwQY.js} +1 -1
- package/web/dist/assets/arc-BGjhhJ_y.js +1 -0
- package/web/dist/assets/architectureDiagram-ZJ3FMSHR-BniM6njz.js +1 -0
- package/web/dist/assets/blockDiagram-677ZJIJ3-D2IfFGZt.js +1 -0
- package/web/dist/assets/{c4Diagram-LMCZKHZV-Cxc-A5iq.js → c4Diagram-LMCZKHZV-h8S5wkdt.js} +1 -1
- package/web/dist/assets/channel-N0KSo7Sv.js +1 -0
- package/web/dist/assets/{chunk-2Q5K7J3B-CkqQPdRA.js → chunk-2Q5K7J3B-t1U97dwL.js} +1 -1
- package/web/dist/assets/{chunk-32BRIVSS-B5eaJW6h.js → chunk-32BRIVSS-iigU4eZM.js} +1 -1
- package/web/dist/assets/{chunk-5VM5RSS4-D7_Nm3Ap.js → chunk-5VM5RSS4-BMO1XLjx.js} +1 -1
- package/web/dist/assets/chunk-EX3LRPZG-CXsSiAmg.js +1 -0
- package/web/dist/assets/{chunk-JWPE2WC7-B9BEd78y.js → chunk-JWPE2WC7-D3ZrRRMs.js} +1 -1
- package/web/dist/assets/{chunk-MOJQB5TN-C_Y1JlrU.js → chunk-MOJQB5TN-CWGoKHP_.js} +1 -1
- package/web/dist/assets/{chunk-RYQCIY6F-BlWvdakS.js → chunk-RYQCIY6F-DBo3xOVM.js} +1 -1
- package/web/dist/assets/chunk-V7JOEXUC-BLSjaO76.js +1 -0
- package/web/dist/assets/{chunk-VR4S4FIN-skH1JSB_.js → chunk-VR4S4FIN-CaCSJo02.js} +1 -1
- package/web/dist/assets/{chunk-XXDRQBXY-BmZ163V2.js → chunk-XXDRQBXY-amifkJ7Y.js} +1 -1
- package/web/dist/assets/classDiagram-OUVF2IWQ-Dzg8X_Nu.js +1 -0
- package/web/dist/assets/classDiagram-v2-EOCWNBFH-Dzg8X_Nu.js +1 -0
- package/web/dist/assets/{cose-bilkent-JH36ORCC-7SguETRE.js → cose-bilkent-JH36ORCC-Bs52-Jl7.js} +1 -1
- package/web/dist/assets/{cssMode-BuihXPPJ.js → cssMode-Cnp1EeM3.js} +1 -1
- package/web/dist/assets/{cynefin-VYW2F7L2-BsipFbN_.js → cynefin-VYW2F7L2-BsVEHpR8.js} +1 -1
- package/web/dist/assets/{cynefinDiagram-TSTJHNR4-CsKb9bMH.js → cynefinDiagram-TSTJHNR4-DTdlttx8.js} +1 -1
- package/web/dist/assets/{dagre-VKFMJZFB-Btpnqx70.js → dagre-VKFMJZFB-BhXQ-1UQ.js} +1 -1
- package/web/dist/assets/diagram-FQU43EPY-CRngtYTG.js +1 -0
- package/web/dist/assets/{diagram-G47NLZAW-9th5DICa.js → diagram-G47NLZAW-f9wqEpDc.js} +1 -1
- package/web/dist/assets/{diagram-NH7WQ7WH-ov9MGctk.js → diagram-NH7WQ7WH-BbVH0Iaz.js} +1 -1
- package/web/dist/assets/diagram-OA4YK3LP-CJMKCqCK.js +1 -0
- package/web/dist/assets/diagram-WEI45ONY-RocXWfIl.js +1 -0
- package/web/dist/assets/{ebnfDiagram-CCIWWBDH-vtEcl50s.js → ebnfDiagram-CCIWWBDH-BPuo3xYV.js} +1 -1
- package/web/dist/assets/{editor.main-C3G5DBcF.js → editor.main-CMogKIvX.js} +3 -3
- package/web/dist/assets/{erDiagram-Q63AITRT-DOhbCB6H.js → erDiagram-Q63AITRT-DyuARIoe.js} +1 -1
- package/web/dist/assets/{flowDiagram-23GEKE2U-CHgXbPM4.js → flowDiagram-23GEKE2U-D6gnFdqH.js} +1 -1
- package/web/dist/assets/{freemarker2-BxEiinMy.js → freemarker2-BmiRUDNU.js} +1 -1
- package/web/dist/assets/{ganttDiagram-NO4QXBWP-BeZhYtr9.js → ganttDiagram-NO4QXBWP-CGDYf6SC.js} +1 -1
- package/web/dist/assets/{gitGraphDiagram-IHSO6WYX-CRw8Zi5p.js → gitGraphDiagram-IHSO6WYX-C_JUelxI.js} +1 -1
- package/web/dist/assets/{handlebars-HpmcrSLR.js → handlebars-UvD85ciQ.js} +1 -1
- package/web/dist/assets/{html-PACa9tPI.js → html-BXz2YX1v.js} +1 -1
- package/web/dist/assets/{htmlMode-P-tErxzQ.js → htmlMode-QQNUhOiX.js} +1 -1
- package/web/dist/assets/{index-DVzecOLh.css → index-CayH0jwf.css} +1 -1
- package/web/dist/assets/{index-BvdvTk5k.js → index-uqkv1EwI.js} +6 -6
- package/web/dist/assets/{infoDiagram-FWYZ7A6U-CB1TNT35.js → infoDiagram-FWYZ7A6U-CCoj6ubP.js} +1 -1
- package/web/dist/assets/ishikawaDiagram-FXEZZL3T-C2tTbPjv.js +1 -0
- package/web/dist/assets/{javascript-BXndY316.js → javascript-BT2Hp4AG.js} +1 -1
- package/web/dist/assets/{journeyDiagram-5HDEW3XC-YShZRT7Z.js → journeyDiagram-5HDEW3XC-C98NZFe-.js} +1 -1
- package/web/dist/assets/{jsonMode-CEY8vxua.js → jsonMode-CMizwVVJ.js} +1 -1
- package/web/dist/assets/kanban-definition-HUTT4EX6-Bgvn5TBy.js +1 -0
- package/web/dist/assets/{layout-C0UWAnD9.js → layout-CdIFZZ-x.js} +1 -1
- package/web/dist/assets/{linear-BaHQeNV7.js → linear-aCQv-zcC.js} +1 -1
- package/web/dist/assets/{liquid-DwtuUfyR.js → liquid-BynPTJbE.js} +1 -1
- package/web/dist/assets/{lspLanguageFeatures-BxaY18I4.js → lspLanguageFeatures-DN3wttaz.js} +1 -1
- package/web/dist/assets/{map-DupEyqkA.js → map-CKQHuyK8.js} +1 -1
- package/web/dist/assets/{mdx-B4ukv3eN.js → mdx-DXOtfEut.js} +1 -1
- package/web/dist/assets/{mermaid.core-CMkyheGu.js → mermaid.core-CuTCe0bN.js} +3 -3
- package/web/dist/assets/mindmap-definition-LN4V7U3C-BJBgrZFi.js +1 -0
- package/web/dist/assets/{pegDiagram-2B236MQR-DuRjwE19.js → pegDiagram-2B236MQR-BXt9uRRX.js} +1 -1
- package/web/dist/assets/pieDiagram-ENE6RG2P-CzI6lPHe.js +1 -0
- package/web/dist/assets/{python-DZsGmIe4.js → python-Cmu7MK6Z.js} +1 -1
- package/web/dist/assets/{quadrantDiagram-ABIIQ3AL-BrdgftA1.js → quadrantDiagram-ABIIQ3AL-D6_QE7ij.js} +1 -1
- package/web/dist/assets/{railroadDiagram-RFXS5EU6-CbNRdZt9.js → railroadDiagram-RFXS5EU6-glK7wh9A.js} +1 -1
- package/web/dist/assets/{razor-s53CmQFp.js → razor-BsrIpy0J.js} +1 -1
- package/web/dist/assets/{requirementDiagram-TGXJPOKE-CVDabtPo.js → requirementDiagram-TGXJPOKE-DIT4kytP.js} +1 -1
- package/web/dist/assets/sankeyDiagram-HTMAVEWB-DvPa_Duu.js +1 -0
- package/web/dist/assets/sequenceDiagram-DBY2YBRQ-C2sVBpFE.js +1 -0
- package/web/dist/assets/{sizeCapture-X5ZJPWSS-Uteu6YTh.js → sizeCapture-X5ZJPWSS-kURYnAGt.js} +1 -1
- package/web/dist/assets/stateDiagram-2N3HPSRC-Dnhp8pCF.js +1 -0
- package/web/dist/assets/stateDiagram-v2-6OUMAXLB-DiZzXoiF.js +1 -0
- package/web/dist/assets/swimlanes-5IMT3BWC-D9cwlvO0.js +2 -0
- package/web/dist/assets/swimlanesDiagram-G3AALYLV-BQX3QN6W.js +1 -0
- package/web/dist/assets/timeline-definition-FHXFAJF6-DGft3mHb.js +1 -0
- package/web/dist/assets/{tsMode-B52nAoXo.js → tsMode-VBdrDid9.js} +1 -1
- package/web/dist/assets/{typescript-BBeyRrvj.js → typescript-B9h5k8RN.js} +1 -1
- package/web/dist/assets/vennDiagram-L72KCM5P-3TEST5ZX.js +1 -0
- package/web/dist/assets/wardleyDiagram-EHGQE667-K1Lk2CxP.js +1 -0
- package/web/dist/assets/{xml-CqWgg4zm.js → xml-DPU_sazQ.js} +1 -1
- package/web/dist/assets/xychartDiagram-FW5EYKEG-Bv4i2bZh.js +1 -0
- package/web/dist/assets/{yaml-Cx5KSrS2.js → yaml-DEGyWCtS.js} +1 -1
- package/web/dist/index.html +2 -2
- package/web/dist/assets/arc-DftcGl7a.js +0 -1
- package/web/dist/assets/architectureDiagram-ZJ3FMSHR-Ci97YwKJ.js +0 -1
- package/web/dist/assets/blockDiagram-677ZJIJ3-DGVZ6FZb.js +0 -1
- package/web/dist/assets/channel-CnGR7l8D.js +0 -1
- package/web/dist/assets/chunk-EX3LRPZG-CiQagYSv.js +0 -1
- package/web/dist/assets/chunk-V7JOEXUC-Bwdvi-PC.js +0 -1
- package/web/dist/assets/classDiagram-OUVF2IWQ-CKFbNoJe.js +0 -1
- package/web/dist/assets/classDiagram-v2-EOCWNBFH-CKFbNoJe.js +0 -1
- package/web/dist/assets/diagram-FQU43EPY-CZp8pPaZ.js +0 -1
- package/web/dist/assets/diagram-OA4YK3LP-TIk4ZS1C.js +0 -1
- package/web/dist/assets/diagram-WEI45ONY-B8BTw9bb.js +0 -1
- package/web/dist/assets/ishikawaDiagram-FXEZZL3T-LDLT94kb.js +0 -1
- package/web/dist/assets/kanban-definition-HUTT4EX6-fNMTn0nF.js +0 -1
- package/web/dist/assets/mindmap-definition-LN4V7U3C-wGFOrqBP.js +0 -1
- package/web/dist/assets/pieDiagram-ENE6RG2P-DtgKC2-1.js +0 -1
- package/web/dist/assets/sankeyDiagram-HTMAVEWB-oLwddnm5.js +0 -1
- package/web/dist/assets/sequenceDiagram-DBY2YBRQ-Cbik55tU.js +0 -1
- package/web/dist/assets/stateDiagram-2N3HPSRC-BdLEzNQg.js +0 -1
- package/web/dist/assets/stateDiagram-v2-6OUMAXLB-TyYu8OOK.js +0 -1
- package/web/dist/assets/swimlanes-5IMT3BWC-DECIjgdE.js +0 -2
- package/web/dist/assets/swimlanesDiagram-G3AALYLV-L2UfTtgf.js +0 -1
- package/web/dist/assets/timeline-definition-FHXFAJF6-Q3weuOq5.js +0 -1
- package/web/dist/assets/vennDiagram-L72KCM5P-CG-4t52C.js +0 -1
- package/web/dist/assets/wardleyDiagram-EHGQE667-tCex6zO_.js +0 -1
- package/web/dist/assets/xychartDiagram-FW5EYKEG-vgvWW1_B.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var t;import{p as e}from"./chunk-JWPE2WC7-B9BEd78y.js";import{_ as i,D as n,V as r,l as o,b as a,a as s,n as h,o as l,g as d,s as c,p as g,A as u,y as f,B as p,c as m,a_ as v,ah as y,i as E,d as N,q as T,ai as A,b6 as w}from"./mermaid.core-CMkyheGu.js";import{p as I}from"./cynefin-VYW2F7L2-BsipFbN_.js";import{c as L}from"./cytoscape.esm-t-ybqhnH.js";import{g as C}from"./index-BvdvTk5k.js";var _,M={exports:{}},x={exports:{}},O={exports:{}};function D(){return _?O.exports:(_=1,t=function(){return function(t){var e={};function i(n){if(e[n])return e[n].exports;var r=e[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,i),r.l=!0,r.exports}return i.m=t,i.c=e,i.i=function(t){return t},i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:n})},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=28)}([function(t,e,i){function n(){}n.QUALITY=1,n.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,n.DEFAULT_INCREMENTAL=!1,n.DEFAULT_ANIMATION_ON_LAYOUT=!0,n.DEFAULT_ANIMATION_DURING_LAYOUT=!1,n.DEFAULT_ANIMATION_PERIOD=50,n.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,n.DEFAULT_GRAPH_MARGIN=15,n.NODE_DIMENSIONS_INCLUDE_LABELS=!1,n.SIMPLE_NODE_SIZE=40,n.SIMPLE_NODE_HALF_SIZE=n.SIMPLE_NODE_SIZE/2,n.EMPTY_COMPOUND_NODE_SIZE=40,n.MIN_EDGE_LENGTH=1,n.WORLD_BOUNDARY=1e6,n.INITIAL_WORLD_BOUNDARY=n.WORLD_BOUNDARY/1e3,n.WORLD_CENTER_X=1200,n.WORLD_CENTER_Y=900,t.exports=n},function(t,e,i){var n=i(2),r=i(8),o=i(9);function a(t,e,i){n.call(this,i),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=i,this.bendpoints=[],this.source=t,this.target=e}for(var s in a.prototype=Object.create(n.prototype),n)a[s]=n[s];a.prototype.getSource=function(){return this.source},a.prototype.getTarget=function(){return this.target},a.prototype.isInterGraph=function(){return this.isInterGraph},a.prototype.getLength=function(){return this.length},a.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},a.prototype.getBendpoints=function(){return this.bendpoints},a.prototype.getLca=function(){return this.lca},a.prototype.getSourceInLca=function(){return this.sourceInLca},a.prototype.getTargetInLca=function(){return this.targetInLca},a.prototype.getOtherEnd=function(t){if(this.source===t)return this.target;if(this.target===t)return this.source;throw"Node is not incident with this edge"},a.prototype.getOtherEndInGraph=function(t,e){for(var i=this.getOtherEnd(t),n=e.getGraphManager().getRoot();;){if(i.getOwner()==e)return i;if(i.getOwner()==n)break;i=i.getOwner().getParent()}return null},a.prototype.updateLength=function(){var t=new Array(4);this.isOverlapingSourceAndTarget=r.getIntersection(this.target.getRect(),this.source.getRect(),t),this.isOverlapingSourceAndTarget||(this.lengthX=t[0]-t[2],this.lengthY=t[1]-t[3],Math.abs(this.lengthX)<1&&(this.lengthX=o.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=o.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},a.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=o.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=o.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},t.exports=a},function(t,e,i){t.exports=function(t){this.vGraphObject=t}},function(t,e,i){var n=i(2),r=i(10),o=i(13),a=i(0),s=i(16),h=i(5);function l(t,e,i,a){null==i&&null==a&&(a=e),n.call(this,a),null!=t.graphManager&&(t=t.graphManager),this.estimatedSize=r.MIN_VALUE,this.inclusionTreeDepth=r.MAX_VALUE,this.vGraphObject=a,this.edges=[],this.graphManager=t,this.rect=null!=i&&null!=e?new o(e.x,e.y,i.width,i.height):new o}for(var d in l.prototype=Object.create(n.prototype),n)l[d]=n[d];l.prototype.getEdges=function(){return this.edges},l.prototype.getChild=function(){return this.child},l.prototype.getOwner=function(){return this.owner},l.prototype.getWidth=function(){return this.rect.width},l.prototype.setWidth=function(t){this.rect.width=t},l.prototype.getHeight=function(){return this.rect.height},l.prototype.setHeight=function(t){this.rect.height=t},l.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},l.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},l.prototype.getCenter=function(){return new h(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},l.prototype.getLocation=function(){return new h(this.rect.x,this.rect.y)},l.prototype.getRect=function(){return this.rect},l.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},l.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},l.prototype.setRect=function(t,e){this.rect.x=t.x,this.rect.y=t.y,this.rect.width=e.width,this.rect.height=e.height},l.prototype.setCenter=function(t,e){this.rect.x=t-this.rect.width/2,this.rect.y=e-this.rect.height/2},l.prototype.setLocation=function(t,e){this.rect.x=t,this.rect.y=e},l.prototype.moveBy=function(t,e){this.rect.x+=t,this.rect.y+=e},l.prototype.getEdgeListToNode=function(t){var e=[],i=this;return i.edges.forEach(function(n){if(n.target==t){if(n.source!=i)throw"Incorrect edge source!";e.push(n)}}),e},l.prototype.getEdgesBetween=function(t){var e=[],i=this;return i.edges.forEach(function(n){if(n.source!=i&&n.target!=i)throw"Incorrect edge source and/or target";n.target!=t&&n.source!=t||e.push(n)}),e},l.prototype.getNeighborsList=function(){var t=new Set,e=this;return e.edges.forEach(function(i){if(i.source==e)t.add(i.target);else{if(i.target!=e)throw"Incorrect incidency!";t.add(i.source)}}),t},l.prototype.withChildren=function(){var t=new Set;if(t.add(this),null!=this.child)for(var e=this.child.getNodes(),i=0;i<e.length;i++)e[i].withChildren().forEach(function(e){t.add(e)});return t},l.prototype.getNoOfChildren=function(){var t=0;if(null==this.child)t=1;else for(var e=this.child.getNodes(),i=0;i<e.length;i++)t+=e[i].getNoOfChildren();return 0==t&&(t=1),t},l.prototype.getEstimatedSize=function(){if(this.estimatedSize==r.MIN_VALUE)throw"assert failed";return this.estimatedSize},l.prototype.calcEstimatedSize=function(){return null==this.child?this.estimatedSize=(this.rect.width+this.rect.height)/2:(this.estimatedSize=this.child.calcEstimatedSize(),this.rect.width=this.estimatedSize,this.rect.height=this.estimatedSize,this.estimatedSize)},l.prototype.scatter=function(){var t,e,i=-a.INITIAL_WORLD_BOUNDARY,n=a.INITIAL_WORLD_BOUNDARY;t=a.WORLD_CENTER_X+s.nextDouble()*(n-i)+i;var r=-a.INITIAL_WORLD_BOUNDARY,o=a.INITIAL_WORLD_BOUNDARY;e=a.WORLD_CENTER_Y+s.nextDouble()*(o-r)+r,this.rect.x=t,this.rect.y=e},l.prototype.updateBounds=function(){if(null==this.getChild())throw"assert failed";if(0!=this.getChild().getNodes().length){var t=this.getChild();if(t.updateBounds(!0),this.rect.x=t.getLeft(),this.rect.y=t.getTop(),this.setWidth(t.getRight()-t.getLeft()),this.setHeight(t.getBottom()-t.getTop()),a.NODE_DIMENSIONS_INCLUDE_LABELS){var e=t.getRight()-t.getLeft(),i=t.getBottom()-t.getTop();this.labelWidth&&("left"==this.labelPosHorizontal?(this.rect.x-=this.labelWidth,this.setWidth(e+this.labelWidth)):"center"==this.labelPosHorizontal&&this.labelWidth>e?(this.rect.x-=(this.labelWidth-e)/2,this.setWidth(this.labelWidth)):"right"==this.labelPosHorizontal&&this.setWidth(e+this.labelWidth)),this.labelHeight&&("top"==this.labelPosVertical?(this.rect.y-=this.labelHeight,this.setHeight(i+this.labelHeight)):"center"==this.labelPosVertical&&this.labelHeight>i?(this.rect.y-=(this.labelHeight-i)/2,this.setHeight(this.labelHeight)):"bottom"==this.labelPosVertical&&this.setHeight(i+this.labelHeight))}}},l.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==r.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},l.prototype.transform=function(t){var e=this.rect.x;e>a.WORLD_BOUNDARY?e=a.WORLD_BOUNDARY:e<-a.WORLD_BOUNDARY&&(e=-a.WORLD_BOUNDARY);var i=this.rect.y;i>a.WORLD_BOUNDARY?i=a.WORLD_BOUNDARY:i<-a.WORLD_BOUNDARY&&(i=-a.WORLD_BOUNDARY);var n=new h(e,i),r=t.inverseTransformPoint(n);this.setLocation(r.x,r.y)},l.prototype.getLeft=function(){return this.rect.x},l.prototype.getRight=function(){return this.rect.x+this.rect.width},l.prototype.getTop=function(){return this.rect.y},l.prototype.getBottom=function(){return this.rect.y+this.rect.height},l.prototype.getParent=function(){return null==this.owner?null:this.owner.getParent()},t.exports=l},function(t,e,i){var n=i(0);function r(){}for(var o in n)r[o]=n[o];r.MAX_ITERATIONS=2500,r.DEFAULT_EDGE_LENGTH=50,r.DEFAULT_SPRING_STRENGTH=.45,r.DEFAULT_REPULSION_STRENGTH=4500,r.DEFAULT_GRAVITY_STRENGTH=.4,r.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,r.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,r.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,r.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,r.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,r.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,r.COOLING_ADAPTATION_FACTOR=.33,r.ADAPTATION_LOWER_NODE_LIMIT=1e3,r.ADAPTATION_UPPER_NODE_LIMIT=5e3,r.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,r.MAX_NODE_DISPLACEMENT=3*r.MAX_NODE_DISPLACEMENT_INCREMENTAL,r.MIN_REPULSION_DIST=r.DEFAULT_EDGE_LENGTH/10,r.CONVERGENCE_CHECK_PERIOD=100,r.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,r.MIN_EDGE_LENGTH=1,r.GRID_CALCULATION_CHECK_PERIOD=10,t.exports=r},function(t,e,i){function n(t,e){null==t&&null==e?(this.x=0,this.y=0):(this.x=t,this.y=e)}n.prototype.getX=function(){return this.x},n.prototype.getY=function(){return this.y},n.prototype.setX=function(t){this.x=t},n.prototype.setY=function(t){this.y=t},n.prototype.getDifference=function(t){return new DimensionD(this.x-t.x,this.y-t.y)},n.prototype.getCopy=function(){return new n(this.x,this.y)},n.prototype.translate=function(t){return this.x+=t.width,this.y+=t.height,this},t.exports=n},function(t,e,i){var n=i(2),r=i(10),o=i(0),a=i(7),s=i(3),h=i(1),l=i(13),d=i(12),c=i(11);function g(t,e,i){n.call(this,i),this.estimatedSize=r.MIN_VALUE,this.margin=o.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=t,null!=e&&e instanceof a?this.graphManager=e:null!=e&&e instanceof Layout&&(this.graphManager=e.graphManager)}for(var u in g.prototype=Object.create(n.prototype),n)g[u]=n[u];g.prototype.getNodes=function(){return this.nodes},g.prototype.getEdges=function(){return this.edges},g.prototype.getGraphManager=function(){return this.graphManager},g.prototype.getParent=function(){return this.parent},g.prototype.getLeft=function(){return this.left},g.prototype.getRight=function(){return this.right},g.prototype.getTop=function(){return this.top},g.prototype.getBottom=function(){return this.bottom},g.prototype.isConnected=function(){return this.isConnected},g.prototype.add=function(t,e,i){if(null==e&&null==i){var n=t;if(null==this.graphManager)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(n)>-1)throw"Node already in graph!";return n.owner=this,this.getNodes().push(n),n}var r=t;if(!(this.getNodes().indexOf(e)>-1&&this.getNodes().indexOf(i)>-1))throw"Source or target not in graph!";if(e.owner!=i.owner||e.owner!=this)throw"Both owners must be this graph!";return e.owner!=i.owner?null:(r.source=e,r.target=i,r.isInterGraph=!1,this.getEdges().push(r),e.edges.push(r),i!=e&&i.edges.push(r),r)},g.prototype.remove=function(t){var e=t;if(t instanceof s){if(null==e)throw"Node is null!";if(null==e.owner||e.owner!=this)throw"Owner graph is invalid!";if(null==this.graphManager)throw"Owner graph manager is invalid!";for(var i=e.edges.slice(),n=i.length,r=0;r<n;r++)(o=i[r]).isInterGraph?this.graphManager.remove(o):o.source.owner.remove(o);if(-1==(a=this.nodes.indexOf(e)))throw"Node not in owner node list!";this.nodes.splice(a,1)}else if(t instanceof h){var o;if(null==(o=t))throw"Edge is null!";if(null==o.source||null==o.target)throw"Source and/or target is null!";if(null==o.source.owner||null==o.target.owner||o.source.owner!=this||o.target.owner!=this)throw"Source and/or target owner is invalid!";var a,l=o.source.edges.indexOf(o),d=o.target.edges.indexOf(o);if(!(l>-1&&d>-1))throw"Source and/or target doesn't know this edge!";if(o.source.edges.splice(l,1),o.target!=o.source&&o.target.edges.splice(d,1),-1==(a=o.source.owner.getEdges().indexOf(o)))throw"Not in owner's edge list!";o.source.owner.getEdges().splice(a,1)}},g.prototype.updateLeftTop=function(){for(var t,e,i,n=r.MAX_VALUE,o=r.MAX_VALUE,a=this.getNodes(),s=a.length,h=0;h<s;h++){var l=a[h];n>(t=l.getTop())&&(n=t),o>(e=l.getLeft())&&(o=e)}return n==r.MAX_VALUE?null:(i=null!=a[0].getParent().paddingLeft?a[0].getParent().paddingLeft:this.margin,this.left=o-i,this.top=n-i,new d(this.left,this.top))},g.prototype.updateBounds=function(t){for(var e,i,n,o,a,s=r.MAX_VALUE,h=-r.MAX_VALUE,d=r.MAX_VALUE,c=-r.MAX_VALUE,g=this.nodes,u=g.length,f=0;f<u;f++){var p=g[f];t&&null!=p.child&&p.updateBounds(),s>(e=p.getLeft())&&(s=e),h<(i=p.getRight())&&(h=i),d>(n=p.getTop())&&(d=n),c<(o=p.getBottom())&&(c=o)}var m=new l(s,d,h-s,c-d);s==r.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),a=null!=g[0].getParent().paddingLeft?g[0].getParent().paddingLeft:this.margin,this.left=m.x-a,this.right=m.x+m.width+a,this.top=m.y-a,this.bottom=m.y+m.height+a},g.calculateBounds=function(t){for(var e,i,n,o,a=r.MAX_VALUE,s=-r.MAX_VALUE,h=r.MAX_VALUE,d=-r.MAX_VALUE,c=t.length,g=0;g<c;g++){var u=t[g];a>(e=u.getLeft())&&(a=e),s<(i=u.getRight())&&(s=i),h>(n=u.getTop())&&(h=n),d<(o=u.getBottom())&&(d=o)}return new l(a,h,s-a,d-h)},g.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},g.prototype.getEstimatedSize=function(){if(this.estimatedSize==r.MIN_VALUE)throw"assert failed";return this.estimatedSize},g.prototype.calcEstimatedSize=function(){for(var t=0,e=this.nodes,i=e.length,n=0;n<i;n++)t+=e[n].calcEstimatedSize();return this.estimatedSize=0==t?o.EMPTY_COMPOUND_NODE_SIZE:t/Math.sqrt(this.nodes.length),this.estimatedSize},g.prototype.updateConnected=function(){var t=this;if(0!=this.nodes.length){var e,i,n=new c,r=new Set,o=this.nodes[0];for(o.withChildren().forEach(function(t){n.push(t),r.add(t)});0!==n.length;)for(var a=(e=(o=n.shift()).getEdges()).length,s=0;s<a;s++)null==(i=e[s].getOtherEndInGraph(o,this))||r.has(i)||i.withChildren().forEach(function(t){n.push(t),r.add(t)});if(this.isConnected=!1,r.size>=this.nodes.length){var h=0;r.forEach(function(e){e.owner==t&&h++}),h==this.nodes.length&&(this.isConnected=!0)}}else this.isConnected=!0},t.exports=g},function(t,e,i){var n,r=i(1);function o(t){n=i(6),this.layout=t,this.graphs=[],this.edges=[]}o.prototype.addRoot=function(){var t=this.layout.newGraph(),e=this.layout.newNode(null),i=this.add(t,e);return this.setRootGraph(i),this.rootGraph},o.prototype.add=function(t,e,i,n,r){if(null==i&&null==n&&null==r){if(null==t)throw"Graph is null!";if(null==e)throw"Parent node is null!";if(this.graphs.indexOf(t)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(t),null!=t.parent)throw"Already has a parent!";if(null!=e.child)throw"Already has a child!";return t.parent=e,e.child=t,t}r=i,i=t;var o=(n=e).getOwner(),a=r.getOwner();if(null==o||o.getGraphManager()!=this)throw"Source not in this graph mgr!";if(null==a||a.getGraphManager()!=this)throw"Target not in this graph mgr!";if(o==a)return i.isInterGraph=!1,o.add(i,n,r);if(i.isInterGraph=!0,i.source=n,i.target=r,this.edges.indexOf(i)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(i),null==i.source||null==i.target)throw"Edge source and/or target is null!";if(-1!=i.source.edges.indexOf(i)||-1!=i.target.edges.indexOf(i))throw"Edge already in source and/or target incidency list!";return i.source.edges.push(i),i.target.edges.push(i),i},o.prototype.remove=function(t){if(t instanceof n){var e=t;if(e.getGraphManager()!=this)throw"Graph not in this graph mgr";if(e!=this.rootGraph&&(null==e.parent||e.parent.graphManager!=this))throw"Invalid parent node!";for(var i,o=[],a=(o=o.concat(e.getEdges())).length,s=0;s<a;s++)i=o[s],e.remove(i);var h,l=[];for(a=(l=l.concat(e.getNodes())).length,s=0;s<a;s++)h=l[s],e.remove(h);e==this.rootGraph&&this.setRootGraph(null);var d=this.graphs.indexOf(e);this.graphs.splice(d,1),e.parent=null}else if(t instanceof r){if(null==(i=t))throw"Edge is null!";if(!i.isInterGraph)throw"Not an inter-graph edge!";if(null==i.source||null==i.target)throw"Source and/or target is null!";if(-1==i.source.edges.indexOf(i)||-1==i.target.edges.indexOf(i))throw"Source and/or target doesn't know this edge!";if(d=i.source.edges.indexOf(i),i.source.edges.splice(d,1),d=i.target.edges.indexOf(i),i.target.edges.splice(d,1),null==i.source.owner||null==i.source.owner.getGraphManager())throw"Edge owner graph or owner graph manager is null!";if(-1==i.source.owner.getGraphManager().edges.indexOf(i))throw"Not in owner graph manager's edge list!";d=i.source.owner.getGraphManager().edges.indexOf(i),i.source.owner.getGraphManager().edges.splice(d,1)}},o.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},o.prototype.getGraphs=function(){return this.graphs},o.prototype.getAllNodes=function(){if(null==this.allNodes){for(var t=[],e=this.getGraphs(),i=e.length,n=0;n<i;n++)t=t.concat(e[n].getNodes());this.allNodes=t}return this.allNodes},o.prototype.resetAllNodes=function(){this.allNodes=null},o.prototype.resetAllEdges=function(){this.allEdges=null},o.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},o.prototype.getAllEdges=function(){if(null==this.allEdges){var t=[],e=this.getGraphs();e.length;for(var i=0;i<e.length;i++)t=t.concat(e[i].getEdges());t=t.concat(this.edges),this.allEdges=t}return this.allEdges},o.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},o.prototype.setAllNodesToApplyGravitation=function(t){if(null!=this.allNodesToApplyGravitation)throw"assert failed";this.allNodesToApplyGravitation=t},o.prototype.getRoot=function(){return this.rootGraph},o.prototype.setRootGraph=function(t){if(t.getGraphManager()!=this)throw"Root not in this graph mgr!";this.rootGraph=t,null==t.parent&&(t.parent=this.layout.newNode("Root node"))},o.prototype.getLayout=function(){return this.layout},o.prototype.isOneAncestorOfOther=function(t,e){if(null==t||null==e)throw"assert failed";if(t==e)return!0;for(var i,n=t.getOwner();null!=(i=n.getParent());){if(i==e)return!0;if(null==(n=i.getOwner()))break}for(n=e.getOwner();null!=(i=n.getParent());){if(i==t)return!0;if(null==(n=i.getOwner()))break}return!1},o.prototype.calcLowestCommonAncestors=function(){for(var t,e,i,n,r,o=this.getAllEdges(),a=o.length,s=0;s<a;s++)if(e=(t=o[s]).source,i=t.target,t.lca=null,t.sourceInLca=e,t.targetInLca=i,e!=i){for(n=e.getOwner();null==t.lca;){for(t.targetInLca=i,r=i.getOwner();null==t.lca;){if(r==n){t.lca=r;break}if(r==this.rootGraph)break;if(null!=t.lca)throw"assert failed";t.targetInLca=r.getParent(),r=t.targetInLca.getOwner()}if(n==this.rootGraph)break;null==t.lca&&(t.sourceInLca=n.getParent(),n=t.sourceInLca.getOwner())}if(null==t.lca)throw"assert failed"}else t.lca=e.getOwner()},o.prototype.calcLowestCommonAncestor=function(t,e){if(t==e)return t.getOwner();for(var i=t.getOwner();null!=i;){for(var n=e.getOwner();null!=n;){if(n==i)return n;n=n.getParent().getOwner()}i=i.getParent().getOwner()}return i},o.prototype.calcInclusionTreeDepths=function(t,e){var i;null==t&&null==e&&(t=this.rootGraph,e=1);for(var n=t.getNodes(),r=n.length,o=0;o<r;o++)(i=n[o]).inclusionTreeDepth=e,null!=i.child&&this.calcInclusionTreeDepths(i.child,e+1)},o.prototype.includesInvalidEdge=function(){for(var t,e=[],i=this.edges.length,n=0;n<i;n++)t=this.edges[n],this.isOneAncestorOfOther(t.source,t.target)&&e.push(t);for(n=0;n<e.length;n++)this.remove(e[n]);return!1},t.exports=o},function(t,e,i){var n=i(12);function r(){}r.calcSeparationAmount=function(t,e,i,n){if(!t.intersects(e))throw"assert failed";var r=new Array(2);this.decideDirectionsForOverlappingNodes(t,e,r),i[0]=Math.min(t.getRight(),e.getRight())-Math.max(t.x,e.x),i[1]=Math.min(t.getBottom(),e.getBottom())-Math.max(t.y,e.y),t.getX()<=e.getX()&&t.getRight()>=e.getRight()?i[0]+=Math.min(e.getX()-t.getX(),t.getRight()-e.getRight()):e.getX()<=t.getX()&&e.getRight()>=t.getRight()&&(i[0]+=Math.min(t.getX()-e.getX(),e.getRight()-t.getRight())),t.getY()<=e.getY()&&t.getBottom()>=e.getBottom()?i[1]+=Math.min(e.getY()-t.getY(),t.getBottom()-e.getBottom()):e.getY()<=t.getY()&&e.getBottom()>=t.getBottom()&&(i[1]+=Math.min(t.getY()-e.getY(),e.getBottom()-t.getBottom()));var o=Math.abs((e.getCenterY()-t.getCenterY())/(e.getCenterX()-t.getCenterX()));e.getCenterY()===t.getCenterY()&&e.getCenterX()===t.getCenterX()&&(o=1);var a=o*i[0],s=i[1]/o;i[0]<s?s=i[0]:a=i[1],i[0]=-1*r[0]*(s/2+n),i[1]=-1*r[1]*(a/2+n)},r.decideDirectionsForOverlappingNodes=function(t,e,i){t.getCenterX()<e.getCenterX()?i[0]=-1:i[0]=1,t.getCenterY()<e.getCenterY()?i[1]=-1:i[1]=1},r.getIntersection2=function(t,e,i){var n=t.getCenterX(),r=t.getCenterY(),o=e.getCenterX(),a=e.getCenterY();if(t.intersects(e))return i[0]=n,i[1]=r,i[2]=o,i[3]=a,!0;var s=t.getX(),h=t.getY(),l=t.getRight(),d=t.getX(),c=t.getBottom(),g=t.getRight(),u=t.getWidthHalf(),f=t.getHeightHalf(),p=e.getX(),m=e.getY(),v=e.getRight(),y=e.getX(),E=e.getBottom(),N=e.getRight(),T=e.getWidthHalf(),A=e.getHeightHalf(),w=!1,I=!1;if(n===o){if(r>a)return i[0]=n,i[1]=h,i[2]=o,i[3]=E,!1;if(r<a)return i[0]=n,i[1]=c,i[2]=o,i[3]=m,!1}else if(r===a){if(n>o)return i[0]=s,i[1]=r,i[2]=v,i[3]=a,!1;if(n<o)return i[0]=l,i[1]=r,i[2]=p,i[3]=a,!1}else{var L=t.height/t.width,C=e.height/e.width,_=(a-r)/(o-n),M=void 0,x=void 0,O=void 0,D=void 0,b=void 0,R=void 0;if(-L===_?n>o?(i[0]=d,i[1]=c,w=!0):(i[0]=l,i[1]=h,w=!0):L===_&&(n>o?(i[0]=s,i[1]=h,w=!0):(i[0]=g,i[1]=c,w=!0)),-C===_?o>n?(i[2]=y,i[3]=E,I=!0):(i[2]=v,i[3]=m,I=!0):C===_&&(o>n?(i[2]=p,i[3]=m,I=!0):(i[2]=N,i[3]=E,I=!0)),w&&I)return!1;if(n>o?r>a?(M=this.getCardinalDirection(L,_,4),x=this.getCardinalDirection(C,_,2)):(M=this.getCardinalDirection(-L,_,3),x=this.getCardinalDirection(-C,_,1)):r>a?(M=this.getCardinalDirection(-L,_,1),x=this.getCardinalDirection(-C,_,3)):(M=this.getCardinalDirection(L,_,2),x=this.getCardinalDirection(C,_,4)),!w)switch(M){case 1:D=h,O=n+-f/_,i[0]=O,i[1]=D;break;case 2:O=g,D=r+u*_,i[0]=O,i[1]=D;break;case 3:D=c,O=n+f/_,i[0]=O,i[1]=D;break;case 4:O=d,D=r+-u*_,i[0]=O,i[1]=D}if(!I)switch(x){case 1:R=m,b=o+-A/_,i[2]=b,i[3]=R;break;case 2:b=N,R=a+T*_,i[2]=b,i[3]=R;break;case 3:R=E,b=o+A/_,i[2]=b,i[3]=R;break;case 4:b=y,R=a+-T*_,i[2]=b,i[3]=R}}return!1},r.getCardinalDirection=function(t,e,i){return t>e?i:1+i%4},r.getIntersection=function(t,e,i,r){if(null==r)return this.getIntersection2(t,e,i);var o,a,s,h,l,d,c,g=t.x,u=t.y,f=e.x,p=e.y,m=i.x,v=i.y,y=r.x,E=r.y;return 0===(c=(o=p-u)*(h=m-y)-(a=E-v)*(s=g-f))?null:new n((s*(d=y*v-m*E)-h*(l=f*u-g*p))/c,(a*l-o*d)/c)},r.angleOfVector=function(t,e,i,n){var r=void 0;return t!==i?(r=Math.atan((n-e)/(i-t)),i<t?r+=Math.PI:n<e&&(r+=this.TWO_PI)):r=n<e?this.ONE_AND_HALF_PI:this.HALF_PI,r},r.doIntersect=function(t,e,i,n){var r=t.x,o=t.y,a=e.x,s=e.y,h=i.x,l=i.y,d=n.x,c=n.y,g=(a-r)*(c-l)-(d-h)*(s-o);if(0===g)return!1;var u=((c-l)*(d-r)+(h-d)*(c-o))/g,f=((o-s)*(d-r)+(a-r)*(c-o))/g;return 0<u&&u<1&&0<f&&f<1},r.findCircleLineIntersections=function(t,e,i,n,r,o,a){var s=(i-t)*(i-t)+(n-e)*(n-e),h=2*((t-r)*(i-t)+(e-o)*(n-e)),l=(t-r)*(t-r)+(e-o)*(e-o)-a*a;if(h*h-4*s*l>=0){var d=(-h+Math.sqrt(h*h-4*s*l))/(2*s),c=(-h-Math.sqrt(h*h-4*s*l))/(2*s);return d>=0&&d<=1?[d]:c>=0&&c<=1?[c]:null}return null},r.HALF_PI=.5*Math.PI,r.ONE_AND_HALF_PI=1.5*Math.PI,r.TWO_PI=2*Math.PI,r.THREE_PI=3*Math.PI,t.exports=r},function(t,e,i){function n(){}n.sign=function(t){return t>0?1:t<0?-1:0},n.floor=function(t){return t<0?Math.ceil(t):Math.floor(t)},n.ceil=function(t){return t<0?Math.floor(t):Math.ceil(t)},t.exports=n},function(t,e,i){function n(){}n.MAX_VALUE=2147483647,n.MIN_VALUE=-2147483648,t.exports=n},function(t,e,i){var n=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),r=function(t){return{value:t,next:null,prev:null}},o=function(t,e,i,n){return null!==t?t.next=e:n.head=e,null!==i?i.prev=e:n.tail=e,e.prev=t,e.next=i,n.length++,e},a=function(t,e){var i=t.prev,n=t.next;return null!==i?i.next=n:e.head=n,null!==n?n.prev=i:e.tail=i,t.prev=t.next=null,e.length--,t},s=function(){function t(e){var i=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.length=0,this.head=null,this.tail=null,null!=e&&e.forEach(function(t){return i.push(t)})}return n(t,[{key:"size",value:function(){return this.length}},{key:"insertBefore",value:function(t,e){return o(e.prev,r(t),e,this)}},{key:"insertAfter",value:function(t,e){return o(e,r(t),e.next,this)}},{key:"insertNodeBefore",value:function(t,e){return o(e.prev,t,e,this)}},{key:"insertNodeAfter",value:function(t,e){return o(e,t,e.next,this)}},{key:"push",value:function(t){return o(this.tail,r(t),null,this)}},{key:"unshift",value:function(t){return o(null,r(t),this.head,this)}},{key:"remove",value:function(t){return a(t,this)}},{key:"pop",value:function(){return a(this.tail,this).value}},{key:"popNode",value:function(){return a(this.tail,this)}},{key:"shift",value:function(){return a(this.head,this).value}},{key:"shiftNode",value:function(){return a(this.head,this)}},{key:"get_object_at",value:function(t){if(t<=this.length()){for(var e=1,i=this.head;e<t;)i=i.next,e++;return i.value}}},{key:"set_object_at",value:function(t,e){if(t<=this.length()){for(var i=1,n=this.head;i<t;)n=n.next,i++;n.value=e}}}]),t}();t.exports=s},function(t,e,i){function n(t,e,i){this.x=null,this.y=null,null==t&&null==e&&null==i?(this.x=0,this.y=0):"number"==typeof t&&"number"==typeof e&&null==i?(this.x=t,this.y=e):"Point"==t.constructor.name&&null==e&&null==i&&(i=t,this.x=i.x,this.y=i.y)}n.prototype.getX=function(){return this.x},n.prototype.getY=function(){return this.y},n.prototype.getLocation=function(){return new n(this.x,this.y)},n.prototype.setLocation=function(t,e,i){"Point"==t.constructor.name&&null==e&&null==i?(i=t,this.setLocation(i.x,i.y)):"number"==typeof t&&"number"==typeof e&&null==i&&(parseInt(t)==t&&parseInt(e)==e?this.move(t,e):(this.x=Math.floor(t+.5),this.y=Math.floor(e+.5)))},n.prototype.move=function(t,e){this.x=t,this.y=e},n.prototype.translate=function(t,e){this.x+=t,this.y+=e},n.prototype.equals=function(t){if("Point"==t.constructor.name){var e=t;return this.x==e.x&&this.y==e.y}return this==t},n.prototype.toString=function(){return(new n).constructor.name+"[x="+this.x+",y="+this.y+"]"},t.exports=n},function(t,e,i){function n(t,e,i,n){this.x=0,this.y=0,this.width=0,this.height=0,null!=t&&null!=e&&null!=i&&null!=n&&(this.x=t,this.y=e,this.width=i,this.height=n)}n.prototype.getX=function(){return this.x},n.prototype.setX=function(t){this.x=t},n.prototype.getY=function(){return this.y},n.prototype.setY=function(t){this.y=t},n.prototype.getWidth=function(){return this.width},n.prototype.setWidth=function(t){this.width=t},n.prototype.getHeight=function(){return this.height},n.prototype.setHeight=function(t){this.height=t},n.prototype.getRight=function(){return this.x+this.width},n.prototype.getBottom=function(){return this.y+this.height},n.prototype.intersects=function(t){return!(this.getRight()<t.x||this.getBottom()<t.y||t.getRight()<this.x||t.getBottom()<this.y)},n.prototype.getCenterX=function(){return this.x+this.width/2},n.prototype.getMinX=function(){return this.getX()},n.prototype.getMaxX=function(){return this.getX()+this.width},n.prototype.getCenterY=function(){return this.y+this.height/2},n.prototype.getMinY=function(){return this.getY()},n.prototype.getMaxY=function(){return this.getY()+this.height},n.prototype.getWidthHalf=function(){return this.width/2},n.prototype.getHeightHalf=function(){return this.height/2},t.exports=n},function(t,e,i){var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};function r(){}r.lastID=0,r.createID=function(t){return r.isPrimitive(t)?t:(null!=t.uniqueID||(t.uniqueID=r.getString(),r.lastID++),t.uniqueID)},r.getString=function(t){return null==t&&(t=r.lastID),"Object#"+t},r.isPrimitive=function(t){var e=void 0===t?"undefined":n(t);return null==t||"object"!=e&&"function"!=e},t.exports=r},function(t,e,i){function n(t){if(Array.isArray(t)){for(var e=0,i=Array(t.length);e<t.length;e++)i[e]=t[e];return i}return Array.from(t)}var r=i(0),o=i(7),a=i(3),s=i(1),h=i(6),l=i(5),d=i(17),c=i(29);function g(t){c.call(this),this.layoutQuality=r.QUALITY,this.createBendsAsNeeded=r.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=r.DEFAULT_INCREMENTAL,this.animationOnLayout=r.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=r.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=r.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=r.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new o(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,null!=t&&(this.isRemoteUse=t)}g.RANDOM_SEED=1,g.prototype=Object.create(c.prototype),g.prototype.getGraphManager=function(){return this.graphManager},g.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},g.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},g.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},g.prototype.newGraphManager=function(){var t=new o(this);return this.graphManager=t,t},g.prototype.newGraph=function(t){return new h(null,this.graphManager,t)},g.prototype.newNode=function(t){return new a(this.graphManager,t)},g.prototype.newEdge=function(t){return new s(null,null,t)},g.prototype.checkLayoutSuccess=function(){return null==this.graphManager.getRoot()||0==this.graphManager.getRoot().getNodes().length||this.graphManager.includesInvalidEdge()},g.prototype.runLayout=function(){var t;return this.isLayoutFinished=!1,this.tilingPreLayout&&this.tilingPreLayout(),this.initParameters(),t=!this.checkLayoutSuccess()&&this.layout(),"during"!==r.ANIMATE&&(t&&(this.isSubLayout||this.doPostLayout()),this.tilingPostLayout&&this.tilingPostLayout(),this.isLayoutFinished=!0,t)},g.prototype.doPostLayout=function(){this.incremental||this.transform(),this.update()},g.prototype.update2=function(){if(this.createBendsAsNeeded&&(this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges()),!this.isRemoteUse){for(var t=this.graphManager.getAllEdges(),e=0;e<t.length;e++)t[e];var i=this.graphManager.getRoot().getNodes();for(e=0;e<i.length;e++)i[e];this.update(this.graphManager.getRoot())}},g.prototype.update=function(t){if(null==t)this.update2();else if(t instanceof a){var e=t;if(null!=e.getChild())for(var i=e.getChild().getNodes(),n=0;n<i.length;n++)update(i[n]);null!=e.vGraphObject&&e.vGraphObject.update(e)}else if(t instanceof s){var r=t;null!=r.vGraphObject&&r.vGraphObject.update(r)}else if(t instanceof h){var o=t;null!=o.vGraphObject&&o.vGraphObject.update(o)}},g.prototype.initParameters=function(){this.isSubLayout||(this.layoutQuality=r.QUALITY,this.animationDuringLayout=r.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=r.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=r.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=r.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=r.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=r.DEFAULT_UNIFORM_LEAF_NODE_SIZES),this.animationDuringLayout&&(this.animationOnLayout=!1)},g.prototype.transform=function(t){if(null==t)this.transform(new l(0,0));else{var e=new d,i=this.graphManager.getRoot().updateLeftTop();if(null!=i){e.setWorldOrgX(t.x),e.setWorldOrgY(t.y),e.setDeviceOrgX(i.x),e.setDeviceOrgY(i.y);for(var n=this.getAllNodes(),r=0;r<n.length;r++)n[r].transform(e)}}},g.prototype.positionNodesRandomly=function(t){if(null==t)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else for(var e,i,n=t.getNodes(),r=0;r<n.length;r++)null==(i=(e=n[r]).getChild())||0==i.getNodes().length?e.scatter():(this.positionNodesRandomly(i),e.updateBounds())},g.prototype.getFlatForest=function(){for(var t=[],e=!0,i=this.graphManager.getRoot().getNodes(),r=!0,o=0;o<i.length;o++)null!=i[o].getChild()&&(r=!1);if(!r)return t;var a=new Set,s=[],h=new Map,l=[];for(l=l.concat(i);l.length>0&&e;){for(s.push(l[0]);s.length>0&&e;){var d=s[0];s.splice(0,1),a.add(d);var c=d.getEdges();for(o=0;o<c.length;o++){var g=c[o].getOtherEnd(d);if(h.get(d)!=g){if(a.has(g)){e=!1;break}s.push(g),h.set(g,d)}}}if(e){var u=[].concat(n(a));for(t.push(u),o=0;o<u.length;o++){var f=u[o],p=l.indexOf(f);p>-1&&l.splice(p,1)}a=new Set,h=new Map}else t=[]}return t},g.prototype.createDummyNodesForBendpoints=function(t){for(var e=[],i=t.source,n=this.graphManager.calcLowestCommonAncestor(t.source,t.target),r=0;r<t.bendpoints.length;r++){var o=this.newNode(null);o.setRect(new Point(0,0),new Dimension(1,1)),n.add(o);var a=this.newEdge(null);this.graphManager.add(a,i,o),e.add(o),i=o}return a=this.newEdge(null),this.graphManager.add(a,i,t.target),this.edgeToDummyNodes.set(t,e),t.isInterGraph()?this.graphManager.remove(t):n.remove(t),e},g.prototype.createBendpointsFromDummyNodes=function(){var t=[];t=t.concat(this.graphManager.getAllEdges()),t=[].concat(n(this.edgeToDummyNodes.keys())).concat(t);for(var e=0;e<t.length;e++){var i=t[e];if(i.bendpoints.length>0){for(var r=this.edgeToDummyNodes.get(i),o=0;o<r.length;o++){var a=r[o],s=new l(a.getCenterX(),a.getCenterY()),h=i.bendpoints.get(o);h.x=s.x,h.y=s.y,a.getOwner().remove(a)}this.graphManager.add(i,i.source,i.target)}}},g.transform=function(t,e,i,n){if(null!=i&&null!=n){var r=e;return t<=50?r-=(e-e/i)/50*(50-t):r+=(e*n-e)/50*(t-50),r}var o,a;return t<=50?(o=9*e/500,a=e/10):(o=9*e/50,a=-8*e),o*t+a},g.findCenterOfTree=function(t){var e=[];e=e.concat(t);var i=[],n=new Map,r=!1,o=null;1!=e.length&&2!=e.length||(r=!0,o=e[0]);for(var a=0;a<e.length;a++){var s=(d=e[a]).getNeighborsList().size;n.set(d,d.getNeighborsList().size),1==s&&i.push(d)}var h=[];for(h=h.concat(i);!r;){var l=[];for(l=l.concat(h),h=[],a=0;a<e.length;a++){var d=e[a],c=e.indexOf(d);c>=0&&e.splice(c,1),d.getNeighborsList().forEach(function(t){if(i.indexOf(t)<0){var e=n.get(t)-1;1==e&&h.push(t),n.set(t,e)}})}i=i.concat(h),1!=e.length&&2!=e.length||(r=!0,o=e[0])}return o},g.prototype.setGraphManager=function(t){this.graphManager=t},t.exports=g},function(t,e,i){function n(){}n.seed=1,n.x=0,n.nextDouble=function(){return n.x=1e4*Math.sin(n.seed++),n.x-Math.floor(n.x)},t.exports=n},function(t,e,i){var n=i(5);function r(t,e){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}r.prototype.getWorldOrgX=function(){return this.lworldOrgX},r.prototype.setWorldOrgX=function(t){this.lworldOrgX=t},r.prototype.getWorldOrgY=function(){return this.lworldOrgY},r.prototype.setWorldOrgY=function(t){this.lworldOrgY=t},r.prototype.getWorldExtX=function(){return this.lworldExtX},r.prototype.setWorldExtX=function(t){this.lworldExtX=t},r.prototype.getWorldExtY=function(){return this.lworldExtY},r.prototype.setWorldExtY=function(t){this.lworldExtY=t},r.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},r.prototype.setDeviceOrgX=function(t){this.ldeviceOrgX=t},r.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},r.prototype.setDeviceOrgY=function(t){this.ldeviceOrgY=t},r.prototype.getDeviceExtX=function(){return this.ldeviceExtX},r.prototype.setDeviceExtX=function(t){this.ldeviceExtX=t},r.prototype.getDeviceExtY=function(){return this.ldeviceExtY},r.prototype.setDeviceExtY=function(t){this.ldeviceExtY=t},r.prototype.transformX=function(t){var e=0,i=this.lworldExtX;return 0!=i&&(e=this.ldeviceOrgX+(t-this.lworldOrgX)*this.ldeviceExtX/i),e},r.prototype.transformY=function(t){var e=0,i=this.lworldExtY;return 0!=i&&(e=this.ldeviceOrgY+(t-this.lworldOrgY)*this.ldeviceExtY/i),e},r.prototype.inverseTransformX=function(t){var e=0,i=this.ldeviceExtX;return 0!=i&&(e=this.lworldOrgX+(t-this.ldeviceOrgX)*this.lworldExtX/i),e},r.prototype.inverseTransformY=function(t){var e=0,i=this.ldeviceExtY;return 0!=i&&(e=this.lworldOrgY+(t-this.ldeviceOrgY)*this.lworldExtY/i),e},r.prototype.inverseTransformPoint=function(t){return new n(this.inverseTransformX(t.x),this.inverseTransformY(t.y))},t.exports=r},function(t,e,i){var n=i(15),r=i(4),o=i(0),a=i(8),s=i(9);function h(){n.call(this),this.useSmartIdealEdgeLengthCalculation=r.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=r.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=r.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=r.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=r.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*r.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=r.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=r.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=r.MAX_ITERATIONS}for(var l in h.prototype=Object.create(n.prototype),n)h[l]=n[l];h.prototype.initParameters=function(){n.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=r.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},h.prototype.calcIdealEdgeLengths=function(){for(var t,e,i,n,a,s,h,l=this.getGraphManager().getAllEdges(),d=0;d<l.length;d++)e=(t=l[d]).idealLength,t.isInterGraph&&(n=t.getSource(),a=t.getTarget(),s=t.getSourceInLca().getEstimatedSize(),h=t.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation&&(t.idealLength+=s+h-2*o.SIMPLE_NODE_SIZE),i=t.getLca().getInclusionTreeDepth(),t.idealLength+=e*r.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(n.getInclusionTreeDepth()+a.getInclusionTreeDepth()-2*i))},h.prototype.initSpringEmbedder=function(){var t=this.getAllNodes().length;this.incremental?(t>r.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*r.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(t-r.ADAPTATION_LOWER_NODE_LIMIT)/(r.ADAPTATION_UPPER_NODE_LIMIT-r.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-r.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=r.MAX_NODE_DISPLACEMENT_INCREMENTAL):(t>r.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(r.COOLING_ADAPTATION_FACTOR,1-(t-r.ADAPTATION_LOWER_NODE_LIMIT)/(r.ADAPTATION_UPPER_NODE_LIMIT-r.ADAPTATION_LOWER_NODE_LIMIT)*(1-r.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=r.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(5*this.getAllNodes().length,this.maxIterations),this.displacementThresholdPerNode=3*r.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},h.prototype.calcSpringForces=function(){for(var t,e=this.getAllEdges(),i=0;i<e.length;i++)t=e[i],this.calcSpringForce(t,t.idealLength)},h.prototype.calcRepulsionForces=function(){var t,e,i,n,o,a=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],s=arguments.length>1&&void 0!==arguments[1]&&arguments[1],h=this.getAllNodes();if(this.useFRGridVariant)for(this.totalIterations%r.GRID_CALCULATION_CHECK_PERIOD==1&&a&&this.updateGrid(),o=new Set,t=0;t<h.length;t++)i=h[t],this.calculateRepulsionForceOfANode(i,o,a,s),o.add(i);else for(t=0;t<h.length;t++)for(i=h[t],e=t+1;e<h.length;e++)n=h[e],i.getOwner()==n.getOwner()&&this.calcRepulsionForce(i,n)},h.prototype.calcGravitationalForces=function(){for(var t,e=this.getAllNodesToApplyGravitation(),i=0;i<e.length;i++)t=e[i],this.calcGravitationalForce(t)},h.prototype.moveNodes=function(){for(var t=this.getAllNodes(),e=0;e<t.length;e++)t[e].move()},h.prototype.calcSpringForce=function(t,e){var i,n,r,o,a=t.getSource(),s=t.getTarget();if(this.uniformLeafNodeSizes&&null==a.getChild()&&null==s.getChild())t.updateLengthSimple();else if(t.updateLength(),t.isOverlapingSourceAndTarget)return;0!=(i=t.getLength())&&(r=(n=t.edgeElasticity*(i-e))*(t.lengthX/i),o=n*(t.lengthY/i),a.springForceX+=r,a.springForceY+=o,s.springForceX-=r,s.springForceY-=o)},h.prototype.calcRepulsionForce=function(t,e){var i,n,o,h,l,d,c,g=t.getRect(),u=e.getRect(),f=new Array(2),p=new Array(4);if(g.intersects(u)){a.calcSeparationAmount(g,u,f,r.DEFAULT_EDGE_LENGTH/2),d=2*f[0],c=2*f[1];var m=t.noOfChildren*e.noOfChildren/(t.noOfChildren+e.noOfChildren);t.repulsionForceX-=m*d,t.repulsionForceY-=m*c,e.repulsionForceX+=m*d,e.repulsionForceY+=m*c}else this.uniformLeafNodeSizes&&null==t.getChild()&&null==e.getChild()?(i=u.getCenterX()-g.getCenterX(),n=u.getCenterY()-g.getCenterY()):(a.getIntersection(g,u,p),i=p[2]-p[0],n=p[3]-p[1]),Math.abs(i)<r.MIN_REPULSION_DIST&&(i=s.sign(i)*r.MIN_REPULSION_DIST),Math.abs(n)<r.MIN_REPULSION_DIST&&(n=s.sign(n)*r.MIN_REPULSION_DIST),o=i*i+n*n,h=Math.sqrt(o),d=(l=(t.nodeRepulsion/2+e.nodeRepulsion/2)*t.noOfChildren*e.noOfChildren/o)*i/h,c=l*n/h,t.repulsionForceX-=d,t.repulsionForceY-=c,e.repulsionForceX+=d,e.repulsionForceY+=c},h.prototype.calcGravitationalForce=function(t){var e,i,n,r,o,a,s,h;i=((e=t.getOwner()).getRight()+e.getLeft())/2,n=(e.getTop()+e.getBottom())/2,r=t.getCenterX()-i,o=t.getCenterY()-n,a=Math.abs(r)+t.getWidth()/2,s=Math.abs(o)+t.getHeight()/2,t.getOwner()==this.graphManager.getRoot()?(a>(h=e.getEstimatedSize()*this.gravityRangeFactor)||s>h)&&(t.gravitationForceX=-this.gravityConstant*r,t.gravitationForceY=-this.gravityConstant*o):(a>(h=e.getEstimatedSize()*this.compoundGravityRangeFactor)||s>h)&&(t.gravitationForceX=-this.gravityConstant*r*this.compoundGravityConstant,t.gravitationForceY=-this.gravityConstant*o*this.compoundGravityConstant)},h.prototype.isConverged=function(){var t,e=!1;return this.totalIterations>this.maxIterations/3&&(e=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),t=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,t||e},h.prototype.animate=function(){this.animationDuringLayout&&!this.isSubLayout&&(this.notAnimatedIterations==this.animationPeriod?(this.update(),this.notAnimatedIterations=0):this.notAnimatedIterations++)},h.prototype.calcNoOfChildrenForAllNodes=function(){for(var t,e=this.graphManager.getAllNodes(),i=0;i<e.length;i++)(t=e[i]).noOfChildren=t.getNoOfChildren()},h.prototype.calcGrid=function(t){var e,i;e=parseInt(Math.ceil((t.getRight()-t.getLeft())/this.repulsionRange)),i=parseInt(Math.ceil((t.getBottom()-t.getTop())/this.repulsionRange));for(var n=new Array(e),r=0;r<e;r++)n[r]=new Array(i);for(r=0;r<e;r++)for(var o=0;o<i;o++)n[r][o]=new Array;return n},h.prototype.addNodeToGrid=function(t,e,i){var n,r,o,a;n=parseInt(Math.floor((t.getRect().x-e)/this.repulsionRange)),r=parseInt(Math.floor((t.getRect().width+t.getRect().x-e)/this.repulsionRange)),o=parseInt(Math.floor((t.getRect().y-i)/this.repulsionRange)),a=parseInt(Math.floor((t.getRect().height+t.getRect().y-i)/this.repulsionRange));for(var s=n;s<=r;s++)for(var h=o;h<=a;h++)this.grid[s][h].push(t),t.setGridCoordinates(n,r,o,a)},h.prototype.updateGrid=function(){var t,e,i=this.getAllNodes();for(this.grid=this.calcGrid(this.graphManager.getRoot()),t=0;t<i.length;t++)e=i[t],this.addNodeToGrid(e,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},h.prototype.calculateRepulsionForceOfANode=function(t,e,i,n){if(this.totalIterations%r.GRID_CALCULATION_CHECK_PERIOD==1&&i||n){var o,a=new Set;t.surrounding=new Array;for(var s=this.grid,h=t.startX-1;h<t.finishX+2;h++)for(var l=t.startY-1;l<t.finishY+2;l++)if(!(h<0||l<0||h>=s.length||l>=s[0].length))for(var d=0;d<s[h][l].length;d++)if(o=s[h][l][d],t.getOwner()==o.getOwner()&&t!=o&&!e.has(o)&&!a.has(o)){var c=Math.abs(t.getCenterX()-o.getCenterX())-(t.getWidth()/2+o.getWidth()/2),g=Math.abs(t.getCenterY()-o.getCenterY())-(t.getHeight()/2+o.getHeight()/2);c<=this.repulsionRange&&g<=this.repulsionRange&&a.add(o)}t.surrounding=[].concat(function(t){if(Array.isArray(t)){for(var e=0,i=Array(t.length);e<t.length;e++)i[e]=t[e];return i}return Array.from(t)}(a))}for(h=0;h<t.surrounding.length;h++)this.calcRepulsionForce(t,t.surrounding[h])},h.prototype.calcRepulsionRange=function(){return 0},t.exports=h},function(t,e,i){var n=i(1),r=i(4);function o(t,e,i){n.call(this,t,e,i),this.idealLength=r.DEFAULT_EDGE_LENGTH,this.edgeElasticity=r.DEFAULT_SPRING_STRENGTH}for(var a in o.prototype=Object.create(n.prototype),n)o[a]=n[a];t.exports=o},function(t,e,i){var n=i(3),r=i(4);function o(t,e,i,o){n.call(this,t,e,i,o),this.nodeRepulsion=r.DEFAULT_REPULSION_STRENGTH,this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0,this.startX=0,this.finishX=0,this.startY=0,this.finishY=0,this.surrounding=[]}for(var a in o.prototype=Object.create(n.prototype),n)o[a]=n[a];o.prototype.setGridCoordinates=function(t,e,i,n){this.startX=t,this.finishX=e,this.startY=i,this.finishY=n},t.exports=o},function(t,e,i){function n(t,e){this.width=0,this.height=0,null!==t&&null!==e&&(this.height=e,this.width=t)}n.prototype.getWidth=function(){return this.width},n.prototype.setWidth=function(t){this.width=t},n.prototype.getHeight=function(){return this.height},n.prototype.setHeight=function(t){this.height=t},t.exports=n},function(t,e,i){var n=i(14);function r(){this.map={},this.keys=[]}r.prototype.put=function(t,e){var i=n.createID(t);this.contains(i)||(this.map[i]=e,this.keys.push(t))},r.prototype.contains=function(t){return n.createID(t),null!=this.map[t]},r.prototype.get=function(t){var e=n.createID(t);return this.map[e]},r.prototype.keySet=function(){return this.keys},t.exports=r},function(t,e,i){var n=i(14);function r(){this.set={}}r.prototype.add=function(t){var e=n.createID(t);this.contains(e)||(this.set[e]=t)},r.prototype.remove=function(t){delete this.set[n.createID(t)]},r.prototype.clear=function(){this.set={}},r.prototype.contains=function(t){return this.set[n.createID(t)]==t},r.prototype.isEmpty=function(){return 0===this.size()},r.prototype.size=function(){return Object.keys(this.set).length},r.prototype.addAllTo=function(t){for(var e=Object.keys(this.set),i=e.length,n=0;n<i;n++)t.push(this.set[e[n]])},r.prototype.size=function(){return Object.keys(this.set).length},r.prototype.addAll=function(t){for(var e=t.length,i=0;i<e;i++){var n=t[i];this.add(n)}},t.exports=r},function(t,e,i){function n(){}n.multMat=function(t,e){for(var i=[],n=0;n<t.length;n++){i[n]=[];for(var r=0;r<e[0].length;r++){i[n][r]=0;for(var o=0;o<t[0].length;o++)i[n][r]+=t[n][o]*e[o][r]}}return i},n.transpose=function(t){for(var e=[],i=0;i<t[0].length;i++){e[i]=[];for(var n=0;n<t.length;n++)e[i][n]=t[n][i]}return e},n.multCons=function(t,e){for(var i=[],n=0;n<t.length;n++)i[n]=t[n]*e;return i},n.minusOp=function(t,e){for(var i=[],n=0;n<t.length;n++)i[n]=t[n]-e[n];return i},n.dotProduct=function(t,e){for(var i=0,n=0;n<t.length;n++)i+=t[n]*e[n];return i},n.mag=function(t){return Math.sqrt(this.dotProduct(t,t))},n.normalize=function(t){for(var e=[],i=this.mag(t),n=0;n<t.length;n++)e[n]=t[n]/i;return e},n.multGamma=function(t){for(var e=[],i=0,n=0;n<t.length;n++)i+=t[n];i*=-1/t.length;for(var r=0;r<t.length;r++)e[r]=i+t[r];return e},n.multL=function(t,e,i){for(var n=[],r=[],o=[],a=0;a<e[0].length;a++){for(var s=0,h=0;h<e.length;h++)s+=-.5*e[h][a]*t[h];r[a]=s}for(var l=0;l<i.length;l++){for(var d=0,c=0;c<i.length;c++)d+=i[l][c]*r[c];o[l]=d}for(var g=0;g<e.length;g++){for(var u=0,f=0;f<e[0].length;f++)u+=e[g][f]*o[f];n[g]=u}return n},t.exports=n},function(t,e,i){var n=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),r=i(11),o=function(){function t(e,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),null===i&&void 0===i||(this.compareFunction=this._defaultCompareFunction);var n=void 0;n=e instanceof r?e.size():e.length,this._quicksort(e,0,n-1)}return n(t,[{key:"_quicksort",value:function(t,e,i){if(e<i){var n=this._partition(t,e,i);this._quicksort(t,e,n),this._quicksort(t,n+1,i)}}},{key:"_partition",value:function(t,e,i){for(var n=this._get(t,e),r=e,o=i;;){for(;this.compareFunction(n,this._get(t,o));)o--;for(;this.compareFunction(this._get(t,r),n);)r++;if(!(r<o))return o;this._swap(t,r,o),r++,o--}}},{key:"_get",value:function(t,e){return t instanceof r?t.get_object_at(e):t[e]}},{key:"_set",value:function(t,e,i){t instanceof r?t.set_object_at(e,i):t[e]=i}},{key:"_swap",value:function(t,e,i){var n=this._get(t,e);this._set(t,e,this._get(t,i)),this._set(t,i,n)}},{key:"_defaultCompareFunction",value:function(t,e){return e>t}}]),t}();t.exports=o},function(t,e,i){function n(){}n.svd=function(t){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=t.length,this.n=t[0].length;var e=Math.min(this.m,this.n);this.s=function(t){for(var e=[];t-- >0;)e.push(0);return e}(Math.min(this.m+1,this.n)),this.U=function t(e){if(0==e.length)return 0;for(var i=[],n=0;n<e[0];n++)i.push(t(e.slice(1)));return i}([this.m,e]),this.V=function(t){return function t(e){if(0==e.length)return 0;for(var i=[],n=0;n<e[0];n++)i.push(t(e.slice(1)));return i}(t)}([this.n,this.n]);for(var i=function(t){for(var e=[];t-- >0;)e.push(0);return e}(this.n),r=function(t){for(var e=[];t-- >0;)e.push(0);return e}(this.m),o=Math.min(this.m-1,this.n),a=Math.max(0,Math.min(this.n-2,this.m)),s=0;s<Math.max(o,a);s++){if(s<o){this.s[s]=0;for(var h=s;h<this.m;h++)this.s[s]=n.hypot(this.s[s],t[h][s]);if(0!==this.s[s]){t[s][s]<0&&(this.s[s]=-this.s[s]);for(var l=s;l<this.m;l++)t[l][s]/=this.s[s];t[s][s]+=1}this.s[s]=-this.s[s]}for(var d=s+1;d<this.n;d++){if(function(t,e){return t&&e}(s<o,0!==this.s[s])){for(var c=0,g=s;g<this.m;g++)c+=t[g][s]*t[g][d];c=-c/t[s][s];for(var u=s;u<this.m;u++)t[u][d]+=c*t[u][s]}i[d]=t[s][d]}if(function(t,e){return e}(0,s<o))for(var f=s;f<this.m;f++)this.U[f][s]=t[f][s];if(s<a){i[s]=0;for(var p=s+1;p<this.n;p++)i[s]=n.hypot(i[s],i[p]);if(0!==i[s]){i[s+1]<0&&(i[s]=-i[s]);for(var m=s+1;m<this.n;m++)i[m]/=i[s];i[s+1]+=1}if(i[s]=-i[s],function(t,e){return t&&e}(s+1<this.m,0!==i[s])){for(var v=s+1;v<this.m;v++)r[v]=0;for(var y=s+1;y<this.n;y++)for(var E=s+1;E<this.m;E++)r[E]+=i[y]*t[E][y];for(var N=s+1;N<this.n;N++)for(var T=-i[N]/i[s+1],A=s+1;A<this.m;A++)t[A][N]+=T*r[A]}for(var w=s+1;w<this.n;w++)this.V[w][s]=i[w]}}var I=Math.min(this.n,this.m+1);o<this.n&&(this.s[o]=t[o][o]),this.m<I&&(this.s[I-1]=0),a+1<I&&(i[a]=t[a][I-1]),i[I-1]=0;for(var L=o;L<e;L++){for(var C=0;C<this.m;C++)this.U[C][L]=0;this.U[L][L]=1}for(var _=o-1;_>=0;_--)if(0!==this.s[_]){for(var M=_+1;M<e;M++){for(var x=0,O=_;O<this.m;O++)x+=this.U[O][_]*this.U[O][M];x=-x/this.U[_][_];for(var D=_;D<this.m;D++)this.U[D][M]+=x*this.U[D][_]}for(var b=_;b<this.m;b++)this.U[b][_]=-this.U[b][_];this.U[_][_]=1+this.U[_][_];for(var R=0;R<_-1;R++)this.U[R][_]=0}else{for(var F=0;F<this.m;F++)this.U[F][_]=0;this.U[_][_]=1}for(var G=this.n-1;G>=0;G--){if(function(t,e){return t&&e}(G<a,0!==i[G]))for(var S=G+1;S<e;S++){for(var P=0,U=G+1;U<this.n;U++)P+=this.V[U][G]*this.V[U][S];P=-P/this.V[G+1][G];for(var Y=G+1;Y<this.n;Y++)this.V[Y][S]+=P*this.V[Y][G]}for(var k=0;k<this.n;k++)this.V[k][G]=0;this.V[G][G]=1}for(var H=I-1,X=Math.pow(2,-52),z=Math.pow(2,-966);I>0;){var V=void 0,B=void 0;for(V=I-2;V>=-1&&-1!==V;V--)if(Math.abs(i[V])<=z+X*(Math.abs(this.s[V])+Math.abs(this.s[V+1]))){i[V]=0;break}if(V===I-2)B=4;else{var W=void 0;for(W=I-1;W>=V&&W!==V;W--){var j=(W!==I?Math.abs(i[W]):0)+(W!==V+1?Math.abs(i[W-1]):0);if(Math.abs(this.s[W])<=z+X*j){this.s[W]=0;break}}W===V?B=3:W===I-1?B=1:(B=2,V=W)}switch(V++,B){case 1:var $=i[I-2];i[I-2]=0;for(var q=I-2;q>=V;q--){var Z=n.hypot(this.s[q],$),Q=this.s[q]/Z,J=$/Z;this.s[q]=Z,q!==V&&($=-J*i[q-1],i[q-1]=Q*i[q-1]);for(var K=0;K<this.n;K++)Z=Q*this.V[K][q]+J*this.V[K][I-1],this.V[K][I-1]=-J*this.V[K][q]+Q*this.V[K][I-1],this.V[K][q]=Z}break;case 2:var tt=i[V-1];i[V-1]=0;for(var et=V;et<I;et++){var it=n.hypot(this.s[et],tt),nt=this.s[et]/it,rt=tt/it;this.s[et]=it,tt=-rt*i[et],i[et]=nt*i[et];for(var ot=0;ot<this.m;ot++)it=nt*this.U[ot][et]+rt*this.U[ot][V-1],this.U[ot][V-1]=-rt*this.U[ot][et]+nt*this.U[ot][V-1],this.U[ot][et]=it}break;case 3:var at=Math.max(Math.max(Math.max(Math.max(Math.abs(this.s[I-1]),Math.abs(this.s[I-2])),Math.abs(i[I-2])),Math.abs(this.s[V])),Math.abs(i[V])),st=this.s[I-1]/at,ht=this.s[I-2]/at,lt=i[I-2]/at,dt=this.s[V]/at,ct=i[V]/at,gt=((ht+st)*(ht-st)+lt*lt)/2,ut=st*lt*(st*lt),ft=0;(function(t,e){return t||e})(0!==gt,0!==ut)&&(ft=Math.sqrt(gt*gt+ut),gt<0&&(ft=-ft),ft=ut/(gt+ft));for(var pt=(dt+st)*(dt-st)+ft,mt=dt*ct,vt=V;vt<I-1;vt++){var yt=n.hypot(pt,mt),Et=pt/yt,Nt=mt/yt;vt!==V&&(i[vt-1]=yt),pt=Et*this.s[vt]+Nt*i[vt],i[vt]=Et*i[vt]-Nt*this.s[vt],mt=Nt*this.s[vt+1],this.s[vt+1]=Et*this.s[vt+1];for(var Tt=0;Tt<this.n;Tt++)yt=Et*this.V[Tt][vt]+Nt*this.V[Tt][vt+1],this.V[Tt][vt+1]=-Nt*this.V[Tt][vt]+Et*this.V[Tt][vt+1],this.V[Tt][vt]=yt;if(Et=pt/(yt=n.hypot(pt,mt)),Nt=mt/yt,this.s[vt]=yt,pt=Et*i[vt]+Nt*this.s[vt+1],this.s[vt+1]=-Nt*i[vt]+Et*this.s[vt+1],mt=Nt*i[vt+1],i[vt+1]=Et*i[vt+1],vt<this.m-1)for(var At=0;At<this.m;At++)yt=Et*this.U[At][vt]+Nt*this.U[At][vt+1],this.U[At][vt+1]=-Nt*this.U[At][vt]+Et*this.U[At][vt+1],this.U[At][vt]=yt}i[I-2]=pt;break;case 4:if(this.s[V]<=0){this.s[V]=this.s[V]<0?-this.s[V]:0;for(var wt=0;wt<=H;wt++)this.V[wt][V]=-this.V[wt][V]}for(;V<H&&!(this.s[V]>=this.s[V+1]);){var It=this.s[V];if(this.s[V]=this.s[V+1],this.s[V+1]=It,V<this.n-1)for(var Lt=0;Lt<this.n;Lt++)It=this.V[Lt][V+1],this.V[Lt][V+1]=this.V[Lt][V],this.V[Lt][V]=It;if(V<this.m-1)for(var Ct=0;Ct<this.m;Ct++)It=this.U[Ct][V+1],this.U[Ct][V+1]=this.U[Ct][V],this.U[Ct][V]=It;V++}I--}}return{U:this.U,V:this.V,S:this.s}},n.hypot=function(t,e){var i=void 0;return Math.abs(t)>Math.abs(e)?(i=e/t,i=Math.abs(t)*Math.sqrt(1+i*i)):0!=e?(i=t/e,i=Math.abs(e)*Math.sqrt(1+i*i)):i=0,i},t.exports=n},function(t,e,i){var n=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),r=function(){function t(e,i){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.sequence1=e,this.sequence2=i,this.match_score=n,this.mismatch_penalty=r,this.gap_penalty=o,this.iMax=e.length+1,this.jMax=i.length+1,this.grid=new Array(this.iMax);for(var a=0;a<this.iMax;a++){this.grid[a]=new Array(this.jMax);for(var s=0;s<this.jMax;s++)this.grid[a][s]=0}this.tracebackGrid=new Array(this.iMax);for(var h=0;h<this.iMax;h++){this.tracebackGrid[h]=new Array(this.jMax);for(var l=0;l<this.jMax;l++)this.tracebackGrid[h][l]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return n(t,[{key:"getScore",value:function(){return this.score}},{key:"getAlignments",value:function(){return this.alignments}},{key:"computeGrids",value:function(){for(var t=1;t<this.jMax;t++)this.grid[0][t]=this.grid[0][t-1]+this.gap_penalty,this.tracebackGrid[0][t]=[!1,!1,!0];for(var e=1;e<this.iMax;e++)this.grid[e][0]=this.grid[e-1][0]+this.gap_penalty,this.tracebackGrid[e][0]=[!1,!0,!1];for(var i=1;i<this.iMax;i++)for(var n=1;n<this.jMax;n++){var r=[this.sequence1[i-1]===this.sequence2[n-1]?this.grid[i-1][n-1]+this.match_score:this.grid[i-1][n-1]+this.mismatch_penalty,this.grid[i-1][n]+this.gap_penalty,this.grid[i][n-1]+this.gap_penalty],o=this.arrayAllMaxIndexes(r);this.grid[i][n]=r[o[0]],this.tracebackGrid[i][n]=[o.includes(0),o.includes(1),o.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]}},{key:"alignmentTraceback",value:function(){var t=[];for(t.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});t[0];){var e=t[0],i=this.tracebackGrid[e.pos[0]][e.pos[1]];i[0]&&t.push({pos:[e.pos[0]-1,e.pos[1]-1],seq1:this.sequence1[e.pos[0]-1]+e.seq1,seq2:this.sequence2[e.pos[1]-1]+e.seq2}),i[1]&&t.push({pos:[e.pos[0]-1,e.pos[1]],seq1:this.sequence1[e.pos[0]-1]+e.seq1,seq2:"-"+e.seq2}),i[2]&&t.push({pos:[e.pos[0],e.pos[1]-1],seq1:"-"+e.seq1,seq2:this.sequence2[e.pos[1]-1]+e.seq2}),0===e.pos[0]&&0===e.pos[1]&&this.alignments.push({sequence1:e.seq1,sequence2:e.seq2}),t.shift()}return this.alignments}},{key:"getAllIndexes",value:function(t,e){for(var i=[],n=-1;-1!==(n=t.indexOf(e,n+1));)i.push(n);return i}},{key:"arrayAllMaxIndexes",value:function(t){return this.getAllIndexes(t,Math.max.apply(null,t))}}]),t}();t.exports=r},function(t,e,i){var n=function(){};n.FDLayout=i(18),n.FDLayoutConstants=i(4),n.FDLayoutEdge=i(19),n.FDLayoutNode=i(20),n.DimensionD=i(21),n.HashMap=i(22),n.HashSet=i(23),n.IGeometry=i(8),n.IMath=i(9),n.Integer=i(10),n.Point=i(12),n.PointD=i(5),n.RandomSeed=i(16),n.RectangleD=i(13),n.Transform=i(17),n.UniqueIDGeneretor=i(14),n.Quicksort=i(25),n.LinkedList=i(11),n.LGraphObject=i(2),n.LGraph=i(6),n.LEdge=i(1),n.LGraphManager=i(7),n.LNode=i(3),n.Layout=i(15),n.LayoutConstants=i(0),n.NeedlemanWunsch=i(27),n.Matrix=i(24),n.SVD=i(26),t.exports=n},function(t,e,i){function n(){this.listeners=[]}var r=n.prototype;r.addListener=function(t,e){this.listeners.push({event:t,callback:e})},r.removeListener=function(t,e){for(var i=this.listeners.length;i>=0;i--){var n=this.listeners[i];n.event===t&&n.callback===e&&this.listeners.splice(i,1)}},r.emit=function(t,e){for(var i=0;i<this.listeners.length;i++){var n=this.listeners[i];t===n.event&&n.callback(e)}},t.exports=n}])},O.exports=t());var t}var b;function R(){return b?x.exports:(b=1,t=function(t){return e={45:(t,e,i)=>{var n={};n.layoutBase=i(551),n.CoSEConstants=i(806),n.CoSEEdge=i(767),n.CoSEGraph=i(880),n.CoSEGraphManager=i(578),n.CoSELayout=i(765),n.CoSENode=i(991),n.ConstraintHandler=i(902),t.exports=n},806:(t,e,i)=>{var n=i(551).FDLayoutConstants;function r(){}for(var o in n)r[o]=n[o];r.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,r.DEFAULT_RADIAL_SEPARATION=n.DEFAULT_EDGE_LENGTH,r.DEFAULT_COMPONENT_SEPERATION=60,r.TILE=!0,r.TILING_PADDING_VERTICAL=10,r.TILING_PADDING_HORIZONTAL=10,r.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,r.ENFORCE_CONSTRAINTS=!0,r.APPLY_LAYOUT=!0,r.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,r.TREE_REDUCTION_ON_INCREMENTAL=!0,r.PURE_INCREMENTAL=r.DEFAULT_INCREMENTAL,t.exports=r},767:(t,e,i)=>{var n=i(551).FDLayoutEdge;function r(t,e,i){n.call(this,t,e,i)}for(var o in r.prototype=Object.create(n.prototype),n)r[o]=n[o];t.exports=r},880:(t,e,i)=>{var n=i(551).LGraph;function r(t,e,i){n.call(this,t,e,i)}for(var o in r.prototype=Object.create(n.prototype),n)r[o]=n[o];t.exports=r},578:(t,e,i)=>{var n=i(551).LGraphManager;function r(t){n.call(this,t)}for(var o in r.prototype=Object.create(n.prototype),n)r[o]=n[o];t.exports=r},765:(t,e,i)=>{var n=i(551).FDLayout,r=i(578),o=i(880),a=i(991),s=i(767),h=i(806),l=i(902),d=i(551).FDLayoutConstants,c=i(551).LayoutConstants,g=i(551).Point,u=i(551).PointD,f=i(551).DimensionD,p=i(551).Layout,m=i(551).Integer,v=i(551).IGeometry,y=i(551).LGraph,E=i(551).Transform,N=i(551).LinkedList;function T(){n.call(this),this.toBeTiled={},this.constraints={}}for(var A in T.prototype=Object.create(n.prototype),n)T[A]=n[A];T.prototype.newGraphManager=function(){var t=new r(this);return this.graphManager=t,t},T.prototype.newGraph=function(t){return new o(null,this.graphManager,t)},T.prototype.newNode=function(t){return new a(this.graphManager,t)},T.prototype.newEdge=function(t){return new s(null,null,t)},T.prototype.initParameters=function(){n.prototype.initParameters.call(this,arguments),this.isSubLayout||(h.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=h.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=h.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=d.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=d.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=d.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=d.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},T.prototype.initSpringEmbedder=function(){n.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/d.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},T.prototype.layout=function(){return c.DEFAULT_CREATE_BENDS_AS_NEEDED&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},T.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental)h.TREE_REDUCTION_ON_INCREMENTAL&&(this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation(),e=new Set(this.getAllNodes()),i=this.nodesWithGravity.filter(function(t){return e.has(t)}),this.graphManager.setAllNodesToApplyGravitation(i));else{var t=this.getFlatForest();if(t.length>0)this.positionNodesRadially(t);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var e=new Set(this.getAllNodes()),i=this.nodesWithGravity.filter(function(t){return e.has(t)});this.graphManager.setAllNodesToApplyGravitation(i),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(l.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),h.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},T.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished){if(!(this.prunedNodesAll.length>0))return!0;this.isTreeGrowing=!0}if(this.totalIterations%d.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged()){if(!(this.prunedNodesAll.length>0))return!0;this.isTreeGrowing=!0}this.coolingCycle++,0==this.layoutQuality?this.coolingAdjuster=this.coolingCycle:1==this.layoutQuality&&(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 t=new Set(this.getAllNodes()),e=this.nodesWithGravity.filter(function(e){return t.has(e)});this.graphManager.setAllNodesToApplyGravitation(e),this.graphManager.updateBounds(),this.updateGrid(),h.PURE_INCREMENTAL?this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL/2: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()),h.PURE_INCREMENTAL?this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var i=!this.isTreeGrowing&&!this.isGrowthFinished,n=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(i,n),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},T.prototype.getPositionsData=function(){for(var t=this.graphManager.getAllNodes(),e={},i=0;i<t.length;i++){var n=t[i].rect,r=t[i].id;e[r]={id:r,x:n.getCenterX(),y:n.getCenterY(),w:n.width,h:n.height}}return e},T.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var t=!1;if("during"===d.ANIMATE)this.emit("layoutstarted");else{for(;!t;)t=this.tick();this.graphManager.updateBounds()}},T.prototype.moveNodes=function(){for(var t=this.getAllNodes(),e=0;e<t.length;e++)t[e].calculateDisplacement();for(Object.keys(this.constraints).length>0&&this.updateDisplacements(),e=0;e<t.length;e++)t[e].move()},T.prototype.initConstraintVariables=function(){var t=this;this.idToNodeMap=new Map,this.fixedNodeSet=new Set;for(var e=this.graphManager.getAllNodes(),i=0;i<e.length;i++){var n=e[i];this.idToNodeMap.set(n.id,n)}var r=function e(i){for(var n,r=i.getChild().getNodes(),o=0,a=0;a<r.length;a++)null==(n=r[a]).getChild()?t.fixedNodeSet.has(n.id)&&(o+=100):o+=e(n);return o};if(this.constraints.fixedNodeConstraint)for(this.constraints.fixedNodeConstraint.forEach(function(e){t.fixedNodeSet.add(e.nodeId)}),e=this.graphManager.getAllNodes(),i=0;i<e.length;i++)if(null!=(n=e[i]).getChild()){var o=r(n);o>0&&(n.fixedNodeWeight=o)}if(this.constraints.relativePlacementConstraint){var a=new Map,s=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(e){t.fixedNodesOnHorizontal.add(e),t.fixedNodesOnVertical.add(e)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical){var l=this.constraints.alignmentConstraint.vertical;for(i=0;i<l.length;i++)this.dummyToNodeForVerticalAlignment.set("dummy"+i,[]),l[i].forEach(function(e){a.set(e,"dummy"+i),t.dummyToNodeForVerticalAlignment.get("dummy"+i).push(e),t.fixedNodeSet.has(e)&&t.fixedNodesOnHorizontal.add("dummy"+i)})}if(this.constraints.alignmentConstraint.horizontal){var d=this.constraints.alignmentConstraint.horizontal;for(i=0;i<d.length;i++)this.dummyToNodeForHorizontalAlignment.set("dummy"+i,[]),d[i].forEach(function(e){s.set(e,"dummy"+i),t.dummyToNodeForHorizontalAlignment.get("dummy"+i).push(e),t.fixedNodeSet.has(e)&&t.fixedNodesOnVertical.add("dummy"+i)})}}if(h.RELAX_MOVEMENT_ON_CONSTRAINTS)this.shuffle=function(t){var e,i,n;for(n=t.length-1;n>=2*t.length/3;n--)e=Math.floor(Math.random()*(n+1)),i=t[n],t[n]=t[e],t[e]=i;return t},this.nodesInRelativeHorizontal=[],this.nodesInRelativeVertical=[],this.nodeToRelativeConstraintMapHorizontal=new Map,this.nodeToRelativeConstraintMapVertical=new Map,this.nodeToTempPositionMapHorizontal=new Map,this.nodeToTempPositionMapVertical=new Map,this.constraints.relativePlacementConstraint.forEach(function(e){if(e.left){var i=a.has(e.left)?a.get(e.left):e.left,n=a.has(e.right)?a.get(e.right):e.right;t.nodesInRelativeHorizontal.includes(i)||(t.nodesInRelativeHorizontal.push(i),t.nodeToRelativeConstraintMapHorizontal.set(i,[]),t.dummyToNodeForVerticalAlignment.has(i)?t.nodeToTempPositionMapHorizontal.set(i,t.idToNodeMap.get(t.dummyToNodeForVerticalAlignment.get(i)[0]).getCenterX()):t.nodeToTempPositionMapHorizontal.set(i,t.idToNodeMap.get(i).getCenterX())),t.nodesInRelativeHorizontal.includes(n)||(t.nodesInRelativeHorizontal.push(n),t.nodeToRelativeConstraintMapHorizontal.set(n,[]),t.dummyToNodeForVerticalAlignment.has(n)?t.nodeToTempPositionMapHorizontal.set(n,t.idToNodeMap.get(t.dummyToNodeForVerticalAlignment.get(n)[0]).getCenterX()):t.nodeToTempPositionMapHorizontal.set(n,t.idToNodeMap.get(n).getCenterX())),t.nodeToRelativeConstraintMapHorizontal.get(i).push({right:n,gap:e.gap}),t.nodeToRelativeConstraintMapHorizontal.get(n).push({left:i,gap:e.gap})}else{var r=s.has(e.top)?s.get(e.top):e.top,o=s.has(e.bottom)?s.get(e.bottom):e.bottom;t.nodesInRelativeVertical.includes(r)||(t.nodesInRelativeVertical.push(r),t.nodeToRelativeConstraintMapVertical.set(r,[]),t.dummyToNodeForHorizontalAlignment.has(r)?t.nodeToTempPositionMapVertical.set(r,t.idToNodeMap.get(t.dummyToNodeForHorizontalAlignment.get(r)[0]).getCenterY()):t.nodeToTempPositionMapVertical.set(r,t.idToNodeMap.get(r).getCenterY())),t.nodesInRelativeVertical.includes(o)||(t.nodesInRelativeVertical.push(o),t.nodeToRelativeConstraintMapVertical.set(o,[]),t.dummyToNodeForHorizontalAlignment.has(o)?t.nodeToTempPositionMapVertical.set(o,t.idToNodeMap.get(t.dummyToNodeForHorizontalAlignment.get(o)[0]).getCenterY()):t.nodeToTempPositionMapVertical.set(o,t.idToNodeMap.get(o).getCenterY())),t.nodeToRelativeConstraintMapVertical.get(r).push({bottom:o,gap:e.gap}),t.nodeToRelativeConstraintMapVertical.get(o).push({top:r,gap:e.gap})}});else{var c=new Map,g=new Map;this.constraints.relativePlacementConstraint.forEach(function(t){if(t.left){var e=a.has(t.left)?a.get(t.left):t.left,i=a.has(t.right)?a.get(t.right):t.right;c.has(e)?c.get(e).push(i):c.set(e,[i]),c.has(i)?c.get(i).push(e):c.set(i,[e])}else{var n=s.has(t.top)?s.get(t.top):t.top,r=s.has(t.bottom)?s.get(t.bottom):t.bottom;g.has(n)?g.get(n).push(r):g.set(n,[r]),g.has(r)?g.get(r).push(n):g.set(r,[n])}});var u=function(t,e){var i=[],n=[],r=new N,o=new Set,a=0;return t.forEach(function(s,h){if(!o.has(h)){i[a]=[],n[a]=!1;var l=h;for(r.push(l),o.add(l),i[a].push(l);0!=r.length;)l=r.shift(),e.has(l)&&(n[a]=!0),t.get(l).forEach(function(t){o.has(t)||(r.push(t),o.add(t),i[a].push(t))});a++}}),{components:i,isFixed:n}},f=u(c,t.fixedNodesOnHorizontal);this.componentsOnHorizontal=f.components,this.fixedComponentsOnHorizontal=f.isFixed;var p=u(g,t.fixedNodesOnVertical);this.componentsOnVertical=p.components,this.fixedComponentsOnVertical=p.isFixed}}},T.prototype.updateDisplacements=function(){var t=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function(e){var i=t.idToNodeMap.get(e.nodeId);i.displacementX=0,i.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var e=this.constraints.alignmentConstraint.vertical,i=0;i<e.length;i++){for(var n=0,r=0;r<e[i].length;r++){if(this.fixedNodeSet.has(e[i][r])){n=0;break}n+=this.idToNodeMap.get(e[i][r]).displacementX}var o=n/e[i].length;for(r=0;r<e[i].length;r++)this.idToNodeMap.get(e[i][r]).displacementX=o}if(this.constraints.alignmentConstraint.horizontal){var a=this.constraints.alignmentConstraint.horizontal;for(i=0;i<a.length;i++){var s=0;for(r=0;r<a[i].length;r++){if(this.fixedNodeSet.has(a[i][r])){s=0;break}s+=this.idToNodeMap.get(a[i][r]).displacementY}var l=s/a[i].length;for(r=0;r<a[i].length;r++)this.idToNodeMap.get(a[i][r]).displacementY=l}}}if(this.constraints.relativePlacementConstraint)if(h.RELAX_MOVEMENT_ON_CONSTRAINTS)this.totalIterations%10==0&&(this.shuffle(this.nodesInRelativeHorizontal),this.shuffle(this.nodesInRelativeVertical)),this.nodesInRelativeHorizontal.forEach(function(e){if(!t.fixedNodesOnHorizontal.has(e)){var i=0;i=t.dummyToNodeForVerticalAlignment.has(e)?t.idToNodeMap.get(t.dummyToNodeForVerticalAlignment.get(e)[0]).displacementX:t.idToNodeMap.get(e).displacementX,t.nodeToRelativeConstraintMapHorizontal.get(e).forEach(function(n){var r;n.right?(r=t.nodeToTempPositionMapHorizontal.get(n.right)-t.nodeToTempPositionMapHorizontal.get(e)-i)<n.gap&&(i-=n.gap-r):(r=t.nodeToTempPositionMapHorizontal.get(e)-t.nodeToTempPositionMapHorizontal.get(n.left)+i)<n.gap&&(i+=n.gap-r)}),t.nodeToTempPositionMapHorizontal.set(e,t.nodeToTempPositionMapHorizontal.get(e)+i),t.dummyToNodeForVerticalAlignment.has(e)?t.dummyToNodeForVerticalAlignment.get(e).forEach(function(e){t.idToNodeMap.get(e).displacementX=i}):t.idToNodeMap.get(e).displacementX=i}}),this.nodesInRelativeVertical.forEach(function(e){if(!t.fixedNodesOnHorizontal.has(e)){var i=0;i=t.dummyToNodeForHorizontalAlignment.has(e)?t.idToNodeMap.get(t.dummyToNodeForHorizontalAlignment.get(e)[0]).displacementY:t.idToNodeMap.get(e).displacementY,t.nodeToRelativeConstraintMapVertical.get(e).forEach(function(n){var r;n.bottom?(r=t.nodeToTempPositionMapVertical.get(n.bottom)-t.nodeToTempPositionMapVertical.get(e)-i)<n.gap&&(i-=n.gap-r):(r=t.nodeToTempPositionMapVertical.get(e)-t.nodeToTempPositionMapVertical.get(n.top)+i)<n.gap&&(i+=n.gap-r)}),t.nodeToTempPositionMapVertical.set(e,t.nodeToTempPositionMapVertical.get(e)+i),t.dummyToNodeForHorizontalAlignment.has(e)?t.dummyToNodeForHorizontalAlignment.get(e).forEach(function(e){t.idToNodeMap.get(e).displacementY=i}):t.idToNodeMap.get(e).displacementY=i}});else{for(i=0;i<this.componentsOnHorizontal.length;i++){var d=this.componentsOnHorizontal[i];if(this.fixedComponentsOnHorizontal[i])for(r=0;r<d.length;r++)this.dummyToNodeForVerticalAlignment.has(d[r])?this.dummyToNodeForVerticalAlignment.get(d[r]).forEach(function(e){t.idToNodeMap.get(e).displacementX=0}):this.idToNodeMap.get(d[r]).displacementX=0;else{var c=0,g=0;for(r=0;r<d.length;r++)this.dummyToNodeForVerticalAlignment.has(d[r])?(c+=(f=this.dummyToNodeForVerticalAlignment.get(d[r])).length*this.idToNodeMap.get(f[0]).displacementX,g+=f.length):(c+=this.idToNodeMap.get(d[r]).displacementX,g++);var u=c/g;for(r=0;r<d.length;r++)this.dummyToNodeForVerticalAlignment.has(d[r])?this.dummyToNodeForVerticalAlignment.get(d[r]).forEach(function(e){t.idToNodeMap.get(e).displacementX=u}):this.idToNodeMap.get(d[r]).displacementX=u}}for(i=0;i<this.componentsOnVertical.length;i++)if(d=this.componentsOnVertical[i],this.fixedComponentsOnVertical[i])for(r=0;r<d.length;r++)this.dummyToNodeForHorizontalAlignment.has(d[r])?this.dummyToNodeForHorizontalAlignment.get(d[r]).forEach(function(e){t.idToNodeMap.get(e).displacementY=0}):this.idToNodeMap.get(d[r]).displacementY=0;else{for(c=0,g=0,r=0;r<d.length;r++){var f;this.dummyToNodeForHorizontalAlignment.has(d[r])?(c+=(f=this.dummyToNodeForHorizontalAlignment.get(d[r])).length*this.idToNodeMap.get(f[0]).displacementY,g+=f.length):(c+=this.idToNodeMap.get(d[r]).displacementY,g++)}for(u=c/g,r=0;r<d.length;r++)this.dummyToNodeForHorizontalAlignment.has(d[r])?this.dummyToNodeForHorizontalAlignment.get(d[r]).forEach(function(e){t.idToNodeMap.get(e).displacementY=u}):this.idToNodeMap.get(d[r]).displacementY=u}}},T.prototype.calculateNodesToApplyGravitationTo=function(){var t,e,i=[],n=this.graphManager.getGraphs(),r=n.length;for(e=0;e<r;e++)(t=n[e]).updateConnected(),t.isConnected||(i=i.concat(t.getNodes()));return i},T.prototype.createBendpoints=function(){var t=[];t=t.concat(this.graphManager.getAllEdges());var e,i=new Set;for(e=0;e<t.length;e++){var n=t[e];if(!i.has(n)){var r=n.getSource(),o=n.getTarget();if(r==o)n.getBendpoints().push(new u),n.getBendpoints().push(new u),this.createDummyNodesForBendpoints(n),i.add(n);else{var a=[];if(a=(a=a.concat(r.getEdgeListToNode(o))).concat(o.getEdgeListToNode(r)),!i.has(a[0])){var s;if(a.length>1)for(s=0;s<a.length;s++){var h=a[s];h.getBendpoints().push(new u),this.createDummyNodesForBendpoints(h)}a.forEach(function(t){i.add(t)})}}}if(i.size==t.length)break}},T.prototype.positionNodesRadially=function(t){for(var e=new g(0,0),i=Math.ceil(Math.sqrt(t.length)),n=0,r=0,o=0,a=new u(0,0),s=0;s<t.length;s++){s%i==0&&(o=0,r=n,0!=s&&(r+=h.DEFAULT_COMPONENT_SEPERATION),n=0);var l=t[s],d=p.findCenterOfTree(l);e.x=o,e.y=r,(a=T.radialLayout(l,d,e)).y>n&&(n=Math.floor(a.y)),o=Math.floor(a.x+h.DEFAULT_COMPONENT_SEPERATION)}this.transform(new u(c.WORLD_CENTER_X-a.x/2,c.WORLD_CENTER_Y-a.y/2))},T.radialLayout=function(t,e,i){var n=Math.max(this.maxDiagonalInTree(t),h.DEFAULT_RADIAL_SEPARATION);T.branchRadialLayout(e,null,0,359,0,n);var r=y.calculateBounds(t),o=new E;o.setDeviceOrgX(r.getMinX()),o.setDeviceOrgY(r.getMinY()),o.setWorldOrgX(i.x),o.setWorldOrgY(i.y);for(var a=0;a<t.length;a++)t[a].transform(o);var s=new u(r.getMaxX(),r.getMaxY());return o.inverseTransformPoint(s)},T.branchRadialLayout=function(t,e,i,n,r,o){var a=(n-i+1)/2;a<0&&(a+=180);var s=(a+i)%360*v.TWO_PI/360,h=r*Math.cos(s),l=r*Math.sin(s);t.setCenter(h,l);var d=[],c=(d=d.concat(t.getEdges())).length;null!=e&&c--;for(var g,u=0,f=d.length,p=t.getEdgesBetween(e);p.length>1;){var m=p[0];p.splice(0,1);var y=d.indexOf(m);y>=0&&d.splice(y,1),f--,c--}g=null!=e?(d.indexOf(p[0])+1)%f:0;for(var E=Math.abs(n-i)/c,N=g;u!=c;N=++N%f){var A=d[N].getOtherEnd(t);if(A!=e){var w=(i+u*E)%360,I=(w+E)%360;T.branchRadialLayout(A,t,w,I,r+o,o),u++}}},T.maxDiagonalInTree=function(t){for(var e=m.MIN_VALUE,i=0;i<t.length;i++){var n=t[i].getDiagonal();n>e&&(e=n)}return e},T.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},T.prototype.groupZeroDegreeMembers=function(){var t=this,e={};this.memberGroups={},this.idToDummyNode={};for(var i=[],n=this.graphManager.getAllNodes(),r=0;r<n.length;r++){var o=(s=n[r]).getParent();0!==this.getNodeDegreeWithChildren(s)||null!=o.id&&this.getToBeTiled(o)||i.push(s)}for(r=0;r<i.length;r++){var s,h=(s=i[r]).getParent().id;void 0===e[h]&&(e[h]=[]),e[h]=e[h].concat(s)}Object.keys(e).forEach(function(i){if(e[i].length>1){var n="DummyCompound_"+i;t.memberGroups[n]=e[i];var r=e[i][0].getParent(),o=new a(t.graphManager);o.id=n,o.paddingLeft=r.paddingLeft||0,o.paddingRight=r.paddingRight||0,o.paddingBottom=r.paddingBottom||0,o.paddingTop=r.paddingTop||0,t.idToDummyNode[n]=o;var s=t.getGraphManager().add(t.newGraph(),o),h=r.getChild();h.add(o);for(var l=0;l<e[i].length;l++){var d=e[i][l];h.remove(d),s.add(d)}}})},T.prototype.clearCompounds=function(){var t={},e={};this.performDFSOnCompounds();for(var i=0;i<this.compoundOrder.length;i++)e[this.compoundOrder[i].id]=this.compoundOrder[i],t[this.compoundOrder[i].id]=[].concat(this.compoundOrder[i].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[i].getChild()),this.compoundOrder[i].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(t,e)},T.prototype.clearZeroDegreeMembers=function(){var t=this,e=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(i){var n=t.idToDummyNode[i];if(e[i]=t.tileNodes(t.memberGroups[i],n.paddingLeft+n.paddingRight),n.rect.width=e[i].width,n.rect.height=e[i].height,n.setCenter(e[i].centerX,e[i].centerY),n.labelMarginLeft=0,n.labelMarginTop=0,h.NODE_DIMENSIONS_INCLUDE_LABELS){var r=n.rect.width,o=n.rect.height;n.labelWidth&&("left"==n.labelPosHorizontal?(n.rect.x-=n.labelWidth,n.setWidth(r+n.labelWidth),n.labelMarginLeft=n.labelWidth):"center"==n.labelPosHorizontal&&n.labelWidth>r?(n.rect.x-=(n.labelWidth-r)/2,n.setWidth(n.labelWidth),n.labelMarginLeft=(n.labelWidth-r)/2):"right"==n.labelPosHorizontal&&n.setWidth(r+n.labelWidth)),n.labelHeight&&("top"==n.labelPosVertical?(n.rect.y-=n.labelHeight,n.setHeight(o+n.labelHeight),n.labelMarginTop=n.labelHeight):"center"==n.labelPosVertical&&n.labelHeight>o?(n.rect.y-=(n.labelHeight-o)/2,n.setHeight(n.labelHeight),n.labelMarginTop=(n.labelHeight-o)/2):"bottom"==n.labelPosVertical&&n.setHeight(o+n.labelHeight))}})},T.prototype.repopulateCompounds=function(){for(var t=this.compoundOrder.length-1;t>=0;t--){var e=this.compoundOrder[t],i=e.id,n=e.paddingLeft,r=e.paddingTop,o=e.labelMarginLeft,a=e.labelMarginTop;this.adjustLocations(this.tiledMemberPack[i],e.rect.x,e.rect.y,n,r,o,a)}},T.prototype.repopulateZeroDegreeMembers=function(){var t=this,e=this.tiledZeroDegreePack;Object.keys(e).forEach(function(i){var n=t.idToDummyNode[i],r=n.paddingLeft,o=n.paddingTop,a=n.labelMarginLeft,s=n.labelMarginTop;t.adjustLocations(e[i],n.rect.x,n.rect.y,r,o,a,s)})},T.prototype.getToBeTiled=function(t){var e=t.id;if(null!=this.toBeTiled[e])return this.toBeTiled[e];var i=t.getChild();if(null==i)return this.toBeTiled[e]=!1,!1;for(var n=i.getNodes(),r=0;r<n.length;r++){var o=n[r];if(this.getNodeDegree(o)>0)return this.toBeTiled[e]=!1,!1;if(null!=o.getChild()){if(!this.getToBeTiled(o))return this.toBeTiled[e]=!1,!1}else this.toBeTiled[o.id]=!1}return this.toBeTiled[e]=!0,!0},T.prototype.getNodeDegree=function(t){t.id;for(var e=t.getEdges(),i=0,n=0;n<e.length;n++){var r=e[n];r.getSource().id!==r.getTarget().id&&(i+=1)}return i},T.prototype.getNodeDegreeWithChildren=function(t){var e=this.getNodeDegree(t);if(null==t.getChild())return e;for(var i=t.getChild().getNodes(),n=0;n<i.length;n++){var r=i[n];e+=this.getNodeDegreeWithChildren(r)}return e},T.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},T.prototype.fillCompexOrderByDFS=function(t){for(var e=0;e<t.length;e++){var i=t[e];null!=i.getChild()&&this.fillCompexOrderByDFS(i.getChild().getNodes()),this.getToBeTiled(i)&&this.compoundOrder.push(i)}},T.prototype.adjustLocations=function(t,e,i,n,r,o,a){i+=r+a;for(var s=e+=n+o,h=0;h<t.rows.length;h++){var l=t.rows[h];e=s;for(var d=0,c=0;c<l.length;c++){var g=l[c];g.rect.x=e,g.rect.y=i,e+=g.rect.width+t.horizontalPadding,g.rect.height>d&&(d=g.rect.height)}i+=d+t.verticalPadding}},T.prototype.tileCompoundMembers=function(t,e){var i=this;this.tiledMemberPack=[],Object.keys(t).forEach(function(n){var r=e[n];if(i.tiledMemberPack[n]=i.tileNodes(t[n],r.paddingLeft+r.paddingRight),r.rect.width=i.tiledMemberPack[n].width,r.rect.height=i.tiledMemberPack[n].height,r.setCenter(i.tiledMemberPack[n].centerX,i.tiledMemberPack[n].centerY),r.labelMarginLeft=0,r.labelMarginTop=0,h.NODE_DIMENSIONS_INCLUDE_LABELS){var o=r.rect.width,a=r.rect.height;r.labelWidth&&("left"==r.labelPosHorizontal?(r.rect.x-=r.labelWidth,r.setWidth(o+r.labelWidth),r.labelMarginLeft=r.labelWidth):"center"==r.labelPosHorizontal&&r.labelWidth>o?(r.rect.x-=(r.labelWidth-o)/2,r.setWidth(r.labelWidth),r.labelMarginLeft=(r.labelWidth-o)/2):"right"==r.labelPosHorizontal&&r.setWidth(o+r.labelWidth)),r.labelHeight&&("top"==r.labelPosVertical?(r.rect.y-=r.labelHeight,r.setHeight(a+r.labelHeight),r.labelMarginTop=r.labelHeight):"center"==r.labelPosVertical&&r.labelHeight>a?(r.rect.y-=(r.labelHeight-a)/2,r.setHeight(r.labelHeight),r.labelMarginTop=(r.labelHeight-a)/2):"bottom"==r.labelPosVertical&&r.setHeight(a+r.labelHeight))}})},T.prototype.tileNodes=function(t,e){var i=this.tileNodesByFavoringDim(t,e,!0),n=this.tileNodesByFavoringDim(t,e,!1),r=this.getOrgRatio(i);return this.getOrgRatio(n)<r?n:i},T.prototype.getOrgRatio=function(t){var e=t.width/t.height;return e<1&&(e=1/e),e},T.prototype.calcIdealRowWidth=function(t,e){var i=h.TILING_PADDING_VERTICAL,n=h.TILING_PADDING_HORIZONTAL,r=t.length,o=0,a=0,s=0;t.forEach(function(t){o+=t.getWidth(),a+=t.getHeight(),t.getWidth()>s&&(s=t.getWidth())});var l,d=o/r,c=a/r,g=Math.pow(i-n,2)+4*(d+n)*(c+i)*r,u=(n-i+Math.sqrt(g))/(2*(d+n));e?(l=Math.ceil(u))==u&&l++:l=Math.floor(u);var f=l*(d+n)-n;return s>f&&(f=s),f+=2*n},T.prototype.tileNodesByFavoringDim=function(t,e,i){var n=h.TILING_PADDING_VERTICAL,r=h.TILING_PADDING_HORIZONTAL,o=h.TILING_COMPARE_BY,a={rows:[],rowWidth:[],rowHeight:[],width:0,height:e,verticalPadding:n,horizontalPadding:r,centerX:0,centerY:0};o&&(a.idealRowWidth=this.calcIdealRowWidth(t,i));var s=function(t){return t.rect.width*t.rect.height},l=function(t,e){return s(e)-s(t)};t.sort(function(t,e){var i=l;return a.idealRowWidth?(i=o)(t.id,e.id):i(t,e)});for(var d=0,c=0,g=0;g<t.length;g++)d+=(u=t[g]).getCenterX(),c+=u.getCenterY();for(a.centerX=d/t.length,a.centerY=c/t.length,g=0;g<t.length;g++){var u=t[g];if(0==a.rows.length)this.insertNodeToRow(a,u,0,e);else if(this.canAddHorizontal(a,u.rect.width,u.rect.height)){var f=a.rows.length-1;a.idealRowWidth||(f=this.getShortestRowIndex(a)),this.insertNodeToRow(a,u,f,e)}else this.insertNodeToRow(a,u,a.rows.length,e);this.shiftToLastRow(a)}return a},T.prototype.insertNodeToRow=function(t,e,i,n){var r=n;i==t.rows.length&&(t.rows.push([]),t.rowWidth.push(r),t.rowHeight.push(0));var o=t.rowWidth[i]+e.rect.width;t.rows[i].length>0&&(o+=t.horizontalPadding),t.rowWidth[i]=o,t.width<o&&(t.width=o);var a=e.rect.height;i>0&&(a+=t.verticalPadding);var s=0;a>t.rowHeight[i]&&(s=t.rowHeight[i],t.rowHeight[i]=a,s=t.rowHeight[i]-s),t.height+=s,t.rows[i].push(e)},T.prototype.getShortestRowIndex=function(t){for(var e=-1,i=Number.MAX_VALUE,n=0;n<t.rows.length;n++)t.rowWidth[n]<i&&(e=n,i=t.rowWidth[n]);return e},T.prototype.getLongestRowIndex=function(t){for(var e=-1,i=Number.MIN_VALUE,n=0;n<t.rows.length;n++)t.rowWidth[n]>i&&(e=n,i=t.rowWidth[n]);return e},T.prototype.canAddHorizontal=function(t,e,i){if(t.idealRowWidth){var n=t.rows.length-1;return t.rowWidth[n]+e+t.horizontalPadding<=t.idealRowWidth}var r=this.getShortestRowIndex(t);if(r<0)return!0;var o=t.rowWidth[r];if(o+t.horizontalPadding+e<=t.width)return!0;var a,s,h=0;return t.rowHeight[r]<i&&r>0&&(h=i+t.verticalPadding-t.rowHeight[r]),a=t.width-o>=e+t.horizontalPadding?(t.height+h)/(o+e+t.horizontalPadding):(t.height+h)/t.width,h=i+t.verticalPadding,(s=t.width<e?(t.height+h)/e:(t.height+h)/t.width)<1&&(s=1/s),a<1&&(a=1/a),a<s},T.prototype.shiftToLastRow=function(t){var e=this.getLongestRowIndex(t),i=t.rowWidth.length-1,n=t.rows[e],r=n[n.length-1],o=r.width+t.horizontalPadding;if(t.width-t.rowWidth[i]>o&&e!=i){n.splice(-1,1),t.rows[i].push(r),t.rowWidth[e]=t.rowWidth[e]-o,t.rowWidth[i]=t.rowWidth[i]+o,t.width=t.rowWidth[instance.getLongestRowIndex(t)];for(var a=Number.MIN_VALUE,s=0;s<n.length;s++)n[s].height>a&&(a=n[s].height);e>0&&(a+=t.verticalPadding);var h=t.rowHeight[e]+t.rowHeight[i];t.rowHeight[e]=a,t.rowHeight[i]<r.height+t.verticalPadding&&(t.rowHeight[i]=r.height+t.verticalPadding);var l=t.rowHeight[e]+t.rowHeight[i];t.height+=l-h,this.shiftToLastRow(t)}},T.prototype.tilingPreLayout=function(){h.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},T.prototype.tilingPostLayout=function(){h.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},T.prototype.reduceTrees=function(){for(var t,e=[],i=!0;i;){var n=this.graphManager.getAllNodes(),r=[];i=!1;for(var o=0;o<n.length;o++)if(1==(t=n[o]).getEdges().length&&!t.getEdges()[0].isInterGraph&&null==t.getChild()){if(h.PURE_INCREMENTAL){var a=t.getEdges()[0].getOtherEnd(t),s=new f(t.getCenterX()-a.getCenterX(),t.getCenterY()-a.getCenterY());r.push([t,t.getEdges()[0],t.getOwner(),s])}else r.push([t,t.getEdges()[0],t.getOwner()]);i=!0}if(1==i){for(var l=[],d=0;d<r.length;d++)1==r[d][0].getEdges().length&&(l.push(r[d]),r[d][0].getOwner().remove(r[d][0]));e.push(l),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=e},T.prototype.growTree=function(t){for(var e,i=t[t.length-1],n=0;n<i.length;n++)e=i[n],this.findPlaceforPrunedNode(e),e[2].add(e[0]),e[2].add(e[1],e[1].source,e[1].target);t.splice(t.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},T.prototype.findPlaceforPrunedNode=function(t){var e,i,n=t[0];if(i=n==t[1].source?t[1].target:t[1].source,h.PURE_INCREMENTAL)n.setCenter(i.getCenterX()+t[3].getWidth(),i.getCenterY()+t[3].getHeight());else{var r=i.startX,o=i.finishX,a=i.startY,s=i.finishY,l=[0,0,0,0];if(a>0)for(var c=r;c<=o;c++)l[0]+=this.grid[c][a-1].length+this.grid[c][a].length-1;if(o<this.grid.length-1)for(c=a;c<=s;c++)l[1]+=this.grid[o+1][c].length+this.grid[o][c].length-1;if(s<this.grid[0].length-1)for(c=r;c<=o;c++)l[2]+=this.grid[c][s+1].length+this.grid[c][s].length-1;if(r>0)for(c=a;c<=s;c++)l[3]+=this.grid[r-1][c].length+this.grid[r][c].length-1;for(var g,u,f=m.MAX_VALUE,p=0;p<l.length;p++)l[p]<f?(f=l[p],g=1,u=p):l[p]==f&&g++;if(3==g&&0==f)0==l[0]&&0==l[1]&&0==l[2]?e=1:0==l[0]&&0==l[1]&&0==l[3]?e=0:0==l[0]&&0==l[2]&&0==l[3]?e=3:0==l[1]&&0==l[2]&&0==l[3]&&(e=2);else if(2==g&&0==f){var v=Math.floor(2*Math.random());e=0==l[0]&&0==l[1]?0==v?0:1:0==l[0]&&0==l[2]?0==v?0:2:0==l[0]&&0==l[3]?0==v?0:3:0==l[1]&&0==l[2]?0==v?1:2:0==l[1]&&0==l[3]?0==v?1:3:0==v?2:3}else e=4==g&&0==f?v=Math.floor(4*Math.random()):u;0==e?n.setCenter(i.getCenterX(),i.getCenterY()-i.getHeight()/2-d.DEFAULT_EDGE_LENGTH-n.getHeight()/2):1==e?n.setCenter(i.getCenterX()+i.getWidth()/2+d.DEFAULT_EDGE_LENGTH+n.getWidth()/2,i.getCenterY()):2==e?n.setCenter(i.getCenterX(),i.getCenterY()+i.getHeight()/2+d.DEFAULT_EDGE_LENGTH+n.getHeight()/2):n.setCenter(i.getCenterX()-i.getWidth()/2-d.DEFAULT_EDGE_LENGTH-n.getWidth()/2,i.getCenterY())}},t.exports=T},991:(t,e,i)=>{var n=i(551).FDLayoutNode,r=i(551).IMath;function o(t,e,i,r){n.call(this,t,e,i,r)}for(var a in o.prototype=Object.create(n.prototype),n)o[a]=n[a];o.prototype.calculateDisplacement=function(){var t=this.graphManager.getLayout();null!=this.getChild()&&this.fixedNodeWeight?(this.displacementX+=t.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=t.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=t.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=t.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>t.coolingFactor*t.maxNodeDisplacement&&(this.displacementX=t.coolingFactor*t.maxNodeDisplacement*r.sign(this.displacementX)),Math.abs(this.displacementY)>t.coolingFactor*t.maxNodeDisplacement&&(this.displacementY=t.coolingFactor*t.maxNodeDisplacement*r.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},o.prototype.propogateDisplacementToChildren=function(t,e){for(var i,n=this.getChild().getNodes(),r=0;r<n.length;r++)null==(i=n[r]).getChild()?(i.displacementX+=t,i.displacementY+=e):i.propogateDisplacementToChildren(t,e)},o.prototype.move=function(){var t=this.graphManager.getLayout();null!=this.child&&0!=this.child.getNodes().length||(this.moveBy(this.displacementX,this.displacementY),t.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},o.prototype.setPred1=function(t){this.pred1=t},o.prototype.getPred1=function(){return pred1},o.prototype.getPred2=function(){return pred2},o.prototype.setNext=function(t){this.next=t},o.prototype.getNext=function(){return next},o.prototype.setProcessed=function(t){this.processed=t},o.prototype.isProcessed=function(){return processed},t.exports=o},902:(t,e,i)=>{function n(t){if(Array.isArray(t)){for(var e=0,i=Array(t.length);e<t.length;e++)i[e]=t[e];return i}return Array.from(t)}var r=i(806),o=i(551).LinkedList,a=i(551).Matrix,s=i(551).SVD;function h(){}h.handleConstraints=function(t){var e={};e.fixedNodeConstraint=t.constraints.fixedNodeConstraint,e.alignmentConstraint=t.constraints.alignmentConstraint,e.relativePlacementConstraint=t.constraints.relativePlacementConstraint;for(var i=new Map,h=new Map,l=[],d=[],c=t.getAllNodes(),g=0,u=0;u<c.length;u++){var f=c[u];null==f.getChild()&&(h.set(f.id,g++),l.push(f.getCenterX()),d.push(f.getCenterY()),i.set(f.id,f))}e.relativePlacementConstraint&&e.relativePlacementConstraint.forEach(function(t){t.gap||0==t.gap||(t.left?t.gap=r.DEFAULT_EDGE_LENGTH+i.get(t.left).getWidth()/2+i.get(t.right).getWidth()/2:t.gap=r.DEFAULT_EDGE_LENGTH+i.get(t.top).getHeight()/2+i.get(t.bottom).getHeight()/2)});var p=function(t){var e=0,i=0;return t.forEach(function(t){e+=l[h.get(t)],i+=d[h.get(t)]}),{x:e/t.size,y:i/t.size}},m=function(t,e,i,r,a){var s=new Map;t.forEach(function(t,e){s.set(e,0)}),t.forEach(function(t,e){t.forEach(function(t){s.set(t.id,s.get(t.id)+1)})});var c=new Map,g=new Map,u=new o;s.forEach(function(t,n){0==t?(u.push(n),i||("horizontal"==e?c.set(n,h.has(n)?l[h.get(n)]:r.get(n)):c.set(n,h.has(n)?d[h.get(n)]:r.get(n)))):c.set(n,Number.NEGATIVE_INFINITY),i&&g.set(n,new Set([n]))}),i&&a.forEach(function(t){var n=[];if(t.forEach(function(t){i.has(t)&&n.push(t)}),n.length>0){var o=0;n.forEach(function(t){"horizontal"==e?(c.set(t,h.has(t)?l[h.get(t)]:r.get(t)),o+=c.get(t)):(c.set(t,h.has(t)?d[h.get(t)]:r.get(t)),o+=c.get(t))}),o/=n.length,t.forEach(function(t){i.has(t)||c.set(t,o)})}else{var a=0;t.forEach(function(t){a+="horizontal"==e?h.has(t)?l[h.get(t)]:r.get(t):h.has(t)?d[h.get(t)]:r.get(t)}),a/=t.length,t.forEach(function(t){c.set(t,a)})}});for(var f=function(){var n=u.shift();t.get(n).forEach(function(t){if(c.get(t.id)<c.get(n)+t.gap)if(i&&i.has(t.id)){var o=void 0;if(o="horizontal"==e?h.has(t.id)?l[h.get(t.id)]:r.get(t.id):h.has(t.id)?d[h.get(t.id)]:r.get(t.id),c.set(t.id,o),o<c.get(n)+t.gap){var a=c.get(n)+t.gap-o;g.get(n).forEach(function(t){c.set(t,c.get(t)-a)})}}else c.set(t.id,c.get(n)+t.gap);s.set(t.id,s.get(t.id)-1),0==s.get(t.id)&&u.push(t.id),i&&g.set(t.id,function(t,e){var i=new Set(t),n=!0,r=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done);n=!0){var h=a.value;i.add(h)}}catch(l){r=!0,o=l}finally{try{!n&&s.return&&s.return()}finally{if(r)throw o}}return i}(g.get(n),g.get(t.id)))})};0!=u.length;)f();if(i){var p=new Set;t.forEach(function(t,e){0==t.length&&p.add(e)});var m=[];g.forEach(function(t,e){if(p.has(e)){var r=!1,o=!0,a=!1,s=void 0;try{for(var h,l=t[Symbol.iterator]();!(o=(h=l.next()).done);o=!0){var d=h.value;i.has(d)&&(r=!0)}}catch(u){a=!0,s=u}finally{try{!o&&l.return&&l.return()}finally{if(a)throw s}}if(!r){var c=!1,g=void 0;m.forEach(function(e,i){e.has([].concat(n(t))[0])&&(c=!0,g=i)}),c?t.forEach(function(t){m[g].add(t)}):m.push(new Set(t))}}}),m.forEach(function(t,i){var n=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY,s=Number.NEGATIVE_INFINITY,g=!0,u=!1,f=void 0;try{for(var p,m=t[Symbol.iterator]();!(g=(p=m.next()).done);g=!0){var v=p.value,y=void 0;y="horizontal"==e?h.has(v)?l[h.get(v)]:r.get(v):h.has(v)?d[h.get(v)]:r.get(v);var E=c.get(v);y<n&&(n=y),y>a&&(a=y),E<o&&(o=E),E>s&&(s=E)}}catch(_){u=!0,f=_}finally{try{!g&&m.return&&m.return()}finally{if(u)throw f}}var N=(n+a)/2-(o+s)/2,T=!0,A=!1,w=void 0;try{for(var I,L=t[Symbol.iterator]();!(T=(I=L.next()).done);T=!0){var C=I.value;c.set(C,c.get(C)+N)}}catch(_){A=!0,w=_}finally{try{!T&&L.return&&L.return()}finally{if(A)throw w}}})}return c},v=function(t){var e=0,i=0,n=0,r=0;if(t.forEach(function(t){t.left?l[h.get(t.left)]-l[h.get(t.right)]>=0?e++:i++:d[h.get(t.top)]-d[h.get(t.bottom)]>=0?n++:r++}),e>i&&n>r)for(var o=0;o<h.size;o++)l[o]=-1*l[o],d[o]=-1*d[o];else if(e>i)for(var a=0;a<h.size;a++)l[a]=-1*l[a];else if(n>r)for(var s=0;s<h.size;s++)d[s]=-1*d[s]},y=function(t){var e=[],i=new o,n=new Set,r=0;return t.forEach(function(o,a){if(!n.has(a)){e[r]=[];var s=a;for(i.push(s),n.add(s),e[r].push(s);0!=i.length;)s=i.shift(),t.get(s).forEach(function(t){n.has(t.id)||(i.push(t.id),n.add(t.id),e[r].push(t.id))});r++}}),e},E=function(t){var e=new Map;return t.forEach(function(t,i){e.set(i,[])}),t.forEach(function(t,i){t.forEach(function(t){e.get(i).push(t),e.get(t.id).push({id:i,gap:t.gap,direction:t.direction})})}),e},N=function(t){var e=new Map;return t.forEach(function(t,i){e.set(i,[])}),t.forEach(function(t,i){t.forEach(function(t){e.get(t.id).push({id:i,gap:t.gap,direction:t.direction})})}),e},T=[],A=[],w=!1,I=!1,L=new Set,C=new Map,_=new Map,M=[];if(e.fixedNodeConstraint&&e.fixedNodeConstraint.forEach(function(t){L.add(t.nodeId)}),e.relativePlacementConstraint&&(e.relativePlacementConstraint.forEach(function(t){t.left?(C.has(t.left)?C.get(t.left).push({id:t.right,gap:t.gap,direction:"horizontal"}):C.set(t.left,[{id:t.right,gap:t.gap,direction:"horizontal"}]),C.has(t.right)||C.set(t.right,[])):(C.has(t.top)?C.get(t.top).push({id:t.bottom,gap:t.gap,direction:"vertical"}):C.set(t.top,[{id:t.bottom,gap:t.gap,direction:"vertical"}]),C.has(t.bottom)||C.set(t.bottom,[]))}),_=E(C),M=y(_)),r.TRANSFORM_ON_CONSTRAINT_HANDLING){if(e.fixedNodeConstraint&&e.fixedNodeConstraint.length>1)e.fixedNodeConstraint.forEach(function(t,e){T[e]=[t.position.x,t.position.y],A[e]=[l[h.get(t.nodeId)],d[h.get(t.nodeId)]]}),w=!0;else if(e.alignmentConstraint)!function(){var t=0;if(e.alignmentConstraint.vertical){for(var i=e.alignmentConstraint.vertical,r=function(e){var r=new Set;i[e].forEach(function(t){r.add(t)});var o=new Set([].concat(n(r)).filter(function(t){return L.has(t)})),a=void 0;a=o.size>0?l[h.get(o.values().next().value)]:p(r).x,i[e].forEach(function(e){T[t]=[a,d[h.get(e)]],A[t]=[l[h.get(e)],d[h.get(e)]],t++})},o=0;o<i.length;o++)r(o);w=!0}if(e.alignmentConstraint.horizontal){for(var a=e.alignmentConstraint.horizontal,s=function(e){var i=new Set;a[e].forEach(function(t){i.add(t)});var r=new Set([].concat(n(i)).filter(function(t){return L.has(t)})),o=void 0;o=r.size>0?l[h.get(r.values().next().value)]:p(i).y,a[e].forEach(function(e){T[t]=[l[h.get(e)],o],A[t]=[l[h.get(e)],d[h.get(e)]],t++})},c=0;c<a.length;c++)s(c);w=!0}e.relativePlacementConstraint&&(I=!0)}();else if(e.relativePlacementConstraint){for(var x=0,O=0,D=0;D<M.length;D++)M[D].length>x&&(x=M[D].length,O=D);if(x<_.size/2)v(e.relativePlacementConstraint),w=!1,I=!1;else{var b=new Map,R=new Map,F=[];M[O].forEach(function(t){C.get(t).forEach(function(e){"horizontal"==e.direction?(b.has(t)?b.get(t).push(e):b.set(t,[e]),b.has(e.id)||b.set(e.id,[]),F.push({left:t,right:e.id})):(R.has(t)?R.get(t).push(e):R.set(t,[e]),R.has(e.id)||R.set(e.id,[]),F.push({top:t,bottom:e.id}))})}),v(F),I=!1;var G=m(b,"horizontal"),S=m(R,"vertical");M[O].forEach(function(t,e){A[e]=[l[h.get(t)],d[h.get(t)]],T[e]=[],G.has(t)?T[e][0]=G.get(t):T[e][0]=l[h.get(t)],S.has(t)?T[e][1]=S.get(t):T[e][1]=d[h.get(t)]}),w=!0}}if(w){for(var P,U=a.transpose(T),Y=a.transpose(A),k=0;k<U.length;k++)U[k]=a.multGamma(U[k]),Y[k]=a.multGamma(Y[k]);var H=a.multMat(U,a.transpose(Y)),X=s.svd(H);P=a.multMat(X.V,a.transpose(X.U));for(var z=0;z<h.size;z++){var V=[l[z],d[z]],B=[P[0][0],P[1][0]],W=[P[0][1],P[1][1]];l[z]=a.dotProduct(V,B),d[z]=a.dotProduct(V,W)}I&&v(e.relativePlacementConstraint)}}if(r.ENFORCE_CONSTRAINTS){if(e.fixedNodeConstraint&&e.fixedNodeConstraint.length>0){var j={x:0,y:0};e.fixedNodeConstraint.forEach(function(t,e){var i,n,r={x:l[h.get(t.nodeId)],y:d[h.get(t.nodeId)]},o=t.position,a=(n=r,{x:(i=o).x-n.x,y:i.y-n.y});j.x+=a.x,j.y+=a.y}),j.x/=e.fixedNodeConstraint.length,j.y/=e.fixedNodeConstraint.length,l.forEach(function(t,e){l[e]+=j.x}),d.forEach(function(t,e){d[e]+=j.y}),e.fixedNodeConstraint.forEach(function(t){l[h.get(t.nodeId)]=t.position.x,d[h.get(t.nodeId)]=t.position.y})}if(e.alignmentConstraint){if(e.alignmentConstraint.vertical)for(var $=e.alignmentConstraint.vertical,q=function(t){var e=new Set;$[t].forEach(function(t){e.add(t)});var i=new Set([].concat(n(e)).filter(function(t){return L.has(t)})),r=void 0;r=i.size>0?l[h.get(i.values().next().value)]:p(e).x,e.forEach(function(t){L.has(t)||(l[h.get(t)]=r)})},Z=0;Z<$.length;Z++)q(Z);if(e.alignmentConstraint.horizontal)for(var Q=e.alignmentConstraint.horizontal,J=function(t){var e=new Set;Q[t].forEach(function(t){e.add(t)});var i=new Set([].concat(n(e)).filter(function(t){return L.has(t)})),r=void 0;r=i.size>0?d[h.get(i.values().next().value)]:p(e).y,e.forEach(function(t){L.has(t)||(d[h.get(t)]=r)})},K=0;K<Q.length;K++)J(K)}e.relativePlacementConstraint&&function(){var t=new Map,i=new Map,n=new Map,r=new Map,o=new Map,a=new Map,s=new Set,c=new Set;if(L.forEach(function(t){s.add(t),c.add(t)}),e.alignmentConstraint){if(e.alignmentConstraint.vertical)for(var g=e.alignmentConstraint.vertical,u=function(e){n.set("dummy"+e,[]),g[e].forEach(function(i){t.set(i,"dummy"+e),n.get("dummy"+e).push(i),L.has(i)&&s.add("dummy"+e)}),o.set("dummy"+e,l[h.get(g[e][0])])},f=0;f<g.length;f++)u(f);if(e.alignmentConstraint.horizontal)for(var p=e.alignmentConstraint.horizontal,v=function(t){r.set("dummy"+t,[]),p[t].forEach(function(e){i.set(e,"dummy"+t),r.get("dummy"+t).push(e),L.has(e)&&c.add("dummy"+t)}),a.set("dummy"+t,d[h.get(p[t][0])])},T=0;T<p.length;T++)v(T)}var A=new Map,w=new Map,I=function(e){C.get(e).forEach(function(n){var r=void 0,o=void 0;"horizontal"==n.direction?(r=t.get(e)?t.get(e):e,o=t.get(n.id)?{id:t.get(n.id),gap:n.gap,direction:n.direction}:n,A.has(r)?A.get(r).push(o):A.set(r,[o]),A.has(o.id)||A.set(o.id,[])):(r=i.get(e)?i.get(e):e,o=i.get(n.id)?{id:i.get(n.id),gap:n.gap,direction:n.direction}:n,w.has(r)?w.get(r).push(o):w.set(r,[o]),w.has(o.id)||w.set(o.id,[]))})},_=!0,M=!1,x=void 0;try{for(var O,D=C.keys()[Symbol.iterator]();!(_=(O=D.next()).done);_=!0)I(O.value)}catch(tt){M=!0,x=tt}finally{try{!_&&D.return&&D.return()}finally{if(M)throw x}}var b=E(A),R=E(w),F=y(b),G=y(R),S=N(A),P=N(w),U=[],Y=[];F.forEach(function(t,e){U[e]=[],t.forEach(function(t){0==S.get(t).length&&U[e].push(t)})}),G.forEach(function(t,e){Y[e]=[],t.forEach(function(t){0==P.get(t).length&&Y[e].push(t)})});var k=m(A,"horizontal",s,o,U),H=m(w,"vertical",c,a,Y),X=function(t){n.get(t)?n.get(t).forEach(function(e){l[h.get(e)]=k.get(t)}):l[h.get(t)]=k.get(t)},z=!0,V=!1,B=void 0;try{for(var W,j=k.keys()[Symbol.iterator]();!(z=(W=j.next()).done);z=!0)X(W.value)}catch(tt){V=!0,B=tt}finally{try{!z&&j.return&&j.return()}finally{if(V)throw B}}var $=function(t){r.get(t)?r.get(t).forEach(function(e){d[h.get(e)]=H.get(t)}):d[h.get(t)]=H.get(t)},q=!0,Z=!1,Q=void 0;try{for(var J,K=H.keys()[Symbol.iterator]();!(q=(J=K.next()).done);q=!0)$(J.value)}catch(tt){Z=!0,Q=tt}finally{try{!q&&K.return&&K.return()}finally{if(Z)throw Q}}}()}for(var tt=0;tt<c.length;tt++){var et=c[tt];null==et.getChild()&&et.setCenter(l[h.get(et.id)],d[h.get(et.id)])}},t.exports=h},551:e=>{e.exports=t}},i={},function t(n){var r=i[n];if(void 0!==r)return r.exports;var o=i[n]={exports:{}};return e[n](o,o.exports,t),o.exports}(45);var e,i},x.exports=t(D()));var t}var F,G,S,P;const U=C(F?M.exports:(F=1,M.exports=(G=R(),S={658:t=>{t.exports=null!=Object.assign?Object.assign.bind(Object):function(t){for(var e=arguments.length,i=Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];return i.forEach(function(e){Object.keys(e).forEach(function(i){return t[i]=e[i]})}),t}},548:(t,e,i)=>{var n=function(){return function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var i=[],n=!0,r=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(n=(a=s.next()).done)&&(i.push(a.value),!e||i.length!==e);n=!0);}catch(h){r=!0,o=h}finally{try{!n&&s.return&&s.return()}finally{if(r)throw o}}return i}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),r=i(140).layoutBase.LinkedList,o={getTopMostNodes:function(t){for(var e={},i=0;i<t.length;i++)e[t[i].id()]=!0;return t.filter(function(t,i){"number"==typeof t&&(t=i);for(var n=t.parent()[0];null!=n;){if(e[n.id()])return!1;n=n.parent()[0]}return!0})},connectComponents:function(t,e,i,n){var o=new r,a=new Set,s=[],h=void 0,l=void 0,d=void 0,c=!1,g=1,u=[],f=[],p=function(){var n=t.collection();f.push(n);var r=i[0],p=t.collection();p.merge(r).merge(r.descendants().intersection(e)),s.push(r),p.forEach(function(t){o.push(t),a.add(t),n.merge(t)});for(var m=function(){r=o.shift();var l=t.collection();r.neighborhood().nodes().forEach(function(t){e.intersection(r.edgesWith(t)).length>0&&l.merge(t)});for(var d=0;d<l.length;d++){var c=l[d];null==(h=i.intersection(c.union(c.ancestors())))||a.has(h[0])||h.union(h.descendants()).forEach(function(t){o.push(t),a.add(t),n.merge(t),i.has(t)&&s.push(t)})}};0!=o.length;)m();if(n.forEach(function(t){e.intersection(t.connectedEdges()).forEach(function(t){n.has(t.source())&&n.has(t.target())&&n.merge(t)})}),s.length==i.length&&(c=!0),!c||c&&g>1){l=s[0],d=l.connectedEdges().length,s.forEach(function(t){t.connectedEdges().length<d&&(d=t.connectedEdges().length,l=t)}),u.push(l.id());var v=t.collection();v.merge(s[0]),s.forEach(function(t){v.merge(t)}),s=[],i=i.difference(v),g++}};do{p()}while(!c);return n&&u.length>0&&n.set("dummy"+(n.size+1),u),f},relocateComponent:function(t,e,i){if(!i.fixedNodeConstraint){var r=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY;if("draft"==i.quality){var h=!0,l=!1,d=void 0;try{for(var c,g=e.nodeIndexes[Symbol.iterator]();!(h=(c=g.next()).done);h=!0){var u=c.value,f=n(u,2),p=f[0],m=f[1],v=i.cy.getElementById(p);if(v){var y=v.boundingBox(),E=e.xCoords[m]-y.w/2,N=e.xCoords[m]+y.w/2,T=e.yCoords[m]-y.h/2,A=e.yCoords[m]+y.h/2;E<r&&(r=E),N>o&&(o=N),T<a&&(a=T),A>s&&(s=A)}}}catch(_){l=!0,d=_}finally{try{!h&&g.return&&g.return()}finally{if(l)throw d}}var w=t.x-(o+r)/2,I=t.y-(s+a)/2;e.xCoords=e.xCoords.map(function(t){return t+w}),e.yCoords=e.yCoords.map(function(t){return t+I})}else{Object.keys(e).forEach(function(t){var i=e[t],n=i.getRect().x,h=i.getRect().x+i.getRect().width,l=i.getRect().y,d=i.getRect().y+i.getRect().height;n<r&&(r=n),h>o&&(o=h),l<a&&(a=l),d>s&&(s=d)});var L=t.x-(o+r)/2,C=t.y-(s+a)/2;Object.keys(e).forEach(function(t){var i=e[t];i.setCenter(i.getCenterX()+L,i.getCenterY()+C)})}}},calcBoundingBox:function(t,e,i,n){for(var r=Number.MAX_SAFE_INTEGER,o=Number.MIN_SAFE_INTEGER,a=Number.MAX_SAFE_INTEGER,s=Number.MIN_SAFE_INTEGER,h=void 0,l=void 0,d=void 0,c=void 0,g=t.descendants().not(":parent"),u=g.length,f=0;f<u;f++){var p=g[f];r>(h=e[n.get(p.id())]-p.width()/2)&&(r=h),o<(l=e[n.get(p.id())]+p.width()/2)&&(o=l),a>(d=i[n.get(p.id())]-p.height()/2)&&(a=d),s<(c=i[n.get(p.id())]+p.height()/2)&&(s=c)}var m={};return m.topLeftX=r,m.topLeftY=a,m.width=o-r,m.height=s-a,m},calcParentsWithoutChildren:function(t,e){var i=t.collection();return e.nodes(":parent").forEach(function(t){var e=!1;t.children().forEach(function(t){"none"!=t.css("display")&&(e=!0)}),e||i.merge(t)}),i}};t.exports=o},816:(t,e,i)=>{var n=i(548),r=i(140).CoSELayout,o=i(140).CoSENode,a=i(140).layoutBase.PointD,s=i(140).layoutBase.DimensionD,h=i(140).layoutBase.LayoutConstants,l=i(140).layoutBase.FDLayoutConstants,d=i(140).CoSEConstants;t.exports={coseLayout:function(t,e){var i=t.cy,c=t.eles,g=c.nodes(),u=c.edges(),f=void 0,p=void 0,m=void 0,v={};t.randomize&&(f=e.nodeIndexes,p=e.xCoords,m=e.yCoords);var y=function(t){return"function"==typeof t},E=function(t,e){return y(t)?t(e):t},N=n.calcParentsWithoutChildren(i,c);null!=t.nestingFactor&&(d.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=l.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=t.nestingFactor),null!=t.gravity&&(d.DEFAULT_GRAVITY_STRENGTH=l.DEFAULT_GRAVITY_STRENGTH=t.gravity),null!=t.numIter&&(d.MAX_ITERATIONS=l.MAX_ITERATIONS=t.numIter),null!=t.gravityRange&&(d.DEFAULT_GRAVITY_RANGE_FACTOR=l.DEFAULT_GRAVITY_RANGE_FACTOR=t.gravityRange),null!=t.gravityCompound&&(d.DEFAULT_COMPOUND_GRAVITY_STRENGTH=l.DEFAULT_COMPOUND_GRAVITY_STRENGTH=t.gravityCompound),null!=t.gravityRangeCompound&&(d.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=t.gravityRangeCompound),null!=t.initialEnergyOnIncremental&&(d.DEFAULT_COOLING_FACTOR_INCREMENTAL=l.DEFAULT_COOLING_FACTOR_INCREMENTAL=t.initialEnergyOnIncremental),null!=t.tilingCompareBy&&(d.TILING_COMPARE_BY=t.tilingCompareBy),"proof"==t.quality?h.QUALITY=2:h.QUALITY=0,d.NODE_DIMENSIONS_INCLUDE_LABELS=l.NODE_DIMENSIONS_INCLUDE_LABELS=h.NODE_DIMENSIONS_INCLUDE_LABELS=t.nodeDimensionsIncludeLabels,d.DEFAULT_INCREMENTAL=l.DEFAULT_INCREMENTAL=h.DEFAULT_INCREMENTAL=!t.randomize,d.ANIMATE=l.ANIMATE=h.ANIMATE=t.animate,d.TILE=t.tile,d.TILING_PADDING_VERTICAL="function"==typeof t.tilingPaddingVertical?t.tilingPaddingVertical.call():t.tilingPaddingVertical,d.TILING_PADDING_HORIZONTAL="function"==typeof t.tilingPaddingHorizontal?t.tilingPaddingHorizontal.call():t.tilingPaddingHorizontal,d.DEFAULT_INCREMENTAL=l.DEFAULT_INCREMENTAL=h.DEFAULT_INCREMENTAL=!0,d.PURE_INCREMENTAL=!t.randomize,h.DEFAULT_UNIFORM_LEAF_NODE_SIZES=t.uniformNodeDimensions,"transformed"==t.step&&(d.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,d.ENFORCE_CONSTRAINTS=!1,d.APPLY_LAYOUT=!1),"enforced"==t.step&&(d.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,d.ENFORCE_CONSTRAINTS=!0,d.APPLY_LAYOUT=!1),"cose"==t.step&&(d.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,d.ENFORCE_CONSTRAINTS=!1,d.APPLY_LAYOUT=!0),"all"==t.step&&(t.randomize?d.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:d.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,d.ENFORCE_CONSTRAINTS=!0,d.APPLY_LAYOUT=!0),t.fixedNodeConstraint||t.alignmentConstraint||t.relativePlacementConstraint?d.TREE_REDUCTION_ON_INCREMENTAL=!1:d.TREE_REDUCTION_ON_INCREMENTAL=!0;var T,A,w=new r,I=w.newGraphManager();return function t(e,i,r,h){for(var l=i.length,d=0;d<l;d++){var c=i[d],g=null;0==c.intersection(N).length&&(g=c.children());var u=void 0,y=c.layoutDimensions({nodeDimensionsIncludeLabels:h.nodeDimensionsIncludeLabels});if(null!=c.outerWidth()&&null!=c.outerHeight())if(h.randomize)if(c.isParent()){var T=n.calcBoundingBox(c,p,m,f);u=0==c.intersection(N).length?e.add(new o(r.graphManager,new a(T.topLeftX,T.topLeftY),new s(T.width,T.height))):e.add(new o(r.graphManager,new a(T.topLeftX,T.topLeftY),new s(parseFloat(y.w),parseFloat(y.h))))}else u=e.add(new o(r.graphManager,new a(p[f.get(c.id())]-y.w/2,m[f.get(c.id())]-y.h/2),new s(parseFloat(y.w),parseFloat(y.h))));else u=e.add(new o(r.graphManager,new a(c.position("x")-y.w/2,c.position("y")-y.h/2),new s(parseFloat(y.w),parseFloat(y.h))));else u=e.add(new o(this.graphManager));u.id=c.data("id"),u.nodeRepulsion=E(h.nodeRepulsion,c),u.paddingLeft=parseInt(c.css("padding")),u.paddingTop=parseInt(c.css("padding")),u.paddingRight=parseInt(c.css("padding")),u.paddingBottom=parseInt(c.css("padding")),h.nodeDimensionsIncludeLabels&&(u.labelWidth=c.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).w,u.labelHeight=c.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).h,u.labelPosVertical=c.css("text-valign"),u.labelPosHorizontal=c.css("text-halign")),v[c.data("id")]=u,isNaN(u.rect.x)&&(u.rect.x=0),isNaN(u.rect.y)&&(u.rect.y=0),null!=g&&g.length>0&&t(r.getGraphManager().add(r.newGraph(),u),g,r,h)}}(I.addRoot(),n.getTopMostNodes(g),w,t),function(e,i,n){for(var r=0,o=0,a=0;a<n.length;a++){var s=n[a],h=v[s.data("source")],c=v[s.data("target")];if(h&&c&&h!==c&&0==h.getEdgesBetween(c).length){var g=i.add(e.newEdge(),h,c);g.id=s.id(),g.idealLength=E(t.idealEdgeLength,s),g.edgeElasticity=E(t.edgeElasticity,s),r+=g.idealLength,o++}}null!=t.idealEdgeLength&&(o>0?d.DEFAULT_EDGE_LENGTH=l.DEFAULT_EDGE_LENGTH=r/o:y(t.idealEdgeLength)?d.DEFAULT_EDGE_LENGTH=l.DEFAULT_EDGE_LENGTH=50:d.DEFAULT_EDGE_LENGTH=l.DEFAULT_EDGE_LENGTH=t.idealEdgeLength,d.MIN_REPULSION_DIST=l.MIN_REPULSION_DIST=l.DEFAULT_EDGE_LENGTH/10,d.DEFAULT_RADIAL_SEPARATION=l.DEFAULT_EDGE_LENGTH)}(w,I,u),T=w,(A=t).fixedNodeConstraint&&(T.constraints.fixedNodeConstraint=A.fixedNodeConstraint),A.alignmentConstraint&&(T.constraints.alignmentConstraint=A.alignmentConstraint),A.relativePlacementConstraint&&(T.constraints.relativePlacementConstraint=A.relativePlacementConstraint),w.runLayout(),v}}},212:(t,e,i)=>{var n=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),r=i(658),o=i(548),a=i(657).spectralLayout,s=i(816).coseLayout,h=Object.freeze({quality:"default",randomize:!0,animate:!0,animationDuration:1e3,animationEasing:void 0,fit:!0,padding:30,nodeDimensionsIncludeLabels:!1,uniformNodeDimensions:!1,packComponents:!0,step:"all",samplingType:!0,sampleSize:25,nodeSeparation:75,piTol:1e-7,nodeRepulsion:function(t){return 4500},idealEdgeLength:function(t){return 50},edgeElasticity:function(t){return.45},nestingFactor:.1,gravity:.25,numIter:2500,tile:!0,tilingCompareBy:void 0,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:.3,fixedNodeConstraint:void 0,alignmentConstraint:void 0,relativePlacementConstraint:void 0,ready:function(){},stop:function(){}}),l=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.options=r({},h,e)}return n(t,[{key:"run",value:function(){var t=this.options,e=t.cy,i=t.eles,n=[],r=[],h=void 0,l=[];!t.fixedNodeConstraint||Array.isArray(t.fixedNodeConstraint)&&0!=t.fixedNodeConstraint.length||(t.fixedNodeConstraint=void 0),t.alignmentConstraint&&(!t.alignmentConstraint.vertical||Array.isArray(t.alignmentConstraint.vertical)&&0!=t.alignmentConstraint.vertical.length||(t.alignmentConstraint.vertical=void 0),!t.alignmentConstraint.horizontal||Array.isArray(t.alignmentConstraint.horizontal)&&0!=t.alignmentConstraint.horizontal.length||(t.alignmentConstraint.horizontal=void 0)),!t.relativePlacementConstraint||Array.isArray(t.relativePlacementConstraint)&&0!=t.relativePlacementConstraint.length||(t.relativePlacementConstraint=void 0),(t.fixedNodeConstraint||t.alignmentConstraint||t.relativePlacementConstraint)&&(t.tile=!1,t.packComponents=!1);var d=void 0,c=!1;if(e.layoutUtilities&&t.packComponents&&((d=e.layoutUtilities("get"))||(d=e.layoutUtilities()),c=!0),i.nodes().length>0)if(c){var g=o.getTopMostNodes(t.eles.nodes());if((h=o.connectComponents(e,t.eles,g)).forEach(function(t){var e=t.boundingBox();l.push({x:e.x1+e.w/2,y:e.y1+e.h/2})}),t.randomize&&h.forEach(function(e){t.eles=e,n.push(a(t))}),"default"==t.quality||"proof"==t.quality){var u=e.collection();if(t.tile){var f=0,p={nodeIndexes:new Map,xCoords:[],yCoords:[]},m=[];if(h.forEach(function(t,e){0==t.edges().length&&(t.nodes().forEach(function(e,i){u.merge(t.nodes()[i]),e.isParent()||(p.nodeIndexes.set(t.nodes()[i].id(),f++),p.xCoords.push(t.nodes()[0].position().x),p.yCoords.push(t.nodes()[0].position().y))}),m.push(e))}),u.length>1){var v=u.boundingBox();l.push({x:v.x1+v.w/2,y:v.y1+v.h/2}),h.push(u),n.push(p);for(var y=m.length-1;y>=0;y--)h.splice(m[y],1),n.splice(m[y],1),l.splice(m[y],1)}}h.forEach(function(e,i){t.eles=e,r.push(s(t,n[i])),o.relocateComponent(l[i],r[i],t)})}else h.forEach(function(e,i){o.relocateComponent(l[i],n[i],t)});var E=new Set;if(h.length>1){var N=[],T=i.filter(function(t){return"none"==t.css("display")});h.forEach(function(e,i){var a=void 0;if("draft"==t.quality&&(a=n[i].nodeIndexes),e.nodes().not(T).length>0){var s={edges:[],nodes:[]},h=void 0;e.nodes().not(T).forEach(function(e){if("draft"==t.quality)if(e.isParent()){var l=o.calcBoundingBox(e,n[i].xCoords,n[i].yCoords,a);s.nodes.push({x:l.topLeftX,y:l.topLeftY,width:l.width,height:l.height})}else h=a.get(e.id()),s.nodes.push({x:n[i].xCoords[h]-e.boundingbox().w/2,y:n[i].yCoords[h]-e.boundingbox().h/2,width:e.boundingbox().w,height:e.boundingbox().h});else r[i][e.id()]&&s.nodes.push({x:r[i][e.id()].getLeft(),y:r[i][e.id()].getTop(),width:r[i][e.id()].getWidth(),height:r[i][e.id()].getHeight()})}),e.edges().forEach(function(e){var h=e.source(),l=e.target();if("none"!=h.css("display")&&"none"!=l.css("display"))if("draft"==t.quality){var d=a.get(h.id()),c=a.get(l.id()),g=[],u=[];if(h.isParent()){var f=o.calcBoundingBox(h,n[i].xCoords,n[i].yCoords,a);g.push(f.topLeftX+f.width/2),g.push(f.topLeftY+f.height/2)}else g.push(n[i].xCoords[d]),g.push(n[i].yCoords[d]);if(l.isParent()){var p=o.calcBoundingBox(l,n[i].xCoords,n[i].yCoords,a);u.push(p.topLeftX+p.width/2),u.push(p.topLeftY+p.height/2)}else u.push(n[i].xCoords[c]),u.push(n[i].yCoords[c]);s.edges.push({startX:g[0],startY:g[1],endX:u[0],endY:u[1]})}else r[i][h.id()]&&r[i][l.id()]&&s.edges.push({startX:r[i][h.id()].getCenterX(),startY:r[i][h.id()].getCenterY(),endX:r[i][l.id()].getCenterX(),endY:r[i][l.id()].getCenterY()})}),s.nodes.length>0&&(N.push(s),E.add(i))}});var A=d.packComponents(N,t.randomize).shifts;if("draft"==t.quality)n.forEach(function(t,e){var i=t.xCoords.map(function(t){return t+A[e].dx}),n=t.yCoords.map(function(t){return t+A[e].dy});t.xCoords=i,t.yCoords=n});else{var w=0;E.forEach(function(t){Object.keys(r[t]).forEach(function(e){var i=r[t][e];i.setCenter(i.getCenterX()+A[w].dx,i.getCenterY()+A[w].dy)}),w++})}}}else{var I=t.eles.boundingBox();if(l.push({x:I.x1+I.w/2,y:I.y1+I.h/2}),t.randomize){var L=a(t);n.push(L)}"default"==t.quality||"proof"==t.quality?(r.push(s(t,n[0])),o.relocateComponent(l[0],r[0],t)):o.relocateComponent(l[0],n[0],t)}var C=function(e,i){if("default"==t.quality||"proof"==t.quality){"number"==typeof e&&(e=i);var o=void 0,a=void 0,s=e.data("id");return r.forEach(function(t){s in t&&(o={x:t[s].getRect().getCenterX(),y:t[s].getRect().getCenterY()},a=t[s])}),t.nodeDimensionsIncludeLabels&&(a.labelWidth&&("left"==a.labelPosHorizontal?o.x+=a.labelWidth/2:"right"==a.labelPosHorizontal&&(o.x-=a.labelWidth/2)),a.labelHeight&&("top"==a.labelPosVertical?o.y+=a.labelHeight/2:"bottom"==a.labelPosVertical&&(o.y-=a.labelHeight/2))),null==o&&(o={x:e.position("x"),y:e.position("y")}),{x:o.x,y:o.y}}var h=void 0;return n.forEach(function(t){var i=t.nodeIndexes.get(e.id());null!=i&&(h={x:t.xCoords[i],y:t.yCoords[i]})}),null==h&&(h={x:e.position("x"),y:e.position("y")}),{x:h.x,y:h.y}};if("default"==t.quality||"proof"==t.quality||t.randomize){var _=o.calcParentsWithoutChildren(e,i),M=i.filter(function(t){return"none"==t.css("display")});t.eles=i.not(M),i.nodes().not(":parent").not(M).layoutPositions(this,t,C),_.length>0&&_.forEach(function(t){t.position(C(t))})}}}]),t}();t.exports=l},657:(t,e,i)=>{var n=i(548),r=i(140).layoutBase.Matrix,o=i(140).layoutBase.SVD;t.exports={spectralLayout:function(t){var e=t.cy,i=t.eles,a=i.nodes(),s=i.nodes(":parent"),h=new Map,l=new Map,d=new Map,c=[],g=[],u=[],f=[],p=[],m=[],v=[],y=[],E=void 0,N=1e8,T=1e-9,A=t.piTol,w=t.samplingType,I=t.nodeSeparation,L=void 0,C=function(t,e,i){for(var n=[],r=0,o=0,a=0,s=void 0,h=[],d=0,g=1,u=0;u<E;u++)h[u]=N;for(n[o]=t,h[t]=0;o>=r;){a=n[r++];for(var f=c[a],v=0;v<f.length;v++)h[s=l.get(f[v])]==N&&(h[s]=h[a]+1,n[++o]=s);m[a][e]=h[a]*I}if(i){for(var y=0;y<E;y++)m[y][e]<p[y]&&(p[y]=m[y][e]);for(var T=0;T<E;T++)p[T]>d&&(d=p[T],g=T)}return g};n.connectComponents(e,i,n.getTopMostNodes(a),h),s.forEach(function(t){n.connectComponents(e,i,n.getTopMostNodes(t.descendants().intersection(i)),h)});for(var _=0,M=0;M<a.length;M++)a[M].isParent()||l.set(a[M].id(),_++);var x=!0,O=!1,D=void 0;try{for(var b,R=h.keys()[Symbol.iterator]();!(x=(b=R.next()).done);x=!0){var F=b.value;l.set(F,_++)}}catch(Z){O=!0,D=Z}finally{try{!x&&R.return&&R.return()}finally{if(O)throw D}}for(var G=0;G<l.size;G++)c[G]=[];s.forEach(function(t){for(var e=t.children().intersection(i);0==e.nodes(":childless").length;)e=e.nodes()[0].children().intersection(i);var n=0,r=e.nodes(":childless")[0].connectedEdges().length;e.nodes(":childless").forEach(function(t,e){t.connectedEdges().length<r&&(r=t.connectedEdges().length,n=e)}),d.set(t.id(),e.nodes(":childless")[n].id())}),a.forEach(function(t){var e=void 0;e=t.isParent()?l.get(d.get(t.id())):l.get(t.id()),t.neighborhood().nodes().forEach(function(n){i.intersection(t.edgesWith(n)).length>0&&(n.isParent()?c[e].push(d.get(n.id())):c[e].push(n.id()))})});var S=function(t){var i=l.get(t),n=void 0;h.get(t).forEach(function(r){n=e.getElementById(r).isParent()?d.get(r):r,c[i].push(n),c[l.get(n)].push(t)})},P=!0,U=!1,Y=void 0;try{for(var k,H=h.keys()[Symbol.iterator]();!(P=(k=H.next()).done);P=!0)S(k.value)}catch(Z){U=!0,Y=Z}finally{try{!P&&H.return&&H.return()}finally{if(U)throw Y}}var X=void 0;if((E=l.size)>2){L=E<t.sampleSize?E:t.sampleSize;for(var z=0;z<E;z++)m[z]=[];for(var V=0;V<L;V++)y[V]=[];return"draft"==t.quality||"all"==t.step?(function(t){var e=void 0;if(t){e=Math.floor(Math.random()*E);for(var i=0;i<E;i++)p[i]=N;for(var n=0;n<L;n++)f[n]=e,e=C(e,n,t)}else{!function(){for(var t=0,e=0,i=!1;e<L;){t=Math.floor(Math.random()*E),i=!1;for(var n=0;n<e;n++)if(f[n]==t){i=!0;break}i||(f[e]=t,e++)}}();for(var r=0;r<L;r++)C(f[r],r,t)}for(var o=0;o<E;o++)for(var a=0;a<L;a++)m[o][a]*=m[o][a];for(var s=0;s<L;s++)v[s]=[];for(var h=0;h<L;h++)for(var l=0;l<L;l++)v[h][l]=m[f[l]][h]}(w),function(){for(var t=o.svd(v),e=t.S,i=t.U,n=t.V,a=e[0]*e[0]*e[0],s=[],h=0;h<L;h++){s[h]=[];for(var l=0;l<L;l++)s[h][l]=0,h==l&&(s[h][l]=e[h]/(e[h]*e[h]+a/(e[h]*e[h])))}y=r.multMat(r.multMat(n,s),r.transpose(i))}(),function(){for(var t=void 0,e=void 0,i=[],n=[],o=[],a=[],s=0;s<E;s++)i[s]=Math.random(),n[s]=Math.random();i=r.normalize(i),n=r.normalize(n);for(var h=T,l=T,d=void 0;;){for(var c=0;c<E;c++)o[c]=i[c];if(i=r.multGamma(r.multL(r.multGamma(o),m,y)),t=r.dotProduct(o,i),i=r.normalize(i),h=r.dotProduct(o,i),(d=Math.abs(h/l))<=1+A&&d>=1)break;l=h}for(var f=0;f<E;f++)o[f]=i[f];for(l=T;;){for(var p=0;p<E;p++)a[p]=n[p];if(a=r.minusOp(a,r.multCons(o,r.dotProduct(o,a))),n=r.multGamma(r.multL(r.multGamma(a),m,y)),e=r.dotProduct(a,n),n=r.normalize(n),h=r.dotProduct(a,n),(d=Math.abs(h/l))<=1+A&&d>=1)break;l=h}for(var v=0;v<E;v++)a[v]=n[v];g=r.multCons(o,Math.sqrt(Math.abs(t))),u=r.multCons(a,Math.sqrt(Math.abs(e)))}(),X={nodeIndexes:l,xCoords:g,yCoords:u}):(l.forEach(function(t,i){g.push(e.getElementById(i).position("x")),u.push(e.getElementById(i).position("y"))}),X={nodeIndexes:l,xCoords:g,yCoords:u}),X}var B=l.keys(),W=e.getElementById(B.next().value),j=W.position(),$=W.outerWidth();if(g.push(j.x),u.push(j.y),2==E){var q=e.getElementById(B.next().value).outerWidth();g.push(j.x+$/2+q/2+t.idealEdgeLength),u.push(j.y)}return X={nodeIndexes:l,xCoords:g,yCoords:u}}}},579:(t,e,i)=>{var n=i(212),r=function(t){t&&t("layout","fcose",n)};"undefined"!=typeof cytoscape&&r(cytoscape),t.exports=r},140:t=>{t.exports=G}},P={},function t(e){var i=P[e];if(void 0!==i)return i.exports;var n=P[e]={exports:{}};return S[e](n,n.exports,t),n.exports}(579))));var Y={L:"left",R:"right",T:"top",B:"bottom"},k={L:i(t=>`${t},${t/2} 0,${t} 0,0`,"L"),R:i(t=>`0,${t/2} ${t},0 ${t},${t}`,"R"),T:i(t=>`0,0 ${t},0 ${t/2},${t}`,"T"),B:i(t=>`${t/2},0 ${t},${t} 0,${t}`,"B")},H={L:i((t,e)=>t-e+2,"L"),R:i((t,e)=>t-2,"R"),T:i((t,e)=>t-e+2,"T"),B:i((t,e)=>t-2,"B")},X=i(function(t){return V(t)?"L"===t?"R":"L":"T"===t?"B":"T"},"getOppositeArchitectureDirection"),z=i(function(t){return"L"===t||"R"===t||"T"===t||"B"===t},"isArchitectureDirection"),V=i(function(t){return"L"===t||"R"===t},"isArchitectureDirectionX"),B=i(function(t){return"T"===t||"B"===t},"isArchitectureDirectionY"),W=i(function(t,e){const i=V(t)&&B(e),n=B(t)&&V(e);return i||n},"isArchitectureDirectionXY"),j=i(function(t){const e=t[0],i=t[1],n=V(e)&&B(i),r=B(e)&&V(i);return n||r},"isArchitecturePairXY"),$=i(function(t){return"LL"!==t&&"RR"!==t&&"TT"!==t&&"BB"!==t},"isValidArchitectureDirectionPair"),q=i(function(t,e){const i=`${t}${e}`;return $(i)?i:void 0},"getArchitectureDirectionPair"),Z=i(function([t,e],i){const n=i[0],r=i[1];return V(n)?B(r)?[t+("L"===n?-1:1),e+("T"===r?1:-1)]:[t+("L"===n?-1:1),e]:V(r)?[t+("L"===r?1:-1),e+("T"===n?1:-1)]:[t,e+("T"===n?1:-1)]},"shiftPositionByArchitectureDirectionPair"),Q=i(function(t){return"LT"===t||"TL"===t?[1,1]:"BL"===t||"LB"===t?[1,-1]:"BR"===t||"RB"===t?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),J=i(function(t,e){return W(t,e)?"bend":V(t)?"horizontal":"vertical"},"getArchitectureDirectionAlignment"),K=i(function(t){return"service"===t.type},"isArchitectureService"),tt=i(function(t){return"junction"===t.type},"isArchitectureJunction"),et=i(t=>t.data(),"edgeData"),it=i(t=>t.data(),"nodeData"),nt=p.architecture,rt=(i(t=class{constructor(){this.nodes={},this.groups={},this.edges=[],this.layoutHints=[],this.registeredIds={},this.elements={},this.diagramId="",this.setAccTitle=a,this.getAccTitle=s,this.setDiagramTitle=h,this.getDiagramTitle=l,this.getAccDescription=d,this.setAccDescription=c,this.clear()}setDiagramId(t){this.diagramId=t}getDiagramId(){return this.diagramId}clear(){this.nodes={},this.groups={},this.edges=[],this.layoutHints=[],this.registeredIds={},this.dataStructures=void 0,this.elements={},this.diagramId="",g()}addService({id:t,icon:e,in:i,title:n,iconText:r}){if(void 0!==this.registeredIds[t])throw new Error(`The service id [${t}] is already in use by another ${this.registeredIds[t]}`);if(void 0!==i){if(t===i)throw new Error(`The service [${t}] cannot be placed within itself`);if(void 0===this.registeredIds[i])throw new Error(`The service [${t}]'s parent does not exist. Please make sure the parent is created before this service`);if("node"===this.registeredIds[i])throw new Error(`The service [${t}]'s parent is not a group`)}this.registeredIds[t]="node",this.nodes[t]={id:t,type:"service",icon:e,iconText:r,title:n,edges:[],in:i}}getServices(){return Object.values(this.nodes).filter(K)}addJunction({id:t,in:e}){if(void 0!==this.registeredIds[t])throw new Error(`The junction id [${t}] is already in use by another ${this.registeredIds[t]}`);if(void 0!==e){if(t===e)throw new Error(`The junction [${t}] cannot be placed within itself`);if(void 0===this.registeredIds[e])throw new Error(`The junction [${t}]'s parent does not exist. Please make sure the parent is created before this junction`);if("node"===this.registeredIds[e])throw new Error(`The junction [${t}]'s parent is not a group`)}this.registeredIds[t]="node",this.nodes[t]={id:t,type:"junction",edges:[],in:e}}getJunctions(){return Object.values(this.nodes).filter(tt)}getNodes(){return Object.values(this.nodes)}getNode(t){return this.nodes[t]??null}addGroup({id:t,icon:e,in:i,title:n}){var r,o,a;if(void 0!==(null==(r=this.registeredIds)?void 0:r[t]))throw new Error(`The group id [${t}] is already in use by another ${this.registeredIds[t]}`);if(void 0!==i){if(t===i)throw new Error(`The group [${t}] cannot be placed within itself`);if(void 0===(null==(o=this.registeredIds)?void 0:o[i]))throw new Error(`The group [${t}]'s parent does not exist. Please make sure the parent is created before this group`);if("node"===(null==(a=this.registeredIds)?void 0:a[i]))throw new Error(`The group [${t}]'s parent is not a group`)}this.registeredIds[t]="group",this.groups[t]={id:t,icon:e,title:n,in:i}}getGroups(){return Object.values(this.groups)}addEdge({lhsId:t,rhsId:e,lhsDir:i,rhsDir:n,lhsInto:r,rhsInto:o,lhsGroup:a,rhsGroup:s,title:h}){if(!z(i))throw new Error(`Invalid direction given for left hand side of edge ${t}--${e}. Expected (L,R,T,B) got ${String(i)}`);if(!z(n))throw new Error(`Invalid direction given for right hand side of edge ${t}--${e}. Expected (L,R,T,B) got ${String(n)}`);if(void 0===this.nodes[t]&&void 0===this.groups[t])throw new Error(`The left-hand id [${t}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(void 0===this.nodes[e]&&void 0===this.groups[e])throw new Error(`The right-hand id [${e}] does not yet exist. Please create the service/group before declaring an edge to it.`);const l=this.nodes[t].in,d=this.nodes[e].in;if(a&&l&&d&&l==d)throw new Error(`The left-hand id [${t}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(s&&l&&d&&l==d)throw new Error(`The right-hand id [${e}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);const c={lhsId:t,lhsDir:i,lhsInto:r,lhsGroup:a,rhsId:e,rhsDir:n,rhsInto:o,rhsGroup:s,title:h};this.edges.push(c),this.nodes[t]&&this.nodes[e]&&(this.nodes[t].edges.push(this.edges[this.edges.length-1]),this.nodes[e].edges.push(this.edges[this.edges.length-1]))}getEdges(){return this.edges}addLayoutHint(t){if(t.members.length<2)throw new Error(`An align directive requires at least two members; got ${t.members.length}`);const e=new Set;t.members.forEach(i=>{if("node"!==this.registeredIds[i])throw new Error(`align ${t.direction} references [${i}], which is not a service or junction`);if(e.has(i))throw new Error(`align ${t.direction} lists [${i}] more than once`);e.add(i)}),this.layoutHints.push(t)}getLayoutHints(){return this.layoutHints}getDataStructures(){if(void 0===this.dataStructures){const t={},e=Object.entries(this.nodes).reduce((e,[i,n])=>(e[i]=n.edges.reduce((e,n)=>{var r,o;const a=null==(r=this.getNode(n.lhsId))?void 0:r.in,s=null==(o=this.getNode(n.rhsId))?void 0:o.in;if(a&&s&&a!==s){const e=J(n.lhsDir,n.rhsDir);"bend"!==e&&(t[a]??(t[a]={}),t[a][s]=e,t[s]??(t[s]={}),t[s][a]=e)}if(n.lhsId===i){const t=q(n.lhsDir,n.rhsDir);t&&(e[t]=n.rhsId)}else{const t=q(n.rhsDir,n.lhsDir);t&&(e[t]=n.lhsId)}return e},{}),e),{}),n=Object.keys(e)[0],r={[n]:1},o=Object.keys(e).reduce((t,e)=>e===n?t:{...t,[e]:1},{}),a=i(t=>{const i={[t]:[0,0]},n=[t];for(;n.length>0;){const t=n.shift();if(t){r[t]=1,delete o[t];const a=e[t],[s,h]=i[t];Object.entries(a).forEach(([t,e])=>{r[e]||(i[e]=Z([s,h],t),n.push(e))})}}return i},"BFS"),s=[a(n)];for(;Object.keys(o).length>0;)s.push(a(Object.keys(o)[0]));this.dataStructures={adjList:e,spatialMaps:s,groupAlignments:t}}return this.dataStructures}setElementForId(t,e){this.elements[t]=e}getElementById(t){return this.elements[t]}getConfig(){return u({...nt,...f().architecture})}getConfigField(t){return this.getConfig()[t]}},"ArchitectureDB"),t),ot=i((t,i)=>{var n;e(t,i),t.groups.map(t=>i.addGroup(t)),t.services.map(t=>i.addService({...t,type:"service"})),t.junctions.map(t=>i.addJunction({...t,type:"junction"})),t.edges.map(t=>i.addEdge(t)),null==(n=t.alignments)||n.map(t=>i.addLayoutHint({direction:t.direction,members:[...t.members]}))},"populateDb"),at={parser:{yy:void 0},parse:i(async t=>{var e;const i=await I("architecture",t);o.debug(i);const n=null==(e=at.parser)?void 0:e.yy;if(!(n instanceof rt))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.");ot(i,n)},"parse")},st=i(t=>`\n .edge {\n stroke-width: ${t.archEdgeWidth};\n stroke: ${t.archEdgeColor};\n fill: none;\n }\n\n .arrow {\n fill: ${t.archEdgeArrowColor};\n }\n\n .node-bkg {\n fill: none;\n stroke: ${t.archGroupBorderColor};\n stroke-width: ${t.archGroupBorderWidth};\n stroke-dasharray: 8;\n }\n .node-icon-text {\n display: flex; \n align-items: center;\n }\n \n .node-icon-text > div {\n color: #fff;\n margin: 1px;\n height: fit-content;\n text-align: center;\n overflow: hidden;\n display: -webkit-box;\n -webkit-box-orient: vertical;\n }\n`,"getStyles");function ht(t,e){if(0===t)return e();const i=Math.random;let n=t>>>0;Math.random=function(){n=n+1831565813>>>0;let t=n;return t=Math.imul(t^t>>>15,1|t),t^=t+Math.imul(t^t>>>7,61|t),((t^t>>>14)>>>0)/4294967296};try{return e()}finally{Math.random=i}}i(ht,"withSeededRandom");var lt=i(t=>`<g><rect width="80" height="80" style="fill: #087ebf; stroke-width: 0px;"/>${t}</g>`,"wrapIcon"),dt={prefix:"mermaid-architecture",height:80,width:80,icons:{database:{body:lt('<path id="b" data-name="4" d="m20,57.86c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path id="c" data-name="3" d="m20,45.95c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path id="d" data-name="2" d="m20,34.05c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse id="e" data-name="1" cx="40" cy="22.14" rx="20" ry="7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="20" y1="57.86" x2="20" y2="22.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="60" y1="57.86" x2="60" y2="22.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>')},server:{body:lt('<rect x="17.5" y="17.5" width="45" height="45" rx="2" ry="2" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="32.5" x2="62.5" y2="32.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="47.5" x2="62.5" y2="47.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><g><path d="m56.25,25c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,25c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><path d="m56.25,40c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,40c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><path d="m56.25,55c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,55c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g>')},disk:{body:lt('<rect x="20" y="15" width="40" height="50" rx="1" ry="1" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="24" cy="19.17" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="56" cy="19.17" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="24" cy="60.83" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="56" cy="60.83" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="40" cy="33.75" rx="14" ry="14.58" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="40" cy="33.75" rx="4" ry="4.17" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m37.51,42.52l-4.83,13.22c-.26.71-1.1,1.02-1.76.64l-4.18-2.42c-.66-.38-.81-1.26-.33-1.84l9.01-10.8c.88-1.05,2.56-.08,2.09,1.2Z" style="fill: #fff; stroke-width: 0px;"/>')},internet:{body:lt('<circle cx="40" cy="40" r="22.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="40" y1="17.5" x2="40" y2="62.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="40" x2="62.5" y2="40" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m39.99,17.51c-15.28,11.1-15.28,33.88,0,44.98" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m40.01,17.51c15.28,11.1,15.28,33.88,0,44.98" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="19.75" y1="30.1" x2="60.25" y2="30.1" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="19.75" y1="49.9" x2="60.25" y2="49.9" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>')},cloud:{body:lt('<path d="m65,47.5c0,2.76-2.24,5-5,5H20c-2.76,0-5-2.24-5-5,0-1.87,1.03-3.51,2.56-4.36-.04-.21-.06-.42-.06-.64,0-2.6,2.48-4.74,5.65-4.97,1.65-4.51,6.34-7.76,11.85-7.76.86,0,1.69.08,2.5.23,2.09-1.57,4.69-2.5,7.5-2.5,6.1,0,11.19,4.38,12.28,10.17,2.14.56,3.72,2.51,3.72,4.83,0,.03,0,.07-.01.1,2.29.46,4.01,2.48,4.01,4.9Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>')},unknown:w,blank:{body:lt("")}}},ct=i(async function(t,e,i,n){const r=i.getConfigField("padding"),o=i.getConfigField("iconSize"),a=o/2,s=o/6,h=s/2;await Promise.all(e.edges().map(async e=>{var o,l;const{source:d,sourceDir:c,sourceArrow:g,sourceGroup:u,target:f,targetDir:p,targetArrow:y,targetGroup:E,label:N}=et(e);let{x:A,y:w}=e[0].sourceEndpoint();const{x:I,y:L}=e[0].midpoint();let{x:C,y:_}=e[0].targetEndpoint();const M=r+4;if(u&&(V(c)?A+="L"===c?-M:M:w+="T"===c?-M:M+18),E&&(V(p)?C+="L"===p?-M:M:_+="T"===p?-M:M+18),u||"junction"!==(null==(o=i.getNode(d))?void 0:o.type)||(V(c)?A+="L"===c?a:-a:w+="T"===c?a:-a),E||"junction"!==(null==(l=i.getNode(f))?void 0:l.type)||(V(p)?C+="L"===p?a:-a:_+="T"===p?a:-a),e[0]._private.rscratch){const e=t.insert("g");if(e.insert("path").attr("d",`M ${A},${w} L ${I},${L} L${C},${_} `).attr("class","edge").attr("id",`${n}-${T(d,f,{prefix:"L"})}`),g){const t=V(c)?H[c](A,s):A-h,i=B(c)?H[c](w,s):w-h;e.insert("polygon").attr("points",k[c](s)).attr("transform",`translate(${t},${i})`).attr("class","arrow")}if(y){const t=V(p)?H[p](C,s):C-h,i=B(p)?H[p](_,s):_-h;e.insert("polygon").attr("points",k[p](s)).attr("transform",`translate(${t},${i})`).attr("class","arrow")}if(N){const t=W(c,p)?"XY":V(c)?"X":"Y";let i=0;i="X"===t?Math.abs(A-C):"Y"===t?Math.abs(w-_)/1.5:Math.abs(A-C)/2;const n=e.append("g");if(await v(n,N,{useHtmlLabels:!1,width:i,classes:"architecture-service-label"},m()),n.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),"X"===t)n.attr("transform","translate("+I+", "+L+")");else if("Y"===t)n.attr("transform","translate("+I+", "+L+") rotate(-90)");else if("XY"===t){const t=q(c,p);if(t&&j(t)){const e=n.node().getBoundingClientRect(),[i,r]=Q(t);n.attr("dominant-baseline","auto").attr("transform",`rotate(${-1*i*r*45})`);const o=n.node().getBoundingClientRect();n.attr("transform",`\n translate(${I}, ${L-e.height/2})\n translate(${i*o.width/2}, ${r*o.height/2})\n rotate(${-1*i*r*45}, 0, ${e.height/2})\n `)}}}}}))},"drawEdges"),gt=i(async function(t,e,i,n){const r=.75*i.getConfigField("padding"),o=i.getConfigField("fontSize"),a=i.getConfigField("iconSize")/2;await Promise.all(e.nodes().map(async e=>{const s=it(e);if("group"===s.type){const{h:h,w:l,x1:d,y1:c}=e.boundingBox(),g=t.append("rect");g.attr("id",`${n}-group-${s.id}`).attr("x",d+a).attr("y",c+a).attr("width",l).attr("height",h).attr("class","node-bkg");const u=t.append("g");let f=d,p=c;if(s.icon){const t=u.append("g");t.html(`<g>${await y(s.icon,{height:r,width:r,fallbackPrefix:dt.prefix})}</g>`),t.attr("transform","translate("+(f+a+1)+", "+(p+a+1)+")"),f+=r,p+=o/2-1-2}if(s.label){const t=u.append("g");await v(t,s.label,{useHtmlLabels:!1,width:l,classes:"architecture-service-label"},m()),t.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start"),t.attr("transform","translate("+(f+a+4)+", "+(p+a+2)+")")}i.setElementForId(s.id,g)}}))},"drawGroups"),ut=i(async function(t,e,i,n){const r=m();for(const o of i){const i=e.append("g"),a=t.getConfigField("iconSize");if(o.title){const t=i.append("g");await v(t,o.title,{useHtmlLabels:!1,width:1.5*a,classes:"architecture-service-label"},r),t.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),t.attr("transform","translate("+a/2+", "+a+")")}const s=i.append("g");if(o.icon)s.html(`<g>${await y(o.icon,{height:a,width:a,fallbackPrefix:dt.prefix})}</g>`);else if(o.iconText){s.html(`<g>${await y("blank",{height:a,width:a,fallbackPrefix:dt.prefix})}</g>`);const t=s.append("g").append("foreignObject").attr("width",a).attr("height",a).append("div").attr("class","node-icon-text").attr("style",`height: ${a}px;`).append("div").html(E(o.iconText,r)),e=parseInt(window.getComputedStyle(t.node(),null).getPropertyValue("font-size").replace(/\D/g,""))??16;t.attr("style",`-webkit-line-clamp: ${Math.floor((a-2)/e)};`)}else s.append("path").attr("class","node-bkg").attr("id",`${n}-node-${o.id}`).attr("d",`M0,${a} V5 Q0,0 5,0 H${a-5} Q${a},0 ${a},5 V${a} Z`);i.attr("id",`${n}-service-${o.id}`).attr("class","architecture-service");const{width:h,height:l}=i.node().getBBox();o.width=h,o.height=l,t.setElementForId(o.id,i)}return 0},"drawServices"),ft=i(function(t,e,i,n){i.forEach(i=>{const r=e.append("g"),o=t.getConfigField("iconSize");r.append("g").append("rect").attr("id",`${n}-node-${i.id}`).attr("fill-opacity","0").attr("width",o).attr("height",o),r.attr("class","architecture-junction");const{width:a,height:s}=r._groups[0][0].getBBox();r.width=a,r.height=s,t.setElementForId(i.id,r)})},"drawJunctions");function pt(t,e,i){t.forEach(t=>{e.add({group:"nodes",data:{type:"service",id:t.id,icon:t.icon,label:t.title,parent:t.in,width:i.getConfigField("iconSize"),height:i.getConfigField("iconSize")},classes:"node-service"})})}function mt(t,e,i){t.forEach(t=>{e.add({group:"nodes",data:{type:"junction",id:t.id,parent:t.in,width:i.getConfigField("iconSize"),height:i.getConfigField("iconSize")},classes:"node-junction"})})}function vt(t,e){e.nodes().map(e=>{const i=it(e);if("group"===i.type)return;i.x=e.position().x,i.y=e.position().y;t.getElementById(i.id).attr("transform","translate("+(i.x||0)+","+(i.y||0)+")")})}function yt(t,e){t.forEach(t=>{e.add({group:"nodes",data:{type:"group",id:t.id,icon:t.icon,label:t.title,parent:t.in},classes:"node-group"})})}function Et(t,e){t.forEach(t=>{const{lhsId:i,rhsId:n,lhsInto:r,lhsGroup:o,rhsInto:a,lhsDir:s,rhsDir:h,rhsGroup:l,title:d}=t,c=W(t.lhsDir,t.rhsDir)?"segments":"straight",g={id:`${i}-${n}`,label:d,source:i,sourceDir:s,sourceArrow:r,sourceGroup:o,sourceEndpoint:"L"===s?"0 50%":"R"===s?"100% 50%":"T"===s?"50% 0":"50% 100%",target:n,targetDir:h,targetArrow:a,targetGroup:l,targetEndpoint:"L"===h?"0 50%":"R"===h?"100% 50%":"T"===h?"50% 0":"50% 100%"};e.add({group:"edges",data:g,classes:c})})}function Nt(t,e,n,r=[]){const o=i((t,e)=>Object.entries(t).reduce((t,[i,r])=>{var o;let a=0;const s=Object.entries(r);if(1===s.length)return t[i]=s[0][1],t;for(let h=0;h<s.length-1;h++)for(let r=h+1;r<s.length;r++){const[l,d]=s[h],[c,g]=s[r];if((null==(o=n[l])?void 0:o[c])===e)t[i]??(t[i]=[]),t[i]=[...t[i],...d,...g];else if("default"===l||"default"===c)t[i]??(t[i]=[]),t[i]=[...t[i],...d,...g];else{t[`${i}-${a++}`]=d;t[`${i}-${a++}`]=g}}return t},{}),"flattenAlignments"),a=e.map(e=>{const i={},n={};return Object.entries(e).forEach(([e,[r,o]])=>{var a,s,h;const l=(null==(a=t.getNode(e))?void 0:a.in)??"default";i[o]??(i[o]={}),(s=i[o])[l]??(s[l]=[]),i[o][l].push(e),n[r]??(n[r]={}),(h=n[r])[l]??(h[l]=[]),n[r][l].push(e)}),{horiz:Object.values(o(i,"horizontal")).filter(t=>t.length>1),vert:Object.values(o(n,"vertical")).filter(t=>t.length>1)}}),[s,h]=a.reduce(([t,e],{horiz:i,vert:n})=>[[...t,...i],[...e,...n]],[[],[]]),l=new Set;r.forEach(t=>t.members.forEach(t=>l.add(t)));const d=i(t=>t.filter(t=>!t.some(t=>l.has(t))),"dropOverlapping"),c=d(s),g=d(h);return r.forEach(t=>{t.members.length<2||("row"===t.direction?c.push([...t.members]):g.push([...t.members]))}),{horizontal:c,vertical:g}}function Tt(t,e,n=[]){const r=[],o=e.getConfigField("iconSize"),a=e.getConfigField("idealEdgeLengthMultiplier"),s=a*o,h=new Set;n.forEach(t=>{for(let e=0;e<t.members.length-1;e++){const i=t.members[e],n=t.members[e+1];h.add(`${i}|${n}`),h.add(`${n}|${i}`),"row"===t.direction?r.push({left:i,right:n,gap:s}):r.push({top:i,bottom:n,gap:s})}});const l=i(t=>`${t[0]},${t[1]}`,"posToStr"),d=i(t=>t.split(",").map(t=>parseInt(t)),"strToPos");return t.forEach(t=>{const e=Object.fromEntries(Object.entries(t).map(([t,e])=>[l(e),t])),i=[l([0,0])],n={},s={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};for(;i.length>0;){const t=i.shift();if(t){n[t]=1;const c=e[t];if(c){const g=d(t);Object.entries(s).forEach(([t,s])=>{const d=l([g[0]+s[0],g[1]+s[1]]),u=e[d];if(u&&!n[d]){if(i.push(d),h.has(`${c}|${u}`))return;r.push({[Y[t]]:u,[Y[X(t)]]:c,gap:a*o})}})}}}}),r}function At(t,e,n,r,a,{spatialMaps:s,groupAlignments:h}){return new Promise(l=>{const d=N("body").append("div").attr("id","cy").attr("style","display:none"),c=L({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"straight","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"edge[label]",style:{label:"data(label)"}},{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":`${a.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:`${a.getConfigField("padding")}px`}}],layout:{name:"grid",boundingBox:{x1:0,x2:100,y1:0,y2:100}}});d.remove(),yt(n,c),pt(t,c,a),mt(e,c,a),Et(r,c);const g=a.getLayoutHints(),u=Nt(a,s,h,g),f=Tt(s,a,g),p=a.getConfigField("iconSize"),m=a.getConfigField("idealEdgeLengthMultiplier")*p,v=.5*p,y=a.getConfigField("edgeElasticity"),E=a.getConfigField("seed"),T=c.layout({name:"fcose",quality:"proof",randomize:a.getConfigField("randomize"),nodeSeparation:a.getConfigField("nodeSeparation"),numIter:a.getConfigField("numIter"),styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1,idealEdgeLength(t){const[e,i]=t.connectedNodes(),{parent:n}=it(e),{parent:r}=it(i);return n===r?m:v},edgeElasticity(t){const[e,i]=t.connectedNodes(),{parent:n}=it(e),{parent:r}=it(i);return n===r?y:.001},alignmentConstraint:u,relativePlacementConstraint:f});T.one("layoutstop",()=>{var t;function e(t,e,i,n){let r,o;const{x:a,y:s}=t,{x:h,y:l}=e;o=(n-s+(a-i)*(s-l)/(a-h))/Math.sqrt(1+Math.pow((s-l)/(a-h),2)),r=Math.sqrt(Math.pow(n-s,2)+Math.pow(i-a,2)-Math.pow(o,2));r/=Math.sqrt(Math.pow(h-a,2)+Math.pow(l-s,2));let d=(h-a)*(n-s)-(l-s)*(i-a);switch(!0){case d>=0:d=1;break;case d<0:d=-1}let c=(h-a)*(i-a)+(l-s)*(n-s);switch(!0){case c>=0:c=1;break;case c<0:c=-1}return o=Math.abs(o)*d,r*=c,{distances:o,weights:r}}i(e,"getSegmentWeights"),c.startBatch();for(const i of Object.values(c.edges()))if(null==(t=i.data)?void 0:t.call(i)){const{x:t,y:n}=i.source().position(),{x:r,y:o}=i.target().position();if(t!==r&&n!==o){const t=i.sourceEndpoint(),n=i.targetEndpoint(),{sourceDir:r}=et(i),[o,a]=B(r)?[t.x,n.y]:[n.x,t.y],{weights:s,distances:h}=e(t,n,o,a);i.style("segment-distances",h),i.style("segment-weights",s)}}c.endBatch(),ht(E,()=>T.run())});try{ht(E,()=>T.run())}catch(A){if(A instanceof RangeError&&A.message.includes("Invalid array length"))throw new Error("Architecture layout failed: a declared `align row|column` directive likely contradicts the edge directions, or two declared alignments overlap on a shared node. Check that the order of members in each `align` chain is consistent with the edges between them, and that no node appears in two `align` directives along the same axis.");throw A}c.ready(t=>{o.info("Ready",t),l(c)})})}A([{name:dt.prefix,icons:dt}]),L.use(U),i(pt,"addServices"),i(mt,"addJunctions"),i(vt,"positionNodes"),i(yt,"addGroups"),i(Et,"addEdges"),i(Nt,"getAlignments"),i(Tt,"getRelativeConstraints"),i(At,"layoutArchitecture");var wt={draw:i(async(t,e,i,o)=>{const a=o.db;a.setDiagramId(e);const s=a.getServices(),h=a.getJunctions(),l=a.getGroups(),d=a.getEdges(),c=a.getDataStructures(),g=n(e),u=g.append("g");u.attr("class","architecture-edges");const f=g.append("g");f.attr("class","architecture-services");const p=g.append("g");p.attr("class","architecture-groups"),await ut(a,f,s,e),ft(a,f,h,e);const m=await At(s,h,l,d,a,c);await ct(u,m,a,e),await gt(p,m,a,e),vt(a,m),r(void 0,g,a.getConfigField("padding"),a.getConfigField("useMaxWidth"))},"draw")},It={parser:at,get db(){return new rt},renderer:wt,styles:st};export{It as diagram};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{g as t}from"./chunk-5VM5RSS4-D7_Nm3Ap.js";import{az as e,aA as r,aB as a,aC as i,aD as n,aE as s,aF as o,aG as l,aH as c,aI as d,aJ as h,aK as g,aL as u,aM as y,aN as p,aO as x,aP as b,aQ as f,aR as m,aS as w,aT as k,aU as S,aV as L,aW as _,aX as v,_ as E,y as T,d as D,e as $,l as I,p as N,r as C,c as B,aY as O,O as R,P as z,L as A,aZ as M,a_ as P,a$ as Y,ar as j,x as F,k as W,b0 as X,i as H,b1 as U,b2 as K}from"./mermaid.core-CMkyheGu.js";import{G as Z}from"./graph-DaY0Al7L.js";import{c as q}from"./channel-CnGR7l8D.js";import"./index-BvdvTk5k.js";function V(t){if(e(t))return t;const E=r(t);if(!function(t){switch(r(t)){case v:case _:case L:case S:case k:case w:case m:case f:case b:case x:case p:case y:case u:case g:case h:case d:case c:case l:case o:case s:case n:case i:return!0;default:return!1}}(t))return{};if(T=t,Array.isArray(T)){const e=Array.from(t);return t.length>0&&"string"==typeof t[0]&&Object.hasOwn(t,"index")&&(e.index=t.index,e.input=t.input),e}var T;if(a(t)){const e=t;return new(0,e.constructor)(e.buffer,e.byteOffset,e.length)}if("[object ArrayBuffer]"===E)return new ArrayBuffer(t.byteLength);if("[object DataView]"===E){const e=t,r=e.buffer,a=e.byteOffset,i=e.byteLength,n=new ArrayBuffer(i),s=new Uint8Array(r,a,i);return new Uint8Array(n).set(s),new DataView(n)}if("[object Boolean]"===E||"[object Number]"===E||"[object String]"===E){const e=new(0,t.constructor)(t.valueOf());return"[object String]"===E?function(t,e){const r=e.valueOf().length;for(const a in e)Object.hasOwn(e,a)&&(Number.isNaN(Number(a))||Number(a)>=r)&&(t[a]=e[a])}(e,t):G(e,t),e}if("[object Date]"===E)return new Date(Number(t));if("[object RegExp]"===E){const e=t,r=new RegExp(e.source,e.flags);return r.lastIndex=e.lastIndex,r}if("[object Symbol]"===E)return Object(Symbol.prototype.valueOf.call(t));if("[object Map]"===E){const e=t,r=new Map;return e.forEach((t,e)=>{r.set(e,t)}),r}if("[object Set]"===E){const e=t,r=new Set;return e.forEach(t=>{r.add(t)}),r}if("[object Arguments]"===E){const e=t,r={};return G(r,e),r.length=e.length,r[Symbol.iterator]=e[Symbol.iterator],r}const D={};return function(t,e){const r=Object.getPrototypeOf(e);null!==r&&"function"==typeof e.constructor&&Object.setPrototypeOf(t,r)}(D,t),G(D,t),function(t,e){const r=Object.getOwnPropertySymbols(e);for(let a=0;a<r.length;a++){const i=r[a];Object.prototype.propertyIsEnumerable.call(e,i)&&(t[i]=e[i])}}(D,t),D}function G(t,e){for(const r in e)Object.hasOwn(e,r)&&(t[r]=e[r])}var J=function(){var t=E(function(t,e,r,a){for(r=r||{},a=t.length;a--;r[t[a]]=e);return r},"o"),e=[1,15],r=[1,7],a=[1,13],i=[1,14],n=[1,19],s=[1,16],o=[1,17],l=[1,18],c=[8,30],d=[8,10,21,28,29,30,31,39,43,46],h=[1,23],g=[1,24],u=[8,10,15,16,21,28,29,30,31,39,43,46],y=[8,10,15,16,21,27,28,29,30,31,39,43,46],p=[1,49],x={trace:E(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:E(function(t,e,r,a,i,n,s){var o=n.length-1;switch(i){case 4:a.getLogger().debug("Rule: separator (NL) ");break;case 5:a.getLogger().debug("Rule: separator (Space) ");break;case 6:a.getLogger().debug("Rule: separator (EOF) ");break;case 7:a.getLogger().debug("Rule: hierarchy: ",n[o-1]),a.setHierarchy(n[o-1]);break;case 8:a.getLogger().debug("Stop NL ");break;case 9:a.getLogger().debug("Stop EOF ");break;case 10:a.getLogger().debug("Stop NL2 ");break;case 11:a.getLogger().debug("Stop EOF2 ");break;case 12:a.getLogger().debug("Rule: statement: ",n[o]),"number"==typeof n[o].length?this.$=n[o]:this.$=[n[o]];break;case 13:a.getLogger().debug("Rule: statement #2: ",n[o-1]),this.$=[n[o-1]].concat(n[o]);break;case 14:a.getLogger().debug("Rule: link: ",n[o],t),this.$={edgeTypeStr:n[o],label:""};break;case 15:a.getLogger().debug("Rule: LABEL link: ",n[o-3],n[o-1],n[o]),this.$={edgeTypeStr:n[o],label:n[o-1]};break;case 18:const e=parseInt(n[o]),r=a.generateId();this.$={id:r,type:"space",label:"",width:e,children:[]};break;case 23:a.getLogger().debug("Rule: (nodeStatement link node) ",n[o-2],n[o-1],n[o]," typestr: ",n[o-1].edgeTypeStr);const i=a.edgeStrToEdgeData(n[o-1].edgeTypeStr),s=a.edgeStrToEdgeStartData(n[o-1].edgeTypeStr),l=a.edgeStrToThickness(n[o-1].edgeTypeStr),c=a.edgeStrToPattern(n[o-1].edgeTypeStr);this.$=[{id:n[o-2].id,label:n[o-2].label,type:n[o-2].type,directions:n[o-2].directions},{id:n[o-2].id+"-"+n[o].id,start:n[o-2].id,end:n[o].id,label:n[o-1].label,type:"edge",thickness:l,pattern:c,directions:n[o].directions,arrowTypeEnd:i,arrowTypeStart:s},{id:n[o].id,label:n[o].label,type:a.typeStr2Type(n[o].typeStr),directions:n[o].directions}];break;case 24:a.getLogger().debug("Rule: nodeStatement (abc88 node size) ",n[o-1],n[o]),this.$={id:n[o-1].id,label:n[o-1].label,type:a.typeStr2Type(n[o-1].typeStr),directions:n[o-1].directions,widthInColumns:parseInt(n[o],10)};break;case 25:a.getLogger().debug("Rule: nodeStatement (node) ",n[o]),this.$={id:n[o].id,label:n[o].label,type:a.typeStr2Type(n[o].typeStr),directions:n[o].directions,widthInColumns:1};break;case 26:a.getLogger().debug("APA123",this?this:"na"),a.getLogger().debug("COLUMNS: ",n[o]),this.$={type:"column-setting",columns:"auto"===n[o]?-1:parseInt(n[o])};break;case 27:a.getLogger().debug("Rule: id-block statement : ",n[o-2],n[o-1]),a.generateId(),this.$={...n[o-2],type:"composite",children:n[o-1]};break;case 28:a.getLogger().debug("Rule: blockStatement : ",n[o-2],n[o-1],n[o]);const d=a.generateId();this.$={id:d,type:"composite",label:"",children:n[o-1]};break;case 29:a.getLogger().debug("Rule: node (NODE_ID separator): ",n[o]),this.$={id:n[o]};break;case 30:a.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",n[o-1],n[o]),this.$={id:n[o-1],label:n[o].label,typeStr:n[o].typeStr,directions:n[o].directions};break;case 31:a.getLogger().debug("Rule: dirList: ",n[o]),this.$=[n[o]];break;case 32:a.getLogger().debug("Rule: dirList: ",n[o-1],n[o]),this.$=[n[o-1]].concat(n[o]);break;case 33:a.getLogger().debug("Rule: nodeShapeNLabel: ",n[o-2],n[o-1],n[o]),this.$={typeStr:n[o-2]+n[o],label:n[o-1]};break;case 34:a.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",n[o-3],n[o-2]," #3:",n[o-1],n[o]),this.$={typeStr:n[o-3]+n[o],label:n[o-2],directions:n[o-1]};break;case 35:case 36:this.$={type:"classDef",id:n[o-1].trim(),css:n[o].trim()};break;case 37:this.$={type:"applyClass",id:n[o-1].trim(),styleClass:n[o].trim()};break;case 38:this.$={type:"applyStyles",id:n[o-1].trim(),stylesStr:n[o].trim()}}},"anonymous"),table:[{9:1,10:[1,2]},{1:[3]},{10:e,11:3,13:4,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:a,29:i,31:n,39:s,43:o,46:l},{8:[1,20]},t(c,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,10:e,21:r,28:a,29:i,31:n,39:s,43:o,46:l}),t(d,[2,16],{14:22,15:h,16:g}),t(d,[2,17]),t(d,[2,18]),t(d,[2,19]),t(d,[2,20]),t(d,[2,21]),t(d,[2,22]),t(u,[2,25],{27:[1,25]}),t(d,[2,26]),{19:26,26:12,31:n},{10:e,11:27,13:4,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:a,29:i,31:n,39:s,43:o,46:l},{40:[1,28],42:[1,29]},{44:[1,30]},{47:[1,31]},t(y,[2,29],{32:32,35:[1,33],37:[1,34]}),{1:[2,7]},t(c,[2,13]),{26:35,31:n},{31:[2,14]},{17:[1,36]},t(u,[2,24]),{10:e,11:37,13:4,14:22,15:h,16:g,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:a,29:i,31:n,39:s,43:o,46:l},{30:[1,38]},{41:[1,39]},{41:[1,40]},{45:[1,41]},{48:[1,42]},t(y,[2,30]),{18:[1,43]},{18:[1,44]},t(u,[2,23]),{18:[1,45]},{30:[1,46]},t(d,[2,28]),t(d,[2,35]),t(d,[2,36]),t(d,[2,37]),t(d,[2,38]),{36:[1,47]},{33:48,34:p},{15:[1,50]},t(d,[2,27]),t(y,[2,33]),{38:[1,51]},{33:52,34:p,38:[2,31]},{31:[2,15]},t(y,[2,34]),{38:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:E(function(t,e){if(!e.recoverable){var r=new Error(t);throw r.hash=e,r}this.trace(t)},"parseError"),parse:E(function(t){var e=this,r=[0],a=[],i=[null],n=[],s=this.table,o="",l=0,c=0,d=n.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var u in this.yy)Object.prototype.hasOwnProperty.call(this.yy,u)&&(g.yy[u]=this.yy[u]);h.setInput(t,g.yy),g.yy.lexer=h,g.yy.parser=this,void 0===h.yylloc&&(h.yylloc={});var y=h.yylloc;n.push(y);var p=h.options&&h.options.ranges;function x(){var t;return"number"!=typeof(t=a.pop()||h.lex()||1)&&(t instanceof Array&&(t=(a=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof g.yy.parseError?this.parseError=g.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,E(function(t){r.length=r.length-2*t,i.length=i.length-t,n.length=n.length-t},"popStack"),E(x,"lex");for(var b,f,m,w,k,S,L,_,v={};;){if(f=r[r.length-1],this.defaultActions[f]?m=this.defaultActions[f]:(null==b&&(b=x()),m=s[f]&&s[f][b]),void 0===m||!m.length||!m[0]){var T="";for(k in _=[],s[f])this.terminals_[k]&&k>2&&_.push("'"+this.terminals_[k]+"'");T=h.showPosition?"Parse error on line "+(l+1)+":\n"+h.showPosition()+"\nExpecting "+_.join(", ")+", got '"+(this.terminals_[b]||b)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==b?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(T,{text:h.match,token:this.terminals_[b]||b,line:h.yylineno,loc:y,expected:_})}if(m[0]instanceof Array&&m.length>1)throw new Error("Parse Error: multiple actions possible at state: "+f+", token: "+b);switch(m[0]){case 1:r.push(b),i.push(h.yytext),n.push(h.yylloc),r.push(m[1]),b=null,c=h.yyleng,o=h.yytext,l=h.yylineno,y=h.yylloc;break;case 2:if(S=this.productions_[m[1]][1],v.$=i[i.length-S],v._$={first_line:n[n.length-(S||1)].first_line,last_line:n[n.length-1].last_line,first_column:n[n.length-(S||1)].first_column,last_column:n[n.length-1].last_column},p&&(v._$.range=[n[n.length-(S||1)].range[0],n[n.length-1].range[1]]),void 0!==(w=this.performAction.apply(v,[o,c,l,g.yy,m[1],i,n].concat(d))))return w;S&&(r=r.slice(0,-1*S*2),i=i.slice(0,-1*S),n=n.slice(0,-1*S)),r.push(this.productions_[m[1]][0]),i.push(v.$),n.push(v._$),L=s[r[r.length-2]][r[r.length-1]],r.push(L);break;case 3:return!0}}return!0},"parse")},b=function(){return{EOF:1,parseError:E(function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},"parseError"),setInput:E(function(t,e){return this.yy=e||this.yy||{},this._input=t,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:E(function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},"input"),unput:E(function(t){var e=t.length,r=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var a=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),r.length-1&&(this.yylineno-=r.length-1);var i=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:r?(r.length===a.length?this.yylloc.first_column:0)+a[a.length-r.length].length-r[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},"unput"),more:E(function(){return this._more=!0,this},"more"),reject:E(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:E(function(t){this.unput(this.match.slice(t))},"less"),pastInput:E(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:E(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:E(function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},"showPosition"),test_match:E(function(t,e){var r,a,i;if(this.options.backtrack_lexer&&(i={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&&(i.yylloc.range=this.yylloc.range.slice(0))),(a=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=a.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:a?a[a.length-1].length-a[a.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,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(t[0].length),this.matched+=t[0],r=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var n in i)this[n]=i[n];return!1}return!1},"test_match"),next:E(function(){if(this.done)return this.EOF;var t,e,r,a;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),n=0;n<i.length;n++)if((r=this._input.match(this.rules[i[n]]))&&(!e||r[0].length>e[0].length)){if(e=r,a=n,this.options.backtrack_lexer){if(!1!==(t=this.test_match(r,i[n])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,i[a]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:E(function(){var t=this.next();return t||this.lex()},"lex"),begin:E(function(t){this.conditionStack.push(t)},"begin"),popState:E(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:E(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:E(function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:E(function(t){this.begin(t)},"pushState"),stateStackSize:E(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:E(function(t,e,r,a){switch(r){case 0:return t.getLogger().debug("Found block-beta"),10;case 1:return t.getLogger().debug("Found id-block"),29;case 2:return t.getLogger().debug("Found block"),10;case 3:t.getLogger().debug(".",e.yytext);break;case 4:t.getLogger().debug("_",e.yytext);break;case 5:return 5;case 6:return e.yytext=-1,28;case 7:return e.yytext=e.yytext.replace(/columns\s+/,""),t.getLogger().debug("COLUMNS (LEX)",e.yytext),28;case 8:case 76:case 77:case 99:this.pushState("md_string");break;case 9:return"MD_STR";case 10:case 34:case 79:this.popState();break;case 11:this.pushState("string");break;case 12:t.getLogger().debug("LEX: POPPING STR:",e.yytext),this.popState();break;case 13:return t.getLogger().debug("LEX: STR end:",e.yytext),"STR";case 14:return e.yytext=e.yytext.replace(/space\:/,""),t.getLogger().debug("SPACE NUM (LEX)",e.yytext),21;case 15:return e.yytext="1",t.getLogger().debug("COLUMNS (LEX)",e.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 35:return"acc_descr_multiline_value";case 36:return 30;case 37:case 38:case 40:case 41:case 44:return this.popState(),t.getLogger().debug("Lex: (("),"NODE_DEND";case 39:return this.popState(),t.getLogger().debug("Lex: ))"),"NODE_DEND";case 42:return this.popState(),t.getLogger().debug("Lex: (-"),"NODE_DEND";case 43:return this.popState(),t.getLogger().debug("Lex: -)"),"NODE_DEND";case 45:return this.popState(),t.getLogger().debug("Lex: ]]"),"NODE_DEND";case 46:return this.popState(),t.getLogger().debug("Lex: ("),"NODE_DEND";case 47:return this.popState(),t.getLogger().debug("Lex: ])"),"NODE_DEND";case 48:case 49:return this.popState(),t.getLogger().debug("Lex: /]"),"NODE_DEND";case 50:return this.popState(),t.getLogger().debug("Lex: )]"),"NODE_DEND";case 51:return this.popState(),t.getLogger().debug("Lex: )"),"NODE_DEND";case 52:return this.popState(),t.getLogger().debug("Lex: ]>"),"NODE_DEND";case 53:return this.popState(),t.getLogger().debug("Lex: ]"),"NODE_DEND";case 54:return t.getLogger().debug("Lexa: -)"),this.pushState("NODE"),35;case 55:return t.getLogger().debug("Lexa: (-"),this.pushState("NODE"),35;case 56:return t.getLogger().debug("Lexa: ))"),this.pushState("NODE"),35;case 57:case 59:case 60:case 61:case 64:return t.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 58:return t.getLogger().debug("Lex: ((("),this.pushState("NODE"),35;case 62:return t.getLogger().debug("Lexc: >"),this.pushState("NODE"),35;case 63:return t.getLogger().debug("Lexa: (["),this.pushState("NODE"),35;case 65:case 66:case 67:case 68:case 69:case 70:case 71:return this.pushState("NODE"),35;case 72:return t.getLogger().debug("Lexa: ["),this.pushState("NODE"),35;case 73:return this.pushState("BLOCK_ARROW"),t.getLogger().debug("LEX ARR START"),37;case 74:return t.getLogger().debug("Lex: NODE_ID",e.yytext),31;case 75:return t.getLogger().debug("Lex: EOF",e.yytext),8;case 78:return"NODE_DESCR";case 80:t.getLogger().debug("Lex: Starting string"),this.pushState("string");break;case 81:t.getLogger().debug("LEX ARR: Starting string"),this.pushState("string");break;case 82:return t.getLogger().debug("LEX: NODE_DESCR:",e.yytext),"NODE_DESCR";case 83:t.getLogger().debug("LEX POPPING"),this.popState();break;case 84:t.getLogger().debug("Lex: =>BAE"),this.pushState("ARROW_DIR");break;case 85:return e.yytext=e.yytext.replace(/^,\s*/,""),t.getLogger().debug("Lex (right): dir:",e.yytext),"DIR";case 86:return e.yytext=e.yytext.replace(/^,\s*/,""),t.getLogger().debug("Lex (left):",e.yytext),"DIR";case 87:return e.yytext=e.yytext.replace(/^,\s*/,""),t.getLogger().debug("Lex (x):",e.yytext),"DIR";case 88:return e.yytext=e.yytext.replace(/^,\s*/,""),t.getLogger().debug("Lex (y):",e.yytext),"DIR";case 89:return e.yytext=e.yytext.replace(/^,\s*/,""),t.getLogger().debug("Lex (up):",e.yytext),"DIR";case 90:return e.yytext=e.yytext.replace(/^,\s*/,""),t.getLogger().debug("Lex (down):",e.yytext),"DIR";case 91:return e.yytext="]>",t.getLogger().debug("Lex (ARROW_DIR end):",e.yytext),this.popState(),this.popState(),"BLOCK_ARROW_END";case 92:return t.getLogger().debug("Lex: LINK","#"+e.yytext+"#"),15;case 93:case 94:case 95:return t.getLogger().debug("Lex: LINK",e.yytext),15;case 96:case 97:case 98:return t.getLogger().debug("Lex: START_LINK",e.yytext),this.pushState("LLABEL"),16;case 100:return t.getLogger().debug("Lex: Starting string"),this.pushState("string"),"LINK_LABEL";case 101:return this.popState(),t.getLogger().debug("Lex: LINK","#"+e.yytext+"#"),15;case 102:case 103:return this.popState(),t.getLogger().debug("Lex: LINK",e.yytext),15;case 104:return t.getLogger().debug("Lex: COLON",e.yytext),e.yytext=e.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}}}}();function f(){this.yy={}}return x.lexer=b,E(f,"Parser"),f.prototype=x,x.Parser=f,new f}();J.parser=J;var Q=J,tt=new Map,et=[],rt=new Map,at="color",it="fill",nt=new Map,st="",ot=E(t=>W.sanitizeText(t,B()),"sanitizeText"),lt=E(function(t,e=""){let r=nt.get(t);r||(r={id:t,styles:[],textStyles:[]},nt.set(t,r)),null!=e&&e.split(",").forEach(t=>{const e=t.replace(/([^;]*);/,"$1").trim();if(RegExp(at).exec(t)){const t=e.replace(it,"bgFill").replace(at,it);r.textStyles.push(t)}r.styles.push(e)})},"addStyleClass"),ct=E(function(t,e=""){const r=tt.get(t);null!=e&&(r.styles=e.split(","))},"addStyle2Node"),dt=E(function(t,e){t.split(",").forEach(function(t){let r=tt.get(t);if(void 0===r){const e=t.trim();r={id:e,type:"na",children:[]},tt.set(e,r)}r.classes||(r.classes=[]),r.classes.push(e)})},"setCssClass"),ht=E((t,e)=>{const r=t.flat(),a=[],i=r.find(t=>"column-setting"===(null==t?void 0:t.type)),n=(null==i?void 0:i.columns)??-1;for(const s of r)if("number"==typeof n&&n>0&&"column-setting"!==s.type&&"number"==typeof s.widthInColumns&&s.widthInColumns>n&&I.warn(`Block ${s.id} width ${s.widthInColumns} exceeds configured column width ${n}`),s.label&&(s.label=ot(s.label)),"classDef"!==s.type)if("applyClass"!==s.type)if("applyStyles"!==s.type)if("column-setting"===s.type)e.columns=s.columns??-1;else if("edge"===s.type){const t=(rt.get(s.id)??0)+1;rt.set(s.id,t),s.id=t+"-"+s.id,et.push(s)}else{s.label||("composite"===s.type?s.label="":s.label=s.id);const t=tt.get(s.id);if(void 0===t?tt.set(s.id,s):("na"!==s.type&&(t.type=s.type),s.label!==s.id&&(t.label=s.label)),s.children&&ht(s.children,s),"space"===s.type){const t=s.width??1;for(let e=0;e<t;e++){const t=V(s);t.id=t.id+"-"+e,tt.set(t.id,t),a.push(t)}}else void 0===t&&a.push(s)}else(null==s?void 0:s.stylesStr)&&ct(s.id,null==s?void 0:s.stylesStr);else dt(s.id,(null==s?void 0:s.styleClass)??"");else lt(s.id,s.css);e.children=a},"populateBlockDatabase"),gt=[],ut={id:"root",type:"composite",children:[],columns:-1},yt=E(()=>{I.debug("Clear called"),N(),ut={id:"root",type:"composite",children:[],columns:-1},tt=new Map([["root",ut]]),gt=[],nt=new Map,et=[],rt=new Map,st=""},"clear");function pt(t){switch(I.debug("typeStr2Type",t),t){case"[]":return"square";case"()":return I.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"}}function xt(t){return I.debug("typeStr2Type",t),"=="===t?"thick":"normal"}function bt(t){switch(t.trim().slice(-1)){case"x":return"arrow_cross";case"o":return"arrow_circle";case">":return"arrow_point";default:return""}}function ft(t){switch(t.trim().charAt(0)){case"x":return"arrow_cross";case"o":return"arrow_circle";case"<":return"arrow_point";default:return"arrow_open"}}function mt(t){return t.includes("==")?"thick":"normal"}function wt(t){return t.includes(".-")?"dotted":"solid"}E(pt,"typeStr2Type"),E(xt,"edgeTypeStr2Type"),E(bt,"edgeStrToEdgeData"),E(ft,"edgeStrToEdgeStartData"),E(mt,"edgeStrToThickness"),E(wt,"edgeStrToPattern");var kt=0,St=E(()=>(kt++,"id-"+Math.random().toString(36).substr(2,12)+"-"+kt),"generateId"),Lt=E(t=>{ut.children=t,ht(t,ut),gt=ut.children},"setHierarchy"),_t=E(t=>{const e=tt.get(t);return e?e.columns?e.columns:e.children?e.children.length:-1:-1},"getColumns"),vt=E(()=>[...tt.values()],"getBlocksFlat"),Et=E(()=>gt||[],"getBlocks"),Tt=E(()=>et,"getEdges"),Dt=E(t=>tt.get(t),"getBlock"),$t=E(t=>{tt.set(t.id,t)},"setBlock"),It=E(t=>{st=t},"setDiagramId"),Nt=E(()=>st,"getDiagramId"),Ct=E(()=>I,"getLogger"),Bt=E(function(){return nt},"getClasses"),Ot={getConfig:E(()=>T().block,"getConfig"),typeStr2Type:pt,edgeTypeStr2Type:xt,edgeStrToEdgeData:bt,edgeStrToEdgeStartData:ft,edgeStrToThickness:mt,edgeStrToPattern:wt,getLogger:Ct,getBlocksFlat:vt,getBlocks:Et,getEdges:Tt,setHierarchy:Lt,getBlock:Dt,setBlock:$t,getColumns:_t,getClasses:Bt,clear:yt,generateId:St,setDiagramId:It,getDiagramId:Nt},Rt=E((t,e)=>{const r=q,a=r(t,"r"),i=r(t,"g"),n=r(t,"b");return C(a,i,n,e)},"fade"),zt=E(e=>`.label {\n font-family: ${e.fontFamily};\n color: ${e.nodeTextColor||e.textColor};\n }\n .cluster-label text {\n fill: ${e.titleColor};\n }\n .cluster-label span,p {\n color: ${e.titleColor};\n }\n\n\n\n .label text,span,p {\n fill: ${e.nodeTextColor||e.textColor};\n color: ${e.nodeTextColor||e.textColor};\n }\n\n .node rect,\n .node circle,\n .node ellipse,\n .node polygon,\n .node path {\n fill: ${e.mainBkg};\n stroke: ${e.nodeBorder};\n stroke-width: 1px;\n }\n .flowchart-label text {\n text-anchor: middle;\n }\n // .flowchart-label .text-outer-tspan {\n // text-anchor: middle;\n // }\n // .flowchart-label .text-inner-tspan {\n // text-anchor: start;\n // }\n\n .node .label {\n text-align: center;\n }\n .node.clickable {\n cursor: pointer;\n }\n\n .arrowheadPath {\n fill: ${e.arrowheadColor};\n }\n\n .edgePath .path {\n stroke: ${e.lineColor};\n stroke-width: 2.0px;\n }\n\n .flowchart-link {\n stroke: ${e.lineColor};\n fill: none;\n }\n\n .edgeLabel {\n background-color: ${e.edgeLabelBackground};\n /*\n * This is for backward compatibility with existing code that didn't\n * add a \`<p>\` around edge labels.\n *\n * TODO: We should probably remove this in a future release.\n */\n p {\n margin: 0;\n padding: 0;\n display: inline;\n }\n rect {\n opacity: 0.5;\n background-color: ${e.edgeLabelBackground};\n fill: ${e.edgeLabelBackground};\n }\n text-align: center;\n }\n\n /* For html labels only */\n .labelBkg {\n background-color: ${e.edgeLabelBackground};\n }\n\n .node .cluster {\n // fill: ${Rt(e.mainBkg,.5)};\n fill: ${Rt(e.clusterBkg,.5)};\n stroke: ${Rt(e.clusterBorder,.2)};\n box-shadow: rgba(50, 50, 93, 0.25) 0px 13px 27px -5px, rgba(0, 0, 0, 0.3) 0px 8px 16px -8px;\n stroke-width: 1px;\n }\n\n .cluster text {\n fill: ${e.titleColor};\n }\n\n .cluster span,p {\n color: ${e.titleColor};\n }\n /* .cluster div {\n color: ${e.titleColor};\n } */\n\n div.mermaidTooltip {\n position: absolute;\n text-align: center;\n max-width: 200px;\n padding: 2px;\n font-family: ${e.fontFamily};\n font-size: 12px;\n background: ${e.tertiaryColor};\n border: 1px solid ${e.border2};\n border-radius: 2px;\n pointer-events: none;\n z-index: 100;\n }\n\n .flowchartTitleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${e.textColor};\n }\n ${t()}\n`,"getStyles"),At=E((t,e,r,a)=>{e.forEach(e=>{Mt[e](t,r,a)})},"insertMarkers"),Mt={extension:E((t,e,r)=>{I.trace("Making markers for ",r),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionStart").attr("class","marker extension "+e).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"),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionEnd").attr("class","marker extension "+e).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"),composition:E((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionStart").attr("class","marker composition "+e).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"),t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionEnd").attr("class","marker composition "+e).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"),aggregation:E((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationStart").attr("class","marker aggregation "+e).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"),t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationEnd").attr("class","marker aggregation "+e).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"),dependency:E((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyStart").attr("class","marker dependency "+e).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"),t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyEnd").attr("class","marker dependency "+e).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"),lollipop:E((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopStart").attr("class","marker lollipop "+e).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),t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopEnd").attr("class","marker lollipop "+e).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"),point:E((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-pointEnd").attr("class","marker "+e).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"),t.append("marker").attr("id",r+"_"+e+"-pointStart").attr("class","marker "+e).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"),circle:E((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-circleEnd").attr("class","marker "+e).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"),t.append("marker").attr("id",r+"_"+e+"-circleStart").attr("class","marker "+e).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"),cross:E((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-crossEnd").attr("class","marker cross "+e).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"),t.append("marker").attr("id",r+"_"+e+"-crossStart").attr("class","marker cross "+e).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"),barb:E((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-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")},Pt=At;function Yt(t,e){if(0===t||!Number.isInteger(t))throw new Error("Columns must be an integer !== 0.");if(e<0||!Number.isInteger(e))throw new Error("Position must be a non-negative integer."+e);if(t<0)return{px:e,py:0};if(1===t)return{px:0,py:e};return{px:e%t,py:Math.floor(e/t)}}E(Yt,"calculateBlockPosition");var jt=E(t=>{let e=0,r=0;for(const a of t.children){const{width:t,height:i,x:n,y:s}=a.size??{width:0,height:0,x:0,y:0};if(I.debug("getMaxChildSize abc95 child:",a.id,"width:",t,"height:",i,"x:",n,"y:",s,a.type),"space"===a.type)continue;const o=t/(a.widthInColumns??1);o>e&&(e=o),i>r&&(r=i)}return{width:e,height:r}},"getMaxChildSize");function Ft(t,e,r=0,a=0,i=8){var n,s,o,l,c,d,h,g,u,y,p;I.debug("setBlockSizes abc95 (start)",t.id,null==(n=null==t?void 0:t.size)?void 0:n.x,"block width =",null==t?void 0:t.size,"siblingWidth",r),(null==(s=null==t?void 0:t.size)?void 0:s.width)||(t.size={width:r,height:a,x:0,y:0});let x=0,b=0;if((null==(o=t.children)?void 0:o.length)>0){for(const r of t.children)Ft(r,e,0,0,i);const n=jt(t);x=n.width,b=n.height,I.debug("setBlockSizes abc95 maxWidth of",t.id,":s children is ",x,b);for(const e of t.children)e.size&&(I.debug(`abc95 Setting size of children of ${t.id} id=${e.id} ${x} ${b} ${JSON.stringify(e.size)}`),e.size.width=x*(e.widthInColumns??1)+i*((e.widthInColumns??1)-1),e.size.height=b,e.size.x=0,e.size.y=0,I.debug(`abc95 updating size of ${t.id} children child:${e.id} maxWidth:${x} maxHeight:${b}`));for(const r of t.children)Ft(r,e,x,b,i);const s=t.columns??-1;let o=0;for(const e of t.children)o+=e.widthInColumns??1;let g=t.children.length;s>0&&s<o&&(g=s);const u=Math.ceil(o/g);let y=g*(x+i)+i,p=u*(b+i)+i;if(y<r){I.debug(`Detected to small sibling: abc95 ${t.id} siblingWidth ${r} siblingHeight ${a} width ${y}`),y=r,p=a;const e=(r-g*i-i)/g,n=(a-u*i-i)/u;I.debug("Size indata abc88",t.id,"childWidth",e,"maxWidth",x),I.debug("Size indata abc88",t.id,"childHeight",n,"maxHeight",b),I.debug("Size indata abc88 xSize",g,"padding",i);for(const r of t.children)r.size&&(r.size.width=e,r.size.height=n,r.size.x=0,r.size.y=0)}if(I.debug(`abc95 (finale calc) ${t.id} xSize ${g} ySize ${u} columns ${s}${t.children.length} width=${Math.max(y,(null==(l=t.size)?void 0:l.width)||0)}`),y<((null==(c=null==t?void 0:t.size)?void 0:c.width)||0)){y=(null==(d=null==t?void 0:t.size)?void 0:d.width)||0;const e=s>0?Math.min(t.children.length,s):t.children.length;if(e>0){const r=(y-e*i-i)/e;I.debug("abc95 (growing to fit) width",t.id,y,null==(h=t.size)?void 0:h.width,r);for(const e of t.children)e.size&&(e.size.width=r)}}t.size={width:y,height:p,x:0,y:0}}I.debug("setBlockSizes abc94 (done)",t.id,null==(g=null==t?void 0:t.size)?void 0:g.x,null==(u=null==t?void 0:t.size)?void 0:u.width,null==(y=null==t?void 0:t.size)?void 0:y.y,null==(p=null==t?void 0:t.size)?void 0:p.height)}function Wt(t,e,r=8){var a,i,n,s,o,l,c,d,h,g,u,y,p,x,b,f,m;I.debug(`abc85 layout blocks (=>layoutBlocks) ${t.id} x: ${null==(a=null==t?void 0:t.size)?void 0:a.x} y: ${null==(i=null==t?void 0:t.size)?void 0:i.y} width: ${null==(n=null==t?void 0:t.size)?void 0:n.width}`);const w=t.columns??-1;if(I.debug("layoutBlocks columns abc95",t.id,"=>",w,t),t.children&&t.children.length>0){const a=(null==(o=null==(s=null==t?void 0:t.children[0])?void 0:s.size)?void 0:o.width)??0,i=t.children.length*a+(t.children.length-1)*r;I.debug("widthOfChildren 88",i,"posX");const n=new Map;{let e=0;for(const r of t.children){if(!r.size)continue;const{py:t}=Yt(w,e),a=n.get(t)??0;r.size.height>a&&n.set(t,r.size.height);let i=(null==r?void 0:r.widthInColumns)??1;w>0&&(i=Math.min(i,w-e%w)),e+=i}}const b=new Map;{let t=0;const e=[...n.keys()].sort((t,e)=>t-e);for(const a of e)b.set(a,t),t+=(n.get(a)??0)+r}let f=0;I.debug("abc91 block?.size?.x",t.id,null==(l=null==t?void 0:t.size)?void 0:l.x);let m=(null==(c=null==t?void 0:t.size)?void 0:c.x)?(null==(d=null==t?void 0:t.size)?void 0:d.x)+(-(null==(h=null==t?void 0:t.size)?void 0:h.width)/2||0):-r,k=0;for(const s of t.children){const a=t;if(!s.size)continue;const{width:i,height:o}=s.size,{px:l,py:c}=Yt(w,f);if(c!=k&&(k=c,m=(null==(g=null==t?void 0:t.size)?void 0:g.x)?(null==(u=null==t?void 0:t.size)?void 0:u.x)+(-(null==(y=null==t?void 0:t.size)?void 0:y.width)/2||0):-r,I.debug("New row in layout for block",t.id," and child ",s.id,k)),I.debug(`abc89 layout blocks (child) id: ${s.id} Pos: ${f} (px, py) ${l},${c} (${null==(p=null==a?void 0:a.size)?void 0:p.x},${null==(x=null==a?void 0:a.size)?void 0:x.y}) parent: ${a.id} width: ${i}${r}`),a.size){const t=i/2;s.size.x=m+r+t,I.debug(`abc91 layout blocks (calc) px, pyid:${s.id} startingPos=X${m} new startingPosX${s.size.x} ${t} padding=${r} width=${i} halfWidth=${t} => x:${s.size.x} y:${s.size.y} ${s.widthInColumns} (width * (child?.w || 1)) / 2 ${i*((null==s?void 0:s.widthInColumns)??1)/2}`),m=s.size.x+t;const e=b.get(c)??0,l=n.get(c)??o;s.size.y=a.size.y-a.size.height/2+e+l/2+r,I.debug(`abc88 layout blocks (calc) px, pyid:${s.id}startingPosX${m}${r}${t}=>x:${s.size.x}y:${s.size.y}${s.widthInColumns}(width * (child?.w || 1)) / 2${i*((null==s?void 0:s.widthInColumns)??1)/2}`)}s.children&&Wt(s,e,r);let d=(null==s?void 0:s.widthInColumns)??1;w>0&&(d=Math.min(d,w-f%w)),f+=d,I.debug("abc88 columnsPos",s,f)}}I.debug(`layout blocks (<==layoutBlocks) ${t.id} x: ${null==(b=null==t?void 0:t.size)?void 0:b.x} y: ${null==(f=null==t?void 0:t.size)?void 0:f.y} width: ${null==(m=null==t?void 0:t.size)?void 0:m.width}`)}function Xt(t,{minX:e,minY:r,maxX:a,maxY:i}={minX:0,minY:0,maxX:0,maxY:0}){if(t.size&&"root"!==t.id){const{x:n,y:s,width:o,height:l}=t.size;n-o/2<e&&(e=n-o/2),s-l/2<r&&(r=s-l/2),n+o/2>a&&(a=n+o/2),s+l/2>i&&(i=s+l/2)}if(t.children)for(const n of t.children)({minX:e,minY:r,maxX:a,maxY:i}=Xt(n,{minX:e,minY:r,maxX:a,maxY:i}));return{minX:e,minY:r,maxX:a,maxY:i}}function Ht(t){var e,r;const a=t.getBlock("root");if(!a)return;const i=(null==(r=null==(e=B())?void 0:e.block)?void 0:r.padding)??8;Ft(a,t,0,0,i),Wt(a,t,i),I.debug("getBlocks",JSON.stringify(a,null,2));const{minX:n,minY:s,maxX:o,maxY:l}=Xt(a);return{x:n,y:s,width:o-n,height:l-s}}E(Ft,"setBlockSizes"),E(Wt,"layoutBlocks"),E(Xt,"findBounds"),E(Ht,"layout");var Ut=E(async(t,e,r,a=!1,i=!1)=>{let n=e||"";"object"==typeof n&&(n=n[0]);const s=B(),o=M(s);return await P(t,n,{style:r,isTitle:a,useHtmlLabels:o,markdown:!1,isNode:i,width:Number.POSITIVE_INFINITY},s)},"createLabel"),Kt=E((t,e,r,a,i)=>{e.arrowTypeStart&&qt(t,"start",e.arrowTypeStart,r,a,i),e.arrowTypeEnd&&qt(t,"end",e.arrowTypeEnd,r,a,i)},"addEdgeMarkers"),Zt={arrow_cross:"cross",arrow_point:"point",arrow_barb:"barb",arrow_circle:"circle",aggregation:"aggregation",extension:"extension",composition:"composition",dependency:"dependency",lollipop:"lollipop"},qt=E((t,e,r,a,i,n)=>{const s=Zt[r];if(!s)return void I.warn(`Unknown arrow type: ${r}`);const o="start"===e?"Start":"End";t.attr(`marker-${e}`,`url(${a}#${i}_${n}-${s}${o})`)},"addEdgeMarker"),Vt={},Gt={},Jt=E(async(t,e)=>{const r=B(),a=M(r),i=t.insert("g").attr("class","edgeLabel"),n=i.insert("g").attr("class","label"),s="markdown"===e.labelType,o=await P(t,e.label,{style:e.labelStyle,useHtmlLabels:a,addSvgBackground:s,isNode:!1,markdown:s,width:s?void 0:Number.POSITIVE_INFINITY},r);n.node().appendChild(o);let l,c=o.getBBox(),d=c;if(a){const t=o.children[0],e=D(o);c=t.getBoundingClientRect(),d=c,e.attr("width",c.width),e.attr("height",c.height)}else{const t=D(o).select("text").node();t&&"function"==typeof t.getBBox&&(d=t.getBBox())}if(n.attr("transform",Y(d,a)),Vt[e.id]=i,e.width=c.width,e.height=c.height,e.startLabelLeft){const r=t.insert("g").attr("class","edgeTerminals"),i=r.insert("g").attr("class","inner"),n=await Ut(i,e.startLabelLeft,e.labelStyle);l=n;let s=n.getBBox();if(a){const t=n.children[0],e=D(n);s=t.getBoundingClientRect(),e.attr("width",s.width),e.attr("height",s.height)}i.attr("transform",Y(s,a)),Gt[e.id]||(Gt[e.id]={}),Gt[e.id].startLeft=r,Qt(l,e.startLabelLeft)}if(e.startLabelRight){const r=t.insert("g").attr("class","edgeTerminals"),i=r.insert("g").attr("class","inner"),n=await Ut(i,e.startLabelRight,e.labelStyle);l=n;let s=n.getBBox();if(a){const t=n.children[0],e=D(n);s=t.getBoundingClientRect(),e.attr("width",s.width),e.attr("height",s.height)}i.attr("transform",Y(s,a)),Gt[e.id]||(Gt[e.id]={}),Gt[e.id].startRight=r,Qt(l,e.startLabelRight)}if(e.endLabelLeft){const r=t.insert("g").attr("class","edgeTerminals"),i=r.insert("g").attr("class","inner"),n=await Ut(r,e.endLabelLeft,e.labelStyle);l=n;let s=n.getBBox();if(a){const t=n.children[0],e=D(n);s=t.getBoundingClientRect(),e.attr("width",s.width),e.attr("height",s.height)}i.attr("transform",Y(s,a)),Gt[e.id]||(Gt[e.id]={}),Gt[e.id].endLeft=r,Qt(l,e.endLabelLeft)}if(e.endLabelRight){const r=t.insert("g").attr("class","edgeTerminals"),i=r.insert("g").attr("class","inner"),n=await Ut(r,e.endLabelRight,e.labelStyle);l=n;let s=n.getBBox();if(a){const t=n.children[0],e=D(n);s=t.getBoundingClientRect(),e.attr("width",s.width),e.attr("height",s.height)}i.attr("transform",Y(s,a)),Gt[e.id]||(Gt[e.id]={}),Gt[e.id].endRight=r,Qt(l,e.endLabelRight)}return o},"insertEdgeLabel");function Qt(t,e){M(B())&&t&&(t.style.width=9*e.length+"px",t.style.height="12px")}E(Qt,"setTerminalWidth");var te=E((t,e)=>{I.debug("Moving label abc88 ",t.id,t.label,Vt[t.id],e);let r=e.updatedPath?e.updatedPath:e.originalPath;const a=B(),{subGraphTitleTotalMargin:i}=j(a);if(t.label){const a=Vt[t.id];let n=t.x,s=t.y;if(r){const a=F.calcLabelPosition(r);I.debug("Moving label "+t.label+" from (",n,",",s,") to (",a.x,",",a.y,") abc88"),e.updatedPath&&(n=a.x,s=a.y)}a.attr("transform",`translate(${n}, ${s+i/2})`)}if(t.startLabelLeft){const e=Gt[t.id].startLeft;let a=t.x,i=t.y;if(r){const e=F.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_left",r);a=e.x,i=e.y}e.attr("transform",`translate(${a}, ${i})`)}if(t.startLabelRight){const e=Gt[t.id].startRight;let a=t.x,i=t.y;if(r){const e=F.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_right",r);a=e.x,i=e.y}e.attr("transform",`translate(${a}, ${i})`)}if(t.endLabelLeft){const e=Gt[t.id].endLeft;let a=t.x,i=t.y;if(r){const e=F.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_left",r);a=e.x,i=e.y}e.attr("transform",`translate(${a}, ${i})`)}if(t.endLabelRight){const e=Gt[t.id].endRight;let a=t.x,i=t.y;if(r){const e=F.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",r);a=e.x,i=e.y}e.attr("transform",`translate(${a}, ${i})`)}},"positionEdgeLabel"),ee=E((t,e)=>{const r=t.x,a=t.y,i=Math.abs(e.x-r),n=Math.abs(e.y-a),s=t.width/2,o=t.height/2;return i>=s||n>=o},"outsideNode"),re=E((t,e,r)=>{I.debug(`intersection calc abc89:\n outsidePoint: ${JSON.stringify(e)}\n insidePoint : ${JSON.stringify(r)}\n node : x:${t.x} y:${t.y} w:${t.width} h:${t.height}`);const a=t.x,i=t.y,n=Math.abs(a-r.x),s=t.width/2;let o=r.x<e.x?s-n:s+n;const l=t.height/2,c=Math.abs(e.y-r.y),d=Math.abs(e.x-r.x);if(Math.abs(i-e.y)*s>Math.abs(a-e.x)*l){let t=r.y<e.y?e.y-l-i:i-l-e.y;o=d*t/c;const a={x:r.x<e.x?r.x+o:r.x-d+o,y:r.y<e.y?r.y+c-t:r.y-c+t};return 0===o&&(a.x=e.x,a.y=e.y),0===d&&(a.x=e.x),0===c&&(a.y=e.y),I.debug(`abc89 topp/bott calc, Q ${c}, q ${t}, R ${d}, r ${o}`,a),a}{o=r.x<e.x?e.x-s-a:a-s-e.x;let t=c*o/d,i=r.x<e.x?r.x+d-o:r.x-d+o,n=r.y<e.y?r.y+t:r.y-t;return I.debug(`sides calc abc89, Q ${c}, q ${t}, R ${d}, r ${o}`,{_x:i,_y:n}),0===o&&(i=e.x,n=e.y),0===d&&(i=e.x),0===c&&(n=e.y),{x:i,y:n}}},"intersection"),ae=E((t,e)=>{I.debug("abc88 cutPathAtIntersect",t,e);let r=[],a=t[0],i=!1;return t.forEach(t=>{if(ee(e,t)||i)a=t,i||r.push(t);else{const n=re(e,a,t);let s=!1;r.forEach(t=>{s=s||t.x===n.x&&t.y===n.y}),r.some(t=>t.x===n.x&&t.y===n.y)||r.push(n),i=!0}}),r},"cutPathAtIntersect"),ie=E(function(t,e,r,a,i,n,s){let o=r.points;I.debug("abc88 InsertEdge: edge=",r,"e=",e);let l=!1;const c=n.node(e.v);var d=n.node(e.w);(null==d?void 0:d.intersect)&&(null==c?void 0:c.intersect)&&(o=o.slice(1,r.points.length-1),o.unshift(c.intersect(o[0])),o.push(d.intersect(o[o.length-1]))),r.toCluster&&(I.debug("to cluster abc88",a[r.toCluster]),o=ae(r.points,a[r.toCluster].node),l=!0),r.fromCluster&&(I.debug("from cluster abc88",a[r.fromCluster]),o=ae(o.reverse(),a[r.fromCluster].node).reverse(),l=!0);const h=o.filter(t=>!Number.isNaN(t.y));let g=z;!r.curve||"graph"!==i&&"flowchart"!==i||(g=r.curve);const{x:u,y:y}=O(r),p=R().x(u).y(y).curve(g);let x;switch(r.thickness){case"normal":x="edge-thickness-normal";break;case"thick":case"invisible":x="edge-thickness-thick";break;default:x=""}switch(r.pattern){case"solid":x+=" edge-pattern-solid";break;case"dotted":x+=" edge-pattern-dotted";break;case"dashed":x+=" edge-pattern-dashed"}const b=t.append("path").attr("d",p(h)).attr("id",r.id).attr("class"," "+x+(r.classes?" "+r.classes:"")).attr("style",r.style);let f="";(B().flowchart.arrowMarkerAbsolute||B().state.arrowMarkerAbsolute)&&(f=A(!0)),Kt(b,r,f,s,i);let m={};return l&&(m.updatedPath=o),m.originalPath=r.points,m},"insertEdge"),ne=E(t=>{const e=new Set;for(const r of t)switch(r){case"x":e.add("right"),e.add("left");break;case"y":e.add("up"),e.add("down");break;default:e.add(r)}return e},"expandAndDeduplicateDirections"),se=E((t,e,r,a)=>{const i=ne(t),n=e.height+2*r.padding,s=n/2,o=a??e.width+2*s+r.padding,l=r.padding/2;return i.has("right")&&i.has("left")&&i.has("up")&&i.has("down")?[{x:0,y:0},{x:s,y:0},{x:o/2,y:2*l},{x:o-s,y:0},{x:o,y:0},{x:o,y:-n/3},{x:o+2*l,y:-n/2},{x:o,y:-2*n/3},{x:o,y:-n},{x:o-s,y:-n},{x:o/2,y:-n-2*l},{x:s,y:-n},{x:0,y:-n},{x:0,y:-2*n/3},{x:-2*l,y:-n/2},{x:0,y:-n/3}]:i.has("right")&&i.has("left")&&i.has("up")?[{x:s,y:0},{x:o-s,y:0},{x:o,y:-n/2},{x:o-s,y:-n},{x:s,y:-n},{x:0,y:-n/2}]:i.has("right")&&i.has("left")&&i.has("down")?[{x:0,y:0},{x:s,y:-n},{x:o-s,y:-n},{x:o,y:0}]:i.has("right")&&i.has("up")&&i.has("down")?[{x:0,y:0},{x:o,y:-s},{x:o,y:-n+s},{x:0,y:-n}]:i.has("left")&&i.has("up")&&i.has("down")?[{x:o,y:0},{x:0,y:-s},{x:0,y:-n+s},{x:o,y:-n}]:i.has("right")&&i.has("left")?[{x:s,y:0},{x:s,y:-l},{x:o-s,y:-l},{x:o-s,y:0},{x:o,y:-n/2},{x:o-s,y:-n},{x:o-s,y:-n+l},{x:s,y:-n+l},{x:s,y:-n},{x:0,y:-n/2}]:i.has("up")&&i.has("down")?[{x:o/2,y:0},{x:0,y:-l},{x:s,y:-l},{x:s,y:-n+l},{x:0,y:-n+l},{x:o/2,y:-n},{x:o,y:-n+l},{x:o-s,y:-n+l},{x:o-s,y:-l},{x:o,y:-l}]:i.has("right")&&i.has("up")?[{x:0,y:0},{x:o,y:-s},{x:0,y:-n}]:i.has("right")&&i.has("down")?[{x:0,y:0},{x:o,y:0},{x:0,y:-n}]:i.has("left")&&i.has("up")?[{x:o,y:0},{x:0,y:-s},{x:o,y:-n}]:i.has("left")&&i.has("down")?[{x:o,y:0},{x:0,y:0},{x:o,y:-n}]:i.has("right")?[{x:s,y:-l},{x:s,y:-l},{x:o-s,y:-l},{x:o-s,y:0},{x:o,y:-n/2},{x:o-s,y:-n},{x:o-s,y:-n+l},{x:s,y:-n+l},{x:s,y:-n+l}]:i.has("left")?[{x:s,y:0},{x:s,y:-l},{x:o-s,y:-l},{x:o-s,y:-n+l},{x:s,y:-n+l},{x:s,y:-n},{x:0,y:-n/2}]:i.has("up")?[{x:s,y:-l},{x:s,y:-n+l},{x:0,y:-n+l},{x:o/2,y:-n},{x:o,y:-n+l},{x:o-s,y:-n+l},{x:o-s,y:-l}]:i.has("down")?[{x:o/2,y:0},{x:0,y:-l},{x:s,y:-l},{x:s,y:-n+l},{x:o-s,y:-n+l},{x:o-s,y:-l},{x:o,y:-l}]:[{x:0,y:0}]},"getArrowPoints");function oe(t,e){return t.intersect(e)}E(oe,"intersectNode");var le=oe;function ce(t,e,r,a){var i=t.x,n=t.y,s=i-a.x,o=n-a.y,l=Math.sqrt(e*e*o*o+r*r*s*s),c=Math.abs(e*r*s/l);a.x<i&&(c=-c);var d=Math.abs(e*r*o/l);return a.y<n&&(d=-d),{x:i+c,y:n+d}}E(ce,"intersectEllipse");var de=ce;function he(t,e,r){return de(t,e,e,r)}E(he,"intersectCircle");var ge=he;function ue(t,e,r,a){var i,n,s,o,l,c,d,h,g,u,y,p,x;if(i=e.y-t.y,s=t.x-e.x,l=e.x*t.y-t.x*e.y,g=i*r.x+s*r.y+l,u=i*a.x+s*a.y+l,!(0!==g&&0!==u&&ye(g,u)||(n=a.y-r.y,o=r.x-a.x,c=a.x*r.y-r.x*a.y,d=n*t.x+o*t.y+c,h=n*e.x+o*e.y+c,0!==d&&0!==h&&ye(d,h)||0===(y=i*o-n*s))))return p=Math.abs(y/2),{x:(x=s*c-o*l)<0?(x-p)/y:(x+p)/y,y:(x=n*l-i*c)<0?(x-p)/y:(x+p)/y}}function ye(t,e){return t*e>0}E(ue,"intersectLine"),E(ye,"sameSign");var pe=ue,xe=be;function be(t,e,r){var a=t.x,i=t.y,n=[],s=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY;"function"==typeof e.forEach?e.forEach(function(t){s=Math.min(s,t.x),o=Math.min(o,t.y)}):(s=Math.min(s,e.x),o=Math.min(o,e.y));for(var l=a-t.width/2-s,c=i-t.height/2-o,d=0;d<e.length;d++){var h=e[d],g=e[d<e.length-1?d+1:0],u=pe(t,r,{x:l+h.x,y:c+h.y},{x:l+g.x,y:c+g.y});u&&n.push(u)}return n.length?(n.length>1&&n.sort(function(t,e){var a=t.x-r.x,i=t.y-r.y,n=Math.sqrt(a*a+i*i),s=e.x-r.x,o=e.y-r.y,l=Math.sqrt(s*s+o*o);return n<l?-1:n===l?0:1}),n[0]):t}E(be,"intersectPolygon");var fe={node:le,circle:ge,ellipse:de,polygon:xe,rect:E((t,e)=>{var r,a,i=t.x,n=t.y,s=e.x-i,o=e.y-n,l=t.width/2,c=t.height/2;return Math.abs(o)*l>Math.abs(s)*c?(o<0&&(c=-c),r=0===o?0:c*s/o,a=c):(s<0&&(l=-l),r=l,a=0===s?0:l*o/s),{x:i+r,y:n+a}},"intersectRect")},me=E(async(t,e,r,a)=>{const i=B();let n;const s=e.useHtmlLabels||M(i);n=r||"node default";const o=t.insert("g").attr("class",n).attr("id",e.domId||e.id),l=o.insert("g").attr("class","label").attr("style",e.labelStyle);let c,d;c=void 0===e.labelText?"":"string"==typeof e.labelText?e.labelText:e.labelText[0],d="markdown"===e.labelType?P(l,H(U(c),i),{useHtmlLabels:s,width:e.width||i.flowchart.wrappingWidth,classes:"markdown-node-label"},i):await Ut(l,H(U(c),i),e.labelStyle,!1,a);let h=d.getBBox();const g=e.padding/2;if(M(i)){const t=d.children[0],e=D(d);await K(t,c),h=t.getBoundingClientRect(),e.attr("width",h.width),e.attr("height",h.height)}return s?l.attr("transform","translate("+-h.width/2+", "+-h.height/2+")"):l.attr("transform","translate(0, "+-h.height/2+")"),e.centerLabel&&l.attr("transform","translate("+-h.width/2+", "+-h.height/2+")"),l.insert("rect",":first-child"),{shapeSvg:o,bbox:h,halfPadding:g,label:l}},"labelHelper"),we=E((t,e)=>{const r=e.node().getBBox();t.width=r.width,t.height=r.height},"updateNodeBounds");function ke(t,e,r,a){return t.insert("polygon",":first-child").attr("points",a.map(function(t){return t.x+","+t.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-e/2+","+r/2+")")}E(ke,"insertPolygonShape");var Se=E(async(t,e)=>{e.useHtmlLabels||M(B())||(e.centerLabel=!0);const{shapeSvg:r,bbox:a,halfPadding:i}=await me(t,e,"node "+e.classes,!0);I.info("Classes = ",e.classes);const n=r.insert("rect",":first-child");return n.attr("rx",e.rx).attr("ry",e.ry).attr("x",-a.width/2-i).attr("y",-a.height/2-i).attr("width",a.width+e.padding).attr("height",a.height+e.padding),we(e,n),e.intersect=function(t){return fe.rect(e,t)},r},"note"),Le=E(t=>t?" "+t:"","formatClass"),_e=E((t,e)=>`${e||"node default"}${Le(t.classes)} ${Le(t.class)}`,"getClassesFromNode"),ve=E(async(t,e)=>{const{shapeSvg:r,bbox:a}=await me(t,e,_e(e,void 0),!0),i=a.width+e.padding+(a.height+e.padding),n=[{x:i/2,y:0},{x:i,y:-i/2},{x:i/2,y:-i},{x:0,y:-i/2}];I.info("Question main (Circle)");const s=ke(r,i,i,n);return s.attr("style",e.style),we(e,s),e.intersect=function(t){return I.warn("Intersect called"),fe.polygon(e,n,t)},r},"question"),Ee=E((t,e)=>{const r=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),a=[{x:0,y:14},{x:14,y:0},{x:0,y:-14},{x:-14,y:0}];return r.insert("polygon",":first-child").attr("points",a.map(function(t){return t.x+","+t.y}).join(" ")).attr("class","state-start").attr("r",7).attr("width",28).attr("height",28),e.width=28,e.height=28,e.intersect=function(t){return fe.circle(e,14,t)},r},"choice"),Te=E(async(t,e)=>{const{shapeSvg:r,bbox:a}=await me(t,e,_e(e,void 0),!0),i=e.positioned?e.height:a.height+e.padding,n=i/4,s=e.positioned?e.width:a.width+2*n+e.padding,o=[{x:n,y:0},{x:s-n,y:0},{x:s,y:-i/2},{x:s-n,y:-i},{x:n,y:-i},{x:0,y:-i/2}],l=ke(r,s,i,o);return l.attr("style",e.style),we(e,l),e.intersect=function(t){return fe.polygon(e,o,t)},r},"hexagon"),De=E(async(t,e)=>{const{shapeSvg:r,bbox:a}=await me(t,e,void 0,!0),i=a.height+2*e.padding,n=i/2,s=a.width+2*n+e.padding,o=e.positioned&&(e.widthInColumns??1)>1&&e.width>s?e.width:s,l=se(e.directions,a,e,o),c=ke(r,o,i,l);return c.attr("style",e.style),we(e,c),e.intersect=function(t){return fe.polygon(e,l,t)},r},"block_arrow"),$e=E(async(t,e)=>{const{shapeSvg:r,bbox:a}=await me(t,e,_e(e,void 0),!0),i=a.width+e.padding,n=a.height+e.padding,s=[{x:-n/2,y:0},{x:i,y:0},{x:i,y:-n},{x:-n/2,y:-n},{x:0,y:-n/2}];return ke(r,i,n,s).attr("style",e.style),e.width=i+n,e.height=n,e.intersect=function(t){return fe.polygon(e,s,t)},r},"rect_left_inv_arrow"),Ie=E(async(t,e)=>{const{shapeSvg:r,bbox:a}=await me(t,e,_e(e),!0),i=a.width+e.padding,n=a.height+e.padding,s=[{x:-2*n/6,y:0},{x:i-n/6,y:0},{x:i+2*n/6,y:-n},{x:n/6,y:-n}],o=ke(r,i,n,s);return o.attr("style",e.style),we(e,o),e.intersect=function(t){return fe.polygon(e,s,t)},r},"lean_right"),Ne=E(async(t,e)=>{const{shapeSvg:r,bbox:a}=await me(t,e,_e(e,void 0),!0),i=a.width+e.padding,n=a.height+e.padding,s=[{x:2*n/6,y:0},{x:i+n/6,y:0},{x:i-2*n/6,y:-n},{x:-n/6,y:-n}],o=ke(r,i,n,s);return o.attr("style",e.style),we(e,o),e.intersect=function(t){return fe.polygon(e,s,t)},r},"lean_left"),Ce=E(async(t,e)=>{const{shapeSvg:r,bbox:a}=await me(t,e,_e(e,void 0),!0),i=a.width+e.padding,n=a.height+e.padding,s=[{x:-2*n/6,y:0},{x:i+2*n/6,y:0},{x:i-n/6,y:-n},{x:n/6,y:-n}],o=ke(r,i,n,s);return o.attr("style",e.style),we(e,o),e.intersect=function(t){return fe.polygon(e,s,t)},r},"trapezoid"),Be=E(async(t,e)=>{const{shapeSvg:r,bbox:a}=await me(t,e,_e(e,void 0),!0),i=a.width+e.padding,n=a.height+e.padding,s=[{x:n/6,y:0},{x:i-n/6,y:0},{x:i+2*n/6,y:-n},{x:-2*n/6,y:-n}],o=ke(r,i,n,s);return o.attr("style",e.style),we(e,o),e.intersect=function(t){return fe.polygon(e,s,t)},r},"inv_trapezoid"),Oe=E(async(t,e)=>{const{shapeSvg:r,bbox:a}=await me(t,e,_e(e,void 0),!0),i=a.width+e.padding,n=a.height+e.padding,s=[{x:0,y:0},{x:i+n/2,y:0},{x:i,y:-n/2},{x:i+n/2,y:-n},{x:0,y:-n}],o=ke(r,i,n,s);return o.attr("style",e.style),we(e,o),e.intersect=function(t){return fe.polygon(e,s,t)},r},"rect_right_inv_arrow"),Re=E(async(t,e)=>{const{shapeSvg:r,bbox:a}=await me(t,e,_e(e,void 0),!0),i=a.width+e.padding,n=i/2,s=n/(2.5+i/50),o=a.height+s+e.padding,l="M 0,"+s+" a "+n+","+s+" 0,0,0 "+i+" 0 a "+n+","+s+" 0,0,0 "+-i+" 0 l 0,"+o+" a "+n+","+s+" 0,0,0 "+i+" 0 l 0,"+-o,c=r.attr("label-offset-y",s).insert("path",":first-child").attr("style",e.style).attr("d",l).attr("transform","translate("+-i/2+","+-(o/2+s)+")");return we(e,c),e.intersect=function(t){const r=fe.rect(e,t),a=r.x-e.x;if(0!=n&&(Math.abs(a)<e.width/2||Math.abs(a)==e.width/2&&Math.abs(r.y-e.y)>e.height/2-s)){let i=s*s*(1-a*a/(n*n));0!=i&&(i=Math.sqrt(i)),i=s-i,t.y-e.y>0&&(i=-i),r.y+=i}return r},r},"cylinder"),ze=E(async(t,e)=>{const{shapeSvg:r,bbox:a,halfPadding:i}=await me(t,e,"node "+e.classes+" "+e.class,!0),n=r.insert("rect",":first-child"),s=e.positioned?e.width:a.width+e.padding,o=e.positioned?e.height:a.height+e.padding,l=e.positioned?-s/2:-a.width/2-i,c=e.positioned?-o/2:-a.height/2-i;if(n.attr("class","basic label-container").attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("x",l).attr("y",c).attr("width",s).attr("height",o),e.props){const t=new Set(Object.keys(e.props));e.props.borders&&(Pe(n,e.props.borders,s,o),t.delete("borders")),t.forEach(t=>{I.warn(`Unknown node property ${t}`)})}return we(e,n),e.intersect=function(t){return fe.rect(e,t)},r},"rect"),Ae=E(async(t,e)=>{const{shapeSvg:r,bbox:a,halfPadding:i}=await me(t,e,"node "+e.classes,!0),n=r.insert("rect",":first-child"),s=e.positioned?e.width:a.width+e.padding,o=e.positioned?e.height:a.height+e.padding,l=e.positioned?-s/2:-a.width/2-i,c=e.positioned?-o/2:-a.height/2-i;if(n.attr("class","basic cluster composite label-container").attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("x",l).attr("y",c).attr("width",s).attr("height",o),e.props){const t=new Set(Object.keys(e.props));e.props.borders&&(Pe(n,e.props.borders,s,o),t.delete("borders")),t.forEach(t=>{I.warn(`Unknown node property ${t}`)})}return we(e,n),e.intersect=function(t){return fe.rect(e,t)},r},"composite"),Me=E(async(t,e)=>{const{shapeSvg:r}=await me(t,e,"label",!0);I.trace("Classes = ",e.class);const a=r.insert("rect",":first-child");if(a.attr("width",0).attr("height",0),r.attr("class","label edgeLabel"),e.props){const t=new Set(Object.keys(e.props));e.props.borders&&(Pe(a,e.props.borders,0,0),t.delete("borders")),t.forEach(t=>{I.warn(`Unknown node property ${t}`)})}return we(e,a),e.intersect=function(t){return fe.rect(e,t)},r},"labelRect");function Pe(t,e,r,a){const i=[],n=E(t=>{i.push(t,0)},"addBorder"),s=E(t=>{i.push(0,t)},"skipBorder");e.includes("t")?(I.debug("add top border"),n(r)):s(r),e.includes("r")?(I.debug("add right border"),n(a)):s(a),e.includes("b")?(I.debug("add bottom border"),n(r)):s(r),e.includes("l")?(I.debug("add left border"),n(a)):s(a),t.attr("stroke-dasharray",i.join(" "))}E(Pe,"applyNodePropertyBorders");var Ye=E(async(t,e)=>{let r;r=e.classes?"node "+e.classes:"node default";const a=t.insert("g").attr("class",r).attr("id",e.domId||e.id),i=a.insert("rect",":first-child"),n=a.insert("line"),s=a.insert("g").attr("class","label"),o=e.labelText.flat?e.labelText.flat():e.labelText;let l="";l="object"==typeof o?o[0]:o,I.info("Label text abc79",l,o,"object"==typeof o);const c=await Ut(s,l,e.labelStyle,!0,!0);let d={width:0,height:0};if(M(B())){const t=c.children[0],e=D(c);d=t.getBoundingClientRect(),e.attr("width",d.width),e.attr("height",d.height)}I.info("Text 2",o);const h=o.slice(1,o.length);let g=c.getBBox();const u=await Ut(s,h.join?h.join("<br/>"):h,e.labelStyle,!0,!0);if(M(B())){const t=u.children[0],e=D(u);d=t.getBoundingClientRect(),e.attr("width",d.width),e.attr("height",d.height)}const y=e.padding/2;return D(u).attr("transform","translate( "+(d.width>g.width?0:(g.width-d.width)/2)+", "+(g.height+y+5)+")"),D(c).attr("transform","translate( "+(d.width<g.width?0:-(g.width-d.width)/2)+", 0)"),d=s.node().getBBox(),s.attr("transform","translate("+-d.width/2+", "+(-d.height/2-y+3)+")"),i.attr("class","outer title-state").attr("x",-d.width/2-y).attr("y",-d.height/2-y).attr("width",d.width+e.padding).attr("height",d.height+e.padding),n.attr("class","divider").attr("x1",-d.width/2-y).attr("x2",d.width/2+y).attr("y1",-d.height/2-y+g.height+y).attr("y2",-d.height/2-y+g.height+y),we(e,i),e.intersect=function(t){return fe.rect(e,t)},a},"rectWithTitle"),je=E(async(t,e)=>{const{shapeSvg:r,bbox:a}=await me(t,e,_e(e,void 0),!0),i=a.height+e.padding,n=a.width+i/4+e.padding,s=r.insert("rect",":first-child").attr("style",e.style).attr("rx",i/2).attr("ry",i/2).attr("x",-n/2).attr("y",-i/2).attr("width",n).attr("height",i);return we(e,s),e.intersect=function(t){return fe.rect(e,t)},r},"stadium"),Fe=E(async(t,e)=>{const{shapeSvg:r,bbox:a,halfPadding:i}=await me(t,e,_e(e,void 0),!0),n=r.insert("circle",":first-child");return n.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",a.width/2+i).attr("width",a.width+e.padding).attr("height",a.height+e.padding),I.info("Circle main"),we(e,n),e.intersect=function(t){return I.info("Circle intersect",e,a.width/2+i,t),fe.circle(e,a.width/2+i,t)},r},"circle"),We=E(async(t,e)=>{const{shapeSvg:r,bbox:a,halfPadding:i}=await me(t,e,_e(e,void 0),!0),n=r.insert("g",":first-child"),s=n.insert("circle"),o=n.insert("circle");return n.attr("class",e.class),s.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",a.width/2+i+5).attr("width",a.width+e.padding+10).attr("height",a.height+e.padding+10),o.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",a.width/2+i).attr("width",a.width+e.padding).attr("height",a.height+e.padding),I.info("DoubleCircle main"),we(e,s),e.intersect=function(t){return I.info("DoubleCircle intersect",e,a.width/2+i+5,t),fe.circle(e,a.width/2+i+5,t)},r},"doublecircle"),Xe=E(async(t,e)=>{const{shapeSvg:r,bbox:a}=await me(t,e,_e(e,void 0),!0),i=a.width+e.padding,n=a.height+e.padding,s=[{x:0,y:0},{x:i,y:0},{x:i,y:-n},{x:0,y:-n},{x:0,y:0},{x:-8,y:0},{x:i+8,y:0},{x:i+8,y:-n},{x:-8,y:-n},{x:-8,y:0}],o=ke(r,i,n,s);return o.attr("style",e.style),we(e,o),e.intersect=function(t){return fe.polygon(e,s,t)},r},"subroutine"),He=E((t,e)=>{const r=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),a=r.insert("circle",":first-child");return a.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),we(e,a),e.intersect=function(t){return fe.circle(e,7,t)},r},"start"),Ue=E((t,e,r)=>{const a=t.insert("g").attr("class","node default").attr("id",e.domId||e.id);let i=70,n=10;"LR"===r&&(i=10,n=70);const s=a.append("rect").attr("x",-1*i/2).attr("y",-1*n/2).attr("width",i).attr("height",n).attr("class","fork-join");return we(e,s),e.height=e.height+e.padding/2,e.width=e.width+e.padding/2,e.intersect=function(t){return fe.rect(e,t)},a},"forkJoin"),Ke={rhombus:ve,composite:Ae,question:ve,rect:ze,labelRect:Me,rectWithTitle:Ye,choice:Ee,circle:Fe,doublecircle:We,stadium:je,hexagon:Te,block_arrow:De,rect_left_inv_arrow:$e,lean_right:Ie,lean_left:Ne,trapezoid:Ce,inv_trapezoid:Be,rect_right_inv_arrow:Oe,cylinder:Re,start:He,end:E((t,e)=>{const r=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),a=r.insert("circle",":first-child"),i=r.insert("circle",":first-child");return i.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),a.attr("class","state-end").attr("r",5).attr("width",10).attr("height",10),we(e,i),e.intersect=function(t){return fe.circle(e,7,t)},r},"end"),note:Se,subroutine:Xe,fork:Ue,join:Ue,class_box:E(async(t,e)=>{var r;const a=e.padding/2;let i;i=e.classes?"node "+e.classes:"node default";const n=t.insert("g").attr("class",i).attr("id",e.domId||e.id),s=n.insert("rect",":first-child"),o=n.insert("line"),l=n.insert("line");let c=0,d=4;const h=n.insert("g").attr("class","label");let g=0;const u=null==(r=e.classData.annotations)?void 0:r[0],y=e.classData.annotations[0]?"«"+e.classData.annotations[0]+"»":"",p=await Ut(h,y,e.labelStyle,!0,!0);let x=p.getBBox();if(M(B())){const t=p.children[0],e=D(p);x=t.getBoundingClientRect(),e.attr("width",x.width),e.attr("height",x.height)}e.classData.annotations[0]&&(d+=x.height+4,c+=x.width);let b=e.classData.label;void 0!==e.classData.type&&""!==e.classData.type&&(M(B())?b+="<"+e.classData.type+">":b+="<"+e.classData.type+">");const f=await Ut(h,b,e.labelStyle,!0,!0);D(f).attr("class","classTitle");let m=f.getBBox();if(M(B())){const t=f.children[0],e=D(f);m=t.getBoundingClientRect(),e.attr("width",m.width),e.attr("height",m.height)}d+=m.height+4,m.width>c&&(c=m.width);const w=[];e.classData.members.forEach(async t=>{const r=t.getDisplayDetails();let a=r.displayText;M(B())&&(a=a.replace(/</g,"<").replace(/>/g,">"));const i=await Ut(h,a,r.cssStyle?r.cssStyle:e.labelStyle,!0,!0);let n=i.getBBox();if(M(B())){const t=i.children[0],e=D(i);n=t.getBoundingClientRect(),e.attr("width",n.width),e.attr("height",n.height)}n.width>c&&(c=n.width),d+=n.height+4,w.push(i)}),d+=8;const k=[];if(e.classData.methods.forEach(async t=>{const r=t.getDisplayDetails();let a=r.displayText;M(B())&&(a=a.replace(/</g,"<").replace(/>/g,">"));const i=await Ut(h,a,r.cssStyle?r.cssStyle:e.labelStyle,!0,!0);let n=i.getBBox();if(M(B())){const t=i.children[0],e=D(i);n=t.getBoundingClientRect(),e.attr("width",n.width),e.attr("height",n.height)}n.width>c&&(c=n.width),d+=n.height+4,k.push(i)}),d+=8,u){let t=(c-x.width)/2;D(p).attr("transform","translate( "+(-1*c/2+t)+", "+-1*d/2+")"),g=x.height+4}let S=(c-m.width)/2;return D(f).attr("transform","translate( "+(-1*c/2+S)+", "+(-1*d/2+g)+")"),g+=m.height+4,o.attr("class","divider").attr("x1",-c/2-a).attr("x2",c/2+a).attr("y1",-d/2-a+8+g).attr("y2",-d/2-a+8+g),g+=8,w.forEach(t=>{D(t).attr("transform","translate( "+-c/2+", "+(-1*d/2+g+4)+")");const e=null==t?void 0:t.getBBox();g+=((null==e?void 0:e.height)??0)+4}),g+=8,l.attr("class","divider").attr("x1",-c/2-a).attr("x2",c/2+a).attr("y1",-d/2-a+8+g).attr("y2",-d/2-a+8+g),g+=8,k.forEach(t=>{D(t).attr("transform","translate( "+-c/2+", "+(-1*d/2+g)+")");const e=null==t?void 0:t.getBBox();g+=((null==e?void 0:e.height)??0)+4}),s.attr("style",e.style).attr("class","outer title-state").attr("x",-c/2-a).attr("y",-d/2-a).attr("width",c+e.padding).attr("height",d+e.padding),we(e,s),e.intersect=function(t){return fe.rect(e,t)},n},"class_box")},Ze={},qe=E(async(t,e,r)=>{let a,i;if(e.link){let n;"sandbox"===B().securityLevel?n="_top":e.linkTarget&&(n=e.linkTarget||"_blank"),a=t.insert("svg:a").attr("xlink:href",e.link).attr("target",n),i=await Ke[e.shape](a,e,r)}else i=await Ke[e.shape](t,e,r),a=i;return e.tooltip&&i.attr("title",e.tooltip),e.class&&i.attr("class","node default "+e.class),Ze[e.id]=a,e.haveCallback&&Ze[e.id].attr("class",Ze[e.id].attr("class")+" clickable"),a},"insertNode"),Ve=E(t=>{const e=Ze[t.id];I.trace("Transforming node",t.diff,t,"translate("+(t.x-t.width/2-5)+", "+t.width/2+")");const r=t.diff||0;return t.clusterNode?e.attr("transform","translate("+(t.x+r-t.width/2)+", "+(t.y-t.height/2-8)+")"):e.attr("transform","translate("+t.x+", "+t.y+")"),r},"positionNode");function Ge(t,e,r=!1){var a,i,n;const s=t;let o="default";((null==(a=null==s?void 0:s.classes)?void 0:a.length)||0)>0&&(o=((null==s?void 0:s.classes)??[]).join(" ")),o+=" flowchart-label";let l,c=0,d="";switch(s.type){case"round":c=5,d="rect";break;case"composite":c=0,d="composite",l=0;break;case"square":case"group":default:d="rect";break;case"diamond":d="question";break;case"hexagon":d="hexagon";break;case"block_arrow":d="block_arrow";break;case"odd":case"rect_left_inv_arrow":d="rect_left_inv_arrow";break;case"lean_right":d="lean_right";break;case"lean_left":d="lean_left";break;case"trapezoid":d="trapezoid";break;case"inv_trapezoid":d="inv_trapezoid";break;case"circle":d="circle";break;case"ellipse":d="ellipse";break;case"stadium":d="stadium";break;case"subroutine":d="subroutine";break;case"cylinder":d="cylinder";break;case"doublecircle":d="doublecircle"}const h=X((null==s?void 0:s.styles)??[]),g=s.label,u=s.size??{width:0,height:0,x:0,y:0},y=e.getDiagramId();return{labelStyle:h.labelStyle,shape:d,labelText:g,rx:c,ry:c,class:o,style:h.style,id:s.id,domId:y?`${y}-${s.id}`:s.id,directions:s.directions,width:u.width,height:u.height,x:u.x,y:u.y,positioned:r,intersect:void 0,type:s.type,padding:l??(null==(n=null==(i=T())?void 0:i.block)?void 0:n.padding)??0,widthInColumns:s.widthInColumns??1}}async function Je(t,e,r){const a=Ge(e,r,!1);if("group"===a.type)return;const i=T(),n=await qe(t,a,{config:i}),s=n.node().getBBox(),o=r.getBlock(a.id);o.size={width:s.width,height:s.height,x:0,y:0,node:n},r.setBlock(o),n.remove()}async function Qe(t,e,r){const a=Ge(e,r,!0);if("space"!==r.getBlock(a.id).type){const r=T();await qe(t,a,{config:r}),e.intersect=null==a?void 0:a.intersect,Ve(a)}}async function tr(t,e,r,a){for(const i of e)await a(t,i,r),i.children&&await tr(t,i.children,r,a)}async function er(t,e,r){await tr(t,e,r,Je)}async function rr(t,e,r){await tr(t,e,r,Qe)}async function ar(t,e,r,a,i){const n=new Z({multigraph:!0,compound:!0});n.setGraph({rankdir:"TB",nodesep:10,ranksep:10,marginx:8,marginy:8});for(const s of r)s.size&&n.setNode(s.id,{width:s.size.width,height:s.size.height,intersect:s.intersect});for(const s of e)if(s.start&&s.end){const e=a.getBlock(s.start),r=a.getBlock(s.end);if((null==e?void 0:e.size)&&(null==r?void 0:r.size)){const a=e.size,o=r.size,l=[{x:a.x,y:a.y},{x:a.x+(o.x-a.x)/2,y:a.y+(o.y-a.y)/2},{x:o.x,y:o.y}],c=i?`${i}-${s.id}`:s.id,d=`${"thick"===s.thickness?"edge-thickness-thick":"edge-thickness-normal"} ${"dotted"===s.pattern?"edge-pattern-dotted":"edge-pattern-solid"} flowchart-link LS-a1 LE-b1`;ie(t,{v:s.start,w:s.end,name:c},{...s,id:c,arrowTypeEnd:s.arrowTypeEnd,arrowTypeStart:s.arrowTypeStart,points:l,classes:d},void 0,"block",n,i),s.label&&(await Jt(t,{...s,label:s.label,labelStyle:"stroke: #333; stroke-width: 1.5px;fill:none;",arrowTypeEnd:s.arrowTypeEnd,arrowTypeStart:s.arrowTypeStart,points:l,classes:d}),te({...s,x:l[1].x,y:l[1].y},{originalPath:l}))}}}E(Ge,"getNodeFromBlock"),E(Je,"calculateBlockSize"),E(Qe,"insertBlockPositioned"),E(tr,"performOperations"),E(er,"calculateBlockSizes"),E(rr,"insertBlocks"),E(ar,"insertEdges");var ir=E(function(t,e){return e.db.getClasses()},"getClasses"),nr={parser:Q,db:Ot,renderer:{draw:E(async function(t,e,r,a){const{securityLevel:i,block:n}=T(),s=a.db;let o;s.setDiagramId(e),"sandbox"===i&&(o=D("#i"+e));const l=D("sandbox"===i?o.nodes()[0].contentDocument.body:"body"),c="sandbox"===i?l.select(`[id="${e}"]`):D(`[id="${e}"]`);Pt(c,["point","circle","cross"],a.type,e);const d=s.getBlocks(),h=s.getBlocksFlat(),g=s.getEdges(),u=c.insert("g").attr("class","block");await er(u,d,s);const y=Ht(s);if(await rr(u,d,s),await ar(u,g,h,s,e),y){const t=y,e=Math.max(1,Math.round(t.width/t.height*.125)),r=t.height+e+10,a=t.width+10,{useMaxWidth:i}=n;$(c,r,a,!!i),I.debug("Here Bounds",y,t),c.attr("viewBox",`${t.x-5} ${t.y-5} ${t.width+10} ${t.height+10}`)}},"draw"),getClasses:ir},styles:zt};export{nr as diagram};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{af as a,ag as r}from"./mermaid.core-CMkyheGu.js";const o=(o,s)=>a.lang.round(r.parse(o)[s]);export{o as c};
|