@bkm016/basalt 0.1.9 → 0.1.11

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.
Files changed (188) hide show
  1. package/{chunk-0xd9mnc2.js → chunk-jymx3a77.js} +165 -152
  2. package/{chunk-66h5qpc6.js → chunk-zq32mwxj.js} +134 -134
  3. package/compiled.js +1 -1
  4. package/package.json +1 -1
  5. package/ui-test-worker.js +1 -1
  6. package/web/{chunk-9yfftz38.js → chunk-05mvzx00.js} +1 -1
  7. package/web/chunk-086dshck.js +1 -0
  8. package/web/chunk-0fy590s0.js +1 -0
  9. package/web/{chunk-4a6gdrbs.js → chunk-0hvxb5d5.js} +1 -1
  10. package/web/chunk-0mdf1qja.js +1 -0
  11. package/web/{chunk-dz7g1gnv.js → chunk-0y971zgq.js} +2 -2
  12. package/web/{chunk-fjb3ksfd.js → chunk-1t38sgrk.js} +2 -2
  13. package/web/{chunk-66wb0p6e.js → chunk-1zfxaafq.js} +1 -1
  14. package/web/{chunk-p9hfcamx.js → chunk-27812gqr.js} +5 -5
  15. package/web/{chunk-sk1wkgjw.js → chunk-2ds0a2z1.js} +3 -3
  16. package/web/{chunk-ddyyc20r.js → chunk-2f2agfpj.js} +11 -11
  17. package/web/{chunk-3ecrkvr3.js → chunk-2tsxj613.js} +3 -3
  18. package/web/{chunk-y2rzeb4v.js → chunk-2weaa3gn.js} +2 -2
  19. package/web/{chunk-0pghpg4y.js → chunk-3020mmp1.js} +1 -1
  20. package/web/{chunk-mykrm8ba.js → chunk-30aeb767.js} +2 -2
  21. package/web/chunk-32zmk3f5.js +1 -0
  22. package/web/{chunk-zb2bkr7f.js → chunk-36dc7tcg.js} +2 -2
  23. package/web/{chunk-nnyc889n.js → chunk-3a57m7xm.js} +3 -3
  24. package/web/{chunk-8w7fyb3v.js → chunk-3b4wqmnh.js} +7 -7
  25. package/web/chunk-3d3wnh8a.js +2 -0
  26. package/web/{chunk-601k823s.js → chunk-3ftb27f3.js} +8 -8
  27. package/web/{chunk-c6yacwbc.js → chunk-47mbbmst.js} +3 -3
  28. package/web/chunk-48479gnx.js +1 -0
  29. package/web/{chunk-qsqtwf34.js → chunk-4gc663j0.js} +2 -2
  30. package/web/{chunk-kcjz03h5.js → chunk-4rwwtfnd.js} +2 -2
  31. package/web/{chunk-eqndhs21.js → chunk-4wwd3pfz.js} +2 -2
  32. package/web/{chunk-myd6sc76.js → chunk-57pyz29y.js} +2 -2
  33. package/web/{chunk-mdfksj61.js → chunk-59nk506k.js} +1 -1
  34. package/web/{chunk-db3twjvk.js → chunk-5ahx98zj.js} +9 -9
  35. package/web/chunk-6cjm2yr7.js +1 -0
  36. package/web/{chunk-frnh4zqf.js → chunk-6jb2zyp6.js} +2 -2
  37. package/web/{chunk-ts6jsfdk.js → chunk-793m5jjh.js} +1 -1
  38. package/web/{chunk-3ak5dg10.js → chunk-7dycbjxn.js} +4 -4
  39. package/web/chunk-7ycxz39p.js +1 -0
  40. package/web/{chunk-tftc5v89.js → chunk-8151c970.js} +1 -1
  41. package/web/{chunk-jccz14ye.js → chunk-885kpj14.js} +2 -2
  42. package/web/{chunk-79e08rk1.js → chunk-8csw0mvf.js} +2 -2
  43. package/web/{chunk-m9q5nr8f.js → chunk-8z7texmv.js} +1 -1
  44. package/web/{chunk-v1exk5wd.js → chunk-90fkdzx3.js} +8 -8
  45. package/web/chunk-94denx9h.js +39 -0
  46. package/web/{chunk-5baeh8q7.js → chunk-96xhmmqz.js} +6 -6
  47. package/web/chunk-9jy8nc4r.js +1 -0
  48. package/web/{chunk-5dr4tkem.js → chunk-9kkzmss7.js} +3 -3
  49. package/web/chunk-9wr33d0t.js +1 -0
  50. package/web/{chunk-3pd0qt83.js → chunk-a3pye9ag.js} +3 -3
  51. package/web/chunk-a4tdrxdh.js +1 -0
  52. package/web/chunk-a9fvsyc1.js +1 -0
  53. package/web/chunk-apvbvg4d.js +1 -0
  54. package/web/{chunk-gn8kyz76.js → chunk-b3j07x0n.js} +6 -6
  55. package/web/{chunk-ff1pmd3g.js → chunk-b6sqwmq7.js} +1 -1
  56. package/web/chunk-bkxcc7v5.js +1 -0
  57. package/web/chunk-bve354k7.js +1 -0
  58. package/web/{chunk-zdyys4ar.js → chunk-cbwvfedy.js} +8 -8
  59. package/web/{chunk-eadfxfkw.js → chunk-cpshsp24.js} +1 -1
  60. package/web/chunk-cwpxakby.js +1 -0
  61. package/web/chunk-d3f763n7.js +2 -0
  62. package/web/{chunk-8z0r0wtk.js → chunk-d4519smc.js} +14 -14
  63. package/web/chunk-de29pe57.js +1 -0
  64. package/web/chunk-dk0fnj87.js +1 -0
  65. package/web/{chunk-c57f714b.js → chunk-drchr3yn.js} +2 -2
  66. package/web/chunk-dsbyfvwz.js +1 -0
  67. package/web/{chunk-3hr3ew9w.js → chunk-dtrh40vr.js} +1 -1
  68. package/web/chunk-e68jw0bg.js +1 -0
  69. package/web/{chunk-veam6vk4.js → chunk-e763h2px.js} +67 -67
  70. package/web/{chunk-nvpp0ghj.js → chunk-enryqmj7.js} +5 -5
  71. package/web/{chunk-fpb2dd2d.js → chunk-f79ajymt.js} +2 -2
  72. package/web/{chunk-qq6m2my8.js → chunk-fj753yzt.js} +2 -2
  73. package/web/{chunk-9ctg0f30.js → chunk-g0rtcedn.js} +3 -3
  74. package/web/{chunk-2x4g9t37.js → chunk-g31dbnzm.js} +4 -4
  75. package/web/{chunk-w3w18stt.js → chunk-g4as4zzd.js} +4 -4
  76. package/web/{chunk-6e87m0nm.js → chunk-gten0rpx.js} +2 -2
  77. package/web/{chunk-a0ryzdnp.js → chunk-gyhr27dm.js} +1 -1
  78. package/web/{chunk-98y92vmh.js → chunk-hjyev38w.js} +6 -6
  79. package/web/{chunk-wzd2a4k5.js → chunk-hm8thq7c.js} +4 -4
  80. package/web/{chunk-07agqp8h.js → chunk-j4gvtszc.js} +2 -2
  81. package/web/chunk-jd7npyv9.js +8 -0
  82. package/web/chunk-jhpg2kcf.js +1 -0
  83. package/web/{chunk-9fnr00kv.js → chunk-jqqbkdtw.js} +2 -2
  84. package/web/chunk-jzz5htxp.js +1 -0
  85. package/web/chunk-ka3q31t1.js +1 -0
  86. package/web/chunk-kahab58k.js +1139 -0
  87. package/web/{chunk-af9evdza.js → chunk-kfbgvh0c.js} +1 -1
  88. package/web/chunk-krgvx75q.js +1 -0
  89. package/web/chunk-kxeaj44h.js +1 -0
  90. package/web/chunk-m1rdyvb5.js +1 -0
  91. package/web/{chunk-5v2c0aqk.js → chunk-m24yb8md.js} +2 -2
  92. package/web/chunk-m7k4wr3k.js +1 -0
  93. package/web/chunk-mdj3r75b.js +1 -0
  94. package/web/{chunk-ewx42c11.js → chunk-mpdeqzc9.js} +10 -10
  95. package/web/{chunk-b5h52neg.js → chunk-mykbcvqz.js} +1 -1
  96. package/web/{chunk-7qkav30b.js → chunk-n33753da.js} +1 -1
  97. package/web/{chunk-rasjtvsb.js → chunk-nafe18y9.js} +10 -10
  98. package/web/chunk-nbcpbqq4.js +1 -0
  99. package/web/{chunk-24jhbz82.js → chunk-nhx8pw7p.js} +1 -1
  100. package/web/chunk-nkpdd9hw.js +1 -0
  101. package/web/{chunk-dwjmr0zj.js → chunk-p1yc8hwn.js} +1 -1
  102. package/web/chunk-p29brxyt.js +1 -0
  103. package/web/chunk-p8fbes0t.js +1 -0
  104. package/web/chunk-pbp1p5ex.js +1 -0
  105. package/web/{chunk-xx11yv61.js → chunk-ppjw1mps.js} +4 -4
  106. package/web/{chunk-7tkgbbf9.js → chunk-pq56b3mq.js} +2 -2
  107. package/web/{chunk-vvvd3grf.js → chunk-pzg25qqe.js} +2 -2
  108. package/web/{chunk-spbs56wz.js → chunk-q65zxczs.js} +7 -7
  109. package/web/{chunk-t893141g.js → chunk-q8v5j963.js} +2 -2
  110. package/web/{chunk-vsjpnwsr.js → chunk-qykt7avq.js} +2 -2
  111. package/web/chunk-r6q1301x.js +1 -0
  112. package/web/chunk-r8kghrkb.js +1 -0
  113. package/web/chunk-rhxn7mxg.js +1 -0
  114. package/web/{chunk-2dvbeqt0.js → chunk-rqympya7.js} +2 -2
  115. package/web/{chunk-30b33r2w.js → chunk-s0xy00v5.js} +2 -2
  116. package/web/chunk-svqshmpg.js +1 -0
  117. package/web/chunk-swzxq7r3.css +1 -0
  118. package/web/{chunk-8jcvdd5d.js → chunk-t18tn37m.js} +2 -2
  119. package/web/chunk-tbsaseer.js +1 -0
  120. package/web/{chunk-5jdrev9p.js → chunk-tggja45g.js} +3 -3
  121. package/web/chunk-tgkdyxbn.js +1 -0
  122. package/web/{chunk-rrpn5r5w.js → chunk-tpdcrrf1.js} +1 -1
  123. package/web/chunk-v0zfnvc1.js +1 -0
  124. package/web/{chunk-5a4mj3qz.js → chunk-v3dn9bfw.js} +1 -1
  125. package/web/chunk-vj31fs16.js +1 -0
  126. package/web/chunk-vr79r8vh.js +1 -0
  127. package/web/chunk-wb9tax0m.js +1 -0
  128. package/web/{chunk-rayf24gy.js → chunk-wbwets5x.js} +23 -23
  129. package/web/chunk-x9eghjjd.js +1 -0
  130. package/web/{chunk-awkdw9rw.js → chunk-xbyrgyy0.js} +2 -2
  131. package/web/{chunk-60axh4sa.js → chunk-xjc5fmcr.js} +24 -24
  132. package/web/{chunk-qh62nkem.js → chunk-ydtrc1ay.js} +2 -2
  133. package/web/chunk-yrh86m0n.js +1 -0
  134. package/web/chunk-z3ky5ews.js +2 -0
  135. package/web/{chunk-ctzkqx2g.js → chunk-zdhyq3ch.js} +13 -13
  136. package/web/{chunk-0zwc2rvh.js → chunk-zv73g4qq.js} +2 -2
  137. package/web/index.html +1 -1
  138. package/web/chunk-08sq3cwm.js +0 -1
  139. package/web/chunk-12qf1r6m.js +0 -1
  140. package/web/chunk-24fjnnee.js +0 -1
  141. package/web/chunk-2hrswh3d.js +0 -2
  142. package/web/chunk-2j2atyjw.js +0 -1
  143. package/web/chunk-3h3g3ca3.js +0 -1
  144. package/web/chunk-3pcrxg6m.js +0 -1
  145. package/web/chunk-3txxt0a7.js +0 -1
  146. package/web/chunk-43g4wd7a.js +0 -1
  147. package/web/chunk-5z2n4z9x.css +0 -1
  148. package/web/chunk-6y55gk1n.js +0 -1
  149. package/web/chunk-7qq1ypvj.js +0 -1
  150. package/web/chunk-814kkkmq.js +0 -8
  151. package/web/chunk-8w8atrdh.js +0 -1
  152. package/web/chunk-935mjq1c.js +0 -39
  153. package/web/chunk-942g3eqn.js +0 -1
  154. package/web/chunk-a61zrp66.js +0 -1
  155. package/web/chunk-arnzrqnm.js +0 -1
  156. package/web/chunk-avxk6jpc.js +0 -2
  157. package/web/chunk-bwy3e58v.js +0 -1
  158. package/web/chunk-dnv8dx72.js +0 -1
  159. package/web/chunk-f7jpakwh.js +0 -1
  160. package/web/chunk-fmthkpff.js +0 -1
  161. package/web/chunk-gv99c8zv.js +0 -1
  162. package/web/chunk-h0767tjv.js +0 -1
  163. package/web/chunk-h0c42zy3.js +0 -1
  164. package/web/chunk-hqynf99g.js +0 -1
  165. package/web/chunk-ket6g0yd.js +0 -1
  166. package/web/chunk-mbwwj216.js +0 -1
  167. package/web/chunk-me7dza1c.js +0 -1
  168. package/web/chunk-mzzaet63.js +0 -1
  169. package/web/chunk-n0wazxgz.js +0 -1
  170. package/web/chunk-nvt9tkt4.js +0 -1139
  171. package/web/chunk-ph1dgffm.js +0 -1
  172. package/web/chunk-q34as3v6.js +0 -1
  173. package/web/chunk-qz6r9v1z.js +0 -1
  174. package/web/chunk-rad2s9ha.js +0 -1
  175. package/web/chunk-s37beysw.js +0 -1
  176. package/web/chunk-s60s09mb.js +0 -1
  177. package/web/chunk-tfvcs2xx.js +0 -1
  178. package/web/chunk-tj1fn8v2.js +0 -1
  179. package/web/chunk-vqmj6peg.js +0 -1
  180. package/web/chunk-wdq2tp9e.js +0 -1
  181. package/web/chunk-wkf5xfyr.js +0 -1
  182. package/web/chunk-xa43ndfj.js +0 -2
  183. package/web/chunk-xh4xn1az.js +0 -1
  184. package/web/chunk-xzwxcxb4.js +0 -1
  185. package/web/chunk-y1qty77a.js +0 -1
  186. package/web/chunk-ys2tns0p.js +0 -1
  187. package/web/chunk-z05x9cbm.js +0 -1
  188. package/web/chunk-zgavhnt8.js +0 -1
@@ -1,20 +1,20 @@
1
- import{Te}from"./chunk-nvt9tkt4.js";var Fo=Te(function(on,ko){(function(e,r){if(typeof on==="object"&&typeof ko==="object")ko.exports=r();else if(typeof define==="function"&&define.amd)define([],r);else if(typeof on==="object")on.layoutBase=r();else e.layoutBase=r()})(on,function(){return function(t){var e={};function r(a){if(e[a])return e[a].exports;var n=e[a]={i:a,l:!1,exports:{}};return t[a].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=t,r.c=e,r.i=function(a){return a},r.d=function(a,n,i){if(!r.o(a,n))Object.defineProperty(a,n,{configurable:!1,enumerable:!0,get:i})},r.n=function(a){var n=a&&a.__esModule?function(){return a.default}:function(){return a};return r.d(n,"a",n),n},r.o=function(a,n){return Object.prototype.hasOwnProperty.call(a,n)},r.p="",r(r.s=28)}([function(t,e,r){function a(){}a.QUALITY=1,a.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,a.DEFAULT_INCREMENTAL=!1,a.DEFAULT_ANIMATION_ON_LAYOUT=!0,a.DEFAULT_ANIMATION_DURING_LAYOUT=!1,a.DEFAULT_ANIMATION_PERIOD=50,a.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,a.DEFAULT_GRAPH_MARGIN=15,a.NODE_DIMENSIONS_INCLUDE_LABELS=!1,a.SIMPLE_NODE_SIZE=40,a.SIMPLE_NODE_HALF_SIZE=a.SIMPLE_NODE_SIZE/2,a.EMPTY_COMPOUND_NODE_SIZE=40,a.MIN_EDGE_LENGTH=1,a.WORLD_BOUNDARY=1e6,a.INITIAL_WORLD_BOUNDARY=a.WORLD_BOUNDARY/1000,a.WORLD_CENTER_X=1200,a.WORLD_CENTER_Y=900,t.exports=a},function(t,e,r){var a=r(2),n=r(8),i=r(9);function s(l,u,f){a.call(this,f),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=f,this.bendpoints=[],this.source=l,this.target=u}s.prototype=Object.create(a.prototype);for(var o in a)s[o]=a[o];s.prototype.getSource=function(){return this.source},s.prototype.getTarget=function(){return this.target},s.prototype.isInterGraph=function(){return this.isInterGraph},s.prototype.getLength=function(){return this.length},s.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},s.prototype.getBendpoints=function(){return this.bendpoints},s.prototype.getLca=function(){return this.lca},s.prototype.getSourceInLca=function(){return this.sourceInLca},s.prototype.getTargetInLca=function(){return this.targetInLca},s.prototype.getOtherEnd=function(l){if(this.source===l)return this.target;else if(this.target===l)return this.source;else throw"Node is not incident with this edge"},s.prototype.getOtherEndInGraph=function(l,u){var f=this.getOtherEnd(l),v=u.getGraphManager().getRoot();while(!0){if(f.getOwner()==u)return f;if(f.getOwner()==v)break;f=f.getOwner().getParent()}return null},s.prototype.updateLength=function(){var l=[,,,,];if(this.isOverlapingSourceAndTarget=n.getIntersection(this.target.getRect(),this.source.getRect(),l),!this.isOverlapingSourceAndTarget){if(this.lengthX=l[0]-l[2],this.lengthY=l[1]-l[3],Math.abs(this.lengthX)<1)this.lengthX=i.sign(this.lengthX);if(Math.abs(this.lengthY)<1)this.lengthY=i.sign(this.lengthY);this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)}},s.prototype.updateLengthSimple=function(){if(this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1)this.lengthX=i.sign(this.lengthX);if(Math.abs(this.lengthY)<1)this.lengthY=i.sign(this.lengthY);this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},t.exports=s},function(t,e,r){function a(n){this.vGraphObject=n}t.exports=a},function(t,e,r){var a=r(2),n=r(10),i=r(13),s=r(0),o=r(16),l=r(5);function u(v,h,c,d){if(c==null&&d==null)d=h;if(a.call(this,d),v.graphManager!=null)v=v.graphManager;if(this.estimatedSize=n.MIN_VALUE,this.inclusionTreeDepth=n.MAX_VALUE,this.vGraphObject=d,this.edges=[],this.graphManager=v,c!=null&&h!=null)this.rect=new i(h.x,h.y,c.width,c.height);else this.rect=new i}u.prototype=Object.create(a.prototype);for(var f in a)u[f]=a[f];u.prototype.getEdges=function(){return this.edges},u.prototype.getChild=function(){return this.child},u.prototype.getOwner=function(){return this.owner},u.prototype.getWidth=function(){return this.rect.width},u.prototype.setWidth=function(v){this.rect.width=v},u.prototype.getHeight=function(){return this.rect.height},u.prototype.setHeight=function(v){this.rect.height=v},u.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},u.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},u.prototype.getCenter=function(){return new l(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},u.prototype.getLocation=function(){return new l(this.rect.x,this.rect.y)},u.prototype.getRect=function(){return this.rect},u.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},u.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},u.prototype.setRect=function(v,h){this.rect.x=v.x,this.rect.y=v.y,this.rect.width=h.width,this.rect.height=h.height},u.prototype.setCenter=function(v,h){this.rect.x=v-this.rect.width/2,this.rect.y=h-this.rect.height/2},u.prototype.setLocation=function(v,h){this.rect.x=v,this.rect.y=h},u.prototype.moveBy=function(v,h){this.rect.x+=v,this.rect.y+=h},u.prototype.getEdgeListToNode=function(v){var h=[],c,d=this;return d.edges.forEach(function(g){if(g.target==v){if(g.source!=d)throw"Incorrect edge source!";h.push(g)}}),h},u.prototype.getEdgesBetween=function(v){var h=[],c,d=this;return d.edges.forEach(function(g){if(!(g.source==d||g.target==d))throw"Incorrect edge source and/or target";if(g.target==v||g.source==v)h.push(g)}),h},u.prototype.getNeighborsList=function(){var v=new Set,h=this;return h.edges.forEach(function(c){if(c.source==h)v.add(c.target);else{if(c.target!=h)throw"Incorrect incidency!";v.add(c.source)}}),v},u.prototype.withChildren=function(){var v=new Set,h,c;if(v.add(this),this.child!=null){var d=this.child.getNodes();for(var g=0;g<d.length;g++)h=d[g],c=h.withChildren(),c.forEach(function(y){v.add(y)})}return v},u.prototype.getNoOfChildren=function(){var v=0,h;if(this.child==null)v=1;else{var c=this.child.getNodes();for(var d=0;d<c.length;d++)h=c[d],v+=h.getNoOfChildren()}if(v==0)v=1;return v},u.prototype.getEstimatedSize=function(){if(this.estimatedSize==n.MIN_VALUE)throw"assert failed";return this.estimatedSize},u.prototype.calcEstimatedSize=function(){if(this.child==null)return this.estimatedSize=(this.rect.width+this.rect.height)/2;else return this.estimatedSize=this.child.calcEstimatedSize(),this.rect.width=this.estimatedSize,this.rect.height=this.estimatedSize,this.estimatedSize},u.prototype.scatter=function(){var v,h,c=-s.INITIAL_WORLD_BOUNDARY,d=s.INITIAL_WORLD_BOUNDARY;v=s.WORLD_CENTER_X+o.nextDouble()*(d-c)+c;var g=-s.INITIAL_WORLD_BOUNDARY,y=s.INITIAL_WORLD_BOUNDARY;h=s.WORLD_CENTER_Y+o.nextDouble()*(y-g)+g,this.rect.x=v,this.rect.y=h},u.prototype.updateBounds=function(){if(this.getChild()==null)throw"assert failed";if(this.getChild().getNodes().length!=0){var v=this.getChild();if(v.updateBounds(!0),this.rect.x=v.getLeft(),this.rect.y=v.getTop(),this.setWidth(v.getRight()-v.getLeft()),this.setHeight(v.getBottom()-v.getTop()),s.NODE_DIMENSIONS_INCLUDE_LABELS){var h=v.getRight()-v.getLeft(),c=v.getBottom()-v.getTop();if(this.labelWidth){if(this.labelPosHorizontal=="left")this.rect.x-=this.labelWidth,this.setWidth(h+this.labelWidth);else if(this.labelPosHorizontal=="center"&&this.labelWidth>h)this.rect.x-=(this.labelWidth-h)/2,this.setWidth(this.labelWidth);else if(this.labelPosHorizontal=="right")this.setWidth(h+this.labelWidth)}if(this.labelHeight){if(this.labelPosVertical=="top")this.rect.y-=this.labelHeight,this.setHeight(c+this.labelHeight);else if(this.labelPosVertical=="center"&&this.labelHeight>c)this.rect.y-=(this.labelHeight-c)/2,this.setHeight(this.labelHeight);else if(this.labelPosVertical=="bottom")this.setHeight(c+this.labelHeight)}}}},u.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==n.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},u.prototype.transform=function(v){var h=this.rect.x;if(h>s.WORLD_BOUNDARY)h=s.WORLD_BOUNDARY;else if(h<-s.WORLD_BOUNDARY)h=-s.WORLD_BOUNDARY;var c=this.rect.y;if(c>s.WORLD_BOUNDARY)c=s.WORLD_BOUNDARY;else if(c<-s.WORLD_BOUNDARY)c=-s.WORLD_BOUNDARY;var d=new l(h,c),g=v.inverseTransformPoint(d);this.setLocation(g.x,g.y)},u.prototype.getLeft=function(){return this.rect.x},u.prototype.getRight=function(){return this.rect.x+this.rect.width},u.prototype.getTop=function(){return this.rect.y},u.prototype.getBottom=function(){return this.rect.y+this.rect.height},u.prototype.getParent=function(){if(this.owner==null)return null;return this.owner.getParent()},t.exports=u},function(t,e,r){var a=r(0);function n(){}for(var i in a)n[i]=a[i];n.MAX_ITERATIONS=2500,n.DEFAULT_EDGE_LENGTH=50,n.DEFAULT_SPRING_STRENGTH=0.45,n.DEFAULT_REPULSION_STRENGTH=4500,n.DEFAULT_GRAVITY_STRENGTH=0.4,n.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,n.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,n.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,n.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,n.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,n.DEFAULT_COOLING_FACTOR_INCREMENTAL=0.3,n.COOLING_ADAPTATION_FACTOR=0.33,n.ADAPTATION_LOWER_NODE_LIMIT=1000,n.ADAPTATION_UPPER_NODE_LIMIT=5000,n.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,n.MAX_NODE_DISPLACEMENT=n.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,n.MIN_REPULSION_DIST=n.DEFAULT_EDGE_LENGTH/10,n.CONVERGENCE_CHECK_PERIOD=100,n.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=0.1,n.MIN_EDGE_LENGTH=1,n.GRID_CALCULATION_CHECK_PERIOD=10,t.exports=n},function(t,e,r){function a(n,i){if(n==null&&i==null)this.x=0,this.y=0;else this.x=n,this.y=i}a.prototype.getX=function(){return this.x},a.prototype.getY=function(){return this.y},a.prototype.setX=function(n){this.x=n},a.prototype.setY=function(n){this.y=n},a.prototype.getDifference=function(n){return new DimensionD(this.x-n.x,this.y-n.y)},a.prototype.getCopy=function(){return new a(this.x,this.y)},a.prototype.translate=function(n){return this.x+=n.width,this.y+=n.height,this},t.exports=a},function(t,e,r){var a=r(2),n=r(10),i=r(0),s=r(7),o=r(3),l=r(1),u=r(13),f=r(12),v=r(11);function h(d,g,y){if(a.call(this,y),this.estimatedSize=n.MIN_VALUE,this.margin=i.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=d,g!=null&&g instanceof s)this.graphManager=g;else if(g!=null&&g instanceof Layout)this.graphManager=g.graphManager}h.prototype=Object.create(a.prototype);for(var c in a)h[c]=a[c];h.prototype.getNodes=function(){return this.nodes},h.prototype.getEdges=function(){return this.edges},h.prototype.getGraphManager=function(){return this.graphManager},h.prototype.getParent=function(){return this.parent},h.prototype.getLeft=function(){return this.left},h.prototype.getRight=function(){return this.right},h.prototype.getTop=function(){return this.top},h.prototype.getBottom=function(){return this.bottom},h.prototype.isConnected=function(){return this.isConnected},h.prototype.add=function(d,g,y){if(g==null&&y==null){var p=d;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(p)>-1)throw"Node already in graph!";return p.owner=this,this.getNodes().push(p),p}else{var m=d;if(!(this.getNodes().indexOf(g)>-1&&this.getNodes().indexOf(y)>-1))throw"Source or target not in graph!";if(!(g.owner==y.owner&&g.owner==this))throw"Both owners must be this graph!";if(g.owner!=y.owner)return null;if(m.source=g,m.target=y,m.isInterGraph=!1,this.getEdges().push(m),g.edges.push(m),y!=g)y.edges.push(m);return m}},h.prototype.remove=function(d){var g=d;if(d instanceof o){if(g==null)throw"Node is null!";if(!(g.owner!=null&&g.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";var y=g.edges.slice(),p,m=y.length;for(var b=0;b<m;b++)if(p=y[b],p.isInterGraph)this.graphManager.remove(p);else p.source.owner.remove(p);var E=this.nodes.indexOf(g);if(E==-1)throw"Node not in owner node list!";this.nodes.splice(E,1)}else if(d instanceof l){var p=d;if(p==null)throw"Edge is null!";if(!(p.source!=null&&p.target!=null))throw"Source and/or target is null!";if(!(p.source.owner!=null&&p.target.owner!=null&&p.source.owner==this&&p.target.owner==this))throw"Source and/or target owner is invalid!";var A=p.source.edges.indexOf(p),M=p.target.edges.indexOf(p);if(!(A>-1&&M>-1))throw"Source and/or target doesn't know this edge!";if(p.source.edges.splice(A,1),p.target!=p.source)p.target.edges.splice(M,1);var E=p.source.owner.getEdges().indexOf(p);if(E==-1)throw"Not in owner's edge list!";p.source.owner.getEdges().splice(E,1)}},h.prototype.updateLeftTop=function(){var{MAX_VALUE:d,MAX_VALUE:g}=n,y,p,m,b=this.getNodes(),E=b.length;for(var A=0;A<E;A++){var M=b[A];if(y=M.getTop(),p=M.getLeft(),d>y)d=y;if(g>p)g=p}if(d==n.MAX_VALUE)return null;if(b[0].getParent().paddingLeft!=null)m=b[0].getParent().paddingLeft;else m=this.margin;return this.left=g-m,this.top=d-m,new f(this.left,this.top)},h.prototype.updateBounds=function(d){var g=n.MAX_VALUE,y=-n.MAX_VALUE,p=n.MAX_VALUE,m=-n.MAX_VALUE,b,E,A,M,S,P=this.nodes,N=P.length;for(var R=0;R<N;R++){var I=P[R];if(d&&I.child!=null)I.updateBounds();if(b=I.getLeft(),E=I.getRight(),A=I.getTop(),M=I.getBottom(),g>b)g=b;if(y<E)y=E;if(p>A)p=A;if(m<M)m=M}var w=new u(g,p,y-g,m-p);if(g==n.MAX_VALUE)this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom();if(P[0].getParent().paddingLeft!=null)S=P[0].getParent().paddingLeft;else S=this.margin;this.left=w.x-S,this.right=w.x+w.width+S,this.top=w.y-S,this.bottom=w.y+w.height+S},h.calculateBounds=function(d){var g=n.MAX_VALUE,y=-n.MAX_VALUE,p=n.MAX_VALUE,m=-n.MAX_VALUE,b,E,A,M,S=d.length;for(var P=0;P<S;P++){var N=d[P];if(b=N.getLeft(),E=N.getRight(),A=N.getTop(),M=N.getBottom(),g>b)g=b;if(y<E)y=E;if(p>A)p=A;if(m<M)m=M}var R=new u(g,p,y-g,m-p);return R},h.prototype.getInclusionTreeDepth=function(){if(this==this.graphManager.getRoot())return 1;else return this.parent.getInclusionTreeDepth()},h.prototype.getEstimatedSize=function(){if(this.estimatedSize==n.MIN_VALUE)throw"assert failed";return this.estimatedSize},h.prototype.calcEstimatedSize=function(){var d=0,g=this.nodes,y=g.length;for(var p=0;p<y;p++){var m=g[p];d+=m.calcEstimatedSize()}if(d==0)this.estimatedSize=i.EMPTY_COMPOUND_NODE_SIZE;else this.estimatedSize=d/Math.sqrt(this.nodes.length);return this.estimatedSize},h.prototype.updateConnected=function(){var d=this;if(this.nodes.length==0){this.isConnected=!0;return}var g=new v,y=new Set,p=this.nodes[0],m,b,E=p.withChildren();E.forEach(function(R){g.push(R),y.add(R)});while(g.length!==0){p=g.shift(),m=p.getEdges();var A=m.length;for(var M=0;M<A;M++){var S=m[M];if(b=S.getOtherEndInGraph(p,this),b!=null&&!y.has(b)){var P=b.withChildren();P.forEach(function(R){g.push(R),y.add(R)})}}}if(this.isConnected=!1,y.size>=this.nodes.length){var N=0;if(y.forEach(function(R){if(R.owner==d)N++}),N==this.nodes.length)this.isConnected=!0}},t.exports=h},function(t,e,r){var a,n=r(1);function i(s){a=r(6),this.layout=s,this.graphs=[],this.edges=[]}i.prototype.addRoot=function(){var s=this.layout.newGraph(),o=this.layout.newNode(null),l=this.add(s,o);return this.setRootGraph(l),this.rootGraph},i.prototype.add=function(s,o,l,u,f){if(l==null&&u==null&&f==null){if(s==null)throw"Graph is null!";if(o==null)throw"Parent node is null!";if(this.graphs.indexOf(s)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(s),s.parent!=null)throw"Already has a parent!";if(o.child!=null)throw"Already has a child!";return s.parent=o,o.child=s,s}else{f=l,u=o,l=s;var v=u.getOwner(),h=f.getOwner();if(!(v!=null&&v.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(h!=null&&h.getGraphManager()==this))throw"Target not in this graph mgr!";if(v==h)return l.isInterGraph=!1,v.add(l,u,f);else{if(l.isInterGraph=!0,l.source=u,l.target=f,this.edges.indexOf(l)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(l),!(l.source!=null&&l.target!=null))throw"Edge source and/or target is null!";if(!(l.source.edges.indexOf(l)==-1&&l.target.edges.indexOf(l)==-1))throw"Edge already in source and/or target incidency list!";return l.source.edges.push(l),l.target.edges.push(l),l}}},i.prototype.remove=function(s){if(s instanceof a){var o=s;if(o.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(o==this.rootGraph||o.parent!=null&&o.parent.graphManager==this))throw"Invalid parent node!";var l=[];l=l.concat(o.getEdges());var u,f=l.length;for(var v=0;v<f;v++)u=l[v],o.remove(u);var h=[];h=h.concat(o.getNodes());var c;f=h.length;for(var v=0;v<f;v++)c=h[v],o.remove(c);if(o==this.rootGraph)this.setRootGraph(null);var d=this.graphs.indexOf(o);this.graphs.splice(d,1),o.parent=null}else if(s instanceof n){if(u=s,u==null)throw"Edge is null!";if(!u.isInterGraph)throw"Not an inter-graph edge!";if(!(u.source!=null&&u.target!=null))throw"Source and/or target is null!";if(!(u.source.edges.indexOf(u)!=-1&&u.target.edges.indexOf(u)!=-1))throw"Source and/or target doesn't know this edge!";var d=u.source.edges.indexOf(u);if(u.source.edges.splice(d,1),d=u.target.edges.indexOf(u),u.target.edges.splice(d,1),!(u.source.owner!=null&&u.source.owner.getGraphManager()!=null))throw"Edge owner graph or owner graph manager is null!";if(u.source.owner.getGraphManager().edges.indexOf(u)==-1)throw"Not in owner graph manager's edge list!";var d=u.source.owner.getGraphManager().edges.indexOf(u);u.source.owner.getGraphManager().edges.splice(d,1)}},i.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},i.prototype.getGraphs=function(){return this.graphs},i.prototype.getAllNodes=function(){if(this.allNodes==null){var s=[],o=this.getGraphs(),l=o.length;for(var u=0;u<l;u++)s=s.concat(o[u].getNodes());this.allNodes=s}return this.allNodes},i.prototype.resetAllNodes=function(){this.allNodes=null},i.prototype.resetAllEdges=function(){this.allEdges=null},i.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},i.prototype.getAllEdges=function(){if(this.allEdges==null){var s=[],o=this.getGraphs(),l=o.length;for(var u=0;u<o.length;u++)s=s.concat(o[u].getEdges());s=s.concat(this.edges),this.allEdges=s}return this.allEdges},i.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},i.prototype.setAllNodesToApplyGravitation=function(s){if(this.allNodesToApplyGravitation!=null)throw"assert failed";this.allNodesToApplyGravitation=s},i.prototype.getRoot=function(){return this.rootGraph},i.prototype.setRootGraph=function(s){if(s.getGraphManager()!=this)throw"Root not in this graph mgr!";if(this.rootGraph=s,s.parent==null)s.parent=this.layout.newNode("Root node")},i.prototype.getLayout=function(){return this.layout},i.prototype.isOneAncestorOfOther=function(s,o){if(!(s!=null&&o!=null))throw"assert failed";if(s==o)return!0;var l=s.getOwner(),u;do{if(u=l.getParent(),u==null)break;if(u==o)return!0;if(l=u.getOwner(),l==null)break}while(!0);l=o.getOwner();do{if(u=l.getParent(),u==null)break;if(u==s)return!0;if(l=u.getOwner(),l==null)break}while(!0);return!1},i.prototype.calcLowestCommonAncestors=function(){var s,o,l,u,f,v=this.getAllEdges(),h=v.length;for(var c=0;c<h;c++){if(s=v[c],o=s.source,l=s.target,s.lca=null,s.sourceInLca=o,s.targetInLca=l,o==l){s.lca=o.getOwner();continue}u=o.getOwner();while(s.lca==null){s.targetInLca=l,f=l.getOwner();while(s.lca==null){if(f==u){s.lca=f;break}if(f==this.rootGraph)break;if(s.lca!=null)throw"assert failed";s.targetInLca=f.getParent(),f=s.targetInLca.getOwner()}if(u==this.rootGraph)break;if(s.lca==null)s.sourceInLca=u.getParent(),u=s.sourceInLca.getOwner()}if(s.lca==null)throw"assert failed"}},i.prototype.calcLowestCommonAncestor=function(s,o){if(s==o)return s.getOwner();var l=s.getOwner();do{if(l==null)break;var u=o.getOwner();do{if(u==null)break;if(u==l)return u;u=u.getParent().getOwner()}while(!0);l=l.getParent().getOwner()}while(!0);return l},i.prototype.calcInclusionTreeDepths=function(s,o){if(s==null&&o==null)s=this.rootGraph,o=1;var l,u=s.getNodes(),f=u.length;for(var v=0;v<f;v++)if(l=u[v],l.inclusionTreeDepth=o,l.child!=null)this.calcInclusionTreeDepths(l.child,o+1)},i.prototype.includesInvalidEdge=function(){var s,o=[],l=this.edges.length;for(var u=0;u<l;u++)if(s=this.edges[u],this.isOneAncestorOfOther(s.source,s.target))o.push(s);for(var u=0;u<o.length;u++)this.remove(o[u]);return!1},t.exports=i},function(t,e,r){var a=r(12);function n(){}n.calcSeparationAmount=function(i,s,o,l){if(!i.intersects(s))throw"assert failed";var u=[,,];if(this.decideDirectionsForOverlappingNodes(i,s,u),o[0]=Math.min(i.getRight(),s.getRight())-Math.max(i.x,s.x),o[1]=Math.min(i.getBottom(),s.getBottom())-Math.max(i.y,s.y),i.getX()<=s.getX()&&i.getRight()>=s.getRight())o[0]+=Math.min(s.getX()-i.getX(),i.getRight()-s.getRight());else if(s.getX()<=i.getX()&&s.getRight()>=i.getRight())o[0]+=Math.min(i.getX()-s.getX(),s.getRight()-i.getRight());if(i.getY()<=s.getY()&&i.getBottom()>=s.getBottom())o[1]+=Math.min(s.getY()-i.getY(),i.getBottom()-s.getBottom());else if(s.getY()<=i.getY()&&s.getBottom()>=i.getBottom())o[1]+=Math.min(i.getY()-s.getY(),s.getBottom()-i.getBottom());var f=Math.abs((s.getCenterY()-i.getCenterY())/(s.getCenterX()-i.getCenterX()));if(s.getCenterY()===i.getCenterY()&&s.getCenterX()===i.getCenterX())f=1;var v=f*o[0],h=o[1]/f;if(o[0]<h)h=o[0];else v=o[1];o[0]=-1*u[0]*(h/2+l),o[1]=-1*u[1]*(v/2+l)},n.decideDirectionsForOverlappingNodes=function(i,s,o){if(i.getCenterX()<s.getCenterX())o[0]=-1;else o[0]=1;if(i.getCenterY()<s.getCenterY())o[1]=-1;else o[1]=1},n.getIntersection2=function(i,s,o){var l=i.getCenterX(),u=i.getCenterY(),f=s.getCenterX(),v=s.getCenterY();if(i.intersects(s))return o[0]=l,o[1]=u,o[2]=f,o[3]=v,!0;var h=i.getX(),c=i.getY(),d=i.getRight(),g=i.getX(),y=i.getBottom(),p=i.getRight(),m=i.getWidthHalf(),b=i.getHeightHalf(),E=s.getX(),A=s.getY(),M=s.getRight(),S=s.getX(),P=s.getBottom(),N=s.getRight(),R=s.getWidthHalf(),I=s.getHeightHalf(),w=!1,x=!1;if(l===f){if(u>v)return o[0]=l,o[1]=c,o[2]=f,o[3]=P,!1;else if(u<v)return o[0]=l,o[1]=y,o[2]=f,o[3]=A,!1}else if(u===v){if(l>f)return o[0]=h,o[1]=u,o[2]=M,o[3]=v,!1;else if(l<f)return o[0]=d,o[1]=u,o[2]=E,o[3]=v,!1}else{var T=i.height/i.width,D=s.height/s.width,C=(v-u)/(f-l),O=void 0,B=void 0,z=void 0,V=void 0,k=void 0,G=void 0;if(-T===C)if(l>f)o[0]=g,o[1]=y,w=!0;else o[0]=d,o[1]=c,w=!0;else if(T===C)if(l>f)o[0]=h,o[1]=c,w=!0;else o[0]=p,o[1]=y,w=!0;if(-D===C)if(f>l)o[2]=S,o[3]=P,x=!0;else o[2]=M,o[3]=A,x=!0;else if(D===C)if(f>l)o[2]=E,o[3]=A,x=!0;else o[2]=N,o[3]=P,x=!0;if(w&&x)return!1;if(l>f)if(u>v)O=this.getCardinalDirection(T,C,4),B=this.getCardinalDirection(D,C,2);else O=this.getCardinalDirection(-T,C,3),B=this.getCardinalDirection(-D,C,1);else if(u>v)O=this.getCardinalDirection(-T,C,1),B=this.getCardinalDirection(-D,C,3);else O=this.getCardinalDirection(T,C,2),B=this.getCardinalDirection(D,C,4);if(!w)switch(O){case 1:V=c,z=l+-b/C,o[0]=z,o[1]=V;break;case 2:z=p,V=u+m*C,o[0]=z,o[1]=V;break;case 3:V=y,z=l+b/C,o[0]=z,o[1]=V;break;case 4:z=g,V=u+-m*C,o[0]=z,o[1]=V;break}if(!x)switch(B){case 1:G=A,k=f+-I/C,o[2]=k,o[3]=G;break;case 2:k=N,G=v+R*C,o[2]=k,o[3]=G;break;case 3:G=P,k=f+I/C,o[2]=k,o[3]=G;break;case 4:k=S,G=v+-R*C,o[2]=k,o[3]=G;break}}return!1},n.getCardinalDirection=function(i,s,o){if(i>s)return o;else return 1+o%4},n.getIntersection=function(i,s,o,l){if(l==null)return this.getIntersection2(i,s,o);var{x:u,y:f}=i,{x:v,y:h}=s,{x:c,y:d}=o,{x:g,y}=l,p=void 0,m=void 0,b=void 0,E=void 0,A=void 0,M=void 0,S=void 0,P=void 0,N=void 0;if(b=h-f,A=u-v,S=v*f-u*h,E=y-d,M=c-g,P=g*d-c*y,N=b*M-E*A,N===0)return null;return p=(A*P-M*S)/N,m=(E*S-b*P)/N,new a(p,m)},n.angleOfVector=function(i,s,o,l){var u=void 0;if(i!==o){if(u=Math.atan((l-s)/(o-i)),o<i)u+=Math.PI;else if(l<s)u+=this.TWO_PI}else if(l<s)u=this.ONE_AND_HALF_PI;else u=this.HALF_PI;return u},n.doIntersect=function(i,s,o,l){var{x:u,y:f}=i,{x:v,y:h}=s,{x:c,y:d}=o,{x:g,y}=l,p=(v-u)*(y-d)-(g-c)*(h-f);if(p===0)return!1;else{var m=((y-d)*(g-u)+(c-g)*(y-f))/p,b=((f-h)*(g-u)+(v-u)*(y-f))/p;return 0<m&&m<1&&0<b&&b<1}},n.findCircleLineIntersections=function(i,s,o,l,u,f,v){var h=(o-i)*(o-i)+(l-s)*(l-s),c=2*((i-u)*(o-i)+(s-f)*(l-s)),d=(i-u)*(i-u)+(s-f)*(s-f)-v*v,g=c*c-4*h*d;if(g>=0){var y=(-c+Math.sqrt(c*c-4*h*d))/(2*h),p=(-c-Math.sqrt(c*c-4*h*d))/(2*h),m=null;if(y>=0&&y<=1)return[y];if(p>=0&&p<=1)return[p];return m}else return null},n.HALF_PI=0.5*Math.PI,n.ONE_AND_HALF_PI=1.5*Math.PI,n.TWO_PI=2*Math.PI,n.THREE_PI=3*Math.PI,t.exports=n},function(t,e,r){function a(){}a.sign=function(n){if(n>0)return 1;else if(n<0)return-1;else return 0},a.floor=function(n){return n<0?Math.ceil(n):Math.floor(n)},a.ceil=function(n){return n<0?Math.floor(n):Math.ceil(n)},t.exports=a},function(t,e,r){function a(){}a.MAX_VALUE=2147483647,a.MIN_VALUE=-2147483648,t.exports=a},function(t,e,r){var a=function(){function u(f,v){for(var h=0;h<v.length;h++){var c=v[h];if(c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c)c.writable=!0;Object.defineProperty(f,c.key,c)}}return function(f,v,h){if(v)u(f.prototype,v);if(h)u(f,h);return f}}();function n(u,f){if(!(u instanceof f))throw TypeError("Cannot call a class as a function")}var i=function(f){return{value:f,next:null,prev:null}},s=function(f,v,h,c){if(f!==null)f.next=v;else c.head=v;if(h!==null)h.prev=v;else c.tail=v;return v.prev=f,v.next=h,c.length++,v},o=function(f,v){var{prev:h,next:c}=f;if(h!==null)h.next=c;else v.head=c;if(c!==null)c.prev=h;else v.tail=h;return f.prev=f.next=null,v.length--,f},l=function(){function u(f){var v=this;if(n(this,u),this.length=0,this.head=null,this.tail=null,f!=null)f.forEach(function(h){return v.push(h)})}return a(u,[{key:"size",value:function(){return this.length}},{key:"insertBefore",value:function(v,h){return s(h.prev,i(v),h,this)}},{key:"insertAfter",value:function(v,h){return s(h,i(v),h.next,this)}},{key:"insertNodeBefore",value:function(v,h){return s(h.prev,v,h,this)}},{key:"insertNodeAfter",value:function(v,h){return s(h,v,h.next,this)}},{key:"push",value:function(v){return s(this.tail,i(v),null,this)}},{key:"unshift",value:function(v){return s(null,i(v),this.head,this)}},{key:"remove",value:function(v){return o(v,this)}},{key:"pop",value:function(){return o(this.tail,this).value}},{key:"popNode",value:function(){return o(this.tail,this)}},{key:"shift",value:function(){return o(this.head,this).value}},{key:"shiftNode",value:function(){return o(this.head,this)}},{key:"get_object_at",value:function(v){if(v<=this.length()){var h=1,c=this.head;while(h<v)c=c.next,h++;return c.value}}},{key:"set_object_at",value:function(v,h){if(v<=this.length()){var c=1,d=this.head;while(c<v)d=d.next,c++;d.value=h}}}]),u}();t.exports=l},function(t,e,r){function a(n,i,s){if(this.x=null,this.y=null,n==null&&i==null&&s==null)this.x=0,this.y=0;else if(typeof n=="number"&&typeof i=="number"&&s==null)this.x=n,this.y=i;else if(n.constructor.name=="Point"&&i==null&&s==null)s=n,this.x=s.x,this.y=s.y}a.prototype.getX=function(){return this.x},a.prototype.getY=function(){return this.y},a.prototype.getLocation=function(){return new a(this.x,this.y)},a.prototype.setLocation=function(n,i,s){if(n.constructor.name=="Point"&&i==null&&s==null)s=n,this.setLocation(s.x,s.y);else if(typeof n=="number"&&typeof i=="number"&&s==null)if(parseInt(n)==n&&parseInt(i)==i)this.move(n,i);else this.x=Math.floor(n+0.5),this.y=Math.floor(i+0.5)},a.prototype.move=function(n,i){this.x=n,this.y=i},a.prototype.translate=function(n,i){this.x+=n,this.y+=i},a.prototype.equals=function(n){if(n.constructor.name=="Point"){var i=n;return this.x==i.x&&this.y==i.y}return this==n},a.prototype.toString=function(){return new a().constructor.name+"[x="+this.x+",y="+this.y+"]"},t.exports=a},function(t,e,r){function a(n,i,s,o){if(this.x=0,this.y=0,this.width=0,this.height=0,n!=null&&i!=null&&s!=null&&o!=null)this.x=n,this.y=i,this.width=s,this.height=o}a.prototype.getX=function(){return this.x},a.prototype.setX=function(n){this.x=n},a.prototype.getY=function(){return this.y},a.prototype.setY=function(n){this.y=n},a.prototype.getWidth=function(){return this.width},a.prototype.setWidth=function(n){this.width=n},a.prototype.getHeight=function(){return this.height},a.prototype.setHeight=function(n){this.height=n},a.prototype.getRight=function(){return this.x+this.width},a.prototype.getBottom=function(){return this.y+this.height},a.prototype.intersects=function(n){if(this.getRight()<n.x)return!1;if(this.getBottom()<n.y)return!1;if(n.getRight()<this.x)return!1;if(n.getBottom()<this.y)return!1;return!0},a.prototype.getCenterX=function(){return this.x+this.width/2},a.prototype.getMinX=function(){return this.getX()},a.prototype.getMaxX=function(){return this.getX()+this.width},a.prototype.getCenterY=function(){return this.y+this.height/2},a.prototype.getMinY=function(){return this.getY()},a.prototype.getMaxY=function(){return this.getY()+this.height},a.prototype.getWidthHalf=function(){return this.width/2},a.prototype.getHeightHalf=function(){return this.height/2},t.exports=a},function(t,e,r){var a=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(i){return typeof i}:function(i){return i&&typeof Symbol==="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i};function n(){}n.lastID=0,n.createID=function(i){if(n.isPrimitive(i))return i;if(i.uniqueID!=null)return i.uniqueID;return i.uniqueID=n.getString(),n.lastID++,i.uniqueID},n.getString=function(i){if(i==null)i=n.lastID;return"Object#"+i},n.isPrimitive=function(i){var s=typeof i>"u"?"undefined":a(i);return i==null||s!="object"&&s!="function"},t.exports=n},function(t,e,r){function a(c){if(Array.isArray(c)){for(var d=0,g=Array(c.length);d<c.length;d++)g[d]=c[d];return g}else return Array.from(c)}var n=r(0),i=r(7),s=r(3),o=r(1),l=r(6),u=r(5),f=r(17),v=r(29);function h(c){if(v.call(this),this.layoutQuality=n.QUALITY,this.createBendsAsNeeded=n.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=n.DEFAULT_INCREMENTAL,this.animationOnLayout=n.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=n.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=n.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=n.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new i(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,c!=null)this.isRemoteUse=c}h.RANDOM_SEED=1,h.prototype=Object.create(v.prototype),h.prototype.getGraphManager=function(){return this.graphManager},h.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},h.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},h.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},h.prototype.newGraphManager=function(){var c=new i(this);return this.graphManager=c,c},h.prototype.newGraph=function(c){return new l(null,this.graphManager,c)},h.prototype.newNode=function(c){return new s(this.graphManager,c)},h.prototype.newEdge=function(c){return new o(null,null,c)},h.prototype.checkLayoutSuccess=function(){return this.graphManager.getRoot()==null||this.graphManager.getRoot().getNodes().length==0||this.graphManager.includesInvalidEdge()},h.prototype.runLayout=function(){if(this.isLayoutFinished=!1,this.tilingPreLayout)this.tilingPreLayout();this.initParameters();var c;if(this.checkLayoutSuccess())c=!1;else c=this.layout();if(n.ANIMATE==="during")return!1;if(c){if(!this.isSubLayout)this.doPostLayout()}if(this.tilingPostLayout)this.tilingPostLayout();return this.isLayoutFinished=!0,c},h.prototype.doPostLayout=function(){if(!this.incremental)this.transform();this.update()},h.prototype.update2=function(){if(this.createBendsAsNeeded)this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges();if(!this.isRemoteUse){var c,d=this.graphManager.getAllEdges();for(var g=0;g<d.length;g++)c=d[g];var y,p=this.graphManager.getRoot().getNodes();for(var g=0;g<p.length;g++)y=p[g];this.update(this.graphManager.getRoot())}},h.prototype.update=function(c){if(c==null)this.update2();else if(c instanceof s){var d=c;if(d.getChild()!=null){var g=d.getChild().getNodes();for(var y=0;y<g.length;y++)update(g[y])}if(d.vGraphObject!=null){var p=d.vGraphObject;p.update(d)}}else if(c instanceof o){var m=c;if(m.vGraphObject!=null){var b=m.vGraphObject;b.update(m)}}else if(c instanceof l){var E=c;if(E.vGraphObject!=null){var A=E.vGraphObject;A.update(E)}}},h.prototype.initParameters=function(){if(!this.isSubLayout)this.layoutQuality=n.QUALITY,this.animationDuringLayout=n.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=n.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=n.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=n.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=n.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=n.DEFAULT_UNIFORM_LEAF_NODE_SIZES;if(this.animationDuringLayout)this.animationOnLayout=!1},h.prototype.transform=function(c){if(c==null)this.transform(new u(0,0));else{var d=new f,g=this.graphManager.getRoot().updateLeftTop();if(g!=null){d.setWorldOrgX(c.x),d.setWorldOrgY(c.y),d.setDeviceOrgX(g.x),d.setDeviceOrgY(g.y);var y=this.getAllNodes(),p;for(var m=0;m<y.length;m++)p=y[m],p.transform(d)}}},h.prototype.positionNodesRandomly=function(c){if(c==null)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else{var d,g,y=c.getNodes();for(var p=0;p<y.length;p++)if(d=y[p],g=d.getChild(),g==null)d.scatter();else if(g.getNodes().length==0)d.scatter();else this.positionNodesRandomly(g),d.updateBounds()}},h.prototype.getFlatForest=function(){var c=[],d=!0,g=this.graphManager.getRoot().getNodes(),y=!0;for(var p=0;p<g.length;p++)if(g[p].getChild()!=null)y=!1;if(!y)return c;var m=new Set,b=[],E=new Map,A=[];A=A.concat(g);while(A.length>0&&d){b.push(A[0]);while(b.length>0&&d){var M=b[0];b.splice(0,1),m.add(M);var S=M.getEdges();for(var p=0;p<S.length;p++){var P=S[p].getOtherEnd(M);if(E.get(M)!=P)if(!m.has(P))b.push(P),E.set(P,M);else{d=!1;break}}}if(!d)c=[];else{var N=[].concat(a(m));c.push(N);for(var p=0;p<N.length;p++){var R=N[p],I=A.indexOf(R);if(I>-1)A.splice(I,1)}m=new Set,E=new Map}}return c},h.prototype.createDummyNodesForBendpoints=function(c){var d=[],g=c.source,y=this.graphManager.calcLowestCommonAncestor(c.source,c.target);for(var p=0;p<c.bendpoints.length;p++){var m=this.newNode(null);m.setRect(new Point(0,0),new Dimension(1,1)),y.add(m);var b=this.newEdge(null);this.graphManager.add(b,g,m),d.add(m),g=m}var b=this.newEdge(null);if(this.graphManager.add(b,g,c.target),this.edgeToDummyNodes.set(c,d),c.isInterGraph())this.graphManager.remove(c);else y.remove(c);return d},h.prototype.createBendpointsFromDummyNodes=function(){var c=[];c=c.concat(this.graphManager.getAllEdges()),c=[].concat(a(this.edgeToDummyNodes.keys())).concat(c);for(var d=0;d<c.length;d++){var g=c[d];if(g.bendpoints.length>0){var y=this.edgeToDummyNodes.get(g);for(var p=0;p<y.length;p++){var m=y[p],b=new u(m.getCenterX(),m.getCenterY()),E=g.bendpoints.get(p);E.x=b.x,E.y=b.y,m.getOwner().remove(m)}this.graphManager.add(g,g.source,g.target)}}},h.transform=function(c,d,g,y){if(g!=null&&y!=null){var p=d;if(c<=50){var m=d/g;p-=(d-m)/50*(50-c)}else{var b=d*y;p+=(b-d)/50*(c-50)}return p}else{var E,A;if(c<=50)E=9*d/500,A=d/10;else E=9*d/50,A=-8*d;return E*c+A}},h.findCenterOfTree=function(c){var d=[];d=d.concat(c);var g=[],y=new Map,p=!1,m=null;if(d.length==1||d.length==2)p=!0,m=d[0];for(var b=0;b<d.length;b++){var E=d[b],A=E.getNeighborsList().size;if(y.set(E,E.getNeighborsList().size),A==1)g.push(E)}var M=[];M=M.concat(g);while(!p){var S=[];S=S.concat(M),M=[];for(var b=0;b<d.length;b++){var E=d[b],P=d.indexOf(E);if(P>=0)d.splice(P,1);var N=E.getNeighborsList();N.forEach(function(w){if(g.indexOf(w)<0){var x=y.get(w),T=x-1;if(T==1)M.push(w);y.set(w,T)}})}if(g=g.concat(M),d.length==1||d.length==2)p=!0,m=d[0]}return m},h.prototype.setGraphManager=function(c){this.graphManager=c},t.exports=h},function(t,e,r){function a(){}a.seed=1,a.x=0,a.nextDouble=function(){return a.x=Math.sin(a.seed++)*1e4,a.x-Math.floor(a.x)},t.exports=a},function(t,e,r){var a=r(5);function n(i,s){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}n.prototype.getWorldOrgX=function(){return this.lworldOrgX},n.prototype.setWorldOrgX=function(i){this.lworldOrgX=i},n.prototype.getWorldOrgY=function(){return this.lworldOrgY},n.prototype.setWorldOrgY=function(i){this.lworldOrgY=i},n.prototype.getWorldExtX=function(){return this.lworldExtX},n.prototype.setWorldExtX=function(i){this.lworldExtX=i},n.prototype.getWorldExtY=function(){return this.lworldExtY},n.prototype.setWorldExtY=function(i){this.lworldExtY=i},n.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},n.prototype.setDeviceOrgX=function(i){this.ldeviceOrgX=i},n.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},n.prototype.setDeviceOrgY=function(i){this.ldeviceOrgY=i},n.prototype.getDeviceExtX=function(){return this.ldeviceExtX},n.prototype.setDeviceExtX=function(i){this.ldeviceExtX=i},n.prototype.getDeviceExtY=function(){return this.ldeviceExtY},n.prototype.setDeviceExtY=function(i){this.ldeviceExtY=i},n.prototype.transformX=function(i){var s=0,o=this.lworldExtX;if(o!=0)s=this.ldeviceOrgX+(i-this.lworldOrgX)*this.ldeviceExtX/o;return s},n.prototype.transformY=function(i){var s=0,o=this.lworldExtY;if(o!=0)s=this.ldeviceOrgY+(i-this.lworldOrgY)*this.ldeviceExtY/o;return s},n.prototype.inverseTransformX=function(i){var s=0,o=this.ldeviceExtX;if(o!=0)s=this.lworldOrgX+(i-this.ldeviceOrgX)*this.lworldExtX/o;return s},n.prototype.inverseTransformY=function(i){var s=0,o=this.ldeviceExtY;if(o!=0)s=this.lworldOrgY+(i-this.ldeviceOrgY)*this.lworldExtY/o;return s},n.prototype.inverseTransformPoint=function(i){var s=new a(this.inverseTransformX(i.x),this.inverseTransformY(i.y));return s},t.exports=n},function(t,e,r){function a(v){if(Array.isArray(v)){for(var h=0,c=Array(v.length);h<v.length;h++)c[h]=v[h];return c}else return Array.from(v)}var n=r(15),i=r(4),s=r(0),o=r(8),l=r(9);function u(){n.call(this),this.useSmartIdealEdgeLengthCalculation=i.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=i.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=i.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=i.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=i.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*i.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=i.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=i.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=i.MAX_ITERATIONS}u.prototype=Object.create(n.prototype);for(var f in n)u[f]=n[f];u.prototype.initParameters=function(){n.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=i.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},u.prototype.calcIdealEdgeLengths=function(){var v,h,c,d,g,y,p,m=this.getGraphManager().getAllEdges();for(var b=0;b<m.length;b++)if(v=m[b],h=v.idealLength,v.isInterGraph){if(d=v.getSource(),g=v.getTarget(),y=v.getSourceInLca().getEstimatedSize(),p=v.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation)v.idealLength+=y+p-2*s.SIMPLE_NODE_SIZE;c=v.getLca().getInclusionTreeDepth(),v.idealLength+=h*i.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(d.getInclusionTreeDepth()+g.getInclusionTreeDepth()-2*c)}},u.prototype.initSpringEmbedder=function(){var v=this.getAllNodes().length;if(this.incremental){if(v>i.ADAPTATION_LOWER_NODE_LIMIT)this.coolingFactor=Math.max(this.coolingFactor*i.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(v-i.ADAPTATION_LOWER_NODE_LIMIT)/(i.ADAPTATION_UPPER_NODE_LIMIT-i.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-i.COOLING_ADAPTATION_FACTOR));this.maxNodeDisplacement=i.MAX_NODE_DISPLACEMENT_INCREMENTAL}else{if(v>i.ADAPTATION_LOWER_NODE_LIMIT)this.coolingFactor=Math.max(i.COOLING_ADAPTATION_FACTOR,1-(v-i.ADAPTATION_LOWER_NODE_LIMIT)/(i.ADAPTATION_UPPER_NODE_LIMIT-i.ADAPTATION_LOWER_NODE_LIMIT)*(1-i.COOLING_ADAPTATION_FACTOR));else this.coolingFactor=1;this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=i.MAX_NODE_DISPLACEMENT}this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*i.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},u.prototype.calcSpringForces=function(){var v=this.getAllEdges(),h;for(var c=0;c<v.length;c++)h=v[c],this.calcSpringForce(h,h.idealLength)},u.prototype.calcRepulsionForces=function(){var v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,c,d,g,y,p=this.getAllNodes(),m;if(this.useFRGridVariant){if(this.totalIterations%i.GRID_CALCULATION_CHECK_PERIOD==1&&v)this.updateGrid();m=new Set;for(c=0;c<p.length;c++)g=p[c],this.calculateRepulsionForceOfANode(g,m,v,h),m.add(g)}else for(c=0;c<p.length;c++){g=p[c];for(d=c+1;d<p.length;d++){if(y=p[d],g.getOwner()!=y.getOwner())continue;this.calcRepulsionForce(g,y)}}},u.prototype.calcGravitationalForces=function(){var v,h=this.getAllNodesToApplyGravitation();for(var c=0;c<h.length;c++)v=h[c],this.calcGravitationalForce(v)},u.prototype.moveNodes=function(){var v=this.getAllNodes(),h;for(var c=0;c<v.length;c++)h=v[c],h.move()},u.prototype.calcSpringForce=function(v,h){var c=v.getSource(),d=v.getTarget(),g,y,p,m;if(this.uniformLeafNodeSizes&&c.getChild()==null&&d.getChild()==null)v.updateLengthSimple();else if(v.updateLength(),v.isOverlapingSourceAndTarget)return;if(g=v.getLength(),g==0)return;y=v.edgeElasticity*(g-h),p=y*(v.lengthX/g),m=y*(v.lengthY/g),c.springForceX+=p,c.springForceY+=m,d.springForceX-=p,d.springForceY-=m},u.prototype.calcRepulsionForce=function(v,h){var c=v.getRect(),d=h.getRect(),g=[,,],y=[,,,,],p,m,b,E,A,M,S;if(c.intersects(d)){o.calcSeparationAmount(c,d,g,i.DEFAULT_EDGE_LENGTH/2),M=2*g[0],S=2*g[1];var P=v.noOfChildren*h.noOfChildren/(v.noOfChildren+h.noOfChildren);v.repulsionForceX-=P*M,v.repulsionForceY-=P*S,h.repulsionForceX+=P*M,h.repulsionForceY+=P*S}else{if(this.uniformLeafNodeSizes&&v.getChild()==null&&h.getChild()==null)p=d.getCenterX()-c.getCenterX(),m=d.getCenterY()-c.getCenterY();else o.getIntersection(c,d,y),p=y[2]-y[0],m=y[3]-y[1];if(Math.abs(p)<i.MIN_REPULSION_DIST)p=l.sign(p)*i.MIN_REPULSION_DIST;if(Math.abs(m)<i.MIN_REPULSION_DIST)m=l.sign(m)*i.MIN_REPULSION_DIST;b=p*p+m*m,E=Math.sqrt(b),A=(v.nodeRepulsion/2+h.nodeRepulsion/2)*v.noOfChildren*h.noOfChildren/b,M=A*p/E,S=A*m/E,v.repulsionForceX-=M,v.repulsionForceY-=S,h.repulsionForceX+=M,h.repulsionForceY+=S}},u.prototype.calcGravitationalForce=function(v){var h,c,d,g,y,p,m,b;if(h=v.getOwner(),c=(h.getRight()+h.getLeft())/2,d=(h.getTop()+h.getBottom())/2,g=v.getCenterX()-c,y=v.getCenterY()-d,p=Math.abs(g)+v.getWidth()/2,m=Math.abs(y)+v.getHeight()/2,v.getOwner()==this.graphManager.getRoot()){if(b=h.getEstimatedSize()*this.gravityRangeFactor,p>b||m>b)v.gravitationForceX=-this.gravityConstant*g,v.gravitationForceY=-this.gravityConstant*y}else if(b=h.getEstimatedSize()*this.compoundGravityRangeFactor,p>b||m>b)v.gravitationForceX=-this.gravityConstant*g*this.compoundGravityConstant,v.gravitationForceY=-this.gravityConstant*y*this.compoundGravityConstant},u.prototype.isConverged=function(){var v,h=!1;if(this.totalIterations>this.maxIterations/3)h=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2;return v=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,v||h},u.prototype.animate=function(){if(this.animationDuringLayout&&!this.isSubLayout)if(this.notAnimatedIterations==this.animationPeriod)this.update(),this.notAnimatedIterations=0;else this.notAnimatedIterations++},u.prototype.calcNoOfChildrenForAllNodes=function(){var v,h=this.graphManager.getAllNodes();for(var c=0;c<h.length;c++)v=h[c],v.noOfChildren=v.getNoOfChildren()},u.prototype.calcGrid=function(v){var h=0,c=0;h=parseInt(Math.ceil((v.getRight()-v.getLeft())/this.repulsionRange)),c=parseInt(Math.ceil((v.getBottom()-v.getTop())/this.repulsionRange));var d=Array(h);for(var g=0;g<h;g++)d[g]=Array(c);for(var g=0;g<h;g++)for(var y=0;y<c;y++)d[g][y]=[];return d},u.prototype.addNodeToGrid=function(v,h,c){var d=0,g=0,y=0,p=0;d=parseInt(Math.floor((v.getRect().x-h)/this.repulsionRange)),g=parseInt(Math.floor((v.getRect().width+v.getRect().x-h)/this.repulsionRange)),y=parseInt(Math.floor((v.getRect().y-c)/this.repulsionRange)),p=parseInt(Math.floor((v.getRect().height+v.getRect().y-c)/this.repulsionRange));for(var m=d;m<=g;m++)for(var b=y;b<=p;b++)this.grid[m][b].push(v),v.setGridCoordinates(d,g,y,p)},u.prototype.updateGrid=function(){var v,h,c=this.getAllNodes();this.grid=this.calcGrid(this.graphManager.getRoot());for(v=0;v<c.length;v++)h=c[v],this.addNodeToGrid(h,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},u.prototype.calculateRepulsionForceOfANode=function(v,h,c,d){if(this.totalIterations%i.GRID_CALCULATION_CHECK_PERIOD==1&&c||d){var g=new Set;v.surrounding=[];var y,p=this.grid;for(var m=v.startX-1;m<v.finishX+2;m++)for(var b=v.startY-1;b<v.finishY+2;b++)if(!(m<0||b<0||m>=p.length||b>=p[0].length))for(var E=0;E<p[m][b].length;E++){if(y=p[m][b][E],v.getOwner()!=y.getOwner()||v==y)continue;if(!h.has(y)&&!g.has(y)){var A=Math.abs(v.getCenterX()-y.getCenterX())-(v.getWidth()/2+y.getWidth()/2),M=Math.abs(v.getCenterY()-y.getCenterY())-(v.getHeight()/2+y.getHeight()/2);if(A<=this.repulsionRange&&M<=this.repulsionRange)g.add(y)}}v.surrounding=[].concat(a(g))}for(m=0;m<v.surrounding.length;m++)this.calcRepulsionForce(v,v.surrounding[m])},u.prototype.calcRepulsionRange=function(){return 0},t.exports=u},function(t,e,r){var a=r(1),n=r(4);function i(o,l,u){a.call(this,o,l,u),this.idealLength=n.DEFAULT_EDGE_LENGTH,this.edgeElasticity=n.DEFAULT_SPRING_STRENGTH}i.prototype=Object.create(a.prototype);for(var s in a)i[s]=a[s];t.exports=i},function(t,e,r){var a=r(3),n=r(4);function i(o,l,u,f){a.call(this,o,l,u,f),this.nodeRepulsion=n.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=[]}i.prototype=Object.create(a.prototype);for(var s in a)i[s]=a[s];i.prototype.setGridCoordinates=function(o,l,u,f){this.startX=o,this.finishX=l,this.startY=u,this.finishY=f},t.exports=i},function(t,e,r){function a(n,i){if(this.width=0,this.height=0,n!==null&&i!==null)this.height=i,this.width=n}a.prototype.getWidth=function(){return this.width},a.prototype.setWidth=function(n){this.width=n},a.prototype.getHeight=function(){return this.height},a.prototype.setHeight=function(n){this.height=n},t.exports=a},function(t,e,r){var a=r(14);function n(){this.map={},this.keys=[]}n.prototype.put=function(i,s){var o=a.createID(i);if(!this.contains(o))this.map[o]=s,this.keys.push(i)},n.prototype.contains=function(i){var s=a.createID(i);return this.map[i]!=null},n.prototype.get=function(i){var s=a.createID(i);return this.map[s]},n.prototype.keySet=function(){return this.keys},t.exports=n},function(t,e,r){var a=r(14);function n(){this.set={}}n.prototype.add=function(i){var s=a.createID(i);if(!this.contains(s))this.set[s]=i},n.prototype.remove=function(i){delete this.set[a.createID(i)]},n.prototype.clear=function(){this.set={}},n.prototype.contains=function(i){return this.set[a.createID(i)]==i},n.prototype.isEmpty=function(){return this.size()===0},n.prototype.size=function(){return Object.keys(this.set).length},n.prototype.addAllTo=function(i){var s=Object.keys(this.set),o=s.length;for(var l=0;l<o;l++)i.push(this.set[s[l]])},n.prototype.size=function(){return Object.keys(this.set).length},n.prototype.addAll=function(i){var s=i.length;for(var o=0;o<s;o++){var l=i[o];this.add(l)}},t.exports=n},function(t,e,r){function a(){}a.multMat=function(n,i){var s=[];for(var o=0;o<n.length;o++){s[o]=[];for(var l=0;l<i[0].length;l++){s[o][l]=0;for(var u=0;u<n[0].length;u++)s[o][l]+=n[o][u]*i[u][l]}}return s},a.transpose=function(n){var i=[];for(var s=0;s<n[0].length;s++){i[s]=[];for(var o=0;o<n.length;o++)i[s][o]=n[o][s]}return i},a.multCons=function(n,i){var s=[];for(var o=0;o<n.length;o++)s[o]=n[o]*i;return s},a.minusOp=function(n,i){var s=[];for(var o=0;o<n.length;o++)s[o]=n[o]-i[o];return s},a.dotProduct=function(n,i){var s=0;for(var o=0;o<n.length;o++)s+=n[o]*i[o];return s},a.mag=function(n){return Math.sqrt(this.dotProduct(n,n))},a.normalize=function(n){var i=[],s=this.mag(n);for(var o=0;o<n.length;o++)i[o]=n[o]/s;return i},a.multGamma=function(n){var i=[],s=0;for(var o=0;o<n.length;o++)s+=n[o];s*=-1/n.length;for(var l=0;l<n.length;l++)i[l]=s+n[l];return i},a.multL=function(n,i,s){var o=[],l=[],u=[];for(var f=0;f<i[0].length;f++){var v=0;for(var h=0;h<i.length;h++)v+=-0.5*i[h][f]*n[h];l[f]=v}for(var c=0;c<s.length;c++){var d=0;for(var g=0;g<s.length;g++)d+=s[c][g]*l[g];u[c]=d}for(var y=0;y<i.length;y++){var p=0;for(var m=0;m<i[0].length;m++)p+=i[y][m]*u[m];o[y]=p}return o},t.exports=a},function(t,e,r){var a=function(){function o(l,u){for(var f=0;f<u.length;f++){var v=u[f];if(v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v)v.writable=!0;Object.defineProperty(l,v.key,v)}}return function(l,u,f){if(u)o(l.prototype,u);if(f)o(l,f);return l}}();function n(o,l){if(!(o instanceof l))throw TypeError("Cannot call a class as a function")}var i=r(11),s=function(){function o(l,u){if(n(this,o),u!==null||u!==void 0)this.compareFunction=this._defaultCompareFunction;var f=void 0;if(l instanceof i)f=l.size();else f=l.length;this._quicksort(l,0,f-1)}return a(o,[{key:"_quicksort",value:function(u,f,v){if(f<v){var h=this._partition(u,f,v);this._quicksort(u,f,h),this._quicksort(u,h+1,v)}}},{key:"_partition",value:function(u,f,v){var h=this._get(u,f),c=f,d=v;while(!0){while(this.compareFunction(h,this._get(u,d)))d--;while(this.compareFunction(this._get(u,c),h))c++;if(c<d)this._swap(u,c,d),c++,d--;else return d}}},{key:"_get",value:function(u,f){if(u instanceof i)return u.get_object_at(f);else return u[f]}},{key:"_set",value:function(u,f,v){if(u instanceof i)u.set_object_at(f,v);else u[f]=v}},{key:"_swap",value:function(u,f,v){var h=this._get(u,f);this._set(u,f,this._get(u,v)),this._set(u,v,h)}},{key:"_defaultCompareFunction",value:function(u,f){return f>u}}]),o}();t.exports=s},function(t,e,r){function a(){}a.svd=function(n){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=n.length,this.n=n[0].length;var i=Math.min(this.m,this.n);this.s=function(He){var Le=[];while(He-- >0)Le.push(0);return Le}(Math.min(this.m+1,this.n)),this.U=function(He){var Le=function nt(Ye){if(Ye.length==0)return 0;else{var tt=[];for(var ct=0;ct<Ye[0];ct++)tt.push(nt(Ye.slice(1)));return tt}};return Le(He)}([this.m,i]),this.V=function(He){var Le=function nt(Ye){if(Ye.length==0)return 0;else{var tt=[];for(var ct=0;ct<Ye[0];ct++)tt.push(nt(Ye.slice(1)));return tt}};return Le(He)}([this.n,this.n]);var s=function(He){var Le=[];while(He-- >0)Le.push(0);return Le}(this.n),o=function(He){var Le=[];while(He-- >0)Le.push(0);return Le}(this.m),l=!0,u=!0,f=Math.min(this.m-1,this.n),v=Math.max(0,Math.min(this.n-2,this.m));for(var h=0;h<Math.max(f,v);h++){if(h<f){this.s[h]=0;for(var c=h;c<this.m;c++)this.s[h]=a.hypot(this.s[h],n[c][h]);if(this.s[h]!==0){if(n[h][h]<0)this.s[h]=-this.s[h];for(var d=h;d<this.m;d++)n[d][h]/=this.s[h];n[h][h]+=1}this.s[h]=-this.s[h]}for(var g=h+1;g<this.n;g++){if(function(He,Le){return He&&Le}(h<f,this.s[h]!==0)){var y=0;for(var p=h;p<this.m;p++)y+=n[p][h]*n[p][g];y=-y/n[h][h];for(var m=h;m<this.m;m++)n[m][g]+=y*n[m][h]}s[g]=n[h][g]}if(function(He,Le){return He&&Le}(l,h<f))for(var b=h;b<this.m;b++)this.U[b][h]=n[b][h];if(h<v){s[h]=0;for(var E=h+1;E<this.n;E++)s[h]=a.hypot(s[h],s[E]);if(s[h]!==0){if(s[h+1]<0)s[h]=-s[h];for(var A=h+1;A<this.n;A++)s[A]/=s[h];s[h+1]+=1}if(s[h]=-s[h],function(He,Le){return He&&Le}(h+1<this.m,s[h]!==0)){for(var M=h+1;M<this.m;M++)o[M]=0;for(var S=h+1;S<this.n;S++)for(var P=h+1;P<this.m;P++)o[P]+=s[S]*n[P][S];for(var N=h+1;N<this.n;N++){var R=-s[N]/s[h+1];for(var I=h+1;I<this.m;I++)n[I][N]+=R*o[I]}}if(u)for(var w=h+1;w<this.n;w++)this.V[w][h]=s[w]}}var x=Math.min(this.n,this.m+1);if(f<this.n)this.s[f]=n[f][f];if(this.m<x)this.s[x-1]=0;if(v+1<x)s[v]=n[v][x-1];if(s[x-1]=0,l){for(var T=f;T<i;T++){for(var D=0;D<this.m;D++)this.U[D][T]=0;this.U[T][T]=1}for(var C=f-1;C>=0;C--)if(this.s[C]!==0){for(var O=C+1;O<i;O++){var B=0;for(var z=C;z<this.m;z++)B+=this.U[z][C]*this.U[z][O];B=-B/this.U[C][C];for(var V=C;V<this.m;V++)this.U[V][O]+=B*this.U[V][C]}for(var k=C;k<this.m;k++)this.U[k][C]=-this.U[k][C];this.U[C][C]=1+this.U[C][C];for(var G=0;G<C-1;G++)this.U[G][C]=0}else{for(var J=0;J<this.m;J++)this.U[J][C]=0;this.U[C][C]=1}}if(u)for(var X=this.n-1;X>=0;X--){if(function(He,Le){return He&&Le}(X<v,s[X]!==0))for(var _=X+1;_<i;_++){var Q=0;for(var q=X+1;q<this.n;q++)Q+=this.V[q][X]*this.V[q][_];Q=-Q/this.V[X+1][X];for(var te=X+1;te<this.n;te++)this.V[te][_]+=Q*this.V[te][X]}for(var Z=0;Z<this.n;Z++)this.V[Z][X]=0;this.V[X][X]=1}var U=x-1,W=0,j=Math.pow(2,-52),re=Math.pow(2,-966);while(x>0){var ee=void 0,de=void 0;for(ee=x-2;ee>=-1;ee--){if(ee===-1)break;if(Math.abs(s[ee])<=re+j*(Math.abs(this.s[ee])+Math.abs(this.s[ee+1]))){s[ee]=0;break}}if(ee===x-2)de=4;else{var Ae=void 0;for(Ae=x-1;Ae>=ee;Ae--){if(Ae===ee)break;var Ce=(Ae!==x?Math.abs(s[Ae]):0)+(Ae!==ee+1?Math.abs(s[Ae-1]):0);if(Math.abs(this.s[Ae])<=re+j*Ce){this.s[Ae]=0;break}}if(Ae===ee)de=3;else if(Ae===x-1)de=1;else de=2,ee=Ae}switch(ee++,de){case 1:{var Se=s[x-2];s[x-2]=0;for(var ge=x-2;ge>=ee;ge--){var ve=a.hypot(this.s[ge],Se),ye=this.s[ge]/ve,Ee=Se/ve;if(this.s[ge]=ve,ge!==ee)Se=-Ee*s[ge-1],s[ge-1]=ye*s[ge-1];if(u)for(var Pe=0;Pe<this.n;Pe++)ve=ye*this.V[Pe][ge]+Ee*this.V[Pe][x-1],this.V[Pe][x-1]=-Ee*this.V[Pe][ge]+ye*this.V[Pe][x-1],this.V[Pe][ge]=ve}}break;case 2:{var Me=s[ee-1];s[ee-1]=0;for(var Ne=ee;Ne<x;Ne++){var Fe=a.hypot(this.s[Ne],Me),ze=this.s[Ne]/Fe,Ue=Me/Fe;if(this.s[Ne]=Fe,Me=-Ue*s[Ne],s[Ne]=ze*s[Ne],l)for(var ie=0;ie<this.m;ie++)Fe=ze*this.U[ie][Ne]+Ue*this.U[ie][ee-1],this.U[ie][ee-1]=-Ue*this.U[ie][Ne]+ze*this.U[ie][ee-1],this.U[ie][Ne]=Fe}}break;case 3:{var L=Math.max(Math.max(Math.max(Math.max(Math.abs(this.s[x-1]),Math.abs(this.s[x-2])),Math.abs(s[x-2])),Math.abs(this.s[ee])),Math.abs(s[ee])),F=this.s[x-1]/L,Y=this.s[x-2]/L,H=s[x-2]/L,K=this.s[ee]/L,se=s[ee]/L,ae=((Y+F)*(Y-F)+H*H)/2,oe=F*H*(F*H),ne=0;if(function(He,Le){return He||Le}(ae!==0,oe!==0)){if(ne=Math.sqrt(ae*ae+oe),ae<0)ne=-ne;ne=oe/(ae+ne)}var ue=(K+F)*(K-F)+ne,be=K*se;for(var fe=ee;fe<x-1;fe++){var le=a.hypot(ue,be),De=ue/le,ce=be/le;if(fe!==ee)s[fe-1]=le;if(ue=De*this.s[fe]+ce*s[fe],s[fe]=De*s[fe]-ce*this.s[fe],be=ce*this.s[fe+1],this.s[fe+1]=De*this.s[fe+1],u)for(var pe=0;pe<this.n;pe++)le=De*this.V[pe][fe]+ce*this.V[pe][fe+1],this.V[pe][fe+1]=-ce*this.V[pe][fe]+De*this.V[pe][fe+1],this.V[pe][fe]=le;if(le=a.hypot(ue,be),De=ue/le,ce=be/le,this.s[fe]=le,ue=De*s[fe]+ce*this.s[fe+1],this.s[fe+1]=-ce*s[fe]+De*this.s[fe+1],be=ce*s[fe+1],s[fe+1]=De*s[fe+1],l&&fe<this.m-1)for(var Ie=0;Ie<this.m;Ie++)le=De*this.U[Ie][fe]+ce*this.U[Ie][fe+1],this.U[Ie][fe+1]=-ce*this.U[Ie][fe]+De*this.U[Ie][fe+1],this.U[Ie][fe]=le}s[x-2]=ue,W=W+1}break;case 4:{if(this.s[ee]<=0){if(this.s[ee]=this.s[ee]<0?-this.s[ee]:0,u)for(var xe=0;xe<=U;xe++)this.V[xe][ee]=-this.V[xe][ee]}while(ee<U){if(this.s[ee]>=this.s[ee+1])break;var me=this.s[ee];if(this.s[ee]=this.s[ee+1],this.s[ee+1]=me,u&&ee<this.n-1)for(var Ve=0;Ve<this.n;Ve++)me=this.V[Ve][ee+1],this.V[Ve][ee+1]=this.V[Ve][ee],this.V[Ve][ee]=me;if(l&&ee<this.m-1)for(var Be=0;Be<this.m;Be++)me=this.U[Be][ee+1],this.U[Be][ee+1]=this.U[Be][ee],this.U[Be][ee]=me;ee++}W=0,x--}break}}var Ke={U:this.U,V:this.V,S:this.s};return Ke},a.hypot=function(n,i){var s=void 0;if(Math.abs(n)>Math.abs(i))s=i/n,s=Math.abs(n)*Math.sqrt(1+s*s);else if(i!=0)s=n/i,s=Math.abs(i)*Math.sqrt(1+s*s);else s=0;return s},t.exports=a},function(t,e,r){var a=function(){function s(o,l){for(var u=0;u<l.length;u++){var f=l[u];if(f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f)f.writable=!0;Object.defineProperty(o,f.key,f)}}return function(o,l,u){if(l)s(o.prototype,l);if(u)s(o,u);return o}}();function n(s,o){if(!(s instanceof o))throw TypeError("Cannot call a class as a function")}var i=function(){function s(o,l){var u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,f=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,v=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;n(this,s),this.sequence1=o,this.sequence2=l,this.match_score=u,this.mismatch_penalty=f,this.gap_penalty=v,this.iMax=o.length+1,this.jMax=l.length+1,this.grid=Array(this.iMax);for(var h=0;h<this.iMax;h++){this.grid[h]=Array(this.jMax);for(var c=0;c<this.jMax;c++)this.grid[h][c]=0}this.tracebackGrid=Array(this.iMax);for(var d=0;d<this.iMax;d++){this.tracebackGrid[d]=Array(this.jMax);for(var g=0;g<this.jMax;g++)this.tracebackGrid[d][g]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return a(s,[{key:"getScore",value:function(){return this.score}},{key:"getAlignments",value:function(){return this.alignments}},{key:"computeGrids",value:function(){for(var l=1;l<this.jMax;l++)this.grid[0][l]=this.grid[0][l-1]+this.gap_penalty,this.tracebackGrid[0][l]=[!1,!1,!0];for(var u=1;u<this.iMax;u++)this.grid[u][0]=this.grid[u-1][0]+this.gap_penalty,this.tracebackGrid[u][0]=[!1,!0,!1];for(var f=1;f<this.iMax;f++)for(var v=1;v<this.jMax;v++){var h=void 0;if(this.sequence1[f-1]===this.sequence2[v-1])h=this.grid[f-1][v-1]+this.match_score;else h=this.grid[f-1][v-1]+this.mismatch_penalty;var c=this.grid[f-1][v]+this.gap_penalty,d=this.grid[f][v-1]+this.gap_penalty,g=[h,c,d],y=this.arrayAllMaxIndexes(g);this.grid[f][v]=g[y[0]],this.tracebackGrid[f][v]=[y.includes(0),y.includes(1),y.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]}},{key:"alignmentTraceback",value:function(){var l=[];l.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});while(l[0]){var u=l[0],f=this.tracebackGrid[u.pos[0]][u.pos[1]];if(f[0])l.push({pos:[u.pos[0]-1,u.pos[1]-1],seq1:this.sequence1[u.pos[0]-1]+u.seq1,seq2:this.sequence2[u.pos[1]-1]+u.seq2});if(f[1])l.push({pos:[u.pos[0]-1,u.pos[1]],seq1:this.sequence1[u.pos[0]-1]+u.seq1,seq2:"-"+u.seq2});if(f[2])l.push({pos:[u.pos[0],u.pos[1]-1],seq1:"-"+u.seq1,seq2:this.sequence2[u.pos[1]-1]+u.seq2});if(u.pos[0]===0&&u.pos[1]===0)this.alignments.push({sequence1:u.seq1,sequence2:u.seq2});l.shift()}return this.alignments}},{key:"getAllIndexes",value:function(l,u){var f=[],v=-1;while((v=l.indexOf(u,v+1))!==-1)f.push(v);return f}},{key:"arrayAllMaxIndexes",value:function(l){return this.getAllIndexes(l,Math.max.apply(null,l))}}]),s}();t.exports=i},function(t,e,r){var a=function(){return};a.FDLayout=r(18),a.FDLayoutConstants=r(4),a.FDLayoutEdge=r(19),a.FDLayoutNode=r(20),a.DimensionD=r(21),a.HashMap=r(22),a.HashSet=r(23),a.IGeometry=r(8),a.IMath=r(9),a.Integer=r(10),a.Point=r(12),a.PointD=r(5),a.RandomSeed=r(16),a.RectangleD=r(13),a.Transform=r(17),a.UniqueIDGeneretor=r(14),a.Quicksort=r(25),a.LinkedList=r(11),a.LGraphObject=r(2),a.LGraph=r(6),a.LEdge=r(1),a.LGraphManager=r(7),a.LNode=r(3),a.Layout=r(15),a.LayoutConstants=r(0),a.NeedlemanWunsch=r(27),a.Matrix=r(24),a.SVD=r(26),t.exports=a},function(t,e,r){function a(){this.listeners=[]}var n=a.prototype;n.addListener=function(i,s){this.listeners.push({event:i,callback:s})},n.removeListener=function(i,s){for(var o=this.listeners.length;o>=0;o--){var l=this.listeners[o];if(l.event===i&&l.callback===s)this.listeners.splice(o,1)}},n.emit=function(i,s){for(var o=0;o<this.listeners.length;o++){var l=this.listeners[o];if(i===l.event)l.callback(s)}},t.exports=a}])})});var vr=Te(function(un,zo){(function(e,r){if(typeof un==="object"&&typeof zo==="object")zo.exports=r(Fo());else if(typeof define==="function"&&define.amd)define(["layout-base"],r);else if(typeof un==="object")un.coseBase=r(Fo());else e.coseBase=r(e.layoutBase)})(un,function(t){return(()=>{var e={45:(i,s,o)=>{var l={};l.layoutBase=o(551),l.CoSEConstants=o(806),l.CoSEEdge=o(767),l.CoSEGraph=o(880),l.CoSEGraphManager=o(578),l.CoSELayout=o(765),l.CoSENode=o(991),l.ConstraintHandler=o(902),i.exports=l},806:(i,s,o)=>{var l=o(551).FDLayoutConstants;function u(){}for(var f in l)u[f]=l[f];u.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,u.DEFAULT_RADIAL_SEPARATION=l.DEFAULT_EDGE_LENGTH,u.DEFAULT_COMPONENT_SEPERATION=60,u.TILE=!0,u.TILING_PADDING_VERTICAL=10,u.TILING_PADDING_HORIZONTAL=10,u.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,u.ENFORCE_CONSTRAINTS=!0,u.APPLY_LAYOUT=!0,u.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,u.TREE_REDUCTION_ON_INCREMENTAL=!0,u.PURE_INCREMENTAL=u.DEFAULT_INCREMENTAL,i.exports=u},767:(i,s,o)=>{var l=o(551).FDLayoutEdge;function u(v,h,c){l.call(this,v,h,c)}u.prototype=Object.create(l.prototype);for(var f in l)u[f]=l[f];i.exports=u},880:(i,s,o)=>{var l=o(551).LGraph;function u(v,h,c){l.call(this,v,h,c)}u.prototype=Object.create(l.prototype);for(var f in l)u[f]=l[f];i.exports=u},578:(i,s,o)=>{var l=o(551).LGraphManager;function u(v){l.call(this,v)}u.prototype=Object.create(l.prototype);for(var f in l)u[f]=l[f];i.exports=u},765:(i,s,o)=>{var l=o(551).FDLayout,u=o(578),f=o(880),v=o(991),h=o(767),c=o(806),d=o(902),g=o(551).FDLayoutConstants,y=o(551).LayoutConstants,p=o(551).Point,m=o(551).PointD,b=o(551).DimensionD,E=o(551).Layout,A=o(551).Integer,M=o(551).IGeometry,S=o(551).LGraph,P=o(551).Transform,N=o(551).LinkedList;function R(){l.call(this),this.toBeTiled={},this.constraints={}}R.prototype=Object.create(l.prototype);for(var I in l)R[I]=l[I];R.prototype.newGraphManager=function(){var w=new u(this);return this.graphManager=w,w},R.prototype.newGraph=function(w){return new f(null,this.graphManager,w)},R.prototype.newNode=function(w){return new v(this.graphManager,w)},R.prototype.newEdge=function(w){return new h(null,null,w)},R.prototype.initParameters=function(){if(l.prototype.initParameters.call(this,arguments),!this.isSubLayout){if(c.DEFAULT_EDGE_LENGTH<10)this.idealEdgeLength=10;else this.idealEdgeLength=c.DEFAULT_EDGE_LENGTH;this.useSmartIdealEdgeLengthCalculation=c.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=g.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=g.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=g.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=g.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1}},R.prototype.initSpringEmbedder=function(){l.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/g.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=0.04,this.coolingAdjuster=1},R.prototype.layout=function(){var w=y.DEFAULT_CREATE_BENDS_AS_NEEDED;if(w)this.createBendpoints(),this.graphManager.resetAllEdges();return this.level=0,this.classicLayout()},R.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){var w=this.getFlatForest();if(w.length>0)this.positionNodesRadially(w);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var x=new Set(this.getAllNodes()),T=this.nodesWithGravity.filter(function(D){return x.has(D)});this.graphManager.setAllNodesToApplyGravitation(T),this.positionNodesRandomly()}}else if(c.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var x=new Set(this.getAllNodes()),T=this.nodesWithGravity.filter(function(O){return x.has(O)});this.graphManager.setAllNodesToApplyGravitation(T)}if(Object.keys(this.constraints).length>0)d.handleConstraints(this),this.initConstraintVariables();if(this.initSpringEmbedder(),c.APPLY_LAYOUT)this.runSpringEmbedder();return!0},R.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%g.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.coolingCycle++,this.layoutQuality==0)this.coolingAdjuster=this.coolingCycle;else if(this.layoutQuality==1)this.coolingAdjuster=this.coolingCycle/3;this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var w=new Set(this.getAllNodes()),x=this.nodesWithGravity.filter(function(C){return w.has(C)});if(this.graphManager.setAllNodesToApplyGravitation(x),this.graphManager.updateBounds(),this.updateGrid(),c.PURE_INCREMENTAL)this.coolingFactor=g.DEFAULT_COOLING_FACTOR_INCREMENTAL/2;else this.coolingFactor=g.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;if(this.afterGrowthIterations%10==0)this.graphManager.updateBounds(),this.updateGrid();if(c.PURE_INCREMENTAL)this.coolingFactor=g.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100);else this.coolingFactor=g.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100);this.afterGrowthIterations++}var T=!this.isTreeGrowing&&!this.isGrowthFinished,D=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(T,D),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},R.prototype.getPositionsData=function(){var w=this.graphManager.getAllNodes(),x={};for(var T=0;T<w.length;T++){var D=w[T].rect,C=w[T].id;x[C]={id:C,x:D.getCenterX(),y:D.getCenterY(),w:D.width,h:D.height}}return x},R.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var w=!1;if(g.ANIMATE==="during")this.emit("layoutstarted");else{while(!w)w=this.tick();this.graphManager.updateBounds()}},R.prototype.moveNodes=function(){var w=this.getAllNodes(),x;for(var T=0;T<w.length;T++)x=w[T],x.calculateDisplacement();if(Object.keys(this.constraints).length>0)this.updateDisplacements();for(var T=0;T<w.length;T++)x=w[T],x.move()},R.prototype.initConstraintVariables=function(){var w=this;this.idToNodeMap=new Map,this.fixedNodeSet=new Set;var x=this.graphManager.getAllNodes();for(var T=0;T<x.length;T++){var D=x[T];this.idToNodeMap.set(D.id,D)}var C=function q(te){var Z=te.getChild().getNodes(),U,W=0;for(var j=0;j<Z.length;j++)if(U=Z[j],U.getChild()==null){if(w.fixedNodeSet.has(U.id))W+=100}else W+=q(U);return W};if(this.constraints.fixedNodeConstraint){this.constraints.fixedNodeConstraint.forEach(function(Z){w.fixedNodeSet.add(Z.nodeId)});var x=this.graphManager.getAllNodes(),D;for(var T=0;T<x.length;T++)if(D=x[T],D.getChild()!=null){var O=C(D);if(O>0)D.fixedNodeWeight=O}}if(this.constraints.relativePlacementConstraint){var B=new Map,z=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(q){w.fixedNodesOnHorizontal.add(q),w.fixedNodesOnVertical.add(q)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical){var V=this.constraints.alignmentConstraint.vertical;for(var T=0;T<V.length;T++)this.dummyToNodeForVerticalAlignment.set("dummy"+T,[]),V[T].forEach(function(te){if(B.set(te,"dummy"+T),w.dummyToNodeForVerticalAlignment.get("dummy"+T).push(te),w.fixedNodeSet.has(te))w.fixedNodesOnHorizontal.add("dummy"+T)})}if(this.constraints.alignmentConstraint.horizontal){var k=this.constraints.alignmentConstraint.horizontal;for(var T=0;T<k.length;T++)this.dummyToNodeForHorizontalAlignment.set("dummy"+T,[]),k[T].forEach(function(te){if(z.set(te,"dummy"+T),w.dummyToNodeForHorizontalAlignment.get("dummy"+T).push(te),w.fixedNodeSet.has(te))w.fixedNodesOnVertical.add("dummy"+T)})}}if(c.RELAX_MOVEMENT_ON_CONSTRAINTS)this.shuffle=function(q){var te,Z,U;for(U=q.length-1;U>=2*q.length/3;U--)te=Math.floor(Math.random()*(U+1)),Z=q[U],q[U]=q[te],q[te]=Z;return q},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(q){if(q.left){var te=B.has(q.left)?B.get(q.left):q.left,Z=B.has(q.right)?B.get(q.right):q.right;if(!w.nodesInRelativeHorizontal.includes(te))if(w.nodesInRelativeHorizontal.push(te),w.nodeToRelativeConstraintMapHorizontal.set(te,[]),w.dummyToNodeForVerticalAlignment.has(te))w.nodeToTempPositionMapHorizontal.set(te,w.idToNodeMap.get(w.dummyToNodeForVerticalAlignment.get(te)[0]).getCenterX());else w.nodeToTempPositionMapHorizontal.set(te,w.idToNodeMap.get(te).getCenterX());if(!w.nodesInRelativeHorizontal.includes(Z))if(w.nodesInRelativeHorizontal.push(Z),w.nodeToRelativeConstraintMapHorizontal.set(Z,[]),w.dummyToNodeForVerticalAlignment.has(Z))w.nodeToTempPositionMapHorizontal.set(Z,w.idToNodeMap.get(w.dummyToNodeForVerticalAlignment.get(Z)[0]).getCenterX());else w.nodeToTempPositionMapHorizontal.set(Z,w.idToNodeMap.get(Z).getCenterX());w.nodeToRelativeConstraintMapHorizontal.get(te).push({right:Z,gap:q.gap}),w.nodeToRelativeConstraintMapHorizontal.get(Z).push({left:te,gap:q.gap})}else{var U=z.has(q.top)?z.get(q.top):q.top,W=z.has(q.bottom)?z.get(q.bottom):q.bottom;if(!w.nodesInRelativeVertical.includes(U))if(w.nodesInRelativeVertical.push(U),w.nodeToRelativeConstraintMapVertical.set(U,[]),w.dummyToNodeForHorizontalAlignment.has(U))w.nodeToTempPositionMapVertical.set(U,w.idToNodeMap.get(w.dummyToNodeForHorizontalAlignment.get(U)[0]).getCenterY());else w.nodeToTempPositionMapVertical.set(U,w.idToNodeMap.get(U).getCenterY());if(!w.nodesInRelativeVertical.includes(W))if(w.nodesInRelativeVertical.push(W),w.nodeToRelativeConstraintMapVertical.set(W,[]),w.dummyToNodeForHorizontalAlignment.has(W))w.nodeToTempPositionMapVertical.set(W,w.idToNodeMap.get(w.dummyToNodeForHorizontalAlignment.get(W)[0]).getCenterY());else w.nodeToTempPositionMapVertical.set(W,w.idToNodeMap.get(W).getCenterY());w.nodeToRelativeConstraintMapVertical.get(U).push({bottom:W,gap:q.gap}),w.nodeToRelativeConstraintMapVertical.get(W).push({top:U,gap:q.gap})}});else{var G=new Map,J=new Map;this.constraints.relativePlacementConstraint.forEach(function(q){if(q.left){var te=B.has(q.left)?B.get(q.left):q.left,Z=B.has(q.right)?B.get(q.right):q.right;if(G.has(te))G.get(te).push(Z);else G.set(te,[Z]);if(G.has(Z))G.get(Z).push(te);else G.set(Z,[te])}else{var U=z.has(q.top)?z.get(q.top):q.top,W=z.has(q.bottom)?z.get(q.bottom):q.bottom;if(J.has(U))J.get(U).push(W);else J.set(U,[W]);if(J.has(W))J.get(W).push(U);else J.set(W,[U])}});var X=function(te,Z){var U=[],W=[],j=new N,re=new Set,ee=0;return te.forEach(function(de,Ae){if(!re.has(Ae)){U[ee]=[],W[ee]=!1;var Ce=Ae;j.push(Ce),re.add(Ce),U[ee].push(Ce);while(j.length!=0){if(Ce=j.shift(),Z.has(Ce))W[ee]=!0;var Se=te.get(Ce);Se.forEach(function(ge){if(!re.has(ge))j.push(ge),re.add(ge),U[ee].push(ge)})}ee++}}),{components:U,isFixed:W}},_=X(G,w.fixedNodesOnHorizontal);this.componentsOnHorizontal=_.components,this.fixedComponentsOnHorizontal=_.isFixed;var Q=X(J,w.fixedNodesOnVertical);this.componentsOnVertical=Q.components,this.fixedComponentsOnVertical=Q.isFixed}}},R.prototype.updateDisplacements=function(){var w=this;if(this.constraints.fixedNodeConstraint)this.constraints.fixedNodeConstraint.forEach(function(Q){var q=w.idToNodeMap.get(Q.nodeId);q.displacementX=0,q.displacementY=0});if(this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical){var x=this.constraints.alignmentConstraint.vertical;for(var T=0;T<x.length;T++){var D=0;for(var C=0;C<x[T].length;C++){if(this.fixedNodeSet.has(x[T][C])){D=0;break}D+=this.idToNodeMap.get(x[T][C]).displacementX}var O=D/x[T].length;for(var C=0;C<x[T].length;C++)this.idToNodeMap.get(x[T][C]).displacementX=O}}if(this.constraints.alignmentConstraint.horizontal){var B=this.constraints.alignmentConstraint.horizontal;for(var T=0;T<B.length;T++){var z=0;for(var C=0;C<B[T].length;C++){if(this.fixedNodeSet.has(B[T][C])){z=0;break}z+=this.idToNodeMap.get(B[T][C]).displacementY}var V=z/B[T].length;for(var C=0;C<B[T].length;C++)this.idToNodeMap.get(B[T][C]).displacementY=V}}}if(this.constraints.relativePlacementConstraint)if(c.RELAX_MOVEMENT_ON_CONSTRAINTS){if(this.totalIterations%10==0)this.shuffle(this.nodesInRelativeHorizontal),this.shuffle(this.nodesInRelativeVertical);this.nodesInRelativeHorizontal.forEach(function(Q){if(!w.fixedNodesOnHorizontal.has(Q)){var q=0;if(w.dummyToNodeForVerticalAlignment.has(Q))q=w.idToNodeMap.get(w.dummyToNodeForVerticalAlignment.get(Q)[0]).displacementX;else q=w.idToNodeMap.get(Q).displacementX;if(w.nodeToRelativeConstraintMapHorizontal.get(Q).forEach(function(te){if(te.right){var Z=w.nodeToTempPositionMapHorizontal.get(te.right)-w.nodeToTempPositionMapHorizontal.get(Q)-q;if(Z<te.gap)q-=te.gap-Z}else{var Z=w.nodeToTempPositionMapHorizontal.get(Q)-w.nodeToTempPositionMapHorizontal.get(te.left)+q;if(Z<te.gap)q+=te.gap-Z}}),w.nodeToTempPositionMapHorizontal.set(Q,w.nodeToTempPositionMapHorizontal.get(Q)+q),w.dummyToNodeForVerticalAlignment.has(Q))w.dummyToNodeForVerticalAlignment.get(Q).forEach(function(te){w.idToNodeMap.get(te).displacementX=q});else w.idToNodeMap.get(Q).displacementX=q}}),this.nodesInRelativeVertical.forEach(function(Q){if(!w.fixedNodesOnHorizontal.has(Q)){var q=0;if(w.dummyToNodeForHorizontalAlignment.has(Q))q=w.idToNodeMap.get(w.dummyToNodeForHorizontalAlignment.get(Q)[0]).displacementY;else q=w.idToNodeMap.get(Q).displacementY;if(w.nodeToRelativeConstraintMapVertical.get(Q).forEach(function(te){if(te.bottom){var Z=w.nodeToTempPositionMapVertical.get(te.bottom)-w.nodeToTempPositionMapVertical.get(Q)-q;if(Z<te.gap)q-=te.gap-Z}else{var Z=w.nodeToTempPositionMapVertical.get(Q)-w.nodeToTempPositionMapVertical.get(te.top)+q;if(Z<te.gap)q+=te.gap-Z}}),w.nodeToTempPositionMapVertical.set(Q,w.nodeToTempPositionMapVertical.get(Q)+q),w.dummyToNodeForHorizontalAlignment.has(Q))w.dummyToNodeForHorizontalAlignment.get(Q).forEach(function(te){w.idToNodeMap.get(te).displacementY=q});else w.idToNodeMap.get(Q).displacementY=q}})}else{for(var T=0;T<this.componentsOnHorizontal.length;T++){var k=this.componentsOnHorizontal[T];if(this.fixedComponentsOnHorizontal[T])for(var C=0;C<k.length;C++)if(this.dummyToNodeForVerticalAlignment.has(k[C]))this.dummyToNodeForVerticalAlignment.get(k[C]).forEach(function(te){w.idToNodeMap.get(te).displacementX=0});else this.idToNodeMap.get(k[C]).displacementX=0;else{var G=0,J=0;for(var C=0;C<k.length;C++)if(this.dummyToNodeForVerticalAlignment.has(k[C])){var X=this.dummyToNodeForVerticalAlignment.get(k[C]);G+=X.length*this.idToNodeMap.get(X[0]).displacementX,J+=X.length}else G+=this.idToNodeMap.get(k[C]).displacementX,J++;var _=G/J;for(var C=0;C<k.length;C++)if(this.dummyToNodeForVerticalAlignment.has(k[C]))this.dummyToNodeForVerticalAlignment.get(k[C]).forEach(function(te){w.idToNodeMap.get(te).displacementX=_});else this.idToNodeMap.get(k[C]).displacementX=_}}for(var T=0;T<this.componentsOnVertical.length;T++){var k=this.componentsOnVertical[T];if(this.fixedComponentsOnVertical[T])for(var C=0;C<k.length;C++)if(this.dummyToNodeForHorizontalAlignment.has(k[C]))this.dummyToNodeForHorizontalAlignment.get(k[C]).forEach(function(Z){w.idToNodeMap.get(Z).displacementY=0});else this.idToNodeMap.get(k[C]).displacementY=0;else{var G=0,J=0;for(var C=0;C<k.length;C++)if(this.dummyToNodeForHorizontalAlignment.has(k[C])){var X=this.dummyToNodeForHorizontalAlignment.get(k[C]);G+=X.length*this.idToNodeMap.get(X[0]).displacementY,J+=X.length}else G+=this.idToNodeMap.get(k[C]).displacementY,J++;var _=G/J;for(var C=0;C<k.length;C++)if(this.dummyToNodeForHorizontalAlignment.has(k[C]))this.dummyToNodeForHorizontalAlignment.get(k[C]).forEach(function(j){w.idToNodeMap.get(j).displacementY=_});else this.idToNodeMap.get(k[C]).displacementY=_}}}},R.prototype.calculateNodesToApplyGravitationTo=function(){var w=[],x,T=this.graphManager.getGraphs(),D=T.length,C;for(C=0;C<D;C++)if(x=T[C],x.updateConnected(),!x.isConnected)w=w.concat(x.getNodes());return w},R.prototype.createBendpoints=function(){var w=[];w=w.concat(this.graphManager.getAllEdges());var x=new Set,T;for(T=0;T<w.length;T++){var D=w[T];if(!x.has(D)){var C=D.getSource(),O=D.getTarget();if(C==O)D.getBendpoints().push(new m),D.getBendpoints().push(new m),this.createDummyNodesForBendpoints(D),x.add(D);else{var B=[];if(B=B.concat(C.getEdgeListToNode(O)),B=B.concat(O.getEdgeListToNode(C)),!x.has(B[0])){if(B.length>1){var z;for(z=0;z<B.length;z++){var V=B[z];V.getBendpoints().push(new m),this.createDummyNodesForBendpoints(V)}}B.forEach(function(k){x.add(k)})}}}if(x.size==w.length)break}},R.prototype.positionNodesRadially=function(w){var x=new p(0,0),T=Math.ceil(Math.sqrt(w.length)),D=0,C=0,O=0,B=new m(0,0);for(var z=0;z<w.length;z++){if(z%T==0){if(O=0,C=D,z!=0)C+=c.DEFAULT_COMPONENT_SEPERATION;D=0}var V=w[z],k=E.findCenterOfTree(V);if(x.x=O,x.y=C,B=R.radialLayout(V,k,x),B.y>D)D=Math.floor(B.y);O=Math.floor(B.x+c.DEFAULT_COMPONENT_SEPERATION)}this.transform(new m(y.WORLD_CENTER_X-B.x/2,y.WORLD_CENTER_Y-B.y/2))},R.radialLayout=function(w,x,T){var D=Math.max(this.maxDiagonalInTree(w),c.DEFAULT_RADIAL_SEPARATION);R.branchRadialLayout(x,null,0,359,0,D);var C=S.calculateBounds(w),O=new P;O.setDeviceOrgX(C.getMinX()),O.setDeviceOrgY(C.getMinY()),O.setWorldOrgX(T.x),O.setWorldOrgY(T.y);for(var B=0;B<w.length;B++){var z=w[B];z.transform(O)}var V=new m(C.getMaxX(),C.getMaxY());return O.inverseTransformPoint(V)},R.branchRadialLayout=function(w,x,T,D,C,O){var B=(D-T+1)/2;if(B<0)B+=180;var z=(B+T)%360,V=z*M.TWO_PI/360,k=Math.cos(V),G=C*Math.cos(V),J=C*Math.sin(V);w.setCenter(G,J);var X=[];X=X.concat(w.getEdges());var _=X.length;if(x!=null)_--;var Q=0,q=X.length,te,Z=w.getEdgesBetween(x);while(Z.length>1){var U=Z[0];Z.splice(0,1);var W=X.indexOf(U);if(W>=0)X.splice(W,1);q--,_--}if(x!=null)te=(X.indexOf(Z[0])+1)%q;else te=0;var j=Math.abs(D-T)/_;for(var re=te;Q!=_;re=++re%q){var ee=X[re].getOtherEnd(w);if(ee==x)continue;var de=(T+Q*j)%360,Ae=(de+j)%360;R.branchRadialLayout(ee,w,de,Ae,C+O,O),Q++}},R.maxDiagonalInTree=function(w){var x=A.MIN_VALUE;for(var T=0;T<w.length;T++){var D=w[T],C=D.getDiagonal();if(C>x)x=C}return x},R.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},R.prototype.groupZeroDegreeMembers=function(){var w=this,x={};this.memberGroups={},this.idToDummyNode={};var T=[],D=this.graphManager.getAllNodes();for(var C=0;C<D.length;C++){var O=D[C],B=O.getParent();if(this.getNodeDegreeWithChildren(O)===0&&(B.id==null||!this.getToBeTiled(B)))T.push(O)}for(var C=0;C<T.length;C++){var O=T[C],z=O.getParent().id;if(typeof x[z]>"u")x[z]=[];x[z]=x[z].concat(O)}Object.keys(x).forEach(function(V){if(x[V].length>1){var k="DummyCompound_"+V;w.memberGroups[k]=x[V];var G=x[V][0].getParent(),J=new v(w.graphManager);J.id=k,J.paddingLeft=G.paddingLeft||0,J.paddingRight=G.paddingRight||0,J.paddingBottom=G.paddingBottom||0,J.paddingTop=G.paddingTop||0,w.idToDummyNode[k]=J;var X=w.getGraphManager().add(w.newGraph(),J),_=G.getChild();_.add(J);for(var Q=0;Q<x[V].length;Q++){var q=x[V][Q];_.remove(q),X.add(q)}}})},R.prototype.clearCompounds=function(){var w={},x={};this.performDFSOnCompounds();for(var T=0;T<this.compoundOrder.length;T++)x[this.compoundOrder[T].id]=this.compoundOrder[T],w[this.compoundOrder[T].id]=[].concat(this.compoundOrder[T].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[T].getChild()),this.compoundOrder[T].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(w,x)},R.prototype.clearZeroDegreeMembers=function(){var w=this,x=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(T){var D=w.idToDummyNode[T];if(x[T]=w.tileNodes(w.memberGroups[T],D.paddingLeft+D.paddingRight),D.rect.width=x[T].width,D.rect.height=x[T].height,D.setCenter(x[T].centerX,x[T].centerY),D.labelMarginLeft=0,D.labelMarginTop=0,c.NODE_DIMENSIONS_INCLUDE_LABELS){var C=D.rect.width,O=D.rect.height;if(D.labelWidth){if(D.labelPosHorizontal=="left")D.rect.x-=D.labelWidth,D.setWidth(C+D.labelWidth),D.labelMarginLeft=D.labelWidth;else if(D.labelPosHorizontal=="center"&&D.labelWidth>C)D.rect.x-=(D.labelWidth-C)/2,D.setWidth(D.labelWidth),D.labelMarginLeft=(D.labelWidth-C)/2;else if(D.labelPosHorizontal=="right")D.setWidth(C+D.labelWidth)}if(D.labelHeight){if(D.labelPosVertical=="top")D.rect.y-=D.labelHeight,D.setHeight(O+D.labelHeight),D.labelMarginTop=D.labelHeight;else if(D.labelPosVertical=="center"&&D.labelHeight>O)D.rect.y-=(D.labelHeight-O)/2,D.setHeight(D.labelHeight),D.labelMarginTop=(D.labelHeight-O)/2;else if(D.labelPosVertical=="bottom")D.setHeight(O+D.labelHeight)}}})},R.prototype.repopulateCompounds=function(){for(var w=this.compoundOrder.length-1;w>=0;w--){var x=this.compoundOrder[w],{id:T,paddingLeft:D,paddingTop:C,labelMarginLeft:O,labelMarginTop:B}=x;this.adjustLocations(this.tiledMemberPack[T],x.rect.x,x.rect.y,D,C,O,B)}},R.prototype.repopulateZeroDegreeMembers=function(){var w=this,x=this.tiledZeroDegreePack;Object.keys(x).forEach(function(T){var D=w.idToDummyNode[T],{paddingLeft:C,paddingTop:O,labelMarginLeft:B,labelMarginTop:z}=D;w.adjustLocations(x[T],D.rect.x,D.rect.y,C,O,B,z)})},R.prototype.getToBeTiled=function(w){var x=w.id;if(this.toBeTiled[x]!=null)return this.toBeTiled[x];var T=w.getChild();if(T==null)return this.toBeTiled[x]=!1,!1;var D=T.getNodes();for(var C=0;C<D.length;C++){var O=D[C];if(this.getNodeDegree(O)>0)return this.toBeTiled[x]=!1,!1;if(O.getChild()==null){this.toBeTiled[O.id]=!1;continue}if(!this.getToBeTiled(O))return this.toBeTiled[x]=!1,!1}return this.toBeTiled[x]=!0,!0},R.prototype.getNodeDegree=function(w){var x=w.id,T=w.getEdges(),D=0;for(var C=0;C<T.length;C++){var O=T[C];if(O.getSource().id!==O.getTarget().id)D=D+1}return D},R.prototype.getNodeDegreeWithChildren=function(w){var x=this.getNodeDegree(w);if(w.getChild()==null)return x;var T=w.getChild().getNodes();for(var D=0;D<T.length;D++){var C=T[D];x+=this.getNodeDegreeWithChildren(C)}return x},R.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},R.prototype.fillCompexOrderByDFS=function(w){for(var x=0;x<w.length;x++){var T=w[x];if(T.getChild()!=null)this.fillCompexOrderByDFS(T.getChild().getNodes());if(this.getToBeTiled(T))this.compoundOrder.push(T)}},R.prototype.adjustLocations=function(w,x,T,D,C,O,B){x+=D+O,T+=C+B;var z=x;for(var V=0;V<w.rows.length;V++){var k=w.rows[V];x=z;var G=0;for(var J=0;J<k.length;J++){var X=k[J];if(X.rect.x=x,X.rect.y=T,x+=X.rect.width+w.horizontalPadding,X.rect.height>G)G=X.rect.height}T+=G+w.verticalPadding}},R.prototype.tileCompoundMembers=function(w,x){var T=this;this.tiledMemberPack=[],Object.keys(w).forEach(function(D){var C=x[D];if(T.tiledMemberPack[D]=T.tileNodes(w[D],C.paddingLeft+C.paddingRight),C.rect.width=T.tiledMemberPack[D].width,C.rect.height=T.tiledMemberPack[D].height,C.setCenter(T.tiledMemberPack[D].centerX,T.tiledMemberPack[D].centerY),C.labelMarginLeft=0,C.labelMarginTop=0,c.NODE_DIMENSIONS_INCLUDE_LABELS){var O=C.rect.width,B=C.rect.height;if(C.labelWidth){if(C.labelPosHorizontal=="left")C.rect.x-=C.labelWidth,C.setWidth(O+C.labelWidth),C.labelMarginLeft=C.labelWidth;else if(C.labelPosHorizontal=="center"&&C.labelWidth>O)C.rect.x-=(C.labelWidth-O)/2,C.setWidth(C.labelWidth),C.labelMarginLeft=(C.labelWidth-O)/2;else if(C.labelPosHorizontal=="right")C.setWidth(O+C.labelWidth)}if(C.labelHeight){if(C.labelPosVertical=="top")C.rect.y-=C.labelHeight,C.setHeight(B+C.labelHeight),C.labelMarginTop=C.labelHeight;else if(C.labelPosVertical=="center"&&C.labelHeight>B)C.rect.y-=(C.labelHeight-B)/2,C.setHeight(C.labelHeight),C.labelMarginTop=(C.labelHeight-B)/2;else if(C.labelPosVertical=="bottom")C.setHeight(B+C.labelHeight)}}})},R.prototype.tileNodes=function(w,x){var T=this.tileNodesByFavoringDim(w,x,!0),D=this.tileNodesByFavoringDim(w,x,!1),C=this.getOrgRatio(T),O=this.getOrgRatio(D),B;if(O<C)B=D;else B=T;return B},R.prototype.getOrgRatio=function(w){var{width:x,height:T}=w,D=x/T;if(D<1)D=1/D;return D},R.prototype.calcIdealRowWidth=function(w,x){var{TILING_PADDING_VERTICAL:T,TILING_PADDING_HORIZONTAL:D}=c,C=w.length,O=0,B=0,z=0;w.forEach(function(Q){if(O+=Q.getWidth(),B+=Q.getHeight(),Q.getWidth()>z)z=Q.getWidth()});var V=O/C,k=B/C,G=Math.pow(T-D,2)+4*(V+D)*(k+T)*C,J=(D-T+Math.sqrt(G))/(2*(V+D)),X;if(x){if(X=Math.ceil(J),X==J)X++}else X=Math.floor(J);var _=X*(V+D)-D;if(z>_)_=z;return _+=D*2,_},R.prototype.tileNodesByFavoringDim=function(w,x,T){var{TILING_PADDING_VERTICAL:D,TILING_PADDING_HORIZONTAL:C,TILING_COMPARE_BY:O}=c,B={rows:[],rowWidth:[],rowHeight:[],width:0,height:x,verticalPadding:D,horizontalPadding:C,centerX:0,centerY:0};if(O)B.idealRowWidth=this.calcIdealRowWidth(w,T);var z=function(q){return q.rect.width*q.rect.height},V=function(q,te){return z(te)-z(q)};w.sort(function(Q,q){var te=V;if(B.idealRowWidth)return te=O,te(Q.id,q.id);return te(Q,q)});var k=0,G=0;for(var J=0;J<w.length;J++){var X=w[J];k+=X.getCenterX(),G+=X.getCenterY()}B.centerX=k/w.length,B.centerY=G/w.length;for(var J=0;J<w.length;J++){var X=w[J];if(B.rows.length==0)this.insertNodeToRow(B,X,0,x);else if(this.canAddHorizontal(B,X.rect.width,X.rect.height)){var _=B.rows.length-1;if(!B.idealRowWidth)_=this.getShortestRowIndex(B);this.insertNodeToRow(B,X,_,x)}else this.insertNodeToRow(B,X,B.rows.length,x);this.shiftToLastRow(B)}return B},R.prototype.insertNodeToRow=function(w,x,T,D){var C=D;if(T==w.rows.length){var O=[];w.rows.push(O),w.rowWidth.push(C),w.rowHeight.push(0)}var B=w.rowWidth[T]+x.rect.width;if(w.rows[T].length>0)B+=w.horizontalPadding;if(w.rowWidth[T]=B,w.width<B)w.width=B;var z=x.rect.height;if(T>0)z+=w.verticalPadding;var V=0;if(z>w.rowHeight[T])V=w.rowHeight[T],w.rowHeight[T]=z,V=w.rowHeight[T]-V;w.height+=V,w.rows[T].push(x)},R.prototype.getShortestRowIndex=function(w){var x=-1,T=Number.MAX_VALUE;for(var D=0;D<w.rows.length;D++)if(w.rowWidth[D]<T)x=D,T=w.rowWidth[D];return x},R.prototype.getLongestRowIndex=function(w){var x=-1,T=Number.MIN_VALUE;for(var D=0;D<w.rows.length;D++)if(w.rowWidth[D]>T)x=D,T=w.rowWidth[D];return x},R.prototype.canAddHorizontal=function(w,x,T){if(w.idealRowWidth){var D=w.rows.length-1,C=w.rowWidth[D];return C+x+w.horizontalPadding<=w.idealRowWidth}var O=this.getShortestRowIndex(w);if(O<0)return!0;var B=w.rowWidth[O];if(B+w.horizontalPadding+x<=w.width)return!0;var z=0;if(w.rowHeight[O]<T){if(O>0)z=T+w.verticalPadding-w.rowHeight[O]}var V;if(w.width-B>=x+w.horizontalPadding)V=(w.height+z)/(B+x+w.horizontalPadding);else V=(w.height+z)/w.width;z=T+w.verticalPadding;var k;if(w.width<x)k=(w.height+z)/x;else k=(w.height+z)/w.width;if(k<1)k=1/k;if(V<1)V=1/V;return V<k},R.prototype.shiftToLastRow=function(w){var x=this.getLongestRowIndex(w),T=w.rowWidth.length-1,D=w.rows[x],C=D[D.length-1],O=C.width+w.horizontalPadding;if(w.width-w.rowWidth[T]>O&&x!=T){D.splice(-1,1),w.rows[T].push(C),w.rowWidth[x]=w.rowWidth[x]-O,w.rowWidth[T]=w.rowWidth[T]+O,w.width=w.rowWidth[instance.getLongestRowIndex(w)];var B=Number.MIN_VALUE;for(var z=0;z<D.length;z++)if(D[z].height>B)B=D[z].height;if(x>0)B+=w.verticalPadding;var V=w.rowHeight[x]+w.rowHeight[T];if(w.rowHeight[x]=B,w.rowHeight[T]<C.height+w.verticalPadding)w.rowHeight[T]=C.height+w.verticalPadding;var k=w.rowHeight[x]+w.rowHeight[T];w.height+=k-V,this.shiftToLastRow(w)}},R.prototype.tilingPreLayout=function(){if(c.TILE)this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers()},R.prototype.tilingPostLayout=function(){if(c.TILE)this.repopulateZeroDegreeMembers(),this.repopulateCompounds()},R.prototype.reduceTrees=function(){var w=[],x=!0,T;while(x){var D=this.graphManager.getAllNodes(),C=[];x=!1;for(var O=0;O<D.length;O++)if(T=D[O],T.getEdges().length==1&&!T.getEdges()[0].isInterGraph&&T.getChild()==null){if(c.PURE_INCREMENTAL){var B=T.getEdges()[0].getOtherEnd(T),z=new b(T.getCenterX()-B.getCenterX(),T.getCenterY()-B.getCenterY());C.push([T,T.getEdges()[0],T.getOwner(),z])}else C.push([T,T.getEdges()[0],T.getOwner()]);x=!0}if(x==!0){var V=[];for(var k=0;k<C.length;k++)if(C[k][0].getEdges().length==1)V.push(C[k]),C[k][0].getOwner().remove(C[k][0]);w.push(V),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=w},R.prototype.growTree=function(w){var x=w.length,T=w[x-1],D;for(var C=0;C<T.length;C++)D=T[C],this.findPlaceforPrunedNode(D),D[2].add(D[0]),D[2].add(D[1],D[1].source,D[1].target);w.splice(w.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},R.prototype.findPlaceforPrunedNode=function(w){var x,T,D=w[0];if(D==w[1].source)T=w[1].target;else T=w[1].source;if(c.PURE_INCREMENTAL)D.setCenter(T.getCenterX()+w[3].getWidth(),T.getCenterY()+w[3].getHeight());else{var C=T.startX,O=T.finishX,B=T.startY,z=T.finishY,V=0,k=0,G=0,J=0,X=[V,G,k,J];if(B>0)for(var _=C;_<=O;_++)X[0]+=this.grid[_][B-1].length+this.grid[_][B].length-1;if(O<this.grid.length-1)for(var _=B;_<=z;_++)X[1]+=this.grid[O+1][_].length+this.grid[O][_].length-1;if(z<this.grid[0].length-1)for(var _=C;_<=O;_++)X[2]+=this.grid[_][z+1].length+this.grid[_][z].length-1;if(C>0)for(var _=B;_<=z;_++)X[3]+=this.grid[C-1][_].length+this.grid[C][_].length-1;var Q=A.MAX_VALUE,q,te;for(var Z=0;Z<X.length;Z++)if(X[Z]<Q)Q=X[Z],q=1,te=Z;else if(X[Z]==Q)q++;if(q==3&&Q==0){if(X[0]==0&&X[1]==0&&X[2]==0)x=1;else if(X[0]==0&&X[1]==0&&X[3]==0)x=0;else if(X[0]==0&&X[2]==0&&X[3]==0)x=3;else if(X[1]==0&&X[2]==0&&X[3]==0)x=2}else if(q==2&&Q==0){var U=Math.floor(Math.random()*2);if(X[0]==0&&X[1]==0)if(U==0)x=0;else x=1;else if(X[0]==0&&X[2]==0)if(U==0)x=0;else x=2;else if(X[0]==0&&X[3]==0)if(U==0)x=0;else x=3;else if(X[1]==0&&X[2]==0)if(U==0)x=1;else x=2;else if(X[1]==0&&X[3]==0)if(U==0)x=1;else x=3;else if(U==0)x=2;else x=3}else if(q==4&&Q==0){var U=Math.floor(Math.random()*4);x=U}else x=te;if(x==0)D.setCenter(T.getCenterX(),T.getCenterY()-T.getHeight()/2-g.DEFAULT_EDGE_LENGTH-D.getHeight()/2);else if(x==1)D.setCenter(T.getCenterX()+T.getWidth()/2+g.DEFAULT_EDGE_LENGTH+D.getWidth()/2,T.getCenterY());else if(x==2)D.setCenter(T.getCenterX(),T.getCenterY()+T.getHeight()/2+g.DEFAULT_EDGE_LENGTH+D.getHeight()/2);else D.setCenter(T.getCenterX()-T.getWidth()/2-g.DEFAULT_EDGE_LENGTH-D.getWidth()/2,T.getCenterY())}},i.exports=R},991:(i,s,o)=>{var l=o(551).FDLayoutNode,u=o(551).IMath;function f(h,c,d,g){l.call(this,h,c,d,g)}f.prototype=Object.create(l.prototype);for(var v in l)f[v]=l[v];f.prototype.calculateDisplacement=function(){var h=this.graphManager.getLayout();if(this.getChild()!=null&&this.fixedNodeWeight)this.displacementX+=h.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=h.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight;else this.displacementX+=h.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=h.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren;if(Math.abs(this.displacementX)>h.coolingFactor*h.maxNodeDisplacement)this.displacementX=h.coolingFactor*h.maxNodeDisplacement*u.sign(this.displacementX);if(Math.abs(this.displacementY)>h.coolingFactor*h.maxNodeDisplacement)this.displacementY=h.coolingFactor*h.maxNodeDisplacement*u.sign(this.displacementY);if(this.child&&this.child.getNodes().length>0)this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},f.prototype.propogateDisplacementToChildren=function(h,c){var d=this.getChild().getNodes(),g;for(var y=0;y<d.length;y++)if(g=d[y],g.getChild()==null)g.displacementX+=h,g.displacementY+=c;else g.propogateDisplacementToChildren(h,c)},f.prototype.move=function(){var h=this.graphManager.getLayout();if(this.child==null||this.child.getNodes().length==0)this.moveBy(this.displacementX,this.displacementY),h.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},f.prototype.setPred1=function(h){this.pred1=h},f.prototype.getPred1=function(){return pred1},f.prototype.getPred2=function(){return pred2},f.prototype.setNext=function(h){this.next=h},f.prototype.getNext=function(){return next},f.prototype.setProcessed=function(h){this.processed=h},f.prototype.isProcessed=function(){return processed},i.exports=f},902:(i,s,o)=>{function l(d){if(Array.isArray(d)){for(var g=0,y=Array(d.length);g<d.length;g++)y[g]=d[g];return y}else return Array.from(d)}var u=o(806),f=o(551).LinkedList,v=o(551).Matrix,h=o(551).SVD;function c(){}c.handleConstraints=function(d){var g={};g.fixedNodeConstraint=d.constraints.fixedNodeConstraint,g.alignmentConstraint=d.constraints.alignmentConstraint,g.relativePlacementConstraint=d.constraints.relativePlacementConstraint;var y=new Map,p=new Map,m=[],b=[],E=d.getAllNodes(),A=0;for(var M=0;M<E.length;M++){var S=E[M];if(S.getChild()==null)p.set(S.id,A++),m.push(S.getCenterX()),b.push(S.getCenterY()),y.set(S.id,S)}if(g.relativePlacementConstraint)g.relativePlacementConstraint.forEach(function(L){if(!L.gap&&L.gap!=0)if(L.left)L.gap=u.DEFAULT_EDGE_LENGTH+y.get(L.left).getWidth()/2+y.get(L.right).getWidth()/2;else L.gap=u.DEFAULT_EDGE_LENGTH+y.get(L.top).getHeight()/2+y.get(L.bottom).getHeight()/2});var P=function(F,Y){return{x:F.x-Y.x,y:F.y-Y.y}},N=function(F){var Y=0,H=0;return F.forEach(function(K){Y+=m[p.get(K)],H+=b[p.get(K)]}),{x:Y/F.size,y:H/F.size}},R=function(F,Y,H,K,se){function ae(ce,pe){var Ie=new Set(ce),xe=!0,me=!1,Ve=void 0;try{for(var Be=pe[Symbol.iterator](),Ke;!(xe=(Ke=Be.next()).done);xe=!0){var He=Ke.value;Ie.add(He)}}catch(Le){me=!0,Ve=Le}finally{try{if(!xe&&Be.return)Be.return()}finally{if(me)throw Ve}}return Ie}var oe=new Map;F.forEach(function(ce,pe){oe.set(pe,0)}),F.forEach(function(ce,pe){ce.forEach(function(Ie){oe.set(Ie.id,oe.get(Ie.id)+1)})});var ne=new Map,ue=new Map,be=new f;if(oe.forEach(function(ce,pe){if(ce==0){if(be.push(pe),!H)if(Y=="horizontal")ne.set(pe,p.has(pe)?m[p.get(pe)]:K.get(pe));else ne.set(pe,p.has(pe)?b[p.get(pe)]:K.get(pe))}else ne.set(pe,Number.NEGATIVE_INFINITY);if(H)ue.set(pe,new Set([pe]))}),H)se.forEach(function(ce){var pe=[];if(ce.forEach(function(me){if(H.has(me))pe.push(me)}),pe.length>0){var Ie=0;pe.forEach(function(me){if(Y=="horizontal")ne.set(me,p.has(me)?m[p.get(me)]:K.get(me)),Ie+=ne.get(me);else ne.set(me,p.has(me)?b[p.get(me)]:K.get(me)),Ie+=ne.get(me)}),Ie=Ie/pe.length,ce.forEach(function(me){if(!H.has(me))ne.set(me,Ie)})}else{var xe=0;ce.forEach(function(me){if(Y=="horizontal")xe+=p.has(me)?m[p.get(me)]:K.get(me);else xe+=p.has(me)?b[p.get(me)]:K.get(me)}),xe=xe/ce.length,ce.forEach(function(me){ne.set(me,xe)})}});var fe=function(){var pe=be.shift(),Ie=F.get(pe);Ie.forEach(function(xe){if(ne.get(xe.id)<ne.get(pe)+xe.gap)if(H&&H.has(xe.id)){var me=void 0;if(Y=="horizontal")me=p.has(xe.id)?m[p.get(xe.id)]:K.get(xe.id);else me=p.has(xe.id)?b[p.get(xe.id)]:K.get(xe.id);if(ne.set(xe.id,me),me<ne.get(pe)+xe.gap){var Ve=ne.get(pe)+xe.gap-me;ue.get(pe).forEach(function(Be){ne.set(Be,ne.get(Be)-Ve)})}}else ne.set(xe.id,ne.get(pe)+xe.gap);if(oe.set(xe.id,oe.get(xe.id)-1),oe.get(xe.id)==0)be.push(xe.id);if(H)ue.set(xe.id,ae(ue.get(pe),ue.get(xe.id)))})};while(be.length!=0)fe();if(H){var le=new Set;F.forEach(function(ce,pe){if(ce.length==0)le.add(pe)});var De=[];ue.forEach(function(ce,pe){if(le.has(pe)){var Ie=!1,xe=!0,me=!1,Ve=void 0;try{for(var Be=ce[Symbol.iterator](),Ke;!(xe=(Ke=Be.next()).done);xe=!0){var He=Ke.value;if(H.has(He))Ie=!0}}catch(Ye){me=!0,Ve=Ye}finally{try{if(!xe&&Be.return)Be.return()}finally{if(me)throw Ve}}if(!Ie){var Le=!1,nt=void 0;if(De.forEach(function(Ye,tt){if(Ye.has([].concat(l(ce))[0]))Le=!0,nt=tt}),!Le)De.push(new Set(ce));else ce.forEach(function(Ye){De[nt].add(Ye)})}}}),De.forEach(function(ce,pe){var{POSITIVE_INFINITY:Ie,POSITIVE_INFINITY:xe,NEGATIVE_INFINITY:me,NEGATIVE_INFINITY:Ve}=Number,Be=!0,Ke=!1,He=void 0;try{for(var Le=ce[Symbol.iterator](),nt;!(Be=(nt=Le.next()).done);Be=!0){var Ye=nt.value,tt=void 0;if(Y=="horizontal")tt=p.has(Ye)?m[p.get(Ye)]:K.get(Ye);else tt=p.has(Ye)?b[p.get(Ye)]:K.get(Ye);var ct=ne.get(Ye);if(tt<Ie)Ie=tt;if(tt>me)me=tt;if(ct<xe)xe=ct;if(ct>Ve)Ve=ct}}catch(lr){Ke=!0,He=lr}finally{try{if(!Be&&Le.return)Le.return()}finally{if(Ke)throw He}}var qt=(Ie+me)/2-(xe+Ve)/2,ot=!0,rt=!1,lt=void 0;try{for(var Ft=ce[Symbol.iterator](),xt;!(ot=(xt=Ft.next()).done);ot=!0){var rr=xt.value;ne.set(rr,ne.get(rr)+qt)}}catch(lr){rt=!0,lt=lr}finally{try{if(!ot&&Ft.return)Ft.return()}finally{if(rt)throw lt}}})}return ne},I=function(F){var Y=0,H=0,K=0,se=0;if(F.forEach(function(ue){if(ue.left)m[p.get(ue.left)]-m[p.get(ue.right)]>=0?Y++:H++;else b[p.get(ue.top)]-b[p.get(ue.bottom)]>=0?K++:se++}),Y>H&&K>se)for(var ae=0;ae<p.size;ae++)m[ae]=-1*m[ae],b[ae]=-1*b[ae];else if(Y>H)for(var oe=0;oe<p.size;oe++)m[oe]=-1*m[oe];else if(K>se)for(var ne=0;ne<p.size;ne++)b[ne]=-1*b[ne]},w=function(F){var Y=[],H=new f,K=new Set,se=0;return F.forEach(function(ae,oe){if(!K.has(oe)){Y[se]=[];var ne=oe;H.push(ne),K.add(ne),Y[se].push(ne);while(H.length!=0){ne=H.shift();var ue=F.get(ne);ue.forEach(function(be){if(!K.has(be.id))H.push(be.id),K.add(be.id),Y[se].push(be.id)})}se++}}),Y},x=function(F){var Y=new Map;return F.forEach(function(H,K){Y.set(K,[])}),F.forEach(function(H,K){H.forEach(function(se){Y.get(K).push(se),Y.get(se.id).push({id:K,gap:se.gap,direction:se.direction})})}),Y},T=function(F){var Y=new Map;return F.forEach(function(H,K){Y.set(K,[])}),F.forEach(function(H,K){H.forEach(function(se){Y.get(se.id).push({id:K,gap:se.gap,direction:se.direction})})}),Y},D=[],C=[],O=!1,B=!1,z=new Set,V=new Map,k=new Map,G=[];if(g.fixedNodeConstraint)g.fixedNodeConstraint.forEach(function(L){z.add(L.nodeId)});if(g.relativePlacementConstraint)g.relativePlacementConstraint.forEach(function(L){if(L.left){if(V.has(L.left))V.get(L.left).push({id:L.right,gap:L.gap,direction:"horizontal"});else V.set(L.left,[{id:L.right,gap:L.gap,direction:"horizontal"}]);if(!V.has(L.right))V.set(L.right,[])}else{if(V.has(L.top))V.get(L.top).push({id:L.bottom,gap:L.gap,direction:"vertical"});else V.set(L.top,[{id:L.bottom,gap:L.gap,direction:"vertical"}]);if(!V.has(L.bottom))V.set(L.bottom,[])}}),k=x(V),G=w(k);if(u.TRANSFORM_ON_CONSTRAINT_HANDLING){if(g.fixedNodeConstraint&&g.fixedNodeConstraint.length>1)g.fixedNodeConstraint.forEach(function(L,F){D[F]=[L.position.x,L.position.y],C[F]=[m[p.get(L.nodeId)],b[p.get(L.nodeId)]]}),O=!0;else if(g.alignmentConstraint)(function(){var L=0;if(g.alignmentConstraint.vertical){var F=g.alignmentConstraint.vertical,Y=function(ne){var ue=new Set;F[ne].forEach(function(le){ue.add(le)});var be=new Set([].concat(l(ue)).filter(function(le){return z.has(le)})),fe=void 0;if(be.size>0)fe=m[p.get(be.values().next().value)];else fe=N(ue).x;F[ne].forEach(function(le){D[L]=[fe,b[p.get(le)]],C[L]=[m[p.get(le)],b[p.get(le)]],L++})};for(var H=0;H<F.length;H++)Y(H);O=!0}if(g.alignmentConstraint.horizontal){var K=g.alignmentConstraint.horizontal,se=function(ne){var ue=new Set;K[ne].forEach(function(le){ue.add(le)});var be=new Set([].concat(l(ue)).filter(function(le){return z.has(le)})),fe=void 0;if(be.size>0)fe=m[p.get(be.values().next().value)];else fe=N(ue).y;K[ne].forEach(function(le){D[L]=[m[p.get(le)],fe],C[L]=[m[p.get(le)],b[p.get(le)]],L++})};for(var ae=0;ae<K.length;ae++)se(ae);O=!0}if(g.relativePlacementConstraint)B=!0})();else if(g.relativePlacementConstraint){var J=0,X=0;for(var _=0;_<G.length;_++)if(G[_].length>J)J=G[_].length,X=_;if(J<k.size/2)I(g.relativePlacementConstraint),O=!1,B=!1;else{var Q=new Map,q=new Map,te=[];G[X].forEach(function(L){V.get(L).forEach(function(F){if(F.direction=="horizontal"){if(Q.has(L))Q.get(L).push(F);else Q.set(L,[F]);if(!Q.has(F.id))Q.set(F.id,[]);te.push({left:L,right:F.id})}else{if(q.has(L))q.get(L).push(F);else q.set(L,[F]);if(!q.has(F.id))q.set(F.id,[]);te.push({top:L,bottom:F.id})}})}),I(te),B=!1;var Z=R(Q,"horizontal"),U=R(q,"vertical");G[X].forEach(function(L,F){if(C[F]=[m[p.get(L)],b[p.get(L)]],D[F]=[],Z.has(L))D[F][0]=Z.get(L);else D[F][0]=m[p.get(L)];if(U.has(L))D[F][1]=U.get(L);else D[F][1]=b[p.get(L)]}),O=!0}}if(O){var W=void 0,j=v.transpose(D),re=v.transpose(C);for(var ee=0;ee<j.length;ee++)j[ee]=v.multGamma(j[ee]),re[ee]=v.multGamma(re[ee]);var de=v.multMat(j,v.transpose(re)),Ae=h.svd(de);W=v.multMat(Ae.V,v.transpose(Ae.U));for(var Ce=0;Ce<p.size;Ce++){var Se=[m[Ce],b[Ce]],ge=[W[0][0],W[1][0]],ve=[W[0][1],W[1][1]];m[Ce]=v.dotProduct(Se,ge),b[Ce]=v.dotProduct(Se,ve)}if(B)I(g.relativePlacementConstraint)}}if(u.ENFORCE_CONSTRAINTS){if(g.fixedNodeConstraint&&g.fixedNodeConstraint.length>0){var ye={x:0,y:0};g.fixedNodeConstraint.forEach(function(L,F){var Y={x:m[p.get(L.nodeId)],y:b[p.get(L.nodeId)]},H=L.position,K=P(H,Y);ye.x+=K.x,ye.y+=K.y}),ye.x/=g.fixedNodeConstraint.length,ye.y/=g.fixedNodeConstraint.length,m.forEach(function(L,F){m[F]+=ye.x}),b.forEach(function(L,F){b[F]+=ye.y}),g.fixedNodeConstraint.forEach(function(L){m[p.get(L.nodeId)]=L.position.x,b[p.get(L.nodeId)]=L.position.y})}if(g.alignmentConstraint){if(g.alignmentConstraint.vertical){var Ee=g.alignmentConstraint.vertical,Pe=function(F){var Y=new Set;Ee[F].forEach(function(se){Y.add(se)});var H=new Set([].concat(l(Y)).filter(function(se){return z.has(se)})),K=void 0;if(H.size>0)K=m[p.get(H.values().next().value)];else K=N(Y).x;Y.forEach(function(se){if(!z.has(se))m[p.get(se)]=K})};for(var Me=0;Me<Ee.length;Me++)Pe(Me)}if(g.alignmentConstraint.horizontal){var Ne=g.alignmentConstraint.horizontal,Fe=function(F){var Y=new Set;Ne[F].forEach(function(se){Y.add(se)});var H=new Set([].concat(l(Y)).filter(function(se){return z.has(se)})),K=void 0;if(H.size>0)K=b[p.get(H.values().next().value)];else K=N(Y).y;Y.forEach(function(se){if(!z.has(se))b[p.get(se)]=K})};for(var ze=0;ze<Ne.length;ze++)Fe(ze)}}if(g.relativePlacementConstraint)(function(){var L=new Map,F=new Map,Y=new Map,H=new Map,K=new Map,se=new Map,ae=new Set,oe=new Set;if(z.forEach(function(ft){ae.add(ft),oe.add(ft)}),g.alignmentConstraint){if(g.alignmentConstraint.vertical){var ne=g.alignmentConstraint.vertical,ue=function(ke){Y.set("dummy"+ke,[]),ne[ke].forEach(function(Ge){if(L.set(Ge,"dummy"+ke),Y.get("dummy"+ke).push(Ge),z.has(Ge))ae.add("dummy"+ke)}),K.set("dummy"+ke,m[p.get(ne[ke][0])])};for(var be=0;be<ne.length;be++)ue(be)}if(g.alignmentConstraint.horizontal){var fe=g.alignmentConstraint.horizontal,le=function(ke){H.set("dummy"+ke,[]),fe[ke].forEach(function(Ge){if(F.set(Ge,"dummy"+ke),H.get("dummy"+ke).push(Ge),z.has(Ge))oe.add("dummy"+ke)}),se.set("dummy"+ke,b[p.get(fe[ke][0])])};for(var De=0;De<fe.length;De++)le(De)}}var ce=new Map,pe=new Map,Ie=function(ke){V.get(ke).forEach(function(Ge){var Vt=void 0,Rt=void 0;if(Ge.direction=="horizontal"){if(Vt=L.get(ke)?L.get(ke):ke,L.get(Ge.id))Rt={id:L.get(Ge.id),gap:Ge.gap,direction:Ge.direction};else Rt=Ge;if(ce.has(Vt))ce.get(Vt).push(Rt);else ce.set(Vt,[Rt]);if(!ce.has(Rt.id))ce.set(Rt.id,[])}else{if(Vt=F.get(ke)?F.get(ke):ke,F.get(Ge.id))Rt={id:F.get(Ge.id),gap:Ge.gap,direction:Ge.direction};else Rt=Ge;if(pe.has(Vt))pe.get(Vt).push(Rt);else pe.set(Vt,[Rt]);if(!pe.has(Rt.id))pe.set(Rt.id,[])}})},xe=!0,me=!1,Ve=void 0;try{for(var Be=V.keys()[Symbol.iterator](),Ke;!(xe=(Ke=Be.next()).done);xe=!0){var He=Ke.value;Ie(He)}}catch(ft){me=!0,Ve=ft}finally{try{if(!xe&&Be.return)Be.return()}finally{if(me)throw Ve}}var Le=x(ce),nt=x(pe),Ye=w(Le),tt=w(nt),ct=T(ce),qt=T(pe),ot=[],rt=[];Ye.forEach(function(ft,ke){ot[ke]=[],ft.forEach(function(Ge){if(ct.get(Ge).length==0)ot[ke].push(Ge)})}),tt.forEach(function(ft,ke){rt[ke]=[],ft.forEach(function(Ge){if(qt.get(Ge).length==0)rt[ke].push(Ge)})});var lt=R(ce,"horizontal",ae,K,ot),Ft=R(pe,"vertical",oe,se,rt),xt=function(ke){if(Y.get(ke))Y.get(ke).forEach(function(Ge){m[p.get(Ge)]=lt.get(ke)});else m[p.get(ke)]=lt.get(ke)},rr=!0,lr=!1,ln=void 0;try{for(var wa=lt.keys()[Symbol.iterator](),fn;!(rr=(fn=wa.next()).done);rr=!0){var Ea=fn.value;xt(Ea)}}catch(ft){lr=!0,ln=ft}finally{try{if(!rr&&wa.return)wa.return()}finally{if(lr)throw ln}}var ci=function(ke){if(H.get(ke))H.get(ke).forEach(function(Ge){b[p.get(Ge)]=Ft.get(ke)});else b[p.get(ke)]=Ft.get(ke)},xa=!0,fr=!1,$r=void 0;try{for(var hr=Ft.keys()[Symbol.iterator](),Ta;!(xa=(Ta=hr.next()).done);xa=!0){var Ea=Ta.value;ci(Ea)}}catch(ft){fr=!0,$r=ft}finally{try{if(!xa&&hr.return)hr.return()}finally{if(fr)throw $r}}})()}for(var Ue=0;Ue<E.length;Ue++){var ie=E[Ue];if(ie.getChild()==null)ie.setCenter(m[p.get(ie.id)],b[p.get(ie.id)])}},i.exports=c},551:(i)=>{i.exports=t}},r={};function a(i){var s=r[i];if(s!==void 0)return s.exports;var o=r[i]={exports:{}};return e[i](o,o.exports,a),o.exports}var n=a(45);return n})()})});function Ys(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,a=Array(e);r<e;r++)a[r]=t[r];return a}function fh(t){if(Array.isArray(t))return t}function vh(t){if(Array.isArray(t))return Ys(t)}function Mr(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}function hh(t,e){for(var r=0;r<e.length;r++){var a=e[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,gf(a.key),a)}}function Lr(t,e,r){return e&&hh(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function kt(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=fo(t))||e){r&&(t=r);var a=0,n=function(){};return{s:n,n:function(){return a>=t.length?{done:!0}:{done:!1,value:t[a++]}},e:function(l){throw l},f:n}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
1
+ import{Te}from"./chunk-kahab58k.js";var Fo=Te(function(on,ko){(function(e,r){if(typeof on==="object"&&typeof ko==="object")ko.exports=r();else if(typeof define==="function"&&define.amd)define([],r);else if(typeof on==="object")on.layoutBase=r();else e.layoutBase=r()})(on,function(){return function(t){var e={};function r(a){if(e[a])return e[a].exports;var n=e[a]={i:a,l:!1,exports:{}};return t[a].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=t,r.c=e,r.i=function(a){return a},r.d=function(a,n,i){if(!r.o(a,n))Object.defineProperty(a,n,{configurable:!1,enumerable:!0,get:i})},r.n=function(a){var n=a&&a.__esModule?function(){return a.default}:function(){return a};return r.d(n,"a",n),n},r.o=function(a,n){return Object.prototype.hasOwnProperty.call(a,n)},r.p="",r(r.s=28)}([function(t,e,r){function a(){}a.QUALITY=1,a.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,a.DEFAULT_INCREMENTAL=!1,a.DEFAULT_ANIMATION_ON_LAYOUT=!0,a.DEFAULT_ANIMATION_DURING_LAYOUT=!1,a.DEFAULT_ANIMATION_PERIOD=50,a.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,a.DEFAULT_GRAPH_MARGIN=15,a.NODE_DIMENSIONS_INCLUDE_LABELS=!1,a.SIMPLE_NODE_SIZE=40,a.SIMPLE_NODE_HALF_SIZE=a.SIMPLE_NODE_SIZE/2,a.EMPTY_COMPOUND_NODE_SIZE=40,a.MIN_EDGE_LENGTH=1,a.WORLD_BOUNDARY=1e6,a.INITIAL_WORLD_BOUNDARY=a.WORLD_BOUNDARY/1000,a.WORLD_CENTER_X=1200,a.WORLD_CENTER_Y=900,t.exports=a},function(t,e,r){var a=r(2),n=r(8),i=r(9);function s(l,u,f){a.call(this,f),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=f,this.bendpoints=[],this.source=l,this.target=u}s.prototype=Object.create(a.prototype);for(var o in a)s[o]=a[o];s.prototype.getSource=function(){return this.source},s.prototype.getTarget=function(){return this.target},s.prototype.isInterGraph=function(){return this.isInterGraph},s.prototype.getLength=function(){return this.length},s.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},s.prototype.getBendpoints=function(){return this.bendpoints},s.prototype.getLca=function(){return this.lca},s.prototype.getSourceInLca=function(){return this.sourceInLca},s.prototype.getTargetInLca=function(){return this.targetInLca},s.prototype.getOtherEnd=function(l){if(this.source===l)return this.target;else if(this.target===l)return this.source;else throw"Node is not incident with this edge"},s.prototype.getOtherEndInGraph=function(l,u){var f=this.getOtherEnd(l),v=u.getGraphManager().getRoot();while(!0){if(f.getOwner()==u)return f;if(f.getOwner()==v)break;f=f.getOwner().getParent()}return null},s.prototype.updateLength=function(){var l=[,,,,];if(this.isOverlapingSourceAndTarget=n.getIntersection(this.target.getRect(),this.source.getRect(),l),!this.isOverlapingSourceAndTarget){if(this.lengthX=l[0]-l[2],this.lengthY=l[1]-l[3],Math.abs(this.lengthX)<1)this.lengthX=i.sign(this.lengthX);if(Math.abs(this.lengthY)<1)this.lengthY=i.sign(this.lengthY);this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)}},s.prototype.updateLengthSimple=function(){if(this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1)this.lengthX=i.sign(this.lengthX);if(Math.abs(this.lengthY)<1)this.lengthY=i.sign(this.lengthY);this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},t.exports=s},function(t,e,r){function a(n){this.vGraphObject=n}t.exports=a},function(t,e,r){var a=r(2),n=r(10),i=r(13),s=r(0),o=r(16),l=r(5);function u(v,h,c,d){if(c==null&&d==null)d=h;if(a.call(this,d),v.graphManager!=null)v=v.graphManager;if(this.estimatedSize=n.MIN_VALUE,this.inclusionTreeDepth=n.MAX_VALUE,this.vGraphObject=d,this.edges=[],this.graphManager=v,c!=null&&h!=null)this.rect=new i(h.x,h.y,c.width,c.height);else this.rect=new i}u.prototype=Object.create(a.prototype);for(var f in a)u[f]=a[f];u.prototype.getEdges=function(){return this.edges},u.prototype.getChild=function(){return this.child},u.prototype.getOwner=function(){return this.owner},u.prototype.getWidth=function(){return this.rect.width},u.prototype.setWidth=function(v){this.rect.width=v},u.prototype.getHeight=function(){return this.rect.height},u.prototype.setHeight=function(v){this.rect.height=v},u.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},u.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},u.prototype.getCenter=function(){return new l(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},u.prototype.getLocation=function(){return new l(this.rect.x,this.rect.y)},u.prototype.getRect=function(){return this.rect},u.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},u.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},u.prototype.setRect=function(v,h){this.rect.x=v.x,this.rect.y=v.y,this.rect.width=h.width,this.rect.height=h.height},u.prototype.setCenter=function(v,h){this.rect.x=v-this.rect.width/2,this.rect.y=h-this.rect.height/2},u.prototype.setLocation=function(v,h){this.rect.x=v,this.rect.y=h},u.prototype.moveBy=function(v,h){this.rect.x+=v,this.rect.y+=h},u.prototype.getEdgeListToNode=function(v){var h=[],c,d=this;return d.edges.forEach(function(g){if(g.target==v){if(g.source!=d)throw"Incorrect edge source!";h.push(g)}}),h},u.prototype.getEdgesBetween=function(v){var h=[],c,d=this;return d.edges.forEach(function(g){if(!(g.source==d||g.target==d))throw"Incorrect edge source and/or target";if(g.target==v||g.source==v)h.push(g)}),h},u.prototype.getNeighborsList=function(){var v=new Set,h=this;return h.edges.forEach(function(c){if(c.source==h)v.add(c.target);else{if(c.target!=h)throw"Incorrect incidency!";v.add(c.source)}}),v},u.prototype.withChildren=function(){var v=new Set,h,c;if(v.add(this),this.child!=null){var d=this.child.getNodes();for(var g=0;g<d.length;g++)h=d[g],c=h.withChildren(),c.forEach(function(y){v.add(y)})}return v},u.prototype.getNoOfChildren=function(){var v=0,h;if(this.child==null)v=1;else{var c=this.child.getNodes();for(var d=0;d<c.length;d++)h=c[d],v+=h.getNoOfChildren()}if(v==0)v=1;return v},u.prototype.getEstimatedSize=function(){if(this.estimatedSize==n.MIN_VALUE)throw"assert failed";return this.estimatedSize},u.prototype.calcEstimatedSize=function(){if(this.child==null)return this.estimatedSize=(this.rect.width+this.rect.height)/2;else return this.estimatedSize=this.child.calcEstimatedSize(),this.rect.width=this.estimatedSize,this.rect.height=this.estimatedSize,this.estimatedSize},u.prototype.scatter=function(){var v,h,c=-s.INITIAL_WORLD_BOUNDARY,d=s.INITIAL_WORLD_BOUNDARY;v=s.WORLD_CENTER_X+o.nextDouble()*(d-c)+c;var g=-s.INITIAL_WORLD_BOUNDARY,y=s.INITIAL_WORLD_BOUNDARY;h=s.WORLD_CENTER_Y+o.nextDouble()*(y-g)+g,this.rect.x=v,this.rect.y=h},u.prototype.updateBounds=function(){if(this.getChild()==null)throw"assert failed";if(this.getChild().getNodes().length!=0){var v=this.getChild();if(v.updateBounds(!0),this.rect.x=v.getLeft(),this.rect.y=v.getTop(),this.setWidth(v.getRight()-v.getLeft()),this.setHeight(v.getBottom()-v.getTop()),s.NODE_DIMENSIONS_INCLUDE_LABELS){var h=v.getRight()-v.getLeft(),c=v.getBottom()-v.getTop();if(this.labelWidth){if(this.labelPosHorizontal=="left")this.rect.x-=this.labelWidth,this.setWidth(h+this.labelWidth);else if(this.labelPosHorizontal=="center"&&this.labelWidth>h)this.rect.x-=(this.labelWidth-h)/2,this.setWidth(this.labelWidth);else if(this.labelPosHorizontal=="right")this.setWidth(h+this.labelWidth)}if(this.labelHeight){if(this.labelPosVertical=="top")this.rect.y-=this.labelHeight,this.setHeight(c+this.labelHeight);else if(this.labelPosVertical=="center"&&this.labelHeight>c)this.rect.y-=(this.labelHeight-c)/2,this.setHeight(this.labelHeight);else if(this.labelPosVertical=="bottom")this.setHeight(c+this.labelHeight)}}}},u.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==n.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},u.prototype.transform=function(v){var h=this.rect.x;if(h>s.WORLD_BOUNDARY)h=s.WORLD_BOUNDARY;else if(h<-s.WORLD_BOUNDARY)h=-s.WORLD_BOUNDARY;var c=this.rect.y;if(c>s.WORLD_BOUNDARY)c=s.WORLD_BOUNDARY;else if(c<-s.WORLD_BOUNDARY)c=-s.WORLD_BOUNDARY;var d=new l(h,c),g=v.inverseTransformPoint(d);this.setLocation(g.x,g.y)},u.prototype.getLeft=function(){return this.rect.x},u.prototype.getRight=function(){return this.rect.x+this.rect.width},u.prototype.getTop=function(){return this.rect.y},u.prototype.getBottom=function(){return this.rect.y+this.rect.height},u.prototype.getParent=function(){if(this.owner==null)return null;return this.owner.getParent()},t.exports=u},function(t,e,r){var a=r(0);function n(){}for(var i in a)n[i]=a[i];n.MAX_ITERATIONS=2500,n.DEFAULT_EDGE_LENGTH=50,n.DEFAULT_SPRING_STRENGTH=0.45,n.DEFAULT_REPULSION_STRENGTH=4500,n.DEFAULT_GRAVITY_STRENGTH=0.4,n.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,n.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,n.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,n.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,n.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,n.DEFAULT_COOLING_FACTOR_INCREMENTAL=0.3,n.COOLING_ADAPTATION_FACTOR=0.33,n.ADAPTATION_LOWER_NODE_LIMIT=1000,n.ADAPTATION_UPPER_NODE_LIMIT=5000,n.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,n.MAX_NODE_DISPLACEMENT=n.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,n.MIN_REPULSION_DIST=n.DEFAULT_EDGE_LENGTH/10,n.CONVERGENCE_CHECK_PERIOD=100,n.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=0.1,n.MIN_EDGE_LENGTH=1,n.GRID_CALCULATION_CHECK_PERIOD=10,t.exports=n},function(t,e,r){function a(n,i){if(n==null&&i==null)this.x=0,this.y=0;else this.x=n,this.y=i}a.prototype.getX=function(){return this.x},a.prototype.getY=function(){return this.y},a.prototype.setX=function(n){this.x=n},a.prototype.setY=function(n){this.y=n},a.prototype.getDifference=function(n){return new DimensionD(this.x-n.x,this.y-n.y)},a.prototype.getCopy=function(){return new a(this.x,this.y)},a.prototype.translate=function(n){return this.x+=n.width,this.y+=n.height,this},t.exports=a},function(t,e,r){var a=r(2),n=r(10),i=r(0),s=r(7),o=r(3),l=r(1),u=r(13),f=r(12),v=r(11);function h(d,g,y){if(a.call(this,y),this.estimatedSize=n.MIN_VALUE,this.margin=i.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=d,g!=null&&g instanceof s)this.graphManager=g;else if(g!=null&&g instanceof Layout)this.graphManager=g.graphManager}h.prototype=Object.create(a.prototype);for(var c in a)h[c]=a[c];h.prototype.getNodes=function(){return this.nodes},h.prototype.getEdges=function(){return this.edges},h.prototype.getGraphManager=function(){return this.graphManager},h.prototype.getParent=function(){return this.parent},h.prototype.getLeft=function(){return this.left},h.prototype.getRight=function(){return this.right},h.prototype.getTop=function(){return this.top},h.prototype.getBottom=function(){return this.bottom},h.prototype.isConnected=function(){return this.isConnected},h.prototype.add=function(d,g,y){if(g==null&&y==null){var p=d;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(p)>-1)throw"Node already in graph!";return p.owner=this,this.getNodes().push(p),p}else{var m=d;if(!(this.getNodes().indexOf(g)>-1&&this.getNodes().indexOf(y)>-1))throw"Source or target not in graph!";if(!(g.owner==y.owner&&g.owner==this))throw"Both owners must be this graph!";if(g.owner!=y.owner)return null;if(m.source=g,m.target=y,m.isInterGraph=!1,this.getEdges().push(m),g.edges.push(m),y!=g)y.edges.push(m);return m}},h.prototype.remove=function(d){var g=d;if(d instanceof o){if(g==null)throw"Node is null!";if(!(g.owner!=null&&g.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";var y=g.edges.slice(),p,m=y.length;for(var b=0;b<m;b++)if(p=y[b],p.isInterGraph)this.graphManager.remove(p);else p.source.owner.remove(p);var E=this.nodes.indexOf(g);if(E==-1)throw"Node not in owner node list!";this.nodes.splice(E,1)}else if(d instanceof l){var p=d;if(p==null)throw"Edge is null!";if(!(p.source!=null&&p.target!=null))throw"Source and/or target is null!";if(!(p.source.owner!=null&&p.target.owner!=null&&p.source.owner==this&&p.target.owner==this))throw"Source and/or target owner is invalid!";var A=p.source.edges.indexOf(p),M=p.target.edges.indexOf(p);if(!(A>-1&&M>-1))throw"Source and/or target doesn't know this edge!";if(p.source.edges.splice(A,1),p.target!=p.source)p.target.edges.splice(M,1);var E=p.source.owner.getEdges().indexOf(p);if(E==-1)throw"Not in owner's edge list!";p.source.owner.getEdges().splice(E,1)}},h.prototype.updateLeftTop=function(){var{MAX_VALUE:d,MAX_VALUE:g}=n,y,p,m,b=this.getNodes(),E=b.length;for(var A=0;A<E;A++){var M=b[A];if(y=M.getTop(),p=M.getLeft(),d>y)d=y;if(g>p)g=p}if(d==n.MAX_VALUE)return null;if(b[0].getParent().paddingLeft!=null)m=b[0].getParent().paddingLeft;else m=this.margin;return this.left=g-m,this.top=d-m,new f(this.left,this.top)},h.prototype.updateBounds=function(d){var g=n.MAX_VALUE,y=-n.MAX_VALUE,p=n.MAX_VALUE,m=-n.MAX_VALUE,b,E,A,M,S,P=this.nodes,N=P.length;for(var R=0;R<N;R++){var I=P[R];if(d&&I.child!=null)I.updateBounds();if(b=I.getLeft(),E=I.getRight(),A=I.getTop(),M=I.getBottom(),g>b)g=b;if(y<E)y=E;if(p>A)p=A;if(m<M)m=M}var w=new u(g,p,y-g,m-p);if(g==n.MAX_VALUE)this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom();if(P[0].getParent().paddingLeft!=null)S=P[0].getParent().paddingLeft;else S=this.margin;this.left=w.x-S,this.right=w.x+w.width+S,this.top=w.y-S,this.bottom=w.y+w.height+S},h.calculateBounds=function(d){var g=n.MAX_VALUE,y=-n.MAX_VALUE,p=n.MAX_VALUE,m=-n.MAX_VALUE,b,E,A,M,S=d.length;for(var P=0;P<S;P++){var N=d[P];if(b=N.getLeft(),E=N.getRight(),A=N.getTop(),M=N.getBottom(),g>b)g=b;if(y<E)y=E;if(p>A)p=A;if(m<M)m=M}var R=new u(g,p,y-g,m-p);return R},h.prototype.getInclusionTreeDepth=function(){if(this==this.graphManager.getRoot())return 1;else return this.parent.getInclusionTreeDepth()},h.prototype.getEstimatedSize=function(){if(this.estimatedSize==n.MIN_VALUE)throw"assert failed";return this.estimatedSize},h.prototype.calcEstimatedSize=function(){var d=0,g=this.nodes,y=g.length;for(var p=0;p<y;p++){var m=g[p];d+=m.calcEstimatedSize()}if(d==0)this.estimatedSize=i.EMPTY_COMPOUND_NODE_SIZE;else this.estimatedSize=d/Math.sqrt(this.nodes.length);return this.estimatedSize},h.prototype.updateConnected=function(){var d=this;if(this.nodes.length==0){this.isConnected=!0;return}var g=new v,y=new Set,p=this.nodes[0],m,b,E=p.withChildren();E.forEach(function(R){g.push(R),y.add(R)});while(g.length!==0){p=g.shift(),m=p.getEdges();var A=m.length;for(var M=0;M<A;M++){var S=m[M];if(b=S.getOtherEndInGraph(p,this),b!=null&&!y.has(b)){var P=b.withChildren();P.forEach(function(R){g.push(R),y.add(R)})}}}if(this.isConnected=!1,y.size>=this.nodes.length){var N=0;if(y.forEach(function(R){if(R.owner==d)N++}),N==this.nodes.length)this.isConnected=!0}},t.exports=h},function(t,e,r){var a,n=r(1);function i(s){a=r(6),this.layout=s,this.graphs=[],this.edges=[]}i.prototype.addRoot=function(){var s=this.layout.newGraph(),o=this.layout.newNode(null),l=this.add(s,o);return this.setRootGraph(l),this.rootGraph},i.prototype.add=function(s,o,l,u,f){if(l==null&&u==null&&f==null){if(s==null)throw"Graph is null!";if(o==null)throw"Parent node is null!";if(this.graphs.indexOf(s)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(s),s.parent!=null)throw"Already has a parent!";if(o.child!=null)throw"Already has a child!";return s.parent=o,o.child=s,s}else{f=l,u=o,l=s;var v=u.getOwner(),h=f.getOwner();if(!(v!=null&&v.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(h!=null&&h.getGraphManager()==this))throw"Target not in this graph mgr!";if(v==h)return l.isInterGraph=!1,v.add(l,u,f);else{if(l.isInterGraph=!0,l.source=u,l.target=f,this.edges.indexOf(l)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(l),!(l.source!=null&&l.target!=null))throw"Edge source and/or target is null!";if(!(l.source.edges.indexOf(l)==-1&&l.target.edges.indexOf(l)==-1))throw"Edge already in source and/or target incidency list!";return l.source.edges.push(l),l.target.edges.push(l),l}}},i.prototype.remove=function(s){if(s instanceof a){var o=s;if(o.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(o==this.rootGraph||o.parent!=null&&o.parent.graphManager==this))throw"Invalid parent node!";var l=[];l=l.concat(o.getEdges());var u,f=l.length;for(var v=0;v<f;v++)u=l[v],o.remove(u);var h=[];h=h.concat(o.getNodes());var c;f=h.length;for(var v=0;v<f;v++)c=h[v],o.remove(c);if(o==this.rootGraph)this.setRootGraph(null);var d=this.graphs.indexOf(o);this.graphs.splice(d,1),o.parent=null}else if(s instanceof n){if(u=s,u==null)throw"Edge is null!";if(!u.isInterGraph)throw"Not an inter-graph edge!";if(!(u.source!=null&&u.target!=null))throw"Source and/or target is null!";if(!(u.source.edges.indexOf(u)!=-1&&u.target.edges.indexOf(u)!=-1))throw"Source and/or target doesn't know this edge!";var d=u.source.edges.indexOf(u);if(u.source.edges.splice(d,1),d=u.target.edges.indexOf(u),u.target.edges.splice(d,1),!(u.source.owner!=null&&u.source.owner.getGraphManager()!=null))throw"Edge owner graph or owner graph manager is null!";if(u.source.owner.getGraphManager().edges.indexOf(u)==-1)throw"Not in owner graph manager's edge list!";var d=u.source.owner.getGraphManager().edges.indexOf(u);u.source.owner.getGraphManager().edges.splice(d,1)}},i.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},i.prototype.getGraphs=function(){return this.graphs},i.prototype.getAllNodes=function(){if(this.allNodes==null){var s=[],o=this.getGraphs(),l=o.length;for(var u=0;u<l;u++)s=s.concat(o[u].getNodes());this.allNodes=s}return this.allNodes},i.prototype.resetAllNodes=function(){this.allNodes=null},i.prototype.resetAllEdges=function(){this.allEdges=null},i.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},i.prototype.getAllEdges=function(){if(this.allEdges==null){var s=[],o=this.getGraphs(),l=o.length;for(var u=0;u<o.length;u++)s=s.concat(o[u].getEdges());s=s.concat(this.edges),this.allEdges=s}return this.allEdges},i.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},i.prototype.setAllNodesToApplyGravitation=function(s){if(this.allNodesToApplyGravitation!=null)throw"assert failed";this.allNodesToApplyGravitation=s},i.prototype.getRoot=function(){return this.rootGraph},i.prototype.setRootGraph=function(s){if(s.getGraphManager()!=this)throw"Root not in this graph mgr!";if(this.rootGraph=s,s.parent==null)s.parent=this.layout.newNode("Root node")},i.prototype.getLayout=function(){return this.layout},i.prototype.isOneAncestorOfOther=function(s,o){if(!(s!=null&&o!=null))throw"assert failed";if(s==o)return!0;var l=s.getOwner(),u;do{if(u=l.getParent(),u==null)break;if(u==o)return!0;if(l=u.getOwner(),l==null)break}while(!0);l=o.getOwner();do{if(u=l.getParent(),u==null)break;if(u==s)return!0;if(l=u.getOwner(),l==null)break}while(!0);return!1},i.prototype.calcLowestCommonAncestors=function(){var s,o,l,u,f,v=this.getAllEdges(),h=v.length;for(var c=0;c<h;c++){if(s=v[c],o=s.source,l=s.target,s.lca=null,s.sourceInLca=o,s.targetInLca=l,o==l){s.lca=o.getOwner();continue}u=o.getOwner();while(s.lca==null){s.targetInLca=l,f=l.getOwner();while(s.lca==null){if(f==u){s.lca=f;break}if(f==this.rootGraph)break;if(s.lca!=null)throw"assert failed";s.targetInLca=f.getParent(),f=s.targetInLca.getOwner()}if(u==this.rootGraph)break;if(s.lca==null)s.sourceInLca=u.getParent(),u=s.sourceInLca.getOwner()}if(s.lca==null)throw"assert failed"}},i.prototype.calcLowestCommonAncestor=function(s,o){if(s==o)return s.getOwner();var l=s.getOwner();do{if(l==null)break;var u=o.getOwner();do{if(u==null)break;if(u==l)return u;u=u.getParent().getOwner()}while(!0);l=l.getParent().getOwner()}while(!0);return l},i.prototype.calcInclusionTreeDepths=function(s,o){if(s==null&&o==null)s=this.rootGraph,o=1;var l,u=s.getNodes(),f=u.length;for(var v=0;v<f;v++)if(l=u[v],l.inclusionTreeDepth=o,l.child!=null)this.calcInclusionTreeDepths(l.child,o+1)},i.prototype.includesInvalidEdge=function(){var s,o=[],l=this.edges.length;for(var u=0;u<l;u++)if(s=this.edges[u],this.isOneAncestorOfOther(s.source,s.target))o.push(s);for(var u=0;u<o.length;u++)this.remove(o[u]);return!1},t.exports=i},function(t,e,r){var a=r(12);function n(){}n.calcSeparationAmount=function(i,s,o,l){if(!i.intersects(s))throw"assert failed";var u=[,,];if(this.decideDirectionsForOverlappingNodes(i,s,u),o[0]=Math.min(i.getRight(),s.getRight())-Math.max(i.x,s.x),o[1]=Math.min(i.getBottom(),s.getBottom())-Math.max(i.y,s.y),i.getX()<=s.getX()&&i.getRight()>=s.getRight())o[0]+=Math.min(s.getX()-i.getX(),i.getRight()-s.getRight());else if(s.getX()<=i.getX()&&s.getRight()>=i.getRight())o[0]+=Math.min(i.getX()-s.getX(),s.getRight()-i.getRight());if(i.getY()<=s.getY()&&i.getBottom()>=s.getBottom())o[1]+=Math.min(s.getY()-i.getY(),i.getBottom()-s.getBottom());else if(s.getY()<=i.getY()&&s.getBottom()>=i.getBottom())o[1]+=Math.min(i.getY()-s.getY(),s.getBottom()-i.getBottom());var f=Math.abs((s.getCenterY()-i.getCenterY())/(s.getCenterX()-i.getCenterX()));if(s.getCenterY()===i.getCenterY()&&s.getCenterX()===i.getCenterX())f=1;var v=f*o[0],h=o[1]/f;if(o[0]<h)h=o[0];else v=o[1];o[0]=-1*u[0]*(h/2+l),o[1]=-1*u[1]*(v/2+l)},n.decideDirectionsForOverlappingNodes=function(i,s,o){if(i.getCenterX()<s.getCenterX())o[0]=-1;else o[0]=1;if(i.getCenterY()<s.getCenterY())o[1]=-1;else o[1]=1},n.getIntersection2=function(i,s,o){var l=i.getCenterX(),u=i.getCenterY(),f=s.getCenterX(),v=s.getCenterY();if(i.intersects(s))return o[0]=l,o[1]=u,o[2]=f,o[3]=v,!0;var h=i.getX(),c=i.getY(),d=i.getRight(),g=i.getX(),y=i.getBottom(),p=i.getRight(),m=i.getWidthHalf(),b=i.getHeightHalf(),E=s.getX(),A=s.getY(),M=s.getRight(),S=s.getX(),P=s.getBottom(),N=s.getRight(),R=s.getWidthHalf(),I=s.getHeightHalf(),w=!1,x=!1;if(l===f){if(u>v)return o[0]=l,o[1]=c,o[2]=f,o[3]=P,!1;else if(u<v)return o[0]=l,o[1]=y,o[2]=f,o[3]=A,!1}else if(u===v){if(l>f)return o[0]=h,o[1]=u,o[2]=M,o[3]=v,!1;else if(l<f)return o[0]=d,o[1]=u,o[2]=E,o[3]=v,!1}else{var T=i.height/i.width,D=s.height/s.width,C=(v-u)/(f-l),O=void 0,B=void 0,z=void 0,V=void 0,k=void 0,G=void 0;if(-T===C)if(l>f)o[0]=g,o[1]=y,w=!0;else o[0]=d,o[1]=c,w=!0;else if(T===C)if(l>f)o[0]=h,o[1]=c,w=!0;else o[0]=p,o[1]=y,w=!0;if(-D===C)if(f>l)o[2]=S,o[3]=P,x=!0;else o[2]=M,o[3]=A,x=!0;else if(D===C)if(f>l)o[2]=E,o[3]=A,x=!0;else o[2]=N,o[3]=P,x=!0;if(w&&x)return!1;if(l>f)if(u>v)O=this.getCardinalDirection(T,C,4),B=this.getCardinalDirection(D,C,2);else O=this.getCardinalDirection(-T,C,3),B=this.getCardinalDirection(-D,C,1);else if(u>v)O=this.getCardinalDirection(-T,C,1),B=this.getCardinalDirection(-D,C,3);else O=this.getCardinalDirection(T,C,2),B=this.getCardinalDirection(D,C,4);if(!w)switch(O){case 1:V=c,z=l+-b/C,o[0]=z,o[1]=V;break;case 2:z=p,V=u+m*C,o[0]=z,o[1]=V;break;case 3:V=y,z=l+b/C,o[0]=z,o[1]=V;break;case 4:z=g,V=u+-m*C,o[0]=z,o[1]=V;break}if(!x)switch(B){case 1:G=A,k=f+-I/C,o[2]=k,o[3]=G;break;case 2:k=N,G=v+R*C,o[2]=k,o[3]=G;break;case 3:G=P,k=f+I/C,o[2]=k,o[3]=G;break;case 4:k=S,G=v+-R*C,o[2]=k,o[3]=G;break}}return!1},n.getCardinalDirection=function(i,s,o){if(i>s)return o;else return 1+o%4},n.getIntersection=function(i,s,o,l){if(l==null)return this.getIntersection2(i,s,o);var{x:u,y:f}=i,{x:v,y:h}=s,{x:c,y:d}=o,{x:g,y}=l,p=void 0,m=void 0,b=void 0,E=void 0,A=void 0,M=void 0,S=void 0,P=void 0,N=void 0;if(b=h-f,A=u-v,S=v*f-u*h,E=y-d,M=c-g,P=g*d-c*y,N=b*M-E*A,N===0)return null;return p=(A*P-M*S)/N,m=(E*S-b*P)/N,new a(p,m)},n.angleOfVector=function(i,s,o,l){var u=void 0;if(i!==o){if(u=Math.atan((l-s)/(o-i)),o<i)u+=Math.PI;else if(l<s)u+=this.TWO_PI}else if(l<s)u=this.ONE_AND_HALF_PI;else u=this.HALF_PI;return u},n.doIntersect=function(i,s,o,l){var{x:u,y:f}=i,{x:v,y:h}=s,{x:c,y:d}=o,{x:g,y}=l,p=(v-u)*(y-d)-(g-c)*(h-f);if(p===0)return!1;else{var m=((y-d)*(g-u)+(c-g)*(y-f))/p,b=((f-h)*(g-u)+(v-u)*(y-f))/p;return 0<m&&m<1&&0<b&&b<1}},n.findCircleLineIntersections=function(i,s,o,l,u,f,v){var h=(o-i)*(o-i)+(l-s)*(l-s),c=2*((i-u)*(o-i)+(s-f)*(l-s)),d=(i-u)*(i-u)+(s-f)*(s-f)-v*v,g=c*c-4*h*d;if(g>=0){var y=(-c+Math.sqrt(c*c-4*h*d))/(2*h),p=(-c-Math.sqrt(c*c-4*h*d))/(2*h),m=null;if(y>=0&&y<=1)return[y];if(p>=0&&p<=1)return[p];return m}else return null},n.HALF_PI=0.5*Math.PI,n.ONE_AND_HALF_PI=1.5*Math.PI,n.TWO_PI=2*Math.PI,n.THREE_PI=3*Math.PI,t.exports=n},function(t,e,r){function a(){}a.sign=function(n){if(n>0)return 1;else if(n<0)return-1;else return 0},a.floor=function(n){return n<0?Math.ceil(n):Math.floor(n)},a.ceil=function(n){return n<0?Math.floor(n):Math.ceil(n)},t.exports=a},function(t,e,r){function a(){}a.MAX_VALUE=2147483647,a.MIN_VALUE=-2147483648,t.exports=a},function(t,e,r){var a=function(){function u(f,v){for(var h=0;h<v.length;h++){var c=v[h];if(c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c)c.writable=!0;Object.defineProperty(f,c.key,c)}}return function(f,v,h){if(v)u(f.prototype,v);if(h)u(f,h);return f}}();function n(u,f){if(!(u instanceof f))throw TypeError("Cannot call a class as a function")}var i=function(f){return{value:f,next:null,prev:null}},s=function(f,v,h,c){if(f!==null)f.next=v;else c.head=v;if(h!==null)h.prev=v;else c.tail=v;return v.prev=f,v.next=h,c.length++,v},o=function(f,v){var{prev:h,next:c}=f;if(h!==null)h.next=c;else v.head=c;if(c!==null)c.prev=h;else v.tail=h;return f.prev=f.next=null,v.length--,f},l=function(){function u(f){var v=this;if(n(this,u),this.length=0,this.head=null,this.tail=null,f!=null)f.forEach(function(h){return v.push(h)})}return a(u,[{key:"size",value:function(){return this.length}},{key:"insertBefore",value:function(v,h){return s(h.prev,i(v),h,this)}},{key:"insertAfter",value:function(v,h){return s(h,i(v),h.next,this)}},{key:"insertNodeBefore",value:function(v,h){return s(h.prev,v,h,this)}},{key:"insertNodeAfter",value:function(v,h){return s(h,v,h.next,this)}},{key:"push",value:function(v){return s(this.tail,i(v),null,this)}},{key:"unshift",value:function(v){return s(null,i(v),this.head,this)}},{key:"remove",value:function(v){return o(v,this)}},{key:"pop",value:function(){return o(this.tail,this).value}},{key:"popNode",value:function(){return o(this.tail,this)}},{key:"shift",value:function(){return o(this.head,this).value}},{key:"shiftNode",value:function(){return o(this.head,this)}},{key:"get_object_at",value:function(v){if(v<=this.length()){var h=1,c=this.head;while(h<v)c=c.next,h++;return c.value}}},{key:"set_object_at",value:function(v,h){if(v<=this.length()){var c=1,d=this.head;while(c<v)d=d.next,c++;d.value=h}}}]),u}();t.exports=l},function(t,e,r){function a(n,i,s){if(this.x=null,this.y=null,n==null&&i==null&&s==null)this.x=0,this.y=0;else if(typeof n=="number"&&typeof i=="number"&&s==null)this.x=n,this.y=i;else if(n.constructor.name=="Point"&&i==null&&s==null)s=n,this.x=s.x,this.y=s.y}a.prototype.getX=function(){return this.x},a.prototype.getY=function(){return this.y},a.prototype.getLocation=function(){return new a(this.x,this.y)},a.prototype.setLocation=function(n,i,s){if(n.constructor.name=="Point"&&i==null&&s==null)s=n,this.setLocation(s.x,s.y);else if(typeof n=="number"&&typeof i=="number"&&s==null)if(parseInt(n)==n&&parseInt(i)==i)this.move(n,i);else this.x=Math.floor(n+0.5),this.y=Math.floor(i+0.5)},a.prototype.move=function(n,i){this.x=n,this.y=i},a.prototype.translate=function(n,i){this.x+=n,this.y+=i},a.prototype.equals=function(n){if(n.constructor.name=="Point"){var i=n;return this.x==i.x&&this.y==i.y}return this==n},a.prototype.toString=function(){return new a().constructor.name+"[x="+this.x+",y="+this.y+"]"},t.exports=a},function(t,e,r){function a(n,i,s,o){if(this.x=0,this.y=0,this.width=0,this.height=0,n!=null&&i!=null&&s!=null&&o!=null)this.x=n,this.y=i,this.width=s,this.height=o}a.prototype.getX=function(){return this.x},a.prototype.setX=function(n){this.x=n},a.prototype.getY=function(){return this.y},a.prototype.setY=function(n){this.y=n},a.prototype.getWidth=function(){return this.width},a.prototype.setWidth=function(n){this.width=n},a.prototype.getHeight=function(){return this.height},a.prototype.setHeight=function(n){this.height=n},a.prototype.getRight=function(){return this.x+this.width},a.prototype.getBottom=function(){return this.y+this.height},a.prototype.intersects=function(n){if(this.getRight()<n.x)return!1;if(this.getBottom()<n.y)return!1;if(n.getRight()<this.x)return!1;if(n.getBottom()<this.y)return!1;return!0},a.prototype.getCenterX=function(){return this.x+this.width/2},a.prototype.getMinX=function(){return this.getX()},a.prototype.getMaxX=function(){return this.getX()+this.width},a.prototype.getCenterY=function(){return this.y+this.height/2},a.prototype.getMinY=function(){return this.getY()},a.prototype.getMaxY=function(){return this.getY()+this.height},a.prototype.getWidthHalf=function(){return this.width/2},a.prototype.getHeightHalf=function(){return this.height/2},t.exports=a},function(t,e,r){var a=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(i){return typeof i}:function(i){return i&&typeof Symbol==="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i};function n(){}n.lastID=0,n.createID=function(i){if(n.isPrimitive(i))return i;if(i.uniqueID!=null)return i.uniqueID;return i.uniqueID=n.getString(),n.lastID++,i.uniqueID},n.getString=function(i){if(i==null)i=n.lastID;return"Object#"+i},n.isPrimitive=function(i){var s=typeof i>"u"?"undefined":a(i);return i==null||s!="object"&&s!="function"},t.exports=n},function(t,e,r){function a(c){if(Array.isArray(c)){for(var d=0,g=Array(c.length);d<c.length;d++)g[d]=c[d];return g}else return Array.from(c)}var n=r(0),i=r(7),s=r(3),o=r(1),l=r(6),u=r(5),f=r(17),v=r(29);function h(c){if(v.call(this),this.layoutQuality=n.QUALITY,this.createBendsAsNeeded=n.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=n.DEFAULT_INCREMENTAL,this.animationOnLayout=n.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=n.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=n.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=n.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new i(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,c!=null)this.isRemoteUse=c}h.RANDOM_SEED=1,h.prototype=Object.create(v.prototype),h.prototype.getGraphManager=function(){return this.graphManager},h.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},h.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},h.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},h.prototype.newGraphManager=function(){var c=new i(this);return this.graphManager=c,c},h.prototype.newGraph=function(c){return new l(null,this.graphManager,c)},h.prototype.newNode=function(c){return new s(this.graphManager,c)},h.prototype.newEdge=function(c){return new o(null,null,c)},h.prototype.checkLayoutSuccess=function(){return this.graphManager.getRoot()==null||this.graphManager.getRoot().getNodes().length==0||this.graphManager.includesInvalidEdge()},h.prototype.runLayout=function(){if(this.isLayoutFinished=!1,this.tilingPreLayout)this.tilingPreLayout();this.initParameters();var c;if(this.checkLayoutSuccess())c=!1;else c=this.layout();if(n.ANIMATE==="during")return!1;if(c){if(!this.isSubLayout)this.doPostLayout()}if(this.tilingPostLayout)this.tilingPostLayout();return this.isLayoutFinished=!0,c},h.prototype.doPostLayout=function(){if(!this.incremental)this.transform();this.update()},h.prototype.update2=function(){if(this.createBendsAsNeeded)this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges();if(!this.isRemoteUse){var c,d=this.graphManager.getAllEdges();for(var g=0;g<d.length;g++)c=d[g];var y,p=this.graphManager.getRoot().getNodes();for(var g=0;g<p.length;g++)y=p[g];this.update(this.graphManager.getRoot())}},h.prototype.update=function(c){if(c==null)this.update2();else if(c instanceof s){var d=c;if(d.getChild()!=null){var g=d.getChild().getNodes();for(var y=0;y<g.length;y++)update(g[y])}if(d.vGraphObject!=null){var p=d.vGraphObject;p.update(d)}}else if(c instanceof o){var m=c;if(m.vGraphObject!=null){var b=m.vGraphObject;b.update(m)}}else if(c instanceof l){var E=c;if(E.vGraphObject!=null){var A=E.vGraphObject;A.update(E)}}},h.prototype.initParameters=function(){if(!this.isSubLayout)this.layoutQuality=n.QUALITY,this.animationDuringLayout=n.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=n.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=n.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=n.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=n.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=n.DEFAULT_UNIFORM_LEAF_NODE_SIZES;if(this.animationDuringLayout)this.animationOnLayout=!1},h.prototype.transform=function(c){if(c==null)this.transform(new u(0,0));else{var d=new f,g=this.graphManager.getRoot().updateLeftTop();if(g!=null){d.setWorldOrgX(c.x),d.setWorldOrgY(c.y),d.setDeviceOrgX(g.x),d.setDeviceOrgY(g.y);var y=this.getAllNodes(),p;for(var m=0;m<y.length;m++)p=y[m],p.transform(d)}}},h.prototype.positionNodesRandomly=function(c){if(c==null)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else{var d,g,y=c.getNodes();for(var p=0;p<y.length;p++)if(d=y[p],g=d.getChild(),g==null)d.scatter();else if(g.getNodes().length==0)d.scatter();else this.positionNodesRandomly(g),d.updateBounds()}},h.prototype.getFlatForest=function(){var c=[],d=!0,g=this.graphManager.getRoot().getNodes(),y=!0;for(var p=0;p<g.length;p++)if(g[p].getChild()!=null)y=!1;if(!y)return c;var m=new Set,b=[],E=new Map,A=[];A=A.concat(g);while(A.length>0&&d){b.push(A[0]);while(b.length>0&&d){var M=b[0];b.splice(0,1),m.add(M);var S=M.getEdges();for(var p=0;p<S.length;p++){var P=S[p].getOtherEnd(M);if(E.get(M)!=P)if(!m.has(P))b.push(P),E.set(P,M);else{d=!1;break}}}if(!d)c=[];else{var N=[].concat(a(m));c.push(N);for(var p=0;p<N.length;p++){var R=N[p],I=A.indexOf(R);if(I>-1)A.splice(I,1)}m=new Set,E=new Map}}return c},h.prototype.createDummyNodesForBendpoints=function(c){var d=[],g=c.source,y=this.graphManager.calcLowestCommonAncestor(c.source,c.target);for(var p=0;p<c.bendpoints.length;p++){var m=this.newNode(null);m.setRect(new Point(0,0),new Dimension(1,1)),y.add(m);var b=this.newEdge(null);this.graphManager.add(b,g,m),d.add(m),g=m}var b=this.newEdge(null);if(this.graphManager.add(b,g,c.target),this.edgeToDummyNodes.set(c,d),c.isInterGraph())this.graphManager.remove(c);else y.remove(c);return d},h.prototype.createBendpointsFromDummyNodes=function(){var c=[];c=c.concat(this.graphManager.getAllEdges()),c=[].concat(a(this.edgeToDummyNodes.keys())).concat(c);for(var d=0;d<c.length;d++){var g=c[d];if(g.bendpoints.length>0){var y=this.edgeToDummyNodes.get(g);for(var p=0;p<y.length;p++){var m=y[p],b=new u(m.getCenterX(),m.getCenterY()),E=g.bendpoints.get(p);E.x=b.x,E.y=b.y,m.getOwner().remove(m)}this.graphManager.add(g,g.source,g.target)}}},h.transform=function(c,d,g,y){if(g!=null&&y!=null){var p=d;if(c<=50){var m=d/g;p-=(d-m)/50*(50-c)}else{var b=d*y;p+=(b-d)/50*(c-50)}return p}else{var E,A;if(c<=50)E=9*d/500,A=d/10;else E=9*d/50,A=-8*d;return E*c+A}},h.findCenterOfTree=function(c){var d=[];d=d.concat(c);var g=[],y=new Map,p=!1,m=null;if(d.length==1||d.length==2)p=!0,m=d[0];for(var b=0;b<d.length;b++){var E=d[b],A=E.getNeighborsList().size;if(y.set(E,E.getNeighborsList().size),A==1)g.push(E)}var M=[];M=M.concat(g);while(!p){var S=[];S=S.concat(M),M=[];for(var b=0;b<d.length;b++){var E=d[b],P=d.indexOf(E);if(P>=0)d.splice(P,1);var N=E.getNeighborsList();N.forEach(function(w){if(g.indexOf(w)<0){var x=y.get(w),T=x-1;if(T==1)M.push(w);y.set(w,T)}})}if(g=g.concat(M),d.length==1||d.length==2)p=!0,m=d[0]}return m},h.prototype.setGraphManager=function(c){this.graphManager=c},t.exports=h},function(t,e,r){function a(){}a.seed=1,a.x=0,a.nextDouble=function(){return a.x=Math.sin(a.seed++)*1e4,a.x-Math.floor(a.x)},t.exports=a},function(t,e,r){var a=r(5);function n(i,s){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}n.prototype.getWorldOrgX=function(){return this.lworldOrgX},n.prototype.setWorldOrgX=function(i){this.lworldOrgX=i},n.prototype.getWorldOrgY=function(){return this.lworldOrgY},n.prototype.setWorldOrgY=function(i){this.lworldOrgY=i},n.prototype.getWorldExtX=function(){return this.lworldExtX},n.prototype.setWorldExtX=function(i){this.lworldExtX=i},n.prototype.getWorldExtY=function(){return this.lworldExtY},n.prototype.setWorldExtY=function(i){this.lworldExtY=i},n.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},n.prototype.setDeviceOrgX=function(i){this.ldeviceOrgX=i},n.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},n.prototype.setDeviceOrgY=function(i){this.ldeviceOrgY=i},n.prototype.getDeviceExtX=function(){return this.ldeviceExtX},n.prototype.setDeviceExtX=function(i){this.ldeviceExtX=i},n.prototype.getDeviceExtY=function(){return this.ldeviceExtY},n.prototype.setDeviceExtY=function(i){this.ldeviceExtY=i},n.prototype.transformX=function(i){var s=0,o=this.lworldExtX;if(o!=0)s=this.ldeviceOrgX+(i-this.lworldOrgX)*this.ldeviceExtX/o;return s},n.prototype.transformY=function(i){var s=0,o=this.lworldExtY;if(o!=0)s=this.ldeviceOrgY+(i-this.lworldOrgY)*this.ldeviceExtY/o;return s},n.prototype.inverseTransformX=function(i){var s=0,o=this.ldeviceExtX;if(o!=0)s=this.lworldOrgX+(i-this.ldeviceOrgX)*this.lworldExtX/o;return s},n.prototype.inverseTransformY=function(i){var s=0,o=this.ldeviceExtY;if(o!=0)s=this.lworldOrgY+(i-this.ldeviceOrgY)*this.lworldExtY/o;return s},n.prototype.inverseTransformPoint=function(i){var s=new a(this.inverseTransformX(i.x),this.inverseTransformY(i.y));return s},t.exports=n},function(t,e,r){function a(v){if(Array.isArray(v)){for(var h=0,c=Array(v.length);h<v.length;h++)c[h]=v[h];return c}else return Array.from(v)}var n=r(15),i=r(4),s=r(0),o=r(8),l=r(9);function u(){n.call(this),this.useSmartIdealEdgeLengthCalculation=i.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=i.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=i.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=i.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=i.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*i.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=i.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=i.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=i.MAX_ITERATIONS}u.prototype=Object.create(n.prototype);for(var f in n)u[f]=n[f];u.prototype.initParameters=function(){n.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=i.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},u.prototype.calcIdealEdgeLengths=function(){var v,h,c,d,g,y,p,m=this.getGraphManager().getAllEdges();for(var b=0;b<m.length;b++)if(v=m[b],h=v.idealLength,v.isInterGraph){if(d=v.getSource(),g=v.getTarget(),y=v.getSourceInLca().getEstimatedSize(),p=v.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation)v.idealLength+=y+p-2*s.SIMPLE_NODE_SIZE;c=v.getLca().getInclusionTreeDepth(),v.idealLength+=h*i.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(d.getInclusionTreeDepth()+g.getInclusionTreeDepth()-2*c)}},u.prototype.initSpringEmbedder=function(){var v=this.getAllNodes().length;if(this.incremental){if(v>i.ADAPTATION_LOWER_NODE_LIMIT)this.coolingFactor=Math.max(this.coolingFactor*i.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(v-i.ADAPTATION_LOWER_NODE_LIMIT)/(i.ADAPTATION_UPPER_NODE_LIMIT-i.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-i.COOLING_ADAPTATION_FACTOR));this.maxNodeDisplacement=i.MAX_NODE_DISPLACEMENT_INCREMENTAL}else{if(v>i.ADAPTATION_LOWER_NODE_LIMIT)this.coolingFactor=Math.max(i.COOLING_ADAPTATION_FACTOR,1-(v-i.ADAPTATION_LOWER_NODE_LIMIT)/(i.ADAPTATION_UPPER_NODE_LIMIT-i.ADAPTATION_LOWER_NODE_LIMIT)*(1-i.COOLING_ADAPTATION_FACTOR));else this.coolingFactor=1;this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=i.MAX_NODE_DISPLACEMENT}this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*i.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},u.prototype.calcSpringForces=function(){var v=this.getAllEdges(),h;for(var c=0;c<v.length;c++)h=v[c],this.calcSpringForce(h,h.idealLength)},u.prototype.calcRepulsionForces=function(){var v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,c,d,g,y,p=this.getAllNodes(),m;if(this.useFRGridVariant){if(this.totalIterations%i.GRID_CALCULATION_CHECK_PERIOD==1&&v)this.updateGrid();m=new Set;for(c=0;c<p.length;c++)g=p[c],this.calculateRepulsionForceOfANode(g,m,v,h),m.add(g)}else for(c=0;c<p.length;c++){g=p[c];for(d=c+1;d<p.length;d++){if(y=p[d],g.getOwner()!=y.getOwner())continue;this.calcRepulsionForce(g,y)}}},u.prototype.calcGravitationalForces=function(){var v,h=this.getAllNodesToApplyGravitation();for(var c=0;c<h.length;c++)v=h[c],this.calcGravitationalForce(v)},u.prototype.moveNodes=function(){var v=this.getAllNodes(),h;for(var c=0;c<v.length;c++)h=v[c],h.move()},u.prototype.calcSpringForce=function(v,h){var c=v.getSource(),d=v.getTarget(),g,y,p,m;if(this.uniformLeafNodeSizes&&c.getChild()==null&&d.getChild()==null)v.updateLengthSimple();else if(v.updateLength(),v.isOverlapingSourceAndTarget)return;if(g=v.getLength(),g==0)return;y=v.edgeElasticity*(g-h),p=y*(v.lengthX/g),m=y*(v.lengthY/g),c.springForceX+=p,c.springForceY+=m,d.springForceX-=p,d.springForceY-=m},u.prototype.calcRepulsionForce=function(v,h){var c=v.getRect(),d=h.getRect(),g=[,,],y=[,,,,],p,m,b,E,A,M,S;if(c.intersects(d)){o.calcSeparationAmount(c,d,g,i.DEFAULT_EDGE_LENGTH/2),M=2*g[0],S=2*g[1];var P=v.noOfChildren*h.noOfChildren/(v.noOfChildren+h.noOfChildren);v.repulsionForceX-=P*M,v.repulsionForceY-=P*S,h.repulsionForceX+=P*M,h.repulsionForceY+=P*S}else{if(this.uniformLeafNodeSizes&&v.getChild()==null&&h.getChild()==null)p=d.getCenterX()-c.getCenterX(),m=d.getCenterY()-c.getCenterY();else o.getIntersection(c,d,y),p=y[2]-y[0],m=y[3]-y[1];if(Math.abs(p)<i.MIN_REPULSION_DIST)p=l.sign(p)*i.MIN_REPULSION_DIST;if(Math.abs(m)<i.MIN_REPULSION_DIST)m=l.sign(m)*i.MIN_REPULSION_DIST;b=p*p+m*m,E=Math.sqrt(b),A=(v.nodeRepulsion/2+h.nodeRepulsion/2)*v.noOfChildren*h.noOfChildren/b,M=A*p/E,S=A*m/E,v.repulsionForceX-=M,v.repulsionForceY-=S,h.repulsionForceX+=M,h.repulsionForceY+=S}},u.prototype.calcGravitationalForce=function(v){var h,c,d,g,y,p,m,b;if(h=v.getOwner(),c=(h.getRight()+h.getLeft())/2,d=(h.getTop()+h.getBottom())/2,g=v.getCenterX()-c,y=v.getCenterY()-d,p=Math.abs(g)+v.getWidth()/2,m=Math.abs(y)+v.getHeight()/2,v.getOwner()==this.graphManager.getRoot()){if(b=h.getEstimatedSize()*this.gravityRangeFactor,p>b||m>b)v.gravitationForceX=-this.gravityConstant*g,v.gravitationForceY=-this.gravityConstant*y}else if(b=h.getEstimatedSize()*this.compoundGravityRangeFactor,p>b||m>b)v.gravitationForceX=-this.gravityConstant*g*this.compoundGravityConstant,v.gravitationForceY=-this.gravityConstant*y*this.compoundGravityConstant},u.prototype.isConverged=function(){var v,h=!1;if(this.totalIterations>this.maxIterations/3)h=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2;return v=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,v||h},u.prototype.animate=function(){if(this.animationDuringLayout&&!this.isSubLayout)if(this.notAnimatedIterations==this.animationPeriod)this.update(),this.notAnimatedIterations=0;else this.notAnimatedIterations++},u.prototype.calcNoOfChildrenForAllNodes=function(){var v,h=this.graphManager.getAllNodes();for(var c=0;c<h.length;c++)v=h[c],v.noOfChildren=v.getNoOfChildren()},u.prototype.calcGrid=function(v){var h=0,c=0;h=parseInt(Math.ceil((v.getRight()-v.getLeft())/this.repulsionRange)),c=parseInt(Math.ceil((v.getBottom()-v.getTop())/this.repulsionRange));var d=Array(h);for(var g=0;g<h;g++)d[g]=Array(c);for(var g=0;g<h;g++)for(var y=0;y<c;y++)d[g][y]=[];return d},u.prototype.addNodeToGrid=function(v,h,c){var d=0,g=0,y=0,p=0;d=parseInt(Math.floor((v.getRect().x-h)/this.repulsionRange)),g=parseInt(Math.floor((v.getRect().width+v.getRect().x-h)/this.repulsionRange)),y=parseInt(Math.floor((v.getRect().y-c)/this.repulsionRange)),p=parseInt(Math.floor((v.getRect().height+v.getRect().y-c)/this.repulsionRange));for(var m=d;m<=g;m++)for(var b=y;b<=p;b++)this.grid[m][b].push(v),v.setGridCoordinates(d,g,y,p)},u.prototype.updateGrid=function(){var v,h,c=this.getAllNodes();this.grid=this.calcGrid(this.graphManager.getRoot());for(v=0;v<c.length;v++)h=c[v],this.addNodeToGrid(h,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},u.prototype.calculateRepulsionForceOfANode=function(v,h,c,d){if(this.totalIterations%i.GRID_CALCULATION_CHECK_PERIOD==1&&c||d){var g=new Set;v.surrounding=[];var y,p=this.grid;for(var m=v.startX-1;m<v.finishX+2;m++)for(var b=v.startY-1;b<v.finishY+2;b++)if(!(m<0||b<0||m>=p.length||b>=p[0].length))for(var E=0;E<p[m][b].length;E++){if(y=p[m][b][E],v.getOwner()!=y.getOwner()||v==y)continue;if(!h.has(y)&&!g.has(y)){var A=Math.abs(v.getCenterX()-y.getCenterX())-(v.getWidth()/2+y.getWidth()/2),M=Math.abs(v.getCenterY()-y.getCenterY())-(v.getHeight()/2+y.getHeight()/2);if(A<=this.repulsionRange&&M<=this.repulsionRange)g.add(y)}}v.surrounding=[].concat(a(g))}for(m=0;m<v.surrounding.length;m++)this.calcRepulsionForce(v,v.surrounding[m])},u.prototype.calcRepulsionRange=function(){return 0},t.exports=u},function(t,e,r){var a=r(1),n=r(4);function i(o,l,u){a.call(this,o,l,u),this.idealLength=n.DEFAULT_EDGE_LENGTH,this.edgeElasticity=n.DEFAULT_SPRING_STRENGTH}i.prototype=Object.create(a.prototype);for(var s in a)i[s]=a[s];t.exports=i},function(t,e,r){var a=r(3),n=r(4);function i(o,l,u,f){a.call(this,o,l,u,f),this.nodeRepulsion=n.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=[]}i.prototype=Object.create(a.prototype);for(var s in a)i[s]=a[s];i.prototype.setGridCoordinates=function(o,l,u,f){this.startX=o,this.finishX=l,this.startY=u,this.finishY=f},t.exports=i},function(t,e,r){function a(n,i){if(this.width=0,this.height=0,n!==null&&i!==null)this.height=i,this.width=n}a.prototype.getWidth=function(){return this.width},a.prototype.setWidth=function(n){this.width=n},a.prototype.getHeight=function(){return this.height},a.prototype.setHeight=function(n){this.height=n},t.exports=a},function(t,e,r){var a=r(14);function n(){this.map={},this.keys=[]}n.prototype.put=function(i,s){var o=a.createID(i);if(!this.contains(o))this.map[o]=s,this.keys.push(i)},n.prototype.contains=function(i){var s=a.createID(i);return this.map[i]!=null},n.prototype.get=function(i){var s=a.createID(i);return this.map[s]},n.prototype.keySet=function(){return this.keys},t.exports=n},function(t,e,r){var a=r(14);function n(){this.set={}}n.prototype.add=function(i){var s=a.createID(i);if(!this.contains(s))this.set[s]=i},n.prototype.remove=function(i){delete this.set[a.createID(i)]},n.prototype.clear=function(){this.set={}},n.prototype.contains=function(i){return this.set[a.createID(i)]==i},n.prototype.isEmpty=function(){return this.size()===0},n.prototype.size=function(){return Object.keys(this.set).length},n.prototype.addAllTo=function(i){var s=Object.keys(this.set),o=s.length;for(var l=0;l<o;l++)i.push(this.set[s[l]])},n.prototype.size=function(){return Object.keys(this.set).length},n.prototype.addAll=function(i){var s=i.length;for(var o=0;o<s;o++){var l=i[o];this.add(l)}},t.exports=n},function(t,e,r){function a(){}a.multMat=function(n,i){var s=[];for(var o=0;o<n.length;o++){s[o]=[];for(var l=0;l<i[0].length;l++){s[o][l]=0;for(var u=0;u<n[0].length;u++)s[o][l]+=n[o][u]*i[u][l]}}return s},a.transpose=function(n){var i=[];for(var s=0;s<n[0].length;s++){i[s]=[];for(var o=0;o<n.length;o++)i[s][o]=n[o][s]}return i},a.multCons=function(n,i){var s=[];for(var o=0;o<n.length;o++)s[o]=n[o]*i;return s},a.minusOp=function(n,i){var s=[];for(var o=0;o<n.length;o++)s[o]=n[o]-i[o];return s},a.dotProduct=function(n,i){var s=0;for(var o=0;o<n.length;o++)s+=n[o]*i[o];return s},a.mag=function(n){return Math.sqrt(this.dotProduct(n,n))},a.normalize=function(n){var i=[],s=this.mag(n);for(var o=0;o<n.length;o++)i[o]=n[o]/s;return i},a.multGamma=function(n){var i=[],s=0;for(var o=0;o<n.length;o++)s+=n[o];s*=-1/n.length;for(var l=0;l<n.length;l++)i[l]=s+n[l];return i},a.multL=function(n,i,s){var o=[],l=[],u=[];for(var f=0;f<i[0].length;f++){var v=0;for(var h=0;h<i.length;h++)v+=-0.5*i[h][f]*n[h];l[f]=v}for(var c=0;c<s.length;c++){var d=0;for(var g=0;g<s.length;g++)d+=s[c][g]*l[g];u[c]=d}for(var y=0;y<i.length;y++){var p=0;for(var m=0;m<i[0].length;m++)p+=i[y][m]*u[m];o[y]=p}return o},t.exports=a},function(t,e,r){var a=function(){function o(l,u){for(var f=0;f<u.length;f++){var v=u[f];if(v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v)v.writable=!0;Object.defineProperty(l,v.key,v)}}return function(l,u,f){if(u)o(l.prototype,u);if(f)o(l,f);return l}}();function n(o,l){if(!(o instanceof l))throw TypeError("Cannot call a class as a function")}var i=r(11),s=function(){function o(l,u){if(n(this,o),u!==null||u!==void 0)this.compareFunction=this._defaultCompareFunction;var f=void 0;if(l instanceof i)f=l.size();else f=l.length;this._quicksort(l,0,f-1)}return a(o,[{key:"_quicksort",value:function(u,f,v){if(f<v){var h=this._partition(u,f,v);this._quicksort(u,f,h),this._quicksort(u,h+1,v)}}},{key:"_partition",value:function(u,f,v){var h=this._get(u,f),c=f,d=v;while(!0){while(this.compareFunction(h,this._get(u,d)))d--;while(this.compareFunction(this._get(u,c),h))c++;if(c<d)this._swap(u,c,d),c++,d--;else return d}}},{key:"_get",value:function(u,f){if(u instanceof i)return u.get_object_at(f);else return u[f]}},{key:"_set",value:function(u,f,v){if(u instanceof i)u.set_object_at(f,v);else u[f]=v}},{key:"_swap",value:function(u,f,v){var h=this._get(u,f);this._set(u,f,this._get(u,v)),this._set(u,v,h)}},{key:"_defaultCompareFunction",value:function(u,f){return f>u}}]),o}();t.exports=s},function(t,e,r){function a(){}a.svd=function(n){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=n.length,this.n=n[0].length;var i=Math.min(this.m,this.n);this.s=function(He){var Le=[];while(He-- >0)Le.push(0);return Le}(Math.min(this.m+1,this.n)),this.U=function(He){var Le=function nt(Ye){if(Ye.length==0)return 0;else{var tt=[];for(var dt=0;dt<Ye[0];dt++)tt.push(nt(Ye.slice(1)));return tt}};return Le(He)}([this.m,i]),this.V=function(He){var Le=function nt(Ye){if(Ye.length==0)return 0;else{var tt=[];for(var dt=0;dt<Ye[0];dt++)tt.push(nt(Ye.slice(1)));return tt}};return Le(He)}([this.n,this.n]);var s=function(He){var Le=[];while(He-- >0)Le.push(0);return Le}(this.n),o=function(He){var Le=[];while(He-- >0)Le.push(0);return Le}(this.m),l=!0,u=!0,f=Math.min(this.m-1,this.n),v=Math.max(0,Math.min(this.n-2,this.m));for(var h=0;h<Math.max(f,v);h++){if(h<f){this.s[h]=0;for(var c=h;c<this.m;c++)this.s[h]=a.hypot(this.s[h],n[c][h]);if(this.s[h]!==0){if(n[h][h]<0)this.s[h]=-this.s[h];for(var d=h;d<this.m;d++)n[d][h]/=this.s[h];n[h][h]+=1}this.s[h]=-this.s[h]}for(var g=h+1;g<this.n;g++){if(function(He,Le){return He&&Le}(h<f,this.s[h]!==0)){var y=0;for(var p=h;p<this.m;p++)y+=n[p][h]*n[p][g];y=-y/n[h][h];for(var m=h;m<this.m;m++)n[m][g]+=y*n[m][h]}s[g]=n[h][g]}if(function(He,Le){return He&&Le}(l,h<f))for(var b=h;b<this.m;b++)this.U[b][h]=n[b][h];if(h<v){s[h]=0;for(var E=h+1;E<this.n;E++)s[h]=a.hypot(s[h],s[E]);if(s[h]!==0){if(s[h+1]<0)s[h]=-s[h];for(var A=h+1;A<this.n;A++)s[A]/=s[h];s[h+1]+=1}if(s[h]=-s[h],function(He,Le){return He&&Le}(h+1<this.m,s[h]!==0)){for(var M=h+1;M<this.m;M++)o[M]=0;for(var S=h+1;S<this.n;S++)for(var P=h+1;P<this.m;P++)o[P]+=s[S]*n[P][S];for(var N=h+1;N<this.n;N++){var R=-s[N]/s[h+1];for(var I=h+1;I<this.m;I++)n[I][N]+=R*o[I]}}if(u)for(var w=h+1;w<this.n;w++)this.V[w][h]=s[w]}}var x=Math.min(this.n,this.m+1);if(f<this.n)this.s[f]=n[f][f];if(this.m<x)this.s[x-1]=0;if(v+1<x)s[v]=n[v][x-1];if(s[x-1]=0,l){for(var T=f;T<i;T++){for(var D=0;D<this.m;D++)this.U[D][T]=0;this.U[T][T]=1}for(var C=f-1;C>=0;C--)if(this.s[C]!==0){for(var O=C+1;O<i;O++){var B=0;for(var z=C;z<this.m;z++)B+=this.U[z][C]*this.U[z][O];B=-B/this.U[C][C];for(var V=C;V<this.m;V++)this.U[V][O]+=B*this.U[V][C]}for(var k=C;k<this.m;k++)this.U[k][C]=-this.U[k][C];this.U[C][C]=1+this.U[C][C];for(var G=0;G<C-1;G++)this.U[G][C]=0}else{for(var J=0;J<this.m;J++)this.U[J][C]=0;this.U[C][C]=1}}if(u)for(var X=this.n-1;X>=0;X--){if(function(He,Le){return He&&Le}(X<v,s[X]!==0))for(var _=X+1;_<i;_++){var Q=0;for(var q=X+1;q<this.n;q++)Q+=this.V[q][X]*this.V[q][_];Q=-Q/this.V[X+1][X];for(var te=X+1;te<this.n;te++)this.V[te][_]+=Q*this.V[te][X]}for(var Z=0;Z<this.n;Z++)this.V[Z][X]=0;this.V[X][X]=1}var U=x-1,W=0,j=Math.pow(2,-52),re=Math.pow(2,-966);while(x>0){var ee=void 0,de=void 0;for(ee=x-2;ee>=-1;ee--){if(ee===-1)break;if(Math.abs(s[ee])<=re+j*(Math.abs(this.s[ee])+Math.abs(this.s[ee+1]))){s[ee]=0;break}}if(ee===x-2)de=4;else{var Ae=void 0;for(Ae=x-1;Ae>=ee;Ae--){if(Ae===ee)break;var Ce=(Ae!==x?Math.abs(s[Ae]):0)+(Ae!==ee+1?Math.abs(s[Ae-1]):0);if(Math.abs(this.s[Ae])<=re+j*Ce){this.s[Ae]=0;break}}if(Ae===ee)de=3;else if(Ae===x-1)de=1;else de=2,ee=Ae}switch(ee++,de){case 1:{var Se=s[x-2];s[x-2]=0;for(var ge=x-2;ge>=ee;ge--){var ve=a.hypot(this.s[ge],Se),ye=this.s[ge]/ve,Ee=Se/ve;if(this.s[ge]=ve,ge!==ee)Se=-Ee*s[ge-1],s[ge-1]=ye*s[ge-1];if(u)for(var Pe=0;Pe<this.n;Pe++)ve=ye*this.V[Pe][ge]+Ee*this.V[Pe][x-1],this.V[Pe][x-1]=-Ee*this.V[Pe][ge]+ye*this.V[Pe][x-1],this.V[Pe][ge]=ve}}break;case 2:{var Me=s[ee-1];s[ee-1]=0;for(var Ne=ee;Ne<x;Ne++){var Fe=a.hypot(this.s[Ne],Me),ze=this.s[Ne]/Fe,Ue=Me/Fe;if(this.s[Ne]=Fe,Me=-Ue*s[Ne],s[Ne]=ze*s[Ne],l)for(var ie=0;ie<this.m;ie++)Fe=ze*this.U[ie][Ne]+Ue*this.U[ie][ee-1],this.U[ie][ee-1]=-Ue*this.U[ie][Ne]+ze*this.U[ie][ee-1],this.U[ie][Ne]=Fe}}break;case 3:{var L=Math.max(Math.max(Math.max(Math.max(Math.abs(this.s[x-1]),Math.abs(this.s[x-2])),Math.abs(s[x-2])),Math.abs(this.s[ee])),Math.abs(s[ee])),F=this.s[x-1]/L,Y=this.s[x-2]/L,H=s[x-2]/L,K=this.s[ee]/L,se=s[ee]/L,ae=((Y+F)*(Y-F)+H*H)/2,oe=F*H*(F*H),ne=0;if(function(He,Le){return He||Le}(ae!==0,oe!==0)){if(ne=Math.sqrt(ae*ae+oe),ae<0)ne=-ne;ne=oe/(ae+ne)}var ue=(K+F)*(K-F)+ne,be=K*se;for(var fe=ee;fe<x-1;fe++){var le=a.hypot(ue,be),De=ue/le,ce=be/le;if(fe!==ee)s[fe-1]=le;if(ue=De*this.s[fe]+ce*s[fe],s[fe]=De*s[fe]-ce*this.s[fe],be=ce*this.s[fe+1],this.s[fe+1]=De*this.s[fe+1],u)for(var pe=0;pe<this.n;pe++)le=De*this.V[pe][fe]+ce*this.V[pe][fe+1],this.V[pe][fe+1]=-ce*this.V[pe][fe]+De*this.V[pe][fe+1],this.V[pe][fe]=le;if(le=a.hypot(ue,be),De=ue/le,ce=be/le,this.s[fe]=le,ue=De*s[fe]+ce*this.s[fe+1],this.s[fe+1]=-ce*s[fe]+De*this.s[fe+1],be=ce*s[fe+1],s[fe+1]=De*s[fe+1],l&&fe<this.m-1)for(var Ie=0;Ie<this.m;Ie++)le=De*this.U[Ie][fe]+ce*this.U[Ie][fe+1],this.U[Ie][fe+1]=-ce*this.U[Ie][fe]+De*this.U[Ie][fe+1],this.U[Ie][fe]=le}s[x-2]=ue,W=W+1}break;case 4:{if(this.s[ee]<=0){if(this.s[ee]=this.s[ee]<0?-this.s[ee]:0,u)for(var xe=0;xe<=U;xe++)this.V[xe][ee]=-this.V[xe][ee]}while(ee<U){if(this.s[ee]>=this.s[ee+1])break;var me=this.s[ee];if(this.s[ee]=this.s[ee+1],this.s[ee+1]=me,u&&ee<this.n-1)for(var Ve=0;Ve<this.n;Ve++)me=this.V[Ve][ee+1],this.V[Ve][ee+1]=this.V[Ve][ee],this.V[Ve][ee]=me;if(l&&ee<this.m-1)for(var Be=0;Be<this.m;Be++)me=this.U[Be][ee+1],this.U[Be][ee+1]=this.U[Be][ee],this.U[Be][ee]=me;ee++}W=0,x--}break}}var Ke={U:this.U,V:this.V,S:this.s};return Ke},a.hypot=function(n,i){var s=void 0;if(Math.abs(n)>Math.abs(i))s=i/n,s=Math.abs(n)*Math.sqrt(1+s*s);else if(i!=0)s=n/i,s=Math.abs(i)*Math.sqrt(1+s*s);else s=0;return s},t.exports=a},function(t,e,r){var a=function(){function s(o,l){for(var u=0;u<l.length;u++){var f=l[u];if(f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f)f.writable=!0;Object.defineProperty(o,f.key,f)}}return function(o,l,u){if(l)s(o.prototype,l);if(u)s(o,u);return o}}();function n(s,o){if(!(s instanceof o))throw TypeError("Cannot call a class as a function")}var i=function(){function s(o,l){var u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,f=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,v=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;n(this,s),this.sequence1=o,this.sequence2=l,this.match_score=u,this.mismatch_penalty=f,this.gap_penalty=v,this.iMax=o.length+1,this.jMax=l.length+1,this.grid=Array(this.iMax);for(var h=0;h<this.iMax;h++){this.grid[h]=Array(this.jMax);for(var c=0;c<this.jMax;c++)this.grid[h][c]=0}this.tracebackGrid=Array(this.iMax);for(var d=0;d<this.iMax;d++){this.tracebackGrid[d]=Array(this.jMax);for(var g=0;g<this.jMax;g++)this.tracebackGrid[d][g]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return a(s,[{key:"getScore",value:function(){return this.score}},{key:"getAlignments",value:function(){return this.alignments}},{key:"computeGrids",value:function(){for(var l=1;l<this.jMax;l++)this.grid[0][l]=this.grid[0][l-1]+this.gap_penalty,this.tracebackGrid[0][l]=[!1,!1,!0];for(var u=1;u<this.iMax;u++)this.grid[u][0]=this.grid[u-1][0]+this.gap_penalty,this.tracebackGrid[u][0]=[!1,!0,!1];for(var f=1;f<this.iMax;f++)for(var v=1;v<this.jMax;v++){var h=void 0;if(this.sequence1[f-1]===this.sequence2[v-1])h=this.grid[f-1][v-1]+this.match_score;else h=this.grid[f-1][v-1]+this.mismatch_penalty;var c=this.grid[f-1][v]+this.gap_penalty,d=this.grid[f][v-1]+this.gap_penalty,g=[h,c,d],y=this.arrayAllMaxIndexes(g);this.grid[f][v]=g[y[0]],this.tracebackGrid[f][v]=[y.includes(0),y.includes(1),y.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]}},{key:"alignmentTraceback",value:function(){var l=[];l.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});while(l[0]){var u=l[0],f=this.tracebackGrid[u.pos[0]][u.pos[1]];if(f[0])l.push({pos:[u.pos[0]-1,u.pos[1]-1],seq1:this.sequence1[u.pos[0]-1]+u.seq1,seq2:this.sequence2[u.pos[1]-1]+u.seq2});if(f[1])l.push({pos:[u.pos[0]-1,u.pos[1]],seq1:this.sequence1[u.pos[0]-1]+u.seq1,seq2:"-"+u.seq2});if(f[2])l.push({pos:[u.pos[0],u.pos[1]-1],seq1:"-"+u.seq1,seq2:this.sequence2[u.pos[1]-1]+u.seq2});if(u.pos[0]===0&&u.pos[1]===0)this.alignments.push({sequence1:u.seq1,sequence2:u.seq2});l.shift()}return this.alignments}},{key:"getAllIndexes",value:function(l,u){var f=[],v=-1;while((v=l.indexOf(u,v+1))!==-1)f.push(v);return f}},{key:"arrayAllMaxIndexes",value:function(l){return this.getAllIndexes(l,Math.max.apply(null,l))}}]),s}();t.exports=i},function(t,e,r){var a=function(){return};a.FDLayout=r(18),a.FDLayoutConstants=r(4),a.FDLayoutEdge=r(19),a.FDLayoutNode=r(20),a.DimensionD=r(21),a.HashMap=r(22),a.HashSet=r(23),a.IGeometry=r(8),a.IMath=r(9),a.Integer=r(10),a.Point=r(12),a.PointD=r(5),a.RandomSeed=r(16),a.RectangleD=r(13),a.Transform=r(17),a.UniqueIDGeneretor=r(14),a.Quicksort=r(25),a.LinkedList=r(11),a.LGraphObject=r(2),a.LGraph=r(6),a.LEdge=r(1),a.LGraphManager=r(7),a.LNode=r(3),a.Layout=r(15),a.LayoutConstants=r(0),a.NeedlemanWunsch=r(27),a.Matrix=r(24),a.SVD=r(26),t.exports=a},function(t,e,r){function a(){this.listeners=[]}var n=a.prototype;n.addListener=function(i,s){this.listeners.push({event:i,callback:s})},n.removeListener=function(i,s){for(var o=this.listeners.length;o>=0;o--){var l=this.listeners[o];if(l.event===i&&l.callback===s)this.listeners.splice(o,1)}},n.emit=function(i,s){for(var o=0;o<this.listeners.length;o++){var l=this.listeners[o];if(i===l.event)l.callback(s)}},t.exports=a}])})});var gr=Te(function(un,zo){(function(e,r){if(typeof un==="object"&&typeof zo==="object")zo.exports=r(Fo());else if(typeof define==="function"&&define.amd)define(["layout-base"],r);else if(typeof un==="object")un.coseBase=r(Fo());else e.coseBase=r(e.layoutBase)})(un,function(t){return(()=>{var e={45:(i,s,o)=>{var l={};l.layoutBase=o(551),l.CoSEConstants=o(806),l.CoSEEdge=o(767),l.CoSEGraph=o(880),l.CoSEGraphManager=o(578),l.CoSELayout=o(765),l.CoSENode=o(991),l.ConstraintHandler=o(902),i.exports=l},806:(i,s,o)=>{var l=o(551).FDLayoutConstants;function u(){}for(var f in l)u[f]=l[f];u.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,u.DEFAULT_RADIAL_SEPARATION=l.DEFAULT_EDGE_LENGTH,u.DEFAULT_COMPONENT_SEPERATION=60,u.TILE=!0,u.TILING_PADDING_VERTICAL=10,u.TILING_PADDING_HORIZONTAL=10,u.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,u.ENFORCE_CONSTRAINTS=!0,u.APPLY_LAYOUT=!0,u.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,u.TREE_REDUCTION_ON_INCREMENTAL=!0,u.PURE_INCREMENTAL=u.DEFAULT_INCREMENTAL,i.exports=u},767:(i,s,o)=>{var l=o(551).FDLayoutEdge;function u(v,h,c){l.call(this,v,h,c)}u.prototype=Object.create(l.prototype);for(var f in l)u[f]=l[f];i.exports=u},880:(i,s,o)=>{var l=o(551).LGraph;function u(v,h,c){l.call(this,v,h,c)}u.prototype=Object.create(l.prototype);for(var f in l)u[f]=l[f];i.exports=u},578:(i,s,o)=>{var l=o(551).LGraphManager;function u(v){l.call(this,v)}u.prototype=Object.create(l.prototype);for(var f in l)u[f]=l[f];i.exports=u},765:(i,s,o)=>{var l=o(551).FDLayout,u=o(578),f=o(880),v=o(991),h=o(767),c=o(806),d=o(902),g=o(551).FDLayoutConstants,y=o(551).LayoutConstants,p=o(551).Point,m=o(551).PointD,b=o(551).DimensionD,E=o(551).Layout,A=o(551).Integer,M=o(551).IGeometry,S=o(551).LGraph,P=o(551).Transform,N=o(551).LinkedList;function R(){l.call(this),this.toBeTiled={},this.constraints={}}R.prototype=Object.create(l.prototype);for(var I in l)R[I]=l[I];R.prototype.newGraphManager=function(){var w=new u(this);return this.graphManager=w,w},R.prototype.newGraph=function(w){return new f(null,this.graphManager,w)},R.prototype.newNode=function(w){return new v(this.graphManager,w)},R.prototype.newEdge=function(w){return new h(null,null,w)},R.prototype.initParameters=function(){if(l.prototype.initParameters.call(this,arguments),!this.isSubLayout){if(c.DEFAULT_EDGE_LENGTH<10)this.idealEdgeLength=10;else this.idealEdgeLength=c.DEFAULT_EDGE_LENGTH;this.useSmartIdealEdgeLengthCalculation=c.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=g.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=g.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=g.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=g.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1}},R.prototype.initSpringEmbedder=function(){l.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/g.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=0.04,this.coolingAdjuster=1},R.prototype.layout=function(){var w=y.DEFAULT_CREATE_BENDS_AS_NEEDED;if(w)this.createBendpoints(),this.graphManager.resetAllEdges();return this.level=0,this.classicLayout()},R.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){var w=this.getFlatForest();if(w.length>0)this.positionNodesRadially(w);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var x=new Set(this.getAllNodes()),T=this.nodesWithGravity.filter(function(D){return x.has(D)});this.graphManager.setAllNodesToApplyGravitation(T),this.positionNodesRandomly()}}else if(c.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var x=new Set(this.getAllNodes()),T=this.nodesWithGravity.filter(function(O){return x.has(O)});this.graphManager.setAllNodesToApplyGravitation(T)}if(Object.keys(this.constraints).length>0)d.handleConstraints(this),this.initConstraintVariables();if(this.initSpringEmbedder(),c.APPLY_LAYOUT)this.runSpringEmbedder();return!0},R.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%g.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.coolingCycle++,this.layoutQuality==0)this.coolingAdjuster=this.coolingCycle;else if(this.layoutQuality==1)this.coolingAdjuster=this.coolingCycle/3;this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var w=new Set(this.getAllNodes()),x=this.nodesWithGravity.filter(function(C){return w.has(C)});if(this.graphManager.setAllNodesToApplyGravitation(x),this.graphManager.updateBounds(),this.updateGrid(),c.PURE_INCREMENTAL)this.coolingFactor=g.DEFAULT_COOLING_FACTOR_INCREMENTAL/2;else this.coolingFactor=g.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;if(this.afterGrowthIterations%10==0)this.graphManager.updateBounds(),this.updateGrid();if(c.PURE_INCREMENTAL)this.coolingFactor=g.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100);else this.coolingFactor=g.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100);this.afterGrowthIterations++}var T=!this.isTreeGrowing&&!this.isGrowthFinished,D=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(T,D),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},R.prototype.getPositionsData=function(){var w=this.graphManager.getAllNodes(),x={};for(var T=0;T<w.length;T++){var D=w[T].rect,C=w[T].id;x[C]={id:C,x:D.getCenterX(),y:D.getCenterY(),w:D.width,h:D.height}}return x},R.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var w=!1;if(g.ANIMATE==="during")this.emit("layoutstarted");else{while(!w)w=this.tick();this.graphManager.updateBounds()}},R.prototype.moveNodes=function(){var w=this.getAllNodes(),x;for(var T=0;T<w.length;T++)x=w[T],x.calculateDisplacement();if(Object.keys(this.constraints).length>0)this.updateDisplacements();for(var T=0;T<w.length;T++)x=w[T],x.move()},R.prototype.initConstraintVariables=function(){var w=this;this.idToNodeMap=new Map,this.fixedNodeSet=new Set;var x=this.graphManager.getAllNodes();for(var T=0;T<x.length;T++){var D=x[T];this.idToNodeMap.set(D.id,D)}var C=function q(te){var Z=te.getChild().getNodes(),U,W=0;for(var j=0;j<Z.length;j++)if(U=Z[j],U.getChild()==null){if(w.fixedNodeSet.has(U.id))W+=100}else W+=q(U);return W};if(this.constraints.fixedNodeConstraint){this.constraints.fixedNodeConstraint.forEach(function(Z){w.fixedNodeSet.add(Z.nodeId)});var x=this.graphManager.getAllNodes(),D;for(var T=0;T<x.length;T++)if(D=x[T],D.getChild()!=null){var O=C(D);if(O>0)D.fixedNodeWeight=O}}if(this.constraints.relativePlacementConstraint){var B=new Map,z=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(q){w.fixedNodesOnHorizontal.add(q),w.fixedNodesOnVertical.add(q)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical){var V=this.constraints.alignmentConstraint.vertical;for(var T=0;T<V.length;T++)this.dummyToNodeForVerticalAlignment.set("dummy"+T,[]),V[T].forEach(function(te){if(B.set(te,"dummy"+T),w.dummyToNodeForVerticalAlignment.get("dummy"+T).push(te),w.fixedNodeSet.has(te))w.fixedNodesOnHorizontal.add("dummy"+T)})}if(this.constraints.alignmentConstraint.horizontal){var k=this.constraints.alignmentConstraint.horizontal;for(var T=0;T<k.length;T++)this.dummyToNodeForHorizontalAlignment.set("dummy"+T,[]),k[T].forEach(function(te){if(z.set(te,"dummy"+T),w.dummyToNodeForHorizontalAlignment.get("dummy"+T).push(te),w.fixedNodeSet.has(te))w.fixedNodesOnVertical.add("dummy"+T)})}}if(c.RELAX_MOVEMENT_ON_CONSTRAINTS)this.shuffle=function(q){var te,Z,U;for(U=q.length-1;U>=2*q.length/3;U--)te=Math.floor(Math.random()*(U+1)),Z=q[U],q[U]=q[te],q[te]=Z;return q},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(q){if(q.left){var te=B.has(q.left)?B.get(q.left):q.left,Z=B.has(q.right)?B.get(q.right):q.right;if(!w.nodesInRelativeHorizontal.includes(te))if(w.nodesInRelativeHorizontal.push(te),w.nodeToRelativeConstraintMapHorizontal.set(te,[]),w.dummyToNodeForVerticalAlignment.has(te))w.nodeToTempPositionMapHorizontal.set(te,w.idToNodeMap.get(w.dummyToNodeForVerticalAlignment.get(te)[0]).getCenterX());else w.nodeToTempPositionMapHorizontal.set(te,w.idToNodeMap.get(te).getCenterX());if(!w.nodesInRelativeHorizontal.includes(Z))if(w.nodesInRelativeHorizontal.push(Z),w.nodeToRelativeConstraintMapHorizontal.set(Z,[]),w.dummyToNodeForVerticalAlignment.has(Z))w.nodeToTempPositionMapHorizontal.set(Z,w.idToNodeMap.get(w.dummyToNodeForVerticalAlignment.get(Z)[0]).getCenterX());else w.nodeToTempPositionMapHorizontal.set(Z,w.idToNodeMap.get(Z).getCenterX());w.nodeToRelativeConstraintMapHorizontal.get(te).push({right:Z,gap:q.gap}),w.nodeToRelativeConstraintMapHorizontal.get(Z).push({left:te,gap:q.gap})}else{var U=z.has(q.top)?z.get(q.top):q.top,W=z.has(q.bottom)?z.get(q.bottom):q.bottom;if(!w.nodesInRelativeVertical.includes(U))if(w.nodesInRelativeVertical.push(U),w.nodeToRelativeConstraintMapVertical.set(U,[]),w.dummyToNodeForHorizontalAlignment.has(U))w.nodeToTempPositionMapVertical.set(U,w.idToNodeMap.get(w.dummyToNodeForHorizontalAlignment.get(U)[0]).getCenterY());else w.nodeToTempPositionMapVertical.set(U,w.idToNodeMap.get(U).getCenterY());if(!w.nodesInRelativeVertical.includes(W))if(w.nodesInRelativeVertical.push(W),w.nodeToRelativeConstraintMapVertical.set(W,[]),w.dummyToNodeForHorizontalAlignment.has(W))w.nodeToTempPositionMapVertical.set(W,w.idToNodeMap.get(w.dummyToNodeForHorizontalAlignment.get(W)[0]).getCenterY());else w.nodeToTempPositionMapVertical.set(W,w.idToNodeMap.get(W).getCenterY());w.nodeToRelativeConstraintMapVertical.get(U).push({bottom:W,gap:q.gap}),w.nodeToRelativeConstraintMapVertical.get(W).push({top:U,gap:q.gap})}});else{var G=new Map,J=new Map;this.constraints.relativePlacementConstraint.forEach(function(q){if(q.left){var te=B.has(q.left)?B.get(q.left):q.left,Z=B.has(q.right)?B.get(q.right):q.right;if(G.has(te))G.get(te).push(Z);else G.set(te,[Z]);if(G.has(Z))G.get(Z).push(te);else G.set(Z,[te])}else{var U=z.has(q.top)?z.get(q.top):q.top,W=z.has(q.bottom)?z.get(q.bottom):q.bottom;if(J.has(U))J.get(U).push(W);else J.set(U,[W]);if(J.has(W))J.get(W).push(U);else J.set(W,[U])}});var X=function(te,Z){var U=[],W=[],j=new N,re=new Set,ee=0;return te.forEach(function(de,Ae){if(!re.has(Ae)){U[ee]=[],W[ee]=!1;var Ce=Ae;j.push(Ce),re.add(Ce),U[ee].push(Ce);while(j.length!=0){if(Ce=j.shift(),Z.has(Ce))W[ee]=!0;var Se=te.get(Ce);Se.forEach(function(ge){if(!re.has(ge))j.push(ge),re.add(ge),U[ee].push(ge)})}ee++}}),{components:U,isFixed:W}},_=X(G,w.fixedNodesOnHorizontal);this.componentsOnHorizontal=_.components,this.fixedComponentsOnHorizontal=_.isFixed;var Q=X(J,w.fixedNodesOnVertical);this.componentsOnVertical=Q.components,this.fixedComponentsOnVertical=Q.isFixed}}},R.prototype.updateDisplacements=function(){var w=this;if(this.constraints.fixedNodeConstraint)this.constraints.fixedNodeConstraint.forEach(function(Q){var q=w.idToNodeMap.get(Q.nodeId);q.displacementX=0,q.displacementY=0});if(this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical){var x=this.constraints.alignmentConstraint.vertical;for(var T=0;T<x.length;T++){var D=0;for(var C=0;C<x[T].length;C++){if(this.fixedNodeSet.has(x[T][C])){D=0;break}D+=this.idToNodeMap.get(x[T][C]).displacementX}var O=D/x[T].length;for(var C=0;C<x[T].length;C++)this.idToNodeMap.get(x[T][C]).displacementX=O}}if(this.constraints.alignmentConstraint.horizontal){var B=this.constraints.alignmentConstraint.horizontal;for(var T=0;T<B.length;T++){var z=0;for(var C=0;C<B[T].length;C++){if(this.fixedNodeSet.has(B[T][C])){z=0;break}z+=this.idToNodeMap.get(B[T][C]).displacementY}var V=z/B[T].length;for(var C=0;C<B[T].length;C++)this.idToNodeMap.get(B[T][C]).displacementY=V}}}if(this.constraints.relativePlacementConstraint)if(c.RELAX_MOVEMENT_ON_CONSTRAINTS){if(this.totalIterations%10==0)this.shuffle(this.nodesInRelativeHorizontal),this.shuffle(this.nodesInRelativeVertical);this.nodesInRelativeHorizontal.forEach(function(Q){if(!w.fixedNodesOnHorizontal.has(Q)){var q=0;if(w.dummyToNodeForVerticalAlignment.has(Q))q=w.idToNodeMap.get(w.dummyToNodeForVerticalAlignment.get(Q)[0]).displacementX;else q=w.idToNodeMap.get(Q).displacementX;if(w.nodeToRelativeConstraintMapHorizontal.get(Q).forEach(function(te){if(te.right){var Z=w.nodeToTempPositionMapHorizontal.get(te.right)-w.nodeToTempPositionMapHorizontal.get(Q)-q;if(Z<te.gap)q-=te.gap-Z}else{var Z=w.nodeToTempPositionMapHorizontal.get(Q)-w.nodeToTempPositionMapHorizontal.get(te.left)+q;if(Z<te.gap)q+=te.gap-Z}}),w.nodeToTempPositionMapHorizontal.set(Q,w.nodeToTempPositionMapHorizontal.get(Q)+q),w.dummyToNodeForVerticalAlignment.has(Q))w.dummyToNodeForVerticalAlignment.get(Q).forEach(function(te){w.idToNodeMap.get(te).displacementX=q});else w.idToNodeMap.get(Q).displacementX=q}}),this.nodesInRelativeVertical.forEach(function(Q){if(!w.fixedNodesOnHorizontal.has(Q)){var q=0;if(w.dummyToNodeForHorizontalAlignment.has(Q))q=w.idToNodeMap.get(w.dummyToNodeForHorizontalAlignment.get(Q)[0]).displacementY;else q=w.idToNodeMap.get(Q).displacementY;if(w.nodeToRelativeConstraintMapVertical.get(Q).forEach(function(te){if(te.bottom){var Z=w.nodeToTempPositionMapVertical.get(te.bottom)-w.nodeToTempPositionMapVertical.get(Q)-q;if(Z<te.gap)q-=te.gap-Z}else{var Z=w.nodeToTempPositionMapVertical.get(Q)-w.nodeToTempPositionMapVertical.get(te.top)+q;if(Z<te.gap)q+=te.gap-Z}}),w.nodeToTempPositionMapVertical.set(Q,w.nodeToTempPositionMapVertical.get(Q)+q),w.dummyToNodeForHorizontalAlignment.has(Q))w.dummyToNodeForHorizontalAlignment.get(Q).forEach(function(te){w.idToNodeMap.get(te).displacementY=q});else w.idToNodeMap.get(Q).displacementY=q}})}else{for(var T=0;T<this.componentsOnHorizontal.length;T++){var k=this.componentsOnHorizontal[T];if(this.fixedComponentsOnHorizontal[T])for(var C=0;C<k.length;C++)if(this.dummyToNodeForVerticalAlignment.has(k[C]))this.dummyToNodeForVerticalAlignment.get(k[C]).forEach(function(te){w.idToNodeMap.get(te).displacementX=0});else this.idToNodeMap.get(k[C]).displacementX=0;else{var G=0,J=0;for(var C=0;C<k.length;C++)if(this.dummyToNodeForVerticalAlignment.has(k[C])){var X=this.dummyToNodeForVerticalAlignment.get(k[C]);G+=X.length*this.idToNodeMap.get(X[0]).displacementX,J+=X.length}else G+=this.idToNodeMap.get(k[C]).displacementX,J++;var _=G/J;for(var C=0;C<k.length;C++)if(this.dummyToNodeForVerticalAlignment.has(k[C]))this.dummyToNodeForVerticalAlignment.get(k[C]).forEach(function(te){w.idToNodeMap.get(te).displacementX=_});else this.idToNodeMap.get(k[C]).displacementX=_}}for(var T=0;T<this.componentsOnVertical.length;T++){var k=this.componentsOnVertical[T];if(this.fixedComponentsOnVertical[T])for(var C=0;C<k.length;C++)if(this.dummyToNodeForHorizontalAlignment.has(k[C]))this.dummyToNodeForHorizontalAlignment.get(k[C]).forEach(function(Z){w.idToNodeMap.get(Z).displacementY=0});else this.idToNodeMap.get(k[C]).displacementY=0;else{var G=0,J=0;for(var C=0;C<k.length;C++)if(this.dummyToNodeForHorizontalAlignment.has(k[C])){var X=this.dummyToNodeForHorizontalAlignment.get(k[C]);G+=X.length*this.idToNodeMap.get(X[0]).displacementY,J+=X.length}else G+=this.idToNodeMap.get(k[C]).displacementY,J++;var _=G/J;for(var C=0;C<k.length;C++)if(this.dummyToNodeForHorizontalAlignment.has(k[C]))this.dummyToNodeForHorizontalAlignment.get(k[C]).forEach(function(j){w.idToNodeMap.get(j).displacementY=_});else this.idToNodeMap.get(k[C]).displacementY=_}}}},R.prototype.calculateNodesToApplyGravitationTo=function(){var w=[],x,T=this.graphManager.getGraphs(),D=T.length,C;for(C=0;C<D;C++)if(x=T[C],x.updateConnected(),!x.isConnected)w=w.concat(x.getNodes());return w},R.prototype.createBendpoints=function(){var w=[];w=w.concat(this.graphManager.getAllEdges());var x=new Set,T;for(T=0;T<w.length;T++){var D=w[T];if(!x.has(D)){var C=D.getSource(),O=D.getTarget();if(C==O)D.getBendpoints().push(new m),D.getBendpoints().push(new m),this.createDummyNodesForBendpoints(D),x.add(D);else{var B=[];if(B=B.concat(C.getEdgeListToNode(O)),B=B.concat(O.getEdgeListToNode(C)),!x.has(B[0])){if(B.length>1){var z;for(z=0;z<B.length;z++){var V=B[z];V.getBendpoints().push(new m),this.createDummyNodesForBendpoints(V)}}B.forEach(function(k){x.add(k)})}}}if(x.size==w.length)break}},R.prototype.positionNodesRadially=function(w){var x=new p(0,0),T=Math.ceil(Math.sqrt(w.length)),D=0,C=0,O=0,B=new m(0,0);for(var z=0;z<w.length;z++){if(z%T==0){if(O=0,C=D,z!=0)C+=c.DEFAULT_COMPONENT_SEPERATION;D=0}var V=w[z],k=E.findCenterOfTree(V);if(x.x=O,x.y=C,B=R.radialLayout(V,k,x),B.y>D)D=Math.floor(B.y);O=Math.floor(B.x+c.DEFAULT_COMPONENT_SEPERATION)}this.transform(new m(y.WORLD_CENTER_X-B.x/2,y.WORLD_CENTER_Y-B.y/2))},R.radialLayout=function(w,x,T){var D=Math.max(this.maxDiagonalInTree(w),c.DEFAULT_RADIAL_SEPARATION);R.branchRadialLayout(x,null,0,359,0,D);var C=S.calculateBounds(w),O=new P;O.setDeviceOrgX(C.getMinX()),O.setDeviceOrgY(C.getMinY()),O.setWorldOrgX(T.x),O.setWorldOrgY(T.y);for(var B=0;B<w.length;B++){var z=w[B];z.transform(O)}var V=new m(C.getMaxX(),C.getMaxY());return O.inverseTransformPoint(V)},R.branchRadialLayout=function(w,x,T,D,C,O){var B=(D-T+1)/2;if(B<0)B+=180;var z=(B+T)%360,V=z*M.TWO_PI/360,k=Math.cos(V),G=C*Math.cos(V),J=C*Math.sin(V);w.setCenter(G,J);var X=[];X=X.concat(w.getEdges());var _=X.length;if(x!=null)_--;var Q=0,q=X.length,te,Z=w.getEdgesBetween(x);while(Z.length>1){var U=Z[0];Z.splice(0,1);var W=X.indexOf(U);if(W>=0)X.splice(W,1);q--,_--}if(x!=null)te=(X.indexOf(Z[0])+1)%q;else te=0;var j=Math.abs(D-T)/_;for(var re=te;Q!=_;re=++re%q){var ee=X[re].getOtherEnd(w);if(ee==x)continue;var de=(T+Q*j)%360,Ae=(de+j)%360;R.branchRadialLayout(ee,w,de,Ae,C+O,O),Q++}},R.maxDiagonalInTree=function(w){var x=A.MIN_VALUE;for(var T=0;T<w.length;T++){var D=w[T],C=D.getDiagonal();if(C>x)x=C}return x},R.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},R.prototype.groupZeroDegreeMembers=function(){var w=this,x={};this.memberGroups={},this.idToDummyNode={};var T=[],D=this.graphManager.getAllNodes();for(var C=0;C<D.length;C++){var O=D[C],B=O.getParent();if(this.getNodeDegreeWithChildren(O)===0&&(B.id==null||!this.getToBeTiled(B)))T.push(O)}for(var C=0;C<T.length;C++){var O=T[C],z=O.getParent().id;if(typeof x[z]>"u")x[z]=[];x[z]=x[z].concat(O)}Object.keys(x).forEach(function(V){if(x[V].length>1){var k="DummyCompound_"+V;w.memberGroups[k]=x[V];var G=x[V][0].getParent(),J=new v(w.graphManager);J.id=k,J.paddingLeft=G.paddingLeft||0,J.paddingRight=G.paddingRight||0,J.paddingBottom=G.paddingBottom||0,J.paddingTop=G.paddingTop||0,w.idToDummyNode[k]=J;var X=w.getGraphManager().add(w.newGraph(),J),_=G.getChild();_.add(J);for(var Q=0;Q<x[V].length;Q++){var q=x[V][Q];_.remove(q),X.add(q)}}})},R.prototype.clearCompounds=function(){var w={},x={};this.performDFSOnCompounds();for(var T=0;T<this.compoundOrder.length;T++)x[this.compoundOrder[T].id]=this.compoundOrder[T],w[this.compoundOrder[T].id]=[].concat(this.compoundOrder[T].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[T].getChild()),this.compoundOrder[T].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(w,x)},R.prototype.clearZeroDegreeMembers=function(){var w=this,x=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(T){var D=w.idToDummyNode[T];if(x[T]=w.tileNodes(w.memberGroups[T],D.paddingLeft+D.paddingRight),D.rect.width=x[T].width,D.rect.height=x[T].height,D.setCenter(x[T].centerX,x[T].centerY),D.labelMarginLeft=0,D.labelMarginTop=0,c.NODE_DIMENSIONS_INCLUDE_LABELS){var C=D.rect.width,O=D.rect.height;if(D.labelWidth){if(D.labelPosHorizontal=="left")D.rect.x-=D.labelWidth,D.setWidth(C+D.labelWidth),D.labelMarginLeft=D.labelWidth;else if(D.labelPosHorizontal=="center"&&D.labelWidth>C)D.rect.x-=(D.labelWidth-C)/2,D.setWidth(D.labelWidth),D.labelMarginLeft=(D.labelWidth-C)/2;else if(D.labelPosHorizontal=="right")D.setWidth(C+D.labelWidth)}if(D.labelHeight){if(D.labelPosVertical=="top")D.rect.y-=D.labelHeight,D.setHeight(O+D.labelHeight),D.labelMarginTop=D.labelHeight;else if(D.labelPosVertical=="center"&&D.labelHeight>O)D.rect.y-=(D.labelHeight-O)/2,D.setHeight(D.labelHeight),D.labelMarginTop=(D.labelHeight-O)/2;else if(D.labelPosVertical=="bottom")D.setHeight(O+D.labelHeight)}}})},R.prototype.repopulateCompounds=function(){for(var w=this.compoundOrder.length-1;w>=0;w--){var x=this.compoundOrder[w],{id:T,paddingLeft:D,paddingTop:C,labelMarginLeft:O,labelMarginTop:B}=x;this.adjustLocations(this.tiledMemberPack[T],x.rect.x,x.rect.y,D,C,O,B)}},R.prototype.repopulateZeroDegreeMembers=function(){var w=this,x=this.tiledZeroDegreePack;Object.keys(x).forEach(function(T){var D=w.idToDummyNode[T],{paddingLeft:C,paddingTop:O,labelMarginLeft:B,labelMarginTop:z}=D;w.adjustLocations(x[T],D.rect.x,D.rect.y,C,O,B,z)})},R.prototype.getToBeTiled=function(w){var x=w.id;if(this.toBeTiled[x]!=null)return this.toBeTiled[x];var T=w.getChild();if(T==null)return this.toBeTiled[x]=!1,!1;var D=T.getNodes();for(var C=0;C<D.length;C++){var O=D[C];if(this.getNodeDegree(O)>0)return this.toBeTiled[x]=!1,!1;if(O.getChild()==null){this.toBeTiled[O.id]=!1;continue}if(!this.getToBeTiled(O))return this.toBeTiled[x]=!1,!1}return this.toBeTiled[x]=!0,!0},R.prototype.getNodeDegree=function(w){var x=w.id,T=w.getEdges(),D=0;for(var C=0;C<T.length;C++){var O=T[C];if(O.getSource().id!==O.getTarget().id)D=D+1}return D},R.prototype.getNodeDegreeWithChildren=function(w){var x=this.getNodeDegree(w);if(w.getChild()==null)return x;var T=w.getChild().getNodes();for(var D=0;D<T.length;D++){var C=T[D];x+=this.getNodeDegreeWithChildren(C)}return x},R.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},R.prototype.fillCompexOrderByDFS=function(w){for(var x=0;x<w.length;x++){var T=w[x];if(T.getChild()!=null)this.fillCompexOrderByDFS(T.getChild().getNodes());if(this.getToBeTiled(T))this.compoundOrder.push(T)}},R.prototype.adjustLocations=function(w,x,T,D,C,O,B){x+=D+O,T+=C+B;var z=x;for(var V=0;V<w.rows.length;V++){var k=w.rows[V];x=z;var G=0;for(var J=0;J<k.length;J++){var X=k[J];if(X.rect.x=x,X.rect.y=T,x+=X.rect.width+w.horizontalPadding,X.rect.height>G)G=X.rect.height}T+=G+w.verticalPadding}},R.prototype.tileCompoundMembers=function(w,x){var T=this;this.tiledMemberPack=[],Object.keys(w).forEach(function(D){var C=x[D];if(T.tiledMemberPack[D]=T.tileNodes(w[D],C.paddingLeft+C.paddingRight),C.rect.width=T.tiledMemberPack[D].width,C.rect.height=T.tiledMemberPack[D].height,C.setCenter(T.tiledMemberPack[D].centerX,T.tiledMemberPack[D].centerY),C.labelMarginLeft=0,C.labelMarginTop=0,c.NODE_DIMENSIONS_INCLUDE_LABELS){var O=C.rect.width,B=C.rect.height;if(C.labelWidth){if(C.labelPosHorizontal=="left")C.rect.x-=C.labelWidth,C.setWidth(O+C.labelWidth),C.labelMarginLeft=C.labelWidth;else if(C.labelPosHorizontal=="center"&&C.labelWidth>O)C.rect.x-=(C.labelWidth-O)/2,C.setWidth(C.labelWidth),C.labelMarginLeft=(C.labelWidth-O)/2;else if(C.labelPosHorizontal=="right")C.setWidth(O+C.labelWidth)}if(C.labelHeight){if(C.labelPosVertical=="top")C.rect.y-=C.labelHeight,C.setHeight(B+C.labelHeight),C.labelMarginTop=C.labelHeight;else if(C.labelPosVertical=="center"&&C.labelHeight>B)C.rect.y-=(C.labelHeight-B)/2,C.setHeight(C.labelHeight),C.labelMarginTop=(C.labelHeight-B)/2;else if(C.labelPosVertical=="bottom")C.setHeight(B+C.labelHeight)}}})},R.prototype.tileNodes=function(w,x){var T=this.tileNodesByFavoringDim(w,x,!0),D=this.tileNodesByFavoringDim(w,x,!1),C=this.getOrgRatio(T),O=this.getOrgRatio(D),B;if(O<C)B=D;else B=T;return B},R.prototype.getOrgRatio=function(w){var{width:x,height:T}=w,D=x/T;if(D<1)D=1/D;return D},R.prototype.calcIdealRowWidth=function(w,x){var{TILING_PADDING_VERTICAL:T,TILING_PADDING_HORIZONTAL:D}=c,C=w.length,O=0,B=0,z=0;w.forEach(function(Q){if(O+=Q.getWidth(),B+=Q.getHeight(),Q.getWidth()>z)z=Q.getWidth()});var V=O/C,k=B/C,G=Math.pow(T-D,2)+4*(V+D)*(k+T)*C,J=(D-T+Math.sqrt(G))/(2*(V+D)),X;if(x){if(X=Math.ceil(J),X==J)X++}else X=Math.floor(J);var _=X*(V+D)-D;if(z>_)_=z;return _+=D*2,_},R.prototype.tileNodesByFavoringDim=function(w,x,T){var{TILING_PADDING_VERTICAL:D,TILING_PADDING_HORIZONTAL:C,TILING_COMPARE_BY:O}=c,B={rows:[],rowWidth:[],rowHeight:[],width:0,height:x,verticalPadding:D,horizontalPadding:C,centerX:0,centerY:0};if(O)B.idealRowWidth=this.calcIdealRowWidth(w,T);var z=function(q){return q.rect.width*q.rect.height},V=function(q,te){return z(te)-z(q)};w.sort(function(Q,q){var te=V;if(B.idealRowWidth)return te=O,te(Q.id,q.id);return te(Q,q)});var k=0,G=0;for(var J=0;J<w.length;J++){var X=w[J];k+=X.getCenterX(),G+=X.getCenterY()}B.centerX=k/w.length,B.centerY=G/w.length;for(var J=0;J<w.length;J++){var X=w[J];if(B.rows.length==0)this.insertNodeToRow(B,X,0,x);else if(this.canAddHorizontal(B,X.rect.width,X.rect.height)){var _=B.rows.length-1;if(!B.idealRowWidth)_=this.getShortestRowIndex(B);this.insertNodeToRow(B,X,_,x)}else this.insertNodeToRow(B,X,B.rows.length,x);this.shiftToLastRow(B)}return B},R.prototype.insertNodeToRow=function(w,x,T,D){var C=D;if(T==w.rows.length){var O=[];w.rows.push(O),w.rowWidth.push(C),w.rowHeight.push(0)}var B=w.rowWidth[T]+x.rect.width;if(w.rows[T].length>0)B+=w.horizontalPadding;if(w.rowWidth[T]=B,w.width<B)w.width=B;var z=x.rect.height;if(T>0)z+=w.verticalPadding;var V=0;if(z>w.rowHeight[T])V=w.rowHeight[T],w.rowHeight[T]=z,V=w.rowHeight[T]-V;w.height+=V,w.rows[T].push(x)},R.prototype.getShortestRowIndex=function(w){var x=-1,T=Number.MAX_VALUE;for(var D=0;D<w.rows.length;D++)if(w.rowWidth[D]<T)x=D,T=w.rowWidth[D];return x},R.prototype.getLongestRowIndex=function(w){var x=-1,T=Number.MIN_VALUE;for(var D=0;D<w.rows.length;D++)if(w.rowWidth[D]>T)x=D,T=w.rowWidth[D];return x},R.prototype.canAddHorizontal=function(w,x,T){if(w.idealRowWidth){var D=w.rows.length-1,C=w.rowWidth[D];return C+x+w.horizontalPadding<=w.idealRowWidth}var O=this.getShortestRowIndex(w);if(O<0)return!0;var B=w.rowWidth[O];if(B+w.horizontalPadding+x<=w.width)return!0;var z=0;if(w.rowHeight[O]<T){if(O>0)z=T+w.verticalPadding-w.rowHeight[O]}var V;if(w.width-B>=x+w.horizontalPadding)V=(w.height+z)/(B+x+w.horizontalPadding);else V=(w.height+z)/w.width;z=T+w.verticalPadding;var k;if(w.width<x)k=(w.height+z)/x;else k=(w.height+z)/w.width;if(k<1)k=1/k;if(V<1)V=1/V;return V<k},R.prototype.shiftToLastRow=function(w){var x=this.getLongestRowIndex(w),T=w.rowWidth.length-1,D=w.rows[x],C=D[D.length-1],O=C.width+w.horizontalPadding;if(w.width-w.rowWidth[T]>O&&x!=T){D.splice(-1,1),w.rows[T].push(C),w.rowWidth[x]=w.rowWidth[x]-O,w.rowWidth[T]=w.rowWidth[T]+O,w.width=w.rowWidth[instance.getLongestRowIndex(w)];var B=Number.MIN_VALUE;for(var z=0;z<D.length;z++)if(D[z].height>B)B=D[z].height;if(x>0)B+=w.verticalPadding;var V=w.rowHeight[x]+w.rowHeight[T];if(w.rowHeight[x]=B,w.rowHeight[T]<C.height+w.verticalPadding)w.rowHeight[T]=C.height+w.verticalPadding;var k=w.rowHeight[x]+w.rowHeight[T];w.height+=k-V,this.shiftToLastRow(w)}},R.prototype.tilingPreLayout=function(){if(c.TILE)this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers()},R.prototype.tilingPostLayout=function(){if(c.TILE)this.repopulateZeroDegreeMembers(),this.repopulateCompounds()},R.prototype.reduceTrees=function(){var w=[],x=!0,T;while(x){var D=this.graphManager.getAllNodes(),C=[];x=!1;for(var O=0;O<D.length;O++)if(T=D[O],T.getEdges().length==1&&!T.getEdges()[0].isInterGraph&&T.getChild()==null){if(c.PURE_INCREMENTAL){var B=T.getEdges()[0].getOtherEnd(T),z=new b(T.getCenterX()-B.getCenterX(),T.getCenterY()-B.getCenterY());C.push([T,T.getEdges()[0],T.getOwner(),z])}else C.push([T,T.getEdges()[0],T.getOwner()]);x=!0}if(x==!0){var V=[];for(var k=0;k<C.length;k++)if(C[k][0].getEdges().length==1)V.push(C[k]),C[k][0].getOwner().remove(C[k][0]);w.push(V),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=w},R.prototype.growTree=function(w){var x=w.length,T=w[x-1],D;for(var C=0;C<T.length;C++)D=T[C],this.findPlaceforPrunedNode(D),D[2].add(D[0]),D[2].add(D[1],D[1].source,D[1].target);w.splice(w.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},R.prototype.findPlaceforPrunedNode=function(w){var x,T,D=w[0];if(D==w[1].source)T=w[1].target;else T=w[1].source;if(c.PURE_INCREMENTAL)D.setCenter(T.getCenterX()+w[3].getWidth(),T.getCenterY()+w[3].getHeight());else{var C=T.startX,O=T.finishX,B=T.startY,z=T.finishY,V=0,k=0,G=0,J=0,X=[V,G,k,J];if(B>0)for(var _=C;_<=O;_++)X[0]+=this.grid[_][B-1].length+this.grid[_][B].length-1;if(O<this.grid.length-1)for(var _=B;_<=z;_++)X[1]+=this.grid[O+1][_].length+this.grid[O][_].length-1;if(z<this.grid[0].length-1)for(var _=C;_<=O;_++)X[2]+=this.grid[_][z+1].length+this.grid[_][z].length-1;if(C>0)for(var _=B;_<=z;_++)X[3]+=this.grid[C-1][_].length+this.grid[C][_].length-1;var Q=A.MAX_VALUE,q,te;for(var Z=0;Z<X.length;Z++)if(X[Z]<Q)Q=X[Z],q=1,te=Z;else if(X[Z]==Q)q++;if(q==3&&Q==0){if(X[0]==0&&X[1]==0&&X[2]==0)x=1;else if(X[0]==0&&X[1]==0&&X[3]==0)x=0;else if(X[0]==0&&X[2]==0&&X[3]==0)x=3;else if(X[1]==0&&X[2]==0&&X[3]==0)x=2}else if(q==2&&Q==0){var U=Math.floor(Math.random()*2);if(X[0]==0&&X[1]==0)if(U==0)x=0;else x=1;else if(X[0]==0&&X[2]==0)if(U==0)x=0;else x=2;else if(X[0]==0&&X[3]==0)if(U==0)x=0;else x=3;else if(X[1]==0&&X[2]==0)if(U==0)x=1;else x=2;else if(X[1]==0&&X[3]==0)if(U==0)x=1;else x=3;else if(U==0)x=2;else x=3}else if(q==4&&Q==0){var U=Math.floor(Math.random()*4);x=U}else x=te;if(x==0)D.setCenter(T.getCenterX(),T.getCenterY()-T.getHeight()/2-g.DEFAULT_EDGE_LENGTH-D.getHeight()/2);else if(x==1)D.setCenter(T.getCenterX()+T.getWidth()/2+g.DEFAULT_EDGE_LENGTH+D.getWidth()/2,T.getCenterY());else if(x==2)D.setCenter(T.getCenterX(),T.getCenterY()+T.getHeight()/2+g.DEFAULT_EDGE_LENGTH+D.getHeight()/2);else D.setCenter(T.getCenterX()-T.getWidth()/2-g.DEFAULT_EDGE_LENGTH-D.getWidth()/2,T.getCenterY())}},i.exports=R},991:(i,s,o)=>{var l=o(551).FDLayoutNode,u=o(551).IMath;function f(h,c,d,g){l.call(this,h,c,d,g)}f.prototype=Object.create(l.prototype);for(var v in l)f[v]=l[v];f.prototype.calculateDisplacement=function(){var h=this.graphManager.getLayout();if(this.getChild()!=null&&this.fixedNodeWeight)this.displacementX+=h.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=h.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight;else this.displacementX+=h.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=h.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren;if(Math.abs(this.displacementX)>h.coolingFactor*h.maxNodeDisplacement)this.displacementX=h.coolingFactor*h.maxNodeDisplacement*u.sign(this.displacementX);if(Math.abs(this.displacementY)>h.coolingFactor*h.maxNodeDisplacement)this.displacementY=h.coolingFactor*h.maxNodeDisplacement*u.sign(this.displacementY);if(this.child&&this.child.getNodes().length>0)this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},f.prototype.propogateDisplacementToChildren=function(h,c){var d=this.getChild().getNodes(),g;for(var y=0;y<d.length;y++)if(g=d[y],g.getChild()==null)g.displacementX+=h,g.displacementY+=c;else g.propogateDisplacementToChildren(h,c)},f.prototype.move=function(){var h=this.graphManager.getLayout();if(this.child==null||this.child.getNodes().length==0)this.moveBy(this.displacementX,this.displacementY),h.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},f.prototype.setPred1=function(h){this.pred1=h},f.prototype.getPred1=function(){return pred1},f.prototype.getPred2=function(){return pred2},f.prototype.setNext=function(h){this.next=h},f.prototype.getNext=function(){return next},f.prototype.setProcessed=function(h){this.processed=h},f.prototype.isProcessed=function(){return processed},i.exports=f},902:(i,s,o)=>{function l(d){if(Array.isArray(d)){for(var g=0,y=Array(d.length);g<d.length;g++)y[g]=d[g];return y}else return Array.from(d)}var u=o(806),f=o(551).LinkedList,v=o(551).Matrix,h=o(551).SVD;function c(){}c.handleConstraints=function(d){var g={};g.fixedNodeConstraint=d.constraints.fixedNodeConstraint,g.alignmentConstraint=d.constraints.alignmentConstraint,g.relativePlacementConstraint=d.constraints.relativePlacementConstraint;var y=new Map,p=new Map,m=[],b=[],E=d.getAllNodes(),A=0;for(var M=0;M<E.length;M++){var S=E[M];if(S.getChild()==null)p.set(S.id,A++),m.push(S.getCenterX()),b.push(S.getCenterY()),y.set(S.id,S)}if(g.relativePlacementConstraint)g.relativePlacementConstraint.forEach(function(L){if(!L.gap&&L.gap!=0)if(L.left)L.gap=u.DEFAULT_EDGE_LENGTH+y.get(L.left).getWidth()/2+y.get(L.right).getWidth()/2;else L.gap=u.DEFAULT_EDGE_LENGTH+y.get(L.top).getHeight()/2+y.get(L.bottom).getHeight()/2});var P=function(F,Y){return{x:F.x-Y.x,y:F.y-Y.y}},N=function(F){var Y=0,H=0;return F.forEach(function(K){Y+=m[p.get(K)],H+=b[p.get(K)]}),{x:Y/F.size,y:H/F.size}},R=function(F,Y,H,K,se){function ae(ce,pe){var Ie=new Set(ce),xe=!0,me=!1,Ve=void 0;try{for(var Be=pe[Symbol.iterator](),Ke;!(xe=(Ke=Be.next()).done);xe=!0){var He=Ke.value;Ie.add(He)}}catch(Le){me=!0,Ve=Le}finally{try{if(!xe&&Be.return)Be.return()}finally{if(me)throw Ve}}return Ie}var oe=new Map;F.forEach(function(ce,pe){oe.set(pe,0)}),F.forEach(function(ce,pe){ce.forEach(function(Ie){oe.set(Ie.id,oe.get(Ie.id)+1)})});var ne=new Map,ue=new Map,be=new f;if(oe.forEach(function(ce,pe){if(ce==0){if(be.push(pe),!H)if(Y=="horizontal")ne.set(pe,p.has(pe)?m[p.get(pe)]:K.get(pe));else ne.set(pe,p.has(pe)?b[p.get(pe)]:K.get(pe))}else ne.set(pe,Number.NEGATIVE_INFINITY);if(H)ue.set(pe,new Set([pe]))}),H)se.forEach(function(ce){var pe=[];if(ce.forEach(function(me){if(H.has(me))pe.push(me)}),pe.length>0){var Ie=0;pe.forEach(function(me){if(Y=="horizontal")ne.set(me,p.has(me)?m[p.get(me)]:K.get(me)),Ie+=ne.get(me);else ne.set(me,p.has(me)?b[p.get(me)]:K.get(me)),Ie+=ne.get(me)}),Ie=Ie/pe.length,ce.forEach(function(me){if(!H.has(me))ne.set(me,Ie)})}else{var xe=0;ce.forEach(function(me){if(Y=="horizontal")xe+=p.has(me)?m[p.get(me)]:K.get(me);else xe+=p.has(me)?b[p.get(me)]:K.get(me)}),xe=xe/ce.length,ce.forEach(function(me){ne.set(me,xe)})}});var fe=function(){var pe=be.shift(),Ie=F.get(pe);Ie.forEach(function(xe){if(ne.get(xe.id)<ne.get(pe)+xe.gap)if(H&&H.has(xe.id)){var me=void 0;if(Y=="horizontal")me=p.has(xe.id)?m[p.get(xe.id)]:K.get(xe.id);else me=p.has(xe.id)?b[p.get(xe.id)]:K.get(xe.id);if(ne.set(xe.id,me),me<ne.get(pe)+xe.gap){var Ve=ne.get(pe)+xe.gap-me;ue.get(pe).forEach(function(Be){ne.set(Be,ne.get(Be)-Ve)})}}else ne.set(xe.id,ne.get(pe)+xe.gap);if(oe.set(xe.id,oe.get(xe.id)-1),oe.get(xe.id)==0)be.push(xe.id);if(H)ue.set(xe.id,ae(ue.get(pe),ue.get(xe.id)))})};while(be.length!=0)fe();if(H){var le=new Set;F.forEach(function(ce,pe){if(ce.length==0)le.add(pe)});var De=[];ue.forEach(function(ce,pe){if(le.has(pe)){var Ie=!1,xe=!0,me=!1,Ve=void 0;try{for(var Be=ce[Symbol.iterator](),Ke;!(xe=(Ke=Be.next()).done);xe=!0){var He=Ke.value;if(H.has(He))Ie=!0}}catch(Ye){me=!0,Ve=Ye}finally{try{if(!xe&&Be.return)Be.return()}finally{if(me)throw Ve}}if(!Ie){var Le=!1,nt=void 0;if(De.forEach(function(Ye,tt){if(Ye.has([].concat(l(ce))[0]))Le=!0,nt=tt}),!Le)De.push(new Set(ce));else ce.forEach(function(Ye){De[nt].add(Ye)})}}}),De.forEach(function(ce,pe){var{POSITIVE_INFINITY:Ie,POSITIVE_INFINITY:xe,NEGATIVE_INFINITY:me,NEGATIVE_INFINITY:Ve}=Number,Be=!0,Ke=!1,He=void 0;try{for(var Le=ce[Symbol.iterator](),nt;!(Be=(nt=Le.next()).done);Be=!0){var Ye=nt.value,tt=void 0;if(Y=="horizontal")tt=p.has(Ye)?m[p.get(Ye)]:K.get(Ye);else tt=p.has(Ye)?b[p.get(Ye)]:K.get(Ye);var dt=ne.get(Ye);if(tt<Ie)Ie=tt;if(tt>me)me=tt;if(dt<xe)xe=dt;if(dt>Ve)Ve=dt}}catch(lr){Ke=!0,He=lr}finally{try{if(!Be&&Le.return)Le.return()}finally{if(Ke)throw He}}var qt=(Ie+me)/2-(xe+Ve)/2,ot=!0,rt=!1,lt=void 0;try{for(var Ft=ce[Symbol.iterator](),xt;!(ot=(xt=Ft.next()).done);ot=!0){var rr=xt.value;ne.set(rr,ne.get(rr)+qt)}}catch(lr){rt=!0,lt=lr}finally{try{if(!ot&&Ft.return)Ft.return()}finally{if(rt)throw lt}}})}return ne},I=function(F){var Y=0,H=0,K=0,se=0;if(F.forEach(function(ue){if(ue.left)m[p.get(ue.left)]-m[p.get(ue.right)]>=0?Y++:H++;else b[p.get(ue.top)]-b[p.get(ue.bottom)]>=0?K++:se++}),Y>H&&K>se)for(var ae=0;ae<p.size;ae++)m[ae]=-1*m[ae],b[ae]=-1*b[ae];else if(Y>H)for(var oe=0;oe<p.size;oe++)m[oe]=-1*m[oe];else if(K>se)for(var ne=0;ne<p.size;ne++)b[ne]=-1*b[ne]},w=function(F){var Y=[],H=new f,K=new Set,se=0;return F.forEach(function(ae,oe){if(!K.has(oe)){Y[se]=[];var ne=oe;H.push(ne),K.add(ne),Y[se].push(ne);while(H.length!=0){ne=H.shift();var ue=F.get(ne);ue.forEach(function(be){if(!K.has(be.id))H.push(be.id),K.add(be.id),Y[se].push(be.id)})}se++}}),Y},x=function(F){var Y=new Map;return F.forEach(function(H,K){Y.set(K,[])}),F.forEach(function(H,K){H.forEach(function(se){Y.get(K).push(se),Y.get(se.id).push({id:K,gap:se.gap,direction:se.direction})})}),Y},T=function(F){var Y=new Map;return F.forEach(function(H,K){Y.set(K,[])}),F.forEach(function(H,K){H.forEach(function(se){Y.get(se.id).push({id:K,gap:se.gap,direction:se.direction})})}),Y},D=[],C=[],O=!1,B=!1,z=new Set,V=new Map,k=new Map,G=[];if(g.fixedNodeConstraint)g.fixedNodeConstraint.forEach(function(L){z.add(L.nodeId)});if(g.relativePlacementConstraint)g.relativePlacementConstraint.forEach(function(L){if(L.left){if(V.has(L.left))V.get(L.left).push({id:L.right,gap:L.gap,direction:"horizontal"});else V.set(L.left,[{id:L.right,gap:L.gap,direction:"horizontal"}]);if(!V.has(L.right))V.set(L.right,[])}else{if(V.has(L.top))V.get(L.top).push({id:L.bottom,gap:L.gap,direction:"vertical"});else V.set(L.top,[{id:L.bottom,gap:L.gap,direction:"vertical"}]);if(!V.has(L.bottom))V.set(L.bottom,[])}}),k=x(V),G=w(k);if(u.TRANSFORM_ON_CONSTRAINT_HANDLING){if(g.fixedNodeConstraint&&g.fixedNodeConstraint.length>1)g.fixedNodeConstraint.forEach(function(L,F){D[F]=[L.position.x,L.position.y],C[F]=[m[p.get(L.nodeId)],b[p.get(L.nodeId)]]}),O=!0;else if(g.alignmentConstraint)(function(){var L=0;if(g.alignmentConstraint.vertical){var F=g.alignmentConstraint.vertical,Y=function(ne){var ue=new Set;F[ne].forEach(function(le){ue.add(le)});var be=new Set([].concat(l(ue)).filter(function(le){return z.has(le)})),fe=void 0;if(be.size>0)fe=m[p.get(be.values().next().value)];else fe=N(ue).x;F[ne].forEach(function(le){D[L]=[fe,b[p.get(le)]],C[L]=[m[p.get(le)],b[p.get(le)]],L++})};for(var H=0;H<F.length;H++)Y(H);O=!0}if(g.alignmentConstraint.horizontal){var K=g.alignmentConstraint.horizontal,se=function(ne){var ue=new Set;K[ne].forEach(function(le){ue.add(le)});var be=new Set([].concat(l(ue)).filter(function(le){return z.has(le)})),fe=void 0;if(be.size>0)fe=m[p.get(be.values().next().value)];else fe=N(ue).y;K[ne].forEach(function(le){D[L]=[m[p.get(le)],fe],C[L]=[m[p.get(le)],b[p.get(le)]],L++})};for(var ae=0;ae<K.length;ae++)se(ae);O=!0}if(g.relativePlacementConstraint)B=!0})();else if(g.relativePlacementConstraint){var J=0,X=0;for(var _=0;_<G.length;_++)if(G[_].length>J)J=G[_].length,X=_;if(J<k.size/2)I(g.relativePlacementConstraint),O=!1,B=!1;else{var Q=new Map,q=new Map,te=[];G[X].forEach(function(L){V.get(L).forEach(function(F){if(F.direction=="horizontal"){if(Q.has(L))Q.get(L).push(F);else Q.set(L,[F]);if(!Q.has(F.id))Q.set(F.id,[]);te.push({left:L,right:F.id})}else{if(q.has(L))q.get(L).push(F);else q.set(L,[F]);if(!q.has(F.id))q.set(F.id,[]);te.push({top:L,bottom:F.id})}})}),I(te),B=!1;var Z=R(Q,"horizontal"),U=R(q,"vertical");G[X].forEach(function(L,F){if(C[F]=[m[p.get(L)],b[p.get(L)]],D[F]=[],Z.has(L))D[F][0]=Z.get(L);else D[F][0]=m[p.get(L)];if(U.has(L))D[F][1]=U.get(L);else D[F][1]=b[p.get(L)]}),O=!0}}if(O){var W=void 0,j=v.transpose(D),re=v.transpose(C);for(var ee=0;ee<j.length;ee++)j[ee]=v.multGamma(j[ee]),re[ee]=v.multGamma(re[ee]);var de=v.multMat(j,v.transpose(re)),Ae=h.svd(de);W=v.multMat(Ae.V,v.transpose(Ae.U));for(var Ce=0;Ce<p.size;Ce++){var Se=[m[Ce],b[Ce]],ge=[W[0][0],W[1][0]],ve=[W[0][1],W[1][1]];m[Ce]=v.dotProduct(Se,ge),b[Ce]=v.dotProduct(Se,ve)}if(B)I(g.relativePlacementConstraint)}}if(u.ENFORCE_CONSTRAINTS){if(g.fixedNodeConstraint&&g.fixedNodeConstraint.length>0){var ye={x:0,y:0};g.fixedNodeConstraint.forEach(function(L,F){var Y={x:m[p.get(L.nodeId)],y:b[p.get(L.nodeId)]},H=L.position,K=P(H,Y);ye.x+=K.x,ye.y+=K.y}),ye.x/=g.fixedNodeConstraint.length,ye.y/=g.fixedNodeConstraint.length,m.forEach(function(L,F){m[F]+=ye.x}),b.forEach(function(L,F){b[F]+=ye.y}),g.fixedNodeConstraint.forEach(function(L){m[p.get(L.nodeId)]=L.position.x,b[p.get(L.nodeId)]=L.position.y})}if(g.alignmentConstraint){if(g.alignmentConstraint.vertical){var Ee=g.alignmentConstraint.vertical,Pe=function(F){var Y=new Set;Ee[F].forEach(function(se){Y.add(se)});var H=new Set([].concat(l(Y)).filter(function(se){return z.has(se)})),K=void 0;if(H.size>0)K=m[p.get(H.values().next().value)];else K=N(Y).x;Y.forEach(function(se){if(!z.has(se))m[p.get(se)]=K})};for(var Me=0;Me<Ee.length;Me++)Pe(Me)}if(g.alignmentConstraint.horizontal){var Ne=g.alignmentConstraint.horizontal,Fe=function(F){var Y=new Set;Ne[F].forEach(function(se){Y.add(se)});var H=new Set([].concat(l(Y)).filter(function(se){return z.has(se)})),K=void 0;if(H.size>0)K=b[p.get(H.values().next().value)];else K=N(Y).y;Y.forEach(function(se){if(!z.has(se))b[p.get(se)]=K})};for(var ze=0;ze<Ne.length;ze++)Fe(ze)}}if(g.relativePlacementConstraint)(function(){var L=new Map,F=new Map,Y=new Map,H=new Map,K=new Map,se=new Map,ae=new Set,oe=new Set;if(z.forEach(function(ft){ae.add(ft),oe.add(ft)}),g.alignmentConstraint){if(g.alignmentConstraint.vertical){var ne=g.alignmentConstraint.vertical,ue=function(ke){Y.set("dummy"+ke,[]),ne[ke].forEach(function(Ge){if(L.set(Ge,"dummy"+ke),Y.get("dummy"+ke).push(Ge),z.has(Ge))ae.add("dummy"+ke)}),K.set("dummy"+ke,m[p.get(ne[ke][0])])};for(var be=0;be<ne.length;be++)ue(be)}if(g.alignmentConstraint.horizontal){var fe=g.alignmentConstraint.horizontal,le=function(ke){H.set("dummy"+ke,[]),fe[ke].forEach(function(Ge){if(F.set(Ge,"dummy"+ke),H.get("dummy"+ke).push(Ge),z.has(Ge))oe.add("dummy"+ke)}),se.set("dummy"+ke,b[p.get(fe[ke][0])])};for(var De=0;De<fe.length;De++)le(De)}}var ce=new Map,pe=new Map,Ie=function(ke){V.get(ke).forEach(function(Ge){var Vt=void 0,Rt=void 0;if(Ge.direction=="horizontal"){if(Vt=L.get(ke)?L.get(ke):ke,L.get(Ge.id))Rt={id:L.get(Ge.id),gap:Ge.gap,direction:Ge.direction};else Rt=Ge;if(ce.has(Vt))ce.get(Vt).push(Rt);else ce.set(Vt,[Rt]);if(!ce.has(Rt.id))ce.set(Rt.id,[])}else{if(Vt=F.get(ke)?F.get(ke):ke,F.get(Ge.id))Rt={id:F.get(Ge.id),gap:Ge.gap,direction:Ge.direction};else Rt=Ge;if(pe.has(Vt))pe.get(Vt).push(Rt);else pe.set(Vt,[Rt]);if(!pe.has(Rt.id))pe.set(Rt.id,[])}})},xe=!0,me=!1,Ve=void 0;try{for(var Be=V.keys()[Symbol.iterator](),Ke;!(xe=(Ke=Be.next()).done);xe=!0){var He=Ke.value;Ie(He)}}catch(ft){me=!0,Ve=ft}finally{try{if(!xe&&Be.return)Be.return()}finally{if(me)throw Ve}}var Le=x(ce),nt=x(pe),Ye=w(Le),tt=w(nt),dt=T(ce),qt=T(pe),ot=[],rt=[];Ye.forEach(function(ft,ke){ot[ke]=[],ft.forEach(function(Ge){if(dt.get(Ge).length==0)ot[ke].push(Ge)})}),tt.forEach(function(ft,ke){rt[ke]=[],ft.forEach(function(Ge){if(qt.get(Ge).length==0)rt[ke].push(Ge)})});var lt=R(ce,"horizontal",ae,K,ot),Ft=R(pe,"vertical",oe,se,rt),xt=function(ke){if(Y.get(ke))Y.get(ke).forEach(function(Ge){m[p.get(Ge)]=lt.get(ke)});else m[p.get(ke)]=lt.get(ke)},rr=!0,lr=!1,ln=void 0;try{for(var wa=lt.keys()[Symbol.iterator](),fn;!(rr=(fn=wa.next()).done);rr=!0){var Ea=fn.value;xt(Ea)}}catch(ft){lr=!0,ln=ft}finally{try{if(!rr&&wa.return)wa.return()}finally{if(lr)throw ln}}var ci=function(ke){if(H.get(ke))H.get(ke).forEach(function(Ge){b[p.get(Ge)]=Ft.get(ke)});else b[p.get(ke)]=Ft.get(ke)},xa=!0,fr=!1,$r=void 0;try{for(var vr=Ft.keys()[Symbol.iterator](),Ta;!(xa=(Ta=vr.next()).done);xa=!0){var Ea=Ta.value;ci(Ea)}}catch(ft){fr=!0,$r=ft}finally{try{if(!xa&&vr.return)vr.return()}finally{if(fr)throw $r}}})()}for(var Ue=0;Ue<E.length;Ue++){var ie=E[Ue];if(ie.getChild()==null)ie.setCenter(m[p.get(ie.id)],b[p.get(ie.id)])}},i.exports=c},551:(i)=>{i.exports=t}},r={};function a(i){var s=r[i];if(s!==void 0)return s.exports;var o=r[i]={exports:{}};return e[i](o,o.exports,a),o.exports}var n=a(45);return n})()})});function Ys(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,a=Array(e);r<e;r++)a[r]=t[r];return a}function fh(t){if(Array.isArray(t))return t}function vh(t){if(Array.isArray(t))return Ys(t)}function Mr(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}function hh(t,e){for(var r=0;r<e.length;r++){var a=e[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,gf(a.key),a)}}function Lr(t,e,r){return e&&hh(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function kt(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=fo(t))||e){r&&(t=r);var a=0,n=function(){};return{s:n,n:function(){return a>=t.length?{done:!0}:{done:!1,value:t[a++]}},e:function(l){throw l},f:n}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
2
2
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i,s=!0,o=!1;return{s:function(){r=r.call(t)},n:function(){var l=r.next();return s=l.done,l},e:function(l){o=!0,i=l},f:function(){try{s||r.return==null||r.return()}finally{if(o)throw i}}}}function df(t,e,r){return(e=gf(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ch(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function dh(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var a,n,i,s,o=[],l=!0,u=!1;try{if(i=(r=r.call(t)).next,e===0){if(Object(r)!==r)return;l=!1}else for(;!(l=(a=i.call(r)).done)&&(o.push(a.value),o.length!==e);l=!0);}catch(f){u=!0,n=f}finally{try{if(!l&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw n}}return o}}function gh(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
3
3
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ph(){throw TypeError(`Invalid attempt to spread non-iterable instance.
4
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ht(t,e){return fh(t)||dh(t,e)||fo(t,e)||gh()}function Bn(t){return vh(t)||ch(t)||fo(t)||ph()}function yh(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e);if(typeof a!="object")return a;throw TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function gf(t){var e=yh(t,"string");return typeof e=="symbol"?e:e+""}function pt(t){return pt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},pt(t)}function fo(t,e){if(t){if(typeof t=="string")return Ys(t,e);var r={}.toString.call(t).slice(8,-1);return r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set"?Array.from(t):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ys(t,e):void 0}}var dt=typeof window>"u"?null:window,Vo=dt?dt.navigator:null;dt&&dt.document;var mh=pt(""),pf=pt({}),bh=pt(function(){}),wh=typeof HTMLElement>"u"?"undefined":pt(HTMLElement),Ka=function(e){return e&&e.instanceString&&st(e.instanceString)?e.instanceString():null},Re=function(e){return e!=null&&pt(e)==mh},st=function(e){return e!=null&&pt(e)===bh},Je=function(e){return!zt(e)&&(Array.isArray?Array.isArray(e):e!=null&&e instanceof Array)},We=function(e){return e!=null&&pt(e)===pf&&!Je(e)&&e.constructor===Object},Eh=function(e){return e!=null&&pt(e)===pf},he=function(e){return e!=null&&pt(e)===pt(1)&&!isNaN(e)},yf=function(e){return he(e)&&Math.floor(e)===e},kn=function(e){if(wh==="undefined")return;else return e!=null&&e instanceof HTMLElement},zt=function(e){return Za(e)||mf(e)},Za=function(e){return Ka(e)==="collection"&&e._private.single},mf=function(e){return Ka(e)==="collection"&&!e._private.single},vo=function(e){return Ka(e)==="core"},bf=function(e){return Ka(e)==="stylesheet"},xh=function(e){return Ka(e)==="event"},xr=function(e){if(e===void 0||e===null)return!0;else if(e===""||e.match(/^\s+$/))return!0;return!1},Th=function(e){if(typeof HTMLElement>"u")return!1;else return e instanceof HTMLElement},Ch=function(e){return We(e)&&he(e.x1)&&he(e.x2)&&he(e.y1)&&he(e.y2)},Sh=function(e){return Eh(e)&&st(e.then)},Dh=function(){return Vo&&Vo.userAgent.match(/msie|trident|edge/i)},la=function(e,r){if(!r)r=function(){if(arguments.length===1)return arguments[0];else if(arguments.length===0)return"undefined";var i=[];for(var s=0;s<arguments.length;s++)i.push(arguments[s]);return i.join("$")};var a=function(){var i=this,s=arguments,o,l=r.apply(i,s),u=a.cache;if(!(o=u[l]))o=u[l]=e.apply(i,s);return o};return a.cache={},a},ho=la(function(t){return t.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()})}),Zn=la(function(t){return t.replace(/(-\w)/g,function(e){return e[1].toUpperCase()})}),wf=la(function(t,e){return t+e[0].toUpperCase()+e.substring(1)},function(t,e){return t+"$"+e}),Go=function(e){if(xr(e))return e;return e.charAt(0).toUpperCase()+e.substring(1)},yr=function(e,r){return e.slice(-1*r.length)===r},gt="(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))",Ah="rgb[a]?\\(("+gt+"[%]?)\\s*,\\s*("+gt+"[%]?)\\s*,\\s*("+gt+"[%]?)(?:\\s*,\\s*("+gt+"))?\\)",Mh="rgb[a]?\\((?:"+gt+"[%]?)\\s*,\\s*(?:"+gt+"[%]?)\\s*,\\s*(?:"+gt+"[%]?)(?:\\s*,\\s*(?:"+gt+"))?\\)",Lh="hsl[a]?\\(("+gt+")\\s*,\\s*("+gt+"[%])\\s*,\\s*("+gt+"[%])(?:\\s*,\\s*("+gt+"))?\\)",Rh="hsl[a]?\\((?:"+gt+")\\s*,\\s*(?:"+gt+"[%])\\s*,\\s*(?:"+gt+"[%])(?:\\s*,\\s*(?:"+gt+"))?\\)",Ph="\\#[0-9a-fA-F]{3}",Nh="\\#[0-9a-fA-F]{6}",Ef=function(e,r){if(e<r)return-1;else if(e>r)return 1;else return 0},Oh=function(e,r){return-1*Ef(e,r)},Oe=Object.assign!=null?Object.assign.bind(Object):function(t){var e=arguments;for(var r=1;r<e.length;r++){var a=e[r];if(a==null)continue;var n=Object.keys(a);for(var i=0;i<n.length;i++){var s=n[i];t[s]=a[s]}}return t},Ih=function(e){if(!(e.length===4||e.length===7)||e[0]!=="#")return;var r=e.length===4,a,n,i,s=16;if(r)a=parseInt(e[1]+e[1],s),n=parseInt(e[2]+e[2],s),i=parseInt(e[3]+e[3],s);else a=parseInt(e[1]+e[2],s),n=parseInt(e[3]+e[4],s),i=parseInt(e[5]+e[6],s);return[a,n,i]},Bh=function(e){var r,a,n,i,s,o,l,u;function f(d,g,y){if(y<0)y+=1;if(y>1)y-=1;if(y<0.16666666666666666)return d+(g-d)*6*y;if(y<0.5)return g;if(y<0.6666666666666666)return d+(g-d)*(0.6666666666666666-y)*6;return d}var v=new RegExp("^"+Lh+"$").exec(e);if(v){if(a=parseInt(v[1]),a<0)a=(360- -1*a%360)%360;else if(a>360)a=a%360;if(a/=360,n=parseFloat(v[2]),n<0||n>100)return;if(n=n/100,i=parseFloat(v[3]),i<0||i>100)return;if(i=i/100,s=v[4],s!==void 0){if(s=parseFloat(s),s<0||s>1)return}if(n===0)o=l=u=Math.round(i*255);else{var h=i<0.5?i*(1+n):i+n-i*n,c=2*i-h;o=Math.round(255*f(c,h,a+0.3333333333333333)),l=Math.round(255*f(c,h,a)),u=Math.round(255*f(c,h,a-0.3333333333333333))}r=[o,l,u,s]}return r},kh=function(e){var r,a=new RegExp("^"+Ah+"$").exec(e);if(a){r=[];var n=[];for(var i=1;i<=3;i++){var s=a[i];if(s[s.length-1]==="%")n[i]=!0;if(s=parseFloat(s),n[i])s=s/100*255;if(s<0||s>255)return;r.push(Math.floor(s))}var o=n[1]||n[2]||n[3],l=n[1]&&n[2]&&n[3];if(o&&!l)return;var u=a[4];if(u!==void 0){if(u=parseFloat(u),u<0||u>1)return;r.push(u)}}return r},Fh=function(e){return zh[e.toLowerCase()]},xf=function(e){return(Je(e)?e:null)||Fh(e)||Ih(e)||kh(e)||Bh(e)},zh={transparent:[0,0,0,0],aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],grey:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},Tf=function(e){var{map:r,keys:a}=e,n=a.length;for(var i=0;i<n;i++){var s=a[i];if(We(s))throw Error("Tried to set map with object key");if(i<a.length-1){if(r[s]==null)r[s]={};r=r[s]}else r[s]=e.value}},Cf=function(e){var{map:r,keys:a}=e,n=a.length;for(var i=0;i<n;i++){var s=a[i];if(We(s))throw Error("Tried to get map with object key");if(r=r[s],r==null)return r}return r},vn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function _a(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var di,Uo;function Qa(){if(Uo)return di;Uo=1;function t(e){var r=typeof e;return e!=null&&(r=="object"||r=="function")}return di=t,di}var gi,Ho;function Vh(){if(Ho)return gi;Ho=1;var t=typeof vn=="object"&&vn&&vn.Object===Object&&vn;return gi=t,gi}var pi,qo;function _n(){if(qo)return pi;qo=1;var t=Vh(),e=typeof self=="object"&&self&&self.Object===Object&&self,r=t||e||Function("return this")();return pi=r,pi}var yi,Yo;function Gh(){if(Yo)return yi;Yo=1;var t=_n(),e=function(){return t.Date.now()};return yi=e,yi}var mi,Xo;function Uh(){if(Xo)return mi;Xo=1;var t=/\s/;function e(r){var a=r.length;while(a--&&t.test(r.charAt(a)));return a}return mi=e,mi}var bi,Wo;function Hh(){if(Wo)return bi;Wo=1;var t=Uh(),e=/^\s+/;function r(a){return a?a.slice(0,t(a)+1).replace(e,""):a}return bi=r,bi}var wi,$o;function co(){if($o)return wi;$o=1;var t=_n(),e=t.Symbol;return wi=e,wi}var Ei,Ko;function qh(){if(Ko)return Ei;Ko=1;var t=co(),e=Object.prototype,{hasOwnProperty:r,toString:a}=e,n=t?t.toStringTag:void 0;function i(s){var o=r.call(s,n),l=s[n];try{s[n]=void 0;var u=!0}catch(v){}var f=a.call(s);if(u)if(o)s[n]=l;else delete s[n];return f}return Ei=i,Ei}var xi,Zo;function Yh(){if(Zo)return xi;Zo=1;var t=Object.prototype,e=t.toString;function r(a){return e.call(a)}return xi=r,xi}var Ti,_o;function Sf(){if(_o)return Ti;_o=1;var t=co(),e=qh(),r=Yh(),a="[object Null]",n="[object Undefined]",i=t?t.toStringTag:void 0;function s(o){if(o==null)return o===void 0?n:a;return i&&i in Object(o)?e(o):r(o)}return Ti=s,Ti}var Ci,Qo;function Xh(){if(Qo)return Ci;Qo=1;function t(e){return e!=null&&typeof e=="object"}return Ci=t,Ci}var Si,Jo;function Ja(){if(Jo)return Si;Jo=1;var t=Sf(),e=Xh(),r="[object Symbol]";function a(n){return typeof n=="symbol"||e(n)&&t(n)==r}return Si=a,Si}var Di,jo;function Wh(){if(jo)return Di;jo=1;var t=Hh(),e=Qa(),r=Ja(),a=NaN,n=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,s=/^0o[0-7]+$/i,o=parseInt;function l(u){if(typeof u=="number")return u;if(r(u))return a;if(e(u)){var f=typeof u.valueOf=="function"?u.valueOf():u;u=e(f)?f+"":f}if(typeof u!="string")return u===0?u:+u;u=t(u);var v=i.test(u);return v||s.test(u)?o(u.slice(2),v?2:8):n.test(u)?a:+u}return Di=l,Di}var Ai,eu;function $h(){if(eu)return Ai;eu=1;var t=Qa(),e=Gh(),r=Wh(),a="Expected a function",{max:n,min:i}=Math;function s(o,l,u){var f,v,h,c,d,g,y=0,p=!1,m=!1,b=!0;if(typeof o!="function")throw TypeError(a);if(l=r(l)||0,t(u))p=!!u.leading,m="maxWait"in u,h=m?n(r(u.maxWait)||0,l):h,b="trailing"in u?!!u.trailing:b;function E(x){var T=f,D=v;return f=v=void 0,y=x,c=o.apply(D,T),c}function A(x){return y=x,d=setTimeout(P,l),p?E(x):c}function M(x){var T=x-g,D=x-y,C=l-T;return m?i(C,h-D):C}function S(x){var T=x-g,D=x-y;return g===void 0||T>=l||T<0||m&&D>=h}function P(){var x=e();if(S(x))return N(x);d=setTimeout(P,M(x))}function N(x){if(d=void 0,b&&f)return E(x);return f=v=void 0,c}function R(){if(d!==void 0)clearTimeout(d);y=0,f=g=v=d=void 0}function I(){return d===void 0?c:N(e())}function w(){var x=e(),T=S(x);if(f=arguments,v=this,g=x,T){if(d===void 0)return A(g);if(m)return clearTimeout(d),d=setTimeout(P,l),E(g)}if(d===void 0)d=setTimeout(P,l);return c}return w.cancel=R,w.flush=I,w}return Ai=s,Ai}var Kh=$h(),ja=_a(Kh),Mi=dt?dt.performance:null,Df=Mi&&Mi.now?function(){return Mi.now()}:function(){return Date.now()},Zh=function(){if(dt){if(dt.requestAnimationFrame)return function(t){dt.requestAnimationFrame(t)};else if(dt.mozRequestAnimationFrame)return function(t){dt.mozRequestAnimationFrame(t)};else if(dt.webkitRequestAnimationFrame)return function(t){dt.webkitRequestAnimationFrame(t)};else if(dt.msRequestAnimationFrame)return function(t){dt.msRequestAnimationFrame(t)}}return function(t){if(t)setTimeout(function(){t(Df())},16.666666666666668)}}(),Fn=function(e){return Zh(e)},ir=Df,Fr=9261,Af=65599,ta=5381,Mf=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Fr,a=r,n;for(;;){if(n=e.next(),n.done)break;a=a*Af+n.value|0}return a},za=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Fr;return r*Af+e|0},Va=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ta;return(r<<5)+r+e|0},_h=function(e,r){return e*2097152+r},cr=function(e){return e[0]*2097152+e[1]},hn=function(e,r){return[za(e[0],r[0]),Va(e[1],r[1])]},tu=function(e,r){var a={value:0,done:!1},n=0,i=e.length,s={next:function(){if(n<i)a.value=e[n++];else a.done=!0;return a}};return Mf(s,r)},Gr=function(e,r){var a={value:0,done:!1},n=0,i=e.length,s={next:function(){if(n<i)a.value=e.charCodeAt(n++);else a.done=!0;return a}};return Mf(s,r)},Lf=function(){return Qh(arguments)},Qh=function(e){var r;for(var a=0;a<e.length;a++){var n=e[a];if(a===0)r=Gr(n);else r=Gr(n,r)}return r};function Jh(t,e,r,a,n){var i=n*Math.PI/180,s=Math.cos(i)*(t-r)-Math.sin(i)*(e-a)+r,o=Math.sin(i)*(t-r)+Math.cos(i)*(e-a)+a;return{x:s,y:o}}var jh=function(e,r,a,n,i,s){return{x:(e-a)*i+a,y:(r-n)*s+n}};function ec(t,e,r){if(r===0)return t;var a=(e.x1+e.x2)/2,n=(e.y1+e.y2)/2,i=e.w/e.h,s=1/i,o=Jh(t.x,t.y,a,n,r),l=jh(o.x,o.y,a,n,i,s);return{x:l.x,y:l.y}}var ru=!0,tc=console.warn!=null,rc=console.trace!=null,go=Number.MAX_SAFE_INTEGER||9007199254740991,Rf=function(){return!0},zn=function(){return!1},au=function(){return 0},po=function(){},it=function(e){throw Error(e)},Pf=function(e){if(e!==void 0)ru=!!e;else return ru},_e=function(e){if(!Pf())return;if(tc)console.warn(e);else if(console.log(e),rc)console.trace()},ac=function(e){return Oe({},e)},Jt=function(e){if(e==null)return e;if(Je(e))return e.slice();else if(We(e))return ac(e);else return e},nc=function(e){return e.slice()},Nf=function(e,r){for(r=e="";e++<36;r+=e*51&52?(e^15?8^Math.random()*(e^20?16:4):4).toString(16):"-");return r},ic={},Of=function(){return ic},St=function(e){var r=Object.keys(e);return function(a){var n={};for(var i=0;i<r.length;i++){var s=r[i],o=a==null?void 0:a[s];n[s]=o===void 0?e[s]:o}return n}},Tr=function(e,r,a){for(var n=e.length-1;n>=0;n--)if(e[n]===r)e.splice(n,1)},yo=function(e){e.splice(0,e.length)},sc=function(e,r){for(var a=0;a<r.length;a++){var n=r[a];e.push(n)}},Nt=function(e,r,a){if(a)r=wf(a,r);return e[r]},Qt=function(e,r,a,n){if(a)r=wf(a,r);e[r]=n},oc=function(){function t(){Mr(this,t),this._obj={}}return Lr(t,[{key:"set",value:function(r,a){return this._obj[r]=a,this}},{key:"delete",value:function(r){return this._obj[r]=void 0,this}},{key:"clear",value:function(){this._obj={}}},{key:"has",value:function(r){return this._obj[r]!==void 0}},{key:"get",value:function(r){return this._obj[r]}}])}(),nr=typeof Map<"u"?Map:oc,uc="undefined",lc=function(){function t(e){if(Mr(this,t),this._obj=Object.create(null),this.size=0,e!=null){var r;if(e.instanceString!=null&&e.instanceString()===this.instanceString())r=e.toArray();else r=e;for(var a=0;a<r.length;a++)this.add(r[a])}}return Lr(t,[{key:"instanceString",value:function(){return"set"}},{key:"add",value:function(r){var a=this._obj;if(a[r]!==1)a[r]=1,this.size++}},{key:"delete",value:function(r){var a=this._obj;if(a[r]===1)a[r]=0,this.size--}},{key:"clear",value:function(){this._obj=Object.create(null)}},{key:"has",value:function(r){return this._obj[r]===1}},{key:"toArray",value:function(){var r=this;return Object.keys(this._obj).filter(function(a){return r.has(a)})}},{key:"forEach",value:function(r,a){return this.toArray().forEach(r,a)}}])}(),da=(typeof Set>"u"?"undefined":pt(Set))!==uc?Set:lc,Qn=function(e,r){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0||r===void 0||!vo(e)){it("An element must have a core reference and parameters set");return}var n=r.group;if(n==null)if(r.data&&r.data.source!=null&&r.data.target!=null)n="edges";else n="nodes";if(n!=="nodes"&&n!=="edges"){it("An element must be of type `nodes` or `edges`; you specified `"+n+"`");return}this.length=1,this[0]=this;var i=this._private={cy:e,single:!0,data:r.data||{},position:r.position||{x:0,y:0},autoWidth:void 0,autoHeight:void 0,autoPadding:void 0,compoundBoundsClean:!1,listeners:[],group:n,style:{},rstyle:{},styleCxts:[],styleKeys:{},removed:!0,selected:r.selected?!0:!1,selectable:r.selectable===void 0?!0:r.selectable?!0:!1,locked:r.locked?!0:!1,grabbed:!1,grabbable:r.grabbable===void 0?!0:r.grabbable?!0:!1,pannable:r.pannable===void 0?n==="edges"?!0:!1:r.pannable?!0:!1,active:!1,classes:new da,animation:{current:[],queue:[]},rscratch:{},scratch:r.scratch||{},edges:[],children:[],parent:r.parent&&r.parent.isNode()?r.parent:null,traversalCache:{},backgrounding:!1,bbCache:null,bbCacheShift:{x:0,y:0},bodyBounds:null,overlayBounds:null,labelBounds:{all:null,source:null,target:null,main:null},arrowBounds:{source:null,target:null,"mid-source":null,"mid-target":null}};if(i.position.x==null)i.position.x=0;if(i.position.y==null)i.position.y=0;if(r.renderedPosition){var s=r.renderedPosition,o=e.pan(),l=e.zoom();i.position={x:(s.x-o.x)/l,y:(s.y-o.y)/l}}var u=[];if(Je(r.classes))u=r.classes;else if(Re(r.classes))u=r.classes.split(/\s+/);for(var f=0,v=u.length;f<v;f++){var h=u[f];if(!h||h==="")continue;i.classes.add(h)}if(this.createEmitter(),a===void 0||a)this.restore();var c=r.style||r.css;if(c)_e("Setting a `style` bypass at element creation should be done only when absolutely necessary. Try to use the stylesheet instead."),this.style(c)},nu=function(e){return e={bfs:e.bfs||!e.dfs,dfs:e.dfs||!e.bfs},function(a,n,i){var s;if(We(a)&&!zt(a))s=a,a=s.roots||s.root,n=s.visit,i=s.directed;i=arguments.length===2&&!st(n)?n:i,n=st(n)?n:function(){};var o=this._private.cy,l=a=Re(a)?this.filter(a):a,u=[],f=[],v={},h={},c={},d=0,g,y=this.byGroup(),{nodes:p,edges:m}=y;for(var b=0;b<l.length;b++){var E=l[b],A=E.id();if(E.isNode()){if(u.unshift(E),e.bfs)c[A]=!0,f.push(E);h[A]=0}}var M=function(){var x=e.bfs?u.shift():u.pop(),T=x.id();if(e.dfs){if(c[T])return 0;c[T]=!0,f.push(x)}var D=h[T],C=v[T],O=C!=null?C.source():null,B=C!=null?C.target():null,z=C==null?void 0:x.same(O)?B[0]:O[0],V;if(V=n(x,C,z,d++,D),V===!0)return g=x,1;if(V===!1)return 1;var k=x.connectedEdges().filter(function(Q){return(!i||Q.source().same(x))&&m.has(Q)});for(var G=0;G<k.length;G++){var J=k[G],X=J.connectedNodes().filter(function(Q){return!Q.same(x)&&p.has(Q)}),_=X.id();if(X.length!==0&&!c[_]){if(X=X[0],u.push(X),e.bfs)c[_]=!0,f.push(X);v[_]=J,h[_]=h[T]+1}}},S;while(u.length!==0){if(S=M(),S===0)continue;if(S===1)break}var P=o.collection();for(var N=0;N<f.length;N++){var R=f[N],I=v[R.id()];if(I!=null)P.push(I);P.push(R)}return{path:o.collection(P),found:o.collection(g)}}},Ga={breadthFirstSearch:nu({bfs:!0}),depthFirstSearch:nu({dfs:!0})};Ga.bfs=Ga.breadthFirstSearch;Ga.dfs=Ga.depthFirstSearch;var Cn={exports:{}},fc=Cn.exports,iu;function vc(){if(iu)return Cn.exports;return iu=1,function(t,e){(function(){var r,a,n,i,s,o,l,u,f,v,h,c,d,g,y;n=Math.floor,v=Math.min,a=function(p,m){if(p<m)return-1;if(p>m)return 1;return 0},f=function(p,m,b,E,A){var M;if(b==null)b=0;if(A==null)A=a;if(b<0)throw Error("lo must be non-negative");if(E==null)E=p.length;while(b<E)if(M=n((b+E)/2),A(m,p[M])<0)E=M;else b=M+1;return[].splice.apply(p,[b,b-b].concat(m)),m},o=function(p,m,b){if(b==null)b=a;return p.push(m),g(p,0,p.length-1,b)},s=function(p,m){var b,E;if(m==null)m=a;if(b=p.pop(),p.length)E=p[0],p[0]=b,y(p,0,m);else E=b;return E},u=function(p,m,b){var E;if(b==null)b=a;return E=p[0],p[0]=m,y(p,0,b),E},l=function(p,m,b){var E;if(b==null)b=a;if(p.length&&b(p[0],m)<0)E=[p[0],m],m=E[0],p[0]=E[1],y(p,0,b);return m},i=function(p,m){var b,E,A,M,S,P;if(m==null)m=a;M=function(){P=[];for(var N=0,R=n(p.length/2);0<=R?N<R:N>R;0<=R?N++:N--)P.push(N);return P}.apply(this).reverse(),S=[];for(E=0,A=M.length;E<A;E++)b=M[E],S.push(y(p,b,m));return S},d=function(p,m,b){var E;if(b==null)b=a;if(E=p.indexOf(m),E===-1)return;return g(p,0,E,b),y(p,E,b)},h=function(p,m,b){var E,A,M,S,P;if(b==null)b=a;if(A=p.slice(0,m),!A.length)return A;i(A,b),P=p.slice(m);for(M=0,S=P.length;M<S;M++)E=P[M],l(A,E,b);return A.sort(b).reverse()},c=function(p,m,b){var E,A,M,S,P,N,R,I,w;if(b==null)b=a;if(m*10<=p.length){if(M=p.slice(0,m).sort(b),!M.length)return M;A=M[M.length-1],R=p.slice(m);for(S=0,N=R.length;S<N;S++)if(E=R[S],b(E,A)<0)f(M,E,0,null,b),M.pop(),A=M[M.length-1];return M}i(p,b),w=[];for(P=0,I=v(m,p.length);0<=I?P<I:P>I;0<=I?++P:--P)w.push(s(p,b));return w},g=function(p,m,b,E){var A,M,S;if(E==null)E=a;A=p[b];while(b>m){if(S=b-1>>1,M=p[S],E(A,M)<0){p[b]=M,b=S;continue}break}return p[b]=A},y=function(p,m,b){var E,A,M,S,P;if(b==null)b=a;A=p.length,P=m,M=p[m],E=2*m+1;while(E<A){if(S=E+1,S<A&&!(b(p[E],p[S])<0))E=S;p[m]=p[E],m=E,E=2*m+1}return p[m]=M,g(p,P,m,b)},r=function(){p.push=o,p.pop=s,p.replace=u,p.pushpop=l,p.heapify=i,p.updateItem=d,p.nlargest=h,p.nsmallest=c;function p(m){this.cmp=m!=null?m:a,this.nodes=[]}return p.prototype.push=function(m){return o(this.nodes,m,this.cmp)},p.prototype.pop=function(){return s(this.nodes,this.cmp)},p.prototype.peek=function(){return this.nodes[0]},p.prototype.contains=function(m){return this.nodes.indexOf(m)!==-1},p.prototype.replace=function(m){return u(this.nodes,m,this.cmp)},p.prototype.pushpop=function(m){return l(this.nodes,m,this.cmp)},p.prototype.heapify=function(){return i(this.nodes,this.cmp)},p.prototype.updateItem=function(m){return d(this.nodes,m,this.cmp)},p.prototype.clear=function(){return this.nodes=[]},p.prototype.empty=function(){return this.nodes.length===0},p.prototype.size=function(){return this.nodes.length},p.prototype.clone=function(){var m=new p;return m.nodes=this.nodes.slice(0),m},p.prototype.toArray=function(){return this.nodes.slice(0)},p.prototype.insert=p.prototype.push,p.prototype.top=p.prototype.peek,p.prototype.front=p.prototype.peek,p.prototype.has=p.prototype.contains,p.prototype.copy=p.prototype.clone,p}(),function(p,m){return t.exports=m()}(this,function(){return r})}).call(fc)}(Cn),Cn.exports}var Li,su;function hc(){if(su)return Li;return su=1,Li=vc(),Li}var cc=hc(),en=_a(cc),dc=St({root:null,weight:function(e){return 1},directed:!1}),gc={dijkstra:function(e){if(!We(e)){var r=arguments;e={root:r[0],weight:r[1],directed:r[2]}}var a=dc(e),{root:n,weight:i,directed:s}=a,o=this,l=i,u=Re(n)?this.filter(n)[0]:n[0],f={},v={},h={},c=this.byGroup(),{nodes:d,edges:g}=c;g.unmergeBy(function(D){return D.isLoop()});var y=function(C){return f[C.id()]},p=function(C,O){f[C.id()]=O,m.updateItem(C)},m=new en(function(D,C){return y(D)-y(C)});for(var b=0;b<d.length;b++){var E=d[b];f[E.id()]=E.same(u)?0:1/0,m.push(E)}var A=function(C,O){var B=(s?C.edgesTo(O):C.edgesWith(O)).intersect(g),z=1/0,V;for(var k=0;k<B.length;k++){var G=B[k],J=l(G);if(J<z||!V)z=J,V=G}return{edge:V,dist:z}};while(m.size()>0){var M=m.pop(),S=y(M),P=M.id();if(h[P]=S,S===1/0)continue;var N=M.neighborhood().intersect(d);for(var R=0;R<N.length;R++){var I=N[R],w=I.id(),x=A(M,I),T=S+x.dist;if(T<y(I))p(I,T),v[w]={node:M,edge:x.edge}}}return{distanceTo:function(C){var O=Re(C)?d.filter(C)[0]:C[0];return h[O.id()]},pathTo:function(C){var O=Re(C)?d.filter(C)[0]:C[0],B=[],z=O,V=z.id();if(O.length>0){B.unshift(O);while(v[V]){var k=v[V];B.unshift(k.edge),B.unshift(k.node),z=k.node,V=z.id()}}return o.spawn(B)}}}},pc={kruskal:function(e){e=e||function(b){return 1};var r=this.byGroup(),{nodes:a,edges:n}=r,i=a.length,s=Array(i),o=a,l=function(E){for(var A=0;A<s.length;A++){var M=s[A];if(M.has(E))return A}};for(var u=0;u<i;u++)s[u]=this.spawn(a[u]);var f=n.sort(function(b,E){return e(b)-e(E)});for(var v=0;v<f.length;v++){var h=f[v],c=h.source()[0],d=h.target()[0],g=l(c),y=l(d),p=s[g],m=s[y];if(g!==y)o.merge(h),p.merge(m),s.splice(y,1)}return o}},yc=St({root:null,goal:null,weight:function(e){return 1},heuristic:function(e){return 0},directed:!1}),mc={aStar:function(e){var r=this.cy(),a=yc(e),{root:n,goal:i,heuristic:s,directed:o,weight:l}=a;n=r.collection(n)[0],i=r.collection(i)[0];var u=n.id(),f=i.id(),v={},h={},c={},d=new en(function(V,k){return h[V.id()]-h[k.id()]}),g=new da,y={},p={},m=function(k,G){d.push(k),g.add(G)},b,E,A=function(){b=d.pop(),E=b.id(),g.delete(E)},M=function(k){return g.has(k)};m(n,u),v[u]=0,h[u]=s(n);var S=0;while(d.size()>0){if(A(),S++,E===f){var P=[],N=i,R=f,I=p[R];for(;;){if(P.unshift(N),I!=null)P.unshift(I);if(N=y[R],N==null)break;R=N.id(),I=p[R]}return{found:!0,distance:v[E],path:this.spawn(P),steps:S}}c[E]=!0;var w=b._private.edges;for(var x=0;x<w.length;x++){var T=w[x];if(!this.hasElementWithId(T.id()))continue;if(o&&T.data("source")!==E)continue;var D=T.source(),C=T.target(),O=D.id()!==E?D:C,B=O.id();if(!this.hasElementWithId(B))continue;if(c[B])continue;var z=v[E]+l(T);if(!M(B)){v[B]=z,h[B]=z+s(O),m(O,B),y[B]=b,p[B]=T;continue}if(z<v[B])v[B]=z,h[B]=z+s(O),d.updateItem(O),y[B]=b,p[B]=T}}return{found:!1,distance:void 0,path:void 0,steps:S}}},bc=St({weight:function(e){return 1},directed:!1}),wc={floydWarshall:function(e){var r=this.cy(),a=bc(e),{weight:n,directed:i}=a,s=n,o=this.byGroup(),{nodes:l,edges:u}=o,f=l.length,v=f*f,h=function(J){return l.indexOf(J)},c=function(J){return l[J]},d=Array(v);for(var g=0;g<v;g++){var y=g%f,p=(g-y)/f;if(p===y)d[g]=0;else d[g]=1/0}var m=Array(v),b=Array(v);for(var E=0;E<u.length;E++){var A=u[E],M=A.source()[0],S=A.target()[0];if(M===S)continue;var P=h(M),N=h(S),R=P*f+N,I=s(A);if(d[R]>I)d[R]=I,m[R]=N,b[R]=A;if(!i){var w=N*f+P;if(!i&&d[w]>I)d[w]=I,m[w]=P,b[w]=A}}for(var x=0;x<f;x++)for(var T=0;T<f;T++){var D=T*f+x;for(var C=0;C<f;C++){var O=T*f+C,B=x*f+C;if(d[D]+d[B]<d[O])d[O]=d[D]+d[B],m[O]=m[D]}}var z=function(J){return(Re(J)?r.filter(J):J)[0]},V=function(J){return h(z(J))},k={distance:function(J,X){var _=V(J),Q=V(X);return d[_*f+Q]},path:function(J,X){var _=V(J),Q=V(X),q=c(_);if(_===Q)return q.collection();if(m[_*f+Q]==null)return r.collection();var te=r.collection(),Z=_,U;te.merge(q);while(_!==Q)Z=_,_=m[_*f+Q],U=b[Z*f+_],te.merge(U),te.merge(c(_));return te}};return k}},Ec=St({weight:function(e){return 1},directed:!1,root:null}),xc={bellmanFord:function(e){var r=this,a=Ec(e),{weight:n,directed:i,root:s}=a,o=n,l=this,u=this.cy(),f=this.byGroup(),{edges:v,nodes:h}=f,c=h.length,d=new nr,g=!1,y=[];s=u.collection(s)[0],v.unmergeBy(function(Ce){return Ce.isLoop()});var p=v.length,m=function(Se){var ge=d.get(Se.id());if(!ge)ge={},d.set(Se.id(),ge);return ge},b=function(Se){return(Re(Se)?u.$(Se):Se)[0]},E=function(Se){return m(b(Se)).dist},A=function(Se){var ge=arguments.length>1&&arguments[1]!==void 0?arguments[1]:s,ve=b(Se),ye=[],Ee=ve;for(;;){if(Ee==null)return r.spawn();var Pe=m(Ee),{edge:Me,pred:Ne}=Pe;if(ye.unshift(Ee[0]),Ee.same(ge)&&ye.length>0)break;if(Me!=null)ye.unshift(Me);Ee=Ne}return l.spawn(ye)};for(var M=0;M<c;M++){var S=h[M],P=m(S);if(S.same(s))P.dist=0;else P.dist=1/0;P.pred=null,P.edge=null}var N=!1,R=function(Se,ge,ve,ye,Ee,Pe){var Me=ye.dist+Pe;if(Me<Ee.dist&&!ve.same(ye.edge))Ee.dist=Me,Ee.pred=Se,Ee.edge=ve,N=!0};for(var I=1;I<c;I++){N=!1;for(var w=0;w<p;w++){var x=v[w],T=x.source(),D=x.target(),C=o(x),O=m(T),B=m(D);if(R(T,D,x,O,B,C),!i)R(D,T,x,B,O,C)}if(!N)break}if(N){var z=[];for(var V=0;V<p;V++){var k=v[V],G=k.source(),J=k.target(),X=o(k),_=m(G).dist,Q=m(J).dist;if(_+X<Q||!i&&Q+X<_){if(!g)_e("Graph contains a negative weight cycle for Bellman-Ford"),g=!0;if(e.findNegativeWeightCycles!==!1){var q=[];if(_+X<Q)q.push(G);if(!i&&Q+X<_)q.push(J);var te=q.length;for(var Z=0;Z<te;Z++){var U=q[Z],W=[U];W.push(m(U).edge);var j=m(U).pred;while(W.indexOf(j)===-1)W.push(j),W.push(m(j).edge),j=m(j).pred;W=W.slice(W.indexOf(j));var re=W[0].id(),ee=0;for(var de=2;de<W.length;de+=2)if(W[de].id()<re)re=W[de].id(),ee=de;W=W.slice(ee).concat(W.slice(0,ee)),W.push(W[0]);var Ae=W.map(function(Ce){return Ce.id()}).join(",");if(z.indexOf(Ae)===-1)y.push(l.spawn(W)),z.push(Ae)}}else break}}}return{distanceTo:E,pathTo:A,hasNegativeWeightCycle:g,negativeWeightCycles:y}}},Tc=Math.sqrt(2),Cc=function(e,r,a){if(a.length===0)it("Karger-Stein must be run on a connected (sub)graph");var n=a[e],i=n[1],s=n[2],o=r[i],l=r[s],u=a;for(var f=u.length-1;f>=0;f--){var v=u[f],h=v[1],c=v[2];if(r[h]===o&&r[c]===l||r[h]===l&&r[c]===o)u.splice(f,1)}for(var d=0;d<u.length;d++){var g=u[d];if(g[1]===l)u[d]=g.slice(),u[d][1]=o;else if(g[2]===l)u[d]=g.slice(),u[d][2]=o}for(var y=0;y<r.length;y++)if(r[y]===l)r[y]=o;return u},Ri=function(e,r,a,n){while(a>n){var i=Math.floor(Math.random()*r.length);r=Cc(i,e,r),a--}return r},Sc={kargerStein:function(){var e=this,r=this.byGroup(),{nodes:a,edges:n}=r;n.unmergeBy(function(B){return B.isLoop()});var i=a.length,s=n.length,o=Math.ceil(Math.pow(Math.log(i)/Math.LN2,2)),l=Math.floor(i/Tc);if(i<2){it("At least 2 nodes are required for Karger-Stein algorithm");return}var u=[];for(var f=0;f<s;f++){var v=n[f];u.push([f,a.indexOf(v.source()),a.indexOf(v.target())])}var h=1/0,c=[],d=Array(i),g=Array(i),y=Array(i),p=function(z,V){for(var k=0;k<i;k++)V[k]=z[k]};for(var m=0;m<=o;m++){for(var b=0;b<i;b++)g[b]=b;var E=Ri(g,u.slice(),i,l),A=E.slice();p(g,y);var M=Ri(g,E,l,2),S=Ri(y,A,l,2);if(M.length<=S.length&&M.length<h)h=M.length,c=M,p(g,d);else if(S.length<=M.length&&S.length<h)h=S.length,c=S,p(y,d)}var P=this.spawn(c.map(function(B){return n[B[0]]})),N=this.spawn(),R=this.spawn(),I=d[0];for(var w=0;w<d.length;w++){var x=d[w],T=a[w];if(x===I)N.merge(T);else R.merge(T)}var D=function(z){var V=e.spawn();return z.forEach(function(k){V.merge(k),k.connectedEdges().forEach(function(G){if(e.contains(G)&&!P.contains(G))V.merge(G)})}),V},C=[D(N),D(R)],O={cut:P,components:C,partition1:N,partition2:R};return O}},Pi,Dc=function(e){return{x:e.x,y:e.y}},Jn=function(e,r,a){return{x:e.x*r+a.x,y:e.y*r+a.y}},If=function(e,r,a){return{x:(e.x-a.x)/r,y:(e.y-a.y)/r}},ra=function(e){return{x:e[0],y:e[1]}},Ac=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,n=1/0;for(var i=r;i<a;i++){var s=e[i];if(isFinite(s))n=Math.min(s,n)}return n},Mc=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,n=-1/0;for(var i=r;i<a;i++){var s=e[i];if(isFinite(s))n=Math.max(s,n)}return n},Lc=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,n=0,i=0;for(var s=r;s<a;s++){var o=e[s];if(isFinite(o))n+=o,i++}return n/i},Rc=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;if(n)e=e.slice(r,a);else{if(a<e.length)e.splice(a,e.length-a);if(r>0)e.splice(0,r)}var o=0;for(var l=e.length-1;l>=0;l--){var u=e[l];if(s){if(!isFinite(u))e[l]=-1/0,o++}else e.splice(l,1)}if(i)e.sort(function(h,c){return h-c});var f=e.length,v=Math.floor(f/2);if(f%2!==0)return e[v+1+o];else return(e[v-1+o]+e[v+o])/2},Bf=function(e,r){if(r===0)return e;return Bf(r,e%r)},Pc=function(e){var r=e[0];for(var a=0;a<e.length;a++)if(!yf(e[a]))return 0;else if(a>0)r=Bf(r,e[a]);return r},Nc=function(e){return Math.PI*e/180},cn=function(e,r){return Math.atan2(r,e)-Math.PI/2},mo=Math.log2||function(t){return Math.log(t)/Math.log(2)},bo=function(e){if(e>0)return 1;else if(e<0)return-1;else return 0},Ur=function(e,r){return Math.sqrt(Br(e,r))},Br=function(e,r){var a=r.x-e.x,n=r.y-e.y;return a*a+n*n},Oc=function(e){var r=e.length,a=0;for(var n=0;n<r;n++)a+=e[n];for(var i=0;i<r;i++)e[i]=e[i]/a;return e},bt=function(e,r,a,n){return(1-n)*(1-n)*e+2*(1-n)*n*r+n*n*a},ia=function(e,r,a,n){return{x:bt(e.x,r.x,a.x,n),y:bt(e.y,r.y,a.y,n)}},Ic=function(e,r,a,n){var i={x:r.x-e.x,y:r.y-e.y},s=Ur(e,r),o={x:i.x/s,y:i.y/s};return a=a==null?0:a,n=n!=null?n:a*s,{x:e.x+o.x*n,y:e.y+o.y*n}},Ua=function(e,r,a){return Math.max(e,Math.min(a,r))},Ot=function(e){if(e==null)return{x1:1/0,y1:1/0,x2:-1/0,y2:-1/0,w:0,h:0};else if(e.x1!=null&&e.y1!=null){if(e.x2!=null&&e.y2!=null&&e.x2>=e.x1&&e.y2>=e.y1)return{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,w:e.x2-e.x1,h:e.y2-e.y1};else if(e.w!=null&&e.h!=null&&e.w>=0&&e.h>=0)return{x1:e.x1,y1:e.y1,x2:e.x1+e.w,y2:e.y1+e.h,w:e.w,h:e.h}}},Bc=function(e){return{x1:e.x1,x2:e.x2,w:e.w,y1:e.y1,y2:e.y2,h:e.h}},kc=function(e){e.x1=1/0,e.y1=1/0,e.x2=-1/0,e.y2=-1/0,e.w=0,e.h=0},Fc=function(e,r){e.x1=Math.min(e.x1,r.x1),e.x2=Math.max(e.x2,r.x2),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,r.y1),e.y2=Math.max(e.y2,r.y2),e.h=e.y2-e.y1},kf=function(e,r,a){e.x1=Math.min(e.x1,r),e.x2=Math.max(e.x2,r),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,a),e.y2=Math.max(e.y2,a),e.h=e.y2-e.y1},Sn=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return e.x1-=r,e.x2+=r,e.y1-=r,e.y2+=r,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},Dn=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0],a,n,i,s;if(r.length===1)a=n=i=s=r[0];else if(r.length===2)a=i=r[0],s=n=r[1];else if(r.length===4){var o=ht(r,4);a=o[0],n=o[1],i=o[2],s=o[3]}return e.x1-=s,e.x2+=n,e.y1-=a,e.y2+=i,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},ou=function(e,r){e.x1=r.x1,e.y1=r.y1,e.x2=r.x2,e.y2=r.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1},wo=function(e,r){if(e.x1>r.x2)return!1;if(r.x1>e.x2)return!1;if(e.x2<r.x1)return!1;if(r.x2<e.x1)return!1;if(e.y2<r.y1)return!1;if(r.y2<e.y1)return!1;if(e.y1>r.y2)return!1;if(r.y1>e.y2)return!1;return!0},mr=function(e,r,a){return e.x1<=r&&r<=e.x2&&e.y1<=a&&a<=e.y2},uu=function(e,r){return mr(e,r.x,r.y)},Ff=function(e,r){return mr(e,r.x1,r.y1)&&mr(e,r.x2,r.y2)},zc=(Pi=Math.hypot)!==null&&Pi!==void 0?Pi:function(t,e){return Math.sqrt(t*t+e*e)};function Vc(t,e){if(t.length<3)throw Error("Need at least 3 vertices");var r=function(P,N){return{x:P.x+N.x,y:P.y+N.y}},a=function(P,N){return{x:P.x-N.x,y:P.y-N.y}},n=function(P,N){return{x:P.x*N,y:P.y*N}},i=function(P,N){return P.x*N.y-P.y*N.x},s=function(P){var N=zc(P.x,P.y);return N===0?{x:0,y:0}:{x:P.x/N,y:P.y/N}},o=function(P){var N=0;for(var R=0;R<P.length;R++){var I=P[R],w=P[(R+1)%P.length];N+=I.x*w.y-w.x*I.y}return N/2},l=function(P,N,R,I){var w=a(N,P),x=a(I,R),T=i(w,x);if(Math.abs(T)<0.000000001)return r(P,n(w,0.5));var D=i(a(R,P),x)/T;return r(P,n(w,D))},u=t.map(function(S){return{x:S.x,y:S.y}});if(o(u)<0)u.reverse();var f=u.length,v=[];for(var h=0;h<f;h++){var c=u[h],d=u[(h+1)%f],g=a(d,c),y=s({x:g.y,y:-g.x});v.push(y)}var p=v.map(function(S,P){var N=r(u[P],n(S,e)),R=r(u[(P+1)%f],n(S,e));return{p1:N,p2:R}}),m=[];for(var b=0;b<f;b++){var E=p[(b-1+f)%f],A=p[b],M=l(E.p1,E.p2,A.p1,A.p2);m.push(M)}return m}function Gc(t,e,r,a,n,i){var s=Zc(t,e,r,a,n),o=Vc(s,i),l=Ot();return o.forEach(function(u){return kf(l,u.x,u.y)}),l}var zf=function(e,r,a,n,i,s,o){var l=arguments.length>7&&arguments[7]!==void 0?arguments[7]:"auto",u=l==="auto"?Cr(i,s):l,f=i/2,v=s/2;u=Math.min(u,f,v);var h=u!==f,c=u!==v,d;if(h){var g=a-f+u-o,y=n-v-o,p=a+f-u+o,m=y;if(d=br(e,r,a,n,g,y,p,m,!1),d.length>0)return d}if(c){var b=a+f+o,E=n-v+u-o,A=b,M=n+v-u+o;if(d=br(e,r,a,n,b,E,A,M,!1),d.length>0)return d}if(h){var S=a-f+u-o,P=n+v+o,N=a+f-u+o,R=P;if(d=br(e,r,a,n,S,P,N,R,!1),d.length>0)return d}if(c){var I=a-f-o,w=n-v+u-o,x=I,T=n+v-u+o;if(d=br(e,r,a,n,I,w,x,T,!1),d.length>0)return d}var D;{var C=a-f+u,O=n-v+u;if(D=Na(e,r,a,n,C,O,u+o),D.length>0&&D[0]<=C&&D[1]<=O)return[D[0],D[1]]}{var B=a+f-u,z=n-v+u;if(D=Na(e,r,a,n,B,z,u+o),D.length>0&&D[0]>=B&&D[1]<=z)return[D[0],D[1]]}{var V=a+f-u,k=n+v-u;if(D=Na(e,r,a,n,V,k,u+o),D.length>0&&D[0]>=V&&D[1]>=k)return[D[0],D[1]]}{var G=a-f+u,J=n+v-u;if(D=Na(e,r,a,n,G,J,u+o),D.length>0&&D[0]<=G&&D[1]>=J)return[D[0],D[1]]}return[]},Uc=function(e,r,a,n,i,s,o){var l=o,u=Math.min(a,i),f=Math.max(a,i),v=Math.min(n,s),h=Math.max(n,s);return u-l<=e&&e<=f+l&&v-l<=r&&r<=h+l},Hc=function(e,r,a,n,i,s,o,l,u){var f={x1:Math.min(a,o,i)-u,x2:Math.max(a,o,i)+u,y1:Math.min(n,l,s)-u,y2:Math.max(n,l,s)+u};if(e<f.x1||e>f.x2||r<f.y1||r>f.y2)return!1;else return!0},qc=function(e,r,a,n){a-=n;var i=r*r-4*e*a;if(i<0)return[];var s=Math.sqrt(i),o=2*e,l=(-r+s)/o,u=(-r-s)/o;return[l,u]},Yc=function(e,r,a,n,i){var s=0.00001;if(e===0)e=s;r/=e,a/=e,n/=e;var o,l,u,f,v,h,c,d;if(l=(3*a-r*r)/9,u=-(27*n)+r*(9*a-2*(r*r)),u/=54,o=l*l*l+u*u,i[1]=0,c=r/3,o>0){v=u+Math.sqrt(o),v=v<0?-Math.pow(-v,0.3333333333333333):Math.pow(v,0.3333333333333333),h=u-Math.sqrt(o),h=h<0?-Math.pow(-h,0.3333333333333333):Math.pow(h,0.3333333333333333),i[0]=-c+v+h,c+=(v+h)/2,i[4]=i[2]=-c,c=Math.sqrt(3)*(-h+v)/2,i[3]=c,i[5]=-c;return}if(i[5]=i[3]=0,o===0){d=u<0?-Math.pow(-u,0.3333333333333333):Math.pow(u,0.3333333333333333),i[0]=-c+2*d,i[4]=i[2]=-(d+c);return}l=-l,f=l*l*l,f=Math.acos(u/Math.sqrt(f)),d=2*Math.sqrt(l),i[0]=-c+d*Math.cos(f/3),i[2]=-c+d*Math.cos((f+2*Math.PI)/3),i[4]=-c+d*Math.cos((f+4*Math.PI)/3);return},Xc=function(e,r,a,n,i,s,o,l){var u=1*a*a-4*a*i+2*a*o+4*i*i-4*i*o+o*o+n*n-4*n*s+2*n*l+4*s*s-4*s*l+l*l,f=9*a*i-3*a*a-3*a*o-6*i*i+3*i*o+9*n*s-3*n*n-3*n*l-6*s*s+3*s*l,v=3*a*a-6*a*i+a*o-a*e+2*i*i+2*i*e-o*e+3*n*n-6*n*s+n*l-n*r+2*s*s+2*s*r-l*r,h=1*a*i-a*a+a*e-i*e+n*s-n*n+n*r-s*r,c=[];Yc(u,f,v,h,c);var d=0.0000001,g=[];for(var y=0;y<6;y+=2)if(Math.abs(c[y+1])<d&&c[y]>=0&&c[y]<=1)g.push(c[y]);g.push(1),g.push(0);var p=-1,m,b,E;for(var A=0;A<g.length;A++)if(m=Math.pow(1-g[A],2)*a+2*(1-g[A])*g[A]*i+g[A]*g[A]*o,b=Math.pow(1-g[A],2)*n+2*(1-g[A])*g[A]*s+g[A]*g[A]*l,E=Math.pow(m-e,2)+Math.pow(b-r,2),p>=0){if(E<p)p=E}else p=E;return p},Wc=function(e,r,a,n,i,s){var o=[e-a,r-n],l=[i-a,s-n],u=l[0]*l[0]+l[1]*l[1],f=o[0]*o[0]+o[1]*o[1],v=o[0]*l[0]+o[1]*l[1],h=v*v/u;if(v<0)return f;if(h>u)return(e-i)*(e-i)+(r-s)*(r-s);return f-h},Bt=function(e,r,a){var n,i,s,o,l,u=0;for(var f=0;f<a.length/2;f++){if(n=a[f*2],i=a[f*2+1],f+1<a.length/2)s=a[(f+1)*2],o=a[(f+1)*2+1];else s=a[(f+1-a.length/2)*2],o=a[(f+1-a.length/2)*2+1];if(n==e&&s==e);else if(n>=e&&e>=s||n<=e&&e<=s){if(l=(e-n)/(s-n)*(o-i)+i,l>r)u++}else continue}if(u%2===0)return!1;else return!0},sr=function(e,r,a,n,i,s,o,l,u){var f=Array(a.length),v;if(l[0]!=null)if(v=Math.atan(l[1]/l[0]),l[0]<0)v=v+Math.PI/2;else v=-v-Math.PI/2;else v=l;var h=Math.cos(-v),c=Math.sin(-v);for(var d=0;d<f.length/2;d++)f[d*2]=s/2*(a[d*2]*h-a[d*2+1]*c),f[d*2+1]=o/2*(a[d*2+1]*h+a[d*2]*c),f[d*2]+=n,f[d*2+1]+=i;var g;if(u>0){var y=Gn(f,-u);g=Vn(y)}else g=f;return Bt(e,r,g)},$c=function(e,r,a,n,i,s,o,l){var u=Array(a.length*2);for(var f=0;f<l.length;f++){var v=l[f];u[f*4+0]=v.startX,u[f*4+1]=v.startY,u[f*4+2]=v.stopX,u[f*4+3]=v.stopY;var h=Math.pow(v.cx-e,2)+Math.pow(v.cy-r,2);if(h<=Math.pow(v.radius,2))return!0}return Bt(e,r,u)},Vn=function(e){var r=Array(e.length/2),a,n,i,s,o,l,u,f;for(var v=0;v<e.length/4;v++){if(a=e[v*4],n=e[v*4+1],i=e[v*4+2],s=e[v*4+3],v<e.length/4-1)o=e[(v+1)*4],l=e[(v+1)*4+1],u=e[(v+1)*4+2],f=e[(v+1)*4+3];else o=e[0],l=e[1],u=e[2],f=e[3];var h=br(a,n,i,s,o,l,u,f,!0);r[v*2]=h[0],r[v*2+1]=h[1]}return r},Gn=function(e,r){var a=Array(e.length*2),n,i,s,o;for(var l=0;l<e.length/2;l++){if(n=e[l*2],i=e[l*2+1],l<e.length/2-1)s=e[(l+1)*2],o=e[(l+1)*2+1];else s=e[0],o=e[1];var u=o-i,f=-(s-n),v=Math.sqrt(u*u+f*f),h=u/v,c=f/v;a[l*4]=n+h*r,a[l*4+1]=i+c*r,a[l*4+2]=s+h*r,a[l*4+3]=o+c*r}return a},Kc=function(e,r,a,n,i,s){var o=a-e,l=n-r;o/=i,l/=s;var u=Math.sqrt(o*o+l*l),f=u-1;if(f<0)return[];var v=f/u;return[(a-e)*v+e,(n-r)*v+r]},Vr=function(e,r,a,n,i,s,o){return e-=i,r-=s,e/=a/2+o,r/=n/2+o,e*e+r*r<=1},Na=function(e,r,a,n,i,s,o){var l=[a-e,n-r],u=[e-i,r-s],f=l[0]*l[0]+l[1]*l[1],v=2*(u[0]*l[0]+u[1]*l[1]),h=u[0]*u[0]+u[1]*u[1]-o*o,c=v*v-4*f*h;if(c<0)return[];var d=(-v+Math.sqrt(c))/(2*f),g=(-v-Math.sqrt(c))/(2*f),y=Math.min(d,g),p=Math.max(d,g),m=[];if(y>=0&&y<=1)m.push(y);if(p>=0&&p<=1)m.push(p);if(m.length===0)return[];var b=m[0]*l[0]+e,E=m[0]*l[1]+r;if(m.length>1)if(m[0]==m[1])return[b,E];else{var A=m[1]*l[0]+e,M=m[1]*l[1]+r;return[b,E,A,M]}else return[b,E]},Ni=function(e,r,a){if(r<=e&&e<=a||a<=e&&e<=r)return e;else if(e<=r&&r<=a||a<=r&&r<=e)return r;else return a},br=function(e,r,a,n,i,s,o,l,u){var f=e-i,v=a-e,h=o-i,c=r-s,d=n-r,g=l-s,y=h*c-g*f,p=v*c-d*f,m=g*v-h*d;if(m!==0){var b=y/m,E=p/m,A=0.001,M=0-A,S=1+A;if(M<=b&&b<=S&&M<=E&&E<=S)return[e+b*v,r+b*d];else if(!u)return[];else return[e+b*v,r+b*d]}else if(y===0||p===0){if(Ni(e,a,o)===o)return[o,l];if(Ni(e,a,i)===i)return[i,s];if(Ni(i,o,a)===a)return[a,n];return[]}else return[]},Zc=function(e,r,a,n,i){var s=[],o=n/2,l=i/2,u=r,f=a;s.push({x:u+o*e[0],y:f+l*e[1]});for(var v=1;v<e.length/2;v++)s.push({x:u+o*e[v*2],y:f+l*e[v*2+1]});return s},Ha=function(e,r,a,n,i,s,o,l){var u=[],f,v=Array(a.length),h=!0;if(s==null)h=!1;var c;if(h){for(var d=0;d<v.length/2;d++)v[d*2]=a[d*2]*s+n,v[d*2+1]=a[d*2+1]*o+i;if(l>0){var g=Gn(v,-l);c=Vn(g)}else c=v}else c=a;var y,p,m,b;for(var E=0;E<c.length/2;E++){if(y=c[E*2],p=c[E*2+1],E<c.length/2-1)m=c[(E+1)*2],b=c[(E+1)*2+1];else m=c[0],b=c[1];if(f=br(e,r,n,i,y,p,m,b),f.length!==0)u.push(f[0],f[1])}return u},_c=function(e,r,a,n,i,s,o,l,u){var f=[],v,h=Array(a.length*2);u.forEach(function(m,b){if(b===0)h[h.length-2]=m.startX,h[h.length-1]=m.startY;else h[b*4-2]=m.startX,h[b*4-1]=m.startY;if(h[b*4]=m.stopX,h[b*4+1]=m.stopY,v=Na(e,r,n,i,m.cx,m.cy,m.radius),v.length!==0)f.push(v[0],v[1])});for(var c=0;c<h.length/4;c++)if(v=br(e,r,n,i,h[c*4],h[c*4+1],h[c*4+2],h[c*4+3],!1),v.length!==0)f.push(v[0],v[1]);if(f.length>2){var d=[f[0],f[1]],g=Math.pow(d[0]-e,2)+Math.pow(d[1]-r,2);for(var y=1;y<f.length/2;y++){var p=Math.pow(f[y*2]-e,2)+Math.pow(f[y*2+1]-r,2);if(p<=g)d[0]=f[y*2],d[1]=f[y*2+1],g=p}return d}return f},dn=function(e,r,a){var n=[e[0]-r[0],e[1]-r[1]],i=Math.sqrt(n[0]*n[0]+n[1]*n[1]),s=(i-a)/i;if(s<0)s=0.00001;return[r[0]+s*n[0],r[1]+s*n[1]]},Pt=function(e,r){var a=Xs(e,r);return a=Vf(a),a},Vf=function(e){var r,a,n=e.length/2,i=1/0,s=1/0,o=-1/0,l=-1/0;for(var u=0;u<n;u++)r=e[2*u],a=e[2*u+1],i=Math.min(i,r),o=Math.max(o,r),s=Math.min(s,a),l=Math.max(l,a);var f=2/(o-i),v=2/(l-s);for(var h=0;h<n;h++)r=e[2*h]=e[2*h]*f,a=e[2*h+1]=e[2*h+1]*v,i=Math.min(i,r),o=Math.max(o,r),s=Math.min(s,a),l=Math.max(l,a);if(s<-1)for(var c=0;c<n;c++)a=e[2*c+1]=e[2*c+1]+(-1-s);return e},Xs=function(e,r){var a=1/e*2*Math.PI,n=e%2===0?Math.PI/2+a/2:Math.PI/2;n+=r;var i=Array(e*2),s;for(var o=0;o<e;o++)s=o*a+n,i[2*o]=Math.cos(s),i[2*o+1]=Math.sin(-s);return i},Cr=function(e,r){return Math.min(e/4,r/4,8)},Gf=function(e,r){return Math.min(e/10,r/10,8)},Eo=function(){return 8},Qc=function(e,r,a){return[e-2*r+a,2*(r-e),e]},Ws=function(e,r){return{heightOffset:Math.min(15,0.05*r),widthOffset:Math.min(100,0.25*e),ctrlPtOffsetPct:0.05}};function Oi(t,e){function r(v){var h=[];for(var c=0;c<v.length;c++){var d=v[c],g=v[(c+1)%v.length],y={x:g.x-d.x,y:g.y-d.y},p={x:-y.y,y:y.x},m=Math.sqrt(p.x*p.x+p.y*p.y);h.push({x:p.x/m,y:p.y/m})}return h}function a(v,h){var c=1/0,d=-1/0,g=kt(v),y;try{for(g.s();!(y=g.n()).done;){var p=y.value,m=p.x*h.x+p.y*h.y;c=Math.min(c,m),d=Math.max(d,m)}}catch(b){g.e(b)}finally{g.f()}return{min:c,max:d}}function n(v,h){return!(v.max<h.min||h.max<v.min)}var i=[].concat(Bn(r(t)),Bn(r(e))),s=kt(i),o;try{for(s.s();!(o=s.n()).done;){var l=o.value,u=a(t,l),f=a(e,l);if(!n(u,f))return!1}}catch(v){s.e(v)}finally{s.f()}return!0}var Jc=St({dampingFactor:0.8,precision:0.000001,iterations:200,weight:function(e){return 1}}),jc={pageRank:function(e){var r=Jc(e),{dampingFactor:a,precision:n,iterations:i,weight:s}=r,o=this._private.cy,l=this.byGroup(),{nodes:u,edges:f}=l,v=u.length,h=v*v,c=f.length,d=Array(h),g=Array(v),y=(1-a)/v;for(var p=0;p<v;p++){for(var m=0;m<v;m++){var b=p*v+m;d[b]=0}g[p]=0}for(var E=0;E<c;E++){var A=f[E],M=A.data("source"),S=A.data("target");if(M===S)continue;var P=u.indexOfId(M),N=u.indexOfId(S),R=s(A),I=N*v+P;d[I]+=R,g[P]+=R}var w=1/v+y;for(var x=0;x<v;x++)if(g[x]===0)for(var T=0;T<v;T++){var D=T*v+x;d[D]=w}else for(var C=0;C<v;C++){var O=C*v+x;d[O]=d[O]/g[x]+y}var B=Array(v),z=Array(v),V;for(var k=0;k<v;k++)B[k]=1;for(var G=0;G<i;G++){for(var J=0;J<v;J++)z[J]=0;for(var X=0;X<v;X++)for(var _=0;_<v;_++){var Q=X*v+_;z[X]+=d[Q]*B[_]}Oc(z),V=B,B=z,z=V;var q=0;for(var te=0;te<v;te++){var Z=V[te]-B[te];q+=Z*Z}if(q<n)break}var U={rank:function(j){return j=o.collection(j)[0],B[u.indexOf(j)]}};return U}};var lu=St({root:null,weight:function(e){return 1},directed:!1,alpha:0}),sa={degreeCentralityNormalized:function(e){e=lu(e);var r=this.cy(),a=this.nodes(),n=a.length;if(!e.directed){var i={},s=0;for(var o=0;o<n;o++){var l=a[o];e.root=l;var u=this.degreeCentrality(e);if(s<u.degree)s=u.degree;i[l.id()]=u.degree}return{degree:function(b){if(s===0)return 0;if(Re(b))b=r.filter(b);return i[b.id()]/s}}}else{var f={},v={},h=0,c=0;for(var d=0;d<n;d++){var g=a[d],y=g.id();e.root=g;var p=this.degreeCentrality(e);if(h<p.indegree)h=p.indegree;if(c<p.outdegree)c=p.outdegree;f[y]=p.indegree,v[y]=p.outdegree}return{indegree:function(b){if(h==0)return 0;if(Re(b))b=r.filter(b);return f[b.id()]/h},outdegree:function(b){if(c===0)return 0;if(Re(b))b=r.filter(b);return v[b.id()]/c}}}},degreeCentrality:function(e){e=lu(e);var r=this.cy(),a=this,n=e,{root:i,weight:s,directed:o,alpha:l}=n;if(i=r.collection(i)[0],!o){var u=i.connectedEdges().intersection(a),f=u.length,v=0;for(var h=0;h<u.length;h++)v+=s(u[h]);return{degree:Math.pow(f,1-l)*Math.pow(v,l)}}else{var c=i.connectedEdges(),d=c.filter(function(M){return M.target().same(i)&&a.has(M)}),g=c.filter(function(M){return M.source().same(i)&&a.has(M)}),y=d.length,p=g.length,m=0,b=0;for(var E=0;E<d.length;E++)m+=s(d[E]);for(var A=0;A<g.length;A++)b+=s(g[A]);return{indegree:Math.pow(y,1-l)*Math.pow(m,l),outdegree:Math.pow(p,1-l)*Math.pow(b,l)}}}};sa.dc=sa.degreeCentrality;sa.dcn=sa.degreeCentralityNormalised=sa.degreeCentralityNormalized;var fu=St({harmonic:!0,weight:function(){return 1},directed:!1,root:null}),oa={closenessCentralityNormalized:function(e){var r=fu(e),{harmonic:a,weight:n,directed:i}=r,s=this.cy(),o={},l=0,u=this.nodes(),f=this.floydWarshall({weight:n,directed:i});for(var v=0;v<u.length;v++){var h=0,c=u[v];for(var d=0;d<u.length;d++)if(v!==d){var g=f.distance(c,u[d]);if(a)h+=1/g;else h+=g}if(!a)h=1/h;if(l<h)l=h;o[c.id()]=h}return{closeness:function(p){if(l==0)return 0;if(Re(p))p=s.filter(p)[0].id();else p=p.id();return o[p]/l}}},closenessCentrality:function(e){var r=fu(e),{root:a,weight:n,directed:i,harmonic:s}=r;a=this.filter(a)[0];var o=this.dijkstra({root:a,weight:n,directed:i}),l=0,u=this.nodes();for(var f=0;f<u.length;f++){var v=u[f];if(!v.same(a)){var h=o.distanceTo(v);if(s)l+=1/h;else l+=h}}return s?l:1/l}};oa.cc=oa.closenessCentrality;oa.ccn=oa.closenessCentralityNormalised=oa.closenessCentralityNormalized;var ed=St({weight:null,directed:!1}),$s={betweennessCentrality:function(e){var r=ed(e),{directed:a,weight:n}=r,i=n!=null,s=this.cy(),o=this.nodes(),l={},u={},f=0,v={set:function(b,E){if(u[b]=E,E>f)f=E},get:function(b){return u[b]}};for(var h=0;h<o.length;h++){var c=o[h],d=c.id();if(a)l[d]=c.outgoers().nodes();else l[d]=c.openNeighborhood().nodes();v.set(d,0)}var g=function(){var b=o[y].id(),E=[],A={},M={},S={},P=new en(function(X,_){return S[X]-S[_]});for(var N=0;N<o.length;N++){var R=o[N].id();A[R]=[],M[R]=0,S[R]=1/0}M[b]=1,S[b]=0,P.push(b);while(!P.empty()){var I=P.pop();if(E.push(I),i)for(var w=0;w<l[I].length;w++){var x=l[I][w],T=s.getElementById(I),D=void 0;if(T.edgesTo(x).length>0)D=T.edgesTo(x)[0];else D=x.edgesTo(T)[0];var C=n(D);if(x=x.id(),S[x]>S[I]+C){if(S[x]=S[I]+C,P.nodes.indexOf(x)<0)P.push(x);else P.updateItem(x);M[x]=0,A[x]=[]}if(S[x]==S[I]+C)M[x]=M[x]+M[I],A[x].push(I)}else for(var O=0;O<l[I].length;O++){var B=l[I][O].id();if(S[B]==1/0)P.push(B),S[B]=S[I]+1;if(S[B]==S[I]+1)M[B]=M[B]+M[I],A[B].push(I)}}var z={};for(var V=0;V<o.length;V++)z[o[V].id()]=0;while(E.length>0){var k=E.pop();for(var G=0;G<A[k].length;G++){var J=A[k][G];z[J]=z[J]+M[J]/M[k]*(1+z[k])}if(k!=o[y].id())v.set(k,v.get(k)+z[k])}};for(var y=0;y<o.length;y++)g();var p={betweenness:function(b){var E=s.collection(b).id();return v.get(E)},betweennessNormalized:function(b){if(f==0)return 0;var E=s.collection(b).id();return v.get(E)/f}};return p.betweennessNormalised=p.betweennessNormalized,p}};$s.bc=$s.betweennessCentrality;var td=St({expandFactor:2,inflateFactor:2,multFactor:1,maxIterations:20,attributes:[function(t){return 1}]}),rd=function(e){return td(e)},ad=function(e,r){var a=0;for(var n=0;n<r.length;n++)a+=r[n](e);return a},nd=function(e,r,a){for(var n=0;n<r;n++)e[n*r+n]=a},Uf=function(e,r){var a;for(var n=0;n<r;n++){a=0;for(var i=0;i<r;i++)a+=e[i*r+n];for(var s=0;s<r;s++)e[s*r+n]=e[s*r+n]/a}},id=function(e,r,a){var n=Array(a*a);for(var i=0;i<a;i++){for(var s=0;s<a;s++)n[i*a+s]=0;for(var o=0;o<a;o++)for(var l=0;l<a;l++)n[i*a+l]+=e[i*a+o]*r[o*a+l]}return n},sd=function(e,r,a){var n=e.slice(0);for(var i=1;i<a;i++)e=id(e,n,r);return e},od=function(e,r,a){var n=Array(r*r);for(var i=0;i<r*r;i++)n[i]=Math.pow(e[i],a);return Uf(n,r),n},ud=function(e,r,a,n){for(var i=0;i<a;i++){var s=Math.round(e[i]*Math.pow(10,n))/Math.pow(10,n),o=Math.round(r[i]*Math.pow(10,n))/Math.pow(10,n);if(s!==o)return!1}return!0},ld=function(e,r,a,n){var i=[];for(var s=0;s<r;s++){var o=[];for(var l=0;l<r;l++)if(Math.round(e[s*r+l]*1000)/1000>0)o.push(a[l]);if(o.length!==0)i.push(n.collection(o))}return i},fd=function(e,r){for(var a=0;a<e.length;a++)if(!r[a]||e[a].id()!==r[a].id())return!1;return!0},vd=function(e){for(var r=0;r<e.length;r++)for(var a=0;a<e.length;a++)if(r!=a&&fd(e[r],e[a]))e.splice(a,1);return e},vu=function(e){var r=this.nodes(),a=this.edges(),n=this.cy(),i=rd(e),s={};for(var o=0;o<r.length;o++)s[r[o].id()]=o;var l=r.length,u=l*l,f=Array(u),v;for(var h=0;h<u;h++)f[h]=0;for(var c=0;c<a.length;c++){var d=a[c],g=s[d.source().id()],y=s[d.target().id()],p=ad(d,i.attributes);f[g*l+y]+=p,f[y*l+g]+=p}nd(f,l,i.multFactor),Uf(f,l);var m=!0,b=0;while(m&&b<i.maxIterations){if(m=!1,v=sd(f,l,i.expandFactor),f=od(v,l,i.inflateFactor),!ud(f,v,u,4))m=!0;b++}var E=ld(f,l,r,n);return E=vd(E),E},hd={markovClustering:vu,mcl:vu},cd=function(e){return e},Hf=function(e,r){return Math.abs(r-e)},hu=function(e,r,a){return e+Hf(r,a)},cu=function(e,r,a){return e+Math.pow(a-r,2)},dd=function(e){return Math.sqrt(e)},gd=function(e,r,a){return Math.max(e,Hf(r,a))},Sa=function(e,r,a,n,i){var s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:cd,o=n,l,u;for(var f=0;f<e;f++)l=r(f),u=a(f),o=i(o,l,u);return s(o)},fa={euclidean:function(e,r,a){if(e>=2)return Sa(e,r,a,0,cu,dd);else return Sa(e,r,a,0,hu)},squaredEuclidean:function(e,r,a){return Sa(e,r,a,0,cu)},manhattan:function(e,r,a){return Sa(e,r,a,0,hu)},max:function(e,r,a){return Sa(e,r,a,-1/0,gd)}};fa["squared-euclidean"]=fa.squaredEuclidean;fa.squaredeuclidean=fa.squaredEuclidean;function jn(t,e,r,a,n,i){var s;if(st(t))s=t;else s=fa[t]||fa.euclidean;if(e===0&&st(t))return s(n,i);else return s(e,r,a,n,i)}var pd=St({k:2,m:2,sensitivityThreshold:0.0001,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),xo=function(e){return pd(e)},Un=function(e,r,a,n,i){var s=i!=="kMedoids",o=s?function(v){return a[v]}:function(v){return n[v](a)},l=function(h){return n[h](r)},u=a,f=r;return jn(e,n.length,o,l,u,f)},Ii=function(e,r,a){var n=a.length,i=Array(n),s=Array(n),o=Array(r),l=null;for(var u=0;u<n;u++)i[u]=e.min(a[u]).value,s[u]=e.max(a[u]).value;for(var f=0;f<r;f++){l=[];for(var v=0;v<n;v++)l[v]=Math.random()*(s[v]-i[v])+i[v];o[f]=l}return o},qf=function(e,r,a,n,i){var s=1/0,o=0;for(var l=0;l<r.length;l++){var u=Un(a,e,r[l],n,i);if(u<s)s=u,o=l}return o},Yf=function(e,r,a){var n=[],i=null;for(var s=0;s<r.length;s++)if(i=r[s],a[i.id()]===e)n.push(i);return n},yd=function(e,r,a){return Math.abs(r-e)<=a},md=function(e,r,a){for(var n=0;n<e.length;n++)for(var i=0;i<e[n].length;i++){var s=Math.abs(e[n][i]-r[n][i]);if(s>a)return!1}return!0},bd=function(e,r,a){for(var n=0;n<a;n++)if(e===r[n])return!0;return!1},du=function(e,r){var a=Array(r);if(e.length<50)for(var n=0;n<r;n++){var i=e[Math.floor(Math.random()*e.length)];while(bd(i,a,n))i=e[Math.floor(Math.random()*e.length)];a[n]=i}else for(var s=0;s<r;s++)a[s]=e[Math.floor(Math.random()*e.length)];return a},gu=function(e,r,a){var n=0;for(var i=0;i<r.length;i++)n+=Un("manhattan",r[i],e,a,"kMedoids");return n},wd=function(e){var r=this.cy(),a=this.nodes(),n=null,i=xo(e),s=Array(i.k),o={},l;if(i.testMode)if(typeof i.testCentroids==="number")i.testCentroids,l=Ii(a,i.k,i.attributes);else if(pt(i.testCentroids)==="object")l=i.testCentroids;else l=Ii(a,i.k,i.attributes);else l=Ii(a,i.k,i.attributes);var u=!0,f=0;while(u&&f<i.maxIterations){for(var v=0;v<a.length;v++)n=a[v],o[n.id()]=qf(n,l,i.distance,i.attributes,"kMeans");u=!1;for(var h=0;h<i.k;h++){var c=Yf(h,a,o);if(c.length===0)continue;var d=i.attributes.length,g=l[h],y=Array(d),p=Array(d);for(var m=0;m<d;m++){p[m]=0;for(var b=0;b<c.length;b++)n=c[b],p[m]+=i.attributes[m](n);if(y[m]=p[m]/c.length,!yd(y[m],g[m],i.sensitivityThreshold))u=!0}l[h]=y,s[h]=r.collection(c)}f++}return s},Ed=function(e){var r=this.cy(),a=this.nodes(),n=null,i=xo(e),s=Array(i.k),o,l={},u,f=Array(i.k);if(i.testMode)if(typeof i.testCentroids==="number");else if(pt(i.testCentroids)==="object")o=i.testCentroids;else o=du(a,i.k);else o=du(a,i.k);var v=!0,h=0;while(v&&h<i.maxIterations){for(var c=0;c<a.length;c++)n=a[c],l[n.id()]=qf(n,o,i.distance,i.attributes,"kMedoids");v=!1;for(var d=0;d<o.length;d++){var g=Yf(d,a,l);if(g.length===0)continue;f[d]=gu(o[d],g,i.attributes);for(var y=0;y<g.length;y++)if(u=gu(g[y],g,i.attributes),u<f[d])f[d]=u,o[d]=g[y],v=!0;s[d]=r.collection(g)}h++}return s},xd=function(e,r,a,n,i){var s,o;for(var l=0;l<r.length;l++)for(var u=0;u<e.length;u++)n[l][u]=Math.pow(a[l][u],i.m);for(var f=0;f<e.length;f++)for(var v=0;v<i.attributes.length;v++){s=0,o=0;for(var h=0;h<r.length;h++)s+=n[h][f]*i.attributes[v](r[h]),o+=n[h][f];e[f][v]=s/o}},Td=function(e,r,a,n,i){for(var s=0;s<e.length;s++)r[s]=e[s].slice();var o,l,u,f=2/(i.m-1);for(var v=0;v<a.length;v++)for(var h=0;h<n.length;h++){o=0;for(var c=0;c<a.length;c++)l=Un(i.distance,n[h],a[v],i.attributes,"cmeans"),u=Un(i.distance,n[h],a[c],i.attributes,"cmeans"),o+=Math.pow(l/u,f);e[h][v]=1/o}},Cd=function(e,r,a,n){var i=Array(a.k);for(var s=0;s<i.length;s++)i[s]=[];var o,l;for(var u=0;u<r.length;u++){o=-1/0,l=-1;for(var f=0;f<r[0].length;f++)if(r[u][f]>o)o=r[u][f],l=f;i[l].push(e[u])}for(var v=0;v<i.length;v++)i[v]=n.collection(i[v]);return i},pu=function(e){var r=this.cy(),a=this.nodes(),n=xo(e),i,s,o,l,u;l=Array(a.length);for(var f=0;f<a.length;f++)l[f]=Array(n.k);o=Array(a.length);for(var v=0;v<a.length;v++)o[v]=Array(n.k);for(var h=0;h<a.length;h++){var c=0;for(var d=0;d<n.k;d++)o[h][d]=Math.random(),c+=o[h][d];for(var g=0;g<n.k;g++)o[h][g]=o[h][g]/c}s=Array(n.k);for(var y=0;y<n.k;y++)s[y]=Array(n.attributes.length);u=Array(a.length);for(var p=0;p<a.length;p++)u[p]=Array(n.k);var m=!0,b=0;while(m&&b<n.maxIterations){if(m=!1,xd(s,a,o,u,n),Td(o,l,s,a,n),!md(o,l,n.sensitivityThreshold))m=!0;b++}return i=Cd(a,o,n,r),{clusters:i,degreeOfMembership:o}},Sd={kMeans:wd,kMedoids:Ed,fuzzyCMeans:pu,fcm:pu},Dd=St({distance:"euclidean",linkage:"min",mode:"threshold",threshold:1/0,addDendrogram:!1,dendrogramDepth:0,attributes:[]}),Ad={single:"min",complete:"max"},Md=function(e){var r=Dd(e),a=Ad[r.linkage];if(a!=null)r.linkage=a;return r},yu=function(e,r,a,n,i){var s=0,o=1/0,l,u=i.attributes,f=function(N,R){return jn(i.distance,u.length,function(I){return u[I](N)},function(I){return u[I](R)},N,R)};for(var v=0;v<e.length;v++){var h=e[v].key,c=a[h][n[h]];if(c<o)s=h,o=c}if(i.mode==="threshold"&&o>=i.threshold||i.mode==="dendrogram"&&e.length===1)return!1;var d=r[s],g=r[n[s]],y;if(i.mode==="dendrogram")y={left:d,right:g,key:d.key};else y={value:d.value.concat(g.value),key:d.key};e[d.index]=y,e.splice(g.index,1),r[d.key]=y;for(var p=0;p<e.length;p++){var m=e[p];if(d.key===m.key)l=1/0;else if(i.linkage==="min"){if(l=a[d.key][m.key],a[d.key][m.key]>a[g.key][m.key])l=a[g.key][m.key]}else if(i.linkage==="max"){if(l=a[d.key][m.key],a[d.key][m.key]<a[g.key][m.key])l=a[g.key][m.key]}else if(i.linkage==="mean")l=(a[d.key][m.key]*d.size+a[g.key][m.key]*g.size)/(d.size+g.size);else if(i.mode==="dendrogram")l=f(m.value,d.value);else l=f(m.value[0],d.value[0]);a[d.key][m.key]=a[m.key][d.key]=l}for(var b=0;b<e.length;b++){var E=e[b].key;if(n[E]===d.key||n[E]===g.key){var A=E;for(var M=0;M<e.length;M++){var S=e[M].key;if(a[E][S]<a[E][A])A=S}n[E]=A}e[b].index=b}return d.key=g.key=d.index=g.index=null,!0},aa=function(e,r,a){if(!e)return;if(e.value)r.push(e.value);else{if(e.left)aa(e.left,r);if(e.right)aa(e.right,r)}},Ks=function(e,r){if(!e)return"";if(e.left&&e.right){var a=Ks(e.left,r),n=Ks(e.right,r),i=r.add({group:"nodes",data:{id:a+","+n}});return r.add({group:"edges",data:{source:a,target:i.id()}}),r.add({group:"edges",data:{source:n,target:i.id()}}),i.id()}else if(e.value)return e.value.id()},Zs=function(e,r,a){if(!e)return[];var n=[],i=[],s=[];if(r===0){if(e.left)aa(e.left,n);if(e.right)aa(e.right,i);return s=n.concat(i),[a.collection(s)]}else if(r===1)if(e.value)return[a.collection(e.value)];else{if(e.left)aa(e.left,n);if(e.right)aa(e.right,i);return[a.collection(n),a.collection(i)]}else if(e.value)return[a.collection(e.value)];else{if(e.left)n=Zs(e.left,r-1,a);if(e.right)i=Zs(e.right,r-1,a);return n.concat(i)}},mu=function(e){var r=this.cy(),a=this.nodes(),n=Md(e),i=n.attributes,s=function(b,E){return jn(n.distance,i.length,function(A){return i[A](b)},function(A){return i[A](E)},b,E)},o=[],l=[],u=[],f=[];for(var v=0;v<a.length;v++){var h={value:n.mode==="dendrogram"?a[v]:[a[v]],key:v,index:v};o[v]=h,f[v]=h,l[v]=[],u[v]=0}for(var c=0;c<o.length;c++)for(var d=0;d<=c;d++){var g=void 0;if(n.mode==="dendrogram")g=c===d?1/0:s(o[c].value,o[d].value);else g=c===d?1/0:s(o[c].value[0],o[d].value[0]);if(l[c][d]=g,l[d][c]=g,g<l[c][u[c]])u[c]=d}var y=yu(o,f,l,u,n);while(y)y=yu(o,f,l,u,n);var p;if(n.mode==="dendrogram"){if(p=Zs(o[0],n.dendrogramDepth,r),n.addDendrogram)Ks(o[0],r)}else p=Array(o.length),o.forEach(function(m,b){m.key=m.index=null,p[b]=r.collection(m.value)});return p},Ld={hierarchicalClustering:mu,hca:mu},Rd=St({distance:"euclidean",preference:"median",damping:0.8,maxIterations:1000,minIterations:100,attributes:[]}),Pd=function(e){var{damping:r,preference:a}=e;if(!(0.5<=r&&r<1))it("Damping must range on [0.5, 1). Got: ".concat(r));var n=["median","mean","min","max"];if(!(n.some(function(i){return i===a})||he(a)))it("Preference must be one of [".concat(n.map(function(i){return"'".concat(i,"'")}).join(", "),"] or a number. Got: ").concat(a));return Rd(e)},Nd=function(e,r,a,n){var i=function(o,l){return n[l](o)};return-jn(e,n.length,function(s){return i(r,s)},function(s){return i(a,s)},r,a)},Od=function(e,r){var a=null;if(r==="median")a=Rc(e);else if(r==="mean")a=Lc(e);else if(r==="min")a=Ac(e);else if(r==="max")a=Mc(e);else a=r;return a},Id=function(e,r,a){var n=[];for(var i=0;i<e;i++)if(r[i*e+i]+a[i*e+i]>0)n.push(i);return n},bu=function(e,r,a){var n=[];for(var i=0;i<e;i++){var s=-1,o=-1/0;for(var l=0;l<a.length;l++){var u=a[l];if(r[i*e+u]>o)s=u,o=r[i*e+u]}if(s>0)n.push(s)}for(var f=0;f<a.length;f++)n[a[f]]=a[f];return n},Bd=function(e,r,a){var n=bu(e,r,a);for(var i=0;i<a.length;i++){var s=[];for(var o=0;o<n.length;o++)if(n[o]===a[i])s.push(o);var l=-1,u=-1/0;for(var f=0;f<s.length;f++){var v=0;for(var h=0;h<s.length;h++)v+=r[s[h]*e+s[f]];if(v>u)l=f,u=v}a[i]=s[l]}return n=bu(e,r,a),n},wu=function(e){var r=this.cy(),a=this.nodes(),n=Pd(e),i={};for(var s=0;s<a.length;s++)i[a[s].id()]=s;var o,l,u,f,v,h;o=a.length,l=o*o,u=Array(l);for(var c=0;c<l;c++)u[c]=-1/0;for(var d=0;d<o;d++)for(var g=0;g<o;g++)if(d!==g)u[d*o+g]=Nd(n.distance,a[d],a[g],n.attributes);f=Od(u,n.preference);for(var y=0;y<o;y++)u[y*o+y]=f;v=Array(l);for(var p=0;p<l;p++)v[p]=0;h=Array(l);for(var m=0;m<l;m++)h[m]=0;var b=Array(o),E=Array(o),A=Array(o);for(var M=0;M<o;M++)b[M]=0,E[M]=0,A[M]=0;var S=Array(o*n.minIterations);for(var P=0;P<S.length;P++)S[P]=0;var N;for(N=0;N<n.maxIterations;N++){for(var R=0;R<o;R++){var I=-1/0,w=-1/0,x=-1,T=0;for(var D=0;D<o;D++)if(b[D]=v[R*o+D],T=h[R*o+D]+u[R*o+D],T>=I)w=I,I=T,x=D;else if(T>w)w=T;for(var C=0;C<o;C++)v[R*o+C]=(1-n.damping)*(u[R*o+C]-I)+n.damping*b[C];v[R*o+x]=(1-n.damping)*(u[R*o+x]-w)+n.damping*b[x]}for(var O=0;O<o;O++){var B=0;for(var z=0;z<o;z++)b[z]=h[z*o+O],E[z]=Math.max(0,v[z*o+O]),B+=E[z];B-=E[O],E[O]=v[O*o+O],B+=E[O];for(var V=0;V<o;V++)h[V*o+O]=(1-n.damping)*Math.min(0,B-E[V])+n.damping*b[V];h[O*o+O]=(1-n.damping)*(B-E[O])+n.damping*b[O]}var k=0;for(var G=0;G<o;G++){var J=h[G*o+G]+v[G*o+G]>0?1:0;S[N%n.minIterations*o+G]=J,k+=J}if(k>0&&(N>=n.minIterations-1||N==n.maxIterations-1)){var X=0;for(var _=0;_<o;_++){A[_]=0;for(var Q=0;Q<n.minIterations;Q++)A[_]+=S[Q*o+_];if(A[_]===0||A[_]===n.minIterations)X++}if(X===o)break}}var q=Id(o,v,h),te=Bd(o,u,q),Z={};for(var U=0;U<q.length;U++)Z[q[U]]=[];for(var W=0;W<a.length;W++){var j=i[a[W].id()],re=te[j];if(re!=null)Z[re].push(a[W])}var ee=Array(q.length);for(var de=0;de<q.length;de++)ee[de]=r.collection(Z[q[de]]);return ee},kd={affinityPropagation:wu,ap:wu},Fd=St({root:void 0,directed:!1}),zd={hierholzer:function(e){if(!We(e)){var r=arguments;e={root:r[0],directed:r[1]}}var a=Fd(e),{root:n,directed:i}=a,s=this,o=!1,l,u,f;if(n)f=Re(n)?this.filter(n)[0].id():n[0].id();var v={},h={},c=s.edges().filter(function(b){return s.has(b.source())&&s.has(b.target())});if(i)s.forEach(function(b){var E=b.id();if(b.isNode()){var A=b.incomers().edges().intersection(c),M=b.outgoers().edges().intersection(c),S=A.length,P=M.length,N=S-P,R=P-S;if(N==1)if(l)o=!0;else l=E;else if(R==1)if(u)o=!0;else u=E;else if(R>1||N>1)o=!0;v[E]=[],M.forEach(function(I){return v[E].push(I.id())})}else h[E]=[void 0,b.target().id()]});else s.forEach(function(b){var E=b.id();if(b.isNode()){var A=b.connectedEdges().intersection(c),M=A.length+A.filter(function(S){return S.isLoop()}).length;if(M%2)if(!l)l=E;else if(!u)u=E;else o=!0;v[E]=[],A.forEach(function(S){return v[E].push(S.id())})}else h[E]=[b.source().id(),b.target().id()]});var d={found:!1,trail:void 0};if(o)return d;else if(u&&l){if(i){if(f&&u!=f)return d;f=u}else if(f&&u!=f&&l!=f)return d;else if(!f)f=u}else if(!f)f=s[0].id();var g=function(E){var A=E,M=[E],S,P,N;while(v[A].length){if(S=v[A].shift(),P=h[S][0],N=h[S][1],A!=N)v[N]=v[N].filter(function(R){return R!=S}),A=N;else if(!i&&A!=P)v[P]=v[P].filter(function(R){return R!=S}),A=P;M.unshift(S),M.unshift(A)}return M},y=[],p=[];p=g(f);while(p.length!=1)if(v[p[0]].length==0)y.unshift(s.getElementById(p.shift())),y.unshift(s.getElementById(p.shift()));else p=g(p.shift()).concat(p);y.unshift(s.getElementById(p.shift()));for(var m in v)if(v[m].length)return d;return d.found=!0,d.trail=this.spawn(y,!0),d}},gn=function(){var e=this,r={},a=0,n=0,i=[],s=[],o={},l=function(h,c){var d=s.length-1,g=[],y=e.spawn();while(s[d].x!=h||s[d].y!=c)g.push(s.pop().edge),d--;g.push(s.pop().edge),g.forEach(function(p){var m=p.connectedNodes().intersection(e);y.merge(p),m.forEach(function(b){var E=b.id(),A=b.connectedEdges().intersection(e);if(y.merge(b),!r[E].cutVertex)y.merge(A);else y.merge(A.filter(function(M){return M.isLoop()}))})}),i.push(y)},u=function(h,c,d){if(h===d)n+=1;r[c]={id:a,low:a++,cutVertex:!1};var g=e.getElementById(c).connectedEdges().intersection(e);if(g.size()===0)i.push(e.spawn(e.getElementById(c)));else{var y,p,m,b;g.forEach(function(E){if(y=E.source().id(),p=E.target().id(),m=y===c?p:y,m!==d){if(b=E.id(),!o[b])o[b]=!0,s.push({x:c,y:m,edge:E});if(!(m in r)){if(u(h,m,c),r[c].low=Math.min(r[c].low,r[m].low),r[c].id<=r[m].low)r[c].cutVertex=!0,l(c,m)}else r[c].low=Math.min(r[c].low,r[m].id)}})}};e.forEach(function(v){if(v.isNode()){var h=v.id();if(!(h in r))n=0,u(h,h),r[h].cutVertex=n>1}});var f=Object.keys(r).filter(function(v){return r[v].cutVertex}).map(function(v){return e.getElementById(v)});return{cut:e.spawn(f),components:i}},Vd={hopcroftTarjanBiconnected:gn,htbc:gn,htb:gn,hopcroftTarjanBiconnectedComponents:gn},pn=function(){var e=this,r={},a=0,n=[],i=[],s=e.spawn(e),o=function(u){i.push(u),r[u]={index:a,low:a++,explored:!1};var f=e.getElementById(u).connectedEdges().intersection(e);if(f.forEach(function(g){var y=g.target().id();if(y!==u){if(!(y in r))o(y);if(!r[y].explored)r[u].low=Math.min(r[u].low,r[y].low)}}),r[u].index===r[u].low){var v=e.spawn();for(;;){var h=i.pop();if(v.merge(e.getElementById(h)),r[h].low=r[u].index,r[h].explored=!0,h===u)break}var c=v.edgesWith(v),d=v.merge(c);n.push(d),s=s.difference(d)}};return e.forEach(function(l){if(l.isNode()){var u=l.id();if(!(u in r))o(u)}}),{cut:s,components:n}},Gd={tarjanStronglyConnected:pn,tsc:pn,tscc:pn,tarjanStronglyConnectedComponents:pn},Xf={};[Ga,gc,pc,mc,wc,xc,Sc,jc,sa,oa,$s,hd,Sd,Ld,kd,zd,Vd,Gd].forEach(function(t){Oe(Xf,t)});/*!
4
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ct(t,e){return fh(t)||dh(t,e)||fo(t,e)||gh()}function Bn(t){return vh(t)||ch(t)||fo(t)||ph()}function yh(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e);if(typeof a!="object")return a;throw TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function gf(t){var e=yh(t,"string");return typeof e=="symbol"?e:e+""}function yt(t){return yt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},yt(t)}function fo(t,e){if(t){if(typeof t=="string")return Ys(t,e);var r={}.toString.call(t).slice(8,-1);return r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set"?Array.from(t):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ys(t,e):void 0}}var gt=typeof window>"u"?null:window,Vo=gt?gt.navigator:null;gt&&gt.document;var mh=yt(""),pf=yt({}),bh=yt(function(){}),wh=typeof HTMLElement>"u"?"undefined":yt(HTMLElement),Ka=function(e){return e&&e.instanceString&&st(e.instanceString)?e.instanceString():null},Re=function(e){return e!=null&&yt(e)==mh},st=function(e){return e!=null&&yt(e)===bh},Je=function(e){return!zt(e)&&(Array.isArray?Array.isArray(e):e!=null&&e instanceof Array)},We=function(e){return e!=null&&yt(e)===pf&&!Je(e)&&e.constructor===Object},Eh=function(e){return e!=null&&yt(e)===pf},he=function(e){return e!=null&&yt(e)===yt(1)&&!isNaN(e)},yf=function(e){return he(e)&&Math.floor(e)===e},kn=function(e){if(wh==="undefined")return;else return e!=null&&e instanceof HTMLElement},zt=function(e){return Za(e)||mf(e)},Za=function(e){return Ka(e)==="collection"&&e._private.single},mf=function(e){return Ka(e)==="collection"&&!e._private.single},vo=function(e){return Ka(e)==="core"},bf=function(e){return Ka(e)==="stylesheet"},xh=function(e){return Ka(e)==="event"},xr=function(e){if(e===void 0||e===null)return!0;else if(e===""||e.match(/^\s+$/))return!0;return!1},Th=function(e){if(typeof HTMLElement>"u")return!1;else return e instanceof HTMLElement},Ch=function(e){return We(e)&&he(e.x1)&&he(e.x2)&&he(e.y1)&&he(e.y2)},Sh=function(e){return Eh(e)&&st(e.then)},Dh=function(){return Vo&&Vo.userAgent.match(/msie|trident|edge/i)},la=function(e,r){if(!r)r=function(){if(arguments.length===1)return arguments[0];else if(arguments.length===0)return"undefined";var i=[];for(var s=0;s<arguments.length;s++)i.push(arguments[s]);return i.join("$")};var a=function(){var i=this,s=arguments,o,l=r.apply(i,s),u=a.cache;if(!(o=u[l]))o=u[l]=e.apply(i,s);return o};return a.cache={},a},ho=la(function(t){return t.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()})}),Zn=la(function(t){return t.replace(/(-\w)/g,function(e){return e[1].toUpperCase()})}),wf=la(function(t,e){return t+e[0].toUpperCase()+e.substring(1)},function(t,e){return t+"$"+e}),Go=function(e){if(xr(e))return e;return e.charAt(0).toUpperCase()+e.substring(1)},yr=function(e,r){return e.slice(-1*r.length)===r},pt="(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))",Ah="rgb[a]?\\(("+pt+"[%]?)\\s*,\\s*("+pt+"[%]?)\\s*,\\s*("+pt+"[%]?)(?:\\s*,\\s*("+pt+"))?\\)",Mh="rgb[a]?\\((?:"+pt+"[%]?)\\s*,\\s*(?:"+pt+"[%]?)\\s*,\\s*(?:"+pt+"[%]?)(?:\\s*,\\s*(?:"+pt+"))?\\)",Lh="hsl[a]?\\(("+pt+")\\s*,\\s*("+pt+"[%])\\s*,\\s*("+pt+"[%])(?:\\s*,\\s*("+pt+"))?\\)",Rh="hsl[a]?\\((?:"+pt+")\\s*,\\s*(?:"+pt+"[%])\\s*,\\s*(?:"+pt+"[%])(?:\\s*,\\s*(?:"+pt+"))?\\)",Ph="\\#[0-9a-fA-F]{3}",Nh="\\#[0-9a-fA-F]{6}",Ef=function(e,r){if(e<r)return-1;else if(e>r)return 1;else return 0},Oh=function(e,r){return-1*Ef(e,r)},Oe=Object.assign!=null?Object.assign.bind(Object):function(t){var e=arguments;for(var r=1;r<e.length;r++){var a=e[r];if(a==null)continue;var n=Object.keys(a);for(var i=0;i<n.length;i++){var s=n[i];t[s]=a[s]}}return t},Ih=function(e){if(!(e.length===4||e.length===7)||e[0]!=="#")return;var r=e.length===4,a,n,i,s=16;if(r)a=parseInt(e[1]+e[1],s),n=parseInt(e[2]+e[2],s),i=parseInt(e[3]+e[3],s);else a=parseInt(e[1]+e[2],s),n=parseInt(e[3]+e[4],s),i=parseInt(e[5]+e[6],s);return[a,n,i]},Bh=function(e){var r,a,n,i,s,o,l,u;function f(d,g,y){if(y<0)y+=1;if(y>1)y-=1;if(y<0.16666666666666666)return d+(g-d)*6*y;if(y<0.5)return g;if(y<0.6666666666666666)return d+(g-d)*(0.6666666666666666-y)*6;return d}var v=new RegExp("^"+Lh+"$").exec(e);if(v){if(a=parseInt(v[1]),a<0)a=(360- -1*a%360)%360;else if(a>360)a=a%360;if(a/=360,n=parseFloat(v[2]),n<0||n>100)return;if(n=n/100,i=parseFloat(v[3]),i<0||i>100)return;if(i=i/100,s=v[4],s!==void 0){if(s=parseFloat(s),s<0||s>1)return}if(n===0)o=l=u=Math.round(i*255);else{var h=i<0.5?i*(1+n):i+n-i*n,c=2*i-h;o=Math.round(255*f(c,h,a+0.3333333333333333)),l=Math.round(255*f(c,h,a)),u=Math.round(255*f(c,h,a-0.3333333333333333))}r=[o,l,u,s]}return r},kh=function(e){var r,a=new RegExp("^"+Ah+"$").exec(e);if(a){r=[];var n=[];for(var i=1;i<=3;i++){var s=a[i];if(s[s.length-1]==="%")n[i]=!0;if(s=parseFloat(s),n[i])s=s/100*255;if(s<0||s>255)return;r.push(Math.floor(s))}var o=n[1]||n[2]||n[3],l=n[1]&&n[2]&&n[3];if(o&&!l)return;var u=a[4];if(u!==void 0){if(u=parseFloat(u),u<0||u>1)return;r.push(u)}}return r},Fh=function(e){return zh[e.toLowerCase()]},xf=function(e){return(Je(e)?e:null)||Fh(e)||Ih(e)||kh(e)||Bh(e)},zh={transparent:[0,0,0,0],aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],grey:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},Tf=function(e){var{map:r,keys:a}=e,n=a.length;for(var i=0;i<n;i++){var s=a[i];if(We(s))throw Error("Tried to set map with object key");if(i<a.length-1){if(r[s]==null)r[s]={};r=r[s]}else r[s]=e.value}},Cf=function(e){var{map:r,keys:a}=e,n=a.length;for(var i=0;i<n;i++){var s=a[i];if(We(s))throw Error("Tried to get map with object key");if(r=r[s],r==null)return r}return r},vn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function _a(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var di,Uo;function Qa(){if(Uo)return di;Uo=1;function t(e){var r=typeof e;return e!=null&&(r=="object"||r=="function")}return di=t,di}var gi,Ho;function Vh(){if(Ho)return gi;Ho=1;var t=typeof vn=="object"&&vn&&vn.Object===Object&&vn;return gi=t,gi}var pi,qo;function _n(){if(qo)return pi;qo=1;var t=Vh(),e=typeof self=="object"&&self&&self.Object===Object&&self,r=t||e||Function("return this")();return pi=r,pi}var yi,Yo;function Gh(){if(Yo)return yi;Yo=1;var t=_n(),e=function(){return t.Date.now()};return yi=e,yi}var mi,Xo;function Uh(){if(Xo)return mi;Xo=1;var t=/\s/;function e(r){var a=r.length;while(a--&&t.test(r.charAt(a)));return a}return mi=e,mi}var bi,Wo;function Hh(){if(Wo)return bi;Wo=1;var t=Uh(),e=/^\s+/;function r(a){return a?a.slice(0,t(a)+1).replace(e,""):a}return bi=r,bi}var wi,$o;function co(){if($o)return wi;$o=1;var t=_n(),e=t.Symbol;return wi=e,wi}var Ei,Ko;function qh(){if(Ko)return Ei;Ko=1;var t=co(),e=Object.prototype,{hasOwnProperty:r,toString:a}=e,n=t?t.toStringTag:void 0;function i(s){var o=r.call(s,n),l=s[n];try{s[n]=void 0;var u=!0}catch(v){}var f=a.call(s);if(u)if(o)s[n]=l;else delete s[n];return f}return Ei=i,Ei}var xi,Zo;function Yh(){if(Zo)return xi;Zo=1;var t=Object.prototype,e=t.toString;function r(a){return e.call(a)}return xi=r,xi}var Ti,_o;function Sf(){if(_o)return Ti;_o=1;var t=co(),e=qh(),r=Yh(),a="[object Null]",n="[object Undefined]",i=t?t.toStringTag:void 0;function s(o){if(o==null)return o===void 0?n:a;return i&&i in Object(o)?e(o):r(o)}return Ti=s,Ti}var Ci,Qo;function Xh(){if(Qo)return Ci;Qo=1;function t(e){return e!=null&&typeof e=="object"}return Ci=t,Ci}var Si,Jo;function Ja(){if(Jo)return Si;Jo=1;var t=Sf(),e=Xh(),r="[object Symbol]";function a(n){return typeof n=="symbol"||e(n)&&t(n)==r}return Si=a,Si}var Di,jo;function Wh(){if(jo)return Di;jo=1;var t=Hh(),e=Qa(),r=Ja(),a=NaN,n=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,s=/^0o[0-7]+$/i,o=parseInt;function l(u){if(typeof u=="number")return u;if(r(u))return a;if(e(u)){var f=typeof u.valueOf=="function"?u.valueOf():u;u=e(f)?f+"":f}if(typeof u!="string")return u===0?u:+u;u=t(u);var v=i.test(u);return v||s.test(u)?o(u.slice(2),v?2:8):n.test(u)?a:+u}return Di=l,Di}var Ai,eu;function $h(){if(eu)return Ai;eu=1;var t=Qa(),e=Gh(),r=Wh(),a="Expected a function",{max:n,min:i}=Math;function s(o,l,u){var f,v,h,c,d,g,y=0,p=!1,m=!1,b=!0;if(typeof o!="function")throw TypeError(a);if(l=r(l)||0,t(u))p=!!u.leading,m="maxWait"in u,h=m?n(r(u.maxWait)||0,l):h,b="trailing"in u?!!u.trailing:b;function E(x){var T=f,D=v;return f=v=void 0,y=x,c=o.apply(D,T),c}function A(x){return y=x,d=setTimeout(P,l),p?E(x):c}function M(x){var T=x-g,D=x-y,C=l-T;return m?i(C,h-D):C}function S(x){var T=x-g,D=x-y;return g===void 0||T>=l||T<0||m&&D>=h}function P(){var x=e();if(S(x))return N(x);d=setTimeout(P,M(x))}function N(x){if(d=void 0,b&&f)return E(x);return f=v=void 0,c}function R(){if(d!==void 0)clearTimeout(d);y=0,f=g=v=d=void 0}function I(){return d===void 0?c:N(e())}function w(){var x=e(),T=S(x);if(f=arguments,v=this,g=x,T){if(d===void 0)return A(g);if(m)return clearTimeout(d),d=setTimeout(P,l),E(g)}if(d===void 0)d=setTimeout(P,l);return c}return w.cancel=R,w.flush=I,w}return Ai=s,Ai}var Kh=$h(),ja=_a(Kh),Mi=gt?gt.performance:null,Df=Mi&&Mi.now?function(){return Mi.now()}:function(){return Date.now()},Zh=function(){if(gt){if(gt.requestAnimationFrame)return function(t){gt.requestAnimationFrame(t)};else if(gt.mozRequestAnimationFrame)return function(t){gt.mozRequestAnimationFrame(t)};else if(gt.webkitRequestAnimationFrame)return function(t){gt.webkitRequestAnimationFrame(t)};else if(gt.msRequestAnimationFrame)return function(t){gt.msRequestAnimationFrame(t)}}return function(t){if(t)setTimeout(function(){t(Df())},16.666666666666668)}}(),Fn=function(e){return Zh(e)},ir=Df,Fr=9261,Af=65599,ta=5381,Mf=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Fr,a=r,n;for(;;){if(n=e.next(),n.done)break;a=a*Af+n.value|0}return a},za=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Fr;return r*Af+e|0},Va=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ta;return(r<<5)+r+e|0},_h=function(e,r){return e*2097152+r},hr=function(e){return e[0]*2097152+e[1]},hn=function(e,r){return[za(e[0],r[0]),Va(e[1],r[1])]},tu=function(e,r){var a={value:0,done:!1},n=0,i=e.length,s={next:function(){if(n<i)a.value=e[n++];else a.done=!0;return a}};return Mf(s,r)},Gr=function(e,r){var a={value:0,done:!1},n=0,i=e.length,s={next:function(){if(n<i)a.value=e.charCodeAt(n++);else a.done=!0;return a}};return Mf(s,r)},Lf=function(){return Qh(arguments)},Qh=function(e){var r;for(var a=0;a<e.length;a++){var n=e[a];if(a===0)r=Gr(n);else r=Gr(n,r)}return r};function Jh(t,e,r,a,n){var i=n*Math.PI/180,s=Math.cos(i)*(t-r)-Math.sin(i)*(e-a)+r,o=Math.sin(i)*(t-r)+Math.cos(i)*(e-a)+a;return{x:s,y:o}}var jh=function(e,r,a,n,i,s){return{x:(e-a)*i+a,y:(r-n)*s+n}};function ec(t,e,r){if(r===0)return t;var a=(e.x1+e.x2)/2,n=(e.y1+e.y2)/2,i=e.w/e.h,s=1/i,o=Jh(t.x,t.y,a,n,r),l=jh(o.x,o.y,a,n,i,s);return{x:l.x,y:l.y}}var ru=!0,tc=console.warn!=null,rc=console.trace!=null,go=Number.MAX_SAFE_INTEGER||9007199254740991,Rf=function(){return!0},zn=function(){return!1},au=function(){return 0},po=function(){},it=function(e){throw Error(e)},Pf=function(e){if(e!==void 0)ru=!!e;else return ru},_e=function(e){if(!Pf())return;if(tc)console.warn(e);else if(console.log(e),rc)console.trace()},ac=function(e){return Oe({},e)},Jt=function(e){if(e==null)return e;if(Je(e))return e.slice();else if(We(e))return ac(e);else return e},nc=function(e){return e.slice()},Nf=function(e,r){for(r=e="";e++<36;r+=e*51&52?(e^15?8^Math.random()*(e^20?16:4):4).toString(16):"-");return r},ic={},Of=function(){return ic},St=function(e){var r=Object.keys(e);return function(a){var n={};for(var i=0;i<r.length;i++){var s=r[i],o=a==null?void 0:a[s];n[s]=o===void 0?e[s]:o}return n}},Tr=function(e,r,a){for(var n=e.length-1;n>=0;n--)if(e[n]===r)e.splice(n,1)},yo=function(e){e.splice(0,e.length)},sc=function(e,r){for(var a=0;a<r.length;a++){var n=r[a];e.push(n)}},Nt=function(e,r,a){if(a)r=wf(a,r);return e[r]},Qt=function(e,r,a,n){if(a)r=wf(a,r);e[r]=n},oc=function(){function t(){Mr(this,t),this._obj={}}return Lr(t,[{key:"set",value:function(r,a){return this._obj[r]=a,this}},{key:"delete",value:function(r){return this._obj[r]=void 0,this}},{key:"clear",value:function(){this._obj={}}},{key:"has",value:function(r){return this._obj[r]!==void 0}},{key:"get",value:function(r){return this._obj[r]}}])}(),nr=typeof Map<"u"?Map:oc,uc="undefined",lc=function(){function t(e){if(Mr(this,t),this._obj=Object.create(null),this.size=0,e!=null){var r;if(e.instanceString!=null&&e.instanceString()===this.instanceString())r=e.toArray();else r=e;for(var a=0;a<r.length;a++)this.add(r[a])}}return Lr(t,[{key:"instanceString",value:function(){return"set"}},{key:"add",value:function(r){var a=this._obj;if(a[r]!==1)a[r]=1,this.size++}},{key:"delete",value:function(r){var a=this._obj;if(a[r]===1)a[r]=0,this.size--}},{key:"clear",value:function(){this._obj=Object.create(null)}},{key:"has",value:function(r){return this._obj[r]===1}},{key:"toArray",value:function(){var r=this;return Object.keys(this._obj).filter(function(a){return r.has(a)})}},{key:"forEach",value:function(r,a){return this.toArray().forEach(r,a)}}])}(),da=(typeof Set>"u"?"undefined":yt(Set))!==uc?Set:lc,Qn=function(e,r){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0||r===void 0||!vo(e)){it("An element must have a core reference and parameters set");return}var n=r.group;if(n==null)if(r.data&&r.data.source!=null&&r.data.target!=null)n="edges";else n="nodes";if(n!=="nodes"&&n!=="edges"){it("An element must be of type `nodes` or `edges`; you specified `"+n+"`");return}this.length=1,this[0]=this;var i=this._private={cy:e,single:!0,data:r.data||{},position:r.position||{x:0,y:0},autoWidth:void 0,autoHeight:void 0,autoPadding:void 0,compoundBoundsClean:!1,listeners:[],group:n,style:{},rstyle:{},styleCxts:[],styleKeys:{},removed:!0,selected:r.selected?!0:!1,selectable:r.selectable===void 0?!0:r.selectable?!0:!1,locked:r.locked?!0:!1,grabbed:!1,grabbable:r.grabbable===void 0?!0:r.grabbable?!0:!1,pannable:r.pannable===void 0?n==="edges"?!0:!1:r.pannable?!0:!1,active:!1,classes:new da,animation:{current:[],queue:[]},rscratch:{},scratch:r.scratch||{},edges:[],children:[],parent:r.parent&&r.parent.isNode()?r.parent:null,traversalCache:{},backgrounding:!1,bbCache:null,bbCacheShift:{x:0,y:0},bodyBounds:null,overlayBounds:null,labelBounds:{all:null,source:null,target:null,main:null},arrowBounds:{source:null,target:null,"mid-source":null,"mid-target":null}};if(i.position.x==null)i.position.x=0;if(i.position.y==null)i.position.y=0;if(r.renderedPosition){var s=r.renderedPosition,o=e.pan(),l=e.zoom();i.position={x:(s.x-o.x)/l,y:(s.y-o.y)/l}}var u=[];if(Je(r.classes))u=r.classes;else if(Re(r.classes))u=r.classes.split(/\s+/);for(var f=0,v=u.length;f<v;f++){var h=u[f];if(!h||h==="")continue;i.classes.add(h)}if(this.createEmitter(),a===void 0||a)this.restore();var c=r.style||r.css;if(c)_e("Setting a `style` bypass at element creation should be done only when absolutely necessary. Try to use the stylesheet instead."),this.style(c)},nu=function(e){return e={bfs:e.bfs||!e.dfs,dfs:e.dfs||!e.bfs},function(a,n,i){var s;if(We(a)&&!zt(a))s=a,a=s.roots||s.root,n=s.visit,i=s.directed;i=arguments.length===2&&!st(n)?n:i,n=st(n)?n:function(){};var o=this._private.cy,l=a=Re(a)?this.filter(a):a,u=[],f=[],v={},h={},c={},d=0,g,y=this.byGroup(),{nodes:p,edges:m}=y;for(var b=0;b<l.length;b++){var E=l[b],A=E.id();if(E.isNode()){if(u.unshift(E),e.bfs)c[A]=!0,f.push(E);h[A]=0}}var M=function(){var x=e.bfs?u.shift():u.pop(),T=x.id();if(e.dfs){if(c[T])return 0;c[T]=!0,f.push(x)}var D=h[T],C=v[T],O=C!=null?C.source():null,B=C!=null?C.target():null,z=C==null?void 0:x.same(O)?B[0]:O[0],V;if(V=n(x,C,z,d++,D),V===!0)return g=x,1;if(V===!1)return 1;var k=x.connectedEdges().filter(function(Q){return(!i||Q.source().same(x))&&m.has(Q)});for(var G=0;G<k.length;G++){var J=k[G],X=J.connectedNodes().filter(function(Q){return!Q.same(x)&&p.has(Q)}),_=X.id();if(X.length!==0&&!c[_]){if(X=X[0],u.push(X),e.bfs)c[_]=!0,f.push(X);v[_]=J,h[_]=h[T]+1}}},S;while(u.length!==0){if(S=M(),S===0)continue;if(S===1)break}var P=o.collection();for(var N=0;N<f.length;N++){var R=f[N],I=v[R.id()];if(I!=null)P.push(I);P.push(R)}return{path:o.collection(P),found:o.collection(g)}}},Ga={breadthFirstSearch:nu({bfs:!0}),depthFirstSearch:nu({dfs:!0})};Ga.bfs=Ga.breadthFirstSearch;Ga.dfs=Ga.depthFirstSearch;var Cn={exports:{}},fc=Cn.exports,iu;function vc(){if(iu)return Cn.exports;return iu=1,function(t,e){(function(){var r,a,n,i,s,o,l,u,f,v,h,c,d,g,y;n=Math.floor,v=Math.min,a=function(p,m){if(p<m)return-1;if(p>m)return 1;return 0},f=function(p,m,b,E,A){var M;if(b==null)b=0;if(A==null)A=a;if(b<0)throw Error("lo must be non-negative");if(E==null)E=p.length;while(b<E)if(M=n((b+E)/2),A(m,p[M])<0)E=M;else b=M+1;return[].splice.apply(p,[b,b-b].concat(m)),m},o=function(p,m,b){if(b==null)b=a;return p.push(m),g(p,0,p.length-1,b)},s=function(p,m){var b,E;if(m==null)m=a;if(b=p.pop(),p.length)E=p[0],p[0]=b,y(p,0,m);else E=b;return E},u=function(p,m,b){var E;if(b==null)b=a;return E=p[0],p[0]=m,y(p,0,b),E},l=function(p,m,b){var E;if(b==null)b=a;if(p.length&&b(p[0],m)<0)E=[p[0],m],m=E[0],p[0]=E[1],y(p,0,b);return m},i=function(p,m){var b,E,A,M,S,P;if(m==null)m=a;M=function(){P=[];for(var N=0,R=n(p.length/2);0<=R?N<R:N>R;0<=R?N++:N--)P.push(N);return P}.apply(this).reverse(),S=[];for(E=0,A=M.length;E<A;E++)b=M[E],S.push(y(p,b,m));return S},d=function(p,m,b){var E;if(b==null)b=a;if(E=p.indexOf(m),E===-1)return;return g(p,0,E,b),y(p,E,b)},h=function(p,m,b){var E,A,M,S,P;if(b==null)b=a;if(A=p.slice(0,m),!A.length)return A;i(A,b),P=p.slice(m);for(M=0,S=P.length;M<S;M++)E=P[M],l(A,E,b);return A.sort(b).reverse()},c=function(p,m,b){var E,A,M,S,P,N,R,I,w;if(b==null)b=a;if(m*10<=p.length){if(M=p.slice(0,m).sort(b),!M.length)return M;A=M[M.length-1],R=p.slice(m);for(S=0,N=R.length;S<N;S++)if(E=R[S],b(E,A)<0)f(M,E,0,null,b),M.pop(),A=M[M.length-1];return M}i(p,b),w=[];for(P=0,I=v(m,p.length);0<=I?P<I:P>I;0<=I?++P:--P)w.push(s(p,b));return w},g=function(p,m,b,E){var A,M,S;if(E==null)E=a;A=p[b];while(b>m){if(S=b-1>>1,M=p[S],E(A,M)<0){p[b]=M,b=S;continue}break}return p[b]=A},y=function(p,m,b){var E,A,M,S,P;if(b==null)b=a;A=p.length,P=m,M=p[m],E=2*m+1;while(E<A){if(S=E+1,S<A&&!(b(p[E],p[S])<0))E=S;p[m]=p[E],m=E,E=2*m+1}return p[m]=M,g(p,P,m,b)},r=function(){p.push=o,p.pop=s,p.replace=u,p.pushpop=l,p.heapify=i,p.updateItem=d,p.nlargest=h,p.nsmallest=c;function p(m){this.cmp=m!=null?m:a,this.nodes=[]}return p.prototype.push=function(m){return o(this.nodes,m,this.cmp)},p.prototype.pop=function(){return s(this.nodes,this.cmp)},p.prototype.peek=function(){return this.nodes[0]},p.prototype.contains=function(m){return this.nodes.indexOf(m)!==-1},p.prototype.replace=function(m){return u(this.nodes,m,this.cmp)},p.prototype.pushpop=function(m){return l(this.nodes,m,this.cmp)},p.prototype.heapify=function(){return i(this.nodes,this.cmp)},p.prototype.updateItem=function(m){return d(this.nodes,m,this.cmp)},p.prototype.clear=function(){return this.nodes=[]},p.prototype.empty=function(){return this.nodes.length===0},p.prototype.size=function(){return this.nodes.length},p.prototype.clone=function(){var m=new p;return m.nodes=this.nodes.slice(0),m},p.prototype.toArray=function(){return this.nodes.slice(0)},p.prototype.insert=p.prototype.push,p.prototype.top=p.prototype.peek,p.prototype.front=p.prototype.peek,p.prototype.has=p.prototype.contains,p.prototype.copy=p.prototype.clone,p}(),function(p,m){return t.exports=m()}(this,function(){return r})}).call(fc)}(Cn),Cn.exports}var Li,su;function hc(){if(su)return Li;return su=1,Li=vc(),Li}var cc=hc(),en=_a(cc),dc=St({root:null,weight:function(e){return 1},directed:!1}),gc={dijkstra:function(e){if(!We(e)){var r=arguments;e={root:r[0],weight:r[1],directed:r[2]}}var a=dc(e),{root:n,weight:i,directed:s}=a,o=this,l=i,u=Re(n)?this.filter(n)[0]:n[0],f={},v={},h={},c=this.byGroup(),{nodes:d,edges:g}=c;g.unmergeBy(function(D){return D.isLoop()});var y=function(C){return f[C.id()]},p=function(C,O){f[C.id()]=O,m.updateItem(C)},m=new en(function(D,C){return y(D)-y(C)});for(var b=0;b<d.length;b++){var E=d[b];f[E.id()]=E.same(u)?0:1/0,m.push(E)}var A=function(C,O){var B=(s?C.edgesTo(O):C.edgesWith(O)).intersect(g),z=1/0,V;for(var k=0;k<B.length;k++){var G=B[k],J=l(G);if(J<z||!V)z=J,V=G}return{edge:V,dist:z}};while(m.size()>0){var M=m.pop(),S=y(M),P=M.id();if(h[P]=S,S===1/0)continue;var N=M.neighborhood().intersect(d);for(var R=0;R<N.length;R++){var I=N[R],w=I.id(),x=A(M,I),T=S+x.dist;if(T<y(I))p(I,T),v[w]={node:M,edge:x.edge}}}return{distanceTo:function(C){var O=Re(C)?d.filter(C)[0]:C[0];return h[O.id()]},pathTo:function(C){var O=Re(C)?d.filter(C)[0]:C[0],B=[],z=O,V=z.id();if(O.length>0){B.unshift(O);while(v[V]){var k=v[V];B.unshift(k.edge),B.unshift(k.node),z=k.node,V=z.id()}}return o.spawn(B)}}}},pc={kruskal:function(e){e=e||function(b){return 1};var r=this.byGroup(),{nodes:a,edges:n}=r,i=a.length,s=Array(i),o=a,l=function(E){for(var A=0;A<s.length;A++){var M=s[A];if(M.has(E))return A}};for(var u=0;u<i;u++)s[u]=this.spawn(a[u]);var f=n.sort(function(b,E){return e(b)-e(E)});for(var v=0;v<f.length;v++){var h=f[v],c=h.source()[0],d=h.target()[0],g=l(c),y=l(d),p=s[g],m=s[y];if(g!==y)o.merge(h),p.merge(m),s.splice(y,1)}return o}},yc=St({root:null,goal:null,weight:function(e){return 1},heuristic:function(e){return 0},directed:!1}),mc={aStar:function(e){var r=this.cy(),a=yc(e),{root:n,goal:i,heuristic:s,directed:o,weight:l}=a;n=r.collection(n)[0],i=r.collection(i)[0];var u=n.id(),f=i.id(),v={},h={},c={},d=new en(function(V,k){return h[V.id()]-h[k.id()]}),g=new da,y={},p={},m=function(k,G){d.push(k),g.add(G)},b,E,A=function(){b=d.pop(),E=b.id(),g.delete(E)},M=function(k){return g.has(k)};m(n,u),v[u]=0,h[u]=s(n);var S=0;while(d.size()>0){if(A(),S++,E===f){var P=[],N=i,R=f,I=p[R];for(;;){if(P.unshift(N),I!=null)P.unshift(I);if(N=y[R],N==null)break;R=N.id(),I=p[R]}return{found:!0,distance:v[E],path:this.spawn(P),steps:S}}c[E]=!0;var w=b._private.edges;for(var x=0;x<w.length;x++){var T=w[x];if(!this.hasElementWithId(T.id()))continue;if(o&&T.data("source")!==E)continue;var D=T.source(),C=T.target(),O=D.id()!==E?D:C,B=O.id();if(!this.hasElementWithId(B))continue;if(c[B])continue;var z=v[E]+l(T);if(!M(B)){v[B]=z,h[B]=z+s(O),m(O,B),y[B]=b,p[B]=T;continue}if(z<v[B])v[B]=z,h[B]=z+s(O),d.updateItem(O),y[B]=b,p[B]=T}}return{found:!1,distance:void 0,path:void 0,steps:S}}},bc=St({weight:function(e){return 1},directed:!1}),wc={floydWarshall:function(e){var r=this.cy(),a=bc(e),{weight:n,directed:i}=a,s=n,o=this.byGroup(),{nodes:l,edges:u}=o,f=l.length,v=f*f,h=function(J){return l.indexOf(J)},c=function(J){return l[J]},d=Array(v);for(var g=0;g<v;g++){var y=g%f,p=(g-y)/f;if(p===y)d[g]=0;else d[g]=1/0}var m=Array(v),b=Array(v);for(var E=0;E<u.length;E++){var A=u[E],M=A.source()[0],S=A.target()[0];if(M===S)continue;var P=h(M),N=h(S),R=P*f+N,I=s(A);if(d[R]>I)d[R]=I,m[R]=N,b[R]=A;if(!i){var w=N*f+P;if(!i&&d[w]>I)d[w]=I,m[w]=P,b[w]=A}}for(var x=0;x<f;x++)for(var T=0;T<f;T++){var D=T*f+x;for(var C=0;C<f;C++){var O=T*f+C,B=x*f+C;if(d[D]+d[B]<d[O])d[O]=d[D]+d[B],m[O]=m[D]}}var z=function(J){return(Re(J)?r.filter(J):J)[0]},V=function(J){return h(z(J))},k={distance:function(J,X){var _=V(J),Q=V(X);return d[_*f+Q]},path:function(J,X){var _=V(J),Q=V(X),q=c(_);if(_===Q)return q.collection();if(m[_*f+Q]==null)return r.collection();var te=r.collection(),Z=_,U;te.merge(q);while(_!==Q)Z=_,_=m[_*f+Q],U=b[Z*f+_],te.merge(U),te.merge(c(_));return te}};return k}},Ec=St({weight:function(e){return 1},directed:!1,root:null}),xc={bellmanFord:function(e){var r=this,a=Ec(e),{weight:n,directed:i,root:s}=a,o=n,l=this,u=this.cy(),f=this.byGroup(),{edges:v,nodes:h}=f,c=h.length,d=new nr,g=!1,y=[];s=u.collection(s)[0],v.unmergeBy(function(Ce){return Ce.isLoop()});var p=v.length,m=function(Se){var ge=d.get(Se.id());if(!ge)ge={},d.set(Se.id(),ge);return ge},b=function(Se){return(Re(Se)?u.$(Se):Se)[0]},E=function(Se){return m(b(Se)).dist},A=function(Se){var ge=arguments.length>1&&arguments[1]!==void 0?arguments[1]:s,ve=b(Se),ye=[],Ee=ve;for(;;){if(Ee==null)return r.spawn();var Pe=m(Ee),{edge:Me,pred:Ne}=Pe;if(ye.unshift(Ee[0]),Ee.same(ge)&&ye.length>0)break;if(Me!=null)ye.unshift(Me);Ee=Ne}return l.spawn(ye)};for(var M=0;M<c;M++){var S=h[M],P=m(S);if(S.same(s))P.dist=0;else P.dist=1/0;P.pred=null,P.edge=null}var N=!1,R=function(Se,ge,ve,ye,Ee,Pe){var Me=ye.dist+Pe;if(Me<Ee.dist&&!ve.same(ye.edge))Ee.dist=Me,Ee.pred=Se,Ee.edge=ve,N=!0};for(var I=1;I<c;I++){N=!1;for(var w=0;w<p;w++){var x=v[w],T=x.source(),D=x.target(),C=o(x),O=m(T),B=m(D);if(R(T,D,x,O,B,C),!i)R(D,T,x,B,O,C)}if(!N)break}if(N){var z=[];for(var V=0;V<p;V++){var k=v[V],G=k.source(),J=k.target(),X=o(k),_=m(G).dist,Q=m(J).dist;if(_+X<Q||!i&&Q+X<_){if(!g)_e("Graph contains a negative weight cycle for Bellman-Ford"),g=!0;if(e.findNegativeWeightCycles!==!1){var q=[];if(_+X<Q)q.push(G);if(!i&&Q+X<_)q.push(J);var te=q.length;for(var Z=0;Z<te;Z++){var U=q[Z],W=[U];W.push(m(U).edge);var j=m(U).pred;while(W.indexOf(j)===-1)W.push(j),W.push(m(j).edge),j=m(j).pred;W=W.slice(W.indexOf(j));var re=W[0].id(),ee=0;for(var de=2;de<W.length;de+=2)if(W[de].id()<re)re=W[de].id(),ee=de;W=W.slice(ee).concat(W.slice(0,ee)),W.push(W[0]);var Ae=W.map(function(Ce){return Ce.id()}).join(",");if(z.indexOf(Ae)===-1)y.push(l.spawn(W)),z.push(Ae)}}else break}}}return{distanceTo:E,pathTo:A,hasNegativeWeightCycle:g,negativeWeightCycles:y}}},Tc=Math.sqrt(2),Cc=function(e,r,a){if(a.length===0)it("Karger-Stein must be run on a connected (sub)graph");var n=a[e],i=n[1],s=n[2],o=r[i],l=r[s],u=a;for(var f=u.length-1;f>=0;f--){var v=u[f],h=v[1],c=v[2];if(r[h]===o&&r[c]===l||r[h]===l&&r[c]===o)u.splice(f,1)}for(var d=0;d<u.length;d++){var g=u[d];if(g[1]===l)u[d]=g.slice(),u[d][1]=o;else if(g[2]===l)u[d]=g.slice(),u[d][2]=o}for(var y=0;y<r.length;y++)if(r[y]===l)r[y]=o;return u},Ri=function(e,r,a,n){while(a>n){var i=Math.floor(Math.random()*r.length);r=Cc(i,e,r),a--}return r},Sc={kargerStein:function(){var e=this,r=this.byGroup(),{nodes:a,edges:n}=r;n.unmergeBy(function(B){return B.isLoop()});var i=a.length,s=n.length,o=Math.ceil(Math.pow(Math.log(i)/Math.LN2,2)),l=Math.floor(i/Tc);if(i<2){it("At least 2 nodes are required for Karger-Stein algorithm");return}var u=[];for(var f=0;f<s;f++){var v=n[f];u.push([f,a.indexOf(v.source()),a.indexOf(v.target())])}var h=1/0,c=[],d=Array(i),g=Array(i),y=Array(i),p=function(z,V){for(var k=0;k<i;k++)V[k]=z[k]};for(var m=0;m<=o;m++){for(var b=0;b<i;b++)g[b]=b;var E=Ri(g,u.slice(),i,l),A=E.slice();p(g,y);var M=Ri(g,E,l,2),S=Ri(y,A,l,2);if(M.length<=S.length&&M.length<h)h=M.length,c=M,p(g,d);else if(S.length<=M.length&&S.length<h)h=S.length,c=S,p(y,d)}var P=this.spawn(c.map(function(B){return n[B[0]]})),N=this.spawn(),R=this.spawn(),I=d[0];for(var w=0;w<d.length;w++){var x=d[w],T=a[w];if(x===I)N.merge(T);else R.merge(T)}var D=function(z){var V=e.spawn();return z.forEach(function(k){V.merge(k),k.connectedEdges().forEach(function(G){if(e.contains(G)&&!P.contains(G))V.merge(G)})}),V},C=[D(N),D(R)],O={cut:P,components:C,partition1:N,partition2:R};return O}},Pi,Dc=function(e){return{x:e.x,y:e.y}},Jn=function(e,r,a){return{x:e.x*r+a.x,y:e.y*r+a.y}},If=function(e,r,a){return{x:(e.x-a.x)/r,y:(e.y-a.y)/r}},ra=function(e){return{x:e[0],y:e[1]}},Ac=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,n=1/0;for(var i=r;i<a;i++){var s=e[i];if(isFinite(s))n=Math.min(s,n)}return n},Mc=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,n=-1/0;for(var i=r;i<a;i++){var s=e[i];if(isFinite(s))n=Math.max(s,n)}return n},Lc=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,n=0,i=0;for(var s=r;s<a;s++){var o=e[s];if(isFinite(o))n+=o,i++}return n/i},Rc=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;if(n)e=e.slice(r,a);else{if(a<e.length)e.splice(a,e.length-a);if(r>0)e.splice(0,r)}var o=0;for(var l=e.length-1;l>=0;l--){var u=e[l];if(s){if(!isFinite(u))e[l]=-1/0,o++}else e.splice(l,1)}if(i)e.sort(function(h,c){return h-c});var f=e.length,v=Math.floor(f/2);if(f%2!==0)return e[v+1+o];else return(e[v-1+o]+e[v+o])/2},Bf=function(e,r){if(r===0)return e;return Bf(r,e%r)},Pc=function(e){var r=e[0];for(var a=0;a<e.length;a++)if(!yf(e[a]))return 0;else if(a>0)r=Bf(r,e[a]);return r},Nc=function(e){return Math.PI*e/180},cn=function(e,r){return Math.atan2(r,e)-Math.PI/2},mo=Math.log2||function(t){return Math.log(t)/Math.log(2)},bo=function(e){if(e>0)return 1;else if(e<0)return-1;else return 0},Ur=function(e,r){return Math.sqrt(Br(e,r))},Br=function(e,r){var a=r.x-e.x,n=r.y-e.y;return a*a+n*n},Oc=function(e){var r=e.length,a=0;for(var n=0;n<r;n++)a+=e[n];for(var i=0;i<r;i++)e[i]=e[i]/a;return e},bt=function(e,r,a,n){return(1-n)*(1-n)*e+2*(1-n)*n*r+n*n*a},ia=function(e,r,a,n){return{x:bt(e.x,r.x,a.x,n),y:bt(e.y,r.y,a.y,n)}},Ic=function(e,r,a,n){var i={x:r.x-e.x,y:r.y-e.y},s=Ur(e,r),o={x:i.x/s,y:i.y/s};return a=a==null?0:a,n=n!=null?n:a*s,{x:e.x+o.x*n,y:e.y+o.y*n}},Ua=function(e,r,a){return Math.max(e,Math.min(a,r))},Ot=function(e){if(e==null)return{x1:1/0,y1:1/0,x2:-1/0,y2:-1/0,w:0,h:0};else if(e.x1!=null&&e.y1!=null){if(e.x2!=null&&e.y2!=null&&e.x2>=e.x1&&e.y2>=e.y1)return{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,w:e.x2-e.x1,h:e.y2-e.y1};else if(e.w!=null&&e.h!=null&&e.w>=0&&e.h>=0)return{x1:e.x1,y1:e.y1,x2:e.x1+e.w,y2:e.y1+e.h,w:e.w,h:e.h}}},Bc=function(e){return{x1:e.x1,x2:e.x2,w:e.w,y1:e.y1,y2:e.y2,h:e.h}},kc=function(e){e.x1=1/0,e.y1=1/0,e.x2=-1/0,e.y2=-1/0,e.w=0,e.h=0},Fc=function(e,r){e.x1=Math.min(e.x1,r.x1),e.x2=Math.max(e.x2,r.x2),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,r.y1),e.y2=Math.max(e.y2,r.y2),e.h=e.y2-e.y1},kf=function(e,r,a){e.x1=Math.min(e.x1,r),e.x2=Math.max(e.x2,r),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,a),e.y2=Math.max(e.y2,a),e.h=e.y2-e.y1},Sn=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return e.x1-=r,e.x2+=r,e.y1-=r,e.y2+=r,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},Dn=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0],a,n,i,s;if(r.length===1)a=n=i=s=r[0];else if(r.length===2)a=i=r[0],s=n=r[1];else if(r.length===4){var o=ct(r,4);a=o[0],n=o[1],i=o[2],s=o[3]}return e.x1-=s,e.x2+=n,e.y1-=a,e.y2+=i,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},ou=function(e,r){e.x1=r.x1,e.y1=r.y1,e.x2=r.x2,e.y2=r.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1},wo=function(e,r){if(e.x1>r.x2)return!1;if(r.x1>e.x2)return!1;if(e.x2<r.x1)return!1;if(r.x2<e.x1)return!1;if(e.y2<r.y1)return!1;if(r.y2<e.y1)return!1;if(e.y1>r.y2)return!1;if(r.y1>e.y2)return!1;return!0},mr=function(e,r,a){return e.x1<=r&&r<=e.x2&&e.y1<=a&&a<=e.y2},uu=function(e,r){return mr(e,r.x,r.y)},Ff=function(e,r){return mr(e,r.x1,r.y1)&&mr(e,r.x2,r.y2)},zc=(Pi=Math.hypot)!==null&&Pi!==void 0?Pi:function(t,e){return Math.sqrt(t*t+e*e)};function Vc(t,e){if(t.length<3)throw Error("Need at least 3 vertices");var r=function(P,N){return{x:P.x+N.x,y:P.y+N.y}},a=function(P,N){return{x:P.x-N.x,y:P.y-N.y}},n=function(P,N){return{x:P.x*N,y:P.y*N}},i=function(P,N){return P.x*N.y-P.y*N.x},s=function(P){var N=zc(P.x,P.y);return N===0?{x:0,y:0}:{x:P.x/N,y:P.y/N}},o=function(P){var N=0;for(var R=0;R<P.length;R++){var I=P[R],w=P[(R+1)%P.length];N+=I.x*w.y-w.x*I.y}return N/2},l=function(P,N,R,I){var w=a(N,P),x=a(I,R),T=i(w,x);if(Math.abs(T)<0.000000001)return r(P,n(w,0.5));var D=i(a(R,P),x)/T;return r(P,n(w,D))},u=t.map(function(S){return{x:S.x,y:S.y}});if(o(u)<0)u.reverse();var f=u.length,v=[];for(var h=0;h<f;h++){var c=u[h],d=u[(h+1)%f],g=a(d,c),y=s({x:g.y,y:-g.x});v.push(y)}var p=v.map(function(S,P){var N=r(u[P],n(S,e)),R=r(u[(P+1)%f],n(S,e));return{p1:N,p2:R}}),m=[];for(var b=0;b<f;b++){var E=p[(b-1+f)%f],A=p[b],M=l(E.p1,E.p2,A.p1,A.p2);m.push(M)}return m}function Gc(t,e,r,a,n,i){var s=Zc(t,e,r,a,n),o=Vc(s,i),l=Ot();return o.forEach(function(u){return kf(l,u.x,u.y)}),l}var zf=function(e,r,a,n,i,s,o){var l=arguments.length>7&&arguments[7]!==void 0?arguments[7]:"auto",u=l==="auto"?Cr(i,s):l,f=i/2,v=s/2;u=Math.min(u,f,v);var h=u!==f,c=u!==v,d;if(h){var g=a-f+u-o,y=n-v-o,p=a+f-u+o,m=y;if(d=br(e,r,a,n,g,y,p,m,!1),d.length>0)return d}if(c){var b=a+f+o,E=n-v+u-o,A=b,M=n+v-u+o;if(d=br(e,r,a,n,b,E,A,M,!1),d.length>0)return d}if(h){var S=a-f+u-o,P=n+v+o,N=a+f-u+o,R=P;if(d=br(e,r,a,n,S,P,N,R,!1),d.length>0)return d}if(c){var I=a-f-o,w=n-v+u-o,x=I,T=n+v-u+o;if(d=br(e,r,a,n,I,w,x,T,!1),d.length>0)return d}var D;{var C=a-f+u,O=n-v+u;if(D=Na(e,r,a,n,C,O,u+o),D.length>0&&D[0]<=C&&D[1]<=O)return[D[0],D[1]]}{var B=a+f-u,z=n-v+u;if(D=Na(e,r,a,n,B,z,u+o),D.length>0&&D[0]>=B&&D[1]<=z)return[D[0],D[1]]}{var V=a+f-u,k=n+v-u;if(D=Na(e,r,a,n,V,k,u+o),D.length>0&&D[0]>=V&&D[1]>=k)return[D[0],D[1]]}{var G=a-f+u,J=n+v-u;if(D=Na(e,r,a,n,G,J,u+o),D.length>0&&D[0]<=G&&D[1]>=J)return[D[0],D[1]]}return[]},Uc=function(e,r,a,n,i,s,o){var l=o,u=Math.min(a,i),f=Math.max(a,i),v=Math.min(n,s),h=Math.max(n,s);return u-l<=e&&e<=f+l&&v-l<=r&&r<=h+l},Hc=function(e,r,a,n,i,s,o,l,u){var f={x1:Math.min(a,o,i)-u,x2:Math.max(a,o,i)+u,y1:Math.min(n,l,s)-u,y2:Math.max(n,l,s)+u};if(e<f.x1||e>f.x2||r<f.y1||r>f.y2)return!1;else return!0},qc=function(e,r,a,n){a-=n;var i=r*r-4*e*a;if(i<0)return[];var s=Math.sqrt(i),o=2*e,l=(-r+s)/o,u=(-r-s)/o;return[l,u]},Yc=function(e,r,a,n,i){var s=0.00001;if(e===0)e=s;r/=e,a/=e,n/=e;var o,l,u,f,v,h,c,d;if(l=(3*a-r*r)/9,u=-(27*n)+r*(9*a-2*(r*r)),u/=54,o=l*l*l+u*u,i[1]=0,c=r/3,o>0){v=u+Math.sqrt(o),v=v<0?-Math.pow(-v,0.3333333333333333):Math.pow(v,0.3333333333333333),h=u-Math.sqrt(o),h=h<0?-Math.pow(-h,0.3333333333333333):Math.pow(h,0.3333333333333333),i[0]=-c+v+h,c+=(v+h)/2,i[4]=i[2]=-c,c=Math.sqrt(3)*(-h+v)/2,i[3]=c,i[5]=-c;return}if(i[5]=i[3]=0,o===0){d=u<0?-Math.pow(-u,0.3333333333333333):Math.pow(u,0.3333333333333333),i[0]=-c+2*d,i[4]=i[2]=-(d+c);return}l=-l,f=l*l*l,f=Math.acos(u/Math.sqrt(f)),d=2*Math.sqrt(l),i[0]=-c+d*Math.cos(f/3),i[2]=-c+d*Math.cos((f+2*Math.PI)/3),i[4]=-c+d*Math.cos((f+4*Math.PI)/3);return},Xc=function(e,r,a,n,i,s,o,l){var u=1*a*a-4*a*i+2*a*o+4*i*i-4*i*o+o*o+n*n-4*n*s+2*n*l+4*s*s-4*s*l+l*l,f=9*a*i-3*a*a-3*a*o-6*i*i+3*i*o+9*n*s-3*n*n-3*n*l-6*s*s+3*s*l,v=3*a*a-6*a*i+a*o-a*e+2*i*i+2*i*e-o*e+3*n*n-6*n*s+n*l-n*r+2*s*s+2*s*r-l*r,h=1*a*i-a*a+a*e-i*e+n*s-n*n+n*r-s*r,c=[];Yc(u,f,v,h,c);var d=0.0000001,g=[];for(var y=0;y<6;y+=2)if(Math.abs(c[y+1])<d&&c[y]>=0&&c[y]<=1)g.push(c[y]);g.push(1),g.push(0);var p=-1,m,b,E;for(var A=0;A<g.length;A++)if(m=Math.pow(1-g[A],2)*a+2*(1-g[A])*g[A]*i+g[A]*g[A]*o,b=Math.pow(1-g[A],2)*n+2*(1-g[A])*g[A]*s+g[A]*g[A]*l,E=Math.pow(m-e,2)+Math.pow(b-r,2),p>=0){if(E<p)p=E}else p=E;return p},Wc=function(e,r,a,n,i,s){var o=[e-a,r-n],l=[i-a,s-n],u=l[0]*l[0]+l[1]*l[1],f=o[0]*o[0]+o[1]*o[1],v=o[0]*l[0]+o[1]*l[1],h=v*v/u;if(v<0)return f;if(h>u)return(e-i)*(e-i)+(r-s)*(r-s);return f-h},Bt=function(e,r,a){var n,i,s,o,l,u=0;for(var f=0;f<a.length/2;f++){if(n=a[f*2],i=a[f*2+1],f+1<a.length/2)s=a[(f+1)*2],o=a[(f+1)*2+1];else s=a[(f+1-a.length/2)*2],o=a[(f+1-a.length/2)*2+1];if(n==e&&s==e);else if(n>=e&&e>=s||n<=e&&e<=s){if(l=(e-n)/(s-n)*(o-i)+i,l>r)u++}else continue}if(u%2===0)return!1;else return!0},sr=function(e,r,a,n,i,s,o,l,u){var f=Array(a.length),v;if(l[0]!=null)if(v=Math.atan(l[1]/l[0]),l[0]<0)v=v+Math.PI/2;else v=-v-Math.PI/2;else v=l;var h=Math.cos(-v),c=Math.sin(-v);for(var d=0;d<f.length/2;d++)f[d*2]=s/2*(a[d*2]*h-a[d*2+1]*c),f[d*2+1]=o/2*(a[d*2+1]*h+a[d*2]*c),f[d*2]+=n,f[d*2+1]+=i;var g;if(u>0){var y=Gn(f,-u);g=Vn(y)}else g=f;return Bt(e,r,g)},$c=function(e,r,a,n,i,s,o,l){var u=Array(a.length*2);for(var f=0;f<l.length;f++){var v=l[f];u[f*4+0]=v.startX,u[f*4+1]=v.startY,u[f*4+2]=v.stopX,u[f*4+3]=v.stopY;var h=Math.pow(v.cx-e,2)+Math.pow(v.cy-r,2);if(h<=Math.pow(v.radius,2))return!0}return Bt(e,r,u)},Vn=function(e){var r=Array(e.length/2),a,n,i,s,o,l,u,f;for(var v=0;v<e.length/4;v++){if(a=e[v*4],n=e[v*4+1],i=e[v*4+2],s=e[v*4+3],v<e.length/4-1)o=e[(v+1)*4],l=e[(v+1)*4+1],u=e[(v+1)*4+2],f=e[(v+1)*4+3];else o=e[0],l=e[1],u=e[2],f=e[3];var h=br(a,n,i,s,o,l,u,f,!0);r[v*2]=h[0],r[v*2+1]=h[1]}return r},Gn=function(e,r){var a=Array(e.length*2),n,i,s,o;for(var l=0;l<e.length/2;l++){if(n=e[l*2],i=e[l*2+1],l<e.length/2-1)s=e[(l+1)*2],o=e[(l+1)*2+1];else s=e[0],o=e[1];var u=o-i,f=-(s-n),v=Math.sqrt(u*u+f*f),h=u/v,c=f/v;a[l*4]=n+h*r,a[l*4+1]=i+c*r,a[l*4+2]=s+h*r,a[l*4+3]=o+c*r}return a},Kc=function(e,r,a,n,i,s){var o=a-e,l=n-r;o/=i,l/=s;var u=Math.sqrt(o*o+l*l),f=u-1;if(f<0)return[];var v=f/u;return[(a-e)*v+e,(n-r)*v+r]},Vr=function(e,r,a,n,i,s,o){return e-=i,r-=s,e/=a/2+o,r/=n/2+o,e*e+r*r<=1},Na=function(e,r,a,n,i,s,o){var l=[a-e,n-r],u=[e-i,r-s],f=l[0]*l[0]+l[1]*l[1],v=2*(u[0]*l[0]+u[1]*l[1]),h=u[0]*u[0]+u[1]*u[1]-o*o,c=v*v-4*f*h;if(c<0)return[];var d=(-v+Math.sqrt(c))/(2*f),g=(-v-Math.sqrt(c))/(2*f),y=Math.min(d,g),p=Math.max(d,g),m=[];if(y>=0&&y<=1)m.push(y);if(p>=0&&p<=1)m.push(p);if(m.length===0)return[];var b=m[0]*l[0]+e,E=m[0]*l[1]+r;if(m.length>1)if(m[0]==m[1])return[b,E];else{var A=m[1]*l[0]+e,M=m[1]*l[1]+r;return[b,E,A,M]}else return[b,E]},Ni=function(e,r,a){if(r<=e&&e<=a||a<=e&&e<=r)return e;else if(e<=r&&r<=a||a<=r&&r<=e)return r;else return a},br=function(e,r,a,n,i,s,o,l,u){var f=e-i,v=a-e,h=o-i,c=r-s,d=n-r,g=l-s,y=h*c-g*f,p=v*c-d*f,m=g*v-h*d;if(m!==0){var b=y/m,E=p/m,A=0.001,M=0-A,S=1+A;if(M<=b&&b<=S&&M<=E&&E<=S)return[e+b*v,r+b*d];else if(!u)return[];else return[e+b*v,r+b*d]}else if(y===0||p===0){if(Ni(e,a,o)===o)return[o,l];if(Ni(e,a,i)===i)return[i,s];if(Ni(i,o,a)===a)return[a,n];return[]}else return[]},Zc=function(e,r,a,n,i){var s=[],o=n/2,l=i/2,u=r,f=a;s.push({x:u+o*e[0],y:f+l*e[1]});for(var v=1;v<e.length/2;v++)s.push({x:u+o*e[v*2],y:f+l*e[v*2+1]});return s},Ha=function(e,r,a,n,i,s,o,l){var u=[],f,v=Array(a.length),h=!0;if(s==null)h=!1;var c;if(h){for(var d=0;d<v.length/2;d++)v[d*2]=a[d*2]*s+n,v[d*2+1]=a[d*2+1]*o+i;if(l>0){var g=Gn(v,-l);c=Vn(g)}else c=v}else c=a;var y,p,m,b;for(var E=0;E<c.length/2;E++){if(y=c[E*2],p=c[E*2+1],E<c.length/2-1)m=c[(E+1)*2],b=c[(E+1)*2+1];else m=c[0],b=c[1];if(f=br(e,r,n,i,y,p,m,b),f.length!==0)u.push(f[0],f[1])}return u},_c=function(e,r,a,n,i,s,o,l,u){var f=[],v,h=Array(a.length*2);u.forEach(function(m,b){if(b===0)h[h.length-2]=m.startX,h[h.length-1]=m.startY;else h[b*4-2]=m.startX,h[b*4-1]=m.startY;if(h[b*4]=m.stopX,h[b*4+1]=m.stopY,v=Na(e,r,n,i,m.cx,m.cy,m.radius),v.length!==0)f.push(v[0],v[1])});for(var c=0;c<h.length/4;c++)if(v=br(e,r,n,i,h[c*4],h[c*4+1],h[c*4+2],h[c*4+3],!1),v.length!==0)f.push(v[0],v[1]);if(f.length>2){var d=[f[0],f[1]],g=Math.pow(d[0]-e,2)+Math.pow(d[1]-r,2);for(var y=1;y<f.length/2;y++){var p=Math.pow(f[y*2]-e,2)+Math.pow(f[y*2+1]-r,2);if(p<=g)d[0]=f[y*2],d[1]=f[y*2+1],g=p}return d}return f},dn=function(e,r,a){var n=[e[0]-r[0],e[1]-r[1]],i=Math.sqrt(n[0]*n[0]+n[1]*n[1]),s=(i-a)/i;if(s<0)s=0.00001;return[r[0]+s*n[0],r[1]+s*n[1]]},Pt=function(e,r){var a=Xs(e,r);return a=Vf(a),a},Vf=function(e){var r,a,n=e.length/2,i=1/0,s=1/0,o=-1/0,l=-1/0;for(var u=0;u<n;u++)r=e[2*u],a=e[2*u+1],i=Math.min(i,r),o=Math.max(o,r),s=Math.min(s,a),l=Math.max(l,a);var f=2/(o-i),v=2/(l-s);for(var h=0;h<n;h++)r=e[2*h]=e[2*h]*f,a=e[2*h+1]=e[2*h+1]*v,i=Math.min(i,r),o=Math.max(o,r),s=Math.min(s,a),l=Math.max(l,a);if(s<-1)for(var c=0;c<n;c++)a=e[2*c+1]=e[2*c+1]+(-1-s);return e},Xs=function(e,r){var a=1/e*2*Math.PI,n=e%2===0?Math.PI/2+a/2:Math.PI/2;n+=r;var i=Array(e*2),s;for(var o=0;o<e;o++)s=o*a+n,i[2*o]=Math.cos(s),i[2*o+1]=Math.sin(-s);return i},Cr=function(e,r){return Math.min(e/4,r/4,8)},Gf=function(e,r){return Math.min(e/10,r/10,8)},Eo=function(){return 8},Qc=function(e,r,a){return[e-2*r+a,2*(r-e),e]},Ws=function(e,r){return{heightOffset:Math.min(15,0.05*r),widthOffset:Math.min(100,0.25*e),ctrlPtOffsetPct:0.05}};function Oi(t,e){function r(v){var h=[];for(var c=0;c<v.length;c++){var d=v[c],g=v[(c+1)%v.length],y={x:g.x-d.x,y:g.y-d.y},p={x:-y.y,y:y.x},m=Math.sqrt(p.x*p.x+p.y*p.y);h.push({x:p.x/m,y:p.y/m})}return h}function a(v,h){var c=1/0,d=-1/0,g=kt(v),y;try{for(g.s();!(y=g.n()).done;){var p=y.value,m=p.x*h.x+p.y*h.y;c=Math.min(c,m),d=Math.max(d,m)}}catch(b){g.e(b)}finally{g.f()}return{min:c,max:d}}function n(v,h){return!(v.max<h.min||h.max<v.min)}var i=[].concat(Bn(r(t)),Bn(r(e))),s=kt(i),o;try{for(s.s();!(o=s.n()).done;){var l=o.value,u=a(t,l),f=a(e,l);if(!n(u,f))return!1}}catch(v){s.e(v)}finally{s.f()}return!0}var Jc=St({dampingFactor:0.8,precision:0.000001,iterations:200,weight:function(e){return 1}}),jc={pageRank:function(e){var r=Jc(e),{dampingFactor:a,precision:n,iterations:i,weight:s}=r,o=this._private.cy,l=this.byGroup(),{nodes:u,edges:f}=l,v=u.length,h=v*v,c=f.length,d=Array(h),g=Array(v),y=(1-a)/v;for(var p=0;p<v;p++){for(var m=0;m<v;m++){var b=p*v+m;d[b]=0}g[p]=0}for(var E=0;E<c;E++){var A=f[E],M=A.data("source"),S=A.data("target");if(M===S)continue;var P=u.indexOfId(M),N=u.indexOfId(S),R=s(A),I=N*v+P;d[I]+=R,g[P]+=R}var w=1/v+y;for(var x=0;x<v;x++)if(g[x]===0)for(var T=0;T<v;T++){var D=T*v+x;d[D]=w}else for(var C=0;C<v;C++){var O=C*v+x;d[O]=d[O]/g[x]+y}var B=Array(v),z=Array(v),V;for(var k=0;k<v;k++)B[k]=1;for(var G=0;G<i;G++){for(var J=0;J<v;J++)z[J]=0;for(var X=0;X<v;X++)for(var _=0;_<v;_++){var Q=X*v+_;z[X]+=d[Q]*B[_]}Oc(z),V=B,B=z,z=V;var q=0;for(var te=0;te<v;te++){var Z=V[te]-B[te];q+=Z*Z}if(q<n)break}var U={rank:function(j){return j=o.collection(j)[0],B[u.indexOf(j)]}};return U}};var lu=St({root:null,weight:function(e){return 1},directed:!1,alpha:0}),sa={degreeCentralityNormalized:function(e){e=lu(e);var r=this.cy(),a=this.nodes(),n=a.length;if(!e.directed){var i={},s=0;for(var o=0;o<n;o++){var l=a[o];e.root=l;var u=this.degreeCentrality(e);if(s<u.degree)s=u.degree;i[l.id()]=u.degree}return{degree:function(b){if(s===0)return 0;if(Re(b))b=r.filter(b);return i[b.id()]/s}}}else{var f={},v={},h=0,c=0;for(var d=0;d<n;d++){var g=a[d],y=g.id();e.root=g;var p=this.degreeCentrality(e);if(h<p.indegree)h=p.indegree;if(c<p.outdegree)c=p.outdegree;f[y]=p.indegree,v[y]=p.outdegree}return{indegree:function(b){if(h==0)return 0;if(Re(b))b=r.filter(b);return f[b.id()]/h},outdegree:function(b){if(c===0)return 0;if(Re(b))b=r.filter(b);return v[b.id()]/c}}}},degreeCentrality:function(e){e=lu(e);var r=this.cy(),a=this,n=e,{root:i,weight:s,directed:o,alpha:l}=n;if(i=r.collection(i)[0],!o){var u=i.connectedEdges().intersection(a),f=u.length,v=0;for(var h=0;h<u.length;h++)v+=s(u[h]);return{degree:Math.pow(f,1-l)*Math.pow(v,l)}}else{var c=i.connectedEdges(),d=c.filter(function(M){return M.target().same(i)&&a.has(M)}),g=c.filter(function(M){return M.source().same(i)&&a.has(M)}),y=d.length,p=g.length,m=0,b=0;for(var E=0;E<d.length;E++)m+=s(d[E]);for(var A=0;A<g.length;A++)b+=s(g[A]);return{indegree:Math.pow(y,1-l)*Math.pow(m,l),outdegree:Math.pow(p,1-l)*Math.pow(b,l)}}}};sa.dc=sa.degreeCentrality;sa.dcn=sa.degreeCentralityNormalised=sa.degreeCentralityNormalized;var fu=St({harmonic:!0,weight:function(){return 1},directed:!1,root:null}),oa={closenessCentralityNormalized:function(e){var r=fu(e),{harmonic:a,weight:n,directed:i}=r,s=this.cy(),o={},l=0,u=this.nodes(),f=this.floydWarshall({weight:n,directed:i});for(var v=0;v<u.length;v++){var h=0,c=u[v];for(var d=0;d<u.length;d++)if(v!==d){var g=f.distance(c,u[d]);if(a)h+=1/g;else h+=g}if(!a)h=1/h;if(l<h)l=h;o[c.id()]=h}return{closeness:function(p){if(l==0)return 0;if(Re(p))p=s.filter(p)[0].id();else p=p.id();return o[p]/l}}},closenessCentrality:function(e){var r=fu(e),{root:a,weight:n,directed:i,harmonic:s}=r;a=this.filter(a)[0];var o=this.dijkstra({root:a,weight:n,directed:i}),l=0,u=this.nodes();for(var f=0;f<u.length;f++){var v=u[f];if(!v.same(a)){var h=o.distanceTo(v);if(s)l+=1/h;else l+=h}}return s?l:1/l}};oa.cc=oa.closenessCentrality;oa.ccn=oa.closenessCentralityNormalised=oa.closenessCentralityNormalized;var ed=St({weight:null,directed:!1}),$s={betweennessCentrality:function(e){var r=ed(e),{directed:a,weight:n}=r,i=n!=null,s=this.cy(),o=this.nodes(),l={},u={},f=0,v={set:function(b,E){if(u[b]=E,E>f)f=E},get:function(b){return u[b]}};for(var h=0;h<o.length;h++){var c=o[h],d=c.id();if(a)l[d]=c.outgoers().nodes();else l[d]=c.openNeighborhood().nodes();v.set(d,0)}var g=function(){var b=o[y].id(),E=[],A={},M={},S={},P=new en(function(X,_){return S[X]-S[_]});for(var N=0;N<o.length;N++){var R=o[N].id();A[R]=[],M[R]=0,S[R]=1/0}M[b]=1,S[b]=0,P.push(b);while(!P.empty()){var I=P.pop();if(E.push(I),i)for(var w=0;w<l[I].length;w++){var x=l[I][w],T=s.getElementById(I),D=void 0;if(T.edgesTo(x).length>0)D=T.edgesTo(x)[0];else D=x.edgesTo(T)[0];var C=n(D);if(x=x.id(),S[x]>S[I]+C){if(S[x]=S[I]+C,P.nodes.indexOf(x)<0)P.push(x);else P.updateItem(x);M[x]=0,A[x]=[]}if(S[x]==S[I]+C)M[x]=M[x]+M[I],A[x].push(I)}else for(var O=0;O<l[I].length;O++){var B=l[I][O].id();if(S[B]==1/0)P.push(B),S[B]=S[I]+1;if(S[B]==S[I]+1)M[B]=M[B]+M[I],A[B].push(I)}}var z={};for(var V=0;V<o.length;V++)z[o[V].id()]=0;while(E.length>0){var k=E.pop();for(var G=0;G<A[k].length;G++){var J=A[k][G];z[J]=z[J]+M[J]/M[k]*(1+z[k])}if(k!=o[y].id())v.set(k,v.get(k)+z[k])}};for(var y=0;y<o.length;y++)g();var p={betweenness:function(b){var E=s.collection(b).id();return v.get(E)},betweennessNormalized:function(b){if(f==0)return 0;var E=s.collection(b).id();return v.get(E)/f}};return p.betweennessNormalised=p.betweennessNormalized,p}};$s.bc=$s.betweennessCentrality;var td=St({expandFactor:2,inflateFactor:2,multFactor:1,maxIterations:20,attributes:[function(t){return 1}]}),rd=function(e){return td(e)},ad=function(e,r){var a=0;for(var n=0;n<r.length;n++)a+=r[n](e);return a},nd=function(e,r,a){for(var n=0;n<r;n++)e[n*r+n]=a},Uf=function(e,r){var a;for(var n=0;n<r;n++){a=0;for(var i=0;i<r;i++)a+=e[i*r+n];for(var s=0;s<r;s++)e[s*r+n]=e[s*r+n]/a}},id=function(e,r,a){var n=Array(a*a);for(var i=0;i<a;i++){for(var s=0;s<a;s++)n[i*a+s]=0;for(var o=0;o<a;o++)for(var l=0;l<a;l++)n[i*a+l]+=e[i*a+o]*r[o*a+l]}return n},sd=function(e,r,a){var n=e.slice(0);for(var i=1;i<a;i++)e=id(e,n,r);return e},od=function(e,r,a){var n=Array(r*r);for(var i=0;i<r*r;i++)n[i]=Math.pow(e[i],a);return Uf(n,r),n},ud=function(e,r,a,n){for(var i=0;i<a;i++){var s=Math.round(e[i]*Math.pow(10,n))/Math.pow(10,n),o=Math.round(r[i]*Math.pow(10,n))/Math.pow(10,n);if(s!==o)return!1}return!0},ld=function(e,r,a,n){var i=[];for(var s=0;s<r;s++){var o=[];for(var l=0;l<r;l++)if(Math.round(e[s*r+l]*1000)/1000>0)o.push(a[l]);if(o.length!==0)i.push(n.collection(o))}return i},fd=function(e,r){for(var a=0;a<e.length;a++)if(!r[a]||e[a].id()!==r[a].id())return!1;return!0},vd=function(e){for(var r=0;r<e.length;r++)for(var a=0;a<e.length;a++)if(r!=a&&fd(e[r],e[a]))e.splice(a,1);return e},vu=function(e){var r=this.nodes(),a=this.edges(),n=this.cy(),i=rd(e),s={};for(var o=0;o<r.length;o++)s[r[o].id()]=o;var l=r.length,u=l*l,f=Array(u),v;for(var h=0;h<u;h++)f[h]=0;for(var c=0;c<a.length;c++){var d=a[c],g=s[d.source().id()],y=s[d.target().id()],p=ad(d,i.attributes);f[g*l+y]+=p,f[y*l+g]+=p}nd(f,l,i.multFactor),Uf(f,l);var m=!0,b=0;while(m&&b<i.maxIterations){if(m=!1,v=sd(f,l,i.expandFactor),f=od(v,l,i.inflateFactor),!ud(f,v,u,4))m=!0;b++}var E=ld(f,l,r,n);return E=vd(E),E},hd={markovClustering:vu,mcl:vu},cd=function(e){return e},Hf=function(e,r){return Math.abs(r-e)},hu=function(e,r,a){return e+Hf(r,a)},cu=function(e,r,a){return e+Math.pow(a-r,2)},dd=function(e){return Math.sqrt(e)},gd=function(e,r,a){return Math.max(e,Hf(r,a))},Sa=function(e,r,a,n,i){var s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:cd,o=n,l,u;for(var f=0;f<e;f++)l=r(f),u=a(f),o=i(o,l,u);return s(o)},fa={euclidean:function(e,r,a){if(e>=2)return Sa(e,r,a,0,cu,dd);else return Sa(e,r,a,0,hu)},squaredEuclidean:function(e,r,a){return Sa(e,r,a,0,cu)},manhattan:function(e,r,a){return Sa(e,r,a,0,hu)},max:function(e,r,a){return Sa(e,r,a,-1/0,gd)}};fa["squared-euclidean"]=fa.squaredEuclidean;fa.squaredeuclidean=fa.squaredEuclidean;function jn(t,e,r,a,n,i){var s;if(st(t))s=t;else s=fa[t]||fa.euclidean;if(e===0&&st(t))return s(n,i);else return s(e,r,a,n,i)}var pd=St({k:2,m:2,sensitivityThreshold:0.0001,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),xo=function(e){return pd(e)},Un=function(e,r,a,n,i){var s=i!=="kMedoids",o=s?function(v){return a[v]}:function(v){return n[v](a)},l=function(h){return n[h](r)},u=a,f=r;return jn(e,n.length,o,l,u,f)},Ii=function(e,r,a){var n=a.length,i=Array(n),s=Array(n),o=Array(r),l=null;for(var u=0;u<n;u++)i[u]=e.min(a[u]).value,s[u]=e.max(a[u]).value;for(var f=0;f<r;f++){l=[];for(var v=0;v<n;v++)l[v]=Math.random()*(s[v]-i[v])+i[v];o[f]=l}return o},qf=function(e,r,a,n,i){var s=1/0,o=0;for(var l=0;l<r.length;l++){var u=Un(a,e,r[l],n,i);if(u<s)s=u,o=l}return o},Yf=function(e,r,a){var n=[],i=null;for(var s=0;s<r.length;s++)if(i=r[s],a[i.id()]===e)n.push(i);return n},yd=function(e,r,a){return Math.abs(r-e)<=a},md=function(e,r,a){for(var n=0;n<e.length;n++)for(var i=0;i<e[n].length;i++){var s=Math.abs(e[n][i]-r[n][i]);if(s>a)return!1}return!0},bd=function(e,r,a){for(var n=0;n<a;n++)if(e===r[n])return!0;return!1},du=function(e,r){var a=Array(r);if(e.length<50)for(var n=0;n<r;n++){var i=e[Math.floor(Math.random()*e.length)];while(bd(i,a,n))i=e[Math.floor(Math.random()*e.length)];a[n]=i}else for(var s=0;s<r;s++)a[s]=e[Math.floor(Math.random()*e.length)];return a},gu=function(e,r,a){var n=0;for(var i=0;i<r.length;i++)n+=Un("manhattan",r[i],e,a,"kMedoids");return n},wd=function(e){var r=this.cy(),a=this.nodes(),n=null,i=xo(e),s=Array(i.k),o={},l;if(i.testMode)if(typeof i.testCentroids==="number")i.testCentroids,l=Ii(a,i.k,i.attributes);else if(yt(i.testCentroids)==="object")l=i.testCentroids;else l=Ii(a,i.k,i.attributes);else l=Ii(a,i.k,i.attributes);var u=!0,f=0;while(u&&f<i.maxIterations){for(var v=0;v<a.length;v++)n=a[v],o[n.id()]=qf(n,l,i.distance,i.attributes,"kMeans");u=!1;for(var h=0;h<i.k;h++){var c=Yf(h,a,o);if(c.length===0)continue;var d=i.attributes.length,g=l[h],y=Array(d),p=Array(d);for(var m=0;m<d;m++){p[m]=0;for(var b=0;b<c.length;b++)n=c[b],p[m]+=i.attributes[m](n);if(y[m]=p[m]/c.length,!yd(y[m],g[m],i.sensitivityThreshold))u=!0}l[h]=y,s[h]=r.collection(c)}f++}return s},Ed=function(e){var r=this.cy(),a=this.nodes(),n=null,i=xo(e),s=Array(i.k),o,l={},u,f=Array(i.k);if(i.testMode)if(typeof i.testCentroids==="number");else if(yt(i.testCentroids)==="object")o=i.testCentroids;else o=du(a,i.k);else o=du(a,i.k);var v=!0,h=0;while(v&&h<i.maxIterations){for(var c=0;c<a.length;c++)n=a[c],l[n.id()]=qf(n,o,i.distance,i.attributes,"kMedoids");v=!1;for(var d=0;d<o.length;d++){var g=Yf(d,a,l);if(g.length===0)continue;f[d]=gu(o[d],g,i.attributes);for(var y=0;y<g.length;y++)if(u=gu(g[y],g,i.attributes),u<f[d])f[d]=u,o[d]=g[y],v=!0;s[d]=r.collection(g)}h++}return s},xd=function(e,r,a,n,i){var s,o;for(var l=0;l<r.length;l++)for(var u=0;u<e.length;u++)n[l][u]=Math.pow(a[l][u],i.m);for(var f=0;f<e.length;f++)for(var v=0;v<i.attributes.length;v++){s=0,o=0;for(var h=0;h<r.length;h++)s+=n[h][f]*i.attributes[v](r[h]),o+=n[h][f];e[f][v]=s/o}},Td=function(e,r,a,n,i){for(var s=0;s<e.length;s++)r[s]=e[s].slice();var o,l,u,f=2/(i.m-1);for(var v=0;v<a.length;v++)for(var h=0;h<n.length;h++){o=0;for(var c=0;c<a.length;c++)l=Un(i.distance,n[h],a[v],i.attributes,"cmeans"),u=Un(i.distance,n[h],a[c],i.attributes,"cmeans"),o+=Math.pow(l/u,f);e[h][v]=1/o}},Cd=function(e,r,a,n){var i=Array(a.k);for(var s=0;s<i.length;s++)i[s]=[];var o,l;for(var u=0;u<r.length;u++){o=-1/0,l=-1;for(var f=0;f<r[0].length;f++)if(r[u][f]>o)o=r[u][f],l=f;i[l].push(e[u])}for(var v=0;v<i.length;v++)i[v]=n.collection(i[v]);return i},pu=function(e){var r=this.cy(),a=this.nodes(),n=xo(e),i,s,o,l,u;l=Array(a.length);for(var f=0;f<a.length;f++)l[f]=Array(n.k);o=Array(a.length);for(var v=0;v<a.length;v++)o[v]=Array(n.k);for(var h=0;h<a.length;h++){var c=0;for(var d=0;d<n.k;d++)o[h][d]=Math.random(),c+=o[h][d];for(var g=0;g<n.k;g++)o[h][g]=o[h][g]/c}s=Array(n.k);for(var y=0;y<n.k;y++)s[y]=Array(n.attributes.length);u=Array(a.length);for(var p=0;p<a.length;p++)u[p]=Array(n.k);var m=!0,b=0;while(m&&b<n.maxIterations){if(m=!1,xd(s,a,o,u,n),Td(o,l,s,a,n),!md(o,l,n.sensitivityThreshold))m=!0;b++}return i=Cd(a,o,n,r),{clusters:i,degreeOfMembership:o}},Sd={kMeans:wd,kMedoids:Ed,fuzzyCMeans:pu,fcm:pu},Dd=St({distance:"euclidean",linkage:"min",mode:"threshold",threshold:1/0,addDendrogram:!1,dendrogramDepth:0,attributes:[]}),Ad={single:"min",complete:"max"},Md=function(e){var r=Dd(e),a=Ad[r.linkage];if(a!=null)r.linkage=a;return r},yu=function(e,r,a,n,i){var s=0,o=1/0,l,u=i.attributes,f=function(N,R){return jn(i.distance,u.length,function(I){return u[I](N)},function(I){return u[I](R)},N,R)};for(var v=0;v<e.length;v++){var h=e[v].key,c=a[h][n[h]];if(c<o)s=h,o=c}if(i.mode==="threshold"&&o>=i.threshold||i.mode==="dendrogram"&&e.length===1)return!1;var d=r[s],g=r[n[s]],y;if(i.mode==="dendrogram")y={left:d,right:g,key:d.key};else y={value:d.value.concat(g.value),key:d.key};e[d.index]=y,e.splice(g.index,1),r[d.key]=y;for(var p=0;p<e.length;p++){var m=e[p];if(d.key===m.key)l=1/0;else if(i.linkage==="min"){if(l=a[d.key][m.key],a[d.key][m.key]>a[g.key][m.key])l=a[g.key][m.key]}else if(i.linkage==="max"){if(l=a[d.key][m.key],a[d.key][m.key]<a[g.key][m.key])l=a[g.key][m.key]}else if(i.linkage==="mean")l=(a[d.key][m.key]*d.size+a[g.key][m.key]*g.size)/(d.size+g.size);else if(i.mode==="dendrogram")l=f(m.value,d.value);else l=f(m.value[0],d.value[0]);a[d.key][m.key]=a[m.key][d.key]=l}for(var b=0;b<e.length;b++){var E=e[b].key;if(n[E]===d.key||n[E]===g.key){var A=E;for(var M=0;M<e.length;M++){var S=e[M].key;if(a[E][S]<a[E][A])A=S}n[E]=A}e[b].index=b}return d.key=g.key=d.index=g.index=null,!0},aa=function(e,r,a){if(!e)return;if(e.value)r.push(e.value);else{if(e.left)aa(e.left,r);if(e.right)aa(e.right,r)}},Ks=function(e,r){if(!e)return"";if(e.left&&e.right){var a=Ks(e.left,r),n=Ks(e.right,r),i=r.add({group:"nodes",data:{id:a+","+n}});return r.add({group:"edges",data:{source:a,target:i.id()}}),r.add({group:"edges",data:{source:n,target:i.id()}}),i.id()}else if(e.value)return e.value.id()},Zs=function(e,r,a){if(!e)return[];var n=[],i=[],s=[];if(r===0){if(e.left)aa(e.left,n);if(e.right)aa(e.right,i);return s=n.concat(i),[a.collection(s)]}else if(r===1)if(e.value)return[a.collection(e.value)];else{if(e.left)aa(e.left,n);if(e.right)aa(e.right,i);return[a.collection(n),a.collection(i)]}else if(e.value)return[a.collection(e.value)];else{if(e.left)n=Zs(e.left,r-1,a);if(e.right)i=Zs(e.right,r-1,a);return n.concat(i)}},mu=function(e){var r=this.cy(),a=this.nodes(),n=Md(e),i=n.attributes,s=function(b,E){return jn(n.distance,i.length,function(A){return i[A](b)},function(A){return i[A](E)},b,E)},o=[],l=[],u=[],f=[];for(var v=0;v<a.length;v++){var h={value:n.mode==="dendrogram"?a[v]:[a[v]],key:v,index:v};o[v]=h,f[v]=h,l[v]=[],u[v]=0}for(var c=0;c<o.length;c++)for(var d=0;d<=c;d++){var g=void 0;if(n.mode==="dendrogram")g=c===d?1/0:s(o[c].value,o[d].value);else g=c===d?1/0:s(o[c].value[0],o[d].value[0]);if(l[c][d]=g,l[d][c]=g,g<l[c][u[c]])u[c]=d}var y=yu(o,f,l,u,n);while(y)y=yu(o,f,l,u,n);var p;if(n.mode==="dendrogram"){if(p=Zs(o[0],n.dendrogramDepth,r),n.addDendrogram)Ks(o[0],r)}else p=Array(o.length),o.forEach(function(m,b){m.key=m.index=null,p[b]=r.collection(m.value)});return p},Ld={hierarchicalClustering:mu,hca:mu},Rd=St({distance:"euclidean",preference:"median",damping:0.8,maxIterations:1000,minIterations:100,attributes:[]}),Pd=function(e){var{damping:r,preference:a}=e;if(!(0.5<=r&&r<1))it("Damping must range on [0.5, 1). Got: ".concat(r));var n=["median","mean","min","max"];if(!(n.some(function(i){return i===a})||he(a)))it("Preference must be one of [".concat(n.map(function(i){return"'".concat(i,"'")}).join(", "),"] or a number. Got: ").concat(a));return Rd(e)},Nd=function(e,r,a,n){var i=function(o,l){return n[l](o)};return-jn(e,n.length,function(s){return i(r,s)},function(s){return i(a,s)},r,a)},Od=function(e,r){var a=null;if(r==="median")a=Rc(e);else if(r==="mean")a=Lc(e);else if(r==="min")a=Ac(e);else if(r==="max")a=Mc(e);else a=r;return a},Id=function(e,r,a){var n=[];for(var i=0;i<e;i++)if(r[i*e+i]+a[i*e+i]>0)n.push(i);return n},bu=function(e,r,a){var n=[];for(var i=0;i<e;i++){var s=-1,o=-1/0;for(var l=0;l<a.length;l++){var u=a[l];if(r[i*e+u]>o)s=u,o=r[i*e+u]}if(s>0)n.push(s)}for(var f=0;f<a.length;f++)n[a[f]]=a[f];return n},Bd=function(e,r,a){var n=bu(e,r,a);for(var i=0;i<a.length;i++){var s=[];for(var o=0;o<n.length;o++)if(n[o]===a[i])s.push(o);var l=-1,u=-1/0;for(var f=0;f<s.length;f++){var v=0;for(var h=0;h<s.length;h++)v+=r[s[h]*e+s[f]];if(v>u)l=f,u=v}a[i]=s[l]}return n=bu(e,r,a),n},wu=function(e){var r=this.cy(),a=this.nodes(),n=Pd(e),i={};for(var s=0;s<a.length;s++)i[a[s].id()]=s;var o,l,u,f,v,h;o=a.length,l=o*o,u=Array(l);for(var c=0;c<l;c++)u[c]=-1/0;for(var d=0;d<o;d++)for(var g=0;g<o;g++)if(d!==g)u[d*o+g]=Nd(n.distance,a[d],a[g],n.attributes);f=Od(u,n.preference);for(var y=0;y<o;y++)u[y*o+y]=f;v=Array(l);for(var p=0;p<l;p++)v[p]=0;h=Array(l);for(var m=0;m<l;m++)h[m]=0;var b=Array(o),E=Array(o),A=Array(o);for(var M=0;M<o;M++)b[M]=0,E[M]=0,A[M]=0;var S=Array(o*n.minIterations);for(var P=0;P<S.length;P++)S[P]=0;var N;for(N=0;N<n.maxIterations;N++){for(var R=0;R<o;R++){var I=-1/0,w=-1/0,x=-1,T=0;for(var D=0;D<o;D++)if(b[D]=v[R*o+D],T=h[R*o+D]+u[R*o+D],T>=I)w=I,I=T,x=D;else if(T>w)w=T;for(var C=0;C<o;C++)v[R*o+C]=(1-n.damping)*(u[R*o+C]-I)+n.damping*b[C];v[R*o+x]=(1-n.damping)*(u[R*o+x]-w)+n.damping*b[x]}for(var O=0;O<o;O++){var B=0;for(var z=0;z<o;z++)b[z]=h[z*o+O],E[z]=Math.max(0,v[z*o+O]),B+=E[z];B-=E[O],E[O]=v[O*o+O],B+=E[O];for(var V=0;V<o;V++)h[V*o+O]=(1-n.damping)*Math.min(0,B-E[V])+n.damping*b[V];h[O*o+O]=(1-n.damping)*(B-E[O])+n.damping*b[O]}var k=0;for(var G=0;G<o;G++){var J=h[G*o+G]+v[G*o+G]>0?1:0;S[N%n.minIterations*o+G]=J,k+=J}if(k>0&&(N>=n.minIterations-1||N==n.maxIterations-1)){var X=0;for(var _=0;_<o;_++){A[_]=0;for(var Q=0;Q<n.minIterations;Q++)A[_]+=S[Q*o+_];if(A[_]===0||A[_]===n.minIterations)X++}if(X===o)break}}var q=Id(o,v,h),te=Bd(o,u,q),Z={};for(var U=0;U<q.length;U++)Z[q[U]]=[];for(var W=0;W<a.length;W++){var j=i[a[W].id()],re=te[j];if(re!=null)Z[re].push(a[W])}var ee=Array(q.length);for(var de=0;de<q.length;de++)ee[de]=r.collection(Z[q[de]]);return ee},kd={affinityPropagation:wu,ap:wu},Fd=St({root:void 0,directed:!1}),zd={hierholzer:function(e){if(!We(e)){var r=arguments;e={root:r[0],directed:r[1]}}var a=Fd(e),{root:n,directed:i}=a,s=this,o=!1,l,u,f;if(n)f=Re(n)?this.filter(n)[0].id():n[0].id();var v={},h={},c=s.edges().filter(function(b){return s.has(b.source())&&s.has(b.target())});if(i)s.forEach(function(b){var E=b.id();if(b.isNode()){var A=b.incomers().edges().intersection(c),M=b.outgoers().edges().intersection(c),S=A.length,P=M.length,N=S-P,R=P-S;if(N==1)if(l)o=!0;else l=E;else if(R==1)if(u)o=!0;else u=E;else if(R>1||N>1)o=!0;v[E]=[],M.forEach(function(I){return v[E].push(I.id())})}else h[E]=[void 0,b.target().id()]});else s.forEach(function(b){var E=b.id();if(b.isNode()){var A=b.connectedEdges().intersection(c),M=A.length+A.filter(function(S){return S.isLoop()}).length;if(M%2)if(!l)l=E;else if(!u)u=E;else o=!0;v[E]=[],A.forEach(function(S){return v[E].push(S.id())})}else h[E]=[b.source().id(),b.target().id()]});var d={found:!1,trail:void 0};if(o)return d;else if(u&&l){if(i){if(f&&u!=f)return d;f=u}else if(f&&u!=f&&l!=f)return d;else if(!f)f=u}else if(!f)f=s[0].id();var g=function(E){var A=E,M=[E],S,P,N;while(v[A].length){if(S=v[A].shift(),P=h[S][0],N=h[S][1],A!=N)v[N]=v[N].filter(function(R){return R!=S}),A=N;else if(!i&&A!=P)v[P]=v[P].filter(function(R){return R!=S}),A=P;M.unshift(S),M.unshift(A)}return M},y=[],p=[];p=g(f);while(p.length!=1)if(v[p[0]].length==0)y.unshift(s.getElementById(p.shift())),y.unshift(s.getElementById(p.shift()));else p=g(p.shift()).concat(p);y.unshift(s.getElementById(p.shift()));for(var m in v)if(v[m].length)return d;return d.found=!0,d.trail=this.spawn(y,!0),d}},gn=function(){var e=this,r={},a=0,n=0,i=[],s=[],o={},l=function(h,c){var d=s.length-1,g=[],y=e.spawn();while(s[d].x!=h||s[d].y!=c)g.push(s.pop().edge),d--;g.push(s.pop().edge),g.forEach(function(p){var m=p.connectedNodes().intersection(e);y.merge(p),m.forEach(function(b){var E=b.id(),A=b.connectedEdges().intersection(e);if(y.merge(b),!r[E].cutVertex)y.merge(A);else y.merge(A.filter(function(M){return M.isLoop()}))})}),i.push(y)},u=function(h,c,d){if(h===d)n+=1;r[c]={id:a,low:a++,cutVertex:!1};var g=e.getElementById(c).connectedEdges().intersection(e);if(g.size()===0)i.push(e.spawn(e.getElementById(c)));else{var y,p,m,b;g.forEach(function(E){if(y=E.source().id(),p=E.target().id(),m=y===c?p:y,m!==d){if(b=E.id(),!o[b])o[b]=!0,s.push({x:c,y:m,edge:E});if(!(m in r)){if(u(h,m,c),r[c].low=Math.min(r[c].low,r[m].low),r[c].id<=r[m].low)r[c].cutVertex=!0,l(c,m)}else r[c].low=Math.min(r[c].low,r[m].id)}})}};e.forEach(function(v){if(v.isNode()){var h=v.id();if(!(h in r))n=0,u(h,h),r[h].cutVertex=n>1}});var f=Object.keys(r).filter(function(v){return r[v].cutVertex}).map(function(v){return e.getElementById(v)});return{cut:e.spawn(f),components:i}},Vd={hopcroftTarjanBiconnected:gn,htbc:gn,htb:gn,hopcroftTarjanBiconnectedComponents:gn},pn=function(){var e=this,r={},a=0,n=[],i=[],s=e.spawn(e),o=function(u){i.push(u),r[u]={index:a,low:a++,explored:!1};var f=e.getElementById(u).connectedEdges().intersection(e);if(f.forEach(function(g){var y=g.target().id();if(y!==u){if(!(y in r))o(y);if(!r[y].explored)r[u].low=Math.min(r[u].low,r[y].low)}}),r[u].index===r[u].low){var v=e.spawn();for(;;){var h=i.pop();if(v.merge(e.getElementById(h)),r[h].low=r[u].index,r[h].explored=!0,h===u)break}var c=v.edgesWith(v),d=v.merge(c);n.push(d),s=s.difference(d)}};return e.forEach(function(l){if(l.isNode()){var u=l.id();if(!(u in r))o(u)}}),{cut:s,components:n}},Gd={tarjanStronglyConnected:pn,tsc:pn,tscc:pn,tarjanStronglyConnectedComponents:pn},Xf={};[Ga,gc,pc,mc,wc,xc,Sc,jc,sa,oa,$s,hd,Sd,Ld,kd,zd,Vd,Gd].forEach(function(t){Oe(Xf,t)});/*!
5
5
  Embeddable Minimum Strictly-Compliant Promises/A+ 1.1.1 Thenable
6
6
  Copyright (c) 2013-2014 Ralf S. Engelschall (http://engelschall.com)
7
7
  Licensed under The MIT License (http://opensource.org/licenses/MIT)
8
- */var Wf=0,$f=1,Kf=2,$t=function(e){if(!(this instanceof $t))return new $t(e);if(this.id="Thenable/1.0.7",this.state=Wf,this.fulfillValue=void 0,this.rejectReason=void 0,this.onFulfilled=[],this.onRejected=[],this.proxy={then:this.then.bind(this)},typeof e==="function")e.call(this,this.fulfill.bind(this),this.reject.bind(this))};$t.prototype={fulfill:function(e){return Eu(this,$f,"fulfillValue",e)},reject:function(e){return Eu(this,Kf,"rejectReason",e)},then:function(e,r){var a=this,n=new $t;return a.onFulfilled.push(Tu(e,n,"fulfill")),a.onRejected.push(Tu(r,n,"reject")),Zf(a),n.proxy}};var Eu=function(e,r,a,n){if(e.state===Wf)e.state=r,e[a]=n,Zf(e);return e},Zf=function(e){if(e.state===$f)xu(e,"onFulfilled",e.fulfillValue);else if(e.state===Kf)xu(e,"onRejected",e.rejectReason)},xu=function(e,r,a){if(e[r].length===0)return;var n=e[r];e[r]=[];var i=function(){for(var o=0;o<n.length;o++)n[o](a)};if(typeof setImmediate==="function")setImmediate(i);else setTimeout(i,0)},Tu=function(e,r,a){return function(n){if(typeof e!=="function")r[a].call(r,n);else{var i;try{i=e(n)}catch(s){r.reject(s);return}_f(r,i)}}},_f=function(e,r){if(e===r||e.proxy===r){e.reject(TypeError("cannot resolve promise with itself"));return}var a;if(pt(r)==="object"&&r!==null||typeof r==="function")try{a=r.then}catch(i){e.reject(i);return}if(typeof a==="function"){var n=!1;try{a.call(r,function(i){if(n)return;if(n=!0,i===r)e.reject(TypeError("circular thenable chain"));else _f(e,i)},function(i){if(n)return;n=!0,e.reject(i)})}catch(i){if(!n)e.reject(i)}return}e.fulfill(r)};$t.all=function(t){return new $t(function(e,r){var a=Array(t.length),n=0,i=function(l,u){if(a[l]=u,n++,n===t.length)e(a)};for(var s=0;s<t.length;s++)(function(o){var l=t[o],u=l!=null&&l.then!=null;if(u)l.then(function(v){i(o,v)},function(v){r(v)});else{var f=l;i(o,f)}})(s)})};$t.resolve=function(t){return new $t(function(e,r){e(t)})};$t.reject=function(t){return new $t(function(e,r){r(t)})};var ga=typeof Promise<"u"?Promise:$t,_s=function(e,r,a){var n=vo(e),i=!n,s=this._private=Oe({duration:1000},r,a);if(s.target=e,s.style=s.style||s.css,s.started=!1,s.playing=!1,s.hooked=!1,s.applying=!1,s.progress=0,s.completes=[],s.frames=[],s.complete&&st(s.complete))s.completes.push(s.complete);if(i){var o=e.position();s.startPosition=s.startPosition||{x:o.x,y:o.y},s.startStyle=s.startStyle||e.cy().style().getAnimationStartStyle(e,s.style)}if(n){var l=e.pan();s.startPan={x:l.x,y:l.y},s.startZoom=e.zoom()}this.length=1,this[0]=this},Hr=_s.prototype;Oe(Hr,{instanceString:function(){return"animation"},hook:function(){var e=this._private;if(!e.hooked){var r,a=e.target._private.animation;if(e.queue)r=a.queue;else r=a.current;if(r.push(this),zt(e.target))e.target.cy().addToAnimationPool(e.target);e.hooked=!0}return this},play:function(){var e=this._private;if(e.progress===1)e.progress=0;return e.playing=!0,e.started=!1,e.stopped=!1,this.hook(),this},playing:function(){return this._private.playing},apply:function(){var e=this._private;return e.applying=!0,e.started=!1,e.stopped=!1,this.hook(),this},applying:function(){return this._private.applying},pause:function(){var e=this._private;return e.playing=!1,e.started=!1,this},stop:function(){var e=this._private;return e.playing=!1,e.started=!1,e.stopped=!0,this},rewind:function(){return this.progress(0)},fastforward:function(){return this.progress(1)},time:function(e){var r=this._private;if(e===void 0)return r.progress*r.duration;else return this.progress(e/r.duration)},progress:function(e){var r=this._private,a=r.playing;if(e===void 0)return r.progress;else{if(a)this.pause();if(r.progress=e,r.started=!1,a)this.play()}return this},completed:function(){return this._private.progress===1},reverse:function(){var e=this._private,r=e.playing;if(r)this.pause();e.progress=1-e.progress,e.started=!1;var a=function(u,f){var v=e[u];if(v==null)return;e[u]=e[f],e[f]=v};if(a("zoom","startZoom"),a("pan","startPan"),a("position","startPosition"),e.style)for(var n=0;n<e.style.length;n++){var i=e.style[n],s=i.name,o=e.startStyle[s];e.startStyle[s]=i,e.style[n]=o}if(r)this.play();return this},promise:function(e){var r=this._private,a;switch(e){case"frame":a=r.frames;break;default:case"complete":case"completed":a=r.completes}return new ga(function(n,i){a.push(function(){n()})})}});Hr.complete=Hr.completed;Hr.run=Hr.play;Hr.running=Hr.playing;var Ud={animated:function(){return function(){var r=this,a=r.length!==void 0,n=a?r:[r],i=this._private.cy||this;if(!i.styleEnabled())return!1;var s=n[0];if(s)return s._private.animation.current.length>0}},clearQueue:function(){return function(){var r=this,a=r.length!==void 0,n=a?r:[r],i=this._private.cy||this;if(!i.styleEnabled())return this;for(var s=0;s<n.length;s++){var o=n[s];o._private.animation.queue=[]}return this}},delay:function(){return function(r,a){var n=this._private.cy||this;if(!n.styleEnabled())return this;return this.animate({delay:r,duration:r,complete:a})}},delayAnimation:function(){return function(r,a){var n=this._private.cy||this;if(!n.styleEnabled())return this;return this.animation({delay:r,duration:r,complete:a})}},animation:function(){return function(r,a){var n=this,i=n.length!==void 0,s=i?n:[n],o=this._private.cy||this,l=!i,u=!l;if(!o.styleEnabled())return this;var f=o.style();r=Oe({},r,a);var v=Object.keys(r).length===0;if(v)return new _s(s[0],r);if(r.duration===void 0)r.duration=400;switch(r.duration){case"slow":r.duration=600;break;case"fast":r.duration=200;break}if(u)r.style=f.getPropsList(r.style||r.css),r.css=void 0;if(u&&r.renderedPosition!=null){var h=r.renderedPosition,c=o.pan(),d=o.zoom();r.position=If(h,d,c)}if(l&&r.panBy!=null){var g=r.panBy,y=o.pan();r.pan={x:y.x+g.x,y:y.y+g.y}}var p=r.center||r.centre;if(l&&p!=null){var m=o.getCenterPan(p.eles,r.zoom);if(m!=null)r.pan=m}if(l&&r.fit!=null){var b=r.fit,E=o.getFitViewport(b.eles||b.boundingBox,b.padding);if(E!=null)r.pan=E.pan,r.zoom=E.zoom}if(l&&We(r.zoom)){var A=o.getZoomedViewport(r.zoom);if(A!=null){if(A.zoomed)r.zoom=A.zoom;if(A.panned)r.pan=A.pan}else r.zoom=null}return new _s(s[0],r)}},animate:function(){return function(r,a){var n=this,i=n.length!==void 0,s=i?n:[n],o=this._private.cy||this;if(!o.styleEnabled())return this;if(a)r=Oe({},r,a);for(var l=0;l<s.length;l++){var u=s[l],f=u.animated()&&(r.queue===void 0||r.queue),v=u.animation(r,f?{queue:!0}:void 0);v.play()}return this}},stop:function(){return function(r,a){var n=this,i=n.length!==void 0,s=i?n:[n],o=this._private.cy||this;if(!o.styleEnabled())return this;for(var l=0;l<s.length;l++){var u=s[l],f=u._private,v=f.animation.current;for(var h=0;h<v.length;h++){var c=v[h],d=c._private;if(a)d.duration=0}if(r)f.animation.queue=[];if(!a)f.animation.current=[]}return o.notify("draw"),this}}},Bi,Cu;function ei(){if(Cu)return Bi;Cu=1;var t=Array.isArray;return Bi=t,Bi}var ki,Su;function Hd(){if(Su)return ki;Su=1;var t=ei(),e=Ja(),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;function n(i,s){if(t(i))return!1;var o=typeof i;if(o=="number"||o=="symbol"||o=="boolean"||i==null||e(i))return!0;return a.test(i)||!r.test(i)||s!=null&&i in Object(s)}return ki=n,ki}var Fi,Du;function qd(){if(Du)return Fi;Du=1;var t=Sf(),e=Qa(),r="[object AsyncFunction]",a="[object Function]",n="[object GeneratorFunction]",i="[object Proxy]";function s(o){if(!e(o))return!1;var l=t(o);return l==a||l==n||l==r||l==i}return Fi=s,Fi}var zi,Au;function Yd(){if(Au)return zi;Au=1;var t=_n(),e=t["__core-js_shared__"];return zi=e,zi}var Vi,Mu;function Xd(){if(Mu)return Vi;Mu=1;var t=Yd(),e=function(){var a=/[^.]+$/.exec(t&&t.keys&&t.keys.IE_PROTO||"");return a?"Symbol(src)_1."+a:""}();function r(a){return!!e&&e in a}return Vi=r,Vi}var Gi,Lu;function Wd(){if(Lu)return Gi;Lu=1;var t=Function.prototype,e=t.toString;function r(a){if(a!=null){try{return e.call(a)}catch(n){}try{return a+""}catch(n){}}return""}return Gi=r,Gi}var Ui,Ru;function $d(){if(Ru)return Ui;Ru=1;var t=qd(),e=Xd(),r=Qa(),a=Wd(),n=/[\\^$.*+?()[\]{}|]/g,i=/^\[object .+?Constructor\]$/,s=Function.prototype,o=Object.prototype,l=s.toString,u=o.hasOwnProperty,f=RegExp("^"+l.call(u).replace(n,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function v(h){if(!r(h)||e(h))return!1;var c=t(h)?f:i;return c.test(a(h))}return Ui=v,Ui}var Hi,Pu;function Kd(){if(Pu)return Hi;Pu=1;function t(e,r){return e==null?void 0:e[r]}return Hi=t,Hi}var qi,Nu;function To(){if(Nu)return qi;Nu=1;var t=$d(),e=Kd();function r(a,n){var i=e(a,n);return t(i)?i:void 0}return qi=r,qi}var Yi,Ou;function ti(){if(Ou)return Yi;Ou=1;var t=To(),e=t(Object,"create");return Yi=e,Yi}var Xi,Iu;function Zd(){if(Iu)return Xi;Iu=1;var t=ti();function e(){this.__data__=t?t(null):{},this.size=0}return Xi=e,Xi}var Wi,Bu;function _d(){if(Bu)return Wi;Bu=1;function t(e){var r=this.has(e)&&delete this.__data__[e];return this.size-=r?1:0,r}return Wi=t,Wi}var $i,ku;function Qd(){if(ku)return $i;ku=1;var t=ti(),e="__lodash_hash_undefined__",r=Object.prototype,a=r.hasOwnProperty;function n(i){var s=this.__data__;if(t){var o=s[i];return o===e?void 0:o}return a.call(s,i)?s[i]:void 0}return $i=n,$i}var Ki,Fu;function Jd(){if(Fu)return Ki;Fu=1;var t=ti(),e=Object.prototype,r=e.hasOwnProperty;function a(n){var i=this.__data__;return t?i[n]!==void 0:r.call(i,n)}return Ki=a,Ki}var Zi,zu;function jd(){if(zu)return Zi;zu=1;var t=ti(),e="__lodash_hash_undefined__";function r(a,n){var i=this.__data__;return this.size+=this.has(a)?0:1,i[a]=t&&n===void 0?e:n,this}return Zi=r,Zi}var _i,Vu;function eg(){if(Vu)return _i;Vu=1;var t=Zd(),e=_d(),r=Qd(),a=Jd(),n=jd();function i(s){var o=-1,l=s==null?0:s.length;this.clear();while(++o<l){var u=s[o];this.set(u[0],u[1])}}return i.prototype.clear=t,i.prototype.delete=e,i.prototype.get=r,i.prototype.has=a,i.prototype.set=n,_i=i,_i}var Qi,Gu;function tg(){if(Gu)return Qi;Gu=1;function t(){this.__data__=[],this.size=0}return Qi=t,Qi}var Ji,Uu;function Qf(){if(Uu)return Ji;Uu=1;function t(e,r){return e===r||e!==e&&r!==r}return Ji=t,Ji}var ji,Hu;function ri(){if(Hu)return ji;Hu=1;var t=Qf();function e(r,a){var n=r.length;while(n--)if(t(r[n][0],a))return n;return-1}return ji=e,ji}var es,qu;function rg(){if(qu)return es;qu=1;var t=ri(),e=Array.prototype,r=e.splice;function a(n){var i=this.__data__,s=t(i,n);if(s<0)return!1;var o=i.length-1;if(s==o)i.pop();else r.call(i,s,1);return--this.size,!0}return es=a,es}var ts,Yu;function ag(){if(Yu)return ts;Yu=1;var t=ri();function e(r){var a=this.__data__,n=t(a,r);return n<0?void 0:a[n][1]}return ts=e,ts}var rs,Xu;function ng(){if(Xu)return rs;Xu=1;var t=ri();function e(r){return t(this.__data__,r)>-1}return rs=e,rs}var as,Wu;function ig(){if(Wu)return as;Wu=1;var t=ri();function e(r,a){var n=this.__data__,i=t(n,r);if(i<0)++this.size,n.push([r,a]);else n[i][1]=a;return this}return as=e,as}var ns,$u;function sg(){if($u)return ns;$u=1;var t=tg(),e=rg(),r=ag(),a=ng(),n=ig();function i(s){var o=-1,l=s==null?0:s.length;this.clear();while(++o<l){var u=s[o];this.set(u[0],u[1])}}return i.prototype.clear=t,i.prototype.delete=e,i.prototype.get=r,i.prototype.has=a,i.prototype.set=n,ns=i,ns}var is,Ku;function og(){if(Ku)return is;Ku=1;var t=To(),e=_n(),r=t(e,"Map");return is=r,is}var ss,Zu;function ug(){if(Zu)return ss;Zu=1;var t=eg(),e=sg(),r=og();function a(){this.size=0,this.__data__={hash:new t,map:new(r||e),string:new t}}return ss=a,ss}var os,_u;function lg(){if(_u)return os;_u=1;function t(e){var r=typeof e;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?e!=="__proto__":e===null}return os=t,os}var us,Qu;function ai(){if(Qu)return us;Qu=1;var t=lg();function e(r,a){var n=r.__data__;return t(a)?n[typeof a=="string"?"string":"hash"]:n.map}return us=e,us}var ls,Ju;function fg(){if(Ju)return ls;Ju=1;var t=ai();function e(r){var a=t(this,r).delete(r);return this.size-=a?1:0,a}return ls=e,ls}var fs,ju;function vg(){if(ju)return fs;ju=1;var t=ai();function e(r){return t(this,r).get(r)}return fs=e,fs}var vs,el;function hg(){if(el)return vs;el=1;var t=ai();function e(r){return t(this,r).has(r)}return vs=e,vs}var hs,tl;function cg(){if(tl)return hs;tl=1;var t=ai();function e(r,a){var n=t(this,r),i=n.size;return n.set(r,a),this.size+=n.size==i?0:1,this}return hs=e,hs}var cs,rl;function dg(){if(rl)return cs;rl=1;var t=ug(),e=fg(),r=vg(),a=hg(),n=cg();function i(s){var o=-1,l=s==null?0:s.length;this.clear();while(++o<l){var u=s[o];this.set(u[0],u[1])}}return i.prototype.clear=t,i.prototype.delete=e,i.prototype.get=r,i.prototype.has=a,i.prototype.set=n,cs=i,cs}var ds,al;function gg(){if(al)return ds;al=1;var t=dg(),e="Expected a function";function r(a,n){if(typeof a!="function"||n!=null&&typeof n!="function")throw TypeError(e);var i=function(){var s=arguments,o=n?n.apply(this,s):s[0],l=i.cache;if(l.has(o))return l.get(o);var u=a.apply(this,s);return i.cache=l.set(o,u)||l,u};return i.cache=new(r.Cache||t),i}return r.Cache=t,ds=r,ds}var gs,nl;function pg(){if(nl)return gs;nl=1;var t=gg(),e=500;function r(a){var n=t(a,function(s){if(i.size===e)i.clear();return s}),i=n.cache;return n}return gs=r,gs}var ps,il;function Jf(){if(il)return ps;il=1;var t=pg(),e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,r=/\\(\\)?/g,a=t(function(n){var i=[];if(n.charCodeAt(0)===46)i.push("");return n.replace(e,function(s,o,l,u){i.push(l?u.replace(r,"$1"):o||s)}),i});return ps=a,ps}var ys,sl;function jf(){if(sl)return ys;sl=1;function t(e,r){var a=-1,n=e==null?0:e.length,i=Array(n);while(++a<n)i[a]=r(e[a],a,e);return i}return ys=t,ys}var ms,ol;function yg(){if(ol)return ms;ol=1;var t=co(),e=jf(),r=ei(),a=Ja(),n=t?t.prototype:void 0,i=n?n.toString:void 0;function s(o){if(typeof o=="string")return o;if(r(o))return e(o,s)+"";if(a(o))return i?i.call(o):"";var l=o+"";return l=="0"&&1/o==-1/0?"-0":l}return ms=s,ms}var bs,ul;function ev(){if(ul)return bs;ul=1;var t=yg();function e(r){return r==null?"":t(r)}return bs=e,bs}var ws,ll;function tv(){if(ll)return ws;ll=1;var t=ei(),e=Hd(),r=Jf(),a=ev();function n(i,s){if(t(i))return i;return e(i,s)?[i]:r(a(i))}return ws=n,ws}var Es,fl;function Co(){if(fl)return Es;fl=1;var t=Ja();function e(r){if(typeof r=="string"||t(r))return r;var a=r+"";return a=="0"&&1/r==-1/0?"-0":a}return Es=e,Es}var xs,vl;function mg(){if(vl)return xs;vl=1;var t=tv(),e=Co();function r(a,n){n=t(n,a);var i=0,s=n.length;while(a!=null&&i<s)a=a[e(n[i++])];return i&&i==s?a:void 0}return xs=r,xs}var Ts,hl;function bg(){if(hl)return Ts;hl=1;var t=mg();function e(r,a,n){var i=r==null?void 0:t(r,a);return i===void 0?n:i}return Ts=e,Ts}var wg=bg(),Eg=_a(wg),Cs,cl;function xg(){if(cl)return Cs;cl=1;var t=To(),e=function(){try{var r=t(Object,"defineProperty");return r({},"",{}),r}catch(a){}}();return Cs=e,Cs}var Ss,dl;function Tg(){if(dl)return Ss;dl=1;var t=xg();function e(r,a,n){if(a=="__proto__"&&t)t(r,a,{configurable:!0,enumerable:!0,value:n,writable:!0});else r[a]=n}return Ss=e,Ss}var Ds,gl;function Cg(){if(gl)return Ds;gl=1;var t=Tg(),e=Qf(),r=Object.prototype,a=r.hasOwnProperty;function n(i,s,o){var l=i[s];if(!(a.call(i,s)&&e(l,o))||o===void 0&&!(s in i))t(i,s,o)}return Ds=n,Ds}var As,pl;function Sg(){if(pl)return As;pl=1;var t=9007199254740991,e=/^(?:0|[1-9]\d*)$/;function r(a,n){var i=typeof a;return n=n==null?t:n,!!n&&(i=="number"||i!="symbol"&&e.test(a))&&(a>-1&&a%1==0&&a<n)}return As=r,As}var Ms,yl;function Dg(){if(yl)return Ms;yl=1;var t=Cg(),e=tv(),r=Sg(),a=Qa(),n=Co();function i(s,o,l,u){if(!a(s))return s;o=e(o,s);var f=-1,v=o.length,h=v-1,c=s;while(c!=null&&++f<v){var d=n(o[f]),g=l;if(d==="__proto__"||d==="constructor"||d==="prototype")return s;if(f!=h){var y=c[d];if(g=u?u(y,d,c):void 0,g===void 0)g=a(y)?y:r(o[f+1])?[]:{}}t(c,d,g),c=c[d]}return s}return Ms=i,Ms}var Ls,ml;function Ag(){if(ml)return Ls;ml=1;var t=Dg();function e(r,a,n){return r==null?r:t(r,a,n)}return Ls=e,Ls}var Mg=Ag(),Lg=_a(Mg),Rs,bl;function Rg(){if(bl)return Rs;bl=1;function t(e,r){var a=-1,n=e.length;r||(r=Array(n));while(++a<n)r[a]=e[a];return r}return Rs=t,Rs}var Ps,wl;function Pg(){if(wl)return Ps;wl=1;var t=jf(),e=Rg(),r=ei(),a=Ja(),n=Jf(),i=Co(),s=ev();function o(l){if(r(l))return t(l,i);return a(l)?[l]:e(n(s(l)))}return Ps=o,Ps}var Ng=Pg(),Og=_a(Ng),Ig={data:function(e){var r={field:"data",bindingEvent:"data",allowBinding:!1,allowSetting:!1,allowGetting:!1,settingEvent:"data",settingTriggersEvent:!1,triggerFnName:"trigger",immutableKeys:{},updateStyle:!1,beforeGet:function(n){},beforeSet:function(n,i){},onSet:function(n){},canSet:function(n){return!0}};return e=Oe({},r,e),function(n,i){var s=e,o=this,l=o.length!==void 0,u=l?o:[o],f=l?o[0]:o;if(Re(n)){var v=n.indexOf(".")!==-1,h=v&&Og(n);if(s.allowGetting&&i===void 0){var c;if(f)if(s.beforeGet(f),h&&f._private[s.field][n]===void 0)c=Eg(f._private[s.field],h);else c=f._private[s.field][n];return c}else if(s.allowSetting&&i!==void 0){var d=!s.immutableKeys[n];if(d){var g=df({},n,i);s.beforeSet(o,g);for(var y=0,p=u.length;y<p;y++){var m=u[y];if(s.canSet(m))if(h&&f._private[s.field][n]===void 0)Lg(m._private[s.field],h,i);else m._private[s.field][n]=i}if(s.updateStyle)o.updateStyle();if(s.onSet(o),s.settingTriggersEvent)o[s.triggerFnName](s.settingEvent)}}}else if(s.allowSetting&&We(n)){var b=n,E,A,M=Object.keys(b);s.beforeSet(o,b);for(var S=0;S<M.length;S++){E=M[S],A=b[E];var P=!s.immutableKeys[E];if(P)for(var N=0;N<u.length;N++){var R=u[N];if(s.canSet(R))R._private[s.field][E]=A}}if(s.updateStyle)o.updateStyle();if(s.onSet(o),s.settingTriggersEvent)o[s.triggerFnName](s.settingEvent)}else if(s.allowBinding&&st(n)){var I=n;o.on(s.bindingEvent,I)}else if(s.allowGetting&&n===void 0){var w;if(f)s.beforeGet(f),w=f._private[s.field];return w}return o}},removeData:function(e){var r={field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!1,immutableKeys:{}};return e=Oe({},r,e),function(n){var i=e,s=this,o=s.length!==void 0,l=o?s:[s];if(Re(n)){var u=n.split(/\s+/),f=u.length;for(var v=0;v<f;v++){var h=u[v];if(xr(h))continue;var c=!i.immutableKeys[h];if(c)for(var d=0,g=l.length;d<g;d++)l[d]._private[i.field][h]=void 0}if(i.triggerEvent)s[i.triggerFnName](i.event)}else if(n===void 0){for(var y=0,p=l.length;y<p;y++){var m=l[y]._private[i.field],b=Object.keys(m);for(var E=0;E<b.length;E++){var A=b[E],M=!i.immutableKeys[A];if(M)m[A]=void 0}}if(i.triggerEvent)s[i.triggerFnName](i.event)}return s}}},Bg={eventAliasesOn:function(e){var r=e;r.addListener=r.listen=r.bind=r.on,r.unlisten=r.unbind=r.off=r.removeListener,r.trigger=r.emit,r.pon=r.promiseOn=function(a,n){var i=this,s=Array.prototype.slice.call(arguments,0);return new ga(function(o,l){var u=function(c){i.off.apply(i,v),o(c)},f=s.concat([u]),v=f.concat([]);i.on.apply(i,f)})}}},Ze={};[Ud,Ig,Bg].forEach(function(t){Oe(Ze,t)});var kg={animate:Ze.animate(),animation:Ze.animation(),animated:Ze.animated(),clearQueue:Ze.clearQueue(),delay:Ze.delay(),delayAnimation:Ze.delayAnimation(),stop:Ze.stop()},An={classes:function(e){var r=this;if(e===void 0){var a=[];return r[0]._private.classes.forEach(function(d){return a.push(d)}),a}else if(!Je(e))e=(e||"").match(/\S+/g)||[];var n=[],i=new da(e);for(var s=0;s<r.length;s++){var o=r[s],l=o._private,u=l.classes,f=!1;for(var v=0;v<e.length;v++){var h=e[v],c=u.has(h);if(!c){f=!0;break}}if(!f)f=u.size!==e.length;if(f)l.classes=i,n.push(o)}if(n.length>0)this.spawn(n).updateStyle().emit("class");return r},addClass:function(e){return this.toggleClass(e,!0)},hasClass:function(e){var r=this[0];return r!=null&&r._private.classes.has(e)},toggleClass:function(e,r){if(!Je(e))e=e.match(/\S+/g)||[];var a=this,n=r===void 0,i=[];for(var s=0,o=a.length;s<o;s++){var l=a[s],u=l._private.classes,f=!1;for(var v=0;v<e.length;v++){var h=e[v],c=u.has(h),d=!1;if(r||n&&!c)u.add(h),d=!0;else if(!r||n&&c)u.delete(h),d=!0;if(!f&&d)i.push(l),f=!0}}if(i.length>0)this.spawn(i).updateStyle().emit("class");return a},removeClass:function(e){return this.toggleClass(e,!1)},flashClass:function(e,r){var a=this;if(r==null)r=250;else if(r===0)return a;return a.addClass(e),setTimeout(function(){a.removeClass(e)},r),a}};An.className=An.classNames=An.classes;var Xe={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:`"(?:\\\\"|[^"])*"|'(?:\\\\'|[^'])*'`,number:gt,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};Xe.variable="(?:[\\w-.]|(?:\\\\"+Xe.metaChar+"))+";Xe.className="(?:[\\w-]|(?:\\\\"+Xe.metaChar+"))+";Xe.value=Xe.string+"|"+Xe.number;Xe.id=Xe.variable;(function(){var t,e,r;t=Xe.comparatorOp.split("|");for(r=0;r<t.length;r++)e=t[r],Xe.comparatorOp+="|@"+e;t=Xe.comparatorOp.split("|");for(r=0;r<t.length;r++){if(e=t[r],e.indexOf("!")>=0)continue;if(e==="=")continue;Xe.comparatorOp+="|\\!"+e}})();var Qe=function(){return{checks:[]}},we={GROUP:0,COLLECTION:1,FILTER:2,DATA_COMPARE:3,DATA_EXIST:4,DATA_BOOL:5,META_COMPARE:6,STATE:7,ID:8,CLASS:9,UNDIRECTED_EDGE:10,DIRECTED_EDGE:11,NODE_SOURCE:12,NODE_TARGET:13,NODE_NEIGHBOR:14,CHILD:15,DESCENDANT:16,PARENT:17,ANCESTOR:18,COMPOUND_SPLIT:19,TRUE:20};var Qs=[{selector:":selected",matches:function(e){return e.selected()}},{selector:":unselected",matches:function(e){return!e.selected()}},{selector:":selectable",matches:function(e){return e.selectable()}},{selector:":unselectable",matches:function(e){return!e.selectable()}},{selector:":locked",matches:function(e){return e.locked()}},{selector:":unlocked",matches:function(e){return!e.locked()}},{selector:":visible",matches:function(e){return e.visible()}},{selector:":hidden",matches:function(e){return!e.visible()}},{selector:":transparent",matches:function(e){return e.transparent()}},{selector:":grabbed",matches:function(e){return e.grabbed()}},{selector:":free",matches:function(e){return!e.grabbed()}},{selector:":removed",matches:function(e){return e.removed()}},{selector:":inside",matches:function(e){return!e.removed()}},{selector:":grabbable",matches:function(e){return e.grabbable()}},{selector:":ungrabbable",matches:function(e){return!e.grabbable()}},{selector:":animated",matches:function(e){return e.animated()}},{selector:":unanimated",matches:function(e){return!e.animated()}},{selector:":parent",matches:function(e){return e.isParent()}},{selector:":childless",matches:function(e){return e.isChildless()}},{selector:":child",matches:function(e){return e.isChild()}},{selector:":orphan",matches:function(e){return e.isOrphan()}},{selector:":nonorphan",matches:function(e){return e.isChild()}},{selector:":compound",matches:function(e){if(e.isNode())return e.isParent();else return e.source().isParent()||e.target().isParent()}},{selector:":loop",matches:function(e){return e.isLoop()}},{selector:":simple",matches:function(e){return e.isSimple()}},{selector:":active",matches:function(e){return e.active()}},{selector:":inactive",matches:function(e){return!e.active()}},{selector:":backgrounding",matches:function(e){return e.backgrounding()}},{selector:":nonbackgrounding",matches:function(e){return!e.backgrounding()}}].sort(function(t,e){return Oh(t.selector,e.selector)}),Fg=function(){var t={},e;for(var r=0;r<Qs.length;r++)e=Qs[r],t[e.selector]=e.matches;return t}(),zg=function(e,r){return Fg[e](r)},Vg="("+Qs.map(function(t){return t.selector}).join("|")+")",Kr=function(e){return e.replace(new RegExp("\\\\("+Xe.metaChar+")","g"),function(r,a){return a})},dr=function(e,r,a){e[e.length-1]=a},Js=[{name:"group",query:!0,regex:"("+Xe.group+")",populate:function(e,r,a){var n=ht(a,1),i=n[0];r.checks.push({type:we.GROUP,value:i==="*"?i:i+"s"})}},{name:"state",query:!0,regex:Vg,populate:function(e,r,a){var n=ht(a,1),i=n[0];r.checks.push({type:we.STATE,value:i})}},{name:"id",query:!0,regex:"\\#("+Xe.id+")",populate:function(e,r,a){var n=ht(a,1),i=n[0];r.checks.push({type:we.ID,value:Kr(i)})}},{name:"className",query:!0,regex:"\\.("+Xe.className+")",populate:function(e,r,a){var n=ht(a,1),i=n[0];r.checks.push({type:we.CLASS,value:Kr(i)})}},{name:"dataExists",query:!0,regex:"\\[\\s*("+Xe.variable+")\\s*\\]",populate:function(e,r,a){var n=ht(a,1),i=n[0];r.checks.push({type:we.DATA_EXIST,field:Kr(i)})}},{name:"dataCompare",query:!0,regex:"\\[\\s*("+Xe.variable+")\\s*("+Xe.comparatorOp+")\\s*("+Xe.value+")\\s*\\]",populate:function(e,r,a){var n=ht(a,3),i=n[0],s=n[1],o=n[2],l=new RegExp("^"+Xe.string+"$").exec(o)!=null;if(l)o=o.substring(1,o.length-1);else o=parseFloat(o);r.checks.push({type:we.DATA_COMPARE,field:Kr(i),operator:s,value:o})}},{name:"dataBool",query:!0,regex:"\\[\\s*("+Xe.boolOp+")\\s*("+Xe.variable+")\\s*\\]",populate:function(e,r,a){var n=ht(a,2),i=n[0],s=n[1];r.checks.push({type:we.DATA_BOOL,field:Kr(s),operator:i})}},{name:"metaCompare",query:!0,regex:"\\[\\[\\s*("+Xe.meta+")\\s*("+Xe.comparatorOp+")\\s*("+Xe.number+")\\s*\\]\\]",populate:function(e,r,a){var n=ht(a,3),i=n[0],s=n[1],o=n[2];r.checks.push({type:we.META_COMPARE,field:Kr(i),operator:s,value:parseFloat(o)})}},{name:"nextQuery",separator:!0,regex:Xe.separator,populate:function(e,r){var{currentSubject:a,edgeCount:n,compoundCount:i}=e,s=e[e.length-1];if(a!=null)s.subject=a,e.currentSubject=null;s.edgeCount=n,s.compoundCount=i,e.edgeCount=0,e.compoundCount=0;var o=e[e.length++]=Qe();return o}},{name:"directedEdge",separator:!0,regex:Xe.directedEdge,populate:function(e,r){if(e.currentSubject==null){var a=Qe(),n=r,i=Qe();return a.checks.push({type:we.DIRECTED_EDGE,source:n,target:i}),dr(e,r,a),e.edgeCount++,i}else{var s=Qe(),o=r,l=Qe();return s.checks.push({type:we.NODE_SOURCE,source:o,target:l}),dr(e,r,s),e.edgeCount++,l}}},{name:"undirectedEdge",separator:!0,regex:Xe.undirectedEdge,populate:function(e,r){if(e.currentSubject==null){var a=Qe(),n=r,i=Qe();return a.checks.push({type:we.UNDIRECTED_EDGE,nodes:[n,i]}),dr(e,r,a),e.edgeCount++,i}else{var s=Qe(),o=r,l=Qe();return s.checks.push({type:we.NODE_NEIGHBOR,node:o,neighbor:l}),dr(e,r,s),l}}},{name:"child",separator:!0,regex:Xe.child,populate:function(e,r){if(e.currentSubject==null){var a=Qe(),n=Qe(),i=e[e.length-1];return a.checks.push({type:we.CHILD,parent:i,child:n}),dr(e,r,a),e.compoundCount++,n}else if(e.currentSubject===r){var s=Qe(),o=e[e.length-1],l=Qe(),u=Qe(),f=Qe(),v=Qe();return s.checks.push({type:we.COMPOUND_SPLIT,left:o,right:l,subject:u}),u.checks=r.checks,r.checks=[{type:we.TRUE}],v.checks.push({type:we.TRUE}),l.checks.push({type:we.PARENT,parent:v,child:f}),dr(e,o,s),e.currentSubject=u,e.compoundCount++,f}else{var h=Qe(),c=Qe(),d=[{type:we.PARENT,parent:h,child:c}];return h.checks=r.checks,r.checks=d,e.compoundCount++,c}}},{name:"descendant",separator:!0,regex:Xe.descendant,populate:function(e,r){if(e.currentSubject==null){var a=Qe(),n=Qe(),i=e[e.length-1];return a.checks.push({type:we.DESCENDANT,ancestor:i,descendant:n}),dr(e,r,a),e.compoundCount++,n}else if(e.currentSubject===r){var s=Qe(),o=e[e.length-1],l=Qe(),u=Qe(),f=Qe(),v=Qe();return s.checks.push({type:we.COMPOUND_SPLIT,left:o,right:l,subject:u}),u.checks=r.checks,r.checks=[{type:we.TRUE}],v.checks.push({type:we.TRUE}),l.checks.push({type:we.ANCESTOR,ancestor:v,descendant:f}),dr(e,o,s),e.currentSubject=u,e.compoundCount++,f}else{var h=Qe(),c=Qe(),d=[{type:we.ANCESTOR,ancestor:h,descendant:c}];return h.checks=r.checks,r.checks=d,e.compoundCount++,c}}},{name:"subject",modifier:!0,regex:Xe.subject,populate:function(e,r){if(e.currentSubject!=null&&e.currentSubject!==r)return _e("Redefinition of subject in selector `"+e.toString()+"`"),!1;e.currentSubject=r;var a=e[e.length-1],n=a.checks[0],i=n==null?null:n.type;if(i===we.DIRECTED_EDGE)n.type=we.NODE_TARGET;else if(i===we.UNDIRECTED_EDGE)n.type=we.NODE_NEIGHBOR,n.node=n.nodes[1],n.neighbor=n.nodes[0],n.nodes=null}}];Js.forEach(function(t){return t.regexObj=new RegExp("^"+t.regex)});var Gg=function(e){var r,a,n;for(var i=0;i<Js.length;i++){var s=Js[i],o=s.name,l=e.match(s.regexObj);if(l!=null){a=l,r=s,n=o;var u=l[0];e=e.substring(u.length);break}}return{expr:r,match:a,name:n,remaining:e}},Ug=function(e){var r=e.match(/^\s+/);if(r){var a=r[0];e=e.substring(a.length)}return e},Hg=function(e){var r=this,a=r.inputText=e,n=r[0]=Qe();r.length=1,a=Ug(a);for(;;){var i=Gg(a);if(i.expr==null)return _e("The selector `"+e+"`is invalid"),!1;else{var s=i.match.slice(1),o=i.expr.populate(r,n,s);if(o===!1)return!1;else if(o!=null)n=o}if(a=i.remaining,a.match(/^\s*$/))break}var l=r[r.length-1];if(r.currentSubject!=null)l.subject=r.currentSubject;l.edgeCount=r.edgeCount,l.compoundCount=r.compoundCount;for(var u=0;u<r.length;u++){var f=r[u];if(f.compoundCount>0&&f.edgeCount>0)return _e("The selector `"+e+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(f.edgeCount>1)return _e("The selector `"+e+"` is invalid because it uses multiple edge selectors"),!1;else if(f.edgeCount===1)_e("The selector `"+e+"` is deprecated. Edge selectors do not take effect on changes to source and target nodes after an edge is added, for performance reasons. Use a class or data selector on edges instead, updating the class or data of an edge when your app detects a change in source or target nodes.")}return!0},qg=function(){if(this.toStringCache!=null)return this.toStringCache;var e=function(f){if(f==null)return"";else return f},r=function(f){if(Re(f))return'"'+f+'"';else return e(f)},a=function(f){return" "+f+" "},n=function(f,v){var{type:h,value:c}=f;switch(h){case we.GROUP:{var d=e(c);return d.substring(0,d.length-1)}case we.DATA_COMPARE:{var{field:g,operator:y}=f;return"["+g+a(e(y))+r(c)+"]"}case we.DATA_BOOL:{var{operator:p,field:m}=f;return"["+e(p)+m+"]"}case we.DATA_EXIST:{var b=f.field;return"["+b+"]"}case we.META_COMPARE:{var{operator:E,field:A}=f;return"[["+A+a(e(E))+r(c)+"]]"}case we.STATE:return c;case we.ID:return"#"+c;case we.CLASS:return"."+c;case we.PARENT:case we.CHILD:return i(f.parent,v)+a(">")+i(f.child,v);case we.ANCESTOR:case we.DESCENDANT:return i(f.ancestor,v)+" "+i(f.descendant,v);case we.COMPOUND_SPLIT:{var M=i(f.left,v),S=i(f.subject,v),P=i(f.right,v);return M+(M.length>0?" ":"")+S+P}case we.TRUE:return""}},i=function(f,v){return f.checks.reduce(function(h,c,d){return h+(v===f&&d===0?"$":"")+n(c,v)},"")},s="";for(var o=0;o<this.length;o++){var l=this[o];if(s+=i(l,l.subject),this.length>1&&o<this.length-1)s+=", "}return this.toStringCache=s,s},Yg={parse:Hg,toString:qg},rv=function(e,r,a){var n,i=Re(e),s=he(e),o=Re(a),l,u,f=!1,v=!1,h=!1;if(r.indexOf("!")>=0)r=r.replace("!",""),v=!0;if(r.indexOf("@")>=0)r=r.replace("@",""),f=!0;if(i||o||f)l=!i&&!s?"":""+e,u=""+a;if(f)e=l=l.toLowerCase(),a=u=u.toLowerCase();switch(r){case"*=":n=l.indexOf(u)>=0;break;case"$=":n=l.indexOf(u,l.length-u.length)>=0;break;case"^=":n=l.indexOf(u)===0;break;case"=":n=e===a;break;case">":h=!0,n=e>a;break;case">=":h=!0,n=e>=a;break;case"<":h=!0,n=e<a;break;case"<=":h=!0,n=e<=a;break;default:n=!1;break}if(v&&(e!=null||!h))n=!n;return n},Xg=function(e,r){switch(r){case"?":return e?!0:!1;case"!":return e?!1:!0;case"^":return e===void 0}},Wg=function(e){return e!==void 0},So=function(e,r){return e.data(r)},$g=function(e,r){return e[r]()},ut=[],at=function(e,r){return e.checks.every(function(a){return ut[a.type](a,r)})};ut[we.GROUP]=function(t,e){var r=t.value;return r==="*"||r===e.group()};ut[we.STATE]=function(t,e){var r=t.value;return zg(r,e)};ut[we.ID]=function(t,e){var r=t.value;return e.id()===r};ut[we.CLASS]=function(t,e){var r=t.value;return e.hasClass(r)};ut[we.META_COMPARE]=function(t,e){var{field:r,operator:a,value:n}=t;return rv($g(e,r),a,n)};ut[we.DATA_COMPARE]=function(t,e){var{field:r,operator:a,value:n}=t;return rv(So(e,r),a,n)};ut[we.DATA_BOOL]=function(t,e){var{field:r,operator:a}=t;return Xg(So(e,r),a)};ut[we.DATA_EXIST]=function(t,e){var r=t.field;return t.operator,Wg(So(e,r))};ut[we.UNDIRECTED_EDGE]=function(t,e){var r=t.nodes[0],a=t.nodes[1],n=e.source(),i=e.target();return at(r,n)&&at(a,i)||at(a,n)&&at(r,i)};ut[we.NODE_NEIGHBOR]=function(t,e){return at(t.node,e)&&e.neighborhood().some(function(r){return r.isNode()&&at(t.neighbor,r)})};ut[we.DIRECTED_EDGE]=function(t,e){return at(t.source,e.source())&&at(t.target,e.target())};ut[we.NODE_SOURCE]=function(t,e){return at(t.source,e)&&e.outgoers().some(function(r){return r.isNode()&&at(t.target,r)})};ut[we.NODE_TARGET]=function(t,e){return at(t.target,e)&&e.incomers().some(function(r){return r.isNode()&&at(t.source,r)})};ut[we.CHILD]=function(t,e){return at(t.child,e)&&at(t.parent,e.parent())};ut[we.PARENT]=function(t,e){return at(t.parent,e)&&e.children().some(function(r){return at(t.child,r)})};ut[we.DESCENDANT]=function(t,e){return at(t.descendant,e)&&e.ancestors().some(function(r){return at(t.ancestor,r)})};ut[we.ANCESTOR]=function(t,e){return at(t.ancestor,e)&&e.descendants().some(function(r){return at(t.descendant,r)})};ut[we.COMPOUND_SPLIT]=function(t,e){return at(t.subject,e)&&at(t.left,e)&&at(t.right,e)};ut[we.TRUE]=function(){return!0};ut[we.COLLECTION]=function(t,e){var r=t.value;return r.has(e)};ut[we.FILTER]=function(t,e){var r=t.value;return r(e)};var Kg=function(e){var r=this;if(r.length===1&&r[0].checks.length===1&&r[0].checks[0].type===we.ID)return e.getElementById(r[0].checks[0].value).collection();var a=function(i){for(var s=0;s<r.length;s++){var o=r[s];if(at(o,i))return!0}return!1};if(r.text()==null)a=function(){return!0};return e.filter(a)},Zg=function(e){var r=this;for(var a=0;a<r.length;a++){var n=r[a];if(at(n,e))return!0}return!1},_g={matches:Zg,filter:Kg},Sr=function(e){if(this.inputText=e,this.currentSubject=null,this.compoundCount=0,this.edgeCount=0,this.length=0,e==null||Re(e)&&e.match(/^\s*$/));else if(zt(e))this.addQuery({checks:[{type:we.COLLECTION,value:e.collection()}]});else if(st(e))this.addQuery({checks:[{type:we.FILTER,value:e}]});else if(Re(e)){if(!this.parse(e))this.invalid=!0}else it("A selector must be created from a string; found ")},Dr=Sr.prototype;[Yg,_g].forEach(function(t){return Oe(Dr,t)});Dr.text=function(){return this.inputText};Dr.size=function(){return this.length};Dr.eq=function(t){return this[t]};Dr.sameText=function(t){return!this.invalid&&!t.invalid&&this.text()===t.text()};Dr.addQuery=function(t){this[this.length++]=t};Dr.selector=Dr.toString;var wr={allAre:function(e){var r=new Sr(e);return this.every(function(a){return r.matches(a)})},is:function(e){var r=new Sr(e);return this.some(function(a){return r.matches(a)})},some:function(e,r){for(var a=0;a<this.length;a++){var n=!r?e(this[a],a,this):e.apply(r,[this[a],a,this]);if(n)return!0}return!1},every:function(e,r){for(var a=0;a<this.length;a++){var n=!r?e(this[a],a,this):e.apply(r,[this[a],a,this]);if(!n)return!1}return!0},same:function(e){if(this===e)return!0;e=this.cy().collection(e);var r=this.length,a=e.length;if(r!==a)return!1;if(r===1)return this[0]===e[0];return this.every(function(n){return e.hasElementWithId(n.id())})},anySame:function(e){return e=this.cy().collection(e),this.some(function(r){return e.hasElementWithId(r.id())})},allAreNeighbors:function(e){e=this.cy().collection(e);var r=this.neighborhood();return e.every(function(a){return r.hasElementWithId(a.id())})},contains:function(e){e=this.cy().collection(e);var r=this;return e.every(function(a){return r.hasElementWithId(a.id())})}};wr.allAreNeighbours=wr.allAreNeighbors;wr.has=wr.contains;wr.equal=wr.equals=wr.same;var Ht=function(e,r){return function(n,i,s,o){var l=n,u=this,f;if(l==null)f="";else if(zt(l)&&l.length===1)f=l.id();if(u.length===1&&f){var v=u[0]._private,h=v.traversalCache=v.traversalCache||{},c=h[r]=h[r]||[],d=Gr(f),g=c[d];if(g)return g;else return c[d]=e.call(u,n,i,s,o)}else return e.call(u,n,i,s,o)}},va={parent:function(e){var r=[];if(this.length===1){var a=this[0]._private.parent;if(a)return a}for(var n=0;n<this.length;n++){var i=this[n],s=i._private.parent;if(s)r.push(s)}return this.spawn(r,!0).filter(e)},parents:function(e){var r=[],a=this.parent();while(a.nonempty()){for(var n=0;n<a.length;n++){var i=a[n];r.push(i)}a=a.parent()}return this.spawn(r,!0).filter(e)},commonAncestors:function(e){var r;for(var a=0;a<this.length;a++){var n=this[a],i=n.parents();r=r||i,r=r.intersect(i)}return r.filter(e)},orphans:function(e){return this.stdFilter(function(r){return r.isOrphan()}).filter(e)},nonorphans:function(e){return this.stdFilter(function(r){return r.isChild()}).filter(e)},children:Ht(function(t){var e=[];for(var r=0;r<this.length;r++){var a=this[r],n=a._private.children;for(var i=0;i<n.length;i++)e.push(n[i])}return this.spawn(e,!0).filter(t)},"children"),siblings:function(e){return this.parent().children().not(this).filter(e)},isParent:function(){var e=this[0];if(e)return e.isNode()&&e._private.children.length!==0},isChildless:function(){var e=this[0];if(e)return e.isNode()&&e._private.children.length===0},isChild:function(){var e=this[0];if(e)return e.isNode()&&e._private.parent!=null},isOrphan:function(){var e=this[0];if(e)return e.isNode()&&e._private.parent==null},descendants:function(e){var r=[];function a(n){for(var i=0;i<n.length;i++){var s=n[i];if(r.push(s),s.children().nonempty())a(s.children())}}return a(this.children()),this.spawn(r,!0).filter(e)}};function Do(t,e,r,a){var n=[],i=new da,s=t.cy(),o=s.hasCompoundNodes();for(var l=0;l<t.length;l++){var u=t[l];if(r)n.push(u);else if(o)a(n,i,u)}while(n.length>0){var f=n.shift();if(e(f),i.add(f.id()),o)a(n,i,f)}return t}function av(t,e,r){if(r.isParent()){var a=r._private.children;for(var n=0;n<a.length;n++){var i=a[n];if(!e.has(i.id()))t.push(i)}}}va.forEachDown=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return Do(this,t,e,av)};function nv(t,e,r){if(r.isChild()){var a=r._private.parent;if(!e.has(a.id()))t.push(a)}}va.forEachUp=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return Do(this,t,e,nv)};function Qg(t,e,r){nv(t,e,r),av(t,e,r)}va.forEachUpAndDown=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return Do(this,t,e,Qg)};va.ancestors=va.parents;var qa,iv;qa=iv={data:Ze.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),removeData:Ze.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:Ze.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Ze.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:Ze.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:Ze.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}};qa.attr=qa.data;qa.removeAttr=qa.removeData;var Jg=iv,ni={};function Ns(t){return function(e){var r=this;if(e===void 0)e=!0;if(r.length===0)return;if(r.isNode()&&!r.removed()){var a=0,n=r[0],i=n._private.edges;for(var s=0;s<i.length;s++){var o=i[s];if(!e&&o.isLoop())continue;a+=t(n,o)}return a}else return}}Oe(ni,{degree:Ns(function(t,e){if(e.source().same(e.target()))return 2;else return 1}),indegree:Ns(function(t,e){if(e.target().same(t))return 1;else return 0}),outdegree:Ns(function(t,e){if(e.source().same(t))return 1;else return 0})});function Zr(t,e){return function(r){var a,n=this.nodes();for(var i=0;i<n.length;i++){var s=n[i],o=s[t](r);if(o!==void 0&&(a===void 0||e(o,a)))a=o}return a}}Oe(ni,{minDegree:Zr("degree",function(t,e){return t<e}),maxDegree:Zr("degree",function(t,e){return t>e}),minIndegree:Zr("indegree",function(t,e){return t<e}),maxIndegree:Zr("indegree",function(t,e){return t>e}),minOutdegree:Zr("outdegree",function(t,e){return t<e}),maxOutdegree:Zr("outdegree",function(t,e){return t>e})});Oe(ni,{totalDegree:function(e){var r=0,a=this.nodes();for(var n=0;n<a.length;n++)r+=a[n].degree(e);return r}});var Wt,sv,ov=function(e,r,a){for(var n=0;n<e.length;n++){var i=e[n];if(!i.locked()){var s=i._private.position,o={x:r.x!=null?r.x-s.x:0,y:r.y!=null?r.y-s.y:0};if(i.isParent()&&!(o.x===0&&o.y===0))i.children().shift(o,a);i.dirtyBoundingBoxCache()}}},El={field:"position",bindingEvent:"position",allowBinding:!0,allowSetting:!0,settingEvent:"position",settingTriggersEvent:!0,triggerFnName:"emitAndNotify",allowGetting:!0,validKeys:["x","y"],beforeGet:function(e){e.updateCompoundBounds()},beforeSet:function(e,r){ov(e,r,!1)},onSet:function(e){e.dirtyCompoundBoundsCache()},canSet:function(e){return!e.locked()}};Wt=sv={position:Ze.data(El),silentPosition:Ze.data(Oe({},El,{allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!1,beforeSet:function(e,r){ov(e,r,!0)},onSet:function(e){e.dirtyCompoundBoundsCache()}})),positions:function(e,r){if(We(e))if(r)this.silentPosition(e);else this.position(e);else if(st(e)){var a=e,n=this.cy();n.startBatch();for(var i=0;i<this.length;i++){var s=this[i],o=void 0;if(o=a(s,i))if(r)s.silentPosition(o);else s.position(o)}n.endBatch()}return this},silentPositions:function(e){return this.positions(e,!0)},shift:function(e,r,a){var n;if(We(e))n={x:he(e.x)?e.x:0,y:he(e.y)?e.y:0},a=r;else if(Re(e)&&he(r))n={x:0,y:0},n[e]=r;if(n!=null){var i=this.cy();i.startBatch();for(var s=0;s<this.length;s++){var o=this[s];if(i.hasCompoundNodes()&&o.isChild()&&o.ancestors().anySame(this))continue;var l=o.position(),u={x:l.x+n.x,y:l.y+n.y};if(a)o.silentPosition(u);else o.position(u)}i.endBatch()}return this},silentShift:function(e,r){if(We(e))this.shift(e,!0);else if(Re(e)&&he(r))this.shift(e,r,!0);return this},renderedPosition:function(e,r){var a=this[0],n=this.cy(),i=n.zoom(),s=n.pan(),o=We(e)?e:void 0,l=o!==void 0||r!==void 0&&Re(e);if(a&&a.isNode())if(l)for(var u=0;u<this.length;u++){var f=this[u];if(r!==void 0)f.position(e,(r-s[e])/i);else if(o!==void 0)f.position(If(o,i,s))}else{var v=a.position();if(o=Jn(v,i,s),e===void 0)return o;else return o[e]}else if(!l)return;return this},relativePosition:function(e,r){var a=this[0],n=this.cy(),i=We(e)?e:void 0,s=i!==void 0||r!==void 0&&Re(e),o=n.hasCompoundNodes();if(a&&a.isNode())if(s)for(var l=0;l<this.length;l++){var u=this[l],f=o?u.parent():null,v=f&&f.length>0,h=v;if(v)f=f[0];var c=h?f.position():{x:0,y:0};if(r!==void 0)u.position(e,r+c[e]);else if(i!==void 0)u.position({x:i.x+c.x,y:i.y+c.y})}else{var d=a.position(),g=o?a.parent():null,y=g&&g.length>0,p=y;if(y)g=g[0];var m=p?g.position():{x:0,y:0};if(i={x:d.x-m.x,y:d.y-m.y},e===void 0)return i;else return i[e]}else if(!s)return;return this}};Wt.modelPosition=Wt.point=Wt.position;Wt.modelPositions=Wt.points=Wt.positions;Wt.renderedPoint=Wt.renderedPosition;Wt.relativePoint=Wt.relativePosition;var jg=sv,ha=function(e){switch(e){case"left":case"right-inside":return"left";case"right":case"left-inside":return"right";default:return"center"}},ca=function(e){switch(e){case"top":case"bottom-inside":return"top";case"bottom":case"top-inside":return"bottom";default:return"center"}},ep=function(e){switch(e){case"left":return"right";case"right":return"left";case"left-inside":return"left";case"right-inside":return"right";default:return"center"}},ua,Rr;ua=Rr={};Rr.renderedBoundingBox=function(t){var e=this.boundingBox(t),r=this.cy(),a=r.zoom(),n=r.pan(),i=e.x1*a+n.x,s=e.x2*a+n.x,o=e.y1*a+n.y,l=e.y2*a+n.y;return{x1:i,x2:s,y1:o,y2:l,w:s-i,h:l-o}};Rr.dirtyCompoundBoundsCache=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();if(!e.styleEnabled()||!e.hasCompoundNodes())return this;return this.forEachUp(function(r){if(r.isParent()){var a=r._private;if(a.compoundBoundsClean=!1,a.bbCache=null,!t)r.emitAndNotify("bounds")}}),this};Rr.updateCompoundBounds=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();if(!e.styleEnabled()||!e.hasCompoundNodes())return this;if(!t&&e.batching())return this;function r(s){if(!s.isParent())return;var o=s._private,l=s.children(),u=s.pstyle("compound-sizing-wrt-labels").value==="include",f={width:{val:s.pstyle("min-width").pfValue,left:s.pstyle("min-width-bias-left"),right:s.pstyle("min-width-bias-right")},height:{val:s.pstyle("min-height").pfValue,top:s.pstyle("min-height-bias-top"),bottom:s.pstyle("min-height-bias-bottom")}},v=l.boundingBox({includeLabels:u,includeOverlays:!1,useCache:!1}),h=o.position;if(v.w===0||v.h===0)v={w:s.pstyle("width").pfValue,h:s.pstyle("height").pfValue},v.x1=h.x-v.w/2,v.x2=h.x+v.w/2,v.y1=h.y-v.h/2,v.y2=h.y+v.h/2;function c(N,R,I){var w=0,x=0,T=R+I;if(N>0&&T>0)w=R/T*N,x=I/T*N;return{biasDiff:w,biasComplementDiff:x}}function d(N,R,I,w){if(I.units==="%")switch(w){case"width":return N>0?I.pfValue*N:0;case"height":return R>0?I.pfValue*R:0;case"average":return N>0&&R>0?I.pfValue*(N+R)/2:0;case"min":return N>0&&R>0?N>R?I.pfValue*R:I.pfValue*N:0;case"max":return N>0&&R>0?N>R?I.pfValue*N:I.pfValue*R:0;default:return 0}else if(I.units==="px")return I.pfValue;else return 0}var g=f.width.left.value;if(f.width.left.units==="px"&&f.width.val>0)g=g*100/f.width.val;var y=f.width.right.value;if(f.width.right.units==="px"&&f.width.val>0)y=y*100/f.width.val;var p=f.height.top.value;if(f.height.top.units==="px"&&f.height.val>0)p=p*100/f.height.val;var m=f.height.bottom.value;if(f.height.bottom.units==="px"&&f.height.val>0)m=m*100/f.height.val;var b=c(f.width.val-v.w,g,y),{biasDiff:E,biasComplementDiff:A}=b,M=c(f.height.val-v.h,p,m),{biasDiff:S,biasComplementDiff:P}=M;o.autoPadding=d(v.w,v.h,s.pstyle("padding"),s.pstyle("padding-relative-to").value),o.autoWidth=Math.max(v.w,f.width.val),h.x=(-E+v.x1+v.x2+A)/2,o.autoHeight=Math.max(v.h,f.height.val),h.y=(-S+v.y1+v.y2+P)/2}for(var a=0;a<this.length;a++){var n=this[a],i=n._private;if(!i.compoundBoundsClean||t){if(r(n),!e.batching())i.compoundBoundsClean=!0}}return this};var Ut=function(e){if(e===1/0||e===-1/0)return 0;return e},Xt=function(e,r,a,n,i){if(n-r===0||i-a===0)return;if(r==null||a==null||n==null||i==null)return;e.x1=r<e.x1?r:e.x1,e.x2=n>e.x2?n:e.x2,e.y1=a<e.y1?a:e.y1,e.y2=i>e.y2?i:e.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1},pr=function(e,r){if(r==null)return e;return Xt(e,r.x1,r.y1,r.x2,r.y2)},Da=function(e,r,a){return Nt(e,r,a)},yn=function(e,r,a){if(r.cy().headless())return;var n=r._private,i=n.rstyle,s=i.arrowWidth/2,o=r.pstyle(a+"-arrow-shape").value,l,u;if(o!=="none"){if(a==="source")l=i.srcX,u=i.srcY;else if(a==="target")l=i.tgtX,u=i.tgtY;else l=i.midX,u=i.midY;var f=n.arrowBounds=n.arrowBounds||{},v=f[a]=f[a]||{};v.x1=l-s,v.y1=u-s,v.x2=l+s,v.y2=u+s,v.w=v.x2-v.x1,v.h=v.y2-v.y1,Sn(v,1),Xt(e,v.x1,v.y1,v.x2,v.y2)}},Os=function(e,r,a){if(r.cy().headless())return;var n;if(a)n=a+"-";else n="";var i=r._private,s=i.rstyle,o=r.pstyle(n+"label").strValue;if(o){var l=r.pstyle("text-halign"),u=r.pstyle("text-valign"),f=Da(s,"labelWidth",a),v=Da(s,"labelHeight",a),h=Da(s,"labelX",a),c=Da(s,"labelY",a),d=r.pstyle(n+"text-margin-x").pfValue,g=r.pstyle(n+"text-margin-y").pfValue,y=r.isEdge(),p=r.pstyle(n+"text-rotation"),m=r.pstyle("text-outline-width").pfValue,b=r.pstyle("text-border-width").pfValue,E=b/2,A=r.pstyle("text-background-padding").pfValue,M=2,S=v,P=f,N=P/2,R=S/2,I,w,x,T;if(y)I=h-N,w=h+N,x=c-R,T=c+R;else{switch(ha(l.value)){case"left":I=h-P,w=h;break;case"center":I=h-N,w=h+N;break;case"right":I=h,w=h+P;break}switch(ca(u.value)){case"top":x=c-S,T=c;break;case"center":x=c-R,T=c+R;break;case"bottom":x=c,T=c+S;break}}var D=d-Math.max(m,E)-A-M,C=d+Math.max(m,E)+A+M,O=g-Math.max(m,E)-A-M,B=g+Math.max(m,E)+A+M;I+=D,w+=C,x+=O,T+=B;var z=a||"main",V=i.labelBounds,k=V[z]=V[z]||{};k.x1=I,k.y1=x,k.x2=w,k.y2=T,k.w=w-I,k.h=T-x,k.leftPad=D,k.rightPad=C,k.topPad=O,k.botPad=B;var G=y&&p.strValue==="autorotate",J=p.pfValue!=null&&p.pfValue!==0;if(G||J){var X=G?Da(i.rstyle,"labelAngle",a):p.pfValue,_=Math.cos(X),Q=Math.sin(X),q=(I+w)/2,te=(x+T)/2;if(!y){switch(ha(l.value)){case"left":q=w;break;case"right":q=I;break}switch(ca(u.value)){case"top":te=T;break;case"bottom":te=x;break}}var Z=function(Ce,Se){return Ce=Ce-q,Se=Se-te,{x:Ce*_-Se*Q+q,y:Ce*Q+Se*_+te}},U=Z(I,x),W=Z(I,T),j=Z(w,x),re=Z(w,T);I=Math.min(U.x,W.x,j.x,re.x),w=Math.max(U.x,W.x,j.x,re.x),x=Math.min(U.y,W.y,j.y,re.y),T=Math.max(U.y,W.y,j.y,re.y)}var ee=z+"Rot",de=V[ee]=V[ee]||{};de.x1=I,de.y1=x,de.x2=w,de.y2=T,de.w=w-I,de.h=T-x,Xt(e,I,x,w,T),Xt(i.labelBounds.all,I,x,w,T)}return e},xl=function(e,r){if(r.cy().headless())return;var a=r.pstyle("outline-opacity").value,n=r.pstyle("outline-width").value,i=r.pstyle("outline-offset").value,s=n+i;uv(e,r,a,s,"outside",s/2)},uv=function(e,r,a,n,i,s){if(a===0||n<=0||i==="inside")return;var o=r.cy(),l=o.renderer(),u=l.nodeShapes[l.getNodeShape(r)];if(!u)return;var f=r.position(),{x:v,y:h}=f,c=r.width(),d=r.height();if(u.hasMiterBounds){if(i==="center")n/=2;var g=u.miterBounds(v,h,c,d,n);pr(e,g)}else if(s!=null&&s>0)Dn(e,[s,s,s,s])},tp=function(e,r){if(r.cy().headless())return;var a=r.pstyle("border-opacity").value,n=r.pstyle("border-width").pfValue,i=r.pstyle("border-position").value;uv(e,r,a,n,i)},rp=function(e,r){var a=e._private.cy,n=a.styleEnabled(),i=a.headless(),s=Ot(),o=e._private,l=e.isNode(),u=e.isEdge(),f,v,h,c,d,g,y=o.rstyle,p=l&&n?e.pstyle("bounds-expansion").pfValue:[0],m=function(Ae){return Ae.pstyle("display").value!=="none"},b=!n||m(e)&&(!u||m(e.source())&&m(e.target()));if(b){var E=0,A=0;if(n&&r.includeOverlays){if(E=e.pstyle("overlay-opacity").value,E!==0)A=e.pstyle("overlay-padding").value}var M=0,S=0;if(n&&r.includeUnderlays){if(M=e.pstyle("underlay-opacity").value,M!==0)S=e.pstyle("underlay-padding").value}var P=Math.max(A,S),N=0,R=0;if(n)N=e.pstyle("width").pfValue,R=N/2;if(l&&r.includeNodes){var I=e.position();d=I.x,g=I.y;var w=e.outerWidth(),x=w/2,T=e.outerHeight(),D=T/2;if(f=d-x,v=d+x,h=g-D,c=g+D,Xt(s,f,h,v,c),n)xl(s,e);if(n&&r.includeOutlines&&!i)xl(s,e);if(n)tp(s,e)}else if(u&&r.includeEdges)if(n&&!i){var C=e.pstyle("curve-style").strValue;if(f=Math.min(y.srcX,y.midX,y.tgtX),v=Math.max(y.srcX,y.midX,y.tgtX),h=Math.min(y.srcY,y.midY,y.tgtY),c=Math.max(y.srcY,y.midY,y.tgtY),f-=R,v+=R,h-=R,c+=R,Xt(s,f,h,v,c),C==="haystack"){var O=y.haystackPts;if(O&&O.length===2){if(f=O[0].x,h=O[0].y,v=O[1].x,c=O[1].y,f>v){var B=f;f=v,v=B}if(h>c){var z=h;h=c,c=z}Xt(s,f-R,h-R,v+R,c+R)}}else if(C==="bezier"||C==="unbundled-bezier"||yr(C,"segments")||yr(C,"taxi")){var V;switch(C){case"bezier":case"unbundled-bezier":V=y.bezierPts;break;case"segments":case"taxi":case"round-segments":case"round-taxi":V=y.linePts;break}if(V!=null)for(var k=0;k<V.length;k++){var G=V[k];f=G.x-R,v=G.x+R,h=G.y-R,c=G.y+R,Xt(s,f,h,v,c)}}}else{var J=e.source(),X=J.position(),_=e.target(),Q=_.position();if(f=X.x,v=Q.x,h=X.y,c=Q.y,f>v){var q=f;f=v,v=q}if(h>c){var te=h;h=c,c=te}f-=R,v+=R,h-=R,c+=R,Xt(s,f,h,v,c)}if(n&&r.includeEdges&&u)yn(s,e,"mid-source"),yn(s,e,"mid-target"),yn(s,e,"source"),yn(s,e,"target");if(n){var Z=e.pstyle("ghost").value==="yes";if(Z){var U=e.pstyle("ghost-offset-x").pfValue,W=e.pstyle("ghost-offset-y").pfValue;Xt(s,s.x1+U,s.y1+W,s.x2+U,s.y2+W)}}var j=o.bodyBounds=o.bodyBounds||{};if(ou(j,s),Dn(j,p),Sn(j,1),n)f=s.x1,v=s.x2,h=s.y1,c=s.y2,Xt(s,f-P,h-P,v+P,c+P);var re=o.overlayBounds=o.overlayBounds||{};ou(re,s),Dn(re,p),Sn(re,1);var ee=o.labelBounds=o.labelBounds||{};if(ee.all!=null)kc(ee.all);else ee.all=Ot();if(n&&r.includeLabels){if(r.includeMainLabels)Os(s,e,null);if(u){if(r.includeSourceLabels)Os(s,e,"source");if(r.includeTargetLabels)Os(s,e,"target")}}}if(s.x1=Ut(s.x1),s.y1=Ut(s.y1),s.x2=Ut(s.x2),s.y2=Ut(s.y2),s.w=Ut(s.x2-s.x1),s.h=Ut(s.y2-s.y1),s.w>0&&s.h>0&&b)Dn(s,p),Sn(s,1);return s},lv=function(e){var r=0,a=function(s){return(s?1:0)<<r++},n=0;return n+=a(e.incudeNodes),n+=a(e.includeEdges),n+=a(e.includeLabels),n+=a(e.includeMainLabels),n+=a(e.includeSourceLabels),n+=a(e.includeTargetLabels),n+=a(e.includeOverlays),n+=a(e.includeOutlines),n},fv=function(e){var r=function(o){return Math.round(o)};if(e.isEdge()){var a=e.source().position(),n=e.target().position();return tu([r(a.x),r(a.y),r(n.x),r(n.y)])}else{var i=e.position();return tu([r(i.x),r(i.y)])}},Tl=function(e,r){var a=e._private,n,i=e.isEdge(),s=r==null?Cl:lv(r),o=s===Cl;if(a.bbCache==null)n=rp(e,Ya),a.bbCache=n,a.bbCachePosKey=fv(e);else n=a.bbCache;if(!o){var l=e.isNode();if(n=Ot(),r.includeNodes&&l||r.includeEdges&&!l)if(r.includeOverlays)pr(n,a.overlayBounds);else pr(n,a.bodyBounds);if(r.includeLabels)if(r.includeMainLabels&&(!i||r.includeSourceLabels&&r.includeTargetLabels))pr(n,a.labelBounds.all);else{if(r.includeMainLabels)pr(n,a.labelBounds.mainRot);if(r.includeSourceLabels)pr(n,a.labelBounds.sourceRot);if(r.includeTargetLabels)pr(n,a.labelBounds.targetRot)}n.w=n.x2-n.x1,n.h=n.y2-n.y1}return n},Ya={includeNodes:!0,includeEdges:!0,includeLabels:!0,includeMainLabels:!0,includeSourceLabels:!0,includeTargetLabels:!0,includeOverlays:!0,includeUnderlays:!0,includeOutlines:!0,useCache:!0},Cl=lv(Ya),Sl=St(Ya);Rr.boundingBox=function(t){var e,r=t===void 0||t.useCache===void 0||t.useCache===!0,a=la(function(f){var v=f._private;return v.bbCache==null||v.styleDirty||v.bbCachePosKey!==fv(f)},function(f){return f.id()});if(r&&this.length===1&&!a(this[0])){if(t===void 0)t=Ya;else t=Sl(t);e=Tl(this[0],t)}else{e=Ot(),t=t||Ya;var n=Sl(t),i=this,s=i.cy(),o=s.styleEnabled();if(this.edges().forEach(a),this.nodes().forEach(a),o)this.recalculateRenderedStyle(r);this.updateCompoundBounds(!r);for(var l=0;l<i.length;l++){var u=i[l];if(a(u))u.dirtyBoundingBoxCache();pr(e,Tl(u,n))}}return e.x1=Ut(e.x1),e.y1=Ut(e.y1),e.x2=Ut(e.x2),e.y2=Ut(e.y2),e.w=Ut(e.x2-e.x1),e.h=Ut(e.y2-e.y1),e};Rr.dirtyBoundingBoxCache=function(){for(var t=0;t<this.length;t++){var e=this[t]._private;e.bbCache=null,e.bbCachePosKey=null,e.bodyBounds=null,e.overlayBounds=null,e.labelBounds.all=null,e.labelBounds.source=null,e.labelBounds.target=null,e.labelBounds.main=null,e.labelBounds.sourceRot=null,e.labelBounds.targetRot=null,e.labelBounds.mainRot=null,e.arrowBounds.source=null,e.arrowBounds.target=null,e.arrowBounds["mid-source"]=null,e.arrowBounds["mid-target"]=null}return this.emitAndNotify("bounds"),this};Rr.boundingBoxAt=function(t){var e=this.nodes(),r=this.cy(),a=r.hasCompoundNodes(),n=r.collection();if(a)n=e.filter(function(u){return u.isParent()}),e=e.not(n);if(We(t)){var i=t;t=function(){return i}}var s=function(f,v){return f._private.bbAtOldPos=t(f,v)},o=function(f){return f._private.bbAtOldPos};if(r.startBatch(),e.forEach(s).silentPositions(t),a)n.dirtyCompoundBoundsCache(),n.dirtyBoundingBoxCache(),n.updateCompoundBounds(!0);var l=Bc(this.boundingBox({useCache:!1}));if(e.silentPositions(o),a)n.dirtyCompoundBoundsCache(),n.dirtyBoundingBoxCache(),n.updateCompoundBounds(!0);return r.endBatch(),l};ua.boundingbox=ua.bb=ua.boundingBox;ua.renderedBoundingbox=ua.renderedBoundingBox;var ap=Rr,Oa,tn;Oa=tn={};var vv=function(e){e.uppercaseName=Go(e.name),e.autoName="auto"+e.uppercaseName,e.labelName="label"+e.uppercaseName,e.outerName="outer"+e.uppercaseName,e.uppercaseOuterName=Go(e.outerName),Oa[e.name]=function(){var a=this[0],n=a._private,i=n.cy,s=i._private.styleEnabled;if(a)if(s){if(a.isParent())return a.updateCompoundBounds(),n[e.autoName]||0;var o=a.pstyle(e.name);switch(o.strValue){case"label":return a.recalculateRenderedStyle(),n.rstyle[e.labelName]||0;default:return o.pfValue}}else return 1},Oa["outer"+e.uppercaseName]=function(){var a=this[0],n=a._private,i=n.cy,s=i._private.styleEnabled;if(a)if(s){var o=a[e.name](),l=a.pstyle("border-position").value,u;if(l==="center")u=a.pstyle("border-width").pfValue;else if(l==="outside")u=2*a.pstyle("border-width").pfValue;else u=0;var f=2*a.padding();return o+u+f}else return 1},Oa["rendered"+e.uppercaseName]=function(){var a=this[0];if(a){var n=a[e.name]();return n*this.cy().zoom()}},Oa["rendered"+e.uppercaseOuterName]=function(){var a=this[0];if(a){var n=a[e.outerName]();return n*this.cy().zoom()}}};vv({name:"width"});vv({name:"height"});tn.padding=function(){var t=this[0],e=t._private;if(t.isParent())if(t.updateCompoundBounds(),e.autoPadding!==void 0)return e.autoPadding;else return t.pstyle("padding").pfValue;else return t.pstyle("padding").pfValue};tn.paddedHeight=function(){var t=this[0];return t.height()+2*t.padding()};tn.paddedWidth=function(){var t=this[0];return t.width()+2*t.padding()};var np=tn,ip=function(e,r){if(e.isEdge()&&e.takesUpSpace())return r(e)},sp=function(e,r){if(e.isEdge()&&e.takesUpSpace()){var a=e.cy();return Jn(r(e),a.zoom(),a.pan())}},op=function(e,r){if(e.isEdge()&&e.takesUpSpace()){var a=e.cy(),n=a.pan(),i=a.zoom();return r(e).map(function(s){return Jn(s,i,n)})}},up=function(e){return e.renderer().getControlPoints(e)},lp=function(e){return e.renderer().getSegmentPoints(e)},fp=function(e){return e.renderer().getSourceEndpoint(e)},vp=function(e){return e.renderer().getTargetEndpoint(e)},hp=function(e){return e.renderer().getEdgeMidpoint(e)},Dl={controlPoints:{get:up,mult:!0},segmentPoints:{get:lp,mult:!0},sourceEndpoint:{get:fp},targetEndpoint:{get:vp},midpoint:{get:hp}},cp=function(e){return"rendered"+e[0].toUpperCase()+e.substr(1)},dp=Object.keys(Dl).reduce(function(t,e){var r=Dl[e],a=cp(e);if(t[e]=function(){return ip(this,r.get)},r.mult)t[a]=function(){return op(this,r.get)};else t[a]=function(){return sp(this,r.get)};return t},{}),gp=Oe({},jg,ap,np,dp);/*!
8
+ */var Wf=0,$f=1,Kf=2,$t=function(e){if(!(this instanceof $t))return new $t(e);if(this.id="Thenable/1.0.7",this.state=Wf,this.fulfillValue=void 0,this.rejectReason=void 0,this.onFulfilled=[],this.onRejected=[],this.proxy={then:this.then.bind(this)},typeof e==="function")e.call(this,this.fulfill.bind(this),this.reject.bind(this))};$t.prototype={fulfill:function(e){return Eu(this,$f,"fulfillValue",e)},reject:function(e){return Eu(this,Kf,"rejectReason",e)},then:function(e,r){var a=this,n=new $t;return a.onFulfilled.push(Tu(e,n,"fulfill")),a.onRejected.push(Tu(r,n,"reject")),Zf(a),n.proxy}};var Eu=function(e,r,a,n){if(e.state===Wf)e.state=r,e[a]=n,Zf(e);return e},Zf=function(e){if(e.state===$f)xu(e,"onFulfilled",e.fulfillValue);else if(e.state===Kf)xu(e,"onRejected",e.rejectReason)},xu=function(e,r,a){if(e[r].length===0)return;var n=e[r];e[r]=[];var i=function(){for(var o=0;o<n.length;o++)n[o](a)};if(typeof setImmediate==="function")setImmediate(i);else setTimeout(i,0)},Tu=function(e,r,a){return function(n){if(typeof e!=="function")r[a].call(r,n);else{var i;try{i=e(n)}catch(s){r.reject(s);return}_f(r,i)}}},_f=function(e,r){if(e===r||e.proxy===r){e.reject(TypeError("cannot resolve promise with itself"));return}var a;if(yt(r)==="object"&&r!==null||typeof r==="function")try{a=r.then}catch(i){e.reject(i);return}if(typeof a==="function"){var n=!1;try{a.call(r,function(i){if(n)return;if(n=!0,i===r)e.reject(TypeError("circular thenable chain"));else _f(e,i)},function(i){if(n)return;n=!0,e.reject(i)})}catch(i){if(!n)e.reject(i)}return}e.fulfill(r)};$t.all=function(t){return new $t(function(e,r){var a=Array(t.length),n=0,i=function(l,u){if(a[l]=u,n++,n===t.length)e(a)};for(var s=0;s<t.length;s++)(function(o){var l=t[o],u=l!=null&&l.then!=null;if(u)l.then(function(v){i(o,v)},function(v){r(v)});else{var f=l;i(o,f)}})(s)})};$t.resolve=function(t){return new $t(function(e,r){e(t)})};$t.reject=function(t){return new $t(function(e,r){r(t)})};var ga=typeof Promise<"u"?Promise:$t,_s=function(e,r,a){var n=vo(e),i=!n,s=this._private=Oe({duration:1000},r,a);if(s.target=e,s.style=s.style||s.css,s.started=!1,s.playing=!1,s.hooked=!1,s.applying=!1,s.progress=0,s.completes=[],s.frames=[],s.complete&&st(s.complete))s.completes.push(s.complete);if(i){var o=e.position();s.startPosition=s.startPosition||{x:o.x,y:o.y},s.startStyle=s.startStyle||e.cy().style().getAnimationStartStyle(e,s.style)}if(n){var l=e.pan();s.startPan={x:l.x,y:l.y},s.startZoom=e.zoom()}this.length=1,this[0]=this},Hr=_s.prototype;Oe(Hr,{instanceString:function(){return"animation"},hook:function(){var e=this._private;if(!e.hooked){var r,a=e.target._private.animation;if(e.queue)r=a.queue;else r=a.current;if(r.push(this),zt(e.target))e.target.cy().addToAnimationPool(e.target);e.hooked=!0}return this},play:function(){var e=this._private;if(e.progress===1)e.progress=0;return e.playing=!0,e.started=!1,e.stopped=!1,this.hook(),this},playing:function(){return this._private.playing},apply:function(){var e=this._private;return e.applying=!0,e.started=!1,e.stopped=!1,this.hook(),this},applying:function(){return this._private.applying},pause:function(){var e=this._private;return e.playing=!1,e.started=!1,this},stop:function(){var e=this._private;return e.playing=!1,e.started=!1,e.stopped=!0,this},rewind:function(){return this.progress(0)},fastforward:function(){return this.progress(1)},time:function(e){var r=this._private;if(e===void 0)return r.progress*r.duration;else return this.progress(e/r.duration)},progress:function(e){var r=this._private,a=r.playing;if(e===void 0)return r.progress;else{if(a)this.pause();if(r.progress=e,r.started=!1,a)this.play()}return this},completed:function(){return this._private.progress===1},reverse:function(){var e=this._private,r=e.playing;if(r)this.pause();e.progress=1-e.progress,e.started=!1;var a=function(u,f){var v=e[u];if(v==null)return;e[u]=e[f],e[f]=v};if(a("zoom","startZoom"),a("pan","startPan"),a("position","startPosition"),e.style)for(var n=0;n<e.style.length;n++){var i=e.style[n],s=i.name,o=e.startStyle[s];e.startStyle[s]=i,e.style[n]=o}if(r)this.play();return this},promise:function(e){var r=this._private,a;switch(e){case"frame":a=r.frames;break;default:case"complete":case"completed":a=r.completes}return new ga(function(n,i){a.push(function(){n()})})}});Hr.complete=Hr.completed;Hr.run=Hr.play;Hr.running=Hr.playing;var Ud={animated:function(){return function(){var r=this,a=r.length!==void 0,n=a?r:[r],i=this._private.cy||this;if(!i.styleEnabled())return!1;var s=n[0];if(s)return s._private.animation.current.length>0}},clearQueue:function(){return function(){var r=this,a=r.length!==void 0,n=a?r:[r],i=this._private.cy||this;if(!i.styleEnabled())return this;for(var s=0;s<n.length;s++){var o=n[s];o._private.animation.queue=[]}return this}},delay:function(){return function(r,a){var n=this._private.cy||this;if(!n.styleEnabled())return this;return this.animate({delay:r,duration:r,complete:a})}},delayAnimation:function(){return function(r,a){var n=this._private.cy||this;if(!n.styleEnabled())return this;return this.animation({delay:r,duration:r,complete:a})}},animation:function(){return function(r,a){var n=this,i=n.length!==void 0,s=i?n:[n],o=this._private.cy||this,l=!i,u=!l;if(!o.styleEnabled())return this;var f=o.style();r=Oe({},r,a);var v=Object.keys(r).length===0;if(v)return new _s(s[0],r);if(r.duration===void 0)r.duration=400;switch(r.duration){case"slow":r.duration=600;break;case"fast":r.duration=200;break}if(u)r.style=f.getPropsList(r.style||r.css),r.css=void 0;if(u&&r.renderedPosition!=null){var h=r.renderedPosition,c=o.pan(),d=o.zoom();r.position=If(h,d,c)}if(l&&r.panBy!=null){var g=r.panBy,y=o.pan();r.pan={x:y.x+g.x,y:y.y+g.y}}var p=r.center||r.centre;if(l&&p!=null){var m=o.getCenterPan(p.eles,r.zoom);if(m!=null)r.pan=m}if(l&&r.fit!=null){var b=r.fit,E=o.getFitViewport(b.eles||b.boundingBox,b.padding);if(E!=null)r.pan=E.pan,r.zoom=E.zoom}if(l&&We(r.zoom)){var A=o.getZoomedViewport(r.zoom);if(A!=null){if(A.zoomed)r.zoom=A.zoom;if(A.panned)r.pan=A.pan}else r.zoom=null}return new _s(s[0],r)}},animate:function(){return function(r,a){var n=this,i=n.length!==void 0,s=i?n:[n],o=this._private.cy||this;if(!o.styleEnabled())return this;if(a)r=Oe({},r,a);for(var l=0;l<s.length;l++){var u=s[l],f=u.animated()&&(r.queue===void 0||r.queue),v=u.animation(r,f?{queue:!0}:void 0);v.play()}return this}},stop:function(){return function(r,a){var n=this,i=n.length!==void 0,s=i?n:[n],o=this._private.cy||this;if(!o.styleEnabled())return this;for(var l=0;l<s.length;l++){var u=s[l],f=u._private,v=f.animation.current;for(var h=0;h<v.length;h++){var c=v[h],d=c._private;if(a)d.duration=0}if(r)f.animation.queue=[];if(!a)f.animation.current=[]}return o.notify("draw"),this}}},Bi,Cu;function ei(){if(Cu)return Bi;Cu=1;var t=Array.isArray;return Bi=t,Bi}var ki,Su;function Hd(){if(Su)return ki;Su=1;var t=ei(),e=Ja(),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;function n(i,s){if(t(i))return!1;var o=typeof i;if(o=="number"||o=="symbol"||o=="boolean"||i==null||e(i))return!0;return a.test(i)||!r.test(i)||s!=null&&i in Object(s)}return ki=n,ki}var Fi,Du;function qd(){if(Du)return Fi;Du=1;var t=Sf(),e=Qa(),r="[object AsyncFunction]",a="[object Function]",n="[object GeneratorFunction]",i="[object Proxy]";function s(o){if(!e(o))return!1;var l=t(o);return l==a||l==n||l==r||l==i}return Fi=s,Fi}var zi,Au;function Yd(){if(Au)return zi;Au=1;var t=_n(),e=t["__core-js_shared__"];return zi=e,zi}var Vi,Mu;function Xd(){if(Mu)return Vi;Mu=1;var t=Yd(),e=function(){var a=/[^.]+$/.exec(t&&t.keys&&t.keys.IE_PROTO||"");return a?"Symbol(src)_1."+a:""}();function r(a){return!!e&&e in a}return Vi=r,Vi}var Gi,Lu;function Wd(){if(Lu)return Gi;Lu=1;var t=Function.prototype,e=t.toString;function r(a){if(a!=null){try{return e.call(a)}catch(n){}try{return a+""}catch(n){}}return""}return Gi=r,Gi}var Ui,Ru;function $d(){if(Ru)return Ui;Ru=1;var t=qd(),e=Xd(),r=Qa(),a=Wd(),n=/[\\^$.*+?()[\]{}|]/g,i=/^\[object .+?Constructor\]$/,s=Function.prototype,o=Object.prototype,l=s.toString,u=o.hasOwnProperty,f=RegExp("^"+l.call(u).replace(n,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function v(h){if(!r(h)||e(h))return!1;var c=t(h)?f:i;return c.test(a(h))}return Ui=v,Ui}var Hi,Pu;function Kd(){if(Pu)return Hi;Pu=1;function t(e,r){return e==null?void 0:e[r]}return Hi=t,Hi}var qi,Nu;function To(){if(Nu)return qi;Nu=1;var t=$d(),e=Kd();function r(a,n){var i=e(a,n);return t(i)?i:void 0}return qi=r,qi}var Yi,Ou;function ti(){if(Ou)return Yi;Ou=1;var t=To(),e=t(Object,"create");return Yi=e,Yi}var Xi,Iu;function Zd(){if(Iu)return Xi;Iu=1;var t=ti();function e(){this.__data__=t?t(null):{},this.size=0}return Xi=e,Xi}var Wi,Bu;function _d(){if(Bu)return Wi;Bu=1;function t(e){var r=this.has(e)&&delete this.__data__[e];return this.size-=r?1:0,r}return Wi=t,Wi}var $i,ku;function Qd(){if(ku)return $i;ku=1;var t=ti(),e="__lodash_hash_undefined__",r=Object.prototype,a=r.hasOwnProperty;function n(i){var s=this.__data__;if(t){var o=s[i];return o===e?void 0:o}return a.call(s,i)?s[i]:void 0}return $i=n,$i}var Ki,Fu;function Jd(){if(Fu)return Ki;Fu=1;var t=ti(),e=Object.prototype,r=e.hasOwnProperty;function a(n){var i=this.__data__;return t?i[n]!==void 0:r.call(i,n)}return Ki=a,Ki}var Zi,zu;function jd(){if(zu)return Zi;zu=1;var t=ti(),e="__lodash_hash_undefined__";function r(a,n){var i=this.__data__;return this.size+=this.has(a)?0:1,i[a]=t&&n===void 0?e:n,this}return Zi=r,Zi}var _i,Vu;function eg(){if(Vu)return _i;Vu=1;var t=Zd(),e=_d(),r=Qd(),a=Jd(),n=jd();function i(s){var o=-1,l=s==null?0:s.length;this.clear();while(++o<l){var u=s[o];this.set(u[0],u[1])}}return i.prototype.clear=t,i.prototype.delete=e,i.prototype.get=r,i.prototype.has=a,i.prototype.set=n,_i=i,_i}var Qi,Gu;function tg(){if(Gu)return Qi;Gu=1;function t(){this.__data__=[],this.size=0}return Qi=t,Qi}var Ji,Uu;function Qf(){if(Uu)return Ji;Uu=1;function t(e,r){return e===r||e!==e&&r!==r}return Ji=t,Ji}var ji,Hu;function ri(){if(Hu)return ji;Hu=1;var t=Qf();function e(r,a){var n=r.length;while(n--)if(t(r[n][0],a))return n;return-1}return ji=e,ji}var es,qu;function rg(){if(qu)return es;qu=1;var t=ri(),e=Array.prototype,r=e.splice;function a(n){var i=this.__data__,s=t(i,n);if(s<0)return!1;var o=i.length-1;if(s==o)i.pop();else r.call(i,s,1);return--this.size,!0}return es=a,es}var ts,Yu;function ag(){if(Yu)return ts;Yu=1;var t=ri();function e(r){var a=this.__data__,n=t(a,r);return n<0?void 0:a[n][1]}return ts=e,ts}var rs,Xu;function ng(){if(Xu)return rs;Xu=1;var t=ri();function e(r){return t(this.__data__,r)>-1}return rs=e,rs}var as,Wu;function ig(){if(Wu)return as;Wu=1;var t=ri();function e(r,a){var n=this.__data__,i=t(n,r);if(i<0)++this.size,n.push([r,a]);else n[i][1]=a;return this}return as=e,as}var ns,$u;function sg(){if($u)return ns;$u=1;var t=tg(),e=rg(),r=ag(),a=ng(),n=ig();function i(s){var o=-1,l=s==null?0:s.length;this.clear();while(++o<l){var u=s[o];this.set(u[0],u[1])}}return i.prototype.clear=t,i.prototype.delete=e,i.prototype.get=r,i.prototype.has=a,i.prototype.set=n,ns=i,ns}var is,Ku;function og(){if(Ku)return is;Ku=1;var t=To(),e=_n(),r=t(e,"Map");return is=r,is}var ss,Zu;function ug(){if(Zu)return ss;Zu=1;var t=eg(),e=sg(),r=og();function a(){this.size=0,this.__data__={hash:new t,map:new(r||e),string:new t}}return ss=a,ss}var os,_u;function lg(){if(_u)return os;_u=1;function t(e){var r=typeof e;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?e!=="__proto__":e===null}return os=t,os}var us,Qu;function ai(){if(Qu)return us;Qu=1;var t=lg();function e(r,a){var n=r.__data__;return t(a)?n[typeof a=="string"?"string":"hash"]:n.map}return us=e,us}var ls,Ju;function fg(){if(Ju)return ls;Ju=1;var t=ai();function e(r){var a=t(this,r).delete(r);return this.size-=a?1:0,a}return ls=e,ls}var fs,ju;function vg(){if(ju)return fs;ju=1;var t=ai();function e(r){return t(this,r).get(r)}return fs=e,fs}var vs,el;function hg(){if(el)return vs;el=1;var t=ai();function e(r){return t(this,r).has(r)}return vs=e,vs}var hs,tl;function cg(){if(tl)return hs;tl=1;var t=ai();function e(r,a){var n=t(this,r),i=n.size;return n.set(r,a),this.size+=n.size==i?0:1,this}return hs=e,hs}var cs,rl;function dg(){if(rl)return cs;rl=1;var t=ug(),e=fg(),r=vg(),a=hg(),n=cg();function i(s){var o=-1,l=s==null?0:s.length;this.clear();while(++o<l){var u=s[o];this.set(u[0],u[1])}}return i.prototype.clear=t,i.prototype.delete=e,i.prototype.get=r,i.prototype.has=a,i.prototype.set=n,cs=i,cs}var ds,al;function gg(){if(al)return ds;al=1;var t=dg(),e="Expected a function";function r(a,n){if(typeof a!="function"||n!=null&&typeof n!="function")throw TypeError(e);var i=function(){var s=arguments,o=n?n.apply(this,s):s[0],l=i.cache;if(l.has(o))return l.get(o);var u=a.apply(this,s);return i.cache=l.set(o,u)||l,u};return i.cache=new(r.Cache||t),i}return r.Cache=t,ds=r,ds}var gs,nl;function pg(){if(nl)return gs;nl=1;var t=gg(),e=500;function r(a){var n=t(a,function(s){if(i.size===e)i.clear();return s}),i=n.cache;return n}return gs=r,gs}var ps,il;function Jf(){if(il)return ps;il=1;var t=pg(),e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,r=/\\(\\)?/g,a=t(function(n){var i=[];if(n.charCodeAt(0)===46)i.push("");return n.replace(e,function(s,o,l,u){i.push(l?u.replace(r,"$1"):o||s)}),i});return ps=a,ps}var ys,sl;function jf(){if(sl)return ys;sl=1;function t(e,r){var a=-1,n=e==null?0:e.length,i=Array(n);while(++a<n)i[a]=r(e[a],a,e);return i}return ys=t,ys}var ms,ol;function yg(){if(ol)return ms;ol=1;var t=co(),e=jf(),r=ei(),a=Ja(),n=t?t.prototype:void 0,i=n?n.toString:void 0;function s(o){if(typeof o=="string")return o;if(r(o))return e(o,s)+"";if(a(o))return i?i.call(o):"";var l=o+"";return l=="0"&&1/o==-1/0?"-0":l}return ms=s,ms}var bs,ul;function ev(){if(ul)return bs;ul=1;var t=yg();function e(r){return r==null?"":t(r)}return bs=e,bs}var ws,ll;function tv(){if(ll)return ws;ll=1;var t=ei(),e=Hd(),r=Jf(),a=ev();function n(i,s){if(t(i))return i;return e(i,s)?[i]:r(a(i))}return ws=n,ws}var Es,fl;function Co(){if(fl)return Es;fl=1;var t=Ja();function e(r){if(typeof r=="string"||t(r))return r;var a=r+"";return a=="0"&&1/r==-1/0?"-0":a}return Es=e,Es}var xs,vl;function mg(){if(vl)return xs;vl=1;var t=tv(),e=Co();function r(a,n){n=t(n,a);var i=0,s=n.length;while(a!=null&&i<s)a=a[e(n[i++])];return i&&i==s?a:void 0}return xs=r,xs}var Ts,hl;function bg(){if(hl)return Ts;hl=1;var t=mg();function e(r,a,n){var i=r==null?void 0:t(r,a);return i===void 0?n:i}return Ts=e,Ts}var wg=bg(),Eg=_a(wg),Cs,cl;function xg(){if(cl)return Cs;cl=1;var t=To(),e=function(){try{var r=t(Object,"defineProperty");return r({},"",{}),r}catch(a){}}();return Cs=e,Cs}var Ss,dl;function Tg(){if(dl)return Ss;dl=1;var t=xg();function e(r,a,n){if(a=="__proto__"&&t)t(r,a,{configurable:!0,enumerable:!0,value:n,writable:!0});else r[a]=n}return Ss=e,Ss}var Ds,gl;function Cg(){if(gl)return Ds;gl=1;var t=Tg(),e=Qf(),r=Object.prototype,a=r.hasOwnProperty;function n(i,s,o){var l=i[s];if(!(a.call(i,s)&&e(l,o))||o===void 0&&!(s in i))t(i,s,o)}return Ds=n,Ds}var As,pl;function Sg(){if(pl)return As;pl=1;var t=9007199254740991,e=/^(?:0|[1-9]\d*)$/;function r(a,n){var i=typeof a;return n=n==null?t:n,!!n&&(i=="number"||i!="symbol"&&e.test(a))&&(a>-1&&a%1==0&&a<n)}return As=r,As}var Ms,yl;function Dg(){if(yl)return Ms;yl=1;var t=Cg(),e=tv(),r=Sg(),a=Qa(),n=Co();function i(s,o,l,u){if(!a(s))return s;o=e(o,s);var f=-1,v=o.length,h=v-1,c=s;while(c!=null&&++f<v){var d=n(o[f]),g=l;if(d==="__proto__"||d==="constructor"||d==="prototype")return s;if(f!=h){var y=c[d];if(g=u?u(y,d,c):void 0,g===void 0)g=a(y)?y:r(o[f+1])?[]:{}}t(c,d,g),c=c[d]}return s}return Ms=i,Ms}var Ls,ml;function Ag(){if(ml)return Ls;ml=1;var t=Dg();function e(r,a,n){return r==null?r:t(r,a,n)}return Ls=e,Ls}var Mg=Ag(),Lg=_a(Mg),Rs,bl;function Rg(){if(bl)return Rs;bl=1;function t(e,r){var a=-1,n=e.length;r||(r=Array(n));while(++a<n)r[a]=e[a];return r}return Rs=t,Rs}var Ps,wl;function Pg(){if(wl)return Ps;wl=1;var t=jf(),e=Rg(),r=ei(),a=Ja(),n=Jf(),i=Co(),s=ev();function o(l){if(r(l))return t(l,i);return a(l)?[l]:e(n(s(l)))}return Ps=o,Ps}var Ng=Pg(),Og=_a(Ng),Ig={data:function(e){var r={field:"data",bindingEvent:"data",allowBinding:!1,allowSetting:!1,allowGetting:!1,settingEvent:"data",settingTriggersEvent:!1,triggerFnName:"trigger",immutableKeys:{},updateStyle:!1,beforeGet:function(n){},beforeSet:function(n,i){},onSet:function(n){},canSet:function(n){return!0}};return e=Oe({},r,e),function(n,i){var s=e,o=this,l=o.length!==void 0,u=l?o:[o],f=l?o[0]:o;if(Re(n)){var v=n.indexOf(".")!==-1,h=v&&Og(n);if(s.allowGetting&&i===void 0){var c;if(f)if(s.beforeGet(f),h&&f._private[s.field][n]===void 0)c=Eg(f._private[s.field],h);else c=f._private[s.field][n];return c}else if(s.allowSetting&&i!==void 0){var d=!s.immutableKeys[n];if(d){var g=df({},n,i);s.beforeSet(o,g);for(var y=0,p=u.length;y<p;y++){var m=u[y];if(s.canSet(m))if(h&&f._private[s.field][n]===void 0)Lg(m._private[s.field],h,i);else m._private[s.field][n]=i}if(s.updateStyle)o.updateStyle();if(s.onSet(o),s.settingTriggersEvent)o[s.triggerFnName](s.settingEvent)}}}else if(s.allowSetting&&We(n)){var b=n,E,A,M=Object.keys(b);s.beforeSet(o,b);for(var S=0;S<M.length;S++){E=M[S],A=b[E];var P=!s.immutableKeys[E];if(P)for(var N=0;N<u.length;N++){var R=u[N];if(s.canSet(R))R._private[s.field][E]=A}}if(s.updateStyle)o.updateStyle();if(s.onSet(o),s.settingTriggersEvent)o[s.triggerFnName](s.settingEvent)}else if(s.allowBinding&&st(n)){var I=n;o.on(s.bindingEvent,I)}else if(s.allowGetting&&n===void 0){var w;if(f)s.beforeGet(f),w=f._private[s.field];return w}return o}},removeData:function(e){var r={field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!1,immutableKeys:{}};return e=Oe({},r,e),function(n){var i=e,s=this,o=s.length!==void 0,l=o?s:[s];if(Re(n)){var u=n.split(/\s+/),f=u.length;for(var v=0;v<f;v++){var h=u[v];if(xr(h))continue;var c=!i.immutableKeys[h];if(c)for(var d=0,g=l.length;d<g;d++)l[d]._private[i.field][h]=void 0}if(i.triggerEvent)s[i.triggerFnName](i.event)}else if(n===void 0){for(var y=0,p=l.length;y<p;y++){var m=l[y]._private[i.field],b=Object.keys(m);for(var E=0;E<b.length;E++){var A=b[E],M=!i.immutableKeys[A];if(M)m[A]=void 0}}if(i.triggerEvent)s[i.triggerFnName](i.event)}return s}}},Bg={eventAliasesOn:function(e){var r=e;r.addListener=r.listen=r.bind=r.on,r.unlisten=r.unbind=r.off=r.removeListener,r.trigger=r.emit,r.pon=r.promiseOn=function(a,n){var i=this,s=Array.prototype.slice.call(arguments,0);return new ga(function(o,l){var u=function(c){i.off.apply(i,v),o(c)},f=s.concat([u]),v=f.concat([]);i.on.apply(i,f)})}}},Ze={};[Ud,Ig,Bg].forEach(function(t){Oe(Ze,t)});var kg={animate:Ze.animate(),animation:Ze.animation(),animated:Ze.animated(),clearQueue:Ze.clearQueue(),delay:Ze.delay(),delayAnimation:Ze.delayAnimation(),stop:Ze.stop()},An={classes:function(e){var r=this;if(e===void 0){var a=[];return r[0]._private.classes.forEach(function(d){return a.push(d)}),a}else if(!Je(e))e=(e||"").match(/\S+/g)||[];var n=[],i=new da(e);for(var s=0;s<r.length;s++){var o=r[s],l=o._private,u=l.classes,f=!1;for(var v=0;v<e.length;v++){var h=e[v],c=u.has(h);if(!c){f=!0;break}}if(!f)f=u.size!==e.length;if(f)l.classes=i,n.push(o)}if(n.length>0)this.spawn(n).updateStyle().emit("class");return r},addClass:function(e){return this.toggleClass(e,!0)},hasClass:function(e){var r=this[0];return r!=null&&r._private.classes.has(e)},toggleClass:function(e,r){if(!Je(e))e=e.match(/\S+/g)||[];var a=this,n=r===void 0,i=[];for(var s=0,o=a.length;s<o;s++){var l=a[s],u=l._private.classes,f=!1;for(var v=0;v<e.length;v++){var h=e[v],c=u.has(h),d=!1;if(r||n&&!c)u.add(h),d=!0;else if(!r||n&&c)u.delete(h),d=!0;if(!f&&d)i.push(l),f=!0}}if(i.length>0)this.spawn(i).updateStyle().emit("class");return a},removeClass:function(e){return this.toggleClass(e,!1)},flashClass:function(e,r){var a=this;if(r==null)r=250;else if(r===0)return a;return a.addClass(e),setTimeout(function(){a.removeClass(e)},r),a}};An.className=An.classNames=An.classes;var Xe={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:`"(?:\\\\"|[^"])*"|'(?:\\\\'|[^'])*'`,number:pt,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};Xe.variable="(?:[\\w-.]|(?:\\\\"+Xe.metaChar+"))+";Xe.className="(?:[\\w-]|(?:\\\\"+Xe.metaChar+"))+";Xe.value=Xe.string+"|"+Xe.number;Xe.id=Xe.variable;(function(){var t,e,r;t=Xe.comparatorOp.split("|");for(r=0;r<t.length;r++)e=t[r],Xe.comparatorOp+="|@"+e;t=Xe.comparatorOp.split("|");for(r=0;r<t.length;r++){if(e=t[r],e.indexOf("!")>=0)continue;if(e==="=")continue;Xe.comparatorOp+="|\\!"+e}})();var Qe=function(){return{checks:[]}},we={GROUP:0,COLLECTION:1,FILTER:2,DATA_COMPARE:3,DATA_EXIST:4,DATA_BOOL:5,META_COMPARE:6,STATE:7,ID:8,CLASS:9,UNDIRECTED_EDGE:10,DIRECTED_EDGE:11,NODE_SOURCE:12,NODE_TARGET:13,NODE_NEIGHBOR:14,CHILD:15,DESCENDANT:16,PARENT:17,ANCESTOR:18,COMPOUND_SPLIT:19,TRUE:20};var Qs=[{selector:":selected",matches:function(e){return e.selected()}},{selector:":unselected",matches:function(e){return!e.selected()}},{selector:":selectable",matches:function(e){return e.selectable()}},{selector:":unselectable",matches:function(e){return!e.selectable()}},{selector:":locked",matches:function(e){return e.locked()}},{selector:":unlocked",matches:function(e){return!e.locked()}},{selector:":visible",matches:function(e){return e.visible()}},{selector:":hidden",matches:function(e){return!e.visible()}},{selector:":transparent",matches:function(e){return e.transparent()}},{selector:":grabbed",matches:function(e){return e.grabbed()}},{selector:":free",matches:function(e){return!e.grabbed()}},{selector:":removed",matches:function(e){return e.removed()}},{selector:":inside",matches:function(e){return!e.removed()}},{selector:":grabbable",matches:function(e){return e.grabbable()}},{selector:":ungrabbable",matches:function(e){return!e.grabbable()}},{selector:":animated",matches:function(e){return e.animated()}},{selector:":unanimated",matches:function(e){return!e.animated()}},{selector:":parent",matches:function(e){return e.isParent()}},{selector:":childless",matches:function(e){return e.isChildless()}},{selector:":child",matches:function(e){return e.isChild()}},{selector:":orphan",matches:function(e){return e.isOrphan()}},{selector:":nonorphan",matches:function(e){return e.isChild()}},{selector:":compound",matches:function(e){if(e.isNode())return e.isParent();else return e.source().isParent()||e.target().isParent()}},{selector:":loop",matches:function(e){return e.isLoop()}},{selector:":simple",matches:function(e){return e.isSimple()}},{selector:":active",matches:function(e){return e.active()}},{selector:":inactive",matches:function(e){return!e.active()}},{selector:":backgrounding",matches:function(e){return e.backgrounding()}},{selector:":nonbackgrounding",matches:function(e){return!e.backgrounding()}}].sort(function(t,e){return Oh(t.selector,e.selector)}),Fg=function(){var t={},e;for(var r=0;r<Qs.length;r++)e=Qs[r],t[e.selector]=e.matches;return t}(),zg=function(e,r){return Fg[e](r)},Vg="("+Qs.map(function(t){return t.selector}).join("|")+")",Kr=function(e){return e.replace(new RegExp("\\\\("+Xe.metaChar+")","g"),function(r,a){return a})},cr=function(e,r,a){e[e.length-1]=a},Js=[{name:"group",query:!0,regex:"("+Xe.group+")",populate:function(e,r,a){var n=ct(a,1),i=n[0];r.checks.push({type:we.GROUP,value:i==="*"?i:i+"s"})}},{name:"state",query:!0,regex:Vg,populate:function(e,r,a){var n=ct(a,1),i=n[0];r.checks.push({type:we.STATE,value:i})}},{name:"id",query:!0,regex:"\\#("+Xe.id+")",populate:function(e,r,a){var n=ct(a,1),i=n[0];r.checks.push({type:we.ID,value:Kr(i)})}},{name:"className",query:!0,regex:"\\.("+Xe.className+")",populate:function(e,r,a){var n=ct(a,1),i=n[0];r.checks.push({type:we.CLASS,value:Kr(i)})}},{name:"dataExists",query:!0,regex:"\\[\\s*("+Xe.variable+")\\s*\\]",populate:function(e,r,a){var n=ct(a,1),i=n[0];r.checks.push({type:we.DATA_EXIST,field:Kr(i)})}},{name:"dataCompare",query:!0,regex:"\\[\\s*("+Xe.variable+")\\s*("+Xe.comparatorOp+")\\s*("+Xe.value+")\\s*\\]",populate:function(e,r,a){var n=ct(a,3),i=n[0],s=n[1],o=n[2],l=new RegExp("^"+Xe.string+"$").exec(o)!=null;if(l)o=o.substring(1,o.length-1);else o=parseFloat(o);r.checks.push({type:we.DATA_COMPARE,field:Kr(i),operator:s,value:o})}},{name:"dataBool",query:!0,regex:"\\[\\s*("+Xe.boolOp+")\\s*("+Xe.variable+")\\s*\\]",populate:function(e,r,a){var n=ct(a,2),i=n[0],s=n[1];r.checks.push({type:we.DATA_BOOL,field:Kr(s),operator:i})}},{name:"metaCompare",query:!0,regex:"\\[\\[\\s*("+Xe.meta+")\\s*("+Xe.comparatorOp+")\\s*("+Xe.number+")\\s*\\]\\]",populate:function(e,r,a){var n=ct(a,3),i=n[0],s=n[1],o=n[2];r.checks.push({type:we.META_COMPARE,field:Kr(i),operator:s,value:parseFloat(o)})}},{name:"nextQuery",separator:!0,regex:Xe.separator,populate:function(e,r){var{currentSubject:a,edgeCount:n,compoundCount:i}=e,s=e[e.length-1];if(a!=null)s.subject=a,e.currentSubject=null;s.edgeCount=n,s.compoundCount=i,e.edgeCount=0,e.compoundCount=0;var o=e[e.length++]=Qe();return o}},{name:"directedEdge",separator:!0,regex:Xe.directedEdge,populate:function(e,r){if(e.currentSubject==null){var a=Qe(),n=r,i=Qe();return a.checks.push({type:we.DIRECTED_EDGE,source:n,target:i}),cr(e,r,a),e.edgeCount++,i}else{var s=Qe(),o=r,l=Qe();return s.checks.push({type:we.NODE_SOURCE,source:o,target:l}),cr(e,r,s),e.edgeCount++,l}}},{name:"undirectedEdge",separator:!0,regex:Xe.undirectedEdge,populate:function(e,r){if(e.currentSubject==null){var a=Qe(),n=r,i=Qe();return a.checks.push({type:we.UNDIRECTED_EDGE,nodes:[n,i]}),cr(e,r,a),e.edgeCount++,i}else{var s=Qe(),o=r,l=Qe();return s.checks.push({type:we.NODE_NEIGHBOR,node:o,neighbor:l}),cr(e,r,s),l}}},{name:"child",separator:!0,regex:Xe.child,populate:function(e,r){if(e.currentSubject==null){var a=Qe(),n=Qe(),i=e[e.length-1];return a.checks.push({type:we.CHILD,parent:i,child:n}),cr(e,r,a),e.compoundCount++,n}else if(e.currentSubject===r){var s=Qe(),o=e[e.length-1],l=Qe(),u=Qe(),f=Qe(),v=Qe();return s.checks.push({type:we.COMPOUND_SPLIT,left:o,right:l,subject:u}),u.checks=r.checks,r.checks=[{type:we.TRUE}],v.checks.push({type:we.TRUE}),l.checks.push({type:we.PARENT,parent:v,child:f}),cr(e,o,s),e.currentSubject=u,e.compoundCount++,f}else{var h=Qe(),c=Qe(),d=[{type:we.PARENT,parent:h,child:c}];return h.checks=r.checks,r.checks=d,e.compoundCount++,c}}},{name:"descendant",separator:!0,regex:Xe.descendant,populate:function(e,r){if(e.currentSubject==null){var a=Qe(),n=Qe(),i=e[e.length-1];return a.checks.push({type:we.DESCENDANT,ancestor:i,descendant:n}),cr(e,r,a),e.compoundCount++,n}else if(e.currentSubject===r){var s=Qe(),o=e[e.length-1],l=Qe(),u=Qe(),f=Qe(),v=Qe();return s.checks.push({type:we.COMPOUND_SPLIT,left:o,right:l,subject:u}),u.checks=r.checks,r.checks=[{type:we.TRUE}],v.checks.push({type:we.TRUE}),l.checks.push({type:we.ANCESTOR,ancestor:v,descendant:f}),cr(e,o,s),e.currentSubject=u,e.compoundCount++,f}else{var h=Qe(),c=Qe(),d=[{type:we.ANCESTOR,ancestor:h,descendant:c}];return h.checks=r.checks,r.checks=d,e.compoundCount++,c}}},{name:"subject",modifier:!0,regex:Xe.subject,populate:function(e,r){if(e.currentSubject!=null&&e.currentSubject!==r)return _e("Redefinition of subject in selector `"+e.toString()+"`"),!1;e.currentSubject=r;var a=e[e.length-1],n=a.checks[0],i=n==null?null:n.type;if(i===we.DIRECTED_EDGE)n.type=we.NODE_TARGET;else if(i===we.UNDIRECTED_EDGE)n.type=we.NODE_NEIGHBOR,n.node=n.nodes[1],n.neighbor=n.nodes[0],n.nodes=null}}];Js.forEach(function(t){return t.regexObj=new RegExp("^"+t.regex)});var Gg=function(e){var r,a,n;for(var i=0;i<Js.length;i++){var s=Js[i],o=s.name,l=e.match(s.regexObj);if(l!=null){a=l,r=s,n=o;var u=l[0];e=e.substring(u.length);break}}return{expr:r,match:a,name:n,remaining:e}},Ug=function(e){var r=e.match(/^\s+/);if(r){var a=r[0];e=e.substring(a.length)}return e},Hg=function(e){var r=this,a=r.inputText=e,n=r[0]=Qe();r.length=1,a=Ug(a);for(;;){var i=Gg(a);if(i.expr==null)return _e("The selector `"+e+"`is invalid"),!1;else{var s=i.match.slice(1),o=i.expr.populate(r,n,s);if(o===!1)return!1;else if(o!=null)n=o}if(a=i.remaining,a.match(/^\s*$/))break}var l=r[r.length-1];if(r.currentSubject!=null)l.subject=r.currentSubject;l.edgeCount=r.edgeCount,l.compoundCount=r.compoundCount;for(var u=0;u<r.length;u++){var f=r[u];if(f.compoundCount>0&&f.edgeCount>0)return _e("The selector `"+e+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(f.edgeCount>1)return _e("The selector `"+e+"` is invalid because it uses multiple edge selectors"),!1;else if(f.edgeCount===1)_e("The selector `"+e+"` is deprecated. Edge selectors do not take effect on changes to source and target nodes after an edge is added, for performance reasons. Use a class or data selector on edges instead, updating the class or data of an edge when your app detects a change in source or target nodes.")}return!0},qg=function(){if(this.toStringCache!=null)return this.toStringCache;var e=function(f){if(f==null)return"";else return f},r=function(f){if(Re(f))return'"'+f+'"';else return e(f)},a=function(f){return" "+f+" "},n=function(f,v){var{type:h,value:c}=f;switch(h){case we.GROUP:{var d=e(c);return d.substring(0,d.length-1)}case we.DATA_COMPARE:{var{field:g,operator:y}=f;return"["+g+a(e(y))+r(c)+"]"}case we.DATA_BOOL:{var{operator:p,field:m}=f;return"["+e(p)+m+"]"}case we.DATA_EXIST:{var b=f.field;return"["+b+"]"}case we.META_COMPARE:{var{operator:E,field:A}=f;return"[["+A+a(e(E))+r(c)+"]]"}case we.STATE:return c;case we.ID:return"#"+c;case we.CLASS:return"."+c;case we.PARENT:case we.CHILD:return i(f.parent,v)+a(">")+i(f.child,v);case we.ANCESTOR:case we.DESCENDANT:return i(f.ancestor,v)+" "+i(f.descendant,v);case we.COMPOUND_SPLIT:{var M=i(f.left,v),S=i(f.subject,v),P=i(f.right,v);return M+(M.length>0?" ":"")+S+P}case we.TRUE:return""}},i=function(f,v){return f.checks.reduce(function(h,c,d){return h+(v===f&&d===0?"$":"")+n(c,v)},"")},s="";for(var o=0;o<this.length;o++){var l=this[o];if(s+=i(l,l.subject),this.length>1&&o<this.length-1)s+=", "}return this.toStringCache=s,s},Yg={parse:Hg,toString:qg},rv=function(e,r,a){var n,i=Re(e),s=he(e),o=Re(a),l,u,f=!1,v=!1,h=!1;if(r.indexOf("!")>=0)r=r.replace("!",""),v=!0;if(r.indexOf("@")>=0)r=r.replace("@",""),f=!0;if(i||o||f)l=!i&&!s?"":""+e,u=""+a;if(f)e=l=l.toLowerCase(),a=u=u.toLowerCase();switch(r){case"*=":n=l.indexOf(u)>=0;break;case"$=":n=l.indexOf(u,l.length-u.length)>=0;break;case"^=":n=l.indexOf(u)===0;break;case"=":n=e===a;break;case">":h=!0,n=e>a;break;case">=":h=!0,n=e>=a;break;case"<":h=!0,n=e<a;break;case"<=":h=!0,n=e<=a;break;default:n=!1;break}if(v&&(e!=null||!h))n=!n;return n},Xg=function(e,r){switch(r){case"?":return e?!0:!1;case"!":return e?!1:!0;case"^":return e===void 0}},Wg=function(e){return e!==void 0},So=function(e,r){return e.data(r)},$g=function(e,r){return e[r]()},ut=[],at=function(e,r){return e.checks.every(function(a){return ut[a.type](a,r)})};ut[we.GROUP]=function(t,e){var r=t.value;return r==="*"||r===e.group()};ut[we.STATE]=function(t,e){var r=t.value;return zg(r,e)};ut[we.ID]=function(t,e){var r=t.value;return e.id()===r};ut[we.CLASS]=function(t,e){var r=t.value;return e.hasClass(r)};ut[we.META_COMPARE]=function(t,e){var{field:r,operator:a,value:n}=t;return rv($g(e,r),a,n)};ut[we.DATA_COMPARE]=function(t,e){var{field:r,operator:a,value:n}=t;return rv(So(e,r),a,n)};ut[we.DATA_BOOL]=function(t,e){var{field:r,operator:a}=t;return Xg(So(e,r),a)};ut[we.DATA_EXIST]=function(t,e){var r=t.field;return t.operator,Wg(So(e,r))};ut[we.UNDIRECTED_EDGE]=function(t,e){var r=t.nodes[0],a=t.nodes[1],n=e.source(),i=e.target();return at(r,n)&&at(a,i)||at(a,n)&&at(r,i)};ut[we.NODE_NEIGHBOR]=function(t,e){return at(t.node,e)&&e.neighborhood().some(function(r){return r.isNode()&&at(t.neighbor,r)})};ut[we.DIRECTED_EDGE]=function(t,e){return at(t.source,e.source())&&at(t.target,e.target())};ut[we.NODE_SOURCE]=function(t,e){return at(t.source,e)&&e.outgoers().some(function(r){return r.isNode()&&at(t.target,r)})};ut[we.NODE_TARGET]=function(t,e){return at(t.target,e)&&e.incomers().some(function(r){return r.isNode()&&at(t.source,r)})};ut[we.CHILD]=function(t,e){return at(t.child,e)&&at(t.parent,e.parent())};ut[we.PARENT]=function(t,e){return at(t.parent,e)&&e.children().some(function(r){return at(t.child,r)})};ut[we.DESCENDANT]=function(t,e){return at(t.descendant,e)&&e.ancestors().some(function(r){return at(t.ancestor,r)})};ut[we.ANCESTOR]=function(t,e){return at(t.ancestor,e)&&e.descendants().some(function(r){return at(t.descendant,r)})};ut[we.COMPOUND_SPLIT]=function(t,e){return at(t.subject,e)&&at(t.left,e)&&at(t.right,e)};ut[we.TRUE]=function(){return!0};ut[we.COLLECTION]=function(t,e){var r=t.value;return r.has(e)};ut[we.FILTER]=function(t,e){var r=t.value;return r(e)};var Kg=function(e){var r=this;if(r.length===1&&r[0].checks.length===1&&r[0].checks[0].type===we.ID)return e.getElementById(r[0].checks[0].value).collection();var a=function(i){for(var s=0;s<r.length;s++){var o=r[s];if(at(o,i))return!0}return!1};if(r.text()==null)a=function(){return!0};return e.filter(a)},Zg=function(e){var r=this;for(var a=0;a<r.length;a++){var n=r[a];if(at(n,e))return!0}return!1},_g={matches:Zg,filter:Kg},Sr=function(e){if(this.inputText=e,this.currentSubject=null,this.compoundCount=0,this.edgeCount=0,this.length=0,e==null||Re(e)&&e.match(/^\s*$/));else if(zt(e))this.addQuery({checks:[{type:we.COLLECTION,value:e.collection()}]});else if(st(e))this.addQuery({checks:[{type:we.FILTER,value:e}]});else if(Re(e)){if(!this.parse(e))this.invalid=!0}else it("A selector must be created from a string; found ")},Dr=Sr.prototype;[Yg,_g].forEach(function(t){return Oe(Dr,t)});Dr.text=function(){return this.inputText};Dr.size=function(){return this.length};Dr.eq=function(t){return this[t]};Dr.sameText=function(t){return!this.invalid&&!t.invalid&&this.text()===t.text()};Dr.addQuery=function(t){this[this.length++]=t};Dr.selector=Dr.toString;var wr={allAre:function(e){var r=new Sr(e);return this.every(function(a){return r.matches(a)})},is:function(e){var r=new Sr(e);return this.some(function(a){return r.matches(a)})},some:function(e,r){for(var a=0;a<this.length;a++){var n=!r?e(this[a],a,this):e.apply(r,[this[a],a,this]);if(n)return!0}return!1},every:function(e,r){for(var a=0;a<this.length;a++){var n=!r?e(this[a],a,this):e.apply(r,[this[a],a,this]);if(!n)return!1}return!0},same:function(e){if(this===e)return!0;e=this.cy().collection(e);var r=this.length,a=e.length;if(r!==a)return!1;if(r===1)return this[0]===e[0];return this.every(function(n){return e.hasElementWithId(n.id())})},anySame:function(e){return e=this.cy().collection(e),this.some(function(r){return e.hasElementWithId(r.id())})},allAreNeighbors:function(e){e=this.cy().collection(e);var r=this.neighborhood();return e.every(function(a){return r.hasElementWithId(a.id())})},contains:function(e){e=this.cy().collection(e);var r=this;return e.every(function(a){return r.hasElementWithId(a.id())})}};wr.allAreNeighbours=wr.allAreNeighbors;wr.has=wr.contains;wr.equal=wr.equals=wr.same;var Ht=function(e,r){return function(n,i,s,o){var l=n,u=this,f;if(l==null)f="";else if(zt(l)&&l.length===1)f=l.id();if(u.length===1&&f){var v=u[0]._private,h=v.traversalCache=v.traversalCache||{},c=h[r]=h[r]||[],d=Gr(f),g=c[d];if(g)return g;else return c[d]=e.call(u,n,i,s,o)}else return e.call(u,n,i,s,o)}},va={parent:function(e){var r=[];if(this.length===1){var a=this[0]._private.parent;if(a)return a}for(var n=0;n<this.length;n++){var i=this[n],s=i._private.parent;if(s)r.push(s)}return this.spawn(r,!0).filter(e)},parents:function(e){var r=[],a=this.parent();while(a.nonempty()){for(var n=0;n<a.length;n++){var i=a[n];r.push(i)}a=a.parent()}return this.spawn(r,!0).filter(e)},commonAncestors:function(e){var r;for(var a=0;a<this.length;a++){var n=this[a],i=n.parents();r=r||i,r=r.intersect(i)}return r.filter(e)},orphans:function(e){return this.stdFilter(function(r){return r.isOrphan()}).filter(e)},nonorphans:function(e){return this.stdFilter(function(r){return r.isChild()}).filter(e)},children:Ht(function(t){var e=[];for(var r=0;r<this.length;r++){var a=this[r],n=a._private.children;for(var i=0;i<n.length;i++)e.push(n[i])}return this.spawn(e,!0).filter(t)},"children"),siblings:function(e){return this.parent().children().not(this).filter(e)},isParent:function(){var e=this[0];if(e)return e.isNode()&&e._private.children.length!==0},isChildless:function(){var e=this[0];if(e)return e.isNode()&&e._private.children.length===0},isChild:function(){var e=this[0];if(e)return e.isNode()&&e._private.parent!=null},isOrphan:function(){var e=this[0];if(e)return e.isNode()&&e._private.parent==null},descendants:function(e){var r=[];function a(n){for(var i=0;i<n.length;i++){var s=n[i];if(r.push(s),s.children().nonempty())a(s.children())}}return a(this.children()),this.spawn(r,!0).filter(e)}};function Do(t,e,r,a){var n=[],i=new da,s=t.cy(),o=s.hasCompoundNodes();for(var l=0;l<t.length;l++){var u=t[l];if(r)n.push(u);else if(o)a(n,i,u)}while(n.length>0){var f=n.shift();if(e(f),i.add(f.id()),o)a(n,i,f)}return t}function av(t,e,r){if(r.isParent()){var a=r._private.children;for(var n=0;n<a.length;n++){var i=a[n];if(!e.has(i.id()))t.push(i)}}}va.forEachDown=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return Do(this,t,e,av)};function nv(t,e,r){if(r.isChild()){var a=r._private.parent;if(!e.has(a.id()))t.push(a)}}va.forEachUp=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return Do(this,t,e,nv)};function Qg(t,e,r){nv(t,e,r),av(t,e,r)}va.forEachUpAndDown=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return Do(this,t,e,Qg)};va.ancestors=va.parents;var qa,iv;qa=iv={data:Ze.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),removeData:Ze.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:Ze.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Ze.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:Ze.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:Ze.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}};qa.attr=qa.data;qa.removeAttr=qa.removeData;var Jg=iv,ni={};function Ns(t){return function(e){var r=this;if(e===void 0)e=!0;if(r.length===0)return;if(r.isNode()&&!r.removed()){var a=0,n=r[0],i=n._private.edges;for(var s=0;s<i.length;s++){var o=i[s];if(!e&&o.isLoop())continue;a+=t(n,o)}return a}else return}}Oe(ni,{degree:Ns(function(t,e){if(e.source().same(e.target()))return 2;else return 1}),indegree:Ns(function(t,e){if(e.target().same(t))return 1;else return 0}),outdegree:Ns(function(t,e){if(e.source().same(t))return 1;else return 0})});function Zr(t,e){return function(r){var a,n=this.nodes();for(var i=0;i<n.length;i++){var s=n[i],o=s[t](r);if(o!==void 0&&(a===void 0||e(o,a)))a=o}return a}}Oe(ni,{minDegree:Zr("degree",function(t,e){return t<e}),maxDegree:Zr("degree",function(t,e){return t>e}),minIndegree:Zr("indegree",function(t,e){return t<e}),maxIndegree:Zr("indegree",function(t,e){return t>e}),minOutdegree:Zr("outdegree",function(t,e){return t<e}),maxOutdegree:Zr("outdegree",function(t,e){return t>e})});Oe(ni,{totalDegree:function(e){var r=0,a=this.nodes();for(var n=0;n<a.length;n++)r+=a[n].degree(e);return r}});var Wt,sv,ov=function(e,r,a){for(var n=0;n<e.length;n++){var i=e[n];if(!i.locked()){var s=i._private.position,o={x:r.x!=null?r.x-s.x:0,y:r.y!=null?r.y-s.y:0};if(i.isParent()&&!(o.x===0&&o.y===0))i.children().shift(o,a);i.dirtyBoundingBoxCache()}}},El={field:"position",bindingEvent:"position",allowBinding:!0,allowSetting:!0,settingEvent:"position",settingTriggersEvent:!0,triggerFnName:"emitAndNotify",allowGetting:!0,validKeys:["x","y"],beforeGet:function(e){e.updateCompoundBounds()},beforeSet:function(e,r){ov(e,r,!1)},onSet:function(e){e.dirtyCompoundBoundsCache()},canSet:function(e){return!e.locked()}};Wt=sv={position:Ze.data(El),silentPosition:Ze.data(Oe({},El,{allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!1,beforeSet:function(e,r){ov(e,r,!0)},onSet:function(e){e.dirtyCompoundBoundsCache()}})),positions:function(e,r){if(We(e))if(r)this.silentPosition(e);else this.position(e);else if(st(e)){var a=e,n=this.cy();n.startBatch();for(var i=0;i<this.length;i++){var s=this[i],o=void 0;if(o=a(s,i))if(r)s.silentPosition(o);else s.position(o)}n.endBatch()}return this},silentPositions:function(e){return this.positions(e,!0)},shift:function(e,r,a){var n;if(We(e))n={x:he(e.x)?e.x:0,y:he(e.y)?e.y:0},a=r;else if(Re(e)&&he(r))n={x:0,y:0},n[e]=r;if(n!=null){var i=this.cy();i.startBatch();for(var s=0;s<this.length;s++){var o=this[s];if(i.hasCompoundNodes()&&o.isChild()&&o.ancestors().anySame(this))continue;var l=o.position(),u={x:l.x+n.x,y:l.y+n.y};if(a)o.silentPosition(u);else o.position(u)}i.endBatch()}return this},silentShift:function(e,r){if(We(e))this.shift(e,!0);else if(Re(e)&&he(r))this.shift(e,r,!0);return this},renderedPosition:function(e,r){var a=this[0],n=this.cy(),i=n.zoom(),s=n.pan(),o=We(e)?e:void 0,l=o!==void 0||r!==void 0&&Re(e);if(a&&a.isNode())if(l)for(var u=0;u<this.length;u++){var f=this[u];if(r!==void 0)f.position(e,(r-s[e])/i);else if(o!==void 0)f.position(If(o,i,s))}else{var v=a.position();if(o=Jn(v,i,s),e===void 0)return o;else return o[e]}else if(!l)return;return this},relativePosition:function(e,r){var a=this[0],n=this.cy(),i=We(e)?e:void 0,s=i!==void 0||r!==void 0&&Re(e),o=n.hasCompoundNodes();if(a&&a.isNode())if(s)for(var l=0;l<this.length;l++){var u=this[l],f=o?u.parent():null,v=f&&f.length>0,h=v;if(v)f=f[0];var c=h?f.position():{x:0,y:0};if(r!==void 0)u.position(e,r+c[e]);else if(i!==void 0)u.position({x:i.x+c.x,y:i.y+c.y})}else{var d=a.position(),g=o?a.parent():null,y=g&&g.length>0,p=y;if(y)g=g[0];var m=p?g.position():{x:0,y:0};if(i={x:d.x-m.x,y:d.y-m.y},e===void 0)return i;else return i[e]}else if(!s)return;return this}};Wt.modelPosition=Wt.point=Wt.position;Wt.modelPositions=Wt.points=Wt.positions;Wt.renderedPoint=Wt.renderedPosition;Wt.relativePoint=Wt.relativePosition;var jg=sv,ha=function(e){switch(e){case"left":case"right-inside":return"left";case"right":case"left-inside":return"right";default:return"center"}},ca=function(e){switch(e){case"top":case"bottom-inside":return"top";case"bottom":case"top-inside":return"bottom";default:return"center"}},ep=function(e){switch(e){case"left":return"right";case"right":return"left";case"left-inside":return"left";case"right-inside":return"right";default:return"center"}},ua,Rr;ua=Rr={};Rr.renderedBoundingBox=function(t){var e=this.boundingBox(t),r=this.cy(),a=r.zoom(),n=r.pan(),i=e.x1*a+n.x,s=e.x2*a+n.x,o=e.y1*a+n.y,l=e.y2*a+n.y;return{x1:i,x2:s,y1:o,y2:l,w:s-i,h:l-o}};Rr.dirtyCompoundBoundsCache=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();if(!e.styleEnabled()||!e.hasCompoundNodes())return this;return this.forEachUp(function(r){if(r.isParent()){var a=r._private;if(a.compoundBoundsClean=!1,a.bbCache=null,!t)r.emitAndNotify("bounds")}}),this};Rr.updateCompoundBounds=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();if(!e.styleEnabled()||!e.hasCompoundNodes())return this;if(!t&&e.batching())return this;function r(s){if(!s.isParent())return;var o=s._private,l=s.children(),u=s.pstyle("compound-sizing-wrt-labels").value==="include",f={width:{val:s.pstyle("min-width").pfValue,left:s.pstyle("min-width-bias-left"),right:s.pstyle("min-width-bias-right")},height:{val:s.pstyle("min-height").pfValue,top:s.pstyle("min-height-bias-top"),bottom:s.pstyle("min-height-bias-bottom")}},v=l.boundingBox({includeLabels:u,includeOverlays:!1,useCache:!1}),h=o.position;if(v.w===0||v.h===0)v={w:s.pstyle("width").pfValue,h:s.pstyle("height").pfValue},v.x1=h.x-v.w/2,v.x2=h.x+v.w/2,v.y1=h.y-v.h/2,v.y2=h.y+v.h/2;function c(N,R,I){var w=0,x=0,T=R+I;if(N>0&&T>0)w=R/T*N,x=I/T*N;return{biasDiff:w,biasComplementDiff:x}}function d(N,R,I,w){if(I.units==="%")switch(w){case"width":return N>0?I.pfValue*N:0;case"height":return R>0?I.pfValue*R:0;case"average":return N>0&&R>0?I.pfValue*(N+R)/2:0;case"min":return N>0&&R>0?N>R?I.pfValue*R:I.pfValue*N:0;case"max":return N>0&&R>0?N>R?I.pfValue*N:I.pfValue*R:0;default:return 0}else if(I.units==="px")return I.pfValue;else return 0}var g=f.width.left.value;if(f.width.left.units==="px"&&f.width.val>0)g=g*100/f.width.val;var y=f.width.right.value;if(f.width.right.units==="px"&&f.width.val>0)y=y*100/f.width.val;var p=f.height.top.value;if(f.height.top.units==="px"&&f.height.val>0)p=p*100/f.height.val;var m=f.height.bottom.value;if(f.height.bottom.units==="px"&&f.height.val>0)m=m*100/f.height.val;var b=c(f.width.val-v.w,g,y),{biasDiff:E,biasComplementDiff:A}=b,M=c(f.height.val-v.h,p,m),{biasDiff:S,biasComplementDiff:P}=M;o.autoPadding=d(v.w,v.h,s.pstyle("padding"),s.pstyle("padding-relative-to").value),o.autoWidth=Math.max(v.w,f.width.val),h.x=(-E+v.x1+v.x2+A)/2,o.autoHeight=Math.max(v.h,f.height.val),h.y=(-S+v.y1+v.y2+P)/2}for(var a=0;a<this.length;a++){var n=this[a],i=n._private;if(!i.compoundBoundsClean||t){if(r(n),!e.batching())i.compoundBoundsClean=!0}}return this};var Ut=function(e){if(e===1/0||e===-1/0)return 0;return e},Xt=function(e,r,a,n,i){if(n-r===0||i-a===0)return;if(r==null||a==null||n==null||i==null)return;e.x1=r<e.x1?r:e.x1,e.x2=n>e.x2?n:e.x2,e.y1=a<e.y1?a:e.y1,e.y2=i>e.y2?i:e.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1},pr=function(e,r){if(r==null)return e;return Xt(e,r.x1,r.y1,r.x2,r.y2)},Da=function(e,r,a){return Nt(e,r,a)},yn=function(e,r,a){if(r.cy().headless())return;var n=r._private,i=n.rstyle,s=i.arrowWidth/2,o=r.pstyle(a+"-arrow-shape").value,l,u;if(o!=="none"){if(a==="source")l=i.srcX,u=i.srcY;else if(a==="target")l=i.tgtX,u=i.tgtY;else l=i.midX,u=i.midY;var f=n.arrowBounds=n.arrowBounds||{},v=f[a]=f[a]||{};v.x1=l-s,v.y1=u-s,v.x2=l+s,v.y2=u+s,v.w=v.x2-v.x1,v.h=v.y2-v.y1,Sn(v,1),Xt(e,v.x1,v.y1,v.x2,v.y2)}},Os=function(e,r,a){if(r.cy().headless())return;var n;if(a)n=a+"-";else n="";var i=r._private,s=i.rstyle,o=r.pstyle(n+"label").strValue;if(o){var l=r.pstyle("text-halign"),u=r.pstyle("text-valign"),f=Da(s,"labelWidth",a),v=Da(s,"labelHeight",a),h=Da(s,"labelX",a),c=Da(s,"labelY",a),d=r.pstyle(n+"text-margin-x").pfValue,g=r.pstyle(n+"text-margin-y").pfValue,y=r.isEdge(),p=r.pstyle(n+"text-rotation"),m=r.pstyle("text-outline-width").pfValue,b=r.pstyle("text-border-width").pfValue,E=b/2,A=r.pstyle("text-background-padding").pfValue,M=2,S=v,P=f,N=P/2,R=S/2,I,w,x,T;if(y)I=h-N,w=h+N,x=c-R,T=c+R;else{switch(ha(l.value)){case"left":I=h-P,w=h;break;case"center":I=h-N,w=h+N;break;case"right":I=h,w=h+P;break}switch(ca(u.value)){case"top":x=c-S,T=c;break;case"center":x=c-R,T=c+R;break;case"bottom":x=c,T=c+S;break}}var D=d-Math.max(m,E)-A-M,C=d+Math.max(m,E)+A+M,O=g-Math.max(m,E)-A-M,B=g+Math.max(m,E)+A+M;I+=D,w+=C,x+=O,T+=B;var z=a||"main",V=i.labelBounds,k=V[z]=V[z]||{};k.x1=I,k.y1=x,k.x2=w,k.y2=T,k.w=w-I,k.h=T-x,k.leftPad=D,k.rightPad=C,k.topPad=O,k.botPad=B;var G=y&&p.strValue==="autorotate",J=p.pfValue!=null&&p.pfValue!==0;if(G||J){var X=G?Da(i.rstyle,"labelAngle",a):p.pfValue,_=Math.cos(X),Q=Math.sin(X),q=(I+w)/2,te=(x+T)/2;if(!y){switch(ha(l.value)){case"left":q=w;break;case"right":q=I;break}switch(ca(u.value)){case"top":te=T;break;case"bottom":te=x;break}}var Z=function(Ce,Se){return Ce=Ce-q,Se=Se-te,{x:Ce*_-Se*Q+q,y:Ce*Q+Se*_+te}},U=Z(I,x),W=Z(I,T),j=Z(w,x),re=Z(w,T);I=Math.min(U.x,W.x,j.x,re.x),w=Math.max(U.x,W.x,j.x,re.x),x=Math.min(U.y,W.y,j.y,re.y),T=Math.max(U.y,W.y,j.y,re.y)}var ee=z+"Rot",de=V[ee]=V[ee]||{};de.x1=I,de.y1=x,de.x2=w,de.y2=T,de.w=w-I,de.h=T-x,Xt(e,I,x,w,T),Xt(i.labelBounds.all,I,x,w,T)}return e},xl=function(e,r){if(r.cy().headless())return;var a=r.pstyle("outline-opacity").value,n=r.pstyle("outline-width").value,i=r.pstyle("outline-offset").value,s=n+i;uv(e,r,a,s,"outside",s/2)},uv=function(e,r,a,n,i,s){if(a===0||n<=0||i==="inside")return;var o=r.cy(),l=o.renderer(),u=l.nodeShapes[l.getNodeShape(r)];if(!u)return;var f=r.position(),{x:v,y:h}=f,c=r.width(),d=r.height();if(u.hasMiterBounds){if(i==="center")n/=2;var g=u.miterBounds(v,h,c,d,n);pr(e,g)}else if(s!=null&&s>0)Dn(e,[s,s,s,s])},tp=function(e,r){if(r.cy().headless())return;var a=r.pstyle("border-opacity").value,n=r.pstyle("border-width").pfValue,i=r.pstyle("border-position").value;uv(e,r,a,n,i)},rp=function(e,r){var a=e._private.cy,n=a.styleEnabled(),i=a.headless(),s=Ot(),o=e._private,l=e.isNode(),u=e.isEdge(),f,v,h,c,d,g,y=o.rstyle,p=l&&n?e.pstyle("bounds-expansion").pfValue:[0],m=function(Ae){return Ae.pstyle("display").value!=="none"},b=!n||m(e)&&(!u||m(e.source())&&m(e.target()));if(b){var E=0,A=0;if(n&&r.includeOverlays){if(E=e.pstyle("overlay-opacity").value,E!==0)A=e.pstyle("overlay-padding").value}var M=0,S=0;if(n&&r.includeUnderlays){if(M=e.pstyle("underlay-opacity").value,M!==0)S=e.pstyle("underlay-padding").value}var P=Math.max(A,S),N=0,R=0;if(n)N=e.pstyle("width").pfValue,R=N/2;if(l&&r.includeNodes){var I=e.position();d=I.x,g=I.y;var w=e.outerWidth(),x=w/2,T=e.outerHeight(),D=T/2;if(f=d-x,v=d+x,h=g-D,c=g+D,Xt(s,f,h,v,c),n)xl(s,e);if(n&&r.includeOutlines&&!i)xl(s,e);if(n)tp(s,e)}else if(u&&r.includeEdges)if(n&&!i){var C=e.pstyle("curve-style").strValue;if(f=Math.min(y.srcX,y.midX,y.tgtX),v=Math.max(y.srcX,y.midX,y.tgtX),h=Math.min(y.srcY,y.midY,y.tgtY),c=Math.max(y.srcY,y.midY,y.tgtY),f-=R,v+=R,h-=R,c+=R,Xt(s,f,h,v,c),C==="haystack"){var O=y.haystackPts;if(O&&O.length===2){if(f=O[0].x,h=O[0].y,v=O[1].x,c=O[1].y,f>v){var B=f;f=v,v=B}if(h>c){var z=h;h=c,c=z}Xt(s,f-R,h-R,v+R,c+R)}}else if(C==="bezier"||C==="unbundled-bezier"||yr(C,"segments")||yr(C,"taxi")){var V;switch(C){case"bezier":case"unbundled-bezier":V=y.bezierPts;break;case"segments":case"taxi":case"round-segments":case"round-taxi":V=y.linePts;break}if(V!=null)for(var k=0;k<V.length;k++){var G=V[k];f=G.x-R,v=G.x+R,h=G.y-R,c=G.y+R,Xt(s,f,h,v,c)}}}else{var J=e.source(),X=J.position(),_=e.target(),Q=_.position();if(f=X.x,v=Q.x,h=X.y,c=Q.y,f>v){var q=f;f=v,v=q}if(h>c){var te=h;h=c,c=te}f-=R,v+=R,h-=R,c+=R,Xt(s,f,h,v,c)}if(n&&r.includeEdges&&u)yn(s,e,"mid-source"),yn(s,e,"mid-target"),yn(s,e,"source"),yn(s,e,"target");if(n){var Z=e.pstyle("ghost").value==="yes";if(Z){var U=e.pstyle("ghost-offset-x").pfValue,W=e.pstyle("ghost-offset-y").pfValue;Xt(s,s.x1+U,s.y1+W,s.x2+U,s.y2+W)}}var j=o.bodyBounds=o.bodyBounds||{};if(ou(j,s),Dn(j,p),Sn(j,1),n)f=s.x1,v=s.x2,h=s.y1,c=s.y2,Xt(s,f-P,h-P,v+P,c+P);var re=o.overlayBounds=o.overlayBounds||{};ou(re,s),Dn(re,p),Sn(re,1);var ee=o.labelBounds=o.labelBounds||{};if(ee.all!=null)kc(ee.all);else ee.all=Ot();if(n&&r.includeLabels){if(r.includeMainLabels)Os(s,e,null);if(u){if(r.includeSourceLabels)Os(s,e,"source");if(r.includeTargetLabels)Os(s,e,"target")}}}if(s.x1=Ut(s.x1),s.y1=Ut(s.y1),s.x2=Ut(s.x2),s.y2=Ut(s.y2),s.w=Ut(s.x2-s.x1),s.h=Ut(s.y2-s.y1),s.w>0&&s.h>0&&b)Dn(s,p),Sn(s,1);return s},lv=function(e){var r=0,a=function(s){return(s?1:0)<<r++},n=0;return n+=a(e.incudeNodes),n+=a(e.includeEdges),n+=a(e.includeLabels),n+=a(e.includeMainLabels),n+=a(e.includeSourceLabels),n+=a(e.includeTargetLabels),n+=a(e.includeOverlays),n+=a(e.includeOutlines),n},fv=function(e){var r=function(o){return Math.round(o)};if(e.isEdge()){var a=e.source().position(),n=e.target().position();return tu([r(a.x),r(a.y),r(n.x),r(n.y)])}else{var i=e.position();return tu([r(i.x),r(i.y)])}},Tl=function(e,r){var a=e._private,n,i=e.isEdge(),s=r==null?Cl:lv(r),o=s===Cl;if(a.bbCache==null)n=rp(e,Ya),a.bbCache=n,a.bbCachePosKey=fv(e);else n=a.bbCache;if(!o){var l=e.isNode();if(n=Ot(),r.includeNodes&&l||r.includeEdges&&!l)if(r.includeOverlays)pr(n,a.overlayBounds);else pr(n,a.bodyBounds);if(r.includeLabels)if(r.includeMainLabels&&(!i||r.includeSourceLabels&&r.includeTargetLabels))pr(n,a.labelBounds.all);else{if(r.includeMainLabels)pr(n,a.labelBounds.mainRot);if(r.includeSourceLabels)pr(n,a.labelBounds.sourceRot);if(r.includeTargetLabels)pr(n,a.labelBounds.targetRot)}n.w=n.x2-n.x1,n.h=n.y2-n.y1}return n},Ya={includeNodes:!0,includeEdges:!0,includeLabels:!0,includeMainLabels:!0,includeSourceLabels:!0,includeTargetLabels:!0,includeOverlays:!0,includeUnderlays:!0,includeOutlines:!0,useCache:!0},Cl=lv(Ya),Sl=St(Ya);Rr.boundingBox=function(t){var e,r=t===void 0||t.useCache===void 0||t.useCache===!0,a=la(function(f){var v=f._private;return v.bbCache==null||v.styleDirty||v.bbCachePosKey!==fv(f)},function(f){return f.id()});if(r&&this.length===1&&!a(this[0])){if(t===void 0)t=Ya;else t=Sl(t);e=Tl(this[0],t)}else{e=Ot(),t=t||Ya;var n=Sl(t),i=this,s=i.cy(),o=s.styleEnabled();if(this.edges().forEach(a),this.nodes().forEach(a),o)this.recalculateRenderedStyle(r);this.updateCompoundBounds(!r);for(var l=0;l<i.length;l++){var u=i[l];if(a(u))u.dirtyBoundingBoxCache();pr(e,Tl(u,n))}}return e.x1=Ut(e.x1),e.y1=Ut(e.y1),e.x2=Ut(e.x2),e.y2=Ut(e.y2),e.w=Ut(e.x2-e.x1),e.h=Ut(e.y2-e.y1),e};Rr.dirtyBoundingBoxCache=function(){for(var t=0;t<this.length;t++){var e=this[t]._private;e.bbCache=null,e.bbCachePosKey=null,e.bodyBounds=null,e.overlayBounds=null,e.labelBounds.all=null,e.labelBounds.source=null,e.labelBounds.target=null,e.labelBounds.main=null,e.labelBounds.sourceRot=null,e.labelBounds.targetRot=null,e.labelBounds.mainRot=null,e.arrowBounds.source=null,e.arrowBounds.target=null,e.arrowBounds["mid-source"]=null,e.arrowBounds["mid-target"]=null}return this.emitAndNotify("bounds"),this};Rr.boundingBoxAt=function(t){var e=this.nodes(),r=this.cy(),a=r.hasCompoundNodes(),n=r.collection();if(a)n=e.filter(function(u){return u.isParent()}),e=e.not(n);if(We(t)){var i=t;t=function(){return i}}var s=function(f,v){return f._private.bbAtOldPos=t(f,v)},o=function(f){return f._private.bbAtOldPos};if(r.startBatch(),e.forEach(s).silentPositions(t),a)n.dirtyCompoundBoundsCache(),n.dirtyBoundingBoxCache(),n.updateCompoundBounds(!0);var l=Bc(this.boundingBox({useCache:!1}));if(e.silentPositions(o),a)n.dirtyCompoundBoundsCache(),n.dirtyBoundingBoxCache(),n.updateCompoundBounds(!0);return r.endBatch(),l};ua.boundingbox=ua.bb=ua.boundingBox;ua.renderedBoundingbox=ua.renderedBoundingBox;var ap=Rr,Oa,tn;Oa=tn={};var vv=function(e){e.uppercaseName=Go(e.name),e.autoName="auto"+e.uppercaseName,e.labelName="label"+e.uppercaseName,e.outerName="outer"+e.uppercaseName,e.uppercaseOuterName=Go(e.outerName),Oa[e.name]=function(){var a=this[0],n=a._private,i=n.cy,s=i._private.styleEnabled;if(a)if(s){if(a.isParent())return a.updateCompoundBounds(),n[e.autoName]||0;var o=a.pstyle(e.name);switch(o.strValue){case"label":return a.recalculateRenderedStyle(),n.rstyle[e.labelName]||0;default:return o.pfValue}}else return 1},Oa["outer"+e.uppercaseName]=function(){var a=this[0],n=a._private,i=n.cy,s=i._private.styleEnabled;if(a)if(s){var o=a[e.name](),l=a.pstyle("border-position").value,u;if(l==="center")u=a.pstyle("border-width").pfValue;else if(l==="outside")u=2*a.pstyle("border-width").pfValue;else u=0;var f=2*a.padding();return o+u+f}else return 1},Oa["rendered"+e.uppercaseName]=function(){var a=this[0];if(a){var n=a[e.name]();return n*this.cy().zoom()}},Oa["rendered"+e.uppercaseOuterName]=function(){var a=this[0];if(a){var n=a[e.outerName]();return n*this.cy().zoom()}}};vv({name:"width"});vv({name:"height"});tn.padding=function(){var t=this[0],e=t._private;if(t.isParent())if(t.updateCompoundBounds(),e.autoPadding!==void 0)return e.autoPadding;else return t.pstyle("padding").pfValue;else return t.pstyle("padding").pfValue};tn.paddedHeight=function(){var t=this[0];return t.height()+2*t.padding()};tn.paddedWidth=function(){var t=this[0];return t.width()+2*t.padding()};var np=tn,ip=function(e,r){if(e.isEdge()&&e.takesUpSpace())return r(e)},sp=function(e,r){if(e.isEdge()&&e.takesUpSpace()){var a=e.cy();return Jn(r(e),a.zoom(),a.pan())}},op=function(e,r){if(e.isEdge()&&e.takesUpSpace()){var a=e.cy(),n=a.pan(),i=a.zoom();return r(e).map(function(s){return Jn(s,i,n)})}},up=function(e){return e.renderer().getControlPoints(e)},lp=function(e){return e.renderer().getSegmentPoints(e)},fp=function(e){return e.renderer().getSourceEndpoint(e)},vp=function(e){return e.renderer().getTargetEndpoint(e)},hp=function(e){return e.renderer().getEdgeMidpoint(e)},Dl={controlPoints:{get:up,mult:!0},segmentPoints:{get:lp,mult:!0},sourceEndpoint:{get:fp},targetEndpoint:{get:vp},midpoint:{get:hp}},cp=function(e){return"rendered"+e[0].toUpperCase()+e.substr(1)},dp=Object.keys(Dl).reduce(function(t,e){var r=Dl[e],a=cp(e);if(t[e]=function(){return ip(this,r.get)},r.mult)t[a]=function(){return op(this,r.get)};else t[a]=function(){return sp(this,r.get)};return t},{}),gp=Oe({},jg,ap,np,dp);/*!
9
9
  Event object based on jQuery events, MIT license
10
10
 
11
11
  https://jquery.org/license/
12
12
  https://tldrlegal.com/license/mit-license
13
13
  https://github.com/jquery/jquery/blob/master/src/event.js
14
- */var hv=function(e,r){this.recycle(e,r)};function Aa(){return!1}function mn(){return!0}hv.prototype={instanceString:function(){return"event"},recycle:function(e,r){if(this.isImmediatePropagationStopped=this.isPropagationStopped=this.isDefaultPrevented=Aa,e!=null&&e.preventDefault)this.type=e.type,this.isDefaultPrevented=e.defaultPrevented?mn:Aa;else if(e!=null&&e.type)r=e;else this.type=e;if(r!=null)this.originalEvent=r.originalEvent,this.type=r.type!=null?r.type:this.type,this.cy=r.cy,this.target=r.target,this.position=r.position,this.renderedPosition=r.renderedPosition,this.namespace=r.namespace,this.layout=r.layout;if(this.cy!=null&&this.position!=null&&this.renderedPosition==null){var a=this.position,n=this.cy.zoom(),i=this.cy.pan();this.renderedPosition={x:a.x*n+i.x,y:a.y*n+i.y}}this.timeStamp=e&&e.timeStamp||Date.now()},preventDefault:function(){this.isDefaultPrevented=mn;var e=this.originalEvent;if(!e)return;if(e.preventDefault)e.preventDefault()},stopPropagation:function(){this.isPropagationStopped=mn;var e=this.originalEvent;if(!e)return;if(e.stopPropagation)e.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=mn,this.stopPropagation()},isDefaultPrevented:Aa,isPropagationStopped:Aa,isImmediatePropagationStopped:Aa};var cv=/^([^.]+)(\.(?:[^.]+))?$/,pp=".*",dv={qualifierCompare:function(e,r){return e===r},eventMatches:function(){return!0},addEventFields:function(){},callbackContext:function(e){return e},beforeEmit:function(){},afterEmit:function(){},bubble:function(){return!1},parent:function(){return null},context:null},Al=Object.keys(dv),yp={};function ii(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:yp,e=arguments.length>1?arguments[1]:void 0;for(var r=0;r<Al.length;r++){var a=Al[r];this[a]=t[a]||dv[a]}this.context=e||this.context,this.listeners=[],this.emitting=0}var Ar=ii.prototype,gv=function(e,r,a,n,i,s,o){if(st(n))i=n,n=null;if(o)if(s==null)s=o;else s=Oe({},s,o);var l=Je(a)?a:a.split(/\s+/);for(var u=0;u<l.length;u++){var f=l[u];if(xr(f))continue;var v=f.match(cv);if(v){var h=v[1],c=v[2]?v[2]:null,d=r(e,f,h,c,n,i,s);if(d===!1)break}}},Ml=function(e,r){return e.addEventFields(e.context,r),new hv(r.type,r)},mp=function(e,r,a){if(xh(a)){r(e,a);return}else if(We(a)){r(e,Ml(e,a));return}var n=Je(a)?a:a.split(/\s+/);for(var i=0;i<n.length;i++){var s=n[i];if(xr(s))continue;var o=s.match(cv);if(o){var l=o[1],u=o[2]?o[2]:null,f=Ml(e,{type:l,namespace:u,target:e.context});r(e,f)}}};Ar.on=Ar.addListener=function(t,e,r,a,n){return gv(this,function(i,s,o,l,u,f,v){if(st(f))i.listeners.push({event:s,callback:f,type:o,namespace:l,qualifier:u,conf:v})},t,e,r,a,n),this};Ar.one=function(t,e,r,a){return this.on(t,e,r,a,{one:!0})};Ar.removeListener=Ar.off=function(t,e,r,a){var n=this;if(this.emitting!==0)this.listeners=nc(this.listeners);var i=this.listeners,s=function(u){var f=i[u];gv(n,function(v,h,c,d,g,y){if((f.type===c||t==="*")&&(!d&&f.namespace!==".*"||f.namespace===d)&&(!g||v.qualifierCompare(f.qualifier,g))&&(!y||f.callback===y))return i.splice(u,1),!1},t,e,r,a)};for(var o=i.length-1;o>=0;o--)s(o);return this};Ar.removeAllListeners=function(){return this.removeListener("*")};Ar.emit=Ar.trigger=function(t,e,r){var a=this.listeners,n=a.length;if(this.emitting++,!Je(e))e=[e];return mp(this,function(i,s){if(r!=null)a=[{event:s.event,type:s.type,namespace:s.namespace,callback:r}],n=a.length;var o=function(){var f=a[l];if(f.type===s.type&&(!f.namespace||f.namespace===s.namespace||f.namespace===pp)&&i.eventMatches(i.context,f,s)){var v=[s];if(e!=null)sc(v,e);if(i.beforeEmit(i.context,f,s),f.conf&&f.conf.one)i.listeners=i.listeners.filter(function(d){return d!==f});var h=i.callbackContext(i.context,f,s),c=f.callback.apply(h,v);if(i.afterEmit(i.context,f,s),c===!1)s.stopPropagation(),s.preventDefault()}};for(var l=0;l<n;l++)o();if(i.bubble(i.context)&&!s.isPropagationStopped())i.parent(i.context).emit(s,e)},t),this.emitting--,this};var bp={qualifierCompare:function(e,r){if(e==null||r==null)return e==null&&r==null;else return e.sameText(r)},eventMatches:function(e,r,a){var n=r.qualifier;if(n!=null)return e!==a.target&&Za(a.target)&&n.matches(a.target);return!0},addEventFields:function(e,r){r.cy=e.cy(),r.target=e},callbackContext:function(e,r,a){return r.qualifier!=null?a.target:e},beforeEmit:function(e,r){if(r.conf&&r.conf.once)r.conf.onceCollection.removeListener(r.event,r.qualifier,r.callback)},bubble:function(){return!0},parent:function(e){return e.isChild()?e.parent():e.cy()}},bn=function(e){if(Re(e))return new Sr(e);else return e},pv={createEmitter:function(){for(var e=0;e<this.length;e++){var r=this[e],a=r._private;if(!a.emitter)a.emitter=new ii(bp,r)}return this},emitter:function(){return this._private.emitter},on:function(e,r,a){var n=bn(r);for(var i=0;i<this.length;i++){var s=this[i];s.emitter().on(e,n,a)}return this},removeListener:function(e,r,a){var n=bn(r);for(var i=0;i<this.length;i++){var s=this[i];s.emitter().removeListener(e,n,a)}return this},removeAllListeners:function(){for(var e=0;e<this.length;e++){var r=this[e];r.emitter().removeAllListeners()}return this},one:function(e,r,a){var n=bn(r);for(var i=0;i<this.length;i++){var s=this[i];s.emitter().one(e,n,a)}return this},once:function(e,r,a){var n=bn(r);for(var i=0;i<this.length;i++){var s=this[i];s.emitter().on(e,n,a,{once:!0,onceCollection:this})}},emit:function(e,r){for(var a=0;a<this.length;a++){var n=this[a];n.emitter().emit(e,r)}return this},emitAndNotify:function(e,r){if(this.length===0)return;return this.cy().notify(e,this),this.emit(e,r),this}};Ze.eventAliasesOn(pv);var yv={nodes:function(e){return this.filter(function(r){return r.isNode()}).filter(e)},edges:function(e){return this.filter(function(r){return r.isEdge()}).filter(e)},byGroup:function(){var e=this.spawn(),r=this.spawn();for(var a=0;a<this.length;a++){var n=this[a];if(n.isNode())e.push(n);else r.push(n)}return{nodes:e,edges:r}},filter:function(e,r){if(e===void 0)return this;else if(Re(e)||zt(e))return new Sr(e).filter(this);else if(st(e)){var a=this.spawn(),n=this;for(var i=0;i<n.length;i++){var s=n[i],o=r?e.apply(r,[s,i,n]):e(s,i,n);if(o)a.push(s)}return a}return this.spawn()},not:function(e){if(!e)return this;else{if(Re(e))e=this.filter(e);var r=this.spawn();for(var a=0;a<this.length;a++){var n=this[a],i=e.has(n);if(!i)r.push(n)}return r}},absoluteComplement:function(){var e=this.cy();return e.mutableElements().not(this)},intersect:function(e){if(Re(e)){var r=e;return this.filter(r)}var a=this.spawn(),n=this,i=e,s=this.length<e.length,o=s?n:i,l=s?i:n;for(var u=0;u<o.length;u++){var f=o[u];if(l.has(f))a.push(f)}return a},xor:function(e){var r=this._private.cy;if(Re(e))e=r.$(e);var a=this.spawn(),n=this,i=e,s=function(l,u){for(var f=0;f<l.length;f++){var v=l[f],h=v._private.data.id,c=u.hasElementWithId(h);if(!c)a.push(v)}};return s(n,i),s(i,n),a},diff:function(e){var r=this._private.cy;if(Re(e))e=r.$(e);var a=this.spawn(),n=this.spawn(),i=this.spawn(),s=this,o=e,l=function(f,v,h){for(var c=0;c<f.length;c++){var d=f[c],g=d._private.data.id,y=v.hasElementWithId(g);if(y)i.merge(d);else h.push(d)}};return l(s,o,a),l(o,s,n),{left:a,right:n,both:i}},add:function(e){var r=this._private.cy;if(!e)return this;if(Re(e)){var a=e;e=r.mutableElements().filter(a)}var n=this.spawnSelf();for(var i=0;i<e.length;i++){var s=e[i],o=!this.has(s);if(o)n.push(s)}return n},merge:function(e){var r=this._private,a=r.cy;if(!e)return this;if(e&&Re(e)){var n=e;e=a.mutableElements().filter(n)}var i=r.map;for(var s=0;s<e.length;s++){var o=e[s],l=o._private.data.id,u=!i.has(l);if(u){var f=this.length++;this[f]=o,i.set(l,{ele:o,index:f})}}return this},unmergeAt:function(e){var r=this[e],a=r.id(),n=this._private,i=n.map;this[e]=void 0,i.delete(a);var s=e===this.length-1;if(this.length>1&&!s){var o=this.length-1,l=this[o],u=l._private.data.id;this[o]=void 0,this[e]=l,i.set(u,{ele:l,index:e})}return this.length--,this},unmergeOne:function(e){e=e[0];var r=this._private,a=e._private.data.id,n=r.map,i=n.get(a);if(!i)return this;var s=i.index;return this.unmergeAt(s),this},unmerge:function(e){var r=this._private.cy;if(!e)return this;if(e&&Re(e)){var a=e;e=r.mutableElements().filter(a)}for(var n=0;n<e.length;n++)this.unmergeOne(e[n]);return this},unmergeBy:function(e){for(var r=this.length-1;r>=0;r--){var a=this[r];if(e(a))this.unmergeAt(r)}return this},map:function(e,r){var a=[],n=this;for(var i=0;i<n.length;i++){var s=n[i],o=r?e.apply(r,[s,i,n]):e(s,i,n);a.push(o)}return a},reduce:function(e,r){var a=r,n=this;for(var i=0;i<n.length;i++)a=e(a,n[i],i,n);return a},max:function(e,r){var a=-1/0,n,i=this;for(var s=0;s<i.length;s++){var o=i[s],l=r?e.apply(r,[o,s,i]):e(o,s,i);if(l>a)a=l,n=o}return{value:a,ele:n}},min:function(e,r){var a=1/0,n,i=this;for(var s=0;s<i.length;s++){var o=i[s],l=r?e.apply(r,[o,s,i]):e(o,s,i);if(l<a)a=l,n=o}return{value:a,ele:n}}},$e=yv;$e.u=$e["|"]=$e["+"]=$e.union=$e.or=$e.add;$e["\\"]=$e["!"]=$e["-"]=$e.difference=$e.relativeComplement=$e.subtract=$e.not;$e.n=$e["&"]=$e["."]=$e.and=$e.intersection=$e.intersect;$e["^"]=$e["(+)"]=$e["(-)"]=$e.symmetricDifference=$e.symdiff=$e.xor;$e.fnFilter=$e.filterFn=$e.stdFilter=$e.filter;$e.complement=$e.abscomp=$e.absoluteComplement;var wp={isNode:function(){return this.group()==="nodes"},isEdge:function(){return this.group()==="edges"},isLoop:function(){return this.isEdge()&&this.source()[0]===this.target()[0]},isSimple:function(){return this.isEdge()&&this.source()[0]!==this.target()[0]},group:function(){var e=this[0];if(e)return e._private.group}},mv=function(e,r){var a=e.cy(),n=a.hasCompoundNodes();function i(f){var v=f.pstyle("z-compound-depth");if(v.value==="auto")return n?f.zDepth():0;else if(v.value==="bottom")return-1;else if(v.value==="top")return go;return 0}var s=i(e)-i(r);if(s!==0)return s;function o(f){var v=f.pstyle("z-index-compare");if(v.value==="auto")return f.isNode()?1:0;return 0}var l=o(e)-o(r);if(l!==0)return l;var u=e.pstyle("z-index").value-r.pstyle("z-index").value;if(u!==0)return u;return e.poolIndex()-r.poolIndex()},Hn={forEach:function(e,r){if(st(e)){var a=this.length;for(var n=0;n<a;n++){var i=this[n],s=r?e.apply(r,[i,n,this]):e(i,n,this);if(s===!1)break}}return this},toArray:function(){var e=[];for(var r=0;r<this.length;r++)e.push(this[r]);return e},slice:function(e,r){var a=[],n=this.length;if(r==null)r=n;if(e==null)e=0;if(e<0)e=n+e;if(r<0)r=n+r;for(var i=e;i>=0&&i<r&&i<n;i++)a.push(this[i]);return this.spawn(a)},size:function(){return this.length},eq:function(e){return this[e]||this.spawn()},first:function(){return this[0]||this.spawn()},last:function(){return this[this.length-1]||this.spawn()},empty:function(){return this.length===0},nonempty:function(){return!this.empty()},sort:function(e){if(!st(e))return this;var r=this.toArray().sort(e);return this.spawn(r)},sortByZIndex:function(){return this.sort(mv)},zDepth:function(){var e=this[0];if(!e)return;var r=e._private,a=r.group;if(a==="nodes"){var n=r.data.parent?e.parents().size():0;if(!e.isParent())return go-1;return n}else{var{source:i,target:s}=r,o=i.zDepth(),l=s.zDepth();return Math.max(o,l,0)}}};Hn.each=Hn.forEach;var Ep=function(){var e="undefined",r=(typeof Symbol>"u"?"undefined":pt(Symbol))!=e&&pt(Symbol.iterator)!=e;if(r)Hn[Symbol.iterator]=function(){var a=this,n={value:void 0,done:!1},i=0,s=this.length;return df({next:function(){if(i<s)n.value=a[i++];else n.value=void 0,n.done=!0;return n}},Symbol.iterator,function(){return this})}};Ep();var xp=St({nodeDimensionsIncludeLabels:!1}),Mn={layoutDimensions:function(e){e=xp(e);var r;if(!this.takesUpSpace())r={w:0,h:0};else if(e.nodeDimensionsIncludeLabels){var a=this.boundingBox();r={w:a.w,h:a.h}}else r={w:this.outerWidth(),h:this.outerHeight()};if(r.w===0||r.h===0)r.w=r.h=1;return r},layoutPositions:function(e,r,a){var n=this.nodes().filter(function(A){return!A.isParent()}),i=this.cy(),s=r.eles,o=function(M){return M.id()},l=la(a,o);e.emit({type:"layoutstart",layout:e}),e.animations=[];var u=function(M,S,P){var N={x:S.x1+S.w/2,y:S.y1+S.h/2},R={x:(P.x-N.x)*M,y:(P.y-N.y)*M};return{x:N.x+R.x,y:N.y+R.y}},f=r.spacingFactor&&r.spacingFactor!==1,v=function(){if(!f)return null;var M=Ot();for(var S=0;S<n.length;S++){var P=n[S],N=l(P,S);kf(M,N.x,N.y)}return M},h=v(),c=la(function(A,M){var S=l(A,M);if(f){var P=Math.abs(r.spacingFactor);S=u(P,h,S)}if(r.transform!=null)S=r.transform(A,S);return S},o);if(r.animate){for(var d=0;d<n.length;d++){var g=n[d],y=c(g,d),p=r.animateFilter==null||r.animateFilter(g,d);if(p){var m=g.animation({position:y,duration:r.animationDuration,easing:r.animationEasing});e.animations.push(m)}else g.position(y)}if(r.fit){var b=i.animation({fit:{boundingBox:s.boundingBoxAt(c),padding:r.padding},duration:r.animationDuration,easing:r.animationEasing});e.animations.push(b)}else if(r.zoom!==void 0&&r.pan!==void 0){var E=i.animation({zoom:r.zoom,pan:r.pan,duration:r.animationDuration,easing:r.animationEasing});e.animations.push(E)}e.animations.forEach(function(A){return A.play()}),e.one("layoutready",r.ready),e.emit({type:"layoutready",layout:e}),ga.all(e.animations.map(function(A){return A.promise()})).then(function(){e.one("layoutstop",r.stop),e.emit({type:"layoutstop",layout:e})})}else{if(n.positions(c),r.fit)i.fit(r.eles,r.padding);if(r.zoom!=null)i.zoom(r.zoom);if(r.pan)i.pan(r.pan);e.one("layoutready",r.ready),e.emit({type:"layoutready",layout:e}),e.one("layoutstop",r.stop),e.emit({type:"layoutstop",layout:e})}return this},layout:function(e){var r=this.cy();return r.makeLayout(Oe({},e,{eles:this}))}};Mn.createLayout=Mn.makeLayout=Mn.layout;function bv(t,e,r){var a=r._private,n=a.styleCache=a.styleCache||[],i;if((i=n[t])!=null)return i;else return i=n[t]=e(r),i}function si(t,e){return t=Gr(t),function(a){return bv(t,e,a)}}function oi(t,e){t=Gr(t);var r=function(n){return e.call(n)};return function(){var n=this[0];if(n)return bv(t,r,n)}}var Tt={recalculateRenderedStyle:function(e){var r=this.cy(),a=r.renderer(),n=r.styleEnabled();if(a&&n)a.recalculateRenderedStyle(this,e);return this},dirtyStyleCache:function(){var e=this.cy(),r=function(i){return i._private.styleCache=null};if(e.hasCompoundNodes()){var a=this.spawnSelf().merge(this.descendants()).merge(this.parents());a.merge(a.connectedEdges()),a.forEach(r)}else this.forEach(function(n){r(n),n.connectedEdges().forEach(r)});return this},updateStyle:function(e){var r=this._private.cy;if(!r.styleEnabled())return this;if(r.batching()){var a=r._private.batchStyleEles;return a.merge(this),this}var n=r.hasCompoundNodes(),i=this;if(e=e||e===void 0?!0:!1,n)i=this.spawnSelf().merge(this.descendants()).merge(this.parents());var s=i;if(e)s.emitAndNotify("style");else s.emit("style");return i.forEach(function(o){return o._private.styleDirty=!0}),this},cleanStyle:function(){var e=this.cy();if(!e.styleEnabled())return;for(var r=0;r<this.length;r++){var a=this[r];if(a._private.styleDirty)a._private.styleDirty=!1,e.style().apply(a)}},parsedStyle:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,a=this[0],n=a.cy();if(!n.styleEnabled())return;if(a){if(a._private.styleDirty)a._private.styleDirty=!1,n.style().apply(a);var i=a._private.style[e];if(i!=null)return i;else if(r)return n.style().getDefaultProperty(e);else return null}},numericStyle:function(e){var r=this[0];if(!r.cy().styleEnabled())return;if(r){var a=r.pstyle(e);return a.pfValue!==void 0?a.pfValue:a.value}},numericStyleUnits:function(e){var r=this[0];if(!r.cy().styleEnabled())return;if(r)return r.pstyle(e).units},renderedStyle:function(e){var r=this.cy();if(!r.styleEnabled())return this;var a=this[0];if(a)return r.style().getRenderedStyle(a,e)},style:function(e,r){var a=this.cy();if(!a.styleEnabled())return this;var n=!1,i=a.style();if(We(e)){var s=e;i.applyBypass(this,s,n),this.emitAndNotify("style")}else if(Re(e))if(r===void 0){var o=this[0];if(o)return i.getStylePropertyValue(o,e);else return}else i.applyBypass(this,e,r,n),this.emitAndNotify("style");else if(e===void 0){var l=this[0];if(l)return i.getRawStyle(l);else return}return this},removeStyle:function(e){var r=this.cy();if(!r.styleEnabled())return this;var a=!1,n=r.style(),i=this;if(e===void 0)for(var s=0;s<i.length;s++){var o=i[s];n.removeAllBypasses(o,a)}else{e=e.split(/\s+/);for(var l=0;l<i.length;l++){var u=i[l];n.removeBypasses(u,e,a)}}return this.emitAndNotify("style"),this},show:function(){return this.css("display","element"),this},hide:function(){return this.css("display","none"),this},effectiveOpacity:function(){var e=this.cy();if(!e.styleEnabled())return 1;var r=e.hasCompoundNodes(),a=this[0];if(a){var n=a._private,i=a.pstyle("opacity").value;if(!r)return i;var s=!n.data.parent?null:a.parents();if(s)for(var o=0;o<s.length;o++){var l=s[o],u=l.pstyle("opacity").value;i=u*i}return i}},transparent:function(){var e=this.cy();if(!e.styleEnabled())return!1;var r=this[0],a=r.cy().hasCompoundNodes();if(r)if(!a)return r.pstyle("opacity").value===0;else return r.effectiveOpacity()===0},backgrounding:function(){var e=this.cy();if(!e.styleEnabled())return!1;var r=this[0];return r._private.backgrounding?!0:!1}};function Is(t,e){var r=t._private,a=r.data.parent?t.parents():null;if(a)for(var n=0;n<a.length;n++){var i=a[n];if(!e(i))return!1}return!0}function Ao(t){var e=t.ok,r=t.edgeOkViaNode||t.ok,a=t.parentOk||t.ok;return function(){var n=this.cy();if(!n.styleEnabled())return!0;var i=this[0],s=n.hasCompoundNodes();if(i){var o=i._private;if(!e(i))return!1;if(i.isNode())return!s||Is(i,a);else{var{source:l,target:u}=o;return r(l)&&(!s||Is(l,r))&&(l===u||r(u)&&(!s||Is(u,r)))}}}}var pa=si("eleTakesUpSpace",function(t){return t.pstyle("display").value==="element"&&t.width()!==0&&(t.isNode()?t.height()!==0:!0)});Tt.takesUpSpace=oi("takesUpSpace",Ao({ok:pa}));var Tp=si("eleInteractive",function(t){return t.pstyle("events").value==="yes"&&t.pstyle("visibility").value==="visible"&&pa(t)}),Cp=si("parentInteractive",function(t){return t.pstyle("visibility").value==="visible"&&pa(t)});Tt.interactive=oi("interactive",Ao({ok:Tp,parentOk:Cp,edgeOkViaNode:pa}));Tt.noninteractive=function(){var t=this[0];if(t)return!t.interactive()};var Sp=si("eleVisible",function(t){return t.pstyle("visibility").value==="visible"&&t.pstyle("opacity").pfValue!==0&&pa(t)}),Dp=pa;Tt.visible=oi("visible",Ao({ok:Sp,edgeOkViaNode:Dp}));Tt.hidden=function(){var t=this[0];if(t)return!t.visible()};Tt.isBundledBezier=oi("isBundledBezier",function(){if(!this.cy().styleEnabled())return!1;return!this.removed()&&this.pstyle("curve-style").value==="bezier"&&this.takesUpSpace()});Tt.bypass=Tt.css=Tt.style;Tt.renderedCss=Tt.renderedStyle;Tt.removeBypass=Tt.removeCss=Tt.removeStyle;Tt.pstyle=Tt.parsedStyle;var Er={};function Ll(t){return function(){var e=arguments,r=[];if(e.length===2){var a=e[0],n=e[1];this.on(t.event,a,n)}else if(e.length===1&&st(e[0])){var i=e[0];this.on(t.event,i)}else if(e.length===0||e.length===1&&Je(e[0])){var s=e.length===1?e[0]:null;for(var o=0;o<this.length;o++){var l=this[o],u=!t.ableField||l._private[t.ableField],f=l._private[t.field]!=t.value;if(t.overrideAble){var v=t.overrideAble(l);if(v!==void 0){if(u=v,!v)return this}}if(u){if(l._private[t.field]=t.value,f)r.push(l)}}var h=this.spawn(r);if(h.updateStyle(),h.emit(t.event),s)h.emit(s)}return this}}function ya(t){Er[t.field]=function(){var e=this[0];if(e){if(t.overrideField){var r=t.overrideField(e);if(r!==void 0)return r}return e._private[t.field]}},Er[t.on]=Ll({event:t.on,field:t.field,ableField:t.ableField,overrideAble:t.overrideAble,value:!0}),Er[t.off]=Ll({event:t.off,field:t.field,ableField:t.ableField,overrideAble:t.overrideAble,value:!1})}ya({field:"locked",overrideField:function(e){return e.cy().autolock()?!0:void 0},on:"lock",off:"unlock"});ya({field:"grabbable",overrideField:function(e){return e.cy().autoungrabify()||e.pannable()?!1:void 0},on:"grabify",off:"ungrabify"});ya({field:"selected",ableField:"selectable",overrideAble:function(e){return e.cy().autounselectify()?!1:void 0},on:"select",off:"unselect"});ya({field:"selectable",overrideField:function(e){return e.cy().autounselectify()?!1:void 0},on:"selectify",off:"unselectify"});Er.deselect=Er.unselect;Er.grabbed=function(){var t=this[0];if(t)return t._private.grabbed};ya({field:"active",on:"activate",off:"unactivate"});ya({field:"pannable",on:"panify",off:"unpanify"});Er.inactive=function(){var t=this[0];if(t)return!t._private.active};var At={},Rl=function(e){return function(a){var n=this,i=[];for(var s=0;s<n.length;s++){var o=n[s];if(!o.isNode())continue;var l=!1,u=o.connectedEdges();for(var f=0;f<u.length;f++){var v=u[f],h=v.source(),c=v.target();if(e.noIncomingEdges&&c===o&&h!==o||e.noOutgoingEdges&&h===o&&c!==o){l=!0;break}}if(!l)i.push(o)}return this.spawn(i,!0).filter(a)}},Pl=function(e){return function(r){var a=this,n=[];for(var i=0;i<a.length;i++){var s=a[i];if(!s.isNode())continue;var o=s.connectedEdges();for(var l=0;l<o.length;l++){var u=o[l],f=u.source(),v=u.target();if(e.outgoing&&f===s)n.push(u),n.push(v);else if(e.incoming&&v===s)n.push(u),n.push(f)}}return this.spawn(n,!0).filter(r)}},Nl=function(e){return function(r){var a=this,n=[],i={};for(;;){var s=e.outgoing?a.outgoers():a.incomers();if(s.length===0)break;var o=!1;for(var l=0;l<s.length;l++){var u=s[l],f=u.id();if(!i[f])i[f]=!0,n.push(u),o=!0}if(!o)break;a=s}return this.spawn(n,!0).filter(r)}};At.clearTraversalCache=function(){for(var t=0;t<this.length;t++)this[t]._private.traversalCache=null};Oe(At,{roots:Rl({noIncomingEdges:!0}),leaves:Rl({noOutgoingEdges:!0}),outgoers:Ht(Pl({outgoing:!0}),"outgoers"),successors:Nl({outgoing:!0}),incomers:Ht(Pl({incoming:!0}),"incomers"),predecessors:Nl({})});Oe(At,{neighborhood:Ht(function(t){var e=[],r=this.nodes();for(var a=0;a<r.length;a++){var n=r[a],i=n.connectedEdges();for(var s=0;s<i.length;s++){var o=i[s],l=o.source(),u=o.target(),f=n===l?u:l;if(f.length>0)e.push(f[0]);e.push(o[0])}}return this.spawn(e,!0).filter(t)},"neighborhood"),closedNeighborhood:function(e){return this.neighborhood().add(this).filter(e)},openNeighborhood:function(e){return this.neighborhood(e)}});At.neighbourhood=At.neighborhood;At.closedNeighbourhood=At.closedNeighborhood;At.openNeighbourhood=At.openNeighborhood;Oe(At,{source:Ht(function(e){var r=this[0],a;if(r)a=r._private.source||r.cy().collection();return a&&e?a.filter(e):a},"source"),target:Ht(function(e){var r=this[0],a;if(r)a=r._private.target||r.cy().collection();return a&&e?a.filter(e):a},"target"),sources:Ol({attr:"source"}),targets:Ol({attr:"target"})});function Ol(t){return function(r){var a=[];for(var n=0;n<this.length;n++){var i=this[n],s=i._private[t.attr];if(s)a.push(s)}return this.spawn(a,!0).filter(r)}}Oe(At,{edgesWith:Ht(Il(),"edgesWith"),edgesTo:Ht(Il({thisIsSrc:!0}),"edgesTo")});function Il(t){return function(r){var a=[],n=this._private.cy,i=t||{};if(Re(r))r=n.$(r);for(var s=0;s<r.length;s++){var o=r[s]._private.edges;for(var l=0;l<o.length;l++){var u=o[l],f=u._private.data,v=this.hasElementWithId(f.source)&&r.hasElementWithId(f.target),h=r.hasElementWithId(f.source)&&this.hasElementWithId(f.target),c=v||h;if(!c)continue;if(i.thisIsSrc||i.thisIsTgt){if(i.thisIsSrc&&!v)continue;if(i.thisIsTgt&&!h)continue}a.push(u)}}return this.spawn(a,!0)}}Oe(At,{connectedEdges:Ht(function(t){var e=[],r=this;for(var a=0;a<r.length;a++){var n=r[a];if(!n.isNode())continue;var i=n._private.edges;for(var s=0;s<i.length;s++){var o=i[s];e.push(o)}}return this.spawn(e,!0).filter(t)},"connectedEdges"),connectedNodes:Ht(function(t){var e=[],r=this;for(var a=0;a<r.length;a++){var n=r[a];if(!n.isEdge())continue;e.push(n.source()[0]),e.push(n.target()[0])}return this.spawn(e,!0).filter(t)},"connectedNodes"),parallelEdges:Ht(Bl(),"parallelEdges"),codirectedEdges:Ht(Bl({codirected:!0}),"codirectedEdges")});function Bl(t){var e={codirected:!1};return t=Oe({},e,t),function(a){var n=[],i=this.edges(),s=t;for(var o=0;o<i.length;o++){var l=i[o],u=l._private,f=u.source,v=f._private.data.id,h=u.data.target,c=f._private.edges;for(var d=0;d<c.length;d++){var g=c[d],y=g._private.data,{target:p,source:m}=y,b=p===h&&m===v,E=v===p&&h===m;if(s.codirected&&b||!s.codirected&&(b||E))n.push(g)}}return this.spawn(n,!0).filter(a)}}Oe(At,{components:function(e){var r=this,a=r.cy(),n=a.collection(),i=e==null?r.nodes():e.nodes(),s=[];if(e!=null&&i.empty())i=e.sources();var o=function(f,v){n.merge(f),i.unmerge(f),v.merge(f)};if(i.empty())return r.spawn();var l=function(){var f=a.collection();s.push(f);var v=i[0];o(v,f),r.bfs({directed:!1,roots:v,visit:function(c){return o(c,f)}}),f.forEach(function(h){h.connectedEdges().forEach(function(c){if(r.has(c)&&f.has(c.source())&&f.has(c.target()))f.merge(c)})})};do l();while(i.length>0);return s},component:function(){var e=this[0];return e.cy().mutableElements().components(e)[0]}});At.componentsOf=At.components;var Ct=function(e,r){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(e===void 0){it("A collection must have a reference to the core");return}var i=new nr,s=!1;if(!r)r=[];else if(r.length>0&&We(r[0])&&!Za(r[0])){s=!0;var o=[],l=new da;for(var u=0,f=r.length;u<f;u++){var v=r[u];if(v.data==null)v.data={};var h=v.data;if(h.id==null)h.id=Nf();else if(e.hasElementWithId(h.id)||l.has(h.id))continue;var c=new Qn(e,v,!1);o.push(c),l.add(h.id)}r=o}this.length=0;for(var d=0,g=r.length;d<g;d++){var y=r[d][0];if(y==null)continue;var p=y._private.data.id;if(!a||!i.has(p)){if(a)i.set(p,{index:this.length,ele:y});this[this.length]=y,this.length++}}if(this._private={eles:this,cy:e,get map(){if(this.lazyMap==null)this.rebuildMap();return this.lazyMap},set map(m){this.lazyMap=m},rebuildMap:function(){var b=this.lazyMap=new nr,E=this.eles;for(var A=0;A<E.length;A++){var M=E[A];b.set(M.id(),{index:A,ele:M})}}},a)this._private.map=i;if(s&&!n)this.restore()},et=Qn.prototype=Ct.prototype=Object.create(Array.prototype);et.instanceString=function(){return"collection"};et.spawn=function(t,e){return new Ct(this.cy(),t,e)};et.spawnSelf=function(){return this.spawn(this)};et.cy=function(){return this._private.cy};et.renderer=function(){return this._private.cy.renderer()};et.element=function(){return this[0]};et.collection=function(){if(mf(this))return this;else return new Ct(this._private.cy,[this])};et.unique=function(){return new Ct(this._private.cy,this,!0)};et.hasElementWithId=function(t){return t=""+t,this._private.map.has(t)};et.getElementById=function(t){t=""+t;var e=this._private.cy,r=this._private.map.get(t);return r?r.ele:new Ct(e)};et.$id=et.getElementById;et.poolIndex=function(){var t=this._private.cy,e=t._private.elements,r=this[0]._private.data.id;return e._private.map.get(r).index};et.indexOf=function(t){var e=t[0]._private.data.id;return this._private.map.get(e).index};et.indexOfId=function(t){return t=""+t,this._private.map.get(t).index};et.json=function(t){var e=this.element(),r=this.cy();if(e==null&&t)return this;if(e==null)return;var a=e._private;if(We(t)){if(r.startBatch(),t.data){e.data(t.data);var n=a.data;if(e.isEdge()){var i=!1,s={},o=t.data.source,l=t.data.target;if(o!=null&&o!=n.source)s.source=""+o,i=!0;if(l!=null&&l!=n.target)s.target=""+l,i=!0;if(i)e=e.move(s)}else{var u="parent"in t.data,f=t.data.parent;if(u&&(f!=null||n.parent!=null)&&f!=n.parent){if(f===void 0)f=null;if(f!=null)f=""+f;e=e.move({parent:f})}}}if(t.position)e.position(t.position);var v=function(g,y,p){var m=t[g];if(m!=null&&m!==a[g])if(m)e[y]();else e[p]()};if(v("removed","remove","restore"),v("selected","select","unselect"),v("selectable","selectify","unselectify"),v("locked","lock","unlock"),v("grabbable","grabify","ungrabify"),v("pannable","panify","unpanify"),t.classes!=null)e.classes(t.classes);return r.endBatch(),this}else if(t===void 0){var h={data:Jt(a.data),position:Jt(a.position),group:a.group,removed:a.removed,selected:a.selected,selectable:a.selectable,locked:a.locked,grabbable:a.grabbable,pannable:a.pannable,classes:null};h.classes="";var c=0;return a.classes.forEach(function(d){return h.classes+=c++===0?d:" "+d}),h}};et.jsons=function(){var t=[];for(var e=0;e<this.length;e++){var r=this[e],a=r.json();t.push(a)}return t};et.clone=function(){var t=this.cy(),e=[];for(var r=0;r<this.length;r++){var a=this[r],n=a.json(),i=new Qn(t,n,!1);e.push(i)}return new Ct(t,e)};et.copy=et.clone;et.restore=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=this,a=r.cy(),n=a._private,i=[],s=[],o;for(var l=0,u=r.length;l<u;l++){var f=r[l];if(e&&!f.removed())continue;if(f.isNode())i.push(f);else s.push(f)}o=i.concat(s);var v,h=function(){o.splice(v,1),v--};for(v=0;v<o.length;v++){var c=o[v],d=c._private,g=d.data;if(c.clearTraversalCache(),!e&&!d.removed);else if(g.id===void 0)g.id=Nf();else if(he(g.id))g.id=""+g.id;else if(xr(g.id)||!Re(g.id)){it("Can not create element with invalid string ID `"+g.id+"`"),h();continue}else if(a.hasElementWithId(g.id)){it("Can not create second element with ID `"+g.id+"`"),h();continue}var y=g.id;if(c.isNode()){var p=d.position;if(p.x==null)p.x=0;if(p.y==null)p.y=0}if(c.isEdge()){var m=c,b=["source","target"],E=b.length,A=!1;for(var M=0;M<E;M++){var S=b[M],P=g[S];if(he(P))P=g[S]=""+g[S];if(P==null||P==="")it("Can not create edge `"+y+"` with unspecified "+S),A=!0;else if(!a.hasElementWithId(P))it("Can not create edge `"+y+"` with nonexistent "+S+" `"+P+"`"),A=!0}if(A){h();continue}var N=a.getElementById(g.source),R=a.getElementById(g.target);if(N.same(R))N._private.edges.push(m);else N._private.edges.push(m),R._private.edges.push(m);m._private.source=N,m._private.target=R}if(d.map=new nr,d.map.set(y,{ele:c,index:0}),d.removed=!1,e)a.addToPool(c)}for(var I=0;I<i.length;I++){var w=i[I],x=w._private.data;if(he(x.parent))x.parent=""+x.parent;var T=x.parent,D=T!=null;if(D||w._private.parent){var C=w._private.parent?a.collection().merge(w._private.parent):a.getElementById(T);if(C.empty())x.parent=void 0;else if(C[0].removed())_e("Node added with missing parent, reference to parent removed"),x.parent=void 0,w._private.parent=null;else{var O=!1,B=C;while(!B.empty()){if(w.same(B)){O=!0,x.parent=void 0;break}B=B.parent()}if(!O)C[0]._private.children.push(w),w._private.parent=C[0],n.hasCompoundNodes=!0}}}if(o.length>0){var z=o.length===r.length?r:new Ct(a,o);for(var V=0;V<z.length;V++){var k=z[V];if(k.isNode())continue;k.parallelEdges().clearTraversalCache(),k.source().clearTraversalCache(),k.target().clearTraversalCache()}var G;if(n.hasCompoundNodes)G=a.collection().merge(z).merge(z.connectedNodes()).merge(z.parent());else G=z;if(G.dirtyCompoundBoundsCache().dirtyBoundingBoxCache().updateStyle(t),t)z.emitAndNotify("add");else if(e)z.emit("add")}return r};et.removed=function(){var t=this[0];return t&&t._private.removed};et.inside=function(){var t=this[0];return t&&!t._private.removed};et.remove=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=this,a=[],n={},i=r._private.cy;function s(T){var D=T._private.edges;for(var C=0;C<D.length;C++)l(D[C])}function o(T){var D=T._private.children;for(var C=0;C<D.length;C++)l(D[C])}function l(T){var D=n[T.id()];if(e&&T.removed()||D)return;else n[T.id()]=!0;if(T.isNode())a.push(T),s(T),o(T);else a.unshift(T)}for(var u=0,f=r.length;u<f;u++){var v=r[u];l(v)}function h(T,D){var C=T._private.edges;Tr(C,D),T.clearTraversalCache()}function c(T){T.clearTraversalCache()}var d=[];d.ids={};function g(T,D){D=D[0],T=T[0];var C=T._private.children,O=T.id();if(Tr(C,D),D._private.parent=null,!d.ids[O])d.ids[O]=!0,d.push(T)}if(r.dirtyCompoundBoundsCache(),e)i.removeFromPool(a);for(var y=0;y<a.length;y++){var p=a[y];if(p.isEdge()){var m=p.source()[0],b=p.target()[0];h(m,p),h(b,p);var E=p.parallelEdges();for(var A=0;A<E.length;A++){var M=E[A];if(c(M),M.isBundledBezier())M.dirtyBoundingBoxCache()}}else{var S=p.parent();if(S.length!==0)g(S,p)}if(e)p._private.removed=!0}var P=i._private.elements;i._private.hasCompoundNodes=!1;for(var N=0;N<P.length;N++){var R=P[N];if(R.isParent()){i._private.hasCompoundNodes=!0;break}}var I=new Ct(this.cy(),a);if(I.size()>0){if(t)I.emitAndNotify("remove");else if(e)I.emit("remove")}for(var w=0;w<d.length;w++){var x=d[w];if(!e||!x.removed())x.updateStyle()}return I};et.move=function(t){var e=this._private.cy,r=this,a=!1,n=!1,i=function(d){return d==null?d:""+d};if(t.source!==void 0||t.target!==void 0){var s=i(t.source),o=i(t.target),l=s!=null&&e.hasElementWithId(s),u=o!=null&&e.hasElementWithId(o);if(l||u)e.batch(function(){r.remove(a,n),r.emitAndNotify("moveout");for(var c=0;c<r.length;c++){var d=r[c],g=d._private.data;if(d.isEdge()){if(l)g.source=s;if(u)g.target=o}}r.restore(a,n)}),r.emitAndNotify("move")}else if(t.parent!==void 0){var f=i(t.parent),v=f===null||e.hasElementWithId(f);if(v){var h=f===null?void 0:f;e.batch(function(){var c=r.remove(a,n);c.emitAndNotify("moveout");for(var d=0;d<r.length;d++){var g=r[d],y=g._private.data;if(g.isNode())y.parent=h}c.restore(a,n)}),r.emitAndNotify("move")}}return this};[Xf,kg,An,wr,va,Jg,ni,gp,pv,yv,wp,Hn,Mn,Tt,Er,At].forEach(function(t){Oe(et,t)});var Ap={add:function(e){var r,a=this;if(zt(e)){var n=e;if(n._private.cy===a)r=n.restore();else{var i=[];for(var s=0;s<n.length;s++){var o=n[s];i.push(o.json())}r=new Ct(a,i)}}else if(Je(e)){var l=e;r=new Ct(a,l)}else if(We(e)&&(Je(e.nodes)||Je(e.edges))){var u=e,f=[],v=["nodes","edges"];for(var h=0,c=v.length;h<c;h++){var d=v[h],g=u[d];if(Je(g))for(var y=0,p=g.length;y<p;y++){var m=Oe({group:d},g[y]);f.push(m)}}r=new Ct(a,f)}else{var b=e;r=new Qn(a,b).collection()}return r},remove:function(e){if(zt(e));else if(Re(e)){var r=e;e=this.$(r)}return e.remove()}};/*! Bezier curve function generator. Copyright Gaetan Renaudeau. MIT License: http://en.wikipedia.org/wiki/MIT_License */function Mp(t,e,r,a){var n=4,i=0.001,s=0.0000001,o=10,l=11,u=1/(l-1),f=typeof Float32Array<"u";if(arguments.length!==4)return!1;for(var v=0;v<4;++v)if(typeof arguments[v]!=="number"||isNaN(arguments[v])||!isFinite(arguments[v]))return!1;t=Math.min(t,1),r=Math.min(r,1),t=Math.max(t,0),r=Math.max(r,0);var h=f?new Float32Array(l):Array(l);function c(R,I){return 1-3*I+3*R}function d(R,I){return 3*I-6*R}function g(R){return 3*R}function y(R,I,w){return((c(I,w)*R+d(I,w))*R+g(I))*R}function p(R,I,w){return 3*c(I,w)*R*R+2*d(I,w)*R+g(I)}function m(R,I){for(var w=0;w<n;++w){var x=p(I,t,r);if(x===0)return I;var T=y(I,t,r)-R;I-=T/x}return I}function b(){for(var R=0;R<l;++R)h[R]=y(R*u,t,r)}function E(R,I,w){var x,T,D=0;do if(T=I+(w-I)/2,x=y(T,t,r)-R,x>0)w=T;else I=T;while(Math.abs(x)>s&&++D<o);return T}function A(R){var I=0,w=1,x=l-1;for(;w!==x&&h[w]<=R;++w)I+=u;--w;var T=(R-h[w])/(h[w+1]-h[w]),D=I+T*u,C=p(D,t,r);if(C>=i)return m(R,D);else if(C===0)return D;else return E(R,I,I+u)}var M=!1;function S(){if(M=!0,t!==e||r!==a)b()}var P=function(I){if(!M)S();if(t===e&&r===a)return I;if(I===0)return 0;if(I===1)return 1;return y(A(I),e,a)};P.getControlPoints=function(){return[{x:t,y:e},{x:r,y:a}]};var N="generateBezier("+[t,e,r,a]+")";return P.toString=function(){return N},P}/*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License */var Lp=function(){function t(a){return-a.tension*a.x-a.friction*a.v}function e(a,n,i){var s={x:a.x+i.dx*n,v:a.v+i.dv*n,tension:a.tension,friction:a.friction};return{dx:s.v,dv:t(s)}}function r(a,n){var i={dx:a.v,dv:t(a)},s=e(a,n*0.5,i),o=e(a,n*0.5,s),l=e(a,n,o),u=0.16666666666666666*(i.dx+2*(s.dx+o.dx)+l.dx),f=0.16666666666666666*(i.dv+2*(s.dv+o.dv)+l.dv);return a.x=a.x+u*n,a.v=a.v+f*n,a}return function a(n,i,s){var o={x:-1,v:0,tension:null,friction:null},l=[0],u=0,f=0.0001,v=0.016,h,c,d;if(n=parseFloat(n)||500,i=parseFloat(i)||20,s=s||null,o.tension=n,o.friction=i,h=s!==null,h)u=a(n,i),c=u/s*v;else c=v;for(;;)if(d=r(d||o,c),l.push(1+d.x),u+=16,!(Math.abs(d.x)>f&&Math.abs(d.v)>f))break;return!h?u:function(g){return l[g*(l.length-1)|0]}}}(),je=function(e,r,a,n){var i=Mp(e,r,a,n);return function(s,o,l){return s+(o-s)*i(l)}},Ln={linear:function(e,r,a){return e+(r-e)*a},ease:je(0.25,0.1,0.25,1),"ease-in":je(0.42,0,1,1),"ease-out":je(0,0,0.58,1),"ease-in-out":je(0.42,0,0.58,1),"ease-in-sine":je(0.47,0,0.745,0.715),"ease-out-sine":je(0.39,0.575,0.565,1),"ease-in-out-sine":je(0.445,0.05,0.55,0.95),"ease-in-quad":je(0.55,0.085,0.68,0.53),"ease-out-quad":je(0.25,0.46,0.45,0.94),"ease-in-out-quad":je(0.455,0.03,0.515,0.955),"ease-in-cubic":je(0.55,0.055,0.675,0.19),"ease-out-cubic":je(0.215,0.61,0.355,1),"ease-in-out-cubic":je(0.645,0.045,0.355,1),"ease-in-quart":je(0.895,0.03,0.685,0.22),"ease-out-quart":je(0.165,0.84,0.44,1),"ease-in-out-quart":je(0.77,0,0.175,1),"ease-in-quint":je(0.755,0.05,0.855,0.06),"ease-out-quint":je(0.23,1,0.32,1),"ease-in-out-quint":je(0.86,0,0.07,1),"ease-in-expo":je(0.95,0.05,0.795,0.035),"ease-out-expo":je(0.19,1,0.22,1),"ease-in-out-expo":je(1,0,0,1),"ease-in-circ":je(0.6,0.04,0.98,0.335),"ease-out-circ":je(0.075,0.82,0.165,1),"ease-in-out-circ":je(0.785,0.135,0.15,0.86),spring:function(e,r,a){if(a===0)return Ln.linear;var n=Lp(e,r,a);return function(i,s,o){return i+(s-i)*n(o)}},"cubic-bezier":je};function kl(t,e,r,a,n){if(a===1)return r;if(e===r)return r;var i=n(e,r,a);if(t==null)return i;if(t.roundValue||t.color)i=Math.round(i);if(t.min!==void 0)i=Math.max(i,t.min);if(t.max!==void 0)i=Math.min(i,t.max);return i}function Fl(t,e){if(t.pfValue!=null||t.value!=null)if(t.pfValue!=null&&(e==null||e.type.units!=="%"))return t.pfValue;else return t.value;else return t}function _r(t,e,r,a,n){var i=n!=null?n.type:null;if(r<0)r=0;else if(r>1)r=1;var s=Fl(t,n),o=Fl(e,n);if(he(s)&&he(o))return kl(i,s,o,r,a);else if(Je(s)&&Je(o)){var l=[];for(var u=0;u<o.length;u++){var f=s[u],v=o[u];if(f!=null&&v!=null){var h=kl(i,f,v,r,a);l.push(h)}else l.push(v)}return l}return}function Rp(t,e,r,a){var n=!a,i=t._private,s=e._private,{easing:o,startTime:l}=s,u=a?t:t.cy(),f=u.style();if(!s.easingImpl)if(o==null)s.easingImpl=Ln.linear;else{var v;if(Re(o)){var h=f.parse("transition-timing-function",o);v=h.value}else v=o;var c,d;if(Re(v))c=v,d=[];else c=v[1],d=v.slice(2).map(function(z){return+z});if(d.length>0){if(c==="spring")d.push(s.duration);s.easingImpl=Ln[c].apply(null,d)}else s.easingImpl=Ln[c]}var g=s.easingImpl,y;if(s.duration===0)y=1;else y=(r-l)/s.duration;if(s.applying)y=s.progress;if(y<0)y=0;else if(y>1)y=1;if(s.delay==null){var{startPosition:p,position:m}=s;if(m&&n&&!t.locked()){var b={};if(Ma(p.x,m.x))b.x=_r(p.x,m.x,y,g);if(Ma(p.y,m.y))b.y=_r(p.y,m.y,y,g);t.position(b)}var{startPan:E,pan:A}=s,M=i.pan,S=A!=null&&a;if(S){if(Ma(E.x,A.x))M.x=_r(E.x,A.x,y,g);if(Ma(E.y,A.y))M.y=_r(E.y,A.y,y,g);t.emit("pan")}var{startZoom:P,zoom:N}=s,R=N!=null&&a;if(R){if(Ma(P,N))i.zoom=Ua(i.minZoom,_r(P,N,y,g),i.maxZoom);t.emit("zoom")}if(S||R)t.emit("viewport");var I=s.style;if(I&&I.length>0&&n){for(var w=0;w<I.length;w++){var x=I[w],T=x.name,D=x,C=s.startStyle[T],O=f.properties[C.name],B=_r(C,D,y,g,O);f.overrideBypass(t,T,B)}t.emit("style")}}return s.progress=y,y}function Ma(t,e){if(t==null||e==null)return!1;if(he(t)&&he(e))return!0;else if(t&&e)return!0;return!1}function Pp(t,e,r,a){var n=e._private;n.started=!0,n.startTime=r-n.progress*n.duration}function zl(t,e){var r=e._private.aniEles,a=[];function n(f,v){var h=f._private,c=h.animation.current,d=h.animation.queue,g=!1;if(c.length===0){var y=d.shift();if(y)c.push(y)}var p=function(M){for(var S=M.length-1;S>=0;S--){var P=M[S];P()}M.splice(0,M.length)};for(var m=c.length-1;m>=0;m--){var b=c[m],E=b._private;if(E.stopped){c.splice(m,1),E.hooked=!1,E.playing=!1,E.started=!1,p(E.frames);continue}if(!E.playing&&!E.applying)continue;if(E.playing&&E.applying)E.applying=!1;if(!E.started)Pp(f,b,t);if(Rp(f,b,t,v),E.applying)E.applying=!1;if(p(E.frames),E.step!=null)E.step(t);if(b.completed())c.splice(m,1),E.hooked=!1,E.playing=!1,E.started=!1,p(E.completes);g=!0}if(!v&&c.length===0&&d.length===0)a.push(f);return g}var i=!1;for(var s=0;s<r.length;s++){var o=r[s],l=n(o);i=i||l}var u=n(e,!0);if(i||u)if(r.length>0)e.notify("draw",r);else e.notify("draw");r.unmerge(a),e.emit("step")}var Np={animate:Ze.animate(),animation:Ze.animation(),animated:Ze.animated(),clearQueue:Ze.clearQueue(),delay:Ze.delay(),delayAnimation:Ze.delayAnimation(),stop:Ze.stop(),addToAnimationPool:function(e){var r=this;if(!r.styleEnabled())return;r._private.aniEles.merge(e)},stopAnimationLoop:function(){this._private.animationsRunning=!1},startAnimationLoop:function(){var e=this;if(e._private.animationsRunning=!0,!e.styleEnabled())return;function r(){if(!e._private.animationsRunning)return;Fn(function(i){zl(i,e),r()})}var a=e.renderer();if(a&&a.beforeRender)a.beforeRender(function(i,s){zl(s,e)},a.beforeRenderPriorities.animations);else r()}},Op={qualifierCompare:function(e,r){if(e==null||r==null)return e==null&&r==null;else return e.sameText(r)},eventMatches:function(e,r,a){var n=r.qualifier;if(n!=null)return e!==a.target&&Za(a.target)&&n.matches(a.target);return!0},addEventFields:function(e,r){r.cy=e,r.target=e},callbackContext:function(e,r,a){return r.qualifier!=null?a.target:e}},wn=function(e){if(Re(e))return new Sr(e);else return e},wv={createEmitter:function(){var e=this._private;if(!e.emitter)e.emitter=new ii(Op,this);return this},emitter:function(){return this._private.emitter},on:function(e,r,a){return this.emitter().on(e,wn(r),a),this},removeListener:function(e,r,a){return this.emitter().removeListener(e,wn(r),a),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,r,a){return this.emitter().one(e,wn(r),a),this},once:function(e,r,a){return this.emitter().one(e,wn(r),a),this},emit:function(e,r){return this.emitter().emit(e,r),this},emitAndNotify:function(e,r){return this.emit(e),this.notify(e,r),this}};Ze.eventAliasesOn(wv);var js={png:function(e){var r=this._private.renderer;return e=e||{},r.png(e)},jpg:function(e){var r=this._private.renderer;return e=e||{},e.bg=e.bg||"#fff",r.jpg(e)}};js.jpeg=js.jpg;var Rn={layout:function(e){var r=this;if(e==null){it("Layout options must be specified to make a layout");return}if(e.name==null){it("A `name` must be specified to make a layout");return}var a=e.name,n=r.extension("layout",a);if(n==null){it("No such layout `"+a+"` found. Did you forget to import it and `cytoscape.use()` it?");return}var i;if(Re(e.eles))i=r.$(e.eles);else i=e.eles!=null?e.eles:r.$();var s=new n(Oe({},e,{cy:r,eles:i}));return s}};Rn.createLayout=Rn.makeLayout=Rn.layout;var Ip={notify:function(e,r){var a=this._private;if(this.batching()){a.batchNotifications=a.batchNotifications||{};var n=a.batchNotifications[e]=a.batchNotifications[e]||this.collection();if(r!=null)n.merge(r);return}if(!a.notificationsEnabled)return;var i=this.renderer();if(this.destroyed()||!i)return;i.notify(e,r)},notifications:function(e){var r=this._private;if(e===void 0)return r.notificationsEnabled;else r.notificationsEnabled=e?!0:!1;return this},noNotifications:function(e){this.notifications(!1),e(),this.notifications(!0)},batching:function(){return this._private.batchCount>0},startBatch:function(){var e=this._private;if(e.batchCount==null)e.batchCount=0;if(e.batchCount===0)e.batchStyleEles=this.collection(),e.batchNotifications={};return e.batchCount++,this},endBatch:function(){var e=this._private;if(e.batchCount===0)return this;if(e.batchCount--,e.batchCount===0){e.batchStyleEles.updateStyle();var r=this.renderer();Object.keys(e.batchNotifications).forEach(function(a){var n=e.batchNotifications[a];if(n.empty())r.notify(a);else r.notify(a,n)})}return this},batch:function(e){return this.startBatch(),e(),this.endBatch(),this},batchData:function(e){var r=this;return this.batch(function(){var a=Object.keys(e);for(var n=0;n<a.length;n++){var i=a[n],s=e[i],o=r.getElementById(i);o.data(s)}})}},Bp=St({hideEdgesOnViewport:!1,textureOnViewport:!1,motionBlur:!1,motionBlurOpacity:0.05,pixelRatio:void 0,desktopTapThreshold:4,touchTapThreshold:8,wheelSensitivity:1,debug:!1,showFps:!1,webgl:!1,webglDebug:!1,webglDebugShowAtlases:!1,webglTexSize:2048,webglTexRows:36,webglTexRowsNodes:18,webglBatchSize:2048,webglTexPerBatch:14,webglBgColor:[255,255,255]}),eo={renderTo:function(e,r,a,n){var i=this._private.renderer;return i.renderTo(e,r,a,n),this},renderer:function(){return this._private.renderer},forceRender:function(){return this.notify("draw"),this},resize:function(){return this.invalidateSize(),this.emitAndNotify("resize"),this},initRenderer:function(e){var r=this,a=r.extension("renderer",e.name);if(a==null){it("Can not initialise: No such renderer `".concat(e.name,"` found. Did you forget to import it and `cytoscape.use()` it?"));return}if(e.wheelSensitivity!==void 0)_e("You have set a custom wheel sensitivity. This will make your app zoom unnaturally when using mainstream mice. You should change this value from the default only if you can guarantee that all your users will use the same hardware and OS configuration as your current machine.");var n=Bp(e);n.cy=r,r._private.renderer=new a(n),this.notify("init")},destroyRenderer:function(){var e=this;e.notify("destroy");var r=e.container();if(r){r._cyreg=null;while(r.childNodes.length>0)r.removeChild(r.childNodes[0])}e._private.renderer=null,e.mutableElements().forEach(function(a){var n=a._private;n.rscratch={},n.rstyle={},n.animation.current=[],n.animation.queue=[]})},onRender:function(e){return this.on("render",e)},offRender:function(e){return this.off("render",e)}};eo.invalidateDimensions=eo.resize;var Pn={collection:function(e,r){if(Re(e))return this.$(e);else if(zt(e))return e.collection();else if(Je(e)){if(!r)r={};return new Ct(this,e,r.unique,r.removed)}return new Ct(this)},nodes:function(e){var r=this.$(function(a){return a.isNode()});if(e)return r.filter(e);return r},edges:function(e){var r=this.$(function(a){return a.isEdge()});if(e)return r.filter(e);return r},$:function(e){var r=this._private.elements;if(e)return r.filter(e);else return r.spawnSelf()},mutableElements:function(){return this._private.elements}};Pn.elements=Pn.filter=Pn.$;var Et={},Ba="t",kp="f";Et.apply=function(t){var e=this,r=e._private,a=r.cy,n=a.collection();for(var i=0;i<t.length;i++){var s=t[i],o=e.getContextMeta(s);if(o.empty)continue;var l=e.getContextStyle(o),u=e.applyContextStyle(o,l,s);if(s._private.appliedInitStyle)e.updateTransitions(s,u.diffProps);else s._private.appliedInitStyle=!0;var f=e.updateStyleHints(s);if(f)n.push(s)}return n};Et.getPropertiesDiff=function(t,e){var r=this,a=r._private.propDiffs=r._private.propDiffs||{},n=t+"-"+e,i=a[n];if(i)return i;var s=[],o={};for(var l=0;l<r.length;l++){var u=r[l],f=t[l]===Ba,v=e[l]===Ba,h=f!==v,c=u.mappedProperties.length>0;if(h||v&&c){var d=void 0;if(h&&c)d=u.properties;else if(h)d=u.properties;else if(c)d=u.mappedProperties;for(var g=0;g<d.length;g++){var y=d[g],p=y.name,m=!1;for(var b=l+1;b<r.length;b++){var E=r[b],A=e[b]===Ba;if(!A)continue;if(m=E.properties[y.name]!=null,m)break}if(!o[p]&&!m)o[p]=!0,s.push(p)}}}return a[n]=s,s};Et.getContextMeta=function(t){var e=this,r="",a,n=t._private.styleCxtKey||"";for(var i=0;i<e.length;i++){var s=e[i],o=s.selector&&s.selector.matches(t);if(o)r+=Ba;else r+=kp}return a=e.getPropertiesDiff(n,r),t._private.styleCxtKey=r,{key:r,diffPropNames:a,empty:a.length===0}};Et.getContextStyle=function(t){var e=t.key,r=this,a=this._private.contextStyles=this._private.contextStyles||{};if(a[e])return a[e];var n={_private:{key:e}};for(var i=0;i<r.length;i++){var s=r[i],o=e[i]===Ba;if(!o)continue;for(var l=0;l<s.properties.length;l++){var u=s.properties[l];n[u.name]=u}}return a[e]=n,n};Et.applyContextStyle=function(t,e,r){var a=this,n=t.diffPropNames,i={},s=a.types;for(var o=0;o<n.length;o++){var l=n[o],u=e[l],f=r.pstyle(l);if(!u)if(!f)continue;else if(f.bypass)u={name:l,deleteBypassed:!0};else u={name:l,delete:!0};if(f===u)continue;if(u.mapped===s.fn&&f!=null&&f.mapping!=null&&f.mapping.value===u.value){var v=f.mapping,h=v.fnValue=u.value(r);if(h===v.prevFnValue)continue}var c=i[l]={prev:f};if(a.applyParsedProperty(r,u),c.next=r.pstyle(l),c.next&&c.next.bypass)c.next=c.next.bypassed}return{diffProps:i}};Et.updateStyleHints=function(t){var e=t._private,r=this,{propertyGroupNames:a,propertyGroupKeys:n}=r,i=function(j,re,ee){return r.getPropertiesHash(j,re,ee)},s=e.styleKey;if(t.removed())return!1;var o=e.group==="nodes",l=t._private.style;a=Object.keys(l);for(var u=0;u<n.length;u++){var f=n[u];e.styleKeys[f]=[Fr,ta]}var v=function(j,re){return e.styleKeys[re][0]=za(j,e.styleKeys[re][0])},h=function(j,re){return e.styleKeys[re][1]=Va(j,e.styleKeys[re][1])},c=function(j,re){v(j,re),h(j,re)},d=function(j,re){for(var ee=0;ee<j.length;ee++){var de=j.charCodeAt(ee);v(de,re),h(de,re)}},g=2000000000,y=function(j){return-128<j&&j<128&&Math.floor(j)!==j?g-(j*1024|0):j};for(var p=0;p<a.length;p++){var m=a[p],b=l[m];if(b==null)continue;var E=this.properties[m],{type:A,groupKey:M}=E,S=void 0;if(E.hashOverride!=null)S=E.hashOverride(t,b);else if(b.pfValue!=null)S=b.pfValue;var P=E.enums==null?b.value:null,N=S!=null,R=P!=null,I=N||R,w=b.units;if(A.number&&I&&!A.multiple){var x=N?S:P;if(c(y(x),M),!N&&w!=null)d(w,M)}else d(b.strValue,M)}var T=[Fr,ta];for(var D=0;D<n.length;D++){var C=n[D],O=e.styleKeys[C];T[0]=za(O[0],T[0]),T[1]=Va(O[1],T[1])}e.styleKey=_h(T[0],T[1]);var B=e.styleKeys;e.labelDimsKey=cr(B.labelDimensions);var z=i(t,["label"],B.labelDimensions);if(e.labelKey=cr(z),e.labelStyleKey=cr(hn(B.commonLabel,z)),!o){var V=i(t,["source-label"],B.labelDimensions);e.sourceLabelKey=cr(V),e.sourceLabelStyleKey=cr(hn(B.commonLabel,V));var k=i(t,["target-label"],B.labelDimensions);e.targetLabelKey=cr(k),e.targetLabelStyleKey=cr(hn(B.commonLabel,k))}if(o){var G=e.styleKeys,{nodeBody:J,nodeBorder:X,nodeOutline:_,backgroundImage:Q,compound:q,pie:te,stripe:Z}=G,U=[J,X,_,Q,q,te,Z].filter(function(W){return W!=null}).reduce(hn,[Fr,ta]);e.nodeKey=cr(U),e.hasPie=te!=null&&te[0]!==Fr&&te[1]!==ta,e.hasStripe=Z!=null&&Z[0]!==Fr&&Z[1]!==ta}return s!==e.styleKey};Et.clearStyleHints=function(t){var e=t._private;e.styleCxtKey="",e.styleKeys={},e.styleKey=null,e.labelKey=null,e.labelStyleKey=null,e.sourceLabelKey=null,e.sourceLabelStyleKey=null,e.targetLabelKey=null,e.targetLabelStyleKey=null,e.nodeKey=null,e.hasPie=null,e.hasStripe=null};Et.applyParsedProperty=function(t,e){var r=this,a=e,n=t._private.style,i,s=r.types,o=r.properties[a.name].type,l=a.bypass,u=n[a.name],f=u&&u.bypass,v=t._private,h="mapping",c=function(J){if(J==null)return null;else if(J.pfValue!=null)return J.pfValue;else return J.value},d=function(){var J=c(u),X=c(a);r.checkTriggers(t,a.name,J,X)};if(e.name==="curve-style"&&t.isEdge()&&(e.value!=="bezier"&&t.isLoop()||e.value==="haystack"&&(t.source().isParent()||t.target().isParent())))a=e=this.parse(e.name,"bezier",l);if(a.delete)return n[a.name]=void 0,d(),!0;if(a.deleteBypassed)if(!u)return d(),!0;else if(u.bypass)return u.bypassed=void 0,d(),!0;else return!1;if(a.deleteBypass)if(!u)return d(),!0;else if(u.bypass)return n[a.name]=u.bypassed,d(),!0;else return!1;var g=function(){_e("Do not assign mappings to elements without corresponding data (i.e. ele `"+t.id()+"` has no mapping for property `"+a.name+"` with data field `"+a.field+"`); try a `["+a.field+"]` selector to limit scope to elements with `"+a.field+"` defined")};switch(a.mapped){case s.mapData:{var y=a.field.split("."),p=v.data;for(var m=0;m<y.length&&p;m++){var b=y[m];p=p[b]}if(p==null)return g(),!1;var E;if(!he(p))return _e("Do not use continuous mappers without specifying numeric data (i.e. `"+a.field+": "+p+"` for `"+t.id()+"` is non-numeric)"),!1;else{var A=a.fieldMax-a.fieldMin;if(A===0)E=0;else E=(p-a.fieldMin)/A}if(E<0)E=0;else if(E>1)E=1;if(o.color){var M=a.valueMin[0],S=a.valueMax[0],P=a.valueMin[1],N=a.valueMax[1],R=a.valueMin[2],I=a.valueMax[2],w=a.valueMin[3]==null?1:a.valueMin[3],x=a.valueMax[3]==null?1:a.valueMax[3],T=[Math.round(M+(S-M)*E),Math.round(P+(N-P)*E),Math.round(R+(I-R)*E),Math.round(w+(x-w)*E)];i={bypass:a.bypass,name:a.name,value:T,strValue:"rgb("+T[0]+", "+T[1]+", "+T[2]+")"}}else if(o.number){var D=a.valueMin+(a.valueMax-a.valueMin)*E;i=this.parse(a.name,D,a.bypass,h)}else return!1;if(!i)return g(),!1;i.mapping=a,a=i;break}case s.data:{var C=a.field.split("."),O=v.data;for(var B=0;B<C.length&&O;B++){var z=C[B];O=O[z]}if(O!=null)i=this.parse(a.name,O,a.bypass,h);if(!i)return g(),!1;i.mapping=a,a=i;break}case s.fn:{var V=a.value,k=a.fnValue!=null?a.fnValue:V(t);if(a.prevFnValue=k,k==null)return _e("Custom function mappers may not return null (i.e. `"+a.name+"` for ele `"+t.id()+"` is null)"),!1;if(i=this.parse(a.name,k,a.bypass,h),!i)return _e("Custom function mappers may not return invalid values for the property type (i.e. `"+a.name+"` for ele `"+t.id()+"` is invalid)"),!1;i.mapping=Jt(a),a=i;break}case void 0:break;default:return!1}if(l){if(f)a.bypassed=u.bypassed;else a.bypassed=u;n[a.name]=a}else if(f)u.bypassed=a;else n[a.name]=a;return d(),!0};Et.cleanElements=function(t,e){for(var r=0;r<t.length;r++){var a=t[r];if(this.clearStyleHints(a),a.dirtyCompoundBoundsCache(),a.dirtyBoundingBoxCache(),!e)a._private.style={};else{var n=a._private.style,i=Object.keys(n);for(var s=0;s<i.length;s++){var o=i[s],l=n[o];if(l!=null)if(l.bypass)l.bypassed=null;else n[o]=null}}}};Et.update=function(){var t=this._private.cy,e=t.mutableElements();e.updateStyle()};Et.updateTransitions=function(t,e){var r=this,a=t._private,n=t.pstyle("transition-property").value,i=t.pstyle("transition-duration").pfValue,s=t.pstyle("transition-delay").pfValue;if(n.length>0&&i>0){var o={},l=!1;for(var u=0;u<n.length;u++){var f=n[u],v=t.pstyle(f),h=e[f];if(!h)continue;var c=h.prev,d=c,g=h.next!=null?h.next:v,y=!1,p=void 0,m=0.000001;if(!d)continue;if(he(d.pfValue)&&he(g.pfValue))y=g.pfValue-d.pfValue,p=d.pfValue+m*y;else if(he(d.value)&&he(g.value))y=g.value-d.value,p=d.value+m*y;else if(Je(d.value)&&Je(g.value))y=d.value[0]!==g.value[0]||d.value[1]!==g.value[1]||d.value[2]!==g.value[2],p=d.strValue;if(y)o[f]=g.strValue,this.applyBypass(t,f,p),l=!0}if(!l)return;a.transitioning=!0,new ga(function(b){if(s>0)t.delayAnimation(s).play().promise().then(b);else b()}).then(function(){return t.animation({style:o,duration:i,easing:t.pstyle("transition-timing-function").value,queue:!1}).play().promise()}).then(function(){r.removeBypasses(t,n),t.emitAndNotify("style"),a.transitioning=!1})}else if(a.transitioning)this.removeBypasses(t,n),t.emitAndNotify("style"),a.transitioning=!1};Et.checkTrigger=function(t,e,r,a,n,i){var s=this.properties[e],o=n(s);if(t.removed())return;if(o!=null&&o(r,a,t))i(s)};Et.checkZOrderTrigger=function(t,e,r,a){var n=this;this.checkTrigger(t,e,r,a,function(i){return i.triggersZOrder},function(){n._private.cy.notify("zorder",t)})};Et.checkBoundsTrigger=function(t,e,r,a){this.checkTrigger(t,e,r,a,function(n){return n.triggersBounds},function(n){t.dirtyCompoundBoundsCache(),t.dirtyBoundingBoxCache()})};Et.checkConnectedEdgesBoundsTrigger=function(t,e,r,a){this.checkTrigger(t,e,r,a,function(n){return n.triggersBoundsOfConnectedEdges},function(n){t.connectedEdges().forEach(function(i){i.dirtyBoundingBoxCache()})})};Et.checkParallelEdgesBoundsTrigger=function(t,e,r,a){this.checkTrigger(t,e,r,a,function(n){return n.triggersBoundsOfParallelEdges},function(n){t.parallelEdges().forEach(function(i){i.dirtyBoundingBoxCache()})})};Et.checkTriggers=function(t,e,r,a){t.dirtyStyleCache(),this.checkZOrderTrigger(t,e,r,a),this.checkBoundsTrigger(t,e,r,a),this.checkConnectedEdgesBoundsTrigger(t,e,r,a),this.checkParallelEdgesBoundsTrigger(t,e,r,a)};var rn={};rn.applyBypass=function(t,e,r,a){var n=this,i=[],s=!0;if(e==="*"||e==="**"){if(r!==void 0)for(var o=0;o<n.properties.length;o++){var l=n.properties[o],u=l.name,f=this.parse(u,r,!0);if(f)i.push(f)}}else if(Re(e)){var v=this.parse(e,r,!0);if(v)i.push(v)}else if(We(e)){var h=e;a=r;var c=Object.keys(h);for(var d=0;d<c.length;d++){var g=c[d],y=h[g];if(y===void 0)y=h[Zn(g)];if(y!==void 0){var p=this.parse(g,y,!0);if(p)i.push(p)}}}else return!1;if(i.length===0)return!1;var m=!1;for(var b=0;b<t.length;b++){var E=t[b],A={},M=void 0;for(var S=0;S<i.length;S++){var P=i[S];if(a){var N=E.pstyle(P.name);M=A[P.name]={prev:N}}if(m=this.applyParsedProperty(E,Jt(P))||m,a)M.next=E.pstyle(P.name)}if(m)this.updateStyleHints(E);if(a)this.updateTransitions(E,A,s)}return m};rn.overrideBypass=function(t,e,r){e=ho(e);for(var a=0;a<t.length;a++){var n=t[a],i=n._private.style[e],s=this.properties[e].type,{color:o,mutiple:l}=s,u=!i?null:i.pfValue!=null?i.pfValue:i.value;if(!i||!i.bypass)this.applyBypass(n,e,r);else{if(i.value=r,i.pfValue!=null)i.pfValue=r;if(o)i.strValue="rgb("+r.join(",")+")";else if(l)i.strValue=r.join(" ");else i.strValue=""+r;this.updateStyleHints(n)}this.checkTriggers(n,e,u,r)}};rn.removeAllBypasses=function(t,e){return this.removeBypasses(t,this.propertyNames,e)};rn.removeBypasses=function(t,e,r){var a=!0;for(var n=0;n<t.length;n++){var i=t[n],s={};for(var o=0;o<e.length;o++){var l=e[o],u=this.properties[l],f=i.pstyle(u.name);if(!f||!f.bypass)continue;var v="",h=this.parse(l,v,!0),c=s[u.name]={prev:f};this.applyParsedProperty(i,h),c.next=i.pstyle(u.name)}if(this.updateStyleHints(i),r)this.updateTransitions(i,s,a)}};var Mo={};Mo.getEmSizeInPixels=function(){var t=this.containerCss("font-size");if(t!=null)return parseFloat(t);else return 1};Mo.containerCss=function(t){var e=this._private.cy,r=e.container(),a=e.window();if(a&&r&&a.getComputedStyle)return a.getComputedStyle(r).getPropertyValue(t)};var jt={};jt.getRenderedStyle=function(t,e){if(e)return this.getStylePropertyValue(t,e,!0);else return this.getRawStyle(t,!0)};jt.getRawStyle=function(t,e){var r=this;if(t=t[0],t){var a={};for(var n=0;n<r.properties.length;n++){var i=r.properties[n],s=r.getStylePropertyValue(t,i.name,e);if(s!=null)a[i.name]=s,a[Zn(i.name)]=s}return a}};jt.getIndexedStyle=function(t,e,r,a){var n=t.pstyle(e)[r][a];return n!=null?n:t.cy().style().getDefaultProperty(e)[r][0]};jt.getStylePropertyValue=function(t,e,r){var a=this;if(t=t[0],t){var n=a.properties[e];if(n.alias)n=n.pointsTo;var i=n.type,s=t.pstyle(n.name);if(s){var{value:o,units:l,strValue:u}=s;if(r&&i.number&&o!=null&&he(o)){var f=t.cy().zoom(),v=function(y){return y*f},h=function(y,p){return v(y)+p},c=Je(o),d=c?l.every(function(g){return g!=null}):l!=null;if(d)if(c)return o.map(function(g,y){return h(g,l[y])}).join(" ");else return h(o,l);else if(c)return o.map(function(g){return Re(g)?g:""+v(g)}).join(" ");else return""+v(o)}else if(u!=null)return u}return null}};jt.getAnimationStartStyle=function(t,e){var r={};for(var a=0;a<e.length;a++){var n=e[a],i=n.name,s=t.pstyle(i);if(s!==void 0)if(We(s))s=this.parse(i,s.strValue);else s=this.parse(i,s);if(s)r[i]=s}return r};jt.getPropsList=function(t){var e=this,r=[],a=t,n=e.properties;if(a){var i=Object.keys(a);for(var s=0;s<i.length;s++){var o=i[s],l=a[o],u=n[o]||n[ho(o)],f=this.parse(u.name,l);if(f)r.push(f)}}return r};jt.getNonDefaultPropertiesHash=function(t,e,r){var a=r.slice(),n,i,s,o,l,u;for(l=0;l<e.length;l++)if(n=e[l],i=t.pstyle(n,!1),i==null)continue;else if(i.pfValue!=null)a[0]=za(o,a[0]),a[1]=Va(o,a[1]);else{s=i.strValue;for(u=0;u<s.length;u++)o=s.charCodeAt(u),a[0]=za(o,a[0]),a[1]=Va(o,a[1])}return a};jt.getPropertiesHash=jt.getNonDefaultPropertiesHash;var ui={};ui.appendFromJson=function(t){var e=this;for(var r=0;r<t.length;r++){var a=t[r],n=a.selector,i=a.style||a.css,s=Object.keys(i);e.selector(n);for(var o=0;o<s.length;o++){var l=s[o],u=i[l];e.css(l,u)}}return e};ui.fromJson=function(t){var e=this;return e.resetToDefault(),e.appendFromJson(t),e};ui.json=function(){var t=[];for(var e=this.defaultLength;e<this.length;e++){var r=this[e],{selector:a,properties:n}=r,i={};for(var s=0;s<n.length;s++){var o=n[s];i[o.name]=o.strValue}t.push({selector:!a?"core":a.toString(),style:i})}return t};var Lo={};Lo.appendFromString=function(t){var e=this,r=this,a=""+t,n,i,s;a=a.replace(/[/][*](\s|.)+?[*][/]/g,"");function o(){if(a.length>n.length)a=a.substr(n.length);else a=""}function l(){if(i.length>s.length)i=i.substr(s.length);else i=""}for(;;){var u=a.match(/^\s*$/);if(u)break;var f=a.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!f){_e("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+a);break}n=f[0];var v=f[1];if(v!=="core"){var h=new Sr(v);if(h.invalid){_e("Skipping parsing of block: Invalid selector found in string stylesheet: "+v),o();continue}}var c=f[2],d=!1;i=c;var g=[];for(;;){var y=i.match(/^\s*$/);if(y)break;var p=i.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!p){_e("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+c),d=!0;break}s=p[0];var m=p[1],b=p[2],E=e.properties[m];if(!E){_e("Skipping property: Invalid property name in: "+s),l();continue}var A=r.parse(m,b);if(!A){_e("Skipping property: Invalid property definition in: "+s),l();continue}g.push({name:m,val:b}),l()}if(d){o();break}r.selector(v);for(var M=0;M<g.length;M++){var S=g[M];r.css(S.name,S.val)}o()}return r};Lo.fromString=function(t){var e=this;return e.resetToDefault(),e.appendFromString(t),e};var vt={};(function(){var t=gt,e=Mh,r=Rh,a=Ph,n=Nh,i=function(W){return"^"+W+"\\s*\\(\\s*([\\w\\.]+)\\s*\\)$"},s=function(W){var j=t+"|\\w+|"+e+"|"+r+"|"+a+"|"+n;return"^"+W+"\\s*\\(([\\w\\.]+)\\s*\\,\\s*("+t+")\\s*\\,\\s*("+t+")\\s*,\\s*("+j+")\\s*\\,\\s*("+j+")\\)$"},o=[`^url\\s*\\(\\s*['"]?(.+?)['"]?\\s*\\)$`,"^(none)$","^(.+)$"];vt.types={time:{number:!0,min:0,units:"s|ms",implicitUnits:"ms"},percent:{number:!0,min:0,max:100,units:"%",implicitUnits:"%"},percentages:{number:!0,min:0,max:100,units:"%",implicitUnits:"%",multiple:!0},zeroOneNumber:{number:!0,min:0,max:1,unitless:!0},zeroOneNumbers:{number:!0,min:0,max:1,unitless:!0,multiple:!0},nOneOneNumber:{number:!0,min:-1,max:1,unitless:!0},nonNegativeInt:{number:!0,min:0,integer:!0,unitless:!0},nonNegativeNumber:{number:!0,min:0,unitless:!0},position:{enums:["parent","origin"]},nodeSize:{number:!0,min:0,enums:["label"]},number:{number:!0,unitless:!0},numbers:{number:!0,unitless:!0,multiple:!0},positiveNumber:{number:!0,unitless:!0,min:0,strictMin:!0},size:{number:!0,min:0},bidirectionalSize:{number:!0},bidirectionalSizeMaybePercent:{number:!0,allowPercent:!0},bidirectionalSizes:{number:!0,multiple:!0},sizeMaybePercent:{number:!0,min:0,allowPercent:!0},axisDirection:{enums:["horizontal","leftward","rightward","vertical","upward","downward","auto"]},axisDirectionExplicit:{enums:["leftward","rightward","upward","downward"]},axisDirectionPrimary:{enums:["horizontal","vertical"]},paddingRelativeTo:{enums:["width","height","average","min","max"]},bgWH:{number:!0,min:0,allowPercent:!0,enums:["auto"],multiple:!0},bgPos:{number:!0,allowPercent:!0,multiple:!0},bgRelativeTo:{enums:["inner","include-padding"],multiple:!0},bgRepeat:{enums:["repeat","repeat-x","repeat-y","no-repeat"],multiple:!0},bgFit:{enums:["none","contain","cover"],multiple:!0},bgCrossOrigin:{enums:["anonymous","use-credentials","null"],multiple:!0},bgClip:{enums:["none","node"],multiple:!0},bgContainment:{enums:["inside","over"],multiple:!0},boxSelection:{enums:["contain","overlap","none"]},color:{color:!0},colors:{color:!0,multiple:!0},fill:{enums:["solid","linear-gradient","radial-gradient"]},bool:{enums:["yes","no"]},bools:{enums:["yes","no"],multiple:!0},lineStyle:{enums:["solid","dotted","dashed"]},lineCap:{enums:["butt","round","square"]},linePosition:{enums:["center","inside","outside"]},lineJoin:{enums:["round","bevel","miter"]},borderStyle:{enums:["solid","dotted","dashed","double"]},curveStyle:{enums:["bezier","unbundled-bezier","haystack","segments","straight","straight-triangle","taxi","round-segments","round-taxi"]},radiusType:{enums:["arc-radius","influence-radius"],multiple:!0},fontFamily:{regex:"^([\\w- \\\"]+(?:\\s*,\\s*[\\w- \\\"]+)*)$"},fontStyle:{enums:["italic","normal","oblique"]},fontWeight:{enums:["normal","bold","bolder","lighter","100","200","300","400","500","600","800","900",100,200,300,400,500,600,700,800,900]},textDecoration:{enums:["none","underline","overline","line-through"]},textTransform:{enums:["none","uppercase","lowercase"]},textWrap:{enums:["none","wrap","ellipsis"]},textOverflowWrap:{enums:["whitespace","anywhere"]},textBackgroundShape:{enums:["rectangle","roundrectangle","round-rectangle","circle"]},nodeShape:{enums:["rectangle","roundrectangle","round-rectangle","cutrectangle","cut-rectangle","bottomroundrectangle","bottom-round-rectangle","barrel","ellipse","triangle","round-triangle","square","pentagon","round-pentagon","hexagon","round-hexagon","concavehexagon","concave-hexagon","heptagon","round-heptagon","octagon","round-octagon","tag","round-tag","star","diamond","round-diamond","vee","rhomboid","right-rhomboid","polygon"]},overlayShape:{enums:["roundrectangle","round-rectangle","ellipse"]},cornerRadius:{number:!0,min:0,units:"px|em",implicitUnits:"px",enums:["auto"]},compoundIncludeLabels:{enums:["include","exclude"]},arrowShape:{enums:["tee","triangle","triangle-tee","circle-triangle","triangle-cross","triangle-backcurve","vee","square","circle","diamond","chevron","none"]},arrowFill:{enums:["filled","hollow"]},arrowWidth:{number:!0,units:"%|px|em",implicitUnits:"px",enums:["match-line"]},display:{enums:["element","none"]},visibility:{enums:["hidden","visible"]},zCompoundDepth:{enums:["bottom","orphan","auto","top"]},zIndexCompare:{enums:["auto","manual"]},valign:{enums:["top","top-inside","center","bottom","bottom-inside"]},halign:{enums:["left","left-inside","center","right","right-inside"]},justification:{enums:["left","center","right","auto"]},textMetrics:{enums:["font","glyph"]},text:{string:!0},data:{mapping:!0,regex:i("data")},layoutData:{mapping:!0,regex:i("layoutData")},scratch:{mapping:!0,regex:i("scratch")},mapData:{mapping:!0,regex:s("mapData")},mapLayoutData:{mapping:!0,regex:s("mapLayoutData")},mapScratch:{mapping:!0,regex:s("mapScratch")},fn:{mapping:!0,fn:!0},url:{regexes:o,singleRegexMatchValue:!0},urls:{regexes:o,singleRegexMatchValue:!0,multiple:!0},propList:{propList:!0},angle:{number:!0,units:"deg|rad",implicitUnits:"rad"},textRotation:{number:!0,units:"deg|rad",implicitUnits:"rad",enums:["none","autorotate"]},polygonPointList:{number:!0,multiple:!0,evenMultiple:!0,min:-1,max:1,unitless:!0},edgeDistances:{enums:["intersection","node-position","endpoints"]},edgeEndpoint:{number:!0,multiple:!0,units:"%|px|em|deg|rad",implicitUnits:"px",enums:["inside-to-node","outside-to-node","outside-to-node-or-label","outside-to-line","outside-to-line-or-label"],singleEnum:!0,validate:function(W,j){switch(W.length){case 2:return j[0]!=="deg"&&j[0]!=="rad"&&j[1]!=="deg"&&j[1]!=="rad";case 1:return Re(W[0])||j[0]==="deg"||j[0]==="rad";default:return!1}}},easing:{regexes:["^(spring)\\s*\\(\\s*("+t+")\\s*,\\s*("+t+")\\s*\\)$","^(cubic-bezier)\\s*\\(\\s*("+t+")\\s*,\\s*("+t+")\\s*,\\s*("+t+")\\s*,\\s*("+t+")\\s*\\)$"],enums:["linear","ease","ease-in","ease-out","ease-in-out","ease-in-sine","ease-out-sine","ease-in-out-sine","ease-in-quad","ease-out-quad","ease-in-out-quad","ease-in-cubic","ease-out-cubic","ease-in-out-cubic","ease-in-quart","ease-out-quart","ease-in-out-quart","ease-in-quint","ease-out-quint","ease-in-out-quint","ease-in-expo","ease-out-expo","ease-in-out-expo","ease-in-circ","ease-out-circ","ease-in-out-circ"]},gradientDirection:{enums:["to-bottom","to-top","to-left","to-right","to-bottom-right","to-bottom-left","to-top-right","to-top-left","to-right-bottom","to-left-bottom","to-right-top","to-left-top"]},boundsExpansion:{number:!0,multiple:!0,min:0,validate:function(W){var j=W.length;return j===1||j===2||j===4}}};var l={zeroNonZero:function(W,j){if((W==null||j==null)&&W!==j)return!0;if(W==0&&j!=0)return!0;else if(W!=0&&j==0)return!0;else return!1},any:function(W,j){return W!=j},emptyNonEmpty:function(W,j){var re=xr(W),ee=xr(j);return re&&!ee||!re&&ee}},u=vt.types,f=[{name:"label",type:u.text,triggersBounds:l.any,triggersZOrder:l.emptyNonEmpty},{name:"text-rotation",type:u.textRotation,triggersBounds:l.any},{name:"text-margin-x",type:u.bidirectionalSize,triggersBounds:l.any},{name:"text-margin-y",type:u.bidirectionalSize,triggersBounds:l.any}],v=[{name:"source-label",type:u.text,triggersBounds:l.any},{name:"source-text-rotation",type:u.textRotation,triggersBounds:l.any},{name:"source-text-margin-x",type:u.bidirectionalSize,triggersBounds:l.any},{name:"source-text-margin-y",type:u.bidirectionalSize,triggersBounds:l.any},{name:"source-text-offset",type:u.size,triggersBounds:l.any}],h=[{name:"target-label",type:u.text,triggersBounds:l.any},{name:"target-text-rotation",type:u.textRotation,triggersBounds:l.any},{name:"target-text-margin-x",type:u.bidirectionalSize,triggersBounds:l.any},{name:"target-text-margin-y",type:u.bidirectionalSize,triggersBounds:l.any},{name:"target-text-offset",type:u.size,triggersBounds:l.any}],c=[{name:"font-family",type:u.fontFamily,triggersBounds:l.any},{name:"font-style",type:u.fontStyle,triggersBounds:l.any},{name:"font-weight",type:u.fontWeight,triggersBounds:l.any},{name:"font-size",type:u.size,triggersBounds:l.any},{name:"text-transform",type:u.textTransform,triggersBounds:l.any},{name:"text-wrap",type:u.textWrap,triggersBounds:l.any},{name:"text-overflow-wrap",type:u.textOverflowWrap,triggersBounds:l.any},{name:"text-max-width",type:u.size,triggersBounds:l.any},{name:"text-outline-width",type:u.size,triggersBounds:l.any},{name:"line-height",type:u.positiveNumber,triggersBounds:l.any}],d=[{name:"text-valign",type:u.valign,triggersBounds:l.any},{name:"text-halign",type:u.halign,triggersBounds:l.any},{name:"color",type:u.color},{name:"text-outline-color",type:u.color},{name:"text-outline-opacity",type:u.zeroOneNumber},{name:"text-background-color",type:u.color},{name:"text-background-opacity",type:u.zeroOneNumber},{name:"text-background-padding",type:u.size,triggersBounds:l.any},{name:"text-border-opacity",type:u.zeroOneNumber},{name:"text-border-color",type:u.color},{name:"text-border-width",type:u.size,triggersBounds:l.any},{name:"text-border-style",type:u.borderStyle,triggersBounds:l.any},{name:"text-background-shape",type:u.textBackgroundShape,triggersBounds:l.any},{name:"text-justification",type:u.justification},{name:"text-metrics",type:u.textMetrics},{name:"box-select-labels",type:u.bool,triggersBounds:l.any}],g=[{name:"events",type:u.bool,triggersZOrder:l.any},{name:"text-events",type:u.bool,triggersZOrder:l.any},{name:"box-selection",type:u.boxSelection,triggersZOrder:l.any}],y=[{name:"display",type:u.display,triggersZOrder:l.any,triggersBounds:l.any,triggersBoundsOfConnectedEdges:l.any,triggersBoundsOfParallelEdges:function(W,j,re){if(W===j)return!1;return re.pstyle("curve-style").value==="bezier"}},{name:"visibility",type:u.visibility,triggersZOrder:l.any},{name:"opacity",type:u.zeroOneNumber,triggersZOrder:l.zeroNonZero},{name:"text-opacity",type:u.zeroOneNumber},{name:"min-zoomed-font-size",type:u.size},{name:"z-compound-depth",type:u.zCompoundDepth,triggersZOrder:l.any},{name:"z-index-compare",type:u.zIndexCompare,triggersZOrder:l.any},{name:"z-index",type:u.number,triggersZOrder:l.any}],p=[{name:"overlay-padding",type:u.size,triggersBounds:l.any},{name:"overlay-color",type:u.color},{name:"overlay-opacity",type:u.zeroOneNumber,triggersBounds:l.zeroNonZero},{name:"overlay-shape",type:u.overlayShape,triggersBounds:l.any},{name:"overlay-corner-radius",type:u.cornerRadius}],m=[{name:"underlay-padding",type:u.size,triggersBounds:l.any},{name:"underlay-color",type:u.color},{name:"underlay-opacity",type:u.zeroOneNumber,triggersBounds:l.zeroNonZero},{name:"underlay-shape",type:u.overlayShape,triggersBounds:l.any},{name:"underlay-corner-radius",type:u.cornerRadius}],b=[{name:"transition-property",type:u.propList},{name:"transition-duration",type:u.time},{name:"transition-delay",type:u.time},{name:"transition-timing-function",type:u.easing}],E=function(W,j){if(j.value==="label")return-W.poolIndex();else return j.pfValue},A=[{name:"height",type:u.nodeSize,triggersBounds:l.any,hashOverride:E},{name:"width",type:u.nodeSize,triggersBounds:l.any,hashOverride:E},{name:"shape",type:u.nodeShape,triggersBounds:l.any},{name:"shape-polygon-points",type:u.polygonPointList,triggersBounds:l.any},{name:"corner-radius",type:u.cornerRadius},{name:"background-color",type:u.color},{name:"background-fill",type:u.fill},{name:"background-opacity",type:u.zeroOneNumber},{name:"background-blacken",type:u.nOneOneNumber},{name:"background-gradient-stop-colors",type:u.colors},{name:"background-gradient-stop-positions",type:u.percentages},{name:"background-gradient-direction",type:u.gradientDirection},{name:"padding",type:u.sizeMaybePercent,triggersBounds:l.any},{name:"padding-relative-to",type:u.paddingRelativeTo,triggersBounds:l.any},{name:"bounds-expansion",type:u.boundsExpansion,triggersBounds:l.any}],M=[{name:"border-color",type:u.color},{name:"border-opacity",type:u.zeroOneNumber},{name:"border-width",type:u.size,triggersBounds:l.any},{name:"border-style",type:u.borderStyle},{name:"border-cap",type:u.lineCap},{name:"border-join",type:u.lineJoin},{name:"border-dash-pattern",type:u.numbers},{name:"border-dash-offset",type:u.number},{name:"border-position",type:u.linePosition}],S=[{name:"outline-color",type:u.color},{name:"outline-opacity",type:u.zeroOneNumber},{name:"outline-width",type:u.size,triggersBounds:l.any},{name:"outline-style",type:u.borderStyle},{name:"outline-offset",type:u.size,triggersBounds:l.any}],P=[{name:"background-image",type:u.urls},{name:"background-image-crossorigin",type:u.bgCrossOrigin},{name:"background-image-opacity",type:u.zeroOneNumbers},{name:"background-image-containment",type:u.bgContainment},{name:"background-image-smoothing",type:u.bools},{name:"background-position-x",type:u.bgPos},{name:"background-position-y",type:u.bgPos},{name:"background-width-relative-to",type:u.bgRelativeTo},{name:"background-height-relative-to",type:u.bgRelativeTo},{name:"background-repeat",type:u.bgRepeat},{name:"background-fit",type:u.bgFit},{name:"background-clip",type:u.bgClip},{name:"background-width",type:u.bgWH},{name:"background-height",type:u.bgWH},{name:"background-offset-x",type:u.bgPos},{name:"background-offset-y",type:u.bgPos}],N=[{name:"position",type:u.position,triggersBounds:l.any},{name:"compound-sizing-wrt-labels",type:u.compoundIncludeLabels,triggersBounds:l.any},{name:"min-width",type:u.size,triggersBounds:l.any},{name:"min-width-bias-left",type:u.sizeMaybePercent,triggersBounds:l.any},{name:"min-width-bias-right",type:u.sizeMaybePercent,triggersBounds:l.any},{name:"min-height",type:u.size,triggersBounds:l.any},{name:"min-height-bias-top",type:u.sizeMaybePercent,triggersBounds:l.any},{name:"min-height-bias-bottom",type:u.sizeMaybePercent,triggersBounds:l.any}],R=[{name:"line-style",type:u.lineStyle},{name:"line-color",type:u.color},{name:"line-fill",type:u.fill},{name:"line-cap",type:u.lineCap},{name:"line-opacity",type:u.zeroOneNumber},{name:"line-dash-pattern",type:u.numbers},{name:"line-dash-offset",type:u.number},{name:"line-outline-width",type:u.size},{name:"line-outline-color",type:u.color},{name:"line-gradient-stop-colors",type:u.colors},{name:"line-gradient-stop-positions",type:u.percentages},{name:"curve-style",type:u.curveStyle,triggersBounds:l.any,triggersBoundsOfParallelEdges:function(W,j){if(W===j)return!1;return W==="bezier"||j==="bezier"}},{name:"haystack-radius",type:u.zeroOneNumber,triggersBounds:l.any},{name:"source-endpoint",type:u.edgeEndpoint,triggersBounds:l.any},{name:"target-endpoint",type:u.edgeEndpoint,triggersBounds:l.any},{name:"control-point-step-size",type:u.size,triggersBounds:l.any},{name:"control-point-distances",type:u.bidirectionalSizes,triggersBounds:l.any},{name:"control-point-weights",type:u.numbers,triggersBounds:l.any},{name:"segment-distances",type:u.bidirectionalSizes,triggersBounds:l.any},{name:"segment-weights",type:u.numbers,triggersBounds:l.any},{name:"segment-radii",type:u.numbers,triggersBounds:l.any},{name:"radius-type",type:u.radiusType,triggersBounds:l.any},{name:"taxi-turn",type:u.bidirectionalSizeMaybePercent,triggersBounds:l.any},{name:"taxi-turn-min-distance",type:u.size,triggersBounds:l.any},{name:"taxi-direction",type:u.axisDirection,triggersBounds:l.any},{name:"taxi-radius",type:u.number,triggersBounds:l.any},{name:"edge-distances",type:u.edgeDistances,triggersBounds:l.any},{name:"arrow-scale",type:u.positiveNumber,triggersBounds:l.any},{name:"loop-direction",type:u.angle,triggersBounds:l.any},{name:"loop-sweep",type:u.angle,triggersBounds:l.any},{name:"source-distance-from-node",type:u.size,triggersBounds:l.any},{name:"target-distance-from-node",type:u.size,triggersBounds:l.any}],I=[{name:"ghost",type:u.bool,triggersBounds:l.any},{name:"ghost-offset-x",type:u.bidirectionalSize,triggersBounds:l.any},{name:"ghost-offset-y",type:u.bidirectionalSize,triggersBounds:l.any},{name:"ghost-opacity",type:u.zeroOneNumber}],w=[{name:"selection-box-color",type:u.color},{name:"selection-box-opacity",type:u.zeroOneNumber},{name:"selection-box-border-color",type:u.color},{name:"selection-box-border-width",type:u.size},{name:"active-bg-color",type:u.color},{name:"active-bg-opacity",type:u.zeroOneNumber},{name:"active-bg-size",type:u.size},{name:"outside-texture-bg-color",type:u.color},{name:"outside-texture-bg-opacity",type:u.zeroOneNumber}],x=[];vt.pieBackgroundN=16,x.push({name:"pie-size",type:u.sizeMaybePercent}),x.push({name:"pie-hole",type:u.sizeMaybePercent}),x.push({name:"pie-start-angle",type:u.angle});for(var T=1;T<=vt.pieBackgroundN;T++)x.push({name:"pie-"+T+"-background-color",type:u.color}),x.push({name:"pie-"+T+"-background-size",type:u.percent}),x.push({name:"pie-"+T+"-background-opacity",type:u.zeroOneNumber});var D=[];vt.stripeBackgroundN=16,D.push({name:"stripe-size",type:u.sizeMaybePercent}),D.push({name:"stripe-direction",type:u.axisDirectionPrimary});for(var C=1;C<=vt.stripeBackgroundN;C++)D.push({name:"stripe-"+C+"-background-color",type:u.color}),D.push({name:"stripe-"+C+"-background-size",type:u.percent}),D.push({name:"stripe-"+C+"-background-opacity",type:u.zeroOneNumber});var O=[],B=vt.arrowPrefixes=["source","mid-source","target","mid-target"];[{name:"arrow-shape",type:u.arrowShape,triggersBounds:l.any},{name:"arrow-color",type:u.color},{name:"arrow-fill",type:u.arrowFill},{name:"arrow-width",type:u.arrowWidth}].forEach(function(U){B.forEach(function(W){var j=W+"-"+U.name,{type:re,triggersBounds:ee}=U;O.push({name:j,type:re,triggersBounds:ee})})},{});var z=vt.properties=[].concat(g,b,y,p,m,I,d,c,f,v,h,A,M,S,P,x,D,N,R,O,w),V=vt.propertyGroups={behavior:g,transition:b,visibility:y,overlay:p,underlay:m,ghost:I,commonLabel:d,labelDimensions:c,mainLabel:f,sourceLabel:v,targetLabel:h,nodeBody:A,nodeBorder:M,nodeOutline:S,backgroundImage:P,pie:x,stripe:D,compound:N,edgeLine:R,edgeArrow:O,core:w},k=vt.propertyGroupNames={},G=vt.propertyGroupKeys=Object.keys(V);G.forEach(function(U){k[U]=V[U].map(function(W){return W.name}),V[U].forEach(function(W){return W.groupKey=U})});var J=vt.aliases=[{name:"content",pointsTo:"label"},{name:"control-point-distance",pointsTo:"control-point-distances"},{name:"control-point-weight",pointsTo:"control-point-weights"},{name:"segment-distance",pointsTo:"segment-distances"},{name:"segment-weight",pointsTo:"segment-weights"},{name:"segment-radius",pointsTo:"segment-radii"},{name:"edge-text-rotation",pointsTo:"text-rotation"},{name:"padding-left",pointsTo:"padding"},{name:"padding-right",pointsTo:"padding"},{name:"padding-top",pointsTo:"padding"},{name:"padding-bottom",pointsTo:"padding"}];vt.propertyNames=z.map(function(U){return U.name});for(var X=0;X<z.length;X++){var _=z[X];z[_.name]=_}for(var Q=0;Q<J.length;Q++){var q=J[Q],te=z[q.pointsTo],Z={name:q.name,alias:!0,pointsTo:te};z.push(Z),z[q.name]=Z}})();vt.getDefaultProperty=function(t){return this.getDefaultProperties()[t]};vt.getDefaultProperties=function(){var t=this._private;if(t.defaultProperties!=null)return t.defaultProperties;var e=Oe({"selection-box-color":"#ddd","selection-box-opacity":0.65,"selection-box-border-color":"#aaa","selection-box-border-width":1,"active-bg-color":"black","active-bg-opacity":0.15,"active-bg-size":30,"outside-texture-bg-color":"#000","outside-texture-bg-opacity":0.125,events:"yes","text-events":"no","text-valign":"top","text-halign":"center","text-justification":"auto","line-height":1,color:"#000","box-selection":"contain","text-outline-color":"#000","text-outline-width":0,"text-outline-opacity":1,"text-opacity":1,"text-decoration":"none","text-transform":"none","text-wrap":"none","text-overflow-wrap":"whitespace","text-max-width":9999,"text-background-color":"#000","text-background-opacity":0,"text-background-shape":"rectangle","text-background-padding":0,"text-border-opacity":0,"text-border-width":0,"text-border-style":"solid","text-border-color":"#000","font-family":"Helvetica Neue, Helvetica, sans-serif","font-style":"normal","font-weight":"normal","font-size":16,"min-zoomed-font-size":0,"text-rotation":"none","source-text-rotation":"none","target-text-rotation":"none",visibility:"visible",display:"element",opacity:1,"z-compound-depth":"auto","z-index-compare":"auto","z-index":0,label:"","text-margin-x":0,"text-margin-y":0,"source-label":"","source-text-offset":0,"source-text-margin-x":0,"source-text-margin-y":0,"target-label":"","target-text-offset":0,"target-text-margin-x":0,"target-text-margin-y":0,"overlay-opacity":0,"overlay-color":"#000","overlay-padding":10,"overlay-shape":"round-rectangle","overlay-corner-radius":"auto","underlay-opacity":0,"underlay-color":"#000","underlay-padding":10,"underlay-shape":"round-rectangle","underlay-corner-radius":"auto","text-metrics":"font","transition-property":"none","transition-duration":0,"transition-delay":0,"transition-timing-function":"linear","box-select-labels":"no","background-blacken":0,"background-color":"#999","background-fill":"solid","background-opacity":1,"background-image":"none","background-image-crossorigin":"anonymous","background-image-opacity":1,"background-image-containment":"inside","background-image-smoothing":"yes","background-position-x":"50%","background-position-y":"50%","background-offset-x":0,"background-offset-y":0,"background-width-relative-to":"include-padding","background-height-relative-to":"include-padding","background-repeat":"no-repeat","background-fit":"none","background-clip":"node","background-width":"auto","background-height":"auto","border-color":"#000","border-opacity":1,"border-width":0,"border-style":"solid","border-dash-pattern":[4,2],"border-dash-offset":0,"border-cap":"butt","border-join":"miter","border-position":"center","outline-color":"#999","outline-opacity":1,"outline-width":0,"outline-offset":0,"outline-style":"solid",height:30,width:30,shape:"ellipse","shape-polygon-points":"-1, -1, 1, -1, 1, 1, -1, 1","corner-radius":"auto","bounds-expansion":0,"background-gradient-direction":"to-bottom","background-gradient-stop-colors":"#999","background-gradient-stop-positions":"0%",ghost:"no","ghost-offset-y":0,"ghost-offset-x":0,"ghost-opacity":0,padding:0,"padding-relative-to":"width",position:"origin","compound-sizing-wrt-labels":"include","min-width":0,"min-width-bias-left":0,"min-width-bias-right":0,"min-height":0,"min-height-bias-top":0,"min-height-bias-bottom":0},{"pie-size":"100%","pie-hole":0,"pie-start-angle":"0deg"},[{name:"pie-{{i}}-background-color",value:"black"},{name:"pie-{{i}}-background-size",value:"0%"},{name:"pie-{{i}}-background-opacity",value:1}].reduce(function(l,u){for(var f=1;f<=vt.pieBackgroundN;f++){var v=u.name.replace("{{i}}",f),h=u.value;l[v]=h}return l},{}),{"stripe-size":"100%","stripe-direction":"horizontal"},[{name:"stripe-{{i}}-background-color",value:"black"},{name:"stripe-{{i}}-background-size",value:"0%"},{name:"stripe-{{i}}-background-opacity",value:1}].reduce(function(l,u){for(var f=1;f<=vt.stripeBackgroundN;f++){var v=u.name.replace("{{i}}",f),h=u.value;l[v]=h}return l},{}),{"line-style":"solid","line-color":"#999","line-fill":"solid","line-cap":"butt","line-opacity":1,"line-outline-width":0,"line-outline-color":"#000","line-gradient-stop-colors":"#999","line-gradient-stop-positions":"0%","control-point-step-size":40,"control-point-weights":0.5,"segment-weights":0.5,"segment-distances":20,"segment-radii":15,"radius-type":"arc-radius","taxi-turn":"50%","taxi-radius":15,"taxi-turn-min-distance":10,"taxi-direction":"auto","edge-distances":"intersection","curve-style":"haystack","haystack-radius":0,"arrow-scale":1,"loop-direction":"-45deg","loop-sweep":"-90deg","source-distance-from-node":0,"target-distance-from-node":0,"source-endpoint":"outside-to-node","target-endpoint":"outside-to-node","line-dash-pattern":[6,3],"line-dash-offset":0},[{name:"arrow-shape",value:"none"},{name:"arrow-color",value:"#999"},{name:"arrow-fill",value:"filled"},{name:"arrow-width",value:1}].reduce(function(l,u){return vt.arrowPrefixes.forEach(function(f){var v=f+"-"+u.name,h=u.value;l[v]=h}),l},{})),r={};for(var a=0;a<this.properties.length;a++){var n=this.properties[a];if(n.pointsTo)continue;var i=n.name,s=e[i],o=this.parse(i,s);r[i]=o}return t.defaultProperties=r,t.defaultProperties};vt.addDefaultStylesheet=function(){this.selector(":parent").css({shape:"rectangle",padding:10,"background-color":"#eee","border-color":"#ccc","border-width":1}).selector("edge").css({width:3}).selector(":loop").css({"curve-style":"bezier"}).selector("edge:compound").css({"curve-style":"bezier","source-endpoint":"outside-to-line","target-endpoint":"outside-to-line"}).selector(":selected").css({"background-color":"#0169D9","line-color":"#0169D9","source-arrow-color":"#0169D9","target-arrow-color":"#0169D9","mid-source-arrow-color":"#0169D9","mid-target-arrow-color":"#0169D9"}).selector(":parent:selected").css({"background-color":"#CCE1F9","border-color":"#aec8e5"}).selector(":active").css({"overlay-color":"black","overlay-padding":10,"overlay-opacity":0.25}),this.defaultLength=this.length};var li={};li.parse=function(t,e,r,a){var n=this;if(st(e))return n.parseImplWarn(t,e,r,a);var i=a==="mapping"||a===!0||a===!1||a==null?"dontcare":a,s=r?"t":"f",o=""+e,l=Lf(t,o,s,i),u=n.propCache=n.propCache||[],f;if(!(f=u[l]))f=u[l]=n.parseImplWarn(t,e,r,a);if(r||a==="mapping"){if(f=Jt(f),f)f.value=Jt(f.value)}return f};li.parseImplWarn=function(t,e,r,a){var n=this.parseImpl(t,e,r,a);if(!n&&e!=null)_e("The style property `".concat(t,": ").concat(e,"` is invalid"));if(n&&(n.name==="width"||n.name==="height")&&e==="label")_e("The style value of `label` is deprecated for `"+n.name+"`");return n};li.parseImpl=function(t,e,r,a){var n=this;t=ho(t);var i=n.properties[t],s=e,o=n.types;if(!i)return null;if(e===void 0)return null;if(i.alias)i=i.pointsTo,t=i.name;var l=Re(e);if(l)e=e.trim();var u=i.type;if(!u)return null;if(r&&(e===""||e===null))return{name:t,value:e,bypass:!0,deleteBypass:!0};if(st(e))return{name:t,value:e,strValue:"fn",mapped:o.fn,bypass:r};var f,v;if(!l||a||e.length<7||e[1]!=="a");else if(e.length>=7&&e[0]==="d"&&(f=new RegExp(o.data.regex).exec(e))){if(r)return!1;var h=o.data;return{name:t,value:f,strValue:""+e,mapped:h,field:f[1],bypass:r}}else if(e.length>=10&&e[0]==="m"&&(v=new RegExp(o.mapData.regex).exec(e))){if(r)return!1;if(u.multiple)return!1;var c=o.mapData;if(!(u.color||u.number))return!1;var d=this.parse(t,v[4]);if(!d||d.mapped)return!1;var g=this.parse(t,v[5]);if(!g||g.mapped)return!1;if(d.pfValue===g.pfValue||d.strValue===g.strValue)return _e("`"+t+": "+e+"` is not a valid mapper because the output range is zero; converting to `"+t+": "+d.strValue+"`"),this.parse(t,d.strValue);else if(u.color){var y=d.value,p=g.value,m=y[0]===p[0]&&y[1]===p[1]&&y[2]===p[2]&&(y[3]===p[3]||(y[3]==null||y[3]===1)&&(p[3]==null||p[3]===1));if(m)return!1}return{name:t,value:v,strValue:""+e,mapped:c,field:v[1],fieldMin:parseFloat(v[2]),fieldMax:parseFloat(v[3]),valueMin:d.value,valueMax:g.value,bypass:r}}if(u.multiple&&a!=="multiple"){var b;if(l)b=e.split(/\s+/);else if(Je(e))b=e;else b=[e];if(u.evenMultiple&&b.length%2!==0)return null;var E=[],A=[],M=[],S="",P=!1;for(var N=0;N<b.length;N++){var R=n.parse(t,b[N],r,"multiple");P=P||Re(R.value),E.push(R.value),M.push(R.pfValue!=null?R.pfValue:R.value),A.push(R.units),S+=(N>0?" ":"")+R.strValue}if(u.validate&&!u.validate(E,A))return null;if(u.singleEnum&&P)if(E.length===1&&Re(E[0]))return{name:t,value:E[0],strValue:E[0],bypass:r};else return null;return{name:t,value:E,pfValue:M,strValue:S,bypass:r,units:A}}var I=function(){for(var Z=0;Z<u.enums.length;Z++){var U=u.enums[Z];if(U===e)return{name:t,value:e,strValue:""+e,bypass:r}}return null};if(u.number){var w,x="px";if(u.units)w=u.units;if(u.implicitUnits)x=u.implicitUnits;if(!u.unitless){if(l){var T="px|em"+(u.allowPercent?"|\\%":"");if(w)T=w;var D=e.match("^("+gt+")("+T+")?$");if(D)e=D[1],w=D[2]||x}else if(!w||u.implicitUnits)w=x}if(e=parseFloat(e),isNaN(e)&&u.enums===void 0)return null;if(isNaN(e)&&u.enums!==void 0)return e=s,I();if(u.integer&&!yf(e))return null;if(u.min!==void 0&&(e<u.min||u.strictMin&&e===u.min)||u.max!==void 0&&(e>u.max||u.strictMax&&e===u.max))return null;var C={name:t,value:e,strValue:""+e+(w?w:""),units:w,bypass:r};if(u.unitless||w!=="px"&&w!=="em")C.pfValue=e;else C.pfValue=w==="px"||!w?e:this.getEmSizeInPixels()*e;if(w==="ms"||w==="s")C.pfValue=w==="ms"?e:1000*e;if(w==="deg"||w==="rad")C.pfValue=w==="rad"?e:Nc(e);if(w==="%")C.pfValue=e/100;return C}else if(u.propList){var O=[],B=""+e;if(B==="none");else{var z=B.split(/\s*,\s*|\s+/);for(var V=0;V<z.length;V++){var k=z[V].trim();if(n.properties[k])O.push(k);else _e("`"+k+"` is not a valid property name")}if(O.length===0)return null}return{name:t,value:O,strValue:O.length===0?"none":O.join(" "),bypass:r}}else if(u.color){var G=xf(e);if(!G)return null;return{name:t,value:G,pfValue:G,strValue:"rgb("+G[0]+","+G[1]+","+G[2]+")",bypass:r}}else if(u.regex||u.regexes){if(u.enums){var J=I();if(J)return J}var X=u.regexes?u.regexes:[u.regex];for(var _=0;_<X.length;_++){var Q=new RegExp(X[_]),q=Q.exec(e);if(q)return{name:t,value:u.singleRegexMatchValue?q[1]:q,strValue:""+e,bypass:r}}return null}else if(u.string)return{name:t,value:""+e,strValue:""+e,bypass:r};else if(u.enums)return I();else return null};var wt=function(e){if(!(this instanceof wt))return new wt(e);if(!vo(e)){it("A style must have a core reference");return}this._private={cy:e,coreStyle:{}},this.length=0,this.resetToDefault()},Mt=wt.prototype;Mt.instanceString=function(){return"style"};Mt.clear=function(){var t=this._private,e=t.cy,r=e.elements();for(var a=0;a<this.length;a++)this[a]=void 0;return this.length=0,t.contextStyles={},t.propDiffs={},this.cleanElements(r,!0),r.forEach(function(n){var i=n[0]._private;i.styleDirty=!0,i.appliedInitStyle=!1}),this};Mt.resetToDefault=function(){return this.clear(),this.addDefaultStylesheet(),this};Mt.core=function(t){return this._private.coreStyle[t]||this.getDefaultProperty(t)};Mt.selector=function(t){var e=t==="core"?null:new Sr(t),r=this.length++;return this[r]={selector:e,properties:[],mappedProperties:[],index:r},this};Mt.css=function(){var t=this,e=arguments;if(e.length===1){var r=e[0];for(var a=0;a<t.properties.length;a++){var n=t.properties[a],i=r[n.name];if(i===void 0)i=r[Zn(n.name)];if(i!==void 0)this.cssRule(n.name,i)}}else if(e.length===2)this.cssRule(e[0],e[1]);return this};Mt.style=Mt.css;Mt.cssRule=function(t,e){var r=this.parse(t,e);if(r){var a=this.length-1;if(this[a].properties.push(r),this[a].properties[r.name]=r,r.name.match(/pie-(\d+)-background-size/)&&r.value)this._private.hasPie=!0;if(r.name.match(/stripe-(\d+)-background-size/)&&r.value)this._private.hasStripe=!0;if(r.mapped)this[a].mappedProperties.push(r);var n=!this[a].selector;if(n)this._private.coreStyle[r.name]=r}return this};Mt.append=function(t){if(bf(t))t.appendToStyle(this);else if(Je(t))this.appendFromJson(t);else if(Re(t))this.appendFromString(t);return this};wt.fromJson=function(t,e){var r=new wt(t);return r.fromJson(e),r};wt.fromString=function(t,e){return new wt(t).fromString(e)};[Et,rn,Mo,jt,ui,Lo,vt,li].forEach(function(t){Oe(Mt,t)});wt.types=Mt.types;wt.properties=Mt.properties;wt.propertyGroups=Mt.propertyGroups;wt.propertyGroupNames=Mt.propertyGroupNames;wt.propertyGroupKeys=Mt.propertyGroupKeys;var Fp={style:function(e){if(e){var r=this.setStyle(e);r.update()}return this._private.style},setStyle:function(e){var r=this._private;if(bf(e))r.style=e.generateStyle(this);else if(Je(e))r.style=wt.fromJson(this,e);else if(Re(e))r.style=wt.fromString(this,e);else r.style=wt(this);return r.style},updateStyle:function(){this.mutableElements().updateStyle()}},zp="single",qr={autolock:function(e){if(e!==void 0)this._private.autolock=e?!0:!1;else return this._private.autolock;return this},autoungrabify:function(e){if(e!==void 0)this._private.autoungrabify=e?!0:!1;else return this._private.autoungrabify;return this},autounselectify:function(e){if(e!==void 0)this._private.autounselectify=e?!0:!1;else return this._private.autounselectify;return this},selectionType:function(e){var r=this._private;if(r.selectionType==null)r.selectionType=zp;if(e!==void 0){if(e==="additive"||e==="single")r.selectionType=e}else return r.selectionType;return this},panningEnabled:function(e){if(e!==void 0)this._private.panningEnabled=e?!0:!1;else return this._private.panningEnabled;return this},userPanningEnabled:function(e){if(e!==void 0)this._private.userPanningEnabled=e?!0:!1;else return this._private.userPanningEnabled;return this},zoomingEnabled:function(e){if(e!==void 0)this._private.zoomingEnabled=e?!0:!1;else return this._private.zoomingEnabled;return this},userZoomingEnabled:function(e){if(e!==void 0)this._private.userZoomingEnabled=e?!0:!1;else return this._private.userZoomingEnabled;return this},boxSelectionEnabled:function(e){if(e!==void 0)this._private.boxSelectionEnabled=e?!0:!1;else return this._private.boxSelectionEnabled;return this},pan:function(){var e=arguments,r=this._private.pan,a,n,i,s,o;switch(e.length){case 0:return r;case 1:if(Re(e[0]))return a=e[0],r[a];else if(We(e[0])){if(!this._private.panningEnabled)return this;if(i=e[0],s=i.x,o=i.y,he(s))r.x=s;if(he(o))r.y=o;this.emit("pan viewport")}break;case 2:if(!this._private.panningEnabled)return this;if(a=e[0],n=e[1],(a==="x"||a==="y")&&he(n))r[a]=n;this.emit("pan viewport");break}return this.notify("viewport"),this},panBy:function(e,r){var a=arguments,n=this._private.pan,i,s,o,l,u;if(!this._private.panningEnabled)return this;switch(a.length){case 1:if(We(e)){if(o=a[0],l=o.x,u=o.y,he(l))n.x+=l;if(he(u))n.y+=u;this.emit("pan viewport")}break;case 2:if(i=e,s=r,(i==="x"||i==="y")&&he(s))n[i]+=s;this.emit("pan viewport");break}return this.notify("viewport"),this},gc:function(){this.notify("gc")},fit:function(e,r){var a=this.getFitViewport(e,r);if(a){var n=this._private;n.zoom=a.zoom,n.pan=a.pan,this.emit("pan zoom viewport"),this.notify("viewport")}return this},getFitViewport:function(e,r){if(he(e)&&r===void 0)r=e,e=void 0;if(!this._private.panningEnabled||!this._private.zoomingEnabled)return;var a;if(Re(e)){var n=e;e=this.$(n)}else if(Ch(e)){var i=e;a={x1:i.x1,y1:i.y1,x2:i.x2,y2:i.y2},a.w=a.x2-a.x1,a.h=a.y2-a.y1}else if(!zt(e))e=this.mutableElements();if(zt(e)&&e.empty())return;a=a||e.boundingBox();var s=this.width(),o=this.height(),l;if(r=he(r)?r:0,!isNaN(s)&&!isNaN(o)&&s>0&&o>0&&!isNaN(a.w)&&!isNaN(a.h)&&a.w>0&&a.h>0){l=Math.min((s-2*r)/a.w,(o-2*r)/a.h),l=l>this._private.maxZoom?this._private.maxZoom:l,l=l<this._private.minZoom?this._private.minZoom:l;var u={x:(s-l*(a.x1+a.x2))/2,y:(o-l*(a.y1+a.y2))/2};return{zoom:l,pan:u}}return},zoomRange:function(e,r){var a=this._private;if(r==null){var n=e;e=n.min,r=n.max}if(he(e)&&he(r)&&e<=r)a.minZoom=e,a.maxZoom=r;else if(he(e)&&r===void 0&&e<=a.maxZoom)a.minZoom=e;else if(he(r)&&e===void 0&&r>=a.minZoom)a.maxZoom=r;return this},minZoom:function(e){if(e===void 0)return this._private.minZoom;else return this.zoomRange({min:e})},maxZoom:function(e){if(e===void 0)return this._private.maxZoom;else return this.zoomRange({max:e})},getZoomedViewport:function(e){var r=this._private,{pan:a,zoom:n}=r,i,s,o=!1;if(!r.zoomingEnabled)o=!0;if(he(e))s=e;else if(We(e)){if(s=e.level,e.position!=null)i=Jn(e.position,n,a);else if(e.renderedPosition!=null)i=e.renderedPosition;if(i!=null&&!r.panningEnabled)o=!0}if(s=s>r.maxZoom?r.maxZoom:s,s=s<r.minZoom?r.minZoom:s,o||!he(s)||s===n||i!=null&&(!he(i.x)||!he(i.y)))return null;if(i!=null){var l=a,u=n,f=s,v={x:-f/u*(i.x-l.x)+i.x,y:-f/u*(i.y-l.y)+i.y};return{zoomed:!0,panned:!0,zoom:f,pan:v}}else return{zoomed:!0,panned:!1,zoom:s,pan:a}},zoom:function(e){if(e===void 0)return this._private.zoom;else{var r=this.getZoomedViewport(e),a=this._private;if(r==null||!r.zoomed)return this;if(a.zoom=r.zoom,r.panned)a.pan.x=r.pan.x,a.pan.y=r.pan.y;return this.emit("zoom"+(r.panned?" pan":"")+" viewport"),this.notify("viewport"),this}},viewport:function(e){var r=this._private,a=!0,n=!0,i=[],s=!1,o=!1;if(!e)return this;if(!he(e.zoom))a=!1;if(!We(e.pan))n=!1;if(!a&&!n)return this;if(a){var l=e.zoom;if(l<r.minZoom||l>r.maxZoom||!r.zoomingEnabled)s=!0;else r.zoom=l,i.push("zoom")}if(n&&(!s||!e.cancelOnFailedZoom)&&r.panningEnabled){var u=e.pan;if(he(u.x))r.pan.x=u.x,o=!1;if(he(u.y))r.pan.y=u.y,o=!1;if(!o)i.push("pan")}if(i.length>0)i.push("viewport"),this.emit(i.join(" ")),this.notify("viewport");return this},center:function(e){var r=this.getCenterPan(e);if(r)this._private.pan=r,this.emit("pan viewport"),this.notify("viewport");return this},getCenterPan:function(e,r){if(!this._private.panningEnabled)return;if(Re(e)){var a=e;e=this.mutableElements().filter(a)}else if(!zt(e))e=this.mutableElements();if(e.length===0)return;var n=e.boundingBox(),i=this.width(),s=this.height();r=r===void 0?this._private.zoom:r;var o={x:(i-r*(n.x1+n.x2))/2,y:(s-r*(n.y1+n.y2))/2};return o},reset:function(){if(!this._private.panningEnabled||!this._private.zoomingEnabled)return this;return this.viewport({pan:{x:0,y:0},zoom:1}),this},invalidateSize:function(){this._private.sizeCache=null},size:function(){var e=this._private,r=e.container,a=this;return e.sizeCache=e.sizeCache||(r?function(){var n=a.window().getComputedStyle(r),i=function(o){return parseFloat(n.getPropertyValue(o))};return{width:r.clientWidth-i("padding-left")-i("padding-right"),height:r.clientHeight-i("padding-top")-i("padding-bottom")}}():{width:1,height:1})},width:function(){return this.size().width},height:function(){return this.size().height},extent:function(){var e=this._private.pan,r=this._private.zoom,a=this.renderedExtent(),n={x1:(a.x1-e.x)/r,x2:(a.x2-e.x)/r,y1:(a.y1-e.y)/r,y2:(a.y2-e.y)/r};return n.w=n.x2-n.x1,n.h=n.y2-n.y1,n},renderedExtent:function(){var e=this.width(),r=this.height();return{x1:0,y1:0,x2:e,y2:r,w:e,h:r}},multiClickDebounceTime:function(e){if(e)this._private.multiClickDebounceTime=e;else return this._private.multiClickDebounceTime;return this}};qr.centre=qr.center;qr.autolockNodes=qr.autolock;qr.autoungrabifyNodes=qr.autoungrabify;var Xa={data:Ze.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:Ze.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:Ze.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Ze.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};Xa.attr=Xa.data;Xa.removeAttr=Xa.removeData;var Wa=function(e){var r=this;e=Oe({},e);var a=e.container;if(a&&!kn(a)&&kn(a[0]))a=a[0];var n=a?a._cyreg:null;if(n=n||{},n&&n.cy)n.cy.destroy(),n={};var i=n.readies=n.readies||[];if(a)a._cyreg=n;n.cy=r;var s=dt!==void 0&&a!==void 0&&!e.headless,o=e;o.layout=Oe({name:s?"grid":"null"},o.layout),o.renderer=Oe({name:s?"canvas":"null"},o.renderer);var l=function(d,g,y){if(g!==void 0)return g;else if(y!==void 0)return y;else return d},u=this._private={container:a,ready:!1,options:o,elements:new Ct(this),listeners:[],aniEles:new Ct(this),data:o.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:0.00000000000000000000000000000000000000000000000001,maxZoom:100000000000000000000000000000000000000000000000000,zoomingEnabled:l(!0,o.zoomingEnabled),userZoomingEnabled:l(!0,o.userZoomingEnabled),panningEnabled:l(!0,o.panningEnabled),userPanningEnabled:l(!0,o.userPanningEnabled),boxSelectionEnabled:l(!0,o.boxSelectionEnabled),autolock:l(!1,o.autolock,o.autolockNodes),autoungrabify:l(!1,o.autoungrabify,o.autoungrabifyNodes),autounselectify:l(!1,o.autounselectify),styleEnabled:o.styleEnabled===void 0?s:o.styleEnabled,zoom:he(o.zoom)?o.zoom:1,pan:{x:We(o.pan)&&he(o.pan.x)?o.pan.x:0,y:We(o.pan)&&he(o.pan.y)?o.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:l(250,o.multiClickDebounceTime)};this.createEmitter(),this.selectionType(o.selectionType),this.zoomRange({min:o.minZoom,max:o.maxZoom});var f=function(d,g){var y=d.some(Sh);if(y)return ga.all(d).then(g);else g(d)};if(u.styleEnabled)r.setStyle([]);var v=Oe({},o,o.renderer);r.initRenderer(v);var h=function(d,g,y){r.notifications(!1);var p=r.mutableElements();if(p.length>0)p.remove();if(d!=null){if(We(d)||Je(d))r.add(d)}r.one("layoutready",function(b){r.notifications(!0),r.emit(b),r.one("load",g),r.emitAndNotify("load")}).one("layoutstop",function(){r.one("done",y),r.emit("done")});var m=Oe({},r._private.options.layout);m.eles=r.elements(),r.layout(m).run()};f([o.style,o.elements],function(c){var d=c[0],g=c[1];if(u.styleEnabled)r.style().append(d);h(g,function(){if(r.startAnimationLoop(),u.ready=!0,st(o.ready))r.on("ready",o.ready);for(var y=0;y<i.length;y++){var p=i[y];r.on("ready",p)}if(n)n.readies=[];r.emit("ready")},o.done)})},qn=Wa.prototype;Oe(qn,{instanceString:function(){return"core"},isReady:function(){return this._private.ready},destroyed:function(){return this._private.destroyed},ready:function(e){if(this.isReady())this.emitter().emit("ready",[],e);else this.on("ready",e);return this},destroy:function(){var e=this;if(e.destroyed())return;return e.stopAnimationLoop(),e.destroyRenderer(),this.emit("destroy"),e._private.destroyed=!0,e},hasElementWithId:function(e){return this._private.elements.hasElementWithId(e)},getElementById:function(e){return this._private.elements.getElementById(e)},hasCompoundNodes:function(){return this._private.hasCompoundNodes},headless:function(){return this._private.renderer.isHeadless()},styleEnabled:function(){return this._private.styleEnabled},addToPool:function(e){return this._private.elements.merge(e),this},removeFromPool:function(e){return this._private.elements.unmerge(e),this},container:function(){return this._private.container||null},window:function(){var e=this._private.container;if(e==null)return dt;var r=this._private.container.ownerDocument;if(r===void 0||r==null)return dt;return r.defaultView||dt},mount:function(e){if(e==null)return;var r=this,a=r._private,n=a.options;if(!kn(e)&&kn(e[0]))e=e[0];return r.stopAnimationLoop(),r.destroyRenderer(),a.container=e,a.styleEnabled=!0,r.invalidateSize(),r.initRenderer(Oe({},n,n.renderer,{name:n.renderer.name==="null"?"canvas":n.renderer.name})),r.startAnimationLoop(),r.style(n.style),r.emit("mount"),r},unmount:function(){var e=this;return e.stopAnimationLoop(),e.destroyRenderer(),e.initRenderer({name:"null"}),e.emit("unmount"),e},options:function(){return Jt(this._private.options)},json:function(e){var r=this,a=r._private,n=r.mutableElements(),i=function(E){return r.getElementById(E.id())};if(We(e)){if(r.startBatch(),e.elements){var s={},o=function(E,A){var M=[],S=[];for(var P=0;P<E.length;P++){var N=E[P];if(!N.data.id){_e("cy.json() cannot handle elements without an ID attribute");continue}var R=""+N.data.id,I=r.getElementById(R);if(s[R]=!0,I.length!==0)S.push({ele:I,json:N});else if(A)N.group=A,M.push(N);else M.push(N)}r.add(M);for(var w=0;w<S.length;w++){var x=S[w],{ele:T,json:D}=x;T.json(D)}};if(Je(e.elements))o(e.elements);else{var l=["nodes","edges"];for(var u=0;u<l.length;u++){var f=l[u],v=e.elements[f];if(Je(v))o(v,f)}}var h=r.collection();n.filter(function(b){return!s[b.id()]}).forEach(function(b){if(b.isParent())h.merge(b);else b.remove()}),h.forEach(function(b){return b.children().move({parent:null})}),h.forEach(function(b){return i(b).remove()})}if(e.style)r.style(e.style);if(e.zoom!=null&&e.zoom!==a.zoom)r.zoom(e.zoom);if(e.pan){if(e.pan.x!==a.pan.x||e.pan.y!==a.pan.y)r.pan(e.pan)}if(e.data)r.data(e.data);var c=["minZoom","maxZoom","zoomingEnabled","userZoomingEnabled","panningEnabled","userPanningEnabled","boxSelectionEnabled","autolock","autoungrabify","autounselectify","multiClickDebounceTime"];for(var d=0;d<c.length;d++){var g=c[d];if(e[g]!=null)r[g](e[g])}return r.endBatch(),this}else{var y=!!e,p={};if(y)p.elements=this.elements().map(function(b){return b.json()});else p.elements={},n.forEach(function(b){var E=b.group();if(!p.elements[E])p.elements[E]=[];p.elements[E].push(b.json())});if(this._private.styleEnabled)p.style=r.style().json();p.data=Jt(r.data());var m=a.options;return p.zoomingEnabled=a.zoomingEnabled,p.userZoomingEnabled=a.userZoomingEnabled,p.zoom=a.zoom,p.minZoom=a.minZoom,p.maxZoom=a.maxZoom,p.panningEnabled=a.panningEnabled,p.userPanningEnabled=a.userPanningEnabled,p.pan=Jt(a.pan),p.boxSelectionEnabled=a.boxSelectionEnabled,p.renderer=Jt(m.renderer),p.hideEdgesOnViewport=m.hideEdgesOnViewport,p.textureOnViewport=m.textureOnViewport,p.wheelSensitivity=m.wheelSensitivity,p.motionBlur=m.motionBlur,p.multiClickDebounceTime=m.multiClickDebounceTime,p}}});qn.$id=qn.getElementById;[Ap,Np,wv,js,Rn,Ip,eo,Pn,Fp,qr,Xa].forEach(function(t){Oe(qn,t)});var Vp={fit:!0,directed:!1,direction:"downward",padding:30,circle:!1,grid:!1,spacingFactor:1.75,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,roots:void 0,depthSort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}},Gp={maximal:!1,acyclic:!1},Qr=function(e){return e.scratch("breadthfirst")},Vl=function(e,r){return e.scratch("breadthfirst",r)};function Ev(t){this.options=Oe({},Vp,Gp,t)}Ev.prototype.run=function(){var t=this.options,{cy:e,eles:r}=t,a=r.nodes().filter(function(ge){return ge.isChildless()}),n=r,i=t.directed,s=t.acyclic||t.maximal||t.maximalAdjustments>0,o=!!t.boundingBox,l=Ot(o?t.boundingBox:structuredClone(e.extent())),u;if(zt(t.roots))u=t.roots;else if(Je(t.roots)){var f=[];for(var v=0;v<t.roots.length;v++){var h=t.roots[v],c=e.getElementById(h);f.push(c)}u=e.collection(f)}else if(Re(t.roots))u=e.$(t.roots);else if(i)u=a.roots();else{var d=r.components();u=e.collection();var g=function(){var ve=d[y],ye=ve.maxDegree(!1),Ee=ve.filter(function(Pe){return Pe.degree(!1)===ye});u=u.add(Ee)};for(var y=0;y<d.length;y++)g()}var p=[],m={},b=function(ve,ye){if(p[ye]==null)p[ye]=[];var Ee=p[ye].length;p[ye].push(ve),Vl(ve,{index:Ee,depth:ye})},E=function(ve,ye){var Ee=Qr(ve),{depth:Pe,index:Me}=Ee;if(p[Pe][Me]=null,ve.isChildless())b(ve,ye)};n.bfs({roots:u,directed:t.directed,visit:function(ve,ye,Ee,Pe,Me){var Ne=ve[0],Fe=Ne.id();if(Ne.isChildless())b(Ne,Me);m[Fe]=!0}});var A=[];for(var M=0;M<a.length;M++){var S=a[M];if(m[S.id()])continue;else A.push(S)}var P=function(ve){var ye=p[ve];for(var Ee=0;Ee<ye.length;Ee++){var Pe=ye[Ee];if(Pe==null){ye.splice(Ee,1),Ee--;continue}Vl(Pe,{depth:ve,index:Ee})}},N=function(ve,ye){var Ee=Qr(ve),Pe=ve.incomers().filter(function(L){return L.isNode()&&r.has(L)}),Me=-1,Ne=ve.id();for(var Fe=0;Fe<Pe.length;Fe++){var ze=Pe[Fe],Ue=Qr(ze);Me=Math.max(Me,Ue.depth)}if(Ee.depth<=Me){if(!t.acyclic&&ye[Ne])return null;var ie=Me+1;return E(ve,ie),ye[Ne]=ie,!0}return!1};if(i&&s){var R=[],I={},w=function(ve){return R.push(ve)},x=function(){return R.shift()};a.forEach(function(ge){return R.push(ge)});while(R.length>0){var T=x(),D=N(T,I);if(D)T.outgoers().filter(function(ge){return ge.isNode()&&r.has(ge)}).forEach(w);else if(D===null){_e("Detected double maximal shift for node `"+T.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}var C=0;if(t.avoidOverlap)for(var O=0;O<a.length;O++){var B=a[O],z=B.layoutDimensions(t),{w:V,h:k}=z;C=Math.max(C,V,k)}var G={},J=function(ve){if(G[ve.id()])return G[ve.id()];var ye=Qr(ve).depth,Ee=ve.neighborhood(),Pe=0,Me=0;for(var Ne=0;Ne<Ee.length;Ne++){var Fe=Ee[Ne];if(Fe.isEdge()||Fe.isParent()||!a.has(Fe))continue;var ze=Qr(Fe);if(ze==null)continue;var{index:Ue,depth:ie}=ze;if(Ue==null||ie==null)continue;var L=p[ie].length;if(ie<ye)Pe+=Ue/L,Me++}if(Me=Math.max(1,Me),Pe=Pe/Me,Me===0)Pe=0;return G[ve.id()]=Pe,Pe},X=function(ve,ye){var Ee=J(ve),Pe=J(ye),Me=Ee-Pe;if(Me===0)return Ef(ve.id(),ye.id());else return Me};if(t.depthSort!==void 0)X=t.depthSort;var _=p.length;for(var Q=0;Q<_;Q++)p[Q].sort(X),P(Q);var q=[];for(var te=0;te<A.length;te++)q.push(A[te]);var Z=function(){for(var ve=0;ve<_;ve++)P(ve)};if(q.length)p.unshift(q),_=p.length,Z();var U=0;for(var W=0;W<_;W++)U=Math.max(p[W].length,U);var j={x:l.x1+l.w/2,y:l.y1+l.h/2},re=a.reduce(function(ge,ve){return function(ye){return{w:ge.w===-1?ye.w:(ge.w+ye.w)/2,h:ge.h===-1?ye.h:(ge.h+ye.h)/2}}(ve.boundingBox({includeLabels:t.nodeDimensionsIncludeLabels}))},{w:-1,h:-1}),ee=Math.max(_===1?0:o?(l.h-t.padding*2-re.h)/(_-1):(l.h-t.padding*2-re.h)/(_+1),C),de=p.reduce(function(ge,ve){return Math.max(ge,ve.length)},0),Ae=function(ve){var ye=Qr(ve),{depth:Ee,index:Pe}=ye;if(t.circle){var Me=Math.min(l.w/2/_,l.h/2/_);Me=Math.max(Me,C);var Ne=Me*Ee+Me-(_>0&&p[0].length<=3?Me/2:0),Fe=2*Math.PI/p[Ee].length*Pe;if(Ee===0&&p[0].length===1)Ne=1;return{x:j.x+Ne*Math.cos(Fe),y:j.y+Ne*Math.sin(Fe)}}else{var ze=p[Ee].length,Ue=Math.max(ze===1?0:o?(l.w-t.padding*2-re.w)/((t.grid?de:ze)-1):(l.w-t.padding*2-re.w)/((t.grid?de:ze)+1),C),ie={x:j.x+(Pe+1-(ze+1)/2)*Ue,y:j.y+(Ee+1-(_+1)/2)*ee};return ie}},Ce={downward:0,leftward:90,upward:180,rightward:-90};if(Object.keys(Ce).indexOf(t.direction)===-1)it("Invalid direction '".concat(t.direction,"' specified for breadthfirst layout. Valid values are: ").concat(Object.keys(Ce).join(", ")));var Se=function(ve){return ec(Ae(ve),l,Ce[t.direction])};return r.nodes().layoutPositions(this,t,Se),this};var Up={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,radius:void 0,startAngle:1.5*Math.PI,sweep:void 0,clockwise:!0,sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function xv(t){this.options=Oe({},Up,t)}xv.prototype.run=function(){var t=this.options,e=t,r=t.cy,a=e.eles,n=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,i=a.nodes().not(":parent");if(e.sort)i=i.sort(e.sort);var s=Ot(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),o={x:s.x1+s.w/2,y:s.y1+s.h/2},l=e.sweep===void 0?2*Math.PI-2*Math.PI/i.length:e.sweep,u=l/Math.max(1,i.length-1),f,v=0;for(var h=0;h<i.length;h++){var c=i[h],d=c.layoutDimensions(e),{w:g,h:y}=d;v=Math.max(v,g,y)}if(he(e.radius))f=e.radius;else if(i.length<=1)f=0;else f=Math.min(s.h,s.w)/2-v;if(i.length>1&&e.avoidOverlap){v*=1.75;var p=Math.cos(u)-Math.cos(0),m=Math.sin(u)-Math.sin(0),b=Math.sqrt(v*v/(p*p+m*m));f=Math.max(b,f)}var E=function(M,S){var P=e.startAngle+S*u*(n?1:-1),N=f*Math.cos(P),R=f*Math.sin(P),I={x:o.x+N,y:o.y+R};return I};return a.nodes().layoutPositions(this,e,E),this};var Hp={fit:!0,padding:30,startAngle:1.5*Math.PI,sweep:void 0,clockwise:!0,equidistant:!1,minNodeSpacing:10,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,height:void 0,width:void 0,spacingFactor:void 0,concentric:function(e){return e.degree()},levelWidth:function(e){return e.maxDegree()/4},animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function Tv(t){this.options=Oe({},Hp,t)}Tv.prototype.run=function(){var t=this.options,e=t,r=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,a=t.cy,n=e.eles,i=n.nodes().not(":parent"),s=Ot(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:a.width(),h:a.height()}),o={x:s.x1+s.w/2,y:s.y1+s.h/2},l=[],u=0;for(var f=0;f<i.length;f++){var v=i[f],h=void 0;h=e.concentric(v),l.push({value:h,node:v}),v._private.scratch.concentric=h}i.updateStyle();for(var c=0;c<i.length;c++){var d=i[c],g=d.layoutDimensions(e);u=Math.max(u,g.w,g.h)}l.sort(function(ee,de){return de.value-ee.value});var y=e.levelWidth(i),p=[[]],m=p[0];for(var b=0;b<l.length;b++){var E=l[b];if(m.length>0){var A=Math.abs(m[0].value-E.value);if(A>=y)m=[],p.push(m)}m.push(E)}var M=u+e.minNodeSpacing;if(!e.avoidOverlap){var S=p.length>0&&p[0].length>1,P=Math.min(s.w,s.h)/2-M,N=P/(p.length+S?1:0);M=Math.min(M,N)}var R=0;for(var I=0;I<p.length;I++){var w=p[I],x=e.sweep===void 0?2*Math.PI-2*Math.PI/w.length:e.sweep,T=w.dTheta=x/Math.max(1,w.length-1);if(w.length>1&&e.avoidOverlap){var D=Math.cos(T)-Math.cos(0),C=Math.sin(T)-Math.sin(0),O=Math.sqrt(M*M/(D*D+C*C));R=Math.max(O,R)}w.r=R,R+=M}if(e.equidistant){var B=0,z=0;for(var V=0;V<p.length;V++){var k=p[V],G=k.r-z;B=Math.max(B,G)}z=0;for(var J=0;J<p.length;J++){var X=p[J];if(J===0)z=X.r;X.r=z,z+=B}}var _={};for(var Q=0;Q<p.length;Q++){var q=p[Q],{dTheta:te,r:Z}=q;for(var U=0;U<q.length;U++){var W=q[U],j=e.startAngle+(r?1:-1)*te*U,re={x:o.x+Z*Math.cos(j),y:o.y+Z*Math.sin(j)};_[W.node.id()]=re}}return n.nodes().layoutPositions(this,e,function(ee){var de=ee.id();return _[de]}),this};var Bs,qp={ready:function(){},stop:function(){},animate:!0,animationEasing:void 0,animationDuration:void 0,animateFilter:function(e,r){return!0},animationThreshold:250,refresh:20,fit:!0,padding:30,boundingBox:void 0,nodeDimensionsIncludeLabels:!1,randomize:!1,componentSpacing:40,nodeRepulsion:function(e){return 2048},nodeOverlap:4,idealEdgeLength:function(e){return 32},edgeElasticity:function(e){return 32},nestingFactor:1.2,gravity:1,numIter:1000,initialTemp:1000,coolingFactor:0.99,minTemp:1};function fi(t){this.options=Oe({},qp,t),this.options.layout=this;var e=this.options.eles.nodes(),r=this.options.eles.edges(),a=r.filter(function(n){var i=n.source().data("id"),s=n.target().data("id"),o=e.some(function(u){return u.data("id")===i}),l=e.some(function(u){return u.data("id")===s});return!o||!l});this.options.eles=this.options.eles.not(a)}fi.prototype.run=function(){var t=this.options,e=t.cy,r=this;if(r.stopped=!1,t.animate===!0||t.animate===!1)r.emit({type:"layoutstart",layout:r});if(t.debug===!0)Bs=!0;else Bs=!1;var a=Yp(e,r,t);if(Bs)Wp(a);if(t.randomize)$p(a);var n=ir(),i=function(){if(Kp(a,e,t),t.fit===!0)e.fit(t.padding)},s=function(h){if(r.stopped||h>=t.numIter)return!1;if(Zp(a,t),a.temperature=a.temperature*t.coolingFactor,a.temperature<t.minTemp)return!1;return!0},o=function(){if(t.animate===!0||t.animate===!1)i(),r.one("layoutstop",t.stop),r.emit({type:"layoutstop",layout:r});else{var h=t.eles.nodes(),c=Sv(a,t,h);h.layoutPositions(r,t,c)}},l=0,u=!0;if(t.animate===!0){var f=function(){var h=0;while(u&&h<t.refresh)u=s(l),l++,h++;if(!u)Ul(a,t),o();else{var c=ir();if(c-n>=t.animationThreshold)i();Fn(f)}};f()}else{while(u)u=s(l),l++;Ul(a,t),o()}return this};fi.prototype.stop=function(){if(this.stopped=!0,this.thread)this.thread.stop();return this.emit("layoutstop"),this};fi.prototype.destroy=function(){if(this.thread)this.thread.stop();return this};var Yp=function(e,r,a){var n=a.eles.edges(),i=a.eles.nodes(),s=Ot(a.boundingBox?a.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),o={isCompound:e.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:i.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:n.size(),temperature:a.initialTemp,clientWidth:s.w,clientHeight:s.h,boundingBox:s},l=a.eles.components(),u={};for(var f=0;f<l.length;f++){var v=l[f];for(var h=0;h<v.length;h++){var c=v[h];u[c.id()]=f}}for(var f=0;f<o.nodeSize;f++){var d=i[f],g=d.layoutDimensions(a),y={};y.isLocked=d.locked(),y.id=d.data("id"),y.parentId=d.data("parent"),y.cmptId=u[d.id()],y.children=[],y.positionX=d.position("x"),y.positionY=d.position("y"),y.offsetX=0,y.offsetY=0,y.height=g.w,y.width=g.h,y.maxX=y.positionX+y.width/2,y.minX=y.positionX-y.width/2,y.maxY=y.positionY+y.height/2,y.minY=y.positionY-y.height/2,y.padLeft=parseFloat(d.style("padding")),y.padRight=parseFloat(d.style("padding")),y.padTop=parseFloat(d.style("padding")),y.padBottom=parseFloat(d.style("padding")),y.nodeRepulsion=st(a.nodeRepulsion)?a.nodeRepulsion(d):a.nodeRepulsion,o.layoutNodes.push(y),o.idToIndex[y.id]=f}var p=[],m=0,b=-1,E=[];for(var f=0;f<o.nodeSize;f++){var d=o.layoutNodes[f],A=d.parentId;if(A!=null)o.layoutNodes[o.idToIndex[A]].children.push(d.id);else p[++b]=d.id,E.push(d.id)}o.graphSet.push(E);while(m<=b){var M=p[m++],S=o.idToIndex[M],c=o.layoutNodes[S],P=c.children;if(P.length>0){o.graphSet.push(P);for(var f=0;f<P.length;f++)p[++b]=P[f]}}for(var f=0;f<o.graphSet.length;f++){var N=o.graphSet[f];for(var h=0;h<N.length;h++){var R=o.idToIndex[N[h]];o.indexToGraph[R]=f}}for(var f=0;f<o.edgeSize;f++){var I=n[f],w={};w.id=I.data("id"),w.sourceId=I.data("source"),w.targetId=I.data("target");var x=st(a.idealEdgeLength)?a.idealEdgeLength(I):a.idealEdgeLength,T=st(a.edgeElasticity)?a.edgeElasticity(I):a.edgeElasticity,D=o.idToIndex[w.sourceId],C=o.idToIndex[w.targetId],O=o.indexToGraph[D],B=o.indexToGraph[C];if(O!=B){var z=Xp(w.sourceId,w.targetId,o),V=o.graphSet[z],k=0,y=o.layoutNodes[D];while(V.indexOf(y.id)===-1)y=o.layoutNodes[o.idToIndex[y.parentId]],k++;y=o.layoutNodes[C];while(V.indexOf(y.id)===-1)y=o.layoutNodes[o.idToIndex[y.parentId]],k++;x*=k*a.nestingFactor}w.idealLength=x,w.elasticity=T,o.layoutEdges.push(w)}return o},Xp=function(e,r,a){var n=Cv(e,r,0,a);if(2>n.count)return 0;else return n.graph},Cv=function(e,r,a,n){var i=n.graphSet[a];if(-1<i.indexOf(e)&&-1<i.indexOf(r))return{count:2,graph:a};var s=0;for(var o=0;o<i.length;o++){var l=i[o],u=n.idToIndex[l],f=n.layoutNodes[u].children;if(f.length===0)continue;var v=n.indexToGraph[n.idToIndex[f[0]]],h=Cv(e,r,v,n);if(h.count===0)continue;else if(h.count===1){if(s++,s===2)break}else return h}return{count:s,graph:a}},Wp,$p=function(e,r){var{clientWidth:a,clientHeight:n}=e;for(var i=0;i<e.nodeSize;i++){var s=e.layoutNodes[i];if(s.children.length===0&&!s.isLocked)s.positionX=Math.random()*a,s.positionY=Math.random()*n}},Sv=function(e,r,a){var n=e.boundingBox,i={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0};if(r.boundingBox)a.forEach(function(s){var o=e.layoutNodes[e.idToIndex[s.data("id")]];i.x1=Math.min(i.x1,o.positionX),i.x2=Math.max(i.x2,o.positionX),i.y1=Math.min(i.y1,o.positionY),i.y2=Math.max(i.y2,o.positionY)}),i.w=i.x2-i.x1,i.h=i.y2-i.y1;return function(s,o){var l=e.layoutNodes[e.idToIndex[s.data("id")]];if(r.boundingBox){var u=i.w===0?0.5:(l.positionX-i.x1)/i.w,f=i.h===0?0.5:(l.positionY-i.y1)/i.h;return{x:n.x1+u*n.w,y:n.y1+f*n.h}}else return{x:l.positionX,y:l.positionY}}},Kp=function(e,r,a){var n=a.layout,i=a.eles.nodes(),s=Sv(e,a,i);if(i.positions(s),e.ready!==!0)e.ready=!0,n.one("layoutready",a.ready),n.emit({type:"layoutready",layout:this})},Zp=function(e,r,a){_p(e,r),jp(e),ey(e,r),ty(e),ry(e)},_p=function(e,r){for(var a=0;a<e.graphSet.length;a++){var n=e.graphSet[a],i=n.length;for(var s=0;s<i;s++){var o=e.layoutNodes[e.idToIndex[n[s]]];for(var l=s+1;l<i;l++){var u=e.layoutNodes[e.idToIndex[n[l]]];Qp(o,u,e,r)}}}},Gl=function(e){return-e+2*e*Math.random()},Qp=function(e,r,a,n){var i=e.cmptId,s=r.cmptId;if(i!==s&&!a.isCompound)return;var o=r.positionX-e.positionX,l=r.positionY-e.positionY,u=1;if(o===0&&l===0)o=Gl(u),l=Gl(u);var f=Jp(e,r,o,l);if(f>0)var v=n.nodeOverlap*f,h=Math.sqrt(o*o+l*l),c=v*o/h,d=v*l/h;else var g=Yn(e,o,l),y=Yn(r,-1*o,-1*l),p=y.x-g.x,m=y.y-g.y,b=p*p+m*m,h=Math.sqrt(b),v=(e.nodeRepulsion+r.nodeRepulsion)/b,c=v*p/h,d=v*m/h;if(!e.isLocked)e.offsetX-=c,e.offsetY-=d;if(!r.isLocked)r.offsetX+=c,r.offsetY+=d;return},Jp=function(e,r,a,n){if(a>0)var i=e.maxX-r.minX;else var i=r.maxX-e.minX;if(n>0)var s=e.maxY-r.minY;else var s=r.maxY-e.minY;if(i>=0&&s>=0)return Math.sqrt(i*i+s*s);else return 0},Yn=function(e,r,a){var{positionX:n,positionY:i}=e,s=e.height||1,o=e.width||1,l=a/r,u=s/o,f={};if(r===0&&0<a)return f.x=n,f.y=i+s/2,f;if(r===0&&0>a)return f.x=n,f.y=i+s/2,f;if(0<r&&-1*u<=l&&l<=u)return f.x=n+o/2,f.y=i+o*a/2/r,f;if(0>r&&-1*u<=l&&l<=u)return f.x=n-o/2,f.y=i-o*a/2/r,f;if(0<a&&(l<=-1*u||l>=u))return f.x=n+s*r/2/a,f.y=i+s/2,f;if(0>a&&(l<=-1*u||l>=u))return f.x=n-s*r/2/a,f.y=i-s/2,f;return f},jp=function(e,r){for(var a=0;a<e.edgeSize;a++){var n=e.layoutEdges[a],i=e.idToIndex[n.sourceId],s=e.layoutNodes[i],o=e.idToIndex[n.targetId],l=e.layoutNodes[o],u=l.positionX-s.positionX,f=l.positionY-s.positionY;if(u===0&&f===0)continue;var v=Yn(s,u,f),h=Yn(l,-1*u,-1*f),c=h.x-v.x,d=h.y-v.y,g=Math.sqrt(c*c+d*d),y=Math.pow(n.idealLength-g,2)/n.elasticity;if(g!==0)var p=y*c/g,m=y*d/g;else var p=0,m=0;if(!s.isLocked)s.offsetX+=p,s.offsetY+=m;if(!l.isLocked)l.offsetX-=p,l.offsetY-=m}},ey=function(e,r){if(r.gravity===0)return;var a=1;for(var n=0;n<e.graphSet.length;n++){var i=e.graphSet[n],s=i.length;if(n===0)var o=e.clientHeight/2,l=e.clientWidth/2;else var u=e.layoutNodes[e.idToIndex[i[0]]],f=e.layoutNodes[e.idToIndex[u.parentId]],{positionX:o,positionY:l}=f;for(var v=0;v<s;v++){var h=e.layoutNodes[e.idToIndex[i[v]]];if(h.isLocked)continue;var c=o-h.positionX,d=l-h.positionY,g=Math.sqrt(c*c+d*d);if(g>a){var y=r.gravity*c/g,p=r.gravity*d/g;h.offsetX+=y,h.offsetY+=p}}}},ty=function(e,r){var a=[],n=0,i=-1;a.push.apply(a,e.graphSet[0]),i+=e.graphSet[0].length;while(n<=i){var s=a[n++],o=e.idToIndex[s],l=e.layoutNodes[o],u=l.children;if(0<u.length&&!l.isLocked){var{offsetX:f,offsetY:v}=l;for(var h=0;h<u.length;h++){var c=e.layoutNodes[e.idToIndex[u[h]]];c.offsetX+=f,c.offsetY+=v,a[++i]=u[h]}l.offsetX=0,l.offsetY=0}}},ry=function(e,r){for(var a=0;a<e.nodeSize;a++){var n=e.layoutNodes[a];if(0<n.children.length)n.maxX=void 0,n.minX=void 0,n.maxY=void 0,n.minY=void 0}for(var a=0;a<e.nodeSize;a++){var n=e.layoutNodes[a];if(0<n.children.length||n.isLocked)continue;var i=ay(n.offsetX,n.offsetY,e.temperature);n.positionX+=i.x,n.positionY+=i.y,n.offsetX=0,n.offsetY=0,n.minX=n.positionX-n.width,n.maxX=n.positionX+n.width,n.minY=n.positionY-n.height,n.maxY=n.positionY+n.height,Dv(n,e)}for(var a=0;a<e.nodeSize;a++){var n=e.layoutNodes[a];if(0<n.children.length&&!n.isLocked)n.positionX=(n.maxX+n.minX)/2,n.positionY=(n.maxY+n.minY)/2,n.width=n.maxX-n.minX,n.height=n.maxY-n.minY}},ay=function(e,r,a){var n=Math.sqrt(e*e+r*r);if(n>a)var i={x:a*e/n,y:a*r/n};else var i={x:e,y:r};return i},Dv=function(e,r){var a=e.parentId;if(a==null)return;var n=r.layoutNodes[r.idToIndex[a]],i=!1;if(n.maxX==null||e.maxX+n.padRight>n.maxX)n.maxX=e.maxX+n.padRight,i=!0;if(n.minX==null||e.minX-n.padLeft<n.minX)n.minX=e.minX-n.padLeft,i=!0;if(n.maxY==null||e.maxY+n.padBottom>n.maxY)n.maxY=e.maxY+n.padBottom,i=!0;if(n.minY==null||e.minY-n.padTop<n.minY)n.minY=e.minY-n.padTop,i=!0;if(i)return Dv(n,r);return},Ul=function(e,r){var a=e.layoutNodes,n=[];for(var i=0;i<a.length;i++){var s=a[i],o=s.cmptId,l=n[o]=n[o]||[];l.push(s)}var u=0;for(var i=0;i<n.length;i++){var f=n[i];if(!f)continue;f.x1=1/0,f.x2=-1/0,f.y1=1/0,f.y2=-1/0;for(var v=0;v<f.length;v++){var h=f[v];f.x1=Math.min(f.x1,h.positionX-h.width/2),f.x2=Math.max(f.x2,h.positionX+h.width/2),f.y1=Math.min(f.y1,h.positionY-h.height/2),f.y2=Math.max(f.y2,h.positionY+h.height/2)}f.w=f.x2-f.x1,f.h=f.y2-f.y1,u+=f.w*f.h}n.sort(function(m,b){return b.w*b.h-m.w*m.h});var c=0,d=0,g=0,y=0,p=Math.sqrt(u)*e.clientWidth/e.clientHeight;for(var i=0;i<n.length;i++){var f=n[i];if(!f)continue;for(var v=0;v<f.length;v++){var h=f[v];if(!h.isLocked)h.positionX+=c-f.x1,h.positionY+=d-f.y1}if(c+=f.w+r.componentSpacing,g+=f.w+r.componentSpacing,y=Math.max(y,f.h),g>p)d+=y+r.componentSpacing,c=0,g=0,y=0}},ny={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,avoidOverlapPadding:10,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,condense:!1,rows:void 0,cols:void 0,position:function(e){},sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function Av(t){this.options=Oe({},ny,t)}Av.prototype.run=function(){var t=this.options,e=t,r=t.cy,a=e.eles,n=a.nodes().not(":parent");if(e.sort)n=n.sort(e.sort);var i=Ot(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()});if(i.h===0||i.w===0)a.nodes().layoutPositions(this,e,function(J){return{x:i.x1,y:i.y1}});else{var s=n.size(),o=Math.sqrt(s*i.h/i.w),l=Math.round(o),u=Math.round(i.w/i.h*o),f=function(X){if(X==null)return Math.min(l,u);else{var _=Math.min(l,u);if(_==l)l=X;else u=X}},v=function(X){if(X==null)return Math.max(l,u);else{var _=Math.max(l,u);if(_==l)l=X;else u=X}},h=e.rows,c=e.cols!=null?e.cols:e.columns;if(h!=null&&c!=null)l=h,u=c;else if(h!=null&&c==null)l=h,u=Math.ceil(s/l);else if(h==null&&c!=null)u=c,l=Math.ceil(s/u);else if(u*l>s){var d=f(),g=v();if((d-1)*g>=s)f(d-1);else if((g-1)*d>=s)v(g-1)}else while(u*l<s){var y=f(),p=v();if((p+1)*y>=s)v(p+1);else f(y+1)}var m=i.w/u,b=i.h/l;if(e.condense)m=0,b=0;if(e.avoidOverlap)for(var E=0;E<n.length;E++){var A=n[E],M=A._private.position;if(M.x==null||M.y==null)M.x=0,M.y=0;var S=A.layoutDimensions(e),P=e.avoidOverlapPadding,N=S.w+P,R=S.h+P;m=Math.max(m,N),b=Math.max(b,R)}var I={},w=function(X,_){return I["c-"+X+"-"+_]?!0:!1},x=function(X,_){I["c-"+X+"-"+_]=!0},T=0,D=0,C=function(){if(D++,D>=u)D=0,T++},O={};for(var B=0;B<n.length;B++){var z=n[B],V=e.position(z);if(V&&(V.row!==void 0||V.col!==void 0)){var k={row:V.row,col:V.col};if(k.col===void 0){k.col=0;while(w(k.row,k.col))k.col++}else if(k.row===void 0){k.row=0;while(w(k.row,k.col))k.row++}O[z.id()]=k,x(k.row,k.col)}}var G=function(X,_){var Q,q;if(X.locked()||X.isParent())return!1;var te=O[X.id()];if(te)Q=te.col*m+m/2+i.x1,q=te.row*b+b/2+i.y1;else{while(w(T,D))C();Q=D*m+m/2+i.x1,q=T*b+b/2+i.y1,x(T,D),C()}return{x:Q,y:q}};n.layoutPositions(this,e,G)}return this};var iy={ready:function(){},stop:function(){}};function Ro(t){this.options=Oe({},iy,t)}Ro.prototype.run=function(){var t=this.options,e=t.eles,r=this;return t.cy,r.emit("layoutstart"),e.nodes().positions(function(){return{x:0,y:0}}),r.one("layoutready",t.ready),r.emit("layoutready"),r.one("layoutstop",t.stop),r.emit("layoutstop"),this};Ro.prototype.stop=function(){return this};var sy={positions:void 0,zoom:void 0,pan:void 0,fit:!0,padding:30,spacingFactor:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function Mv(t){this.options=Oe({},sy,t)}Mv.prototype.run=function(){var t=this.options,e=t.eles,r=e.nodes(),a=st(t.positions);function n(i){if(t.positions==null)return Dc(i.position());if(a)return t.positions(i);var s=t.positions[i._private.data.id];if(s==null)return null;return s}return r.layoutPositions(this,t,function(i,s){var o=n(i);if(i.locked()||o==null)return!1;return o}),this};var oy={fit:!0,padding:30,boundingBox:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function Lv(t){this.options=Oe({},oy,t)}Lv.prototype.run=function(){var t=this.options,{cy:e,eles:r}=t,a=Ot(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),n=function(s,o){return{x:a.x1+Math.round(Math.random()*a.w),y:a.y1+Math.round(Math.random()*a.h)}};return r.nodes().layoutPositions(this,t,n),this};var uy=[{name:"breadthfirst",impl:Ev},{name:"circle",impl:xv},{name:"concentric",impl:Tv},{name:"cose",impl:fi},{name:"grid",impl:Av},{name:"null",impl:Ro},{name:"preset",impl:Mv},{name:"random",impl:Lv}];function Rv(t){this.options=t,this.notifications=0}var Hl=function(){},ql=function(){throw Error("A headless instance can not render images")};Rv.prototype={recalculateRenderedStyle:Hl,notify:function(){this.notifications++},init:Hl,isHeadless:function(){return!0},png:ql,jpg:ql};var Po={};Po.arrowShapeWidth=0.3;Po.registerArrowShapes=function(){var t=this.arrowShapes={},e=this,r=function(u,f,v,h,c,d,g){var y=c.x-v/2-g,p=c.x+v/2+g,m=c.y-v/2-g,b=c.y+v/2+g,E=y<=u&&u<=p&&m<=f&&f<=b;return E},a=function(u,f,v,h,c){var d=u*Math.cos(h)-f*Math.sin(h),g=u*Math.sin(h)+f*Math.cos(h),y=d*v,p=g*v,m=y+c.x,b=p+c.y;return{x:m,y:b}},n=function(u,f,v,h){var c=[];for(var d=0;d<u.length;d+=2){var g=u[d],y=u[d+1];c.push(a(g,y,f,v,h))}return c},i=function(u){var f=[];for(var v=0;v<u.length;v++){var h=u[v];f.push(h.x,h.y)}return f},s=function(u){return u.pstyle("width").pfValue*u.pstyle("arrow-scale").pfValue*2},o=function(u,f){if(Re(f))f=t[f];t[u]=Oe({name:u,points:[-0.15,-0.3,0.15,-0.3,0.15,0.3,-0.15,0.3],collide:function(h,c,d,g,y,p){var m=i(n(this.points,d+2*p,g,y)),b=Bt(h,c,m);return b},roughCollide:r,draw:function(h,c,d,g){var y=n(this.points,c,d,g);e.arrowShapeImpl("polygon")(h,y)},spacing:function(h){return 0},gap:s},f)};o("none",{collide:zn,roughCollide:zn,draw:po,spacing:au,gap:au}),o("triangle",{points:[-0.15,-0.3,0,0,0.15,-0.3]}),o("arrow","triangle"),o("triangle-backcurve",{points:t.triangle.points,controlPoint:[0,-0.15],roughCollide:r,draw:function(u,f,v,h,c){var d=n(this.points,f,v,h),g=this.controlPoint,y=a(g[0],g[1],f,v,h);e.arrowShapeImpl(this.name)(u,d,y)},gap:function(u){return s(u)*0.8}}),o("triangle-tee",{points:[0,0,0.15,-0.3,-0.15,-0.3,0,0],pointsTee:[-0.15,-0.4,-0.15,-0.5,0.15,-0.5,0.15,-0.4],collide:function(u,f,v,h,c,d,g){var y=i(n(this.points,v+2*g,h,c)),p=i(n(this.pointsTee,v+2*g,h,c)),m=Bt(u,f,y)||Bt(u,f,p);return m},draw:function(u,f,v,h,c){var d=n(this.points,f,v,h),g=n(this.pointsTee,f,v,h);e.arrowShapeImpl(this.name)(u,d,g)}}),o("circle-triangle",{radius:0.15,pointsTr:[0,-0.15,0.15,-0.45,-0.15,-0.45,0,-0.15],collide:function(u,f,v,h,c,d,g){var y=c,p=Math.pow(y.x-u,2)+Math.pow(y.y-f,2)<=Math.pow((v+2*g)*this.radius,2),m=i(n(this.points,v+2*g,h,c));return Bt(u,f,m)||p},draw:function(u,f,v,h,c){var d=n(this.pointsTr,f,v,h);e.arrowShapeImpl(this.name)(u,d,h.x,h.y,this.radius*f)},spacing:function(u){return e.getArrowWidth(u.pstyle("width").pfValue,u.pstyle("arrow-scale").value)*this.radius}}),o("triangle-cross",{points:[0,0,0.15,-0.3,-0.15,-0.3,0,0],baseCrossLinePts:[-0.15,-0.4,-0.15,-0.4,0.15,-0.4,0.15,-0.4],crossLinePts:function(u,f){var v=this.baseCrossLinePts.slice(),h=f/u,c=3,d=5;return v[c]=v[c]-h,v[d]=v[d]-h,v},collide:function(u,f,v,h,c,d,g){var y=i(n(this.points,v+2*g,h,c)),p=i(n(this.crossLinePts(v,d),v+2*g,h,c)),m=Bt(u,f,y)||Bt(u,f,p);return m},draw:function(u,f,v,h,c){var d=n(this.points,f,v,h),g=n(this.crossLinePts(f,c),f,v,h);e.arrowShapeImpl(this.name)(u,d,g)}}),o("vee",{points:[-0.15,-0.3,0,0,0.15,-0.3,0,-0.15],gap:function(u){return s(u)*0.525}}),o("circle",{radius:0.15,collide:function(u,f,v,h,c,d,g){var y=c,p=Math.pow(y.x-u,2)+Math.pow(y.y-f,2)<=Math.pow((v+2*g)*this.radius,2);return p},draw:function(u,f,v,h,c){e.arrowShapeImpl(this.name)(u,h.x,h.y,this.radius*f)},spacing:function(u){return e.getArrowWidth(u.pstyle("width").pfValue,u.pstyle("arrow-scale").value)*this.radius}}),o("tee",{points:[-0.15,0,-0.15,-0.1,0.15,-0.1,0.15,0],spacing:function(u){return 1},gap:function(u){return 1}}),o("square",{points:[-0.15,0,0.15,0,0.15,-0.3,-0.15,-0.3]}),o("diamond",{points:[-0.15,-0.15,0,-0.3,0.15,-0.15,0,0],gap:function(u){return u.pstyle("width").pfValue*u.pstyle("arrow-scale").value}}),o("chevron",{points:[0,0,-0.15,-0.15,-0.1,-0.2,0,-0.1,0.1,-0.2,0.15,-0.15],gap:function(u){return 0.95*u.pstyle("width").pfValue*u.pstyle("arrow-scale").value}})};var Xr={};Xr.projectIntoViewport=function(t,e){var r=this.cy,a=this.findContainerClientCoords(),n=a[0],i=a[1],s=a[4],o=r.pan(),l=r.zoom(),u=((t-n)/s-o.x)/l,f=((e-i)/s-o.y)/l;return[u,f]};Xr.findContainerClientCoords=function(){if(this.containerBB)return this.containerBB;var t=this.container,e=t.getBoundingClientRect(),r=this.cy.window().getComputedStyle(t),a=function(p){return parseFloat(r.getPropertyValue(p))},n={left:a("padding-left"),right:a("padding-right"),top:a("padding-top"),bottom:a("padding-bottom")},i={left:a("border-left-width"),right:a("border-right-width"),top:a("border-top-width"),bottom:a("border-bottom-width")},{clientWidth:s,clientHeight:o}=t,l=n.left+n.right,u=n.top+n.bottom,f=i.left+i.right,v=e.width/(s+f),h=s-l,c=o-u,d=e.left+n.left+i.left,g=e.top+n.top+i.top;return this.containerBB=[d,g,h,c,v]};Xr.invalidateContainerClientCoordsCache=function(){this.containerBB=null};Xr.findNearestElement=function(t,e,r,a){return this.findNearestElements(t,e,r,a)[0]};Xr.findNearestElements=function(t,e,r,a){var n=this,i=this,s=i.getCachedZSortedEles(),o=[],l=i.cy.zoom(),u=i.cy.hasCompoundNodes(),f=(a?24:8)/l,v=(a?8:2)/l,h=(a?8:2)/l,c=1/0,d,g;if(r)s=s.interactive;function y(S,P){if(S.isNode())if(g)return;else g=S,o.push(S);if(S.isEdge()&&(P==null||P<c))if(d){if(d.pstyle("z-compound-depth").value===S.pstyle("z-compound-depth").value&&d.pstyle("z-compound-depth").value===S.pstyle("z-compound-depth").value){for(var N=0;N<o.length;N++)if(o[N].isEdge()){o[N]=S,d=S,c=P!=null?P:c;break}}}else o.push(S),d=S,c=P!=null?P:c}function p(S){var P=S.outerWidth()+2*v,N=S.outerHeight()+2*v,R=P/2,I=N/2,w=S.position(),x=S.pstyle("corner-radius").value==="auto"?"auto":S.pstyle("corner-radius").pfValue,T=S._private.rscratch;if(w.x-R<=t&&t<=w.x+R&&w.y-I<=e&&e<=w.y+I){var D=i.nodeShapes[n.getNodeShape(S)];if(D.checkPoint(t,e,0,P,N,w.x,w.y,x,T))return y(S,0),!0}}function m(S){var P=S._private,N=P.rscratch,R=S.pstyle("width").pfValue,I=S.pstyle("arrow-scale").value,w=R/2+f,x=w*w,T=w*2,{source:B,target:z}=P,D;if(N.edgeType==="segments"||N.edgeType==="straight"||N.edgeType==="haystack"){var C=N.allpts;for(var O=0;O+3<C.length;O+=2)if(Uc(t,e,C[O],C[O+1],C[O+2],C[O+3],T)&&x>(D=Wc(t,e,C[O],C[O+1],C[O+2],C[O+3])))return y(S,D),!0}else if(N.edgeType==="bezier"||N.edgeType==="multibezier"||N.edgeType==="self"||N.edgeType==="compound"){var C=N.allpts;for(var O=0;O+5<N.allpts.length;O+=4)if(Hc(t,e,C[O],C[O+1],C[O+2],C[O+3],C[O+4],C[O+5],T)&&x>(D=Xc(t,e,C[O],C[O+1],C[O+2],C[O+3],C[O+4],C[O+5])))return y(S,D),!0}var B=B||P.source,z=z||P.target,V=n.getArrowWidth(R,I),k=[{name:"source",x:N.arrowStartX,y:N.arrowStartY,angle:N.srcArrowAngle},{name:"target",x:N.arrowEndX,y:N.arrowEndY,angle:N.tgtArrowAngle},{name:"mid-source",x:N.midX,y:N.midY,angle:N.midsrcArrowAngle},{name:"mid-target",x:N.midX,y:N.midY,angle:N.midtgtArrowAngle}];for(var O=0;O<k.length;O++){var G=k[O],J=i.arrowShapes[S.pstyle(G.name+"-arrow-shape").value],X=S.pstyle("width").pfValue;if(J.roughCollide(t,e,V,G.angle,{x:G.x,y:G.y},X,f)&&J.collide(t,e,V,G.angle,{x:G.x,y:G.y},X,f))return y(S),!0}if(u&&o.length>0)p(B),p(z)}function b(S,P,N){return Nt(S,P,N)}function E(S,P){var N=S._private,R=h,I;if(P)I=P+"-";else I="";S.boundingBox();var w=N.labelBounds[P||"main"],x=S.pstyle(I+"label").value,T=S.pstyle("text-events").strValue==="yes";if(!T||!x)return;var D=b(N.rscratch,"labelX",P),C=b(N.rscratch,"labelY",P),O=b(N.rscratch,"labelAngle",P),B=S.pstyle(I+"text-margin-x").pfValue,z=S.pstyle(I+"text-margin-y").pfValue,V=w.x1-R-B,k=w.x2+R-B,G=w.y1-R-z,J=w.y2+R-z;if(O){var X=Math.cos(O),_=Math.sin(O),Q=function(re,ee){return re=re-D,ee=ee-C,{x:re*X-ee*_+D,y:re*_+ee*X+C}},q=Q(V,G),te=Q(V,J),Z=Q(k,G),U=Q(k,J),W=[q.x+B,q.y+z,Z.x+B,Z.y+z,U.x+B,U.y+z,te.x+B,te.y+z];if(Bt(t,e,W))return y(S),!0}else if(mr(w,t,e))return y(S),!0}for(var A=s.length-1;A>=0;A--){var M=s[A];if(M.isNode())p(M)||E(M);else m(M)||E(M)||E(M,"source")||E(M,"target")}return o};Xr.getAllInBox=function(t,e,r,a){var n=this.getCachedZSortedEles().interactive,i=this.cy.zoom(),s=2/i,o=[],l=Math.min(t,r),u=Math.max(t,r),f=Math.min(e,a),v=Math.max(e,a);t=l,r=u,e=f,a=v;var h=Ot({x1:t,y1:e,x2:r,y2:a}),c=[{x:h.x1,y:h.y1},{x:h.x2,y:h.y1},{x:h.x2,y:h.y2},{x:h.x1,y:h.y2}],d=[[c[0],c[1]],[c[1],c[2]],[c[2],c[3]],[c[3],c[0]]];function g(re,ee,de){return Nt(re,ee,de)}function y(re,ee){var de=re._private,Ae=s,Ce="";re.boundingBox();var Se=de.labelBounds.main;if(!Se)return null;var ge=g(de.rscratch,"labelX",ee),ve=g(de.rscratch,"labelY",ee),ye=g(de.rscratch,"labelAngle",ee),Ee=re.pstyle(Ce+"text-margin-x").pfValue,Pe=re.pstyle(Ce+"text-margin-y").pfValue,Me=Se.x1-Ae-Ee,Ne=Se.x2+Ae-Ee,Fe=Se.y1-Ae-Pe,ze=Se.y2+Ae-Pe;if(ye){var Ue=Math.cos(ye),ie=Math.sin(ye),L=function(Y,H){return Y=Y-ge,H=H-ve,{x:Y*Ue-H*ie+ge,y:Y*ie+H*Ue+ve}};return[L(Me,Fe),L(Ne,Fe),L(Ne,ze),L(Me,ze)]}else return[{x:Me,y:Fe},{x:Ne,y:Fe},{x:Ne,y:ze},{x:Me,y:ze}]}function p(re,ee,de,Ae){function Ce(Se,ge,ve){return(ve.y-Se.y)*(ge.x-Se.x)>(ge.y-Se.y)*(ve.x-Se.x)}return Ce(re,de,Ae)!==Ce(ee,de,Ae)&&Ce(re,ee,de)!==Ce(re,ee,Ae)}for(var m=0;m<n.length;m++){var b=n[m];if(b.isNode()){var E=b,A=E.pstyle("text-events").strValue==="yes",M=E.pstyle("box-selection").strValue,S=E.pstyle("box-select-labels").strValue==="yes";if(M==="none")continue;var P=(M==="overlap"||S)&&A,N=E.boundingBox({includeNodes:!0,includeEdges:!1,includeLabels:P});if(M==="contain"){var R=!1;if(S&&A){var I=y(E);if(I&&Oi(I,c))o.push(E),R=!0}if(!R&&Ff(h,N))o.push(E)}else if(M==="overlap"){if(wo(h,N)){var w=E.boundingBox({includeNodes:!0,includeEdges:!0,includeLabels:!1,includeMainLabels:!1,includeSourceLabels:!1,includeTargetLabels:!1}),x=[{x:w.x1,y:w.y1},{x:w.x2,y:w.y1},{x:w.x2,y:w.y2},{x:w.x1,y:w.y2}];if(Oi(x,c))o.push(E);else{var T=y(E);if(T&&Oi(T,c))o.push(E)}}}}else{var D=b,C=D._private,O=C.rscratch,B=D.pstyle("box-selection").strValue;if(B==="none")continue;if(B==="contain"){if(O.startX!=null&&O.startY!=null&&!mr(h,O.startX,O.startY))continue;if(O.endX!=null&&O.endY!=null&&!mr(h,O.endX,O.endY))continue;if(O.edgeType==="bezier"||O.edgeType==="multibezier"||O.edgeType==="self"||O.edgeType==="compound"||O.edgeType==="segments"||O.edgeType==="haystack"){var z=C.rstyle.bezierPts||C.rstyle.linePts||C.rstyle.haystackPts,V=!0;for(var k=0;k<z.length;k++)if(!uu(h,z[k])){V=!1;break}if(V)o.push(D)}else if(O.edgeType==="straight")o.push(D)}else if(B==="overlap"){var G=!1;if(O.startX!=null&&O.startY!=null&&O.endX!=null&&O.endY!=null&&(mr(h,O.startX,O.startY)||mr(h,O.endX,O.endY)))o.push(D),G=!0;else if(!G&&O.edgeType==="haystack"){var J=C.rstyle.haystackPts;for(var X=0;X<J.length;X++)if(uu(h,J[X])){o.push(D),G=!0;break}}if(!G){var _=C.rstyle.bezierPts||C.rstyle.linePts||C.rstyle.haystackPts;if((!_||_.length<2)&&O.edgeType==="straight"){if(O.startX!=null&&O.startY!=null&&O.endX!=null&&O.endY!=null)_=[{x:O.startX,y:O.startY},{x:O.endX,y:O.endY}]}if(!_||_.length<2)continue;for(var Q=0;Q<_.length-1;Q++){var q=_[Q],te=_[Q+1];for(var Z=0;Z<d.length;Z++){var U=ht(d[Z],2),W=U[0],j=U[1];if(p(q,te,W,j)){o.push(D),G=!0;break}}if(G)break}}}}}return o};var Xn={};Xn.calculateArrowAngles=function(t){var e=t._private.rscratch,r=e.edgeType==="haystack",a=e.edgeType==="bezier",n=e.edgeType==="multibezier",i=e.edgeType==="segments",s=e.edgeType==="compound",o=e.edgeType==="self",l,u,f,v,h,c,p,m;if(r)f=e.haystackPts[0],v=e.haystackPts[1],h=e.haystackPts[2],c=e.haystackPts[3];else f=e.arrowStartX,v=e.arrowStartY,h=e.arrowEndX,c=e.arrowEndY;if(p=e.midX,m=e.midY,i)l=f-e.segpts[0],u=v-e.segpts[1];else if(n||s||o||a){var d=e.allpts,g=bt(d[0],d[2],d[4],0.1),y=bt(d[1],d[3],d[5],0.1);l=f-g,u=v-y}else l=f-p,u=v-m;e.srcArrowAngle=cn(l,u);var{midX:p,midY:m}=e;if(r)p=(f+h)/2,m=(v+c)/2;if(l=h-f,u=c-v,i){var d=e.allpts;if(d.length/2%2===0){var b=d.length/2,E=b-2;l=d[b]-d[E],u=d[b+1]-d[E+1]}else if(e.isRound)l=e.midVector[1],u=-e.midVector[0];else{var b=d.length/2-1,E=b-2;l=d[b]-d[E],u=d[b+1]-d[E+1]}}else if(n||s||o){var{allpts:d,ctrlpts:A}=e,M,S,P,N;if(A.length/2%2===0){var R=d.length/2-1,I=R+2,w=I+2;M=bt(d[R],d[I],d[w],0),S=bt(d[R+1],d[I+1],d[w+1],0),P=bt(d[R],d[I],d[w],0.0001),N=bt(d[R+1],d[I+1],d[w+1],0.0001)}else{var I=d.length/2-1,R=I-2,w=I+2;M=bt(d[R],d[I],d[w],0.4999),S=bt(d[R+1],d[I+1],d[w+1],0.4999),P=bt(d[R],d[I],d[w],0.5),N=bt(d[R+1],d[I+1],d[w+1],0.5)}l=P-M,u=N-S}if(e.midtgtArrowAngle=cn(l,u),e.midDispX=l,e.midDispY=u,l*=-1,u*=-1,i){var d=e.allpts;if(d.length/2%2===0);else if(!e.isRound){var b=d.length/2-1,x=b+2;l=-(d[x]-d[b]),u=-(d[x+1]-d[b+1])}}if(e.midsrcArrowAngle=cn(l,u),i)l=h-e.segpts[e.segpts.length-2],u=c-e.segpts[e.segpts.length-1];else if(n||s||o||a){var d=e.allpts,T=d.length,g=bt(d[T-6],d[T-4],d[T-2],0.9),y=bt(d[T-5],d[T-3],d[T-1],0.9);l=h-g,u=c-y}else l=h-p,u=c-m;e.tgtArrowAngle=cn(l,u)};Xn.getArrowWidth=Xn.getArrowHeight=function(t,e){var r=this.arrowWidthCache=this.arrowWidthCache||{},a=r[t+", "+e];if(a)return a;return a=Math.max(Math.pow(t*13.37,0.9),29)*e,r[t+", "+e]=a,a};var to,ro,_t={},Gt={},Yl,Xl,zr,Nn,ar,Or,kr,Kt,Jr,En,Pv,Nv,ao,no,Wl,$l=function(e,r,a){a.x=r.x-e.x,a.y=r.y-e.y,a.len=Math.sqrt(a.x*a.x+a.y*a.y),a.nx=a.x/a.len,a.ny=a.y/a.len,a.ang=Math.atan2(a.ny,a.nx)},ly=function(e,r){r.x=e.x*-1,r.y=e.y*-1,r.nx=e.nx*-1,r.ny=e.ny*-1,r.ang=e.ang>0?-(Math.PI-e.ang):Math.PI+e.ang},fy=function(e,r,a,n,i){if(e!==Wl?$l(r,e,_t):ly(Gt,_t),$l(r,a,Gt),Yl=_t.nx*Gt.ny-_t.ny*Gt.nx,Xl=_t.nx*Gt.nx-_t.ny*-Gt.ny,ar=Math.asin(Math.max(-1,Math.min(1,Yl))),Math.abs(ar)<0.000001){to=r.x,ro=r.y,kr=Jr=0;return}if(zr=1,Nn=!1,Xl<0)if(ar<0)ar=Math.PI+ar;else ar=Math.PI-ar,zr=-1,Nn=!0;else if(ar>0)zr=-1,Nn=!0;if(r.radius!==void 0)Jr=r.radius;else Jr=n;if(Or=ar/2,En=Math.min(_t.len/2,Gt.len/2),i)if(Kt=Math.abs(Math.cos(Or)*Jr/Math.sin(Or)),Kt>En)Kt=En,kr=Math.abs(Kt*Math.sin(Or)/Math.cos(Or));else kr=Jr;else Kt=Math.min(En,Jr),kr=Math.abs(Kt*Math.sin(Or)/Math.cos(Or));ao=r.x+Gt.nx*Kt,no=r.y+Gt.ny*Kt,to=ao-Gt.ny*kr*zr,ro=no+Gt.nx*kr*zr,Pv=r.x+_t.nx*Kt,Nv=r.y+_t.ny*Kt,Wl=r};function Ov(t,e){if(e.radius===0)t.lineTo(e.cx,e.cy);else t.arc(e.cx,e.cy,e.radius,e.startAngle,e.endAngle,e.counterClockwise)}function No(t,e,r,a){var n=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;if(a===0||e.radius===0)return{cx:e.x,cy:e.y,radius:0,startX:e.x,startY:e.y,stopX:e.x,stopY:e.y,startAngle:void 0,endAngle:void 0,counterClockwise:void 0};return fy(t,e,r,a,n),{cx:to,cy:ro,radius:kr,startX:Pv,startY:Nv,stopX:ao,stopY:no,startAngle:_t.ang+Math.PI/2*zr,endAngle:Gt.ang-Math.PI/2*zr,counterClockwise:Nn}}var $a=0.01,vy=Math.sqrt(2*$a),Lt={};Lt.findMidptPtsEtc=function(t,e){var{posPts:r,intersectionPts:a,vectorNormInverse:n}=e,i,s=t.pstyle("source-endpoint"),o=t.pstyle("target-endpoint"),l=s.units!=null&&o.units!=null,u=function(A,M,S,P){var N=P-M,R=S-A,I=Math.sqrt(R*R+N*N);return{x:-N/I,y:R/I}},f=t.pstyle("edge-distances").value;switch(f){case"node-position":i=r;break;case"intersection":i=a;break;case"endpoints":{if(l){var v=this.manualEndptToPx(t.source()[0],s),h=ht(v,2),c=h[0],d=h[1],g=this.manualEndptToPx(t.target()[0],o),y=ht(g,2),p=y[0],m=y[1],b={x1:c,y1:d,x2:p,y2:m};n=u(c,d,p,m),i=b}else _e("Edge ".concat(t.id()," has edge-distances:endpoints specified without manual endpoints specified via source-endpoint and target-endpoint. Falling back on edge-distances:intersection (default).")),i=a;break}}return{midptPts:i,vectorNormInverse:n}};Lt.findHaystackPoints=function(t){for(var e=0;e<t.length;e++){var r=t[e],a=r._private,n=a.rscratch;if(!n.haystack){var i=Math.random()*2*Math.PI;n.source={x:Math.cos(i),y:Math.sin(i)},i=Math.random()*2*Math.PI,n.target={x:Math.cos(i),y:Math.sin(i)}}var{source:s,target:o}=a,l=s.position(),u=o.position(),f=s.width(),v=o.width(),h=s.height(),c=o.height(),d=r.pstyle("haystack-radius").value,g=d/2;n.haystackPts=n.allpts=[n.source.x*f*g+l.x,n.source.y*h*g+l.y,n.target.x*v*g+u.x,n.target.y*c*g+u.y],n.midX=(n.allpts[0]+n.allpts[2])/2,n.midY=(n.allpts[1]+n.allpts[3])/2,n.edgeType="haystack",n.haystack=!0,this.storeEdgeProjections(r),this.calculateArrowAngles(r),this.recalculateEdgeLabelProjections(r),this.calculateLabelAngles(r)}};Lt.findSegmentsPoints=function(t,e){var r=t._private.rscratch,a=t.pstyle("segment-weights"),n=t.pstyle("segment-distances"),i=t.pstyle("segment-radii"),s=t.pstyle("radius-type"),o=Math.min(a.pfValue.length,n.pfValue.length),l=i.pfValue[i.pfValue.length-1],u=s.pfValue[s.pfValue.length-1];r.edgeType="segments",r.segpts=[],r.radii=[],r.isArcRadius=[];for(var f=0;f<o;f++){var v=a.pfValue[f],h=n.pfValue[f],c=1-v,d=v,g=this.findMidptPtsEtc(t,e),{midptPts:y,vectorNormInverse:p}=g,m={x:y.x1*c+y.x2*d,y:y.y1*c+y.y2*d};r.segpts.push(m.x+p.x*h,m.y+p.y*h),r.radii.push(i.pfValue[f]!==void 0?i.pfValue[f]:l),r.isArcRadius.push((s.pfValue[f]!==void 0?s.pfValue[f]:u)==="arc-radius")}};Lt.findLoopPoints=function(t,e,r,a){var n=t._private.rscratch,{dirCounts:i,srcPos:s}=e,o=t.pstyle("control-point-distances"),l=o?o.pfValue[0]:void 0,u=t.pstyle("loop-direction").pfValue,f=t.pstyle("loop-sweep").pfValue,v=t.pstyle("control-point-step-size").pfValue;n.edgeType="self";var h=r,c=v;if(a)h=0,c=l;var d=u-Math.PI/2,g=d-f/2,y=d+f/2,p=String(u+"_"+f);h=i[p]===void 0?i[p]=0:++i[p],n.ctrlpts=[s.x+Math.cos(g)*1.4*c*(h/3+1),s.y+Math.sin(g)*1.4*c*(h/3+1),s.x+Math.cos(y)*1.4*c*(h/3+1),s.y+Math.sin(y)*1.4*c*(h/3+1)]};Lt.findCompoundLoopPoints=function(t,e,r,a){var n=t._private.rscratch;n.edgeType="compound";var{srcPos:i,tgtPos:s,srcW:o,srcH:l,tgtW:u,tgtH:f}=e,v=t.pstyle("control-point-step-size").pfValue,h=t.pstyle("control-point-distances"),c=h?h.pfValue[0]:void 0,d=r,g=v;if(a)d=0,g=c;var y=50,p={x:i.x-o/2,y:i.y-l/2},m={x:s.x-u/2,y:s.y-f/2},b={x:Math.min(p.x,m.x),y:Math.min(p.y,m.y)},E=0.5,A=Math.max(E,Math.log(o*$a)),M=Math.max(E,Math.log(u*$a));n.ctrlpts=[b.x,b.y-(1+Math.pow(y,1.12)/100)*g*(d/3+1)*A,b.x-(1+Math.pow(y,1.12)/100)*g*(d/3+1)*M,b.y]};Lt.findStraightEdgePoints=function(t){t._private.rscratch.edgeType="straight"};Lt.findBezierPoints=function(t,e,r,a,n){var i=t._private.rscratch,s=t.pstyle("control-point-step-size").pfValue,o=t.pstyle("control-point-distances"),l=t.pstyle("control-point-weights"),u=o&&l?Math.min(o.value.length,l.value.length):1,f=o?o.pfValue[0]:void 0,v=l.value[0],h=a;i.edgeType=h?"multibezier":"bezier",i.ctrlpts=[];for(var c=0;c<u;c++){var d=(0.5-e.eles.length/2+r)*s*(n?-1:1),g=void 0,y=bo(d);if(h)f=o?o.pfValue[c]:s,v=l.value[c];if(a)g=f;else g=f!==void 0?y*f:void 0;var p=g!==void 0?g:d,m=1-v,b=v,E=this.findMidptPtsEtc(t,e),{midptPts:A,vectorNormInverse:M}=E,S={x:A.x1*m+A.x2*b,y:A.y1*m+A.y2*b};i.ctrlpts.push(S.x+M.x*p,S.y+M.y*p)}};Lt.findTaxiPoints=function(t,e){var r=t._private.rscratch;r.edgeType="segments";var a="vertical",n="horizontal",i="leftward",s="rightward",o="downward",l="upward",u="auto",{posPts:f,srcW:v,srcH:h,tgtW:c,tgtH:d}=e,g=t.pstyle("edge-distances").value,y=g!=="node-position",p=t.pstyle("taxi-direction").value,m=p,b=t.pstyle("taxi-turn"),E=b.units==="%",A=b.pfValue,M=A<0,S=t.pstyle("taxi-turn-min-distance").pfValue,P=y?(v+c)/2:0,N=y?(h+d)/2:0,R=f.x2-f.x1,I=f.y2-f.y1,w=function(H,K){if(H>0)return Math.max(H-K,0);else return Math.min(H+K,0)},x=w(R,P),T=w(I,N),D=!1;if(m===u)p=Math.abs(x)>Math.abs(T)?n:a;else if(m===l||m===o)p=a,D=!0;else if(m===i||m===s)p=n,D=!0;var C=p===a,O=C?T:x,B=C?I:R,z=bo(B),V=!1;if(!(D&&(E||M))&&(m===o&&B<0||m===l&&B>0||m===i&&B>0||m===s&&B<0))z*=-1,O=z*Math.abs(O),V=!0;var k;if(E){var G=A<0?1+A:A;k=G*O}else{var J=A<0?O:0;k=J+A*z}var X=function(H){return Math.abs(H)<S||Math.abs(H)>=Math.abs(O)},_=X(k),Q=X(Math.abs(O)-Math.abs(k)),q=_||Q;if(q&&!V)if(C){var te=Math.abs(B)<=h/2,Z=Math.abs(R)<=c/2;if(te){var U=(f.x1+f.x2)/2,{y1:W,y2:j}=f;r.segpts=[U,W,U,j]}else if(Z){var re=(f.y1+f.y2)/2,{x1:ee,x2:de}=f;r.segpts=[ee,re,de,re]}else r.segpts=[f.x1,f.y2]}else{var Ae=Math.abs(B)<=v/2,Ce=Math.abs(I)<=d/2;if(Ae){var Se=(f.y1+f.y2)/2,{x1:ge,x2:ve}=f;r.segpts=[ge,Se,ve,Se]}else if(Ce){var ye=(f.x1+f.x2)/2,{y1:Ee,y2:Pe}=f;r.segpts=[ye,Ee,ye,Pe]}else r.segpts=[f.x2,f.y1]}else if(C){var Me=f.y1+k+(y?h/2*z:0),{x1:Ne,x2:Fe}=f;r.segpts=[Ne,Me,Fe,Me]}else{var ze=f.x1+k+(y?v/2*z:0),{y1:Ue,y2:ie}=f;r.segpts=[ze,Ue,ze,ie]}if(r.isRound){var L=t.pstyle("taxi-radius").value,F=t.pstyle("radius-type").value[0]==="arc-radius";r.radii=Array(r.segpts.length/2).fill(L),r.isArcRadius=Array(r.segpts.length/2).fill(F)}};Lt.tryToCorrectInvalidPoints=function(t,e){var r=t._private.rscratch;if(r.edgeType==="bezier"){var{srcPos:a,tgtPos:n,srcW:i,srcH:s,tgtW:o,tgtH:l,srcShape:u,tgtShape:f,srcCornerRadius:v,tgtCornerRadius:h,srcRs:c,tgtRs:d}=e,g=!he(r.startX)||!he(r.startY),y=!he(r.arrowStartX)||!he(r.arrowStartY),p=!he(r.endX)||!he(r.endY),m=!he(r.arrowEndX)||!he(r.arrowEndY),b=3,E=this.getArrowWidth(t.pstyle("width").pfValue,t.pstyle("arrow-scale").value)*this.arrowShapeWidth,A=b*E,M=Ur({x:r.ctrlpts[0],y:r.ctrlpts[1]},{x:r.startX,y:r.startY}),S=M<A,P=Ur({x:r.ctrlpts[0],y:r.ctrlpts[1]},{x:r.endX,y:r.endY}),N=P<A,R=!1;if(g||y||S){R=!0;var I={x:r.ctrlpts[0]-a.x,y:r.ctrlpts[1]-a.y},w=Math.sqrt(I.x*I.x+I.y*I.y),x={x:I.x/w,y:I.y/w},T=Math.max(i,s),D={x:r.ctrlpts[0]+x.x*2*T,y:r.ctrlpts[1]+x.y*2*T},C=u.intersectLine(a.x,a.y,i,s,D.x,D.y,0,v,c);if(S)r.ctrlpts[0]=r.ctrlpts[0]+x.x*(A-M),r.ctrlpts[1]=r.ctrlpts[1]+x.y*(A-M);else r.ctrlpts[0]=C[0]+x.x*A,r.ctrlpts[1]=C[1]+x.y*A}if(p||m||N){R=!0;var O={x:r.ctrlpts[0]-n.x,y:r.ctrlpts[1]-n.y},B=Math.sqrt(O.x*O.x+O.y*O.y),z={x:O.x/B,y:O.y/B},V=Math.max(i,s),k={x:r.ctrlpts[0]+z.x*2*V,y:r.ctrlpts[1]+z.y*2*V},G=f.intersectLine(n.x,n.y,o,l,k.x,k.y,0,h,d);if(N)r.ctrlpts[0]=r.ctrlpts[0]+z.x*(A-P),r.ctrlpts[1]=r.ctrlpts[1]+z.y*(A-P);else r.ctrlpts[0]=G[0]+z.x*A,r.ctrlpts[1]=G[1]+z.y*A}if(R)this.findEndpoints(t)}};Lt.storeAllpts=function(t){var e=t._private.rscratch;if(e.edgeType==="multibezier"||e.edgeType==="bezier"||e.edgeType==="self"||e.edgeType==="compound"){e.allpts=[],e.allpts.push(e.startX,e.startY);for(var r=0;r+1<e.ctrlpts.length;r+=2)if(e.allpts.push(e.ctrlpts[r],e.ctrlpts[r+1]),r+3<e.ctrlpts.length)e.allpts.push((e.ctrlpts[r]+e.ctrlpts[r+2])/2,(e.ctrlpts[r+1]+e.ctrlpts[r+3])/2);e.allpts.push(e.endX,e.endY);var a,n;if(e.ctrlpts.length/2%2===0)a=e.allpts.length/2-1,e.midX=e.allpts[a],e.midY=e.allpts[a+1];else a=e.allpts.length/2-3,n=0.5,e.midX=bt(e.allpts[a],e.allpts[a+2],e.allpts[a+4],n),e.midY=bt(e.allpts[a+1],e.allpts[a+3],e.allpts[a+5],n)}else if(e.edgeType==="straight")e.allpts=[e.startX,e.startY,e.endX,e.endY],e.midX=(e.startX+e.endX+e.arrowStartX+e.arrowEndX)/4,e.midY=(e.startY+e.endY+e.arrowStartY+e.arrowEndY)/4;else if(e.edgeType==="segments"){if(e.allpts=[],e.allpts.push(e.startX,e.startY),e.allpts.push.apply(e.allpts,e.segpts),e.allpts.push(e.endX,e.endY),e.isRound){e.roundCorners=[];for(var i=2;i+3<e.allpts.length;i+=2){var s=e.radii[i/2-1],o=e.isArcRadius[i/2-1];e.roundCorners.push(No({x:e.allpts[i-2],y:e.allpts[i-1]},{x:e.allpts[i],y:e.allpts[i+1],radius:s},{x:e.allpts[i+2],y:e.allpts[i+3]},s,o))}}if(e.segpts.length%4===0){var l=e.segpts.length/2,u=l-2;e.midX=(e.segpts[u]+e.segpts[l])/2,e.midY=(e.segpts[u+1]+e.segpts[l+1])/2}else{var f=e.segpts.length/2-1;if(!e.isRound)e.midX=e.segpts[f],e.midY=e.segpts[f+1];else{var v={x:e.segpts[f],y:e.segpts[f+1]},h=e.roundCorners[f/2];if(h.radius===0){var c={x:e.segpts[f+2],y:e.segpts[f+3]};e.midX=v.x,e.midY=v.y,e.midVector=[v.y-c.y,c.x-v.x]}else{var d=[v.x-h.cx,v.y-h.cy],g=h.radius/Math.sqrt(Math.pow(d[0],2)+Math.pow(d[1],2));d=d.map(function(y){return y*g}),e.midX=h.cx+d[0],e.midY=h.cy+d[1],e.midVector=d}}}}};Lt.checkForInvalidEdgeWarning=function(t){var e=t[0]._private.rscratch;if(e.nodesOverlap||he(e.startX)&&he(e.startY)&&he(e.endX)&&he(e.endY))e.loggedErr=!1;else if(!e.loggedErr)e.loggedErr=!0,_e("Edge `"+t.id()+"` has invalid endpoints and so it is impossible to draw. Adjust your edge style (e.g. control points) accordingly or use an alternative edge type. This is expected behaviour when the source node and the target node overlap.")};Lt.findEdgeControlPoints=function(t){var e=this;if(!t||t.length===0)return;var r=this,a=r.cy,n=a.hasCompoundNodes(),i=new nr,s=function(N,R){return[].concat(Bn(N),[R?1:0]).join("-")},o=[],l=[];for(var u=0;u<t.length;u++){var f=t[u],v=f._private,h=f.pstyle("curve-style").value;if(f.removed()||!f.takesUpSpace())continue;if(h==="haystack"){l.push(f);continue}var c=h==="unbundled-bezier"||yr(h,"segments")||h==="straight"||h==="straight-triangle"||yr(h,"taxi"),d=h==="unbundled-bezier"||h==="bezier",{source:g,target:y}=v,p=g.poolIndex(),m=y.poolIndex(),b=[p,m].sort(),E=s(b,c),A=i.get(E);if(A==null)A={eles:[]},o.push({pairId:b,edgeIsUnbundled:c}),i.set(E,A);if(A.eles.push(f),c)A.hasUnbundled=!0;if(d)A.hasBezier=!0}var M=function(){var N=o[S],{pairId:R,edgeIsUnbundled:I}=N,w=s(R,I),x=i.get(w),T;if(!x.hasUnbundled){var D=x.eles[0].parallelEdges().filter(function(F){return F.isBundledBezier()});yo(x.eles),D.forEach(function(F){return x.eles.push(F)}),x.eles.sort(function(F,Y){return F.poolIndex()-Y.poolIndex()})}var C=x.eles[0],O=C.source(),B=C.target();if(O.poolIndex()>B.poolIndex()){var z=O;O=B,B=z}var V=x.srcPos=O.position(),k=x.tgtPos=B.position(),G=x.srcW=O.outerWidth(),J=x.srcH=O.outerHeight(),X=x.tgtW=B.outerWidth(),_=x.tgtH=B.outerHeight(),Q=x.srcShape=r.nodeShapes[e.getNodeShape(O)],q=x.tgtShape=r.nodeShapes[e.getNodeShape(B)],te=x.srcCornerRadius=O.pstyle("corner-radius").value==="auto"?"auto":O.pstyle("corner-radius").pfValue,Z=x.tgtCornerRadius=B.pstyle("corner-radius").value==="auto"?"auto":B.pstyle("corner-radius").pfValue,U=x.tgtRs=B._private.rscratch,W=x.srcRs=O._private.rscratch;x.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var j=0;j<x.eles.length;j++){var re=x.eles[j],ee=re[0]._private.rscratch,de=re.pstyle("curve-style").value,Ae=de==="unbundled-bezier"||yr(de,"segments")||yr(de,"taxi"),Ce=!O.same(re.source());if(!x.calculatedIntersection&&O!==B&&(x.hasBezier||x.hasUnbundled)){x.calculatedIntersection=!0;var Se=Q.intersectLine(V.x,V.y,G,J,k.x,k.y,0,te,W),ge=x.srcIntn=Se,ve=q.intersectLine(k.x,k.y,X,_,V.x,V.y,0,Z,U),ye=x.tgtIntn=ve,Ee=x.intersectionPts={x1:Se[0],x2:ve[0],y1:Se[1],y2:ve[1]},Pe=x.posPts={x1:V.x,x2:k.x,y1:V.y,y2:k.y},Me=ve[1]-Se[1],Ne=ve[0]-Se[0],Fe=Math.sqrt(Ne*Ne+Me*Me);if(he(Fe)&&Fe>=vy);else Fe=Math.sqrt(Math.max(Ne*Ne,$a)+Math.max(Me*Me,$a));var ze=x.vector={x:Ne,y:Me},Ue=x.vectorNorm={x:ze.x/Fe,y:ze.y/Fe},ie={x:-Ue.y,y:Ue.x};x.nodesOverlap=!he(Fe)||q.checkPoint(Se[0],Se[1],0,X,_,k.x,k.y,Z,U)||Q.checkPoint(ve[0],ve[1],0,G,J,V.x,V.y,te,W),x.vectorNormInverse=ie,T={nodesOverlap:x.nodesOverlap,dirCounts:x.dirCounts,calculatedIntersection:!0,hasBezier:x.hasBezier,hasUnbundled:x.hasUnbundled,eles:x.eles,srcPos:k,srcRs:U,tgtPos:V,tgtRs:W,srcW:X,srcH:_,tgtW:G,tgtH:J,srcIntn:ye,tgtIntn:ge,srcShape:q,tgtShape:Q,posPts:{x1:Pe.x2,y1:Pe.y2,x2:Pe.x1,y2:Pe.y1},intersectionPts:{x1:Ee.x2,y1:Ee.y2,x2:Ee.x1,y2:Ee.y1},vector:{x:-ze.x,y:-ze.y},vectorNorm:{x:-Ue.x,y:-Ue.y},vectorNormInverse:{x:-ie.x,y:-ie.y}}}var L=Ce?T:x;if(ee.nodesOverlap=L.nodesOverlap,ee.srcIntn=L.srcIntn,ee.tgtIntn=L.tgtIntn,ee.isRound=de.startsWith("round"),n&&(O.isParent()||O.isChild()||B.isParent()||B.isChild())&&(O.parents().anySame(B)||B.parents().anySame(O)||O.same(B)&&O.isParent()))e.findCompoundLoopPoints(re,L,j,Ae);else if(O===B)e.findLoopPoints(re,L,j,Ae);else if(de.endsWith("segments"))e.findSegmentsPoints(re,L);else if(de.endsWith("taxi"))e.findTaxiPoints(re,L);else if(de==="straight"||!Ae&&x.eles.length%2===1&&j===Math.floor(x.eles.length/2))e.findStraightEdgePoints(re);else e.findBezierPoints(re,L,j,Ae,Ce);e.findEndpoints(re),e.tryToCorrectInvalidPoints(re,L),e.checkForInvalidEdgeWarning(re),e.storeAllpts(re),e.storeEdgeProjections(re),e.calculateArrowAngles(re),e.recalculateEdgeLabelProjections(re),e.calculateLabelAngles(re)}};for(var S=0;S<o.length;S++)M();this.findHaystackPoints(l)};function Iv(t){var e=[];if(t==null)return;for(var r=0;r<t.length;r+=2){var a=t[r],n=t[r+1];e.push({x:a,y:n})}return e}Lt.getSegmentPoints=function(t){var e=t[0]._private.rscratch;this.recalculateRenderedStyle(t);var r=e.edgeType;if(r==="segments")return Iv(e.segpts)};Lt.getControlPoints=function(t){var e=t[0]._private.rscratch;this.recalculateRenderedStyle(t);var r=e.edgeType;if(r==="bezier"||r==="multibezier"||r==="self"||r==="compound")return Iv(e.ctrlpts)};Lt.getEdgeMidpoint=function(t){var e=t[0]._private.rscratch;return this.recalculateRenderedStyle(t),{x:e.midX,y:e.midY}};var an={};an.manualEndptToPx=function(t,e){var r=this,a=t.position(),n=t.outerWidth(),i=t.outerHeight(),s=t._private.rscratch;if(e.value.length===2){var o=[e.pfValue[0],e.pfValue[1]];if(e.units[0]==="%")o[0]=o[0]*n;if(e.units[1]==="%")o[1]=o[1]*i;return o[0]+=a.x,o[1]+=a.y,o}else{var l=e.pfValue[0];l=-Math.PI/2+l;var u=2*Math.max(n,i),f=[a.x+Math.cos(l)*u,a.y+Math.sin(l)*u];return r.nodeShapes[this.getNodeShape(t)].intersectLine(a.x,a.y,n,i,f[0],f[1],0,t.pstyle("corner-radius").value==="auto"?"auto":t.pstyle("corner-radius").pfValue,s)}};an.findEndpoints=function(t){var e,r,a,n,i=this,s,o=t.source()[0],l=t.target()[0],u=o.position(),f=l.position(),v=t.pstyle("target-arrow-shape").value,h=t.pstyle("source-arrow-shape").value,c=t.pstyle("target-distance-from-node").pfValue,d=t.pstyle("source-distance-from-node").pfValue,g=o._private.rscratch,y=l._private.rscratch,p=t.pstyle("curve-style").value,m=t._private.rscratch,b=m.edgeType,E=yr(p,"taxi"),A=b==="self"||b==="compound",M=b==="bezier"||b==="multibezier"||A,S=b!=="bezier",P=b==="straight"||b==="segments",N=b==="segments",R=M||S||P,I=A||E,w=t.pstyle("source-endpoint"),x=I?"outside-to-node":w.value,T=o.pstyle("corner-radius").value==="auto"?"auto":o.pstyle("corner-radius").pfValue,D=t.pstyle("target-endpoint"),C=I?"outside-to-node":D.value,O=l.pstyle("corner-radius").value==="auto"?"auto":l.pstyle("corner-radius").pfValue;m.srcManEndpt=w,m.tgtManEndpt=D;var B,z,V,k,G=(e=(D===null||D===void 0||(r=D.pfValue)===null||r===void 0?void 0:r.length)===2?D.pfValue:null)!==null&&e!==void 0?e:[0,0],J=(a=(w===null||w===void 0||(n=w.pfValue)===null||n===void 0?void 0:n.length)===2?w.pfValue:null)!==null&&a!==void 0?a:[0,0];if(M){var X=[m.ctrlpts[0],m.ctrlpts[1]],_=S?[m.ctrlpts[m.ctrlpts.length-2],m.ctrlpts[m.ctrlpts.length-1]]:X;B=_,z=X}else if(P){var Q=!N?[f.x+G[0],f.y+G[1]]:m.segpts.slice(0,2),q=!N?[u.x+J[0],u.y+J[1]]:m.segpts.slice(m.segpts.length-2);B=q,z=Q}if(C==="inside-to-node")s=[f.x,f.y];else if(D.units)s=this.manualEndptToPx(l,D);else if(C==="outside-to-line")s=m.tgtIntn;else{if(C==="outside-to-node"||C==="outside-to-node-or-label")V=B;else if(C==="outside-to-line"||C==="outside-to-line-or-label")V=[u.x,u.y];if(s=i.nodeShapes[this.getNodeShape(l)].intersectLine(f.x,f.y,l.outerWidth(),l.outerHeight(),V[0],V[1],0,O,y),C==="outside-to-node-or-label"||C==="outside-to-line-or-label"){var te=l._private.rscratch,{labelWidth:Z,labelHeight:U,labelX:W,labelY:j}=te,re=Z/2,ee=U/2,de=l.pstyle("text-valign").value;if(de=ca(de),de==="top")j-=ee;else if(de==="bottom")j+=ee;var Ae=l.pstyle("text-halign").value;if(Ae=ha(Ae),Ae==="left")W-=re;else if(Ae==="right")W+=re;var Ce=Ha(V[0],V[1],[W-re,j-ee,W+re,j-ee,W+re,j+ee,W-re,j+ee],f.x,f.y);if(Ce.length>0){var Se=u,ge=Br(Se,ra(s)),ve=Br(Se,ra(Ce)),ye=ge;if(ve<ge)s=Ce,ye=ve;if(Ce.length>2){var Ee=Br(Se,{x:Ce[2],y:Ce[3]});if(Ee<ye)s=[Ce[2],Ce[3]]}}}}var Pe=dn(s,B,i.arrowShapes[v].spacing(t)+c),Me=dn(s,B,i.arrowShapes[v].gap(t)+c);if(m.endX=Me[0],m.endY=Me[1],m.arrowEndX=Pe[0],m.arrowEndY=Pe[1],x==="inside-to-node")s=[u.x,u.y];else if(w.units)s=this.manualEndptToPx(o,w);else if(x==="outside-to-line")s=m.srcIntn;else{if(x==="outside-to-node"||x==="outside-to-node-or-label")k=z;else if(x==="outside-to-line"||x==="outside-to-line-or-label")k=[f.x,f.y];if(s=i.nodeShapes[this.getNodeShape(o)].intersectLine(u.x,u.y,o.outerWidth(),o.outerHeight(),k[0],k[1],0,T,g),x==="outside-to-node-or-label"||x==="outside-to-line-or-label"){var Ne=o._private.rscratch,{labelWidth:Fe,labelHeight:ze,labelX:Ue,labelY:ie}=Ne,L=Fe/2,F=ze/2,Y=o.pstyle("text-valign").value;if(Y=ca(Y),Y==="top")ie-=F;else if(Y==="bottom")ie+=F;var H=o.pstyle("text-halign").value;if(H=ha(H),H==="left")Ue-=L;else if(H==="right")Ue+=L;var K=Ha(k[0],k[1],[Ue-L,ie-F,Ue+L,ie-F,Ue+L,ie+F,Ue-L,ie+F],u.x,u.y);if(K.length>0){var se=f,ae=Br(se,ra(s)),oe=Br(se,ra(K)),ne=ae;if(oe<ae)s=[K[0],K[1]],ne=oe;if(K.length>2){var ue=Br(se,{x:K[2],y:K[3]});if(ue<ne)s=[K[2],K[3]]}}}}var be=dn(s,z,i.arrowShapes[h].spacing(t)+d),fe=dn(s,z,i.arrowShapes[h].gap(t)+d);if(m.startX=fe[0],m.startY=fe[1],m.arrowStartX=be[0],m.arrowStartY=be[1],R)if(!he(m.startX)||!he(m.startY)||!he(m.endX)||!he(m.endY))m.badLine=!0;else m.badLine=!1};an.getSourceEndpoint=function(t){var e=t[0]._private.rscratch;switch(this.recalculateRenderedStyle(t),e.edgeType){case"haystack":return{x:e.haystackPts[0],y:e.haystackPts[1]};default:return{x:e.arrowStartX,y:e.arrowStartY}}};an.getTargetEndpoint=function(t){var e=t[0]._private.rscratch;switch(this.recalculateRenderedStyle(t),e.edgeType){case"haystack":return{x:e.haystackPts[2],y:e.haystackPts[3]};default:return{x:e.arrowEndX,y:e.arrowEndY}}};var Oo={};function hy(t,e,r){var a=function(u,f,v,h){return bt(u,f,v,h)},n=e._private,i=n.rstyle.bezierPts;for(var s=0;s<t.bezierProjPcts.length;s++){var o=t.bezierProjPcts[s];i.push({x:a(r[0],r[2],r[4],o),y:a(r[1],r[3],r[5],o)})}}Oo.storeEdgeProjections=function(t){var e=t._private,r=e.rscratch,a=r.edgeType;if(e.rstyle.bezierPts=null,e.rstyle.linePts=null,e.rstyle.haystackPts=null,a==="multibezier"||a==="bezier"||a==="self"||a==="compound"){e.rstyle.bezierPts=[];for(var n=0;n+5<r.allpts.length;n+=4)hy(this,t,r.allpts.slice(n,n+6))}else if(a==="segments"){var i=e.rstyle.linePts=[];for(var n=0;n+1<r.allpts.length;n+=2)i.push({x:r.allpts[n],y:r.allpts[n+1]})}else if(a==="haystack"){var s=r.haystackPts;e.rstyle.haystackPts=[{x:s[0],y:s[1]},{x:s[2],y:s[3]}]}e.rstyle.arrowWidth=this.getArrowWidth(t.pstyle("width").pfValue,t.pstyle("arrow-scale").value)*this.arrowShapeWidth};Oo.recalculateEdgeProjections=function(t){this.findEdgeControlPoints(t)};var er={};er.recalculateNodeLabelProjection=function(t){var e=t.pstyle("label").strValue;if(xr(e))return;var r,a,n=t._private,i=t.width(),s=t.height(),o=t.padding(),l=t.position(),u=t.pstyle("text-halign").strValue,f=t.pstyle("text-valign").strValue,{rscratch:v,rstyle:h}=n;switch(u){case"left":r=l.x-i/2-o;break;case"left-inside":r=l.x-i/2+o;break;case"right":r=l.x+i/2+o;break;case"right-inside":r=l.x+i/2-o;break;default:r=l.x}switch(f){case"top":a=l.y-s/2-o;break;case"top-inside":a=l.y-s/2+o;break;case"bottom":a=l.y+s/2+o;break;case"bottom-inside":a=l.y+s/2-o;break;default:a=l.y}v.labelX=r,v.labelY=a,h.labelX=r,h.labelY=a,this.calculateLabelAngles(t),this.applyLabelDimensions(t)};var Bv=function(e,r){var a=Math.atan(r/e);if(e===0&&a<0)a=a*-1;return a},kv=function(e,r){var a=r.x-e.x,n=r.y-e.y;return Bv(a,n)},cy=function(e,r,a,n){var i=Ua(0,n-0.001,1),s=Ua(0,n+0.001,1),o=ia(e,r,a,i),l=ia(e,r,a,s);return kv(o,l)};er.recalculateEdgeLabelProjections=function(t){var e,r=t._private,a=r.rscratch,n=this,i={mid:t.pstyle("label").strValue,source:t.pstyle("source-label").strValue,target:t.pstyle("target-label").strValue};if(i.mid||i.source||i.target);else return;e={x:a.midX,y:a.midY};var s=function(v,h,c){Qt(r.rscratch,v,h,c),Qt(r.rstyle,v,h,c)};s("labelX",null,e.x),s("labelY",null,e.y);var o=Bv(a.midDispX,a.midDispY);s("labelAutoAngle",null,o);var l=function(){if(l.cache)return l.cache;var v=[];for(var h=0;h+5<a.allpts.length;h+=4){var c={x:a.allpts[h],y:a.allpts[h+1]},d={x:a.allpts[h+2],y:a.allpts[h+3]},g={x:a.allpts[h+4],y:a.allpts[h+5]};v.push({p0:c,p1:d,p2:g,startDist:0,length:0,segments:[]})}var y=r.rstyle.bezierPts,p=n.bezierProjPcts.length;function m(S,P,N,R,I){var w=Ur(P,N),x=S.segments[S.segments.length-1],T={p0:P,p1:N,t0:R,t1:I,startDist:x?x.startDist+x.length:0,length:w};S.segments.push(T),S.length+=w}for(var b=0;b<v.length;b++){var E=v[b],A=v[b-1];if(A)E.startDist=A.startDist+A.length;m(E,E.p0,y[b*p],0,n.bezierProjPcts[0]);for(var M=0;M<p-1;M++)m(E,y[b*p+M],y[b*p+M+1],n.bezierProjPcts[M],n.bezierProjPcts[M+1]);m(E,y[b*p+p-1],E.p2,n.bezierProjPcts[p-1],1)}return l.cache=v},u=function(v){var h,c=v==="source";if(!i[v])return;var d=t.pstyle(v+"-text-offset").pfValue;switch(a.edgeType){case"self":case"compound":case"bezier":case"multibezier":{var g=l(),y,p=0,m=0;for(var b=0;b<g.length;b++){var E=g[c?b:g.length-1-b];for(var A=0;A<E.segments.length;A++){var M=E.segments[c?A:E.segments.length-1-A],S=b===g.length-1&&A===E.segments.length-1;if(p=m,m+=M.length,m>=d||S){y={cp:E,segment:M};break}}if(y)break}var P=y.cp,N=y.segment,R=(d-p)/N.length,I=N.t1-N.t0,w=c?N.t0+I*R:N.t1-I*R;w=Ua(0,w,1),e=ia(P.p0,P.p1,P.p2,w),h=cy(P.p0,P.p1,P.p2,w);break}case"straight":case"segments":case"haystack":{var x=0,T,D,C,O,B=a.allpts.length;for(var z=0;z+3<B;z+=2){if(c)C={x:a.allpts[z],y:a.allpts[z+1]},O={x:a.allpts[z+2],y:a.allpts[z+3]};else C={x:a.allpts[B-2-z],y:a.allpts[B-1-z]},O={x:a.allpts[B-4-z],y:a.allpts[B-3-z]};if(T=Ur(C,O),D=x,x+=T,x>=d)break}var V=d-D,k=V/T;k=Ua(0,k,1),e=Ic(C,O,k),h=kv(C,O);break}}s("labelX",v,e.x),s("labelY",v,e.y),s("labelAutoAngle",v,h)};u("source"),u("target"),this.applyLabelDimensions(t)};er.applyLabelDimensions=function(t){if(this.applyPrefixedLabelDimensions(t),t.isEdge())this.applyPrefixedLabelDimensions(t,"source"),this.applyPrefixedLabelDimensions(t,"target")};er.applyPrefixedLabelDimensions=function(t,e){var r=t._private,a=this.getLabelText(t,e),n=Gr(a,t._private.labelDimsKey);if(Nt(r.rscratch,"prefixedLabelDimsKey",e)===n)return;Qt(r.rscratch,"prefixedLabelDimsKey",e,n);var i=this.calculateLabelDimensions(t,a),s=t.pstyle("line-height").pfValue,o=t.pstyle("font-size").pfValue,l=t.pstyle("text-wrap").strValue,u=Nt(r.rscratch,"labelWrapCachedLines",e)||[],f=l!=="wrap"?1:Math.max(u.length,1),v=o*s,h=i.width,c=i.height+(f-1)*(s-1)*o;Qt(r.rstyle,"labelWidth",e,h),Qt(r.rscratch,"labelWidth",e,h),Qt(r.rstyle,"labelHeight",e,c),Qt(r.rscratch,"labelHeight",e,c),Qt(r.rscratch,"labelLineHeight",e,v),Qt(r.rscratch,"labelActualDescent",e,i.labelActualDescent)};er.getLabelText=function(t,e){var r=t._private,a=e?e+"-":"",n=t.pstyle(a+"label").strValue,i=t.pstyle("text-transform").value,s=function(J,X){if(X)return Qt(r.rscratch,J,e,X),X;else return Nt(r.rscratch,J,e)};if(!n)return"";if(i=="none");else if(i=="uppercase")n=n.toUpperCase();else if(i=="lowercase")n=n.toLowerCase();var o=t.pstyle("text-wrap").value;if(o==="wrap"){var l=s("labelKey");if(l!=null&&s("labelWrapKey")===l)return s("labelWrapCachedText");var u="​",f=n.split(`
14
+ */var hv=function(e,r){this.recycle(e,r)};function Aa(){return!1}function mn(){return!0}hv.prototype={instanceString:function(){return"event"},recycle:function(e,r){if(this.isImmediatePropagationStopped=this.isPropagationStopped=this.isDefaultPrevented=Aa,e!=null&&e.preventDefault)this.type=e.type,this.isDefaultPrevented=e.defaultPrevented?mn:Aa;else if(e!=null&&e.type)r=e;else this.type=e;if(r!=null)this.originalEvent=r.originalEvent,this.type=r.type!=null?r.type:this.type,this.cy=r.cy,this.target=r.target,this.position=r.position,this.renderedPosition=r.renderedPosition,this.namespace=r.namespace,this.layout=r.layout;if(this.cy!=null&&this.position!=null&&this.renderedPosition==null){var a=this.position,n=this.cy.zoom(),i=this.cy.pan();this.renderedPosition={x:a.x*n+i.x,y:a.y*n+i.y}}this.timeStamp=e&&e.timeStamp||Date.now()},preventDefault:function(){this.isDefaultPrevented=mn;var e=this.originalEvent;if(!e)return;if(e.preventDefault)e.preventDefault()},stopPropagation:function(){this.isPropagationStopped=mn;var e=this.originalEvent;if(!e)return;if(e.stopPropagation)e.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=mn,this.stopPropagation()},isDefaultPrevented:Aa,isPropagationStopped:Aa,isImmediatePropagationStopped:Aa};var cv=/^([^.]+)(\.(?:[^.]+))?$/,pp=".*",dv={qualifierCompare:function(e,r){return e===r},eventMatches:function(){return!0},addEventFields:function(){},callbackContext:function(e){return e},beforeEmit:function(){},afterEmit:function(){},bubble:function(){return!1},parent:function(){return null},context:null},Al=Object.keys(dv),yp={};function ii(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:yp,e=arguments.length>1?arguments[1]:void 0;for(var r=0;r<Al.length;r++){var a=Al[r];this[a]=t[a]||dv[a]}this.context=e||this.context,this.listeners=[],this.emitting=0}var Ar=ii.prototype,gv=function(e,r,a,n,i,s,o){if(st(n))i=n,n=null;if(o)if(s==null)s=o;else s=Oe({},s,o);var l=Je(a)?a:a.split(/\s+/);for(var u=0;u<l.length;u++){var f=l[u];if(xr(f))continue;var v=f.match(cv);if(v){var h=v[1],c=v[2]?v[2]:null,d=r(e,f,h,c,n,i,s);if(d===!1)break}}},Ml=function(e,r){return e.addEventFields(e.context,r),new hv(r.type,r)},mp=function(e,r,a){if(xh(a)){r(e,a);return}else if(We(a)){r(e,Ml(e,a));return}var n=Je(a)?a:a.split(/\s+/);for(var i=0;i<n.length;i++){var s=n[i];if(xr(s))continue;var o=s.match(cv);if(o){var l=o[1],u=o[2]?o[2]:null,f=Ml(e,{type:l,namespace:u,target:e.context});r(e,f)}}};Ar.on=Ar.addListener=function(t,e,r,a,n){return gv(this,function(i,s,o,l,u,f,v){if(st(f))i.listeners.push({event:s,callback:f,type:o,namespace:l,qualifier:u,conf:v})},t,e,r,a,n),this};Ar.one=function(t,e,r,a){return this.on(t,e,r,a,{one:!0})};Ar.removeListener=Ar.off=function(t,e,r,a){var n=this;if(this.emitting!==0)this.listeners=nc(this.listeners);var i=this.listeners,s=function(u){var f=i[u];gv(n,function(v,h,c,d,g,y){if((f.type===c||t==="*")&&(!d&&f.namespace!==".*"||f.namespace===d)&&(!g||v.qualifierCompare(f.qualifier,g))&&(!y||f.callback===y))return i.splice(u,1),!1},t,e,r,a)};for(var o=i.length-1;o>=0;o--)s(o);return this};Ar.removeAllListeners=function(){return this.removeListener("*")};Ar.emit=Ar.trigger=function(t,e,r){var a=this.listeners,n=a.length;if(this.emitting++,!Je(e))e=[e];return mp(this,function(i,s){if(r!=null)a=[{event:s.event,type:s.type,namespace:s.namespace,callback:r}],n=a.length;var o=function(){var f=a[l];if(f.type===s.type&&(!f.namespace||f.namespace===s.namespace||f.namespace===pp)&&i.eventMatches(i.context,f,s)){var v=[s];if(e!=null)sc(v,e);if(i.beforeEmit(i.context,f,s),f.conf&&f.conf.one)i.listeners=i.listeners.filter(function(d){return d!==f});var h=i.callbackContext(i.context,f,s),c=f.callback.apply(h,v);if(i.afterEmit(i.context,f,s),c===!1)s.stopPropagation(),s.preventDefault()}};for(var l=0;l<n;l++)o();if(i.bubble(i.context)&&!s.isPropagationStopped())i.parent(i.context).emit(s,e)},t),this.emitting--,this};var bp={qualifierCompare:function(e,r){if(e==null||r==null)return e==null&&r==null;else return e.sameText(r)},eventMatches:function(e,r,a){var n=r.qualifier;if(n!=null)return e!==a.target&&Za(a.target)&&n.matches(a.target);return!0},addEventFields:function(e,r){r.cy=e.cy(),r.target=e},callbackContext:function(e,r,a){return r.qualifier!=null?a.target:e},beforeEmit:function(e,r){if(r.conf&&r.conf.once)r.conf.onceCollection.removeListener(r.event,r.qualifier,r.callback)},bubble:function(){return!0},parent:function(e){return e.isChild()?e.parent():e.cy()}},bn=function(e){if(Re(e))return new Sr(e);else return e},pv={createEmitter:function(){for(var e=0;e<this.length;e++){var r=this[e],a=r._private;if(!a.emitter)a.emitter=new ii(bp,r)}return this},emitter:function(){return this._private.emitter},on:function(e,r,a){var n=bn(r);for(var i=0;i<this.length;i++){var s=this[i];s.emitter().on(e,n,a)}return this},removeListener:function(e,r,a){var n=bn(r);for(var i=0;i<this.length;i++){var s=this[i];s.emitter().removeListener(e,n,a)}return this},removeAllListeners:function(){for(var e=0;e<this.length;e++){var r=this[e];r.emitter().removeAllListeners()}return this},one:function(e,r,a){var n=bn(r);for(var i=0;i<this.length;i++){var s=this[i];s.emitter().one(e,n,a)}return this},once:function(e,r,a){var n=bn(r);for(var i=0;i<this.length;i++){var s=this[i];s.emitter().on(e,n,a,{once:!0,onceCollection:this})}},emit:function(e,r){for(var a=0;a<this.length;a++){var n=this[a];n.emitter().emit(e,r)}return this},emitAndNotify:function(e,r){if(this.length===0)return;return this.cy().notify(e,this),this.emit(e,r),this}};Ze.eventAliasesOn(pv);var yv={nodes:function(e){return this.filter(function(r){return r.isNode()}).filter(e)},edges:function(e){return this.filter(function(r){return r.isEdge()}).filter(e)},byGroup:function(){var e=this.spawn(),r=this.spawn();for(var a=0;a<this.length;a++){var n=this[a];if(n.isNode())e.push(n);else r.push(n)}return{nodes:e,edges:r}},filter:function(e,r){if(e===void 0)return this;else if(Re(e)||zt(e))return new Sr(e).filter(this);else if(st(e)){var a=this.spawn(),n=this;for(var i=0;i<n.length;i++){var s=n[i],o=r?e.apply(r,[s,i,n]):e(s,i,n);if(o)a.push(s)}return a}return this.spawn()},not:function(e){if(!e)return this;else{if(Re(e))e=this.filter(e);var r=this.spawn();for(var a=0;a<this.length;a++){var n=this[a],i=e.has(n);if(!i)r.push(n)}return r}},absoluteComplement:function(){var e=this.cy();return e.mutableElements().not(this)},intersect:function(e){if(Re(e)){var r=e;return this.filter(r)}var a=this.spawn(),n=this,i=e,s=this.length<e.length,o=s?n:i,l=s?i:n;for(var u=0;u<o.length;u++){var f=o[u];if(l.has(f))a.push(f)}return a},xor:function(e){var r=this._private.cy;if(Re(e))e=r.$(e);var a=this.spawn(),n=this,i=e,s=function(l,u){for(var f=0;f<l.length;f++){var v=l[f],h=v._private.data.id,c=u.hasElementWithId(h);if(!c)a.push(v)}};return s(n,i),s(i,n),a},diff:function(e){var r=this._private.cy;if(Re(e))e=r.$(e);var a=this.spawn(),n=this.spawn(),i=this.spawn(),s=this,o=e,l=function(f,v,h){for(var c=0;c<f.length;c++){var d=f[c],g=d._private.data.id,y=v.hasElementWithId(g);if(y)i.merge(d);else h.push(d)}};return l(s,o,a),l(o,s,n),{left:a,right:n,both:i}},add:function(e){var r=this._private.cy;if(!e)return this;if(Re(e)){var a=e;e=r.mutableElements().filter(a)}var n=this.spawnSelf();for(var i=0;i<e.length;i++){var s=e[i],o=!this.has(s);if(o)n.push(s)}return n},merge:function(e){var r=this._private,a=r.cy;if(!e)return this;if(e&&Re(e)){var n=e;e=a.mutableElements().filter(n)}var i=r.map;for(var s=0;s<e.length;s++){var o=e[s],l=o._private.data.id,u=!i.has(l);if(u){var f=this.length++;this[f]=o,i.set(l,{ele:o,index:f})}}return this},unmergeAt:function(e){var r=this[e],a=r.id(),n=this._private,i=n.map;this[e]=void 0,i.delete(a);var s=e===this.length-1;if(this.length>1&&!s){var o=this.length-1,l=this[o],u=l._private.data.id;this[o]=void 0,this[e]=l,i.set(u,{ele:l,index:e})}return this.length--,this},unmergeOne:function(e){e=e[0];var r=this._private,a=e._private.data.id,n=r.map,i=n.get(a);if(!i)return this;var s=i.index;return this.unmergeAt(s),this},unmerge:function(e){var r=this._private.cy;if(!e)return this;if(e&&Re(e)){var a=e;e=r.mutableElements().filter(a)}for(var n=0;n<e.length;n++)this.unmergeOne(e[n]);return this},unmergeBy:function(e){for(var r=this.length-1;r>=0;r--){var a=this[r];if(e(a))this.unmergeAt(r)}return this},map:function(e,r){var a=[],n=this;for(var i=0;i<n.length;i++){var s=n[i],o=r?e.apply(r,[s,i,n]):e(s,i,n);a.push(o)}return a},reduce:function(e,r){var a=r,n=this;for(var i=0;i<n.length;i++)a=e(a,n[i],i,n);return a},max:function(e,r){var a=-1/0,n,i=this;for(var s=0;s<i.length;s++){var o=i[s],l=r?e.apply(r,[o,s,i]):e(o,s,i);if(l>a)a=l,n=o}return{value:a,ele:n}},min:function(e,r){var a=1/0,n,i=this;for(var s=0;s<i.length;s++){var o=i[s],l=r?e.apply(r,[o,s,i]):e(o,s,i);if(l<a)a=l,n=o}return{value:a,ele:n}}},$e=yv;$e.u=$e["|"]=$e["+"]=$e.union=$e.or=$e.add;$e["\\"]=$e["!"]=$e["-"]=$e.difference=$e.relativeComplement=$e.subtract=$e.not;$e.n=$e["&"]=$e["."]=$e.and=$e.intersection=$e.intersect;$e["^"]=$e["(+)"]=$e["(-)"]=$e.symmetricDifference=$e.symdiff=$e.xor;$e.fnFilter=$e.filterFn=$e.stdFilter=$e.filter;$e.complement=$e.abscomp=$e.absoluteComplement;var wp={isNode:function(){return this.group()==="nodes"},isEdge:function(){return this.group()==="edges"},isLoop:function(){return this.isEdge()&&this.source()[0]===this.target()[0]},isSimple:function(){return this.isEdge()&&this.source()[0]!==this.target()[0]},group:function(){var e=this[0];if(e)return e._private.group}},mv=function(e,r){var a=e.cy(),n=a.hasCompoundNodes();function i(f){var v=f.pstyle("z-compound-depth");if(v.value==="auto")return n?f.zDepth():0;else if(v.value==="bottom")return-1;else if(v.value==="top")return go;return 0}var s=i(e)-i(r);if(s!==0)return s;function o(f){var v=f.pstyle("z-index-compare");if(v.value==="auto")return f.isNode()?1:0;return 0}var l=o(e)-o(r);if(l!==0)return l;var u=e.pstyle("z-index").value-r.pstyle("z-index").value;if(u!==0)return u;return e.poolIndex()-r.poolIndex()},Hn={forEach:function(e,r){if(st(e)){var a=this.length;for(var n=0;n<a;n++){var i=this[n],s=r?e.apply(r,[i,n,this]):e(i,n,this);if(s===!1)break}}return this},toArray:function(){var e=[];for(var r=0;r<this.length;r++)e.push(this[r]);return e},slice:function(e,r){var a=[],n=this.length;if(r==null)r=n;if(e==null)e=0;if(e<0)e=n+e;if(r<0)r=n+r;for(var i=e;i>=0&&i<r&&i<n;i++)a.push(this[i]);return this.spawn(a)},size:function(){return this.length},eq:function(e){return this[e]||this.spawn()},first:function(){return this[0]||this.spawn()},last:function(){return this[this.length-1]||this.spawn()},empty:function(){return this.length===0},nonempty:function(){return!this.empty()},sort:function(e){if(!st(e))return this;var r=this.toArray().sort(e);return this.spawn(r)},sortByZIndex:function(){return this.sort(mv)},zDepth:function(){var e=this[0];if(!e)return;var r=e._private,a=r.group;if(a==="nodes"){var n=r.data.parent?e.parents().size():0;if(!e.isParent())return go-1;return n}else{var{source:i,target:s}=r,o=i.zDepth(),l=s.zDepth();return Math.max(o,l,0)}}};Hn.each=Hn.forEach;var Ep=function(){var e="undefined",r=(typeof Symbol>"u"?"undefined":yt(Symbol))!=e&&yt(Symbol.iterator)!=e;if(r)Hn[Symbol.iterator]=function(){var a=this,n={value:void 0,done:!1},i=0,s=this.length;return df({next:function(){if(i<s)n.value=a[i++];else n.value=void 0,n.done=!0;return n}},Symbol.iterator,function(){return this})}};Ep();var xp=St({nodeDimensionsIncludeLabels:!1}),Mn={layoutDimensions:function(e){e=xp(e);var r;if(!this.takesUpSpace())r={w:0,h:0};else if(e.nodeDimensionsIncludeLabels){var a=this.boundingBox();r={w:a.w,h:a.h}}else r={w:this.outerWidth(),h:this.outerHeight()};if(r.w===0||r.h===0)r.w=r.h=1;return r},layoutPositions:function(e,r,a){var n=this.nodes().filter(function(A){return!A.isParent()}),i=this.cy(),s=r.eles,o=function(M){return M.id()},l=la(a,o);e.emit({type:"layoutstart",layout:e}),e.animations=[];var u=function(M,S,P){var N={x:S.x1+S.w/2,y:S.y1+S.h/2},R={x:(P.x-N.x)*M,y:(P.y-N.y)*M};return{x:N.x+R.x,y:N.y+R.y}},f=r.spacingFactor&&r.spacingFactor!==1,v=function(){if(!f)return null;var M=Ot();for(var S=0;S<n.length;S++){var P=n[S],N=l(P,S);kf(M,N.x,N.y)}return M},h=v(),c=la(function(A,M){var S=l(A,M);if(f){var P=Math.abs(r.spacingFactor);S=u(P,h,S)}if(r.transform!=null)S=r.transform(A,S);return S},o);if(r.animate){for(var d=0;d<n.length;d++){var g=n[d],y=c(g,d),p=r.animateFilter==null||r.animateFilter(g,d);if(p){var m=g.animation({position:y,duration:r.animationDuration,easing:r.animationEasing});e.animations.push(m)}else g.position(y)}if(r.fit){var b=i.animation({fit:{boundingBox:s.boundingBoxAt(c),padding:r.padding},duration:r.animationDuration,easing:r.animationEasing});e.animations.push(b)}else if(r.zoom!==void 0&&r.pan!==void 0){var E=i.animation({zoom:r.zoom,pan:r.pan,duration:r.animationDuration,easing:r.animationEasing});e.animations.push(E)}e.animations.forEach(function(A){return A.play()}),e.one("layoutready",r.ready),e.emit({type:"layoutready",layout:e}),ga.all(e.animations.map(function(A){return A.promise()})).then(function(){e.one("layoutstop",r.stop),e.emit({type:"layoutstop",layout:e})})}else{if(n.positions(c),r.fit)i.fit(r.eles,r.padding);if(r.zoom!=null)i.zoom(r.zoom);if(r.pan)i.pan(r.pan);e.one("layoutready",r.ready),e.emit({type:"layoutready",layout:e}),e.one("layoutstop",r.stop),e.emit({type:"layoutstop",layout:e})}return this},layout:function(e){var r=this.cy();return r.makeLayout(Oe({},e,{eles:this}))}};Mn.createLayout=Mn.makeLayout=Mn.layout;function bv(t,e,r){var a=r._private,n=a.styleCache=a.styleCache||[],i;if((i=n[t])!=null)return i;else return i=n[t]=e(r),i}function si(t,e){return t=Gr(t),function(a){return bv(t,e,a)}}function oi(t,e){t=Gr(t);var r=function(n){return e.call(n)};return function(){var n=this[0];if(n)return bv(t,r,n)}}var Tt={recalculateRenderedStyle:function(e){var r=this.cy(),a=r.renderer(),n=r.styleEnabled();if(a&&n)a.recalculateRenderedStyle(this,e);return this},dirtyStyleCache:function(){var e=this.cy(),r=function(i){return i._private.styleCache=null};if(e.hasCompoundNodes()){var a=this.spawnSelf().merge(this.descendants()).merge(this.parents());a.merge(a.connectedEdges()),a.forEach(r)}else this.forEach(function(n){r(n),n.connectedEdges().forEach(r)});return this},updateStyle:function(e){var r=this._private.cy;if(!r.styleEnabled())return this;if(r.batching()){var a=r._private.batchStyleEles;return a.merge(this),this}var n=r.hasCompoundNodes(),i=this;if(e=e||e===void 0?!0:!1,n)i=this.spawnSelf().merge(this.descendants()).merge(this.parents());var s=i;if(e)s.emitAndNotify("style");else s.emit("style");return i.forEach(function(o){return o._private.styleDirty=!0}),this},cleanStyle:function(){var e=this.cy();if(!e.styleEnabled())return;for(var r=0;r<this.length;r++){var a=this[r];if(a._private.styleDirty)a._private.styleDirty=!1,e.style().apply(a)}},parsedStyle:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,a=this[0],n=a.cy();if(!n.styleEnabled())return;if(a){if(a._private.styleDirty)a._private.styleDirty=!1,n.style().apply(a);var i=a._private.style[e];if(i!=null)return i;else if(r)return n.style().getDefaultProperty(e);else return null}},numericStyle:function(e){var r=this[0];if(!r.cy().styleEnabled())return;if(r){var a=r.pstyle(e);return a.pfValue!==void 0?a.pfValue:a.value}},numericStyleUnits:function(e){var r=this[0];if(!r.cy().styleEnabled())return;if(r)return r.pstyle(e).units},renderedStyle:function(e){var r=this.cy();if(!r.styleEnabled())return this;var a=this[0];if(a)return r.style().getRenderedStyle(a,e)},style:function(e,r){var a=this.cy();if(!a.styleEnabled())return this;var n=!1,i=a.style();if(We(e)){var s=e;i.applyBypass(this,s,n),this.emitAndNotify("style")}else if(Re(e))if(r===void 0){var o=this[0];if(o)return i.getStylePropertyValue(o,e);else return}else i.applyBypass(this,e,r,n),this.emitAndNotify("style");else if(e===void 0){var l=this[0];if(l)return i.getRawStyle(l);else return}return this},removeStyle:function(e){var r=this.cy();if(!r.styleEnabled())return this;var a=!1,n=r.style(),i=this;if(e===void 0)for(var s=0;s<i.length;s++){var o=i[s];n.removeAllBypasses(o,a)}else{e=e.split(/\s+/);for(var l=0;l<i.length;l++){var u=i[l];n.removeBypasses(u,e,a)}}return this.emitAndNotify("style"),this},show:function(){return this.css("display","element"),this},hide:function(){return this.css("display","none"),this},effectiveOpacity:function(){var e=this.cy();if(!e.styleEnabled())return 1;var r=e.hasCompoundNodes(),a=this[0];if(a){var n=a._private,i=a.pstyle("opacity").value;if(!r)return i;var s=!n.data.parent?null:a.parents();if(s)for(var o=0;o<s.length;o++){var l=s[o],u=l.pstyle("opacity").value;i=u*i}return i}},transparent:function(){var e=this.cy();if(!e.styleEnabled())return!1;var r=this[0],a=r.cy().hasCompoundNodes();if(r)if(!a)return r.pstyle("opacity").value===0;else return r.effectiveOpacity()===0},backgrounding:function(){var e=this.cy();if(!e.styleEnabled())return!1;var r=this[0];return r._private.backgrounding?!0:!1}};function Is(t,e){var r=t._private,a=r.data.parent?t.parents():null;if(a)for(var n=0;n<a.length;n++){var i=a[n];if(!e(i))return!1}return!0}function Ao(t){var e=t.ok,r=t.edgeOkViaNode||t.ok,a=t.parentOk||t.ok;return function(){var n=this.cy();if(!n.styleEnabled())return!0;var i=this[0],s=n.hasCompoundNodes();if(i){var o=i._private;if(!e(i))return!1;if(i.isNode())return!s||Is(i,a);else{var{source:l,target:u}=o;return r(l)&&(!s||Is(l,r))&&(l===u||r(u)&&(!s||Is(u,r)))}}}}var pa=si("eleTakesUpSpace",function(t){return t.pstyle("display").value==="element"&&t.width()!==0&&(t.isNode()?t.height()!==0:!0)});Tt.takesUpSpace=oi("takesUpSpace",Ao({ok:pa}));var Tp=si("eleInteractive",function(t){return t.pstyle("events").value==="yes"&&t.pstyle("visibility").value==="visible"&&pa(t)}),Cp=si("parentInteractive",function(t){return t.pstyle("visibility").value==="visible"&&pa(t)});Tt.interactive=oi("interactive",Ao({ok:Tp,parentOk:Cp,edgeOkViaNode:pa}));Tt.noninteractive=function(){var t=this[0];if(t)return!t.interactive()};var Sp=si("eleVisible",function(t){return t.pstyle("visibility").value==="visible"&&t.pstyle("opacity").pfValue!==0&&pa(t)}),Dp=pa;Tt.visible=oi("visible",Ao({ok:Sp,edgeOkViaNode:Dp}));Tt.hidden=function(){var t=this[0];if(t)return!t.visible()};Tt.isBundledBezier=oi("isBundledBezier",function(){if(!this.cy().styleEnabled())return!1;return!this.removed()&&this.pstyle("curve-style").value==="bezier"&&this.takesUpSpace()});Tt.bypass=Tt.css=Tt.style;Tt.renderedCss=Tt.renderedStyle;Tt.removeBypass=Tt.removeCss=Tt.removeStyle;Tt.pstyle=Tt.parsedStyle;var Er={};function Ll(t){return function(){var e=arguments,r=[];if(e.length===2){var a=e[0],n=e[1];this.on(t.event,a,n)}else if(e.length===1&&st(e[0])){var i=e[0];this.on(t.event,i)}else if(e.length===0||e.length===1&&Je(e[0])){var s=e.length===1?e[0]:null;for(var o=0;o<this.length;o++){var l=this[o],u=!t.ableField||l._private[t.ableField],f=l._private[t.field]!=t.value;if(t.overrideAble){var v=t.overrideAble(l);if(v!==void 0){if(u=v,!v)return this}}if(u){if(l._private[t.field]=t.value,f)r.push(l)}}var h=this.spawn(r);if(h.updateStyle(),h.emit(t.event),s)h.emit(s)}return this}}function ya(t){Er[t.field]=function(){var e=this[0];if(e){if(t.overrideField){var r=t.overrideField(e);if(r!==void 0)return r}return e._private[t.field]}},Er[t.on]=Ll({event:t.on,field:t.field,ableField:t.ableField,overrideAble:t.overrideAble,value:!0}),Er[t.off]=Ll({event:t.off,field:t.field,ableField:t.ableField,overrideAble:t.overrideAble,value:!1})}ya({field:"locked",overrideField:function(e){return e.cy().autolock()?!0:void 0},on:"lock",off:"unlock"});ya({field:"grabbable",overrideField:function(e){return e.cy().autoungrabify()||e.pannable()?!1:void 0},on:"grabify",off:"ungrabify"});ya({field:"selected",ableField:"selectable",overrideAble:function(e){return e.cy().autounselectify()?!1:void 0},on:"select",off:"unselect"});ya({field:"selectable",overrideField:function(e){return e.cy().autounselectify()?!1:void 0},on:"selectify",off:"unselectify"});Er.deselect=Er.unselect;Er.grabbed=function(){var t=this[0];if(t)return t._private.grabbed};ya({field:"active",on:"activate",off:"unactivate"});ya({field:"pannable",on:"panify",off:"unpanify"});Er.inactive=function(){var t=this[0];if(t)return!t._private.active};var At={},Rl=function(e){return function(a){var n=this,i=[];for(var s=0;s<n.length;s++){var o=n[s];if(!o.isNode())continue;var l=!1,u=o.connectedEdges();for(var f=0;f<u.length;f++){var v=u[f],h=v.source(),c=v.target();if(e.noIncomingEdges&&c===o&&h!==o||e.noOutgoingEdges&&h===o&&c!==o){l=!0;break}}if(!l)i.push(o)}return this.spawn(i,!0).filter(a)}},Pl=function(e){return function(r){var a=this,n=[];for(var i=0;i<a.length;i++){var s=a[i];if(!s.isNode())continue;var o=s.connectedEdges();for(var l=0;l<o.length;l++){var u=o[l],f=u.source(),v=u.target();if(e.outgoing&&f===s)n.push(u),n.push(v);else if(e.incoming&&v===s)n.push(u),n.push(f)}}return this.spawn(n,!0).filter(r)}},Nl=function(e){return function(r){var a=this,n=[],i={};for(;;){var s=e.outgoing?a.outgoers():a.incomers();if(s.length===0)break;var o=!1;for(var l=0;l<s.length;l++){var u=s[l],f=u.id();if(!i[f])i[f]=!0,n.push(u),o=!0}if(!o)break;a=s}return this.spawn(n,!0).filter(r)}};At.clearTraversalCache=function(){for(var t=0;t<this.length;t++)this[t]._private.traversalCache=null};Oe(At,{roots:Rl({noIncomingEdges:!0}),leaves:Rl({noOutgoingEdges:!0}),outgoers:Ht(Pl({outgoing:!0}),"outgoers"),successors:Nl({outgoing:!0}),incomers:Ht(Pl({incoming:!0}),"incomers"),predecessors:Nl({})});Oe(At,{neighborhood:Ht(function(t){var e=[],r=this.nodes();for(var a=0;a<r.length;a++){var n=r[a],i=n.connectedEdges();for(var s=0;s<i.length;s++){var o=i[s],l=o.source(),u=o.target(),f=n===l?u:l;if(f.length>0)e.push(f[0]);e.push(o[0])}}return this.spawn(e,!0).filter(t)},"neighborhood"),closedNeighborhood:function(e){return this.neighborhood().add(this).filter(e)},openNeighborhood:function(e){return this.neighborhood(e)}});At.neighbourhood=At.neighborhood;At.closedNeighbourhood=At.closedNeighborhood;At.openNeighbourhood=At.openNeighborhood;Oe(At,{source:Ht(function(e){var r=this[0],a;if(r)a=r._private.source||r.cy().collection();return a&&e?a.filter(e):a},"source"),target:Ht(function(e){var r=this[0],a;if(r)a=r._private.target||r.cy().collection();return a&&e?a.filter(e):a},"target"),sources:Ol({attr:"source"}),targets:Ol({attr:"target"})});function Ol(t){return function(r){var a=[];for(var n=0;n<this.length;n++){var i=this[n],s=i._private[t.attr];if(s)a.push(s)}return this.spawn(a,!0).filter(r)}}Oe(At,{edgesWith:Ht(Il(),"edgesWith"),edgesTo:Ht(Il({thisIsSrc:!0}),"edgesTo")});function Il(t){return function(r){var a=[],n=this._private.cy,i=t||{};if(Re(r))r=n.$(r);for(var s=0;s<r.length;s++){var o=r[s]._private.edges;for(var l=0;l<o.length;l++){var u=o[l],f=u._private.data,v=this.hasElementWithId(f.source)&&r.hasElementWithId(f.target),h=r.hasElementWithId(f.source)&&this.hasElementWithId(f.target),c=v||h;if(!c)continue;if(i.thisIsSrc||i.thisIsTgt){if(i.thisIsSrc&&!v)continue;if(i.thisIsTgt&&!h)continue}a.push(u)}}return this.spawn(a,!0)}}Oe(At,{connectedEdges:Ht(function(t){var e=[],r=this;for(var a=0;a<r.length;a++){var n=r[a];if(!n.isNode())continue;var i=n._private.edges;for(var s=0;s<i.length;s++){var o=i[s];e.push(o)}}return this.spawn(e,!0).filter(t)},"connectedEdges"),connectedNodes:Ht(function(t){var e=[],r=this;for(var a=0;a<r.length;a++){var n=r[a];if(!n.isEdge())continue;e.push(n.source()[0]),e.push(n.target()[0])}return this.spawn(e,!0).filter(t)},"connectedNodes"),parallelEdges:Ht(Bl(),"parallelEdges"),codirectedEdges:Ht(Bl({codirected:!0}),"codirectedEdges")});function Bl(t){var e={codirected:!1};return t=Oe({},e,t),function(a){var n=[],i=this.edges(),s=t;for(var o=0;o<i.length;o++){var l=i[o],u=l._private,f=u.source,v=f._private.data.id,h=u.data.target,c=f._private.edges;for(var d=0;d<c.length;d++){var g=c[d],y=g._private.data,{target:p,source:m}=y,b=p===h&&m===v,E=v===p&&h===m;if(s.codirected&&b||!s.codirected&&(b||E))n.push(g)}}return this.spawn(n,!0).filter(a)}}Oe(At,{components:function(e){var r=this,a=r.cy(),n=a.collection(),i=e==null?r.nodes():e.nodes(),s=[];if(e!=null&&i.empty())i=e.sources();var o=function(f,v){n.merge(f),i.unmerge(f),v.merge(f)};if(i.empty())return r.spawn();var l=function(){var f=a.collection();s.push(f);var v=i[0];o(v,f),r.bfs({directed:!1,roots:v,visit:function(c){return o(c,f)}}),f.forEach(function(h){h.connectedEdges().forEach(function(c){if(r.has(c)&&f.has(c.source())&&f.has(c.target()))f.merge(c)})})};do l();while(i.length>0);return s},component:function(){var e=this[0];return e.cy().mutableElements().components(e)[0]}});At.componentsOf=At.components;var Ct=function(e,r){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(e===void 0){it("A collection must have a reference to the core");return}var i=new nr,s=!1;if(!r)r=[];else if(r.length>0&&We(r[0])&&!Za(r[0])){s=!0;var o=[],l=new da;for(var u=0,f=r.length;u<f;u++){var v=r[u];if(v.data==null)v.data={};var h=v.data;if(h.id==null)h.id=Nf();else if(e.hasElementWithId(h.id)||l.has(h.id))continue;var c=new Qn(e,v,!1);o.push(c),l.add(h.id)}r=o}this.length=0;for(var d=0,g=r.length;d<g;d++){var y=r[d][0];if(y==null)continue;var p=y._private.data.id;if(!a||!i.has(p)){if(a)i.set(p,{index:this.length,ele:y});this[this.length]=y,this.length++}}if(this._private={eles:this,cy:e,get map(){if(this.lazyMap==null)this.rebuildMap();return this.lazyMap},set map(m){this.lazyMap=m},rebuildMap:function(){var b=this.lazyMap=new nr,E=this.eles;for(var A=0;A<E.length;A++){var M=E[A];b.set(M.id(),{index:A,ele:M})}}},a)this._private.map=i;if(s&&!n)this.restore()},et=Qn.prototype=Ct.prototype=Object.create(Array.prototype);et.instanceString=function(){return"collection"};et.spawn=function(t,e){return new Ct(this.cy(),t,e)};et.spawnSelf=function(){return this.spawn(this)};et.cy=function(){return this._private.cy};et.renderer=function(){return this._private.cy.renderer()};et.element=function(){return this[0]};et.collection=function(){if(mf(this))return this;else return new Ct(this._private.cy,[this])};et.unique=function(){return new Ct(this._private.cy,this,!0)};et.hasElementWithId=function(t){return t=""+t,this._private.map.has(t)};et.getElementById=function(t){t=""+t;var e=this._private.cy,r=this._private.map.get(t);return r?r.ele:new Ct(e)};et.$id=et.getElementById;et.poolIndex=function(){var t=this._private.cy,e=t._private.elements,r=this[0]._private.data.id;return e._private.map.get(r).index};et.indexOf=function(t){var e=t[0]._private.data.id;return this._private.map.get(e).index};et.indexOfId=function(t){return t=""+t,this._private.map.get(t).index};et.json=function(t){var e=this.element(),r=this.cy();if(e==null&&t)return this;if(e==null)return;var a=e._private;if(We(t)){if(r.startBatch(),t.data){e.data(t.data);var n=a.data;if(e.isEdge()){var i=!1,s={},o=t.data.source,l=t.data.target;if(o!=null&&o!=n.source)s.source=""+o,i=!0;if(l!=null&&l!=n.target)s.target=""+l,i=!0;if(i)e=e.move(s)}else{var u="parent"in t.data,f=t.data.parent;if(u&&(f!=null||n.parent!=null)&&f!=n.parent){if(f===void 0)f=null;if(f!=null)f=""+f;e=e.move({parent:f})}}}if(t.position)e.position(t.position);var v=function(g,y,p){var m=t[g];if(m!=null&&m!==a[g])if(m)e[y]();else e[p]()};if(v("removed","remove","restore"),v("selected","select","unselect"),v("selectable","selectify","unselectify"),v("locked","lock","unlock"),v("grabbable","grabify","ungrabify"),v("pannable","panify","unpanify"),t.classes!=null)e.classes(t.classes);return r.endBatch(),this}else if(t===void 0){var h={data:Jt(a.data),position:Jt(a.position),group:a.group,removed:a.removed,selected:a.selected,selectable:a.selectable,locked:a.locked,grabbable:a.grabbable,pannable:a.pannable,classes:null};h.classes="";var c=0;return a.classes.forEach(function(d){return h.classes+=c++===0?d:" "+d}),h}};et.jsons=function(){var t=[];for(var e=0;e<this.length;e++){var r=this[e],a=r.json();t.push(a)}return t};et.clone=function(){var t=this.cy(),e=[];for(var r=0;r<this.length;r++){var a=this[r],n=a.json(),i=new Qn(t,n,!1);e.push(i)}return new Ct(t,e)};et.copy=et.clone;et.restore=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=this,a=r.cy(),n=a._private,i=[],s=[],o;for(var l=0,u=r.length;l<u;l++){var f=r[l];if(e&&!f.removed())continue;if(f.isNode())i.push(f);else s.push(f)}o=i.concat(s);var v,h=function(){o.splice(v,1),v--};for(v=0;v<o.length;v++){var c=o[v],d=c._private,g=d.data;if(c.clearTraversalCache(),!e&&!d.removed);else if(g.id===void 0)g.id=Nf();else if(he(g.id))g.id=""+g.id;else if(xr(g.id)||!Re(g.id)){it("Can not create element with invalid string ID `"+g.id+"`"),h();continue}else if(a.hasElementWithId(g.id)){it("Can not create second element with ID `"+g.id+"`"),h();continue}var y=g.id;if(c.isNode()){var p=d.position;if(p.x==null)p.x=0;if(p.y==null)p.y=0}if(c.isEdge()){var m=c,b=["source","target"],E=b.length,A=!1;for(var M=0;M<E;M++){var S=b[M],P=g[S];if(he(P))P=g[S]=""+g[S];if(P==null||P==="")it("Can not create edge `"+y+"` with unspecified "+S),A=!0;else if(!a.hasElementWithId(P))it("Can not create edge `"+y+"` with nonexistent "+S+" `"+P+"`"),A=!0}if(A){h();continue}var N=a.getElementById(g.source),R=a.getElementById(g.target);if(N.same(R))N._private.edges.push(m);else N._private.edges.push(m),R._private.edges.push(m);m._private.source=N,m._private.target=R}if(d.map=new nr,d.map.set(y,{ele:c,index:0}),d.removed=!1,e)a.addToPool(c)}for(var I=0;I<i.length;I++){var w=i[I],x=w._private.data;if(he(x.parent))x.parent=""+x.parent;var T=x.parent,D=T!=null;if(D||w._private.parent){var C=w._private.parent?a.collection().merge(w._private.parent):a.getElementById(T);if(C.empty())x.parent=void 0;else if(C[0].removed())_e("Node added with missing parent, reference to parent removed"),x.parent=void 0,w._private.parent=null;else{var O=!1,B=C;while(!B.empty()){if(w.same(B)){O=!0,x.parent=void 0;break}B=B.parent()}if(!O)C[0]._private.children.push(w),w._private.parent=C[0],n.hasCompoundNodes=!0}}}if(o.length>0){var z=o.length===r.length?r:new Ct(a,o);for(var V=0;V<z.length;V++){var k=z[V];if(k.isNode())continue;k.parallelEdges().clearTraversalCache(),k.source().clearTraversalCache(),k.target().clearTraversalCache()}var G;if(n.hasCompoundNodes)G=a.collection().merge(z).merge(z.connectedNodes()).merge(z.parent());else G=z;if(G.dirtyCompoundBoundsCache().dirtyBoundingBoxCache().updateStyle(t),t)z.emitAndNotify("add");else if(e)z.emit("add")}return r};et.removed=function(){var t=this[0];return t&&t._private.removed};et.inside=function(){var t=this[0];return t&&!t._private.removed};et.remove=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=this,a=[],n={},i=r._private.cy;function s(T){var D=T._private.edges;for(var C=0;C<D.length;C++)l(D[C])}function o(T){var D=T._private.children;for(var C=0;C<D.length;C++)l(D[C])}function l(T){var D=n[T.id()];if(e&&T.removed()||D)return;else n[T.id()]=!0;if(T.isNode())a.push(T),s(T),o(T);else a.unshift(T)}for(var u=0,f=r.length;u<f;u++){var v=r[u];l(v)}function h(T,D){var C=T._private.edges;Tr(C,D),T.clearTraversalCache()}function c(T){T.clearTraversalCache()}var d=[];d.ids={};function g(T,D){D=D[0],T=T[0];var C=T._private.children,O=T.id();if(Tr(C,D),D._private.parent=null,!d.ids[O])d.ids[O]=!0,d.push(T)}if(r.dirtyCompoundBoundsCache(),e)i.removeFromPool(a);for(var y=0;y<a.length;y++){var p=a[y];if(p.isEdge()){var m=p.source()[0],b=p.target()[0];h(m,p),h(b,p);var E=p.parallelEdges();for(var A=0;A<E.length;A++){var M=E[A];if(c(M),M.isBundledBezier())M.dirtyBoundingBoxCache()}}else{var S=p.parent();if(S.length!==0)g(S,p)}if(e)p._private.removed=!0}var P=i._private.elements;i._private.hasCompoundNodes=!1;for(var N=0;N<P.length;N++){var R=P[N];if(R.isParent()){i._private.hasCompoundNodes=!0;break}}var I=new Ct(this.cy(),a);if(I.size()>0){if(t)I.emitAndNotify("remove");else if(e)I.emit("remove")}for(var w=0;w<d.length;w++){var x=d[w];if(!e||!x.removed())x.updateStyle()}return I};et.move=function(t){var e=this._private.cy,r=this,a=!1,n=!1,i=function(d){return d==null?d:""+d};if(t.source!==void 0||t.target!==void 0){var s=i(t.source),o=i(t.target),l=s!=null&&e.hasElementWithId(s),u=o!=null&&e.hasElementWithId(o);if(l||u)e.batch(function(){r.remove(a,n),r.emitAndNotify("moveout");for(var c=0;c<r.length;c++){var d=r[c],g=d._private.data;if(d.isEdge()){if(l)g.source=s;if(u)g.target=o}}r.restore(a,n)}),r.emitAndNotify("move")}else if(t.parent!==void 0){var f=i(t.parent),v=f===null||e.hasElementWithId(f);if(v){var h=f===null?void 0:f;e.batch(function(){var c=r.remove(a,n);c.emitAndNotify("moveout");for(var d=0;d<r.length;d++){var g=r[d],y=g._private.data;if(g.isNode())y.parent=h}c.restore(a,n)}),r.emitAndNotify("move")}}return this};[Xf,kg,An,wr,va,Jg,ni,gp,pv,yv,wp,Hn,Mn,Tt,Er,At].forEach(function(t){Oe(et,t)});var Ap={add:function(e){var r,a=this;if(zt(e)){var n=e;if(n._private.cy===a)r=n.restore();else{var i=[];for(var s=0;s<n.length;s++){var o=n[s];i.push(o.json())}r=new Ct(a,i)}}else if(Je(e)){var l=e;r=new Ct(a,l)}else if(We(e)&&(Je(e.nodes)||Je(e.edges))){var u=e,f=[],v=["nodes","edges"];for(var h=0,c=v.length;h<c;h++){var d=v[h],g=u[d];if(Je(g))for(var y=0,p=g.length;y<p;y++){var m=Oe({group:d},g[y]);f.push(m)}}r=new Ct(a,f)}else{var b=e;r=new Qn(a,b).collection()}return r},remove:function(e){if(zt(e));else if(Re(e)){var r=e;e=this.$(r)}return e.remove()}};/*! Bezier curve function generator. Copyright Gaetan Renaudeau. MIT License: http://en.wikipedia.org/wiki/MIT_License */function Mp(t,e,r,a){var n=4,i=0.001,s=0.0000001,o=10,l=11,u=1/(l-1),f=typeof Float32Array<"u";if(arguments.length!==4)return!1;for(var v=0;v<4;++v)if(typeof arguments[v]!=="number"||isNaN(arguments[v])||!isFinite(arguments[v]))return!1;t=Math.min(t,1),r=Math.min(r,1),t=Math.max(t,0),r=Math.max(r,0);var h=f?new Float32Array(l):Array(l);function c(R,I){return 1-3*I+3*R}function d(R,I){return 3*I-6*R}function g(R){return 3*R}function y(R,I,w){return((c(I,w)*R+d(I,w))*R+g(I))*R}function p(R,I,w){return 3*c(I,w)*R*R+2*d(I,w)*R+g(I)}function m(R,I){for(var w=0;w<n;++w){var x=p(I,t,r);if(x===0)return I;var T=y(I,t,r)-R;I-=T/x}return I}function b(){for(var R=0;R<l;++R)h[R]=y(R*u,t,r)}function E(R,I,w){var x,T,D=0;do if(T=I+(w-I)/2,x=y(T,t,r)-R,x>0)w=T;else I=T;while(Math.abs(x)>s&&++D<o);return T}function A(R){var I=0,w=1,x=l-1;for(;w!==x&&h[w]<=R;++w)I+=u;--w;var T=(R-h[w])/(h[w+1]-h[w]),D=I+T*u,C=p(D,t,r);if(C>=i)return m(R,D);else if(C===0)return D;else return E(R,I,I+u)}var M=!1;function S(){if(M=!0,t!==e||r!==a)b()}var P=function(I){if(!M)S();if(t===e&&r===a)return I;if(I===0)return 0;if(I===1)return 1;return y(A(I),e,a)};P.getControlPoints=function(){return[{x:t,y:e},{x:r,y:a}]};var N="generateBezier("+[t,e,r,a]+")";return P.toString=function(){return N},P}/*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License */var Lp=function(){function t(a){return-a.tension*a.x-a.friction*a.v}function e(a,n,i){var s={x:a.x+i.dx*n,v:a.v+i.dv*n,tension:a.tension,friction:a.friction};return{dx:s.v,dv:t(s)}}function r(a,n){var i={dx:a.v,dv:t(a)},s=e(a,n*0.5,i),o=e(a,n*0.5,s),l=e(a,n,o),u=0.16666666666666666*(i.dx+2*(s.dx+o.dx)+l.dx),f=0.16666666666666666*(i.dv+2*(s.dv+o.dv)+l.dv);return a.x=a.x+u*n,a.v=a.v+f*n,a}return function a(n,i,s){var o={x:-1,v:0,tension:null,friction:null},l=[0],u=0,f=0.0001,v=0.016,h,c,d;if(n=parseFloat(n)||500,i=parseFloat(i)||20,s=s||null,o.tension=n,o.friction=i,h=s!==null,h)u=a(n,i),c=u/s*v;else c=v;for(;;)if(d=r(d||o,c),l.push(1+d.x),u+=16,!(Math.abs(d.x)>f&&Math.abs(d.v)>f))break;return!h?u:function(g){return l[g*(l.length-1)|0]}}}(),je=function(e,r,a,n){var i=Mp(e,r,a,n);return function(s,o,l){return s+(o-s)*i(l)}},Ln={linear:function(e,r,a){return e+(r-e)*a},ease:je(0.25,0.1,0.25,1),"ease-in":je(0.42,0,1,1),"ease-out":je(0,0,0.58,1),"ease-in-out":je(0.42,0,0.58,1),"ease-in-sine":je(0.47,0,0.745,0.715),"ease-out-sine":je(0.39,0.575,0.565,1),"ease-in-out-sine":je(0.445,0.05,0.55,0.95),"ease-in-quad":je(0.55,0.085,0.68,0.53),"ease-out-quad":je(0.25,0.46,0.45,0.94),"ease-in-out-quad":je(0.455,0.03,0.515,0.955),"ease-in-cubic":je(0.55,0.055,0.675,0.19),"ease-out-cubic":je(0.215,0.61,0.355,1),"ease-in-out-cubic":je(0.645,0.045,0.355,1),"ease-in-quart":je(0.895,0.03,0.685,0.22),"ease-out-quart":je(0.165,0.84,0.44,1),"ease-in-out-quart":je(0.77,0,0.175,1),"ease-in-quint":je(0.755,0.05,0.855,0.06),"ease-out-quint":je(0.23,1,0.32,1),"ease-in-out-quint":je(0.86,0,0.07,1),"ease-in-expo":je(0.95,0.05,0.795,0.035),"ease-out-expo":je(0.19,1,0.22,1),"ease-in-out-expo":je(1,0,0,1),"ease-in-circ":je(0.6,0.04,0.98,0.335),"ease-out-circ":je(0.075,0.82,0.165,1),"ease-in-out-circ":je(0.785,0.135,0.15,0.86),spring:function(e,r,a){if(a===0)return Ln.linear;var n=Lp(e,r,a);return function(i,s,o){return i+(s-i)*n(o)}},"cubic-bezier":je};function kl(t,e,r,a,n){if(a===1)return r;if(e===r)return r;var i=n(e,r,a);if(t==null)return i;if(t.roundValue||t.color)i=Math.round(i);if(t.min!==void 0)i=Math.max(i,t.min);if(t.max!==void 0)i=Math.min(i,t.max);return i}function Fl(t,e){if(t.pfValue!=null||t.value!=null)if(t.pfValue!=null&&(e==null||e.type.units!=="%"))return t.pfValue;else return t.value;else return t}function _r(t,e,r,a,n){var i=n!=null?n.type:null;if(r<0)r=0;else if(r>1)r=1;var s=Fl(t,n),o=Fl(e,n);if(he(s)&&he(o))return kl(i,s,o,r,a);else if(Je(s)&&Je(o)){var l=[];for(var u=0;u<o.length;u++){var f=s[u],v=o[u];if(f!=null&&v!=null){var h=kl(i,f,v,r,a);l.push(h)}else l.push(v)}return l}return}function Rp(t,e,r,a){var n=!a,i=t._private,s=e._private,{easing:o,startTime:l}=s,u=a?t:t.cy(),f=u.style();if(!s.easingImpl)if(o==null)s.easingImpl=Ln.linear;else{var v;if(Re(o)){var h=f.parse("transition-timing-function",o);v=h.value}else v=o;var c,d;if(Re(v))c=v,d=[];else c=v[1],d=v.slice(2).map(function(z){return+z});if(d.length>0){if(c==="spring")d.push(s.duration);s.easingImpl=Ln[c].apply(null,d)}else s.easingImpl=Ln[c]}var g=s.easingImpl,y;if(s.duration===0)y=1;else y=(r-l)/s.duration;if(s.applying)y=s.progress;if(y<0)y=0;else if(y>1)y=1;if(s.delay==null){var{startPosition:p,position:m}=s;if(m&&n&&!t.locked()){var b={};if(Ma(p.x,m.x))b.x=_r(p.x,m.x,y,g);if(Ma(p.y,m.y))b.y=_r(p.y,m.y,y,g);t.position(b)}var{startPan:E,pan:A}=s,M=i.pan,S=A!=null&&a;if(S){if(Ma(E.x,A.x))M.x=_r(E.x,A.x,y,g);if(Ma(E.y,A.y))M.y=_r(E.y,A.y,y,g);t.emit("pan")}var{startZoom:P,zoom:N}=s,R=N!=null&&a;if(R){if(Ma(P,N))i.zoom=Ua(i.minZoom,_r(P,N,y,g),i.maxZoom);t.emit("zoom")}if(S||R)t.emit("viewport");var I=s.style;if(I&&I.length>0&&n){for(var w=0;w<I.length;w++){var x=I[w],T=x.name,D=x,C=s.startStyle[T],O=f.properties[C.name],B=_r(C,D,y,g,O);f.overrideBypass(t,T,B)}t.emit("style")}}return s.progress=y,y}function Ma(t,e){if(t==null||e==null)return!1;if(he(t)&&he(e))return!0;else if(t&&e)return!0;return!1}function Pp(t,e,r,a){var n=e._private;n.started=!0,n.startTime=r-n.progress*n.duration}function zl(t,e){var r=e._private.aniEles,a=[];function n(f,v){var h=f._private,c=h.animation.current,d=h.animation.queue,g=!1;if(c.length===0){var y=d.shift();if(y)c.push(y)}var p=function(M){for(var S=M.length-1;S>=0;S--){var P=M[S];P()}M.splice(0,M.length)};for(var m=c.length-1;m>=0;m--){var b=c[m],E=b._private;if(E.stopped){c.splice(m,1),E.hooked=!1,E.playing=!1,E.started=!1,p(E.frames);continue}if(!E.playing&&!E.applying)continue;if(E.playing&&E.applying)E.applying=!1;if(!E.started)Pp(f,b,t);if(Rp(f,b,t,v),E.applying)E.applying=!1;if(p(E.frames),E.step!=null)E.step(t);if(b.completed())c.splice(m,1),E.hooked=!1,E.playing=!1,E.started=!1,p(E.completes);g=!0}if(!v&&c.length===0&&d.length===0)a.push(f);return g}var i=!1;for(var s=0;s<r.length;s++){var o=r[s],l=n(o);i=i||l}var u=n(e,!0);if(i||u)if(r.length>0)e.notify("draw",r);else e.notify("draw");r.unmerge(a),e.emit("step")}var Np={animate:Ze.animate(),animation:Ze.animation(),animated:Ze.animated(),clearQueue:Ze.clearQueue(),delay:Ze.delay(),delayAnimation:Ze.delayAnimation(),stop:Ze.stop(),addToAnimationPool:function(e){var r=this;if(!r.styleEnabled())return;r._private.aniEles.merge(e)},stopAnimationLoop:function(){this._private.animationsRunning=!1},startAnimationLoop:function(){var e=this;if(e._private.animationsRunning=!0,!e.styleEnabled())return;function r(){if(!e._private.animationsRunning)return;Fn(function(i){zl(i,e),r()})}var a=e.renderer();if(a&&a.beforeRender)a.beforeRender(function(i,s){zl(s,e)},a.beforeRenderPriorities.animations);else r()}},Op={qualifierCompare:function(e,r){if(e==null||r==null)return e==null&&r==null;else return e.sameText(r)},eventMatches:function(e,r,a){var n=r.qualifier;if(n!=null)return e!==a.target&&Za(a.target)&&n.matches(a.target);return!0},addEventFields:function(e,r){r.cy=e,r.target=e},callbackContext:function(e,r,a){return r.qualifier!=null?a.target:e}},wn=function(e){if(Re(e))return new Sr(e);else return e},wv={createEmitter:function(){var e=this._private;if(!e.emitter)e.emitter=new ii(Op,this);return this},emitter:function(){return this._private.emitter},on:function(e,r,a){return this.emitter().on(e,wn(r),a),this},removeListener:function(e,r,a){return this.emitter().removeListener(e,wn(r),a),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,r,a){return this.emitter().one(e,wn(r),a),this},once:function(e,r,a){return this.emitter().one(e,wn(r),a),this},emit:function(e,r){return this.emitter().emit(e,r),this},emitAndNotify:function(e,r){return this.emit(e),this.notify(e,r),this}};Ze.eventAliasesOn(wv);var js={png:function(e){var r=this._private.renderer;return e=e||{},r.png(e)},jpg:function(e){var r=this._private.renderer;return e=e||{},e.bg=e.bg||"#fff",r.jpg(e)}};js.jpeg=js.jpg;var Rn={layout:function(e){var r=this;if(e==null){it("Layout options must be specified to make a layout");return}if(e.name==null){it("A `name` must be specified to make a layout");return}var a=e.name,n=r.extension("layout",a);if(n==null){it("No such layout `"+a+"` found. Did you forget to import it and `cytoscape.use()` it?");return}var i;if(Re(e.eles))i=r.$(e.eles);else i=e.eles!=null?e.eles:r.$();var s=new n(Oe({},e,{cy:r,eles:i}));return s}};Rn.createLayout=Rn.makeLayout=Rn.layout;var Ip={notify:function(e,r){var a=this._private;if(this.batching()){a.batchNotifications=a.batchNotifications||{};var n=a.batchNotifications[e]=a.batchNotifications[e]||this.collection();if(r!=null)n.merge(r);return}if(!a.notificationsEnabled)return;var i=this.renderer();if(this.destroyed()||!i)return;i.notify(e,r)},notifications:function(e){var r=this._private;if(e===void 0)return r.notificationsEnabled;else r.notificationsEnabled=e?!0:!1;return this},noNotifications:function(e){this.notifications(!1),e(),this.notifications(!0)},batching:function(){return this._private.batchCount>0},startBatch:function(){var e=this._private;if(e.batchCount==null)e.batchCount=0;if(e.batchCount===0)e.batchStyleEles=this.collection(),e.batchNotifications={};return e.batchCount++,this},endBatch:function(){var e=this._private;if(e.batchCount===0)return this;if(e.batchCount--,e.batchCount===0){e.batchStyleEles.updateStyle();var r=this.renderer();Object.keys(e.batchNotifications).forEach(function(a){var n=e.batchNotifications[a];if(n.empty())r.notify(a);else r.notify(a,n)})}return this},batch:function(e){return this.startBatch(),e(),this.endBatch(),this},batchData:function(e){var r=this;return this.batch(function(){var a=Object.keys(e);for(var n=0;n<a.length;n++){var i=a[n],s=e[i],o=r.getElementById(i);o.data(s)}})}},Bp=St({hideEdgesOnViewport:!1,textureOnViewport:!1,motionBlur:!1,motionBlurOpacity:0.05,pixelRatio:void 0,desktopTapThreshold:4,touchTapThreshold:8,wheelSensitivity:1,debug:!1,showFps:!1,webgl:!1,webglDebug:!1,webglDebugShowAtlases:!1,webglTexSize:2048,webglTexRows:36,webglTexRowsNodes:18,webglBatchSize:2048,webglTexPerBatch:14,webglBgColor:[255,255,255]}),eo={renderTo:function(e,r,a,n){var i=this._private.renderer;return i.renderTo(e,r,a,n),this},renderer:function(){return this._private.renderer},forceRender:function(){return this.notify("draw"),this},resize:function(){return this.invalidateSize(),this.emitAndNotify("resize"),this},initRenderer:function(e){var r=this,a=r.extension("renderer",e.name);if(a==null){it("Can not initialise: No such renderer `".concat(e.name,"` found. Did you forget to import it and `cytoscape.use()` it?"));return}if(e.wheelSensitivity!==void 0)_e("You have set a custom wheel sensitivity. This will make your app zoom unnaturally when using mainstream mice. You should change this value from the default only if you can guarantee that all your users will use the same hardware and OS configuration as your current machine.");var n=Bp(e);n.cy=r,r._private.renderer=new a(n),this.notify("init")},destroyRenderer:function(){var e=this;e.notify("destroy");var r=e.container();if(r){r._cyreg=null;while(r.childNodes.length>0)r.removeChild(r.childNodes[0])}e._private.renderer=null,e.mutableElements().forEach(function(a){var n=a._private;n.rscratch={},n.rstyle={},n.animation.current=[],n.animation.queue=[]})},onRender:function(e){return this.on("render",e)},offRender:function(e){return this.off("render",e)}};eo.invalidateDimensions=eo.resize;var Pn={collection:function(e,r){if(Re(e))return this.$(e);else if(zt(e))return e.collection();else if(Je(e)){if(!r)r={};return new Ct(this,e,r.unique,r.removed)}return new Ct(this)},nodes:function(e){var r=this.$(function(a){return a.isNode()});if(e)return r.filter(e);return r},edges:function(e){var r=this.$(function(a){return a.isEdge()});if(e)return r.filter(e);return r},$:function(e){var r=this._private.elements;if(e)return r.filter(e);else return r.spawnSelf()},mutableElements:function(){return this._private.elements}};Pn.elements=Pn.filter=Pn.$;var Et={},Ba="t",kp="f";Et.apply=function(t){var e=this,r=e._private,a=r.cy,n=a.collection();for(var i=0;i<t.length;i++){var s=t[i],o=e.getContextMeta(s);if(o.empty)continue;var l=e.getContextStyle(o),u=e.applyContextStyle(o,l,s);if(s._private.appliedInitStyle)e.updateTransitions(s,u.diffProps);else s._private.appliedInitStyle=!0;var f=e.updateStyleHints(s);if(f)n.push(s)}return n};Et.getPropertiesDiff=function(t,e){var r=this,a=r._private.propDiffs=r._private.propDiffs||{},n=t+"-"+e,i=a[n];if(i)return i;var s=[],o={};for(var l=0;l<r.length;l++){var u=r[l],f=t[l]===Ba,v=e[l]===Ba,h=f!==v,c=u.mappedProperties.length>0;if(h||v&&c){var d=void 0;if(h&&c)d=u.properties;else if(h)d=u.properties;else if(c)d=u.mappedProperties;for(var g=0;g<d.length;g++){var y=d[g],p=y.name,m=!1;for(var b=l+1;b<r.length;b++){var E=r[b],A=e[b]===Ba;if(!A)continue;if(m=E.properties[y.name]!=null,m)break}if(!o[p]&&!m)o[p]=!0,s.push(p)}}}return a[n]=s,s};Et.getContextMeta=function(t){var e=this,r="",a,n=t._private.styleCxtKey||"";for(var i=0;i<e.length;i++){var s=e[i],o=s.selector&&s.selector.matches(t);if(o)r+=Ba;else r+=kp}return a=e.getPropertiesDiff(n,r),t._private.styleCxtKey=r,{key:r,diffPropNames:a,empty:a.length===0}};Et.getContextStyle=function(t){var e=t.key,r=this,a=this._private.contextStyles=this._private.contextStyles||{};if(a[e])return a[e];var n={_private:{key:e}};for(var i=0;i<r.length;i++){var s=r[i],o=e[i]===Ba;if(!o)continue;for(var l=0;l<s.properties.length;l++){var u=s.properties[l];n[u.name]=u}}return a[e]=n,n};Et.applyContextStyle=function(t,e,r){var a=this,n=t.diffPropNames,i={},s=a.types;for(var o=0;o<n.length;o++){var l=n[o],u=e[l],f=r.pstyle(l);if(!u)if(!f)continue;else if(f.bypass)u={name:l,deleteBypassed:!0};else u={name:l,delete:!0};if(f===u)continue;if(u.mapped===s.fn&&f!=null&&f.mapping!=null&&f.mapping.value===u.value){var v=f.mapping,h=v.fnValue=u.value(r);if(h===v.prevFnValue)continue}var c=i[l]={prev:f};if(a.applyParsedProperty(r,u),c.next=r.pstyle(l),c.next&&c.next.bypass)c.next=c.next.bypassed}return{diffProps:i}};Et.updateStyleHints=function(t){var e=t._private,r=this,{propertyGroupNames:a,propertyGroupKeys:n}=r,i=function(j,re,ee){return r.getPropertiesHash(j,re,ee)},s=e.styleKey;if(t.removed())return!1;var o=e.group==="nodes",l=t._private.style;a=Object.keys(l);for(var u=0;u<n.length;u++){var f=n[u];e.styleKeys[f]=[Fr,ta]}var v=function(j,re){return e.styleKeys[re][0]=za(j,e.styleKeys[re][0])},h=function(j,re){return e.styleKeys[re][1]=Va(j,e.styleKeys[re][1])},c=function(j,re){v(j,re),h(j,re)},d=function(j,re){for(var ee=0;ee<j.length;ee++){var de=j.charCodeAt(ee);v(de,re),h(de,re)}},g=2000000000,y=function(j){return-128<j&&j<128&&Math.floor(j)!==j?g-(j*1024|0):j};for(var p=0;p<a.length;p++){var m=a[p],b=l[m];if(b==null)continue;var E=this.properties[m],{type:A,groupKey:M}=E,S=void 0;if(E.hashOverride!=null)S=E.hashOverride(t,b);else if(b.pfValue!=null)S=b.pfValue;var P=E.enums==null?b.value:null,N=S!=null,R=P!=null,I=N||R,w=b.units;if(A.number&&I&&!A.multiple){var x=N?S:P;if(c(y(x),M),!N&&w!=null)d(w,M)}else d(b.strValue,M)}var T=[Fr,ta];for(var D=0;D<n.length;D++){var C=n[D],O=e.styleKeys[C];T[0]=za(O[0],T[0]),T[1]=Va(O[1],T[1])}e.styleKey=_h(T[0],T[1]);var B=e.styleKeys;e.labelDimsKey=hr(B.labelDimensions);var z=i(t,["label"],B.labelDimensions);if(e.labelKey=hr(z),e.labelStyleKey=hr(hn(B.commonLabel,z)),!o){var V=i(t,["source-label"],B.labelDimensions);e.sourceLabelKey=hr(V),e.sourceLabelStyleKey=hr(hn(B.commonLabel,V));var k=i(t,["target-label"],B.labelDimensions);e.targetLabelKey=hr(k),e.targetLabelStyleKey=hr(hn(B.commonLabel,k))}if(o){var G=e.styleKeys,{nodeBody:J,nodeBorder:X,nodeOutline:_,backgroundImage:Q,compound:q,pie:te,stripe:Z}=G,U=[J,X,_,Q,q,te,Z].filter(function(W){return W!=null}).reduce(hn,[Fr,ta]);e.nodeKey=hr(U),e.hasPie=te!=null&&te[0]!==Fr&&te[1]!==ta,e.hasStripe=Z!=null&&Z[0]!==Fr&&Z[1]!==ta}return s!==e.styleKey};Et.clearStyleHints=function(t){var e=t._private;e.styleCxtKey="",e.styleKeys={},e.styleKey=null,e.labelKey=null,e.labelStyleKey=null,e.sourceLabelKey=null,e.sourceLabelStyleKey=null,e.targetLabelKey=null,e.targetLabelStyleKey=null,e.nodeKey=null,e.hasPie=null,e.hasStripe=null};Et.applyParsedProperty=function(t,e){var r=this,a=e,n=t._private.style,i,s=r.types,o=r.properties[a.name].type,l=a.bypass,u=n[a.name],f=u&&u.bypass,v=t._private,h="mapping",c=function(J){if(J==null)return null;else if(J.pfValue!=null)return J.pfValue;else return J.value},d=function(){var J=c(u),X=c(a);r.checkTriggers(t,a.name,J,X)};if(e.name==="curve-style"&&t.isEdge()&&(e.value!=="bezier"&&t.isLoop()||e.value==="haystack"&&(t.source().isParent()||t.target().isParent())))a=e=this.parse(e.name,"bezier",l);if(a.delete)return n[a.name]=void 0,d(),!0;if(a.deleteBypassed)if(!u)return d(),!0;else if(u.bypass)return u.bypassed=void 0,d(),!0;else return!1;if(a.deleteBypass)if(!u)return d(),!0;else if(u.bypass)return n[a.name]=u.bypassed,d(),!0;else return!1;var g=function(){_e("Do not assign mappings to elements without corresponding data (i.e. ele `"+t.id()+"` has no mapping for property `"+a.name+"` with data field `"+a.field+"`); try a `["+a.field+"]` selector to limit scope to elements with `"+a.field+"` defined")};switch(a.mapped){case s.mapData:{var y=a.field.split("."),p=v.data;for(var m=0;m<y.length&&p;m++){var b=y[m];p=p[b]}if(p==null)return g(),!1;var E;if(!he(p))return _e("Do not use continuous mappers without specifying numeric data (i.e. `"+a.field+": "+p+"` for `"+t.id()+"` is non-numeric)"),!1;else{var A=a.fieldMax-a.fieldMin;if(A===0)E=0;else E=(p-a.fieldMin)/A}if(E<0)E=0;else if(E>1)E=1;if(o.color){var M=a.valueMin[0],S=a.valueMax[0],P=a.valueMin[1],N=a.valueMax[1],R=a.valueMin[2],I=a.valueMax[2],w=a.valueMin[3]==null?1:a.valueMin[3],x=a.valueMax[3]==null?1:a.valueMax[3],T=[Math.round(M+(S-M)*E),Math.round(P+(N-P)*E),Math.round(R+(I-R)*E),Math.round(w+(x-w)*E)];i={bypass:a.bypass,name:a.name,value:T,strValue:"rgb("+T[0]+", "+T[1]+", "+T[2]+")"}}else if(o.number){var D=a.valueMin+(a.valueMax-a.valueMin)*E;i=this.parse(a.name,D,a.bypass,h)}else return!1;if(!i)return g(),!1;i.mapping=a,a=i;break}case s.data:{var C=a.field.split("."),O=v.data;for(var B=0;B<C.length&&O;B++){var z=C[B];O=O[z]}if(O!=null)i=this.parse(a.name,O,a.bypass,h);if(!i)return g(),!1;i.mapping=a,a=i;break}case s.fn:{var V=a.value,k=a.fnValue!=null?a.fnValue:V(t);if(a.prevFnValue=k,k==null)return _e("Custom function mappers may not return null (i.e. `"+a.name+"` for ele `"+t.id()+"` is null)"),!1;if(i=this.parse(a.name,k,a.bypass,h),!i)return _e("Custom function mappers may not return invalid values for the property type (i.e. `"+a.name+"` for ele `"+t.id()+"` is invalid)"),!1;i.mapping=Jt(a),a=i;break}case void 0:break;default:return!1}if(l){if(f)a.bypassed=u.bypassed;else a.bypassed=u;n[a.name]=a}else if(f)u.bypassed=a;else n[a.name]=a;return d(),!0};Et.cleanElements=function(t,e){for(var r=0;r<t.length;r++){var a=t[r];if(this.clearStyleHints(a),a.dirtyCompoundBoundsCache(),a.dirtyBoundingBoxCache(),!e)a._private.style={};else{var n=a._private.style,i=Object.keys(n);for(var s=0;s<i.length;s++){var o=i[s],l=n[o];if(l!=null)if(l.bypass)l.bypassed=null;else n[o]=null}}}};Et.update=function(){var t=this._private.cy,e=t.mutableElements();e.updateStyle()};Et.updateTransitions=function(t,e){var r=this,a=t._private,n=t.pstyle("transition-property").value,i=t.pstyle("transition-duration").pfValue,s=t.pstyle("transition-delay").pfValue;if(n.length>0&&i>0){var o={},l=!1;for(var u=0;u<n.length;u++){var f=n[u],v=t.pstyle(f),h=e[f];if(!h)continue;var c=h.prev,d=c,g=h.next!=null?h.next:v,y=!1,p=void 0,m=0.000001;if(!d)continue;if(he(d.pfValue)&&he(g.pfValue))y=g.pfValue-d.pfValue,p=d.pfValue+m*y;else if(he(d.value)&&he(g.value))y=g.value-d.value,p=d.value+m*y;else if(Je(d.value)&&Je(g.value))y=d.value[0]!==g.value[0]||d.value[1]!==g.value[1]||d.value[2]!==g.value[2],p=d.strValue;if(y)o[f]=g.strValue,this.applyBypass(t,f,p),l=!0}if(!l)return;a.transitioning=!0,new ga(function(b){if(s>0)t.delayAnimation(s).play().promise().then(b);else b()}).then(function(){return t.animation({style:o,duration:i,easing:t.pstyle("transition-timing-function").value,queue:!1}).play().promise()}).then(function(){r.removeBypasses(t,n),t.emitAndNotify("style"),a.transitioning=!1})}else if(a.transitioning)this.removeBypasses(t,n),t.emitAndNotify("style"),a.transitioning=!1};Et.checkTrigger=function(t,e,r,a,n,i){var s=this.properties[e],o=n(s);if(t.removed())return;if(o!=null&&o(r,a,t))i(s)};Et.checkZOrderTrigger=function(t,e,r,a){var n=this;this.checkTrigger(t,e,r,a,function(i){return i.triggersZOrder},function(){n._private.cy.notify("zorder",t)})};Et.checkBoundsTrigger=function(t,e,r,a){this.checkTrigger(t,e,r,a,function(n){return n.triggersBounds},function(n){t.dirtyCompoundBoundsCache(),t.dirtyBoundingBoxCache()})};Et.checkConnectedEdgesBoundsTrigger=function(t,e,r,a){this.checkTrigger(t,e,r,a,function(n){return n.triggersBoundsOfConnectedEdges},function(n){t.connectedEdges().forEach(function(i){i.dirtyBoundingBoxCache()})})};Et.checkParallelEdgesBoundsTrigger=function(t,e,r,a){this.checkTrigger(t,e,r,a,function(n){return n.triggersBoundsOfParallelEdges},function(n){t.parallelEdges().forEach(function(i){i.dirtyBoundingBoxCache()})})};Et.checkTriggers=function(t,e,r,a){t.dirtyStyleCache(),this.checkZOrderTrigger(t,e,r,a),this.checkBoundsTrigger(t,e,r,a),this.checkConnectedEdgesBoundsTrigger(t,e,r,a),this.checkParallelEdgesBoundsTrigger(t,e,r,a)};var rn={};rn.applyBypass=function(t,e,r,a){var n=this,i=[],s=!0;if(e==="*"||e==="**"){if(r!==void 0)for(var o=0;o<n.properties.length;o++){var l=n.properties[o],u=l.name,f=this.parse(u,r,!0);if(f)i.push(f)}}else if(Re(e)){var v=this.parse(e,r,!0);if(v)i.push(v)}else if(We(e)){var h=e;a=r;var c=Object.keys(h);for(var d=0;d<c.length;d++){var g=c[d],y=h[g];if(y===void 0)y=h[Zn(g)];if(y!==void 0){var p=this.parse(g,y,!0);if(p)i.push(p)}}}else return!1;if(i.length===0)return!1;var m=!1;for(var b=0;b<t.length;b++){var E=t[b],A={},M=void 0;for(var S=0;S<i.length;S++){var P=i[S];if(a){var N=E.pstyle(P.name);M=A[P.name]={prev:N}}if(m=this.applyParsedProperty(E,Jt(P))||m,a)M.next=E.pstyle(P.name)}if(m)this.updateStyleHints(E);if(a)this.updateTransitions(E,A,s)}return m};rn.overrideBypass=function(t,e,r){e=ho(e);for(var a=0;a<t.length;a++){var n=t[a],i=n._private.style[e],s=this.properties[e].type,{color:o,mutiple:l}=s,u=!i?null:i.pfValue!=null?i.pfValue:i.value;if(!i||!i.bypass)this.applyBypass(n,e,r);else{if(i.value=r,i.pfValue!=null)i.pfValue=r;if(o)i.strValue="rgb("+r.join(",")+")";else if(l)i.strValue=r.join(" ");else i.strValue=""+r;this.updateStyleHints(n)}this.checkTriggers(n,e,u,r)}};rn.removeAllBypasses=function(t,e){return this.removeBypasses(t,this.propertyNames,e)};rn.removeBypasses=function(t,e,r){var a=!0;for(var n=0;n<t.length;n++){var i=t[n],s={};for(var o=0;o<e.length;o++){var l=e[o],u=this.properties[l],f=i.pstyle(u.name);if(!f||!f.bypass)continue;var v="",h=this.parse(l,v,!0),c=s[u.name]={prev:f};this.applyParsedProperty(i,h),c.next=i.pstyle(u.name)}if(this.updateStyleHints(i),r)this.updateTransitions(i,s,a)}};var Mo={};Mo.getEmSizeInPixels=function(){var t=this.containerCss("font-size");if(t!=null)return parseFloat(t);else return 1};Mo.containerCss=function(t){var e=this._private.cy,r=e.container(),a=e.window();if(a&&r&&a.getComputedStyle)return a.getComputedStyle(r).getPropertyValue(t)};var jt={};jt.getRenderedStyle=function(t,e){if(e)return this.getStylePropertyValue(t,e,!0);else return this.getRawStyle(t,!0)};jt.getRawStyle=function(t,e){var r=this;if(t=t[0],t){var a={};for(var n=0;n<r.properties.length;n++){var i=r.properties[n],s=r.getStylePropertyValue(t,i.name,e);if(s!=null)a[i.name]=s,a[Zn(i.name)]=s}return a}};jt.getIndexedStyle=function(t,e,r,a){var n=t.pstyle(e)[r][a];return n!=null?n:t.cy().style().getDefaultProperty(e)[r][0]};jt.getStylePropertyValue=function(t,e,r){var a=this;if(t=t[0],t){var n=a.properties[e];if(n.alias)n=n.pointsTo;var i=n.type,s=t.pstyle(n.name);if(s){var{value:o,units:l,strValue:u}=s;if(r&&i.number&&o!=null&&he(o)){var f=t.cy().zoom(),v=function(y){return y*f},h=function(y,p){return v(y)+p},c=Je(o),d=c?l.every(function(g){return g!=null}):l!=null;if(d)if(c)return o.map(function(g,y){return h(g,l[y])}).join(" ");else return h(o,l);else if(c)return o.map(function(g){return Re(g)?g:""+v(g)}).join(" ");else return""+v(o)}else if(u!=null)return u}return null}};jt.getAnimationStartStyle=function(t,e){var r={};for(var a=0;a<e.length;a++){var n=e[a],i=n.name,s=t.pstyle(i);if(s!==void 0)if(We(s))s=this.parse(i,s.strValue);else s=this.parse(i,s);if(s)r[i]=s}return r};jt.getPropsList=function(t){var e=this,r=[],a=t,n=e.properties;if(a){var i=Object.keys(a);for(var s=0;s<i.length;s++){var o=i[s],l=a[o],u=n[o]||n[ho(o)],f=this.parse(u.name,l);if(f)r.push(f)}}return r};jt.getNonDefaultPropertiesHash=function(t,e,r){var a=r.slice(),n,i,s,o,l,u;for(l=0;l<e.length;l++)if(n=e[l],i=t.pstyle(n,!1),i==null)continue;else if(i.pfValue!=null)a[0]=za(o,a[0]),a[1]=Va(o,a[1]);else{s=i.strValue;for(u=0;u<s.length;u++)o=s.charCodeAt(u),a[0]=za(o,a[0]),a[1]=Va(o,a[1])}return a};jt.getPropertiesHash=jt.getNonDefaultPropertiesHash;var ui={};ui.appendFromJson=function(t){var e=this;for(var r=0;r<t.length;r++){var a=t[r],n=a.selector,i=a.style||a.css,s=Object.keys(i);e.selector(n);for(var o=0;o<s.length;o++){var l=s[o],u=i[l];e.css(l,u)}}return e};ui.fromJson=function(t){var e=this;return e.resetToDefault(),e.appendFromJson(t),e};ui.json=function(){var t=[];for(var e=this.defaultLength;e<this.length;e++){var r=this[e],{selector:a,properties:n}=r,i={};for(var s=0;s<n.length;s++){var o=n[s];i[o.name]=o.strValue}t.push({selector:!a?"core":a.toString(),style:i})}return t};var Lo={};Lo.appendFromString=function(t){var e=this,r=this,a=""+t,n,i,s;a=a.replace(/[/][*](\s|.)+?[*][/]/g,"");function o(){if(a.length>n.length)a=a.substr(n.length);else a=""}function l(){if(i.length>s.length)i=i.substr(s.length);else i=""}for(;;){var u=a.match(/^\s*$/);if(u)break;var f=a.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!f){_e("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+a);break}n=f[0];var v=f[1];if(v!=="core"){var h=new Sr(v);if(h.invalid){_e("Skipping parsing of block: Invalid selector found in string stylesheet: "+v),o();continue}}var c=f[2],d=!1;i=c;var g=[];for(;;){var y=i.match(/^\s*$/);if(y)break;var p=i.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!p){_e("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+c),d=!0;break}s=p[0];var m=p[1],b=p[2],E=e.properties[m];if(!E){_e("Skipping property: Invalid property name in: "+s),l();continue}var A=r.parse(m,b);if(!A){_e("Skipping property: Invalid property definition in: "+s),l();continue}g.push({name:m,val:b}),l()}if(d){o();break}r.selector(v);for(var M=0;M<g.length;M++){var S=g[M];r.css(S.name,S.val)}o()}return r};Lo.fromString=function(t){var e=this;return e.resetToDefault(),e.appendFromString(t),e};var vt={};(function(){var t=pt,e=Mh,r=Rh,a=Ph,n=Nh,i=function(W){return"^"+W+"\\s*\\(\\s*([\\w\\.]+)\\s*\\)$"},s=function(W){var j=t+"|\\w+|"+e+"|"+r+"|"+a+"|"+n;return"^"+W+"\\s*\\(([\\w\\.]+)\\s*\\,\\s*("+t+")\\s*\\,\\s*("+t+")\\s*,\\s*("+j+")\\s*\\,\\s*("+j+")\\)$"},o=[`^url\\s*\\(\\s*['"]?(.+?)['"]?\\s*\\)$`,"^(none)$","^(.+)$"];vt.types={time:{number:!0,min:0,units:"s|ms",implicitUnits:"ms"},percent:{number:!0,min:0,max:100,units:"%",implicitUnits:"%"},percentages:{number:!0,min:0,max:100,units:"%",implicitUnits:"%",multiple:!0},zeroOneNumber:{number:!0,min:0,max:1,unitless:!0},zeroOneNumbers:{number:!0,min:0,max:1,unitless:!0,multiple:!0},nOneOneNumber:{number:!0,min:-1,max:1,unitless:!0},nonNegativeInt:{number:!0,min:0,integer:!0,unitless:!0},nonNegativeNumber:{number:!0,min:0,unitless:!0},position:{enums:["parent","origin"]},nodeSize:{number:!0,min:0,enums:["label"]},number:{number:!0,unitless:!0},numbers:{number:!0,unitless:!0,multiple:!0},positiveNumber:{number:!0,unitless:!0,min:0,strictMin:!0},size:{number:!0,min:0},bidirectionalSize:{number:!0},bidirectionalSizeMaybePercent:{number:!0,allowPercent:!0},bidirectionalSizes:{number:!0,multiple:!0},sizeMaybePercent:{number:!0,min:0,allowPercent:!0},axisDirection:{enums:["horizontal","leftward","rightward","vertical","upward","downward","auto"]},axisDirectionExplicit:{enums:["leftward","rightward","upward","downward"]},axisDirectionPrimary:{enums:["horizontal","vertical"]},paddingRelativeTo:{enums:["width","height","average","min","max"]},bgWH:{number:!0,min:0,allowPercent:!0,enums:["auto"],multiple:!0},bgPos:{number:!0,allowPercent:!0,multiple:!0},bgRelativeTo:{enums:["inner","include-padding"],multiple:!0},bgRepeat:{enums:["repeat","repeat-x","repeat-y","no-repeat"],multiple:!0},bgFit:{enums:["none","contain","cover"],multiple:!0},bgCrossOrigin:{enums:["anonymous","use-credentials","null"],multiple:!0},bgClip:{enums:["none","node"],multiple:!0},bgContainment:{enums:["inside","over"],multiple:!0},boxSelection:{enums:["contain","overlap","none"]},color:{color:!0},colors:{color:!0,multiple:!0},fill:{enums:["solid","linear-gradient","radial-gradient"]},bool:{enums:["yes","no"]},bools:{enums:["yes","no"],multiple:!0},lineStyle:{enums:["solid","dotted","dashed"]},lineCap:{enums:["butt","round","square"]},linePosition:{enums:["center","inside","outside"]},lineJoin:{enums:["round","bevel","miter"]},borderStyle:{enums:["solid","dotted","dashed","double"]},curveStyle:{enums:["bezier","unbundled-bezier","haystack","segments","straight","straight-triangle","taxi","round-segments","round-taxi"]},radiusType:{enums:["arc-radius","influence-radius"],multiple:!0},fontFamily:{regex:"^([\\w- \\\"]+(?:\\s*,\\s*[\\w- \\\"]+)*)$"},fontStyle:{enums:["italic","normal","oblique"]},fontWeight:{enums:["normal","bold","bolder","lighter","100","200","300","400","500","600","800","900",100,200,300,400,500,600,700,800,900]},textDecoration:{enums:["none","underline","overline","line-through"]},textTransform:{enums:["none","uppercase","lowercase"]},textWrap:{enums:["none","wrap","ellipsis"]},textOverflowWrap:{enums:["whitespace","anywhere"]},textBackgroundShape:{enums:["rectangle","roundrectangle","round-rectangle","circle"]},nodeShape:{enums:["rectangle","roundrectangle","round-rectangle","cutrectangle","cut-rectangle","bottomroundrectangle","bottom-round-rectangle","barrel","ellipse","triangle","round-triangle","square","pentagon","round-pentagon","hexagon","round-hexagon","concavehexagon","concave-hexagon","heptagon","round-heptagon","octagon","round-octagon","tag","round-tag","star","diamond","round-diamond","vee","rhomboid","right-rhomboid","polygon"]},overlayShape:{enums:["roundrectangle","round-rectangle","ellipse"]},cornerRadius:{number:!0,min:0,units:"px|em",implicitUnits:"px",enums:["auto"]},compoundIncludeLabels:{enums:["include","exclude"]},arrowShape:{enums:["tee","triangle","triangle-tee","circle-triangle","triangle-cross","triangle-backcurve","vee","square","circle","diamond","chevron","none"]},arrowFill:{enums:["filled","hollow"]},arrowWidth:{number:!0,units:"%|px|em",implicitUnits:"px",enums:["match-line"]},display:{enums:["element","none"]},visibility:{enums:["hidden","visible"]},zCompoundDepth:{enums:["bottom","orphan","auto","top"]},zIndexCompare:{enums:["auto","manual"]},valign:{enums:["top","top-inside","center","bottom","bottom-inside"]},halign:{enums:["left","left-inside","center","right","right-inside"]},justification:{enums:["left","center","right","auto"]},textMetrics:{enums:["font","glyph"]},text:{string:!0},data:{mapping:!0,regex:i("data")},layoutData:{mapping:!0,regex:i("layoutData")},scratch:{mapping:!0,regex:i("scratch")},mapData:{mapping:!0,regex:s("mapData")},mapLayoutData:{mapping:!0,regex:s("mapLayoutData")},mapScratch:{mapping:!0,regex:s("mapScratch")},fn:{mapping:!0,fn:!0},url:{regexes:o,singleRegexMatchValue:!0},urls:{regexes:o,singleRegexMatchValue:!0,multiple:!0},propList:{propList:!0},angle:{number:!0,units:"deg|rad",implicitUnits:"rad"},textRotation:{number:!0,units:"deg|rad",implicitUnits:"rad",enums:["none","autorotate"]},polygonPointList:{number:!0,multiple:!0,evenMultiple:!0,min:-1,max:1,unitless:!0},edgeDistances:{enums:["intersection","node-position","endpoints"]},edgeEndpoint:{number:!0,multiple:!0,units:"%|px|em|deg|rad",implicitUnits:"px",enums:["inside-to-node","outside-to-node","outside-to-node-or-label","outside-to-line","outside-to-line-or-label"],singleEnum:!0,validate:function(W,j){switch(W.length){case 2:return j[0]!=="deg"&&j[0]!=="rad"&&j[1]!=="deg"&&j[1]!=="rad";case 1:return Re(W[0])||j[0]==="deg"||j[0]==="rad";default:return!1}}},easing:{regexes:["^(spring)\\s*\\(\\s*("+t+")\\s*,\\s*("+t+")\\s*\\)$","^(cubic-bezier)\\s*\\(\\s*("+t+")\\s*,\\s*("+t+")\\s*,\\s*("+t+")\\s*,\\s*("+t+")\\s*\\)$"],enums:["linear","ease","ease-in","ease-out","ease-in-out","ease-in-sine","ease-out-sine","ease-in-out-sine","ease-in-quad","ease-out-quad","ease-in-out-quad","ease-in-cubic","ease-out-cubic","ease-in-out-cubic","ease-in-quart","ease-out-quart","ease-in-out-quart","ease-in-quint","ease-out-quint","ease-in-out-quint","ease-in-expo","ease-out-expo","ease-in-out-expo","ease-in-circ","ease-out-circ","ease-in-out-circ"]},gradientDirection:{enums:["to-bottom","to-top","to-left","to-right","to-bottom-right","to-bottom-left","to-top-right","to-top-left","to-right-bottom","to-left-bottom","to-right-top","to-left-top"]},boundsExpansion:{number:!0,multiple:!0,min:0,validate:function(W){var j=W.length;return j===1||j===2||j===4}}};var l={zeroNonZero:function(W,j){if((W==null||j==null)&&W!==j)return!0;if(W==0&&j!=0)return!0;else if(W!=0&&j==0)return!0;else return!1},any:function(W,j){return W!=j},emptyNonEmpty:function(W,j){var re=xr(W),ee=xr(j);return re&&!ee||!re&&ee}},u=vt.types,f=[{name:"label",type:u.text,triggersBounds:l.any,triggersZOrder:l.emptyNonEmpty},{name:"text-rotation",type:u.textRotation,triggersBounds:l.any},{name:"text-margin-x",type:u.bidirectionalSize,triggersBounds:l.any},{name:"text-margin-y",type:u.bidirectionalSize,triggersBounds:l.any}],v=[{name:"source-label",type:u.text,triggersBounds:l.any},{name:"source-text-rotation",type:u.textRotation,triggersBounds:l.any},{name:"source-text-margin-x",type:u.bidirectionalSize,triggersBounds:l.any},{name:"source-text-margin-y",type:u.bidirectionalSize,triggersBounds:l.any},{name:"source-text-offset",type:u.size,triggersBounds:l.any}],h=[{name:"target-label",type:u.text,triggersBounds:l.any},{name:"target-text-rotation",type:u.textRotation,triggersBounds:l.any},{name:"target-text-margin-x",type:u.bidirectionalSize,triggersBounds:l.any},{name:"target-text-margin-y",type:u.bidirectionalSize,triggersBounds:l.any},{name:"target-text-offset",type:u.size,triggersBounds:l.any}],c=[{name:"font-family",type:u.fontFamily,triggersBounds:l.any},{name:"font-style",type:u.fontStyle,triggersBounds:l.any},{name:"font-weight",type:u.fontWeight,triggersBounds:l.any},{name:"font-size",type:u.size,triggersBounds:l.any},{name:"text-transform",type:u.textTransform,triggersBounds:l.any},{name:"text-wrap",type:u.textWrap,triggersBounds:l.any},{name:"text-overflow-wrap",type:u.textOverflowWrap,triggersBounds:l.any},{name:"text-max-width",type:u.size,triggersBounds:l.any},{name:"text-outline-width",type:u.size,triggersBounds:l.any},{name:"line-height",type:u.positiveNumber,triggersBounds:l.any}],d=[{name:"text-valign",type:u.valign,triggersBounds:l.any},{name:"text-halign",type:u.halign,triggersBounds:l.any},{name:"color",type:u.color},{name:"text-outline-color",type:u.color},{name:"text-outline-opacity",type:u.zeroOneNumber},{name:"text-background-color",type:u.color},{name:"text-background-opacity",type:u.zeroOneNumber},{name:"text-background-padding",type:u.size,triggersBounds:l.any},{name:"text-border-opacity",type:u.zeroOneNumber},{name:"text-border-color",type:u.color},{name:"text-border-width",type:u.size,triggersBounds:l.any},{name:"text-border-style",type:u.borderStyle,triggersBounds:l.any},{name:"text-background-shape",type:u.textBackgroundShape,triggersBounds:l.any},{name:"text-justification",type:u.justification},{name:"text-metrics",type:u.textMetrics},{name:"box-select-labels",type:u.bool,triggersBounds:l.any}],g=[{name:"events",type:u.bool,triggersZOrder:l.any},{name:"text-events",type:u.bool,triggersZOrder:l.any},{name:"box-selection",type:u.boxSelection,triggersZOrder:l.any}],y=[{name:"display",type:u.display,triggersZOrder:l.any,triggersBounds:l.any,triggersBoundsOfConnectedEdges:l.any,triggersBoundsOfParallelEdges:function(W,j,re){if(W===j)return!1;return re.pstyle("curve-style").value==="bezier"}},{name:"visibility",type:u.visibility,triggersZOrder:l.any},{name:"opacity",type:u.zeroOneNumber,triggersZOrder:l.zeroNonZero},{name:"text-opacity",type:u.zeroOneNumber},{name:"min-zoomed-font-size",type:u.size},{name:"z-compound-depth",type:u.zCompoundDepth,triggersZOrder:l.any},{name:"z-index-compare",type:u.zIndexCompare,triggersZOrder:l.any},{name:"z-index",type:u.number,triggersZOrder:l.any}],p=[{name:"overlay-padding",type:u.size,triggersBounds:l.any},{name:"overlay-color",type:u.color},{name:"overlay-opacity",type:u.zeroOneNumber,triggersBounds:l.zeroNonZero},{name:"overlay-shape",type:u.overlayShape,triggersBounds:l.any},{name:"overlay-corner-radius",type:u.cornerRadius}],m=[{name:"underlay-padding",type:u.size,triggersBounds:l.any},{name:"underlay-color",type:u.color},{name:"underlay-opacity",type:u.zeroOneNumber,triggersBounds:l.zeroNonZero},{name:"underlay-shape",type:u.overlayShape,triggersBounds:l.any},{name:"underlay-corner-radius",type:u.cornerRadius}],b=[{name:"transition-property",type:u.propList},{name:"transition-duration",type:u.time},{name:"transition-delay",type:u.time},{name:"transition-timing-function",type:u.easing}],E=function(W,j){if(j.value==="label")return-W.poolIndex();else return j.pfValue},A=[{name:"height",type:u.nodeSize,triggersBounds:l.any,hashOverride:E},{name:"width",type:u.nodeSize,triggersBounds:l.any,hashOverride:E},{name:"shape",type:u.nodeShape,triggersBounds:l.any},{name:"shape-polygon-points",type:u.polygonPointList,triggersBounds:l.any},{name:"corner-radius",type:u.cornerRadius},{name:"background-color",type:u.color},{name:"background-fill",type:u.fill},{name:"background-opacity",type:u.zeroOneNumber},{name:"background-blacken",type:u.nOneOneNumber},{name:"background-gradient-stop-colors",type:u.colors},{name:"background-gradient-stop-positions",type:u.percentages},{name:"background-gradient-direction",type:u.gradientDirection},{name:"padding",type:u.sizeMaybePercent,triggersBounds:l.any},{name:"padding-relative-to",type:u.paddingRelativeTo,triggersBounds:l.any},{name:"bounds-expansion",type:u.boundsExpansion,triggersBounds:l.any}],M=[{name:"border-color",type:u.color},{name:"border-opacity",type:u.zeroOneNumber},{name:"border-width",type:u.size,triggersBounds:l.any},{name:"border-style",type:u.borderStyle},{name:"border-cap",type:u.lineCap},{name:"border-join",type:u.lineJoin},{name:"border-dash-pattern",type:u.numbers},{name:"border-dash-offset",type:u.number},{name:"border-position",type:u.linePosition}],S=[{name:"outline-color",type:u.color},{name:"outline-opacity",type:u.zeroOneNumber},{name:"outline-width",type:u.size,triggersBounds:l.any},{name:"outline-style",type:u.borderStyle},{name:"outline-offset",type:u.size,triggersBounds:l.any}],P=[{name:"background-image",type:u.urls},{name:"background-image-crossorigin",type:u.bgCrossOrigin},{name:"background-image-opacity",type:u.zeroOneNumbers},{name:"background-image-containment",type:u.bgContainment},{name:"background-image-smoothing",type:u.bools},{name:"background-position-x",type:u.bgPos},{name:"background-position-y",type:u.bgPos},{name:"background-width-relative-to",type:u.bgRelativeTo},{name:"background-height-relative-to",type:u.bgRelativeTo},{name:"background-repeat",type:u.bgRepeat},{name:"background-fit",type:u.bgFit},{name:"background-clip",type:u.bgClip},{name:"background-width",type:u.bgWH},{name:"background-height",type:u.bgWH},{name:"background-offset-x",type:u.bgPos},{name:"background-offset-y",type:u.bgPos}],N=[{name:"position",type:u.position,triggersBounds:l.any},{name:"compound-sizing-wrt-labels",type:u.compoundIncludeLabels,triggersBounds:l.any},{name:"min-width",type:u.size,triggersBounds:l.any},{name:"min-width-bias-left",type:u.sizeMaybePercent,triggersBounds:l.any},{name:"min-width-bias-right",type:u.sizeMaybePercent,triggersBounds:l.any},{name:"min-height",type:u.size,triggersBounds:l.any},{name:"min-height-bias-top",type:u.sizeMaybePercent,triggersBounds:l.any},{name:"min-height-bias-bottom",type:u.sizeMaybePercent,triggersBounds:l.any}],R=[{name:"line-style",type:u.lineStyle},{name:"line-color",type:u.color},{name:"line-fill",type:u.fill},{name:"line-cap",type:u.lineCap},{name:"line-opacity",type:u.zeroOneNumber},{name:"line-dash-pattern",type:u.numbers},{name:"line-dash-offset",type:u.number},{name:"line-outline-width",type:u.size},{name:"line-outline-color",type:u.color},{name:"line-gradient-stop-colors",type:u.colors},{name:"line-gradient-stop-positions",type:u.percentages},{name:"curve-style",type:u.curveStyle,triggersBounds:l.any,triggersBoundsOfParallelEdges:function(W,j){if(W===j)return!1;return W==="bezier"||j==="bezier"}},{name:"haystack-radius",type:u.zeroOneNumber,triggersBounds:l.any},{name:"source-endpoint",type:u.edgeEndpoint,triggersBounds:l.any},{name:"target-endpoint",type:u.edgeEndpoint,triggersBounds:l.any},{name:"control-point-step-size",type:u.size,triggersBounds:l.any},{name:"control-point-distances",type:u.bidirectionalSizes,triggersBounds:l.any},{name:"control-point-weights",type:u.numbers,triggersBounds:l.any},{name:"segment-distances",type:u.bidirectionalSizes,triggersBounds:l.any},{name:"segment-weights",type:u.numbers,triggersBounds:l.any},{name:"segment-radii",type:u.numbers,triggersBounds:l.any},{name:"radius-type",type:u.radiusType,triggersBounds:l.any},{name:"taxi-turn",type:u.bidirectionalSizeMaybePercent,triggersBounds:l.any},{name:"taxi-turn-min-distance",type:u.size,triggersBounds:l.any},{name:"taxi-direction",type:u.axisDirection,triggersBounds:l.any},{name:"taxi-radius",type:u.number,triggersBounds:l.any},{name:"edge-distances",type:u.edgeDistances,triggersBounds:l.any},{name:"arrow-scale",type:u.positiveNumber,triggersBounds:l.any},{name:"loop-direction",type:u.angle,triggersBounds:l.any},{name:"loop-sweep",type:u.angle,triggersBounds:l.any},{name:"source-distance-from-node",type:u.size,triggersBounds:l.any},{name:"target-distance-from-node",type:u.size,triggersBounds:l.any}],I=[{name:"ghost",type:u.bool,triggersBounds:l.any},{name:"ghost-offset-x",type:u.bidirectionalSize,triggersBounds:l.any},{name:"ghost-offset-y",type:u.bidirectionalSize,triggersBounds:l.any},{name:"ghost-opacity",type:u.zeroOneNumber}],w=[{name:"selection-box-color",type:u.color},{name:"selection-box-opacity",type:u.zeroOneNumber},{name:"selection-box-border-color",type:u.color},{name:"selection-box-border-width",type:u.size},{name:"active-bg-color",type:u.color},{name:"active-bg-opacity",type:u.zeroOneNumber},{name:"active-bg-size",type:u.size},{name:"outside-texture-bg-color",type:u.color},{name:"outside-texture-bg-opacity",type:u.zeroOneNumber}],x=[];vt.pieBackgroundN=16,x.push({name:"pie-size",type:u.sizeMaybePercent}),x.push({name:"pie-hole",type:u.sizeMaybePercent}),x.push({name:"pie-start-angle",type:u.angle});for(var T=1;T<=vt.pieBackgroundN;T++)x.push({name:"pie-"+T+"-background-color",type:u.color}),x.push({name:"pie-"+T+"-background-size",type:u.percent}),x.push({name:"pie-"+T+"-background-opacity",type:u.zeroOneNumber});var D=[];vt.stripeBackgroundN=16,D.push({name:"stripe-size",type:u.sizeMaybePercent}),D.push({name:"stripe-direction",type:u.axisDirectionPrimary});for(var C=1;C<=vt.stripeBackgroundN;C++)D.push({name:"stripe-"+C+"-background-color",type:u.color}),D.push({name:"stripe-"+C+"-background-size",type:u.percent}),D.push({name:"stripe-"+C+"-background-opacity",type:u.zeroOneNumber});var O=[],B=vt.arrowPrefixes=["source","mid-source","target","mid-target"];[{name:"arrow-shape",type:u.arrowShape,triggersBounds:l.any},{name:"arrow-color",type:u.color},{name:"arrow-fill",type:u.arrowFill},{name:"arrow-width",type:u.arrowWidth}].forEach(function(U){B.forEach(function(W){var j=W+"-"+U.name,{type:re,triggersBounds:ee}=U;O.push({name:j,type:re,triggersBounds:ee})})},{});var z=vt.properties=[].concat(g,b,y,p,m,I,d,c,f,v,h,A,M,S,P,x,D,N,R,O,w),V=vt.propertyGroups={behavior:g,transition:b,visibility:y,overlay:p,underlay:m,ghost:I,commonLabel:d,labelDimensions:c,mainLabel:f,sourceLabel:v,targetLabel:h,nodeBody:A,nodeBorder:M,nodeOutline:S,backgroundImage:P,pie:x,stripe:D,compound:N,edgeLine:R,edgeArrow:O,core:w},k=vt.propertyGroupNames={},G=vt.propertyGroupKeys=Object.keys(V);G.forEach(function(U){k[U]=V[U].map(function(W){return W.name}),V[U].forEach(function(W){return W.groupKey=U})});var J=vt.aliases=[{name:"content",pointsTo:"label"},{name:"control-point-distance",pointsTo:"control-point-distances"},{name:"control-point-weight",pointsTo:"control-point-weights"},{name:"segment-distance",pointsTo:"segment-distances"},{name:"segment-weight",pointsTo:"segment-weights"},{name:"segment-radius",pointsTo:"segment-radii"},{name:"edge-text-rotation",pointsTo:"text-rotation"},{name:"padding-left",pointsTo:"padding"},{name:"padding-right",pointsTo:"padding"},{name:"padding-top",pointsTo:"padding"},{name:"padding-bottom",pointsTo:"padding"}];vt.propertyNames=z.map(function(U){return U.name});for(var X=0;X<z.length;X++){var _=z[X];z[_.name]=_}for(var Q=0;Q<J.length;Q++){var q=J[Q],te=z[q.pointsTo],Z={name:q.name,alias:!0,pointsTo:te};z.push(Z),z[q.name]=Z}})();vt.getDefaultProperty=function(t){return this.getDefaultProperties()[t]};vt.getDefaultProperties=function(){var t=this._private;if(t.defaultProperties!=null)return t.defaultProperties;var e=Oe({"selection-box-color":"#ddd","selection-box-opacity":0.65,"selection-box-border-color":"#aaa","selection-box-border-width":1,"active-bg-color":"black","active-bg-opacity":0.15,"active-bg-size":30,"outside-texture-bg-color":"#000","outside-texture-bg-opacity":0.125,events:"yes","text-events":"no","text-valign":"top","text-halign":"center","text-justification":"auto","line-height":1,color:"#000","box-selection":"contain","text-outline-color":"#000","text-outline-width":0,"text-outline-opacity":1,"text-opacity":1,"text-decoration":"none","text-transform":"none","text-wrap":"none","text-overflow-wrap":"whitespace","text-max-width":9999,"text-background-color":"#000","text-background-opacity":0,"text-background-shape":"rectangle","text-background-padding":0,"text-border-opacity":0,"text-border-width":0,"text-border-style":"solid","text-border-color":"#000","font-family":"Helvetica Neue, Helvetica, sans-serif","font-style":"normal","font-weight":"normal","font-size":16,"min-zoomed-font-size":0,"text-rotation":"none","source-text-rotation":"none","target-text-rotation":"none",visibility:"visible",display:"element",opacity:1,"z-compound-depth":"auto","z-index-compare":"auto","z-index":0,label:"","text-margin-x":0,"text-margin-y":0,"source-label":"","source-text-offset":0,"source-text-margin-x":0,"source-text-margin-y":0,"target-label":"","target-text-offset":0,"target-text-margin-x":0,"target-text-margin-y":0,"overlay-opacity":0,"overlay-color":"#000","overlay-padding":10,"overlay-shape":"round-rectangle","overlay-corner-radius":"auto","underlay-opacity":0,"underlay-color":"#000","underlay-padding":10,"underlay-shape":"round-rectangle","underlay-corner-radius":"auto","text-metrics":"font","transition-property":"none","transition-duration":0,"transition-delay":0,"transition-timing-function":"linear","box-select-labels":"no","background-blacken":0,"background-color":"#999","background-fill":"solid","background-opacity":1,"background-image":"none","background-image-crossorigin":"anonymous","background-image-opacity":1,"background-image-containment":"inside","background-image-smoothing":"yes","background-position-x":"50%","background-position-y":"50%","background-offset-x":0,"background-offset-y":0,"background-width-relative-to":"include-padding","background-height-relative-to":"include-padding","background-repeat":"no-repeat","background-fit":"none","background-clip":"node","background-width":"auto","background-height":"auto","border-color":"#000","border-opacity":1,"border-width":0,"border-style":"solid","border-dash-pattern":[4,2],"border-dash-offset":0,"border-cap":"butt","border-join":"miter","border-position":"center","outline-color":"#999","outline-opacity":1,"outline-width":0,"outline-offset":0,"outline-style":"solid",height:30,width:30,shape:"ellipse","shape-polygon-points":"-1, -1, 1, -1, 1, 1, -1, 1","corner-radius":"auto","bounds-expansion":0,"background-gradient-direction":"to-bottom","background-gradient-stop-colors":"#999","background-gradient-stop-positions":"0%",ghost:"no","ghost-offset-y":0,"ghost-offset-x":0,"ghost-opacity":0,padding:0,"padding-relative-to":"width",position:"origin","compound-sizing-wrt-labels":"include","min-width":0,"min-width-bias-left":0,"min-width-bias-right":0,"min-height":0,"min-height-bias-top":0,"min-height-bias-bottom":0},{"pie-size":"100%","pie-hole":0,"pie-start-angle":"0deg"},[{name:"pie-{{i}}-background-color",value:"black"},{name:"pie-{{i}}-background-size",value:"0%"},{name:"pie-{{i}}-background-opacity",value:1}].reduce(function(l,u){for(var f=1;f<=vt.pieBackgroundN;f++){var v=u.name.replace("{{i}}",f),h=u.value;l[v]=h}return l},{}),{"stripe-size":"100%","stripe-direction":"horizontal"},[{name:"stripe-{{i}}-background-color",value:"black"},{name:"stripe-{{i}}-background-size",value:"0%"},{name:"stripe-{{i}}-background-opacity",value:1}].reduce(function(l,u){for(var f=1;f<=vt.stripeBackgroundN;f++){var v=u.name.replace("{{i}}",f),h=u.value;l[v]=h}return l},{}),{"line-style":"solid","line-color":"#999","line-fill":"solid","line-cap":"butt","line-opacity":1,"line-outline-width":0,"line-outline-color":"#000","line-gradient-stop-colors":"#999","line-gradient-stop-positions":"0%","control-point-step-size":40,"control-point-weights":0.5,"segment-weights":0.5,"segment-distances":20,"segment-radii":15,"radius-type":"arc-radius","taxi-turn":"50%","taxi-radius":15,"taxi-turn-min-distance":10,"taxi-direction":"auto","edge-distances":"intersection","curve-style":"haystack","haystack-radius":0,"arrow-scale":1,"loop-direction":"-45deg","loop-sweep":"-90deg","source-distance-from-node":0,"target-distance-from-node":0,"source-endpoint":"outside-to-node","target-endpoint":"outside-to-node","line-dash-pattern":[6,3],"line-dash-offset":0},[{name:"arrow-shape",value:"none"},{name:"arrow-color",value:"#999"},{name:"arrow-fill",value:"filled"},{name:"arrow-width",value:1}].reduce(function(l,u){return vt.arrowPrefixes.forEach(function(f){var v=f+"-"+u.name,h=u.value;l[v]=h}),l},{})),r={};for(var a=0;a<this.properties.length;a++){var n=this.properties[a];if(n.pointsTo)continue;var i=n.name,s=e[i],o=this.parse(i,s);r[i]=o}return t.defaultProperties=r,t.defaultProperties};vt.addDefaultStylesheet=function(){this.selector(":parent").css({shape:"rectangle",padding:10,"background-color":"#eee","border-color":"#ccc","border-width":1}).selector("edge").css({width:3}).selector(":loop").css({"curve-style":"bezier"}).selector("edge:compound").css({"curve-style":"bezier","source-endpoint":"outside-to-line","target-endpoint":"outside-to-line"}).selector(":selected").css({"background-color":"#0169D9","line-color":"#0169D9","source-arrow-color":"#0169D9","target-arrow-color":"#0169D9","mid-source-arrow-color":"#0169D9","mid-target-arrow-color":"#0169D9"}).selector(":parent:selected").css({"background-color":"#CCE1F9","border-color":"#aec8e5"}).selector(":active").css({"overlay-color":"black","overlay-padding":10,"overlay-opacity":0.25}),this.defaultLength=this.length};var li={};li.parse=function(t,e,r,a){var n=this;if(st(e))return n.parseImplWarn(t,e,r,a);var i=a==="mapping"||a===!0||a===!1||a==null?"dontcare":a,s=r?"t":"f",o=""+e,l=Lf(t,o,s,i),u=n.propCache=n.propCache||[],f;if(!(f=u[l]))f=u[l]=n.parseImplWarn(t,e,r,a);if(r||a==="mapping"){if(f=Jt(f),f)f.value=Jt(f.value)}return f};li.parseImplWarn=function(t,e,r,a){var n=this.parseImpl(t,e,r,a);if(!n&&e!=null)_e("The style property `".concat(t,": ").concat(e,"` is invalid"));if(n&&(n.name==="width"||n.name==="height")&&e==="label")_e("The style value of `label` is deprecated for `"+n.name+"`");return n};li.parseImpl=function(t,e,r,a){var n=this;t=ho(t);var i=n.properties[t],s=e,o=n.types;if(!i)return null;if(e===void 0)return null;if(i.alias)i=i.pointsTo,t=i.name;var l=Re(e);if(l)e=e.trim();var u=i.type;if(!u)return null;if(r&&(e===""||e===null))return{name:t,value:e,bypass:!0,deleteBypass:!0};if(st(e))return{name:t,value:e,strValue:"fn",mapped:o.fn,bypass:r};var f,v;if(!l||a||e.length<7||e[1]!=="a");else if(e.length>=7&&e[0]==="d"&&(f=new RegExp(o.data.regex).exec(e))){if(r)return!1;var h=o.data;return{name:t,value:f,strValue:""+e,mapped:h,field:f[1],bypass:r}}else if(e.length>=10&&e[0]==="m"&&(v=new RegExp(o.mapData.regex).exec(e))){if(r)return!1;if(u.multiple)return!1;var c=o.mapData;if(!(u.color||u.number))return!1;var d=this.parse(t,v[4]);if(!d||d.mapped)return!1;var g=this.parse(t,v[5]);if(!g||g.mapped)return!1;if(d.pfValue===g.pfValue||d.strValue===g.strValue)return _e("`"+t+": "+e+"` is not a valid mapper because the output range is zero; converting to `"+t+": "+d.strValue+"`"),this.parse(t,d.strValue);else if(u.color){var y=d.value,p=g.value,m=y[0]===p[0]&&y[1]===p[1]&&y[2]===p[2]&&(y[3]===p[3]||(y[3]==null||y[3]===1)&&(p[3]==null||p[3]===1));if(m)return!1}return{name:t,value:v,strValue:""+e,mapped:c,field:v[1],fieldMin:parseFloat(v[2]),fieldMax:parseFloat(v[3]),valueMin:d.value,valueMax:g.value,bypass:r}}if(u.multiple&&a!=="multiple"){var b;if(l)b=e.split(/\s+/);else if(Je(e))b=e;else b=[e];if(u.evenMultiple&&b.length%2!==0)return null;var E=[],A=[],M=[],S="",P=!1;for(var N=0;N<b.length;N++){var R=n.parse(t,b[N],r,"multiple");P=P||Re(R.value),E.push(R.value),M.push(R.pfValue!=null?R.pfValue:R.value),A.push(R.units),S+=(N>0?" ":"")+R.strValue}if(u.validate&&!u.validate(E,A))return null;if(u.singleEnum&&P)if(E.length===1&&Re(E[0]))return{name:t,value:E[0],strValue:E[0],bypass:r};else return null;return{name:t,value:E,pfValue:M,strValue:S,bypass:r,units:A}}var I=function(){for(var Z=0;Z<u.enums.length;Z++){var U=u.enums[Z];if(U===e)return{name:t,value:e,strValue:""+e,bypass:r}}return null};if(u.number){var w,x="px";if(u.units)w=u.units;if(u.implicitUnits)x=u.implicitUnits;if(!u.unitless){if(l){var T="px|em"+(u.allowPercent?"|\\%":"");if(w)T=w;var D=e.match("^("+pt+")("+T+")?$");if(D)e=D[1],w=D[2]||x}else if(!w||u.implicitUnits)w=x}if(e=parseFloat(e),isNaN(e)&&u.enums===void 0)return null;if(isNaN(e)&&u.enums!==void 0)return e=s,I();if(u.integer&&!yf(e))return null;if(u.min!==void 0&&(e<u.min||u.strictMin&&e===u.min)||u.max!==void 0&&(e>u.max||u.strictMax&&e===u.max))return null;var C={name:t,value:e,strValue:""+e+(w?w:""),units:w,bypass:r};if(u.unitless||w!=="px"&&w!=="em")C.pfValue=e;else C.pfValue=w==="px"||!w?e:this.getEmSizeInPixels()*e;if(w==="ms"||w==="s")C.pfValue=w==="ms"?e:1000*e;if(w==="deg"||w==="rad")C.pfValue=w==="rad"?e:Nc(e);if(w==="%")C.pfValue=e/100;return C}else if(u.propList){var O=[],B=""+e;if(B==="none");else{var z=B.split(/\s*,\s*|\s+/);for(var V=0;V<z.length;V++){var k=z[V].trim();if(n.properties[k])O.push(k);else _e("`"+k+"` is not a valid property name")}if(O.length===0)return null}return{name:t,value:O,strValue:O.length===0?"none":O.join(" "),bypass:r}}else if(u.color){var G=xf(e);if(!G)return null;return{name:t,value:G,pfValue:G,strValue:"rgb("+G[0]+","+G[1]+","+G[2]+")",bypass:r}}else if(u.regex||u.regexes){if(u.enums){var J=I();if(J)return J}var X=u.regexes?u.regexes:[u.regex];for(var _=0;_<X.length;_++){var Q=new RegExp(X[_]),q=Q.exec(e);if(q)return{name:t,value:u.singleRegexMatchValue?q[1]:q,strValue:""+e,bypass:r}}return null}else if(u.string)return{name:t,value:""+e,strValue:""+e,bypass:r};else if(u.enums)return I();else return null};var wt=function(e){if(!(this instanceof wt))return new wt(e);if(!vo(e)){it("A style must have a core reference");return}this._private={cy:e,coreStyle:{}},this.length=0,this.resetToDefault()},Mt=wt.prototype;Mt.instanceString=function(){return"style"};Mt.clear=function(){var t=this._private,e=t.cy,r=e.elements();for(var a=0;a<this.length;a++)this[a]=void 0;return this.length=0,t.contextStyles={},t.propDiffs={},this.cleanElements(r,!0),r.forEach(function(n){var i=n[0]._private;i.styleDirty=!0,i.appliedInitStyle=!1}),this};Mt.resetToDefault=function(){return this.clear(),this.addDefaultStylesheet(),this};Mt.core=function(t){return this._private.coreStyle[t]||this.getDefaultProperty(t)};Mt.selector=function(t){var e=t==="core"?null:new Sr(t),r=this.length++;return this[r]={selector:e,properties:[],mappedProperties:[],index:r},this};Mt.css=function(){var t=this,e=arguments;if(e.length===1){var r=e[0];for(var a=0;a<t.properties.length;a++){var n=t.properties[a],i=r[n.name];if(i===void 0)i=r[Zn(n.name)];if(i!==void 0)this.cssRule(n.name,i)}}else if(e.length===2)this.cssRule(e[0],e[1]);return this};Mt.style=Mt.css;Mt.cssRule=function(t,e){var r=this.parse(t,e);if(r){var a=this.length-1;if(this[a].properties.push(r),this[a].properties[r.name]=r,r.name.match(/pie-(\d+)-background-size/)&&r.value)this._private.hasPie=!0;if(r.name.match(/stripe-(\d+)-background-size/)&&r.value)this._private.hasStripe=!0;if(r.mapped)this[a].mappedProperties.push(r);var n=!this[a].selector;if(n)this._private.coreStyle[r.name]=r}return this};Mt.append=function(t){if(bf(t))t.appendToStyle(this);else if(Je(t))this.appendFromJson(t);else if(Re(t))this.appendFromString(t);return this};wt.fromJson=function(t,e){var r=new wt(t);return r.fromJson(e),r};wt.fromString=function(t,e){return new wt(t).fromString(e)};[Et,rn,Mo,jt,ui,Lo,vt,li].forEach(function(t){Oe(Mt,t)});wt.types=Mt.types;wt.properties=Mt.properties;wt.propertyGroups=Mt.propertyGroups;wt.propertyGroupNames=Mt.propertyGroupNames;wt.propertyGroupKeys=Mt.propertyGroupKeys;var Fp={style:function(e){if(e){var r=this.setStyle(e);r.update()}return this._private.style},setStyle:function(e){var r=this._private;if(bf(e))r.style=e.generateStyle(this);else if(Je(e))r.style=wt.fromJson(this,e);else if(Re(e))r.style=wt.fromString(this,e);else r.style=wt(this);return r.style},updateStyle:function(){this.mutableElements().updateStyle()}},zp="single",qr={autolock:function(e){if(e!==void 0)this._private.autolock=e?!0:!1;else return this._private.autolock;return this},autoungrabify:function(e){if(e!==void 0)this._private.autoungrabify=e?!0:!1;else return this._private.autoungrabify;return this},autounselectify:function(e){if(e!==void 0)this._private.autounselectify=e?!0:!1;else return this._private.autounselectify;return this},selectionType:function(e){var r=this._private;if(r.selectionType==null)r.selectionType=zp;if(e!==void 0){if(e==="additive"||e==="single")r.selectionType=e}else return r.selectionType;return this},panningEnabled:function(e){if(e!==void 0)this._private.panningEnabled=e?!0:!1;else return this._private.panningEnabled;return this},userPanningEnabled:function(e){if(e!==void 0)this._private.userPanningEnabled=e?!0:!1;else return this._private.userPanningEnabled;return this},zoomingEnabled:function(e){if(e!==void 0)this._private.zoomingEnabled=e?!0:!1;else return this._private.zoomingEnabled;return this},userZoomingEnabled:function(e){if(e!==void 0)this._private.userZoomingEnabled=e?!0:!1;else return this._private.userZoomingEnabled;return this},boxSelectionEnabled:function(e){if(e!==void 0)this._private.boxSelectionEnabled=e?!0:!1;else return this._private.boxSelectionEnabled;return this},pan:function(){var e=arguments,r=this._private.pan,a,n,i,s,o;switch(e.length){case 0:return r;case 1:if(Re(e[0]))return a=e[0],r[a];else if(We(e[0])){if(!this._private.panningEnabled)return this;if(i=e[0],s=i.x,o=i.y,he(s))r.x=s;if(he(o))r.y=o;this.emit("pan viewport")}break;case 2:if(!this._private.panningEnabled)return this;if(a=e[0],n=e[1],(a==="x"||a==="y")&&he(n))r[a]=n;this.emit("pan viewport");break}return this.notify("viewport"),this},panBy:function(e,r){var a=arguments,n=this._private.pan,i,s,o,l,u;if(!this._private.panningEnabled)return this;switch(a.length){case 1:if(We(e)){if(o=a[0],l=o.x,u=o.y,he(l))n.x+=l;if(he(u))n.y+=u;this.emit("pan viewport")}break;case 2:if(i=e,s=r,(i==="x"||i==="y")&&he(s))n[i]+=s;this.emit("pan viewport");break}return this.notify("viewport"),this},gc:function(){this.notify("gc")},fit:function(e,r){var a=this.getFitViewport(e,r);if(a){var n=this._private;n.zoom=a.zoom,n.pan=a.pan,this.emit("pan zoom viewport"),this.notify("viewport")}return this},getFitViewport:function(e,r){if(he(e)&&r===void 0)r=e,e=void 0;if(!this._private.panningEnabled||!this._private.zoomingEnabled)return;var a;if(Re(e)){var n=e;e=this.$(n)}else if(Ch(e)){var i=e;a={x1:i.x1,y1:i.y1,x2:i.x2,y2:i.y2},a.w=a.x2-a.x1,a.h=a.y2-a.y1}else if(!zt(e))e=this.mutableElements();if(zt(e)&&e.empty())return;a=a||e.boundingBox();var s=this.width(),o=this.height(),l;if(r=he(r)?r:0,!isNaN(s)&&!isNaN(o)&&s>0&&o>0&&!isNaN(a.w)&&!isNaN(a.h)&&a.w>0&&a.h>0){l=Math.min((s-2*r)/a.w,(o-2*r)/a.h),l=l>this._private.maxZoom?this._private.maxZoom:l,l=l<this._private.minZoom?this._private.minZoom:l;var u={x:(s-l*(a.x1+a.x2))/2,y:(o-l*(a.y1+a.y2))/2};return{zoom:l,pan:u}}return},zoomRange:function(e,r){var a=this._private;if(r==null){var n=e;e=n.min,r=n.max}if(he(e)&&he(r)&&e<=r)a.minZoom=e,a.maxZoom=r;else if(he(e)&&r===void 0&&e<=a.maxZoom)a.minZoom=e;else if(he(r)&&e===void 0&&r>=a.minZoom)a.maxZoom=r;return this},minZoom:function(e){if(e===void 0)return this._private.minZoom;else return this.zoomRange({min:e})},maxZoom:function(e){if(e===void 0)return this._private.maxZoom;else return this.zoomRange({max:e})},getZoomedViewport:function(e){var r=this._private,{pan:a,zoom:n}=r,i,s,o=!1;if(!r.zoomingEnabled)o=!0;if(he(e))s=e;else if(We(e)){if(s=e.level,e.position!=null)i=Jn(e.position,n,a);else if(e.renderedPosition!=null)i=e.renderedPosition;if(i!=null&&!r.panningEnabled)o=!0}if(s=s>r.maxZoom?r.maxZoom:s,s=s<r.minZoom?r.minZoom:s,o||!he(s)||s===n||i!=null&&(!he(i.x)||!he(i.y)))return null;if(i!=null){var l=a,u=n,f=s,v={x:-f/u*(i.x-l.x)+i.x,y:-f/u*(i.y-l.y)+i.y};return{zoomed:!0,panned:!0,zoom:f,pan:v}}else return{zoomed:!0,panned:!1,zoom:s,pan:a}},zoom:function(e){if(e===void 0)return this._private.zoom;else{var r=this.getZoomedViewport(e),a=this._private;if(r==null||!r.zoomed)return this;if(a.zoom=r.zoom,r.panned)a.pan.x=r.pan.x,a.pan.y=r.pan.y;return this.emit("zoom"+(r.panned?" pan":"")+" viewport"),this.notify("viewport"),this}},viewport:function(e){var r=this._private,a=!0,n=!0,i=[],s=!1,o=!1;if(!e)return this;if(!he(e.zoom))a=!1;if(!We(e.pan))n=!1;if(!a&&!n)return this;if(a){var l=e.zoom;if(l<r.minZoom||l>r.maxZoom||!r.zoomingEnabled)s=!0;else r.zoom=l,i.push("zoom")}if(n&&(!s||!e.cancelOnFailedZoom)&&r.panningEnabled){var u=e.pan;if(he(u.x))r.pan.x=u.x,o=!1;if(he(u.y))r.pan.y=u.y,o=!1;if(!o)i.push("pan")}if(i.length>0)i.push("viewport"),this.emit(i.join(" ")),this.notify("viewport");return this},center:function(e){var r=this.getCenterPan(e);if(r)this._private.pan=r,this.emit("pan viewport"),this.notify("viewport");return this},getCenterPan:function(e,r){if(!this._private.panningEnabled)return;if(Re(e)){var a=e;e=this.mutableElements().filter(a)}else if(!zt(e))e=this.mutableElements();if(e.length===0)return;var n=e.boundingBox(),i=this.width(),s=this.height();r=r===void 0?this._private.zoom:r;var o={x:(i-r*(n.x1+n.x2))/2,y:(s-r*(n.y1+n.y2))/2};return o},reset:function(){if(!this._private.panningEnabled||!this._private.zoomingEnabled)return this;return this.viewport({pan:{x:0,y:0},zoom:1}),this},invalidateSize:function(){this._private.sizeCache=null},size:function(){var e=this._private,r=e.container,a=this;return e.sizeCache=e.sizeCache||(r?function(){var n=a.window().getComputedStyle(r),i=function(o){return parseFloat(n.getPropertyValue(o))};return{width:r.clientWidth-i("padding-left")-i("padding-right"),height:r.clientHeight-i("padding-top")-i("padding-bottom")}}():{width:1,height:1})},width:function(){return this.size().width},height:function(){return this.size().height},extent:function(){var e=this._private.pan,r=this._private.zoom,a=this.renderedExtent(),n={x1:(a.x1-e.x)/r,x2:(a.x2-e.x)/r,y1:(a.y1-e.y)/r,y2:(a.y2-e.y)/r};return n.w=n.x2-n.x1,n.h=n.y2-n.y1,n},renderedExtent:function(){var e=this.width(),r=this.height();return{x1:0,y1:0,x2:e,y2:r,w:e,h:r}},multiClickDebounceTime:function(e){if(e)this._private.multiClickDebounceTime=e;else return this._private.multiClickDebounceTime;return this}};qr.centre=qr.center;qr.autolockNodes=qr.autolock;qr.autoungrabifyNodes=qr.autoungrabify;var Xa={data:Ze.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:Ze.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:Ze.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Ze.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};Xa.attr=Xa.data;Xa.removeAttr=Xa.removeData;var Wa=function(e){var r=this;e=Oe({},e);var a=e.container;if(a&&!kn(a)&&kn(a[0]))a=a[0];var n=a?a._cyreg:null;if(n=n||{},n&&n.cy)n.cy.destroy(),n={};var i=n.readies=n.readies||[];if(a)a._cyreg=n;n.cy=r;var s=gt!==void 0&&a!==void 0&&!e.headless,o=e;o.layout=Oe({name:s?"grid":"null"},o.layout),o.renderer=Oe({name:s?"canvas":"null"},o.renderer);var l=function(d,g,y){if(g!==void 0)return g;else if(y!==void 0)return y;else return d},u=this._private={container:a,ready:!1,options:o,elements:new Ct(this),listeners:[],aniEles:new Ct(this),data:o.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:0.00000000000000000000000000000000000000000000000001,maxZoom:100000000000000000000000000000000000000000000000000,zoomingEnabled:l(!0,o.zoomingEnabled),userZoomingEnabled:l(!0,o.userZoomingEnabled),panningEnabled:l(!0,o.panningEnabled),userPanningEnabled:l(!0,o.userPanningEnabled),boxSelectionEnabled:l(!0,o.boxSelectionEnabled),autolock:l(!1,o.autolock,o.autolockNodes),autoungrabify:l(!1,o.autoungrabify,o.autoungrabifyNodes),autounselectify:l(!1,o.autounselectify),styleEnabled:o.styleEnabled===void 0?s:o.styleEnabled,zoom:he(o.zoom)?o.zoom:1,pan:{x:We(o.pan)&&he(o.pan.x)?o.pan.x:0,y:We(o.pan)&&he(o.pan.y)?o.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:l(250,o.multiClickDebounceTime)};this.createEmitter(),this.selectionType(o.selectionType),this.zoomRange({min:o.minZoom,max:o.maxZoom});var f=function(d,g){var y=d.some(Sh);if(y)return ga.all(d).then(g);else g(d)};if(u.styleEnabled)r.setStyle([]);var v=Oe({},o,o.renderer);r.initRenderer(v);var h=function(d,g,y){r.notifications(!1);var p=r.mutableElements();if(p.length>0)p.remove();if(d!=null){if(We(d)||Je(d))r.add(d)}r.one("layoutready",function(b){r.notifications(!0),r.emit(b),r.one("load",g),r.emitAndNotify("load")}).one("layoutstop",function(){r.one("done",y),r.emit("done")});var m=Oe({},r._private.options.layout);m.eles=r.elements(),r.layout(m).run()};f([o.style,o.elements],function(c){var d=c[0],g=c[1];if(u.styleEnabled)r.style().append(d);h(g,function(){if(r.startAnimationLoop(),u.ready=!0,st(o.ready))r.on("ready",o.ready);for(var y=0;y<i.length;y++){var p=i[y];r.on("ready",p)}if(n)n.readies=[];r.emit("ready")},o.done)})},qn=Wa.prototype;Oe(qn,{instanceString:function(){return"core"},isReady:function(){return this._private.ready},destroyed:function(){return this._private.destroyed},ready:function(e){if(this.isReady())this.emitter().emit("ready",[],e);else this.on("ready",e);return this},destroy:function(){var e=this;if(e.destroyed())return;return e.stopAnimationLoop(),e.destroyRenderer(),this.emit("destroy"),e._private.destroyed=!0,e},hasElementWithId:function(e){return this._private.elements.hasElementWithId(e)},getElementById:function(e){return this._private.elements.getElementById(e)},hasCompoundNodes:function(){return this._private.hasCompoundNodes},headless:function(){return this._private.renderer.isHeadless()},styleEnabled:function(){return this._private.styleEnabled},addToPool:function(e){return this._private.elements.merge(e),this},removeFromPool:function(e){return this._private.elements.unmerge(e),this},container:function(){return this._private.container||null},window:function(){var e=this._private.container;if(e==null)return gt;var r=this._private.container.ownerDocument;if(r===void 0||r==null)return gt;return r.defaultView||gt},mount:function(e){if(e==null)return;var r=this,a=r._private,n=a.options;if(!kn(e)&&kn(e[0]))e=e[0];return r.stopAnimationLoop(),r.destroyRenderer(),a.container=e,a.styleEnabled=!0,r.invalidateSize(),r.initRenderer(Oe({},n,n.renderer,{name:n.renderer.name==="null"?"canvas":n.renderer.name})),r.startAnimationLoop(),r.style(n.style),r.emit("mount"),r},unmount:function(){var e=this;return e.stopAnimationLoop(),e.destroyRenderer(),e.initRenderer({name:"null"}),e.emit("unmount"),e},options:function(){return Jt(this._private.options)},json:function(e){var r=this,a=r._private,n=r.mutableElements(),i=function(E){return r.getElementById(E.id())};if(We(e)){if(r.startBatch(),e.elements){var s={},o=function(E,A){var M=[],S=[];for(var P=0;P<E.length;P++){var N=E[P];if(!N.data.id){_e("cy.json() cannot handle elements without an ID attribute");continue}var R=""+N.data.id,I=r.getElementById(R);if(s[R]=!0,I.length!==0)S.push({ele:I,json:N});else if(A)N.group=A,M.push(N);else M.push(N)}r.add(M);for(var w=0;w<S.length;w++){var x=S[w],{ele:T,json:D}=x;T.json(D)}};if(Je(e.elements))o(e.elements);else{var l=["nodes","edges"];for(var u=0;u<l.length;u++){var f=l[u],v=e.elements[f];if(Je(v))o(v,f)}}var h=r.collection();n.filter(function(b){return!s[b.id()]}).forEach(function(b){if(b.isParent())h.merge(b);else b.remove()}),h.forEach(function(b){return b.children().move({parent:null})}),h.forEach(function(b){return i(b).remove()})}if(e.style)r.style(e.style);if(e.zoom!=null&&e.zoom!==a.zoom)r.zoom(e.zoom);if(e.pan){if(e.pan.x!==a.pan.x||e.pan.y!==a.pan.y)r.pan(e.pan)}if(e.data)r.data(e.data);var c=["minZoom","maxZoom","zoomingEnabled","userZoomingEnabled","panningEnabled","userPanningEnabled","boxSelectionEnabled","autolock","autoungrabify","autounselectify","multiClickDebounceTime"];for(var d=0;d<c.length;d++){var g=c[d];if(e[g]!=null)r[g](e[g])}return r.endBatch(),this}else{var y=!!e,p={};if(y)p.elements=this.elements().map(function(b){return b.json()});else p.elements={},n.forEach(function(b){var E=b.group();if(!p.elements[E])p.elements[E]=[];p.elements[E].push(b.json())});if(this._private.styleEnabled)p.style=r.style().json();p.data=Jt(r.data());var m=a.options;return p.zoomingEnabled=a.zoomingEnabled,p.userZoomingEnabled=a.userZoomingEnabled,p.zoom=a.zoom,p.minZoom=a.minZoom,p.maxZoom=a.maxZoom,p.panningEnabled=a.panningEnabled,p.userPanningEnabled=a.userPanningEnabled,p.pan=Jt(a.pan),p.boxSelectionEnabled=a.boxSelectionEnabled,p.renderer=Jt(m.renderer),p.hideEdgesOnViewport=m.hideEdgesOnViewport,p.textureOnViewport=m.textureOnViewport,p.wheelSensitivity=m.wheelSensitivity,p.motionBlur=m.motionBlur,p.multiClickDebounceTime=m.multiClickDebounceTime,p}}});qn.$id=qn.getElementById;[Ap,Np,wv,js,Rn,Ip,eo,Pn,Fp,qr,Xa].forEach(function(t){Oe(qn,t)});var Vp={fit:!0,directed:!1,direction:"downward",padding:30,circle:!1,grid:!1,spacingFactor:1.75,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,roots:void 0,depthSort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}},Gp={maximal:!1,acyclic:!1},Qr=function(e){return e.scratch("breadthfirst")},Vl=function(e,r){return e.scratch("breadthfirst",r)};function Ev(t){this.options=Oe({},Vp,Gp,t)}Ev.prototype.run=function(){var t=this.options,{cy:e,eles:r}=t,a=r.nodes().filter(function(ge){return ge.isChildless()}),n=r,i=t.directed,s=t.acyclic||t.maximal||t.maximalAdjustments>0,o=!!t.boundingBox,l=Ot(o?t.boundingBox:structuredClone(e.extent())),u;if(zt(t.roots))u=t.roots;else if(Je(t.roots)){var f=[];for(var v=0;v<t.roots.length;v++){var h=t.roots[v],c=e.getElementById(h);f.push(c)}u=e.collection(f)}else if(Re(t.roots))u=e.$(t.roots);else if(i)u=a.roots();else{var d=r.components();u=e.collection();var g=function(){var ve=d[y],ye=ve.maxDegree(!1),Ee=ve.filter(function(Pe){return Pe.degree(!1)===ye});u=u.add(Ee)};for(var y=0;y<d.length;y++)g()}var p=[],m={},b=function(ve,ye){if(p[ye]==null)p[ye]=[];var Ee=p[ye].length;p[ye].push(ve),Vl(ve,{index:Ee,depth:ye})},E=function(ve,ye){var Ee=Qr(ve),{depth:Pe,index:Me}=Ee;if(p[Pe][Me]=null,ve.isChildless())b(ve,ye)};n.bfs({roots:u,directed:t.directed,visit:function(ve,ye,Ee,Pe,Me){var Ne=ve[0],Fe=Ne.id();if(Ne.isChildless())b(Ne,Me);m[Fe]=!0}});var A=[];for(var M=0;M<a.length;M++){var S=a[M];if(m[S.id()])continue;else A.push(S)}var P=function(ve){var ye=p[ve];for(var Ee=0;Ee<ye.length;Ee++){var Pe=ye[Ee];if(Pe==null){ye.splice(Ee,1),Ee--;continue}Vl(Pe,{depth:ve,index:Ee})}},N=function(ve,ye){var Ee=Qr(ve),Pe=ve.incomers().filter(function(L){return L.isNode()&&r.has(L)}),Me=-1,Ne=ve.id();for(var Fe=0;Fe<Pe.length;Fe++){var ze=Pe[Fe],Ue=Qr(ze);Me=Math.max(Me,Ue.depth)}if(Ee.depth<=Me){if(!t.acyclic&&ye[Ne])return null;var ie=Me+1;return E(ve,ie),ye[Ne]=ie,!0}return!1};if(i&&s){var R=[],I={},w=function(ve){return R.push(ve)},x=function(){return R.shift()};a.forEach(function(ge){return R.push(ge)});while(R.length>0){var T=x(),D=N(T,I);if(D)T.outgoers().filter(function(ge){return ge.isNode()&&r.has(ge)}).forEach(w);else if(D===null){_e("Detected double maximal shift for node `"+T.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}var C=0;if(t.avoidOverlap)for(var O=0;O<a.length;O++){var B=a[O],z=B.layoutDimensions(t),{w:V,h:k}=z;C=Math.max(C,V,k)}var G={},J=function(ve){if(G[ve.id()])return G[ve.id()];var ye=Qr(ve).depth,Ee=ve.neighborhood(),Pe=0,Me=0;for(var Ne=0;Ne<Ee.length;Ne++){var Fe=Ee[Ne];if(Fe.isEdge()||Fe.isParent()||!a.has(Fe))continue;var ze=Qr(Fe);if(ze==null)continue;var{index:Ue,depth:ie}=ze;if(Ue==null||ie==null)continue;var L=p[ie].length;if(ie<ye)Pe+=Ue/L,Me++}if(Me=Math.max(1,Me),Pe=Pe/Me,Me===0)Pe=0;return G[ve.id()]=Pe,Pe},X=function(ve,ye){var Ee=J(ve),Pe=J(ye),Me=Ee-Pe;if(Me===0)return Ef(ve.id(),ye.id());else return Me};if(t.depthSort!==void 0)X=t.depthSort;var _=p.length;for(var Q=0;Q<_;Q++)p[Q].sort(X),P(Q);var q=[];for(var te=0;te<A.length;te++)q.push(A[te]);var Z=function(){for(var ve=0;ve<_;ve++)P(ve)};if(q.length)p.unshift(q),_=p.length,Z();var U=0;for(var W=0;W<_;W++)U=Math.max(p[W].length,U);var j={x:l.x1+l.w/2,y:l.y1+l.h/2},re=a.reduce(function(ge,ve){return function(ye){return{w:ge.w===-1?ye.w:(ge.w+ye.w)/2,h:ge.h===-1?ye.h:(ge.h+ye.h)/2}}(ve.boundingBox({includeLabels:t.nodeDimensionsIncludeLabels}))},{w:-1,h:-1}),ee=Math.max(_===1?0:o?(l.h-t.padding*2-re.h)/(_-1):(l.h-t.padding*2-re.h)/(_+1),C),de=p.reduce(function(ge,ve){return Math.max(ge,ve.length)},0),Ae=function(ve){var ye=Qr(ve),{depth:Ee,index:Pe}=ye;if(t.circle){var Me=Math.min(l.w/2/_,l.h/2/_);Me=Math.max(Me,C);var Ne=Me*Ee+Me-(_>0&&p[0].length<=3?Me/2:0),Fe=2*Math.PI/p[Ee].length*Pe;if(Ee===0&&p[0].length===1)Ne=1;return{x:j.x+Ne*Math.cos(Fe),y:j.y+Ne*Math.sin(Fe)}}else{var ze=p[Ee].length,Ue=Math.max(ze===1?0:o?(l.w-t.padding*2-re.w)/((t.grid?de:ze)-1):(l.w-t.padding*2-re.w)/((t.grid?de:ze)+1),C),ie={x:j.x+(Pe+1-(ze+1)/2)*Ue,y:j.y+(Ee+1-(_+1)/2)*ee};return ie}},Ce={downward:0,leftward:90,upward:180,rightward:-90};if(Object.keys(Ce).indexOf(t.direction)===-1)it("Invalid direction '".concat(t.direction,"' specified for breadthfirst layout. Valid values are: ").concat(Object.keys(Ce).join(", ")));var Se=function(ve){return ec(Ae(ve),l,Ce[t.direction])};return r.nodes().layoutPositions(this,t,Se),this};var Up={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,radius:void 0,startAngle:1.5*Math.PI,sweep:void 0,clockwise:!0,sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function xv(t){this.options=Oe({},Up,t)}xv.prototype.run=function(){var t=this.options,e=t,r=t.cy,a=e.eles,n=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,i=a.nodes().not(":parent");if(e.sort)i=i.sort(e.sort);var s=Ot(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),o={x:s.x1+s.w/2,y:s.y1+s.h/2},l=e.sweep===void 0?2*Math.PI-2*Math.PI/i.length:e.sweep,u=l/Math.max(1,i.length-1),f,v=0;for(var h=0;h<i.length;h++){var c=i[h],d=c.layoutDimensions(e),{w:g,h:y}=d;v=Math.max(v,g,y)}if(he(e.radius))f=e.radius;else if(i.length<=1)f=0;else f=Math.min(s.h,s.w)/2-v;if(i.length>1&&e.avoidOverlap){v*=1.75;var p=Math.cos(u)-Math.cos(0),m=Math.sin(u)-Math.sin(0),b=Math.sqrt(v*v/(p*p+m*m));f=Math.max(b,f)}var E=function(M,S){var P=e.startAngle+S*u*(n?1:-1),N=f*Math.cos(P),R=f*Math.sin(P),I={x:o.x+N,y:o.y+R};return I};return a.nodes().layoutPositions(this,e,E),this};var Hp={fit:!0,padding:30,startAngle:1.5*Math.PI,sweep:void 0,clockwise:!0,equidistant:!1,minNodeSpacing:10,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,height:void 0,width:void 0,spacingFactor:void 0,concentric:function(e){return e.degree()},levelWidth:function(e){return e.maxDegree()/4},animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function Tv(t){this.options=Oe({},Hp,t)}Tv.prototype.run=function(){var t=this.options,e=t,r=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,a=t.cy,n=e.eles,i=n.nodes().not(":parent"),s=Ot(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:a.width(),h:a.height()}),o={x:s.x1+s.w/2,y:s.y1+s.h/2},l=[],u=0;for(var f=0;f<i.length;f++){var v=i[f],h=void 0;h=e.concentric(v),l.push({value:h,node:v}),v._private.scratch.concentric=h}i.updateStyle();for(var c=0;c<i.length;c++){var d=i[c],g=d.layoutDimensions(e);u=Math.max(u,g.w,g.h)}l.sort(function(ee,de){return de.value-ee.value});var y=e.levelWidth(i),p=[[]],m=p[0];for(var b=0;b<l.length;b++){var E=l[b];if(m.length>0){var A=Math.abs(m[0].value-E.value);if(A>=y)m=[],p.push(m)}m.push(E)}var M=u+e.minNodeSpacing;if(!e.avoidOverlap){var S=p.length>0&&p[0].length>1,P=Math.min(s.w,s.h)/2-M,N=P/(p.length+S?1:0);M=Math.min(M,N)}var R=0;for(var I=0;I<p.length;I++){var w=p[I],x=e.sweep===void 0?2*Math.PI-2*Math.PI/w.length:e.sweep,T=w.dTheta=x/Math.max(1,w.length-1);if(w.length>1&&e.avoidOverlap){var D=Math.cos(T)-Math.cos(0),C=Math.sin(T)-Math.sin(0),O=Math.sqrt(M*M/(D*D+C*C));R=Math.max(O,R)}w.r=R,R+=M}if(e.equidistant){var B=0,z=0;for(var V=0;V<p.length;V++){var k=p[V],G=k.r-z;B=Math.max(B,G)}z=0;for(var J=0;J<p.length;J++){var X=p[J];if(J===0)z=X.r;X.r=z,z+=B}}var _={};for(var Q=0;Q<p.length;Q++){var q=p[Q],{dTheta:te,r:Z}=q;for(var U=0;U<q.length;U++){var W=q[U],j=e.startAngle+(r?1:-1)*te*U,re={x:o.x+Z*Math.cos(j),y:o.y+Z*Math.sin(j)};_[W.node.id()]=re}}return n.nodes().layoutPositions(this,e,function(ee){var de=ee.id();return _[de]}),this};var Bs,qp={ready:function(){},stop:function(){},animate:!0,animationEasing:void 0,animationDuration:void 0,animateFilter:function(e,r){return!0},animationThreshold:250,refresh:20,fit:!0,padding:30,boundingBox:void 0,nodeDimensionsIncludeLabels:!1,randomize:!1,componentSpacing:40,nodeRepulsion:function(e){return 2048},nodeOverlap:4,idealEdgeLength:function(e){return 32},edgeElasticity:function(e){return 32},nestingFactor:1.2,gravity:1,numIter:1000,initialTemp:1000,coolingFactor:0.99,minTemp:1};function fi(t){this.options=Oe({},qp,t),this.options.layout=this;var e=this.options.eles.nodes(),r=this.options.eles.edges(),a=r.filter(function(n){var i=n.source().data("id"),s=n.target().data("id"),o=e.some(function(u){return u.data("id")===i}),l=e.some(function(u){return u.data("id")===s});return!o||!l});this.options.eles=this.options.eles.not(a)}fi.prototype.run=function(){var t=this.options,e=t.cy,r=this;if(r.stopped=!1,t.animate===!0||t.animate===!1)r.emit({type:"layoutstart",layout:r});if(t.debug===!0)Bs=!0;else Bs=!1;var a=Yp(e,r,t);if(Bs)Wp(a);if(t.randomize)$p(a);var n=ir(),i=function(){if(Kp(a,e,t),t.fit===!0)e.fit(t.padding)},s=function(h){if(r.stopped||h>=t.numIter)return!1;if(Zp(a,t),a.temperature=a.temperature*t.coolingFactor,a.temperature<t.minTemp)return!1;return!0},o=function(){if(t.animate===!0||t.animate===!1)i(),r.one("layoutstop",t.stop),r.emit({type:"layoutstop",layout:r});else{var h=t.eles.nodes(),c=Sv(a,t,h);h.layoutPositions(r,t,c)}},l=0,u=!0;if(t.animate===!0){var f=function(){var h=0;while(u&&h<t.refresh)u=s(l),l++,h++;if(!u)Ul(a,t),o();else{var c=ir();if(c-n>=t.animationThreshold)i();Fn(f)}};f()}else{while(u)u=s(l),l++;Ul(a,t),o()}return this};fi.prototype.stop=function(){if(this.stopped=!0,this.thread)this.thread.stop();return this.emit("layoutstop"),this};fi.prototype.destroy=function(){if(this.thread)this.thread.stop();return this};var Yp=function(e,r,a){var n=a.eles.edges(),i=a.eles.nodes(),s=Ot(a.boundingBox?a.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),o={isCompound:e.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:i.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:n.size(),temperature:a.initialTemp,clientWidth:s.w,clientHeight:s.h,boundingBox:s},l=a.eles.components(),u={};for(var f=0;f<l.length;f++){var v=l[f];for(var h=0;h<v.length;h++){var c=v[h];u[c.id()]=f}}for(var f=0;f<o.nodeSize;f++){var d=i[f],g=d.layoutDimensions(a),y={};y.isLocked=d.locked(),y.id=d.data("id"),y.parentId=d.data("parent"),y.cmptId=u[d.id()],y.children=[],y.positionX=d.position("x"),y.positionY=d.position("y"),y.offsetX=0,y.offsetY=0,y.height=g.w,y.width=g.h,y.maxX=y.positionX+y.width/2,y.minX=y.positionX-y.width/2,y.maxY=y.positionY+y.height/2,y.minY=y.positionY-y.height/2,y.padLeft=parseFloat(d.style("padding")),y.padRight=parseFloat(d.style("padding")),y.padTop=parseFloat(d.style("padding")),y.padBottom=parseFloat(d.style("padding")),y.nodeRepulsion=st(a.nodeRepulsion)?a.nodeRepulsion(d):a.nodeRepulsion,o.layoutNodes.push(y),o.idToIndex[y.id]=f}var p=[],m=0,b=-1,E=[];for(var f=0;f<o.nodeSize;f++){var d=o.layoutNodes[f],A=d.parentId;if(A!=null)o.layoutNodes[o.idToIndex[A]].children.push(d.id);else p[++b]=d.id,E.push(d.id)}o.graphSet.push(E);while(m<=b){var M=p[m++],S=o.idToIndex[M],c=o.layoutNodes[S],P=c.children;if(P.length>0){o.graphSet.push(P);for(var f=0;f<P.length;f++)p[++b]=P[f]}}for(var f=0;f<o.graphSet.length;f++){var N=o.graphSet[f];for(var h=0;h<N.length;h++){var R=o.idToIndex[N[h]];o.indexToGraph[R]=f}}for(var f=0;f<o.edgeSize;f++){var I=n[f],w={};w.id=I.data("id"),w.sourceId=I.data("source"),w.targetId=I.data("target");var x=st(a.idealEdgeLength)?a.idealEdgeLength(I):a.idealEdgeLength,T=st(a.edgeElasticity)?a.edgeElasticity(I):a.edgeElasticity,D=o.idToIndex[w.sourceId],C=o.idToIndex[w.targetId],O=o.indexToGraph[D],B=o.indexToGraph[C];if(O!=B){var z=Xp(w.sourceId,w.targetId,o),V=o.graphSet[z],k=0,y=o.layoutNodes[D];while(V.indexOf(y.id)===-1)y=o.layoutNodes[o.idToIndex[y.parentId]],k++;y=o.layoutNodes[C];while(V.indexOf(y.id)===-1)y=o.layoutNodes[o.idToIndex[y.parentId]],k++;x*=k*a.nestingFactor}w.idealLength=x,w.elasticity=T,o.layoutEdges.push(w)}return o},Xp=function(e,r,a){var n=Cv(e,r,0,a);if(2>n.count)return 0;else return n.graph},Cv=function(e,r,a,n){var i=n.graphSet[a];if(-1<i.indexOf(e)&&-1<i.indexOf(r))return{count:2,graph:a};var s=0;for(var o=0;o<i.length;o++){var l=i[o],u=n.idToIndex[l],f=n.layoutNodes[u].children;if(f.length===0)continue;var v=n.indexToGraph[n.idToIndex[f[0]]],h=Cv(e,r,v,n);if(h.count===0)continue;else if(h.count===1){if(s++,s===2)break}else return h}return{count:s,graph:a}},Wp,$p=function(e,r){var{clientWidth:a,clientHeight:n}=e;for(var i=0;i<e.nodeSize;i++){var s=e.layoutNodes[i];if(s.children.length===0&&!s.isLocked)s.positionX=Math.random()*a,s.positionY=Math.random()*n}},Sv=function(e,r,a){var n=e.boundingBox,i={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0};if(r.boundingBox)a.forEach(function(s){var o=e.layoutNodes[e.idToIndex[s.data("id")]];i.x1=Math.min(i.x1,o.positionX),i.x2=Math.max(i.x2,o.positionX),i.y1=Math.min(i.y1,o.positionY),i.y2=Math.max(i.y2,o.positionY)}),i.w=i.x2-i.x1,i.h=i.y2-i.y1;return function(s,o){var l=e.layoutNodes[e.idToIndex[s.data("id")]];if(r.boundingBox){var u=i.w===0?0.5:(l.positionX-i.x1)/i.w,f=i.h===0?0.5:(l.positionY-i.y1)/i.h;return{x:n.x1+u*n.w,y:n.y1+f*n.h}}else return{x:l.positionX,y:l.positionY}}},Kp=function(e,r,a){var n=a.layout,i=a.eles.nodes(),s=Sv(e,a,i);if(i.positions(s),e.ready!==!0)e.ready=!0,n.one("layoutready",a.ready),n.emit({type:"layoutready",layout:this})},Zp=function(e,r,a){_p(e,r),jp(e),ey(e,r),ty(e),ry(e)},_p=function(e,r){for(var a=0;a<e.graphSet.length;a++){var n=e.graphSet[a],i=n.length;for(var s=0;s<i;s++){var o=e.layoutNodes[e.idToIndex[n[s]]];for(var l=s+1;l<i;l++){var u=e.layoutNodes[e.idToIndex[n[l]]];Qp(o,u,e,r)}}}},Gl=function(e){return-e+2*e*Math.random()},Qp=function(e,r,a,n){var i=e.cmptId,s=r.cmptId;if(i!==s&&!a.isCompound)return;var o=r.positionX-e.positionX,l=r.positionY-e.positionY,u=1;if(o===0&&l===0)o=Gl(u),l=Gl(u);var f=Jp(e,r,o,l);if(f>0)var v=n.nodeOverlap*f,h=Math.sqrt(o*o+l*l),c=v*o/h,d=v*l/h;else var g=Yn(e,o,l),y=Yn(r,-1*o,-1*l),p=y.x-g.x,m=y.y-g.y,b=p*p+m*m,h=Math.sqrt(b),v=(e.nodeRepulsion+r.nodeRepulsion)/b,c=v*p/h,d=v*m/h;if(!e.isLocked)e.offsetX-=c,e.offsetY-=d;if(!r.isLocked)r.offsetX+=c,r.offsetY+=d;return},Jp=function(e,r,a,n){if(a>0)var i=e.maxX-r.minX;else var i=r.maxX-e.minX;if(n>0)var s=e.maxY-r.minY;else var s=r.maxY-e.minY;if(i>=0&&s>=0)return Math.sqrt(i*i+s*s);else return 0},Yn=function(e,r,a){var{positionX:n,positionY:i}=e,s=e.height||1,o=e.width||1,l=a/r,u=s/o,f={};if(r===0&&0<a)return f.x=n,f.y=i+s/2,f;if(r===0&&0>a)return f.x=n,f.y=i+s/2,f;if(0<r&&-1*u<=l&&l<=u)return f.x=n+o/2,f.y=i+o*a/2/r,f;if(0>r&&-1*u<=l&&l<=u)return f.x=n-o/2,f.y=i-o*a/2/r,f;if(0<a&&(l<=-1*u||l>=u))return f.x=n+s*r/2/a,f.y=i+s/2,f;if(0>a&&(l<=-1*u||l>=u))return f.x=n-s*r/2/a,f.y=i-s/2,f;return f},jp=function(e,r){for(var a=0;a<e.edgeSize;a++){var n=e.layoutEdges[a],i=e.idToIndex[n.sourceId],s=e.layoutNodes[i],o=e.idToIndex[n.targetId],l=e.layoutNodes[o],u=l.positionX-s.positionX,f=l.positionY-s.positionY;if(u===0&&f===0)continue;var v=Yn(s,u,f),h=Yn(l,-1*u,-1*f),c=h.x-v.x,d=h.y-v.y,g=Math.sqrt(c*c+d*d),y=Math.pow(n.idealLength-g,2)/n.elasticity;if(g!==0)var p=y*c/g,m=y*d/g;else var p=0,m=0;if(!s.isLocked)s.offsetX+=p,s.offsetY+=m;if(!l.isLocked)l.offsetX-=p,l.offsetY-=m}},ey=function(e,r){if(r.gravity===0)return;var a=1;for(var n=0;n<e.graphSet.length;n++){var i=e.graphSet[n],s=i.length;if(n===0)var o=e.clientHeight/2,l=e.clientWidth/2;else var u=e.layoutNodes[e.idToIndex[i[0]]],f=e.layoutNodes[e.idToIndex[u.parentId]],{positionX:o,positionY:l}=f;for(var v=0;v<s;v++){var h=e.layoutNodes[e.idToIndex[i[v]]];if(h.isLocked)continue;var c=o-h.positionX,d=l-h.positionY,g=Math.sqrt(c*c+d*d);if(g>a){var y=r.gravity*c/g,p=r.gravity*d/g;h.offsetX+=y,h.offsetY+=p}}}},ty=function(e,r){var a=[],n=0,i=-1;a.push.apply(a,e.graphSet[0]),i+=e.graphSet[0].length;while(n<=i){var s=a[n++],o=e.idToIndex[s],l=e.layoutNodes[o],u=l.children;if(0<u.length&&!l.isLocked){var{offsetX:f,offsetY:v}=l;for(var h=0;h<u.length;h++){var c=e.layoutNodes[e.idToIndex[u[h]]];c.offsetX+=f,c.offsetY+=v,a[++i]=u[h]}l.offsetX=0,l.offsetY=0}}},ry=function(e,r){for(var a=0;a<e.nodeSize;a++){var n=e.layoutNodes[a];if(0<n.children.length)n.maxX=void 0,n.minX=void 0,n.maxY=void 0,n.minY=void 0}for(var a=0;a<e.nodeSize;a++){var n=e.layoutNodes[a];if(0<n.children.length||n.isLocked)continue;var i=ay(n.offsetX,n.offsetY,e.temperature);n.positionX+=i.x,n.positionY+=i.y,n.offsetX=0,n.offsetY=0,n.minX=n.positionX-n.width,n.maxX=n.positionX+n.width,n.minY=n.positionY-n.height,n.maxY=n.positionY+n.height,Dv(n,e)}for(var a=0;a<e.nodeSize;a++){var n=e.layoutNodes[a];if(0<n.children.length&&!n.isLocked)n.positionX=(n.maxX+n.minX)/2,n.positionY=(n.maxY+n.minY)/2,n.width=n.maxX-n.minX,n.height=n.maxY-n.minY}},ay=function(e,r,a){var n=Math.sqrt(e*e+r*r);if(n>a)var i={x:a*e/n,y:a*r/n};else var i={x:e,y:r};return i},Dv=function(e,r){var a=e.parentId;if(a==null)return;var n=r.layoutNodes[r.idToIndex[a]],i=!1;if(n.maxX==null||e.maxX+n.padRight>n.maxX)n.maxX=e.maxX+n.padRight,i=!0;if(n.minX==null||e.minX-n.padLeft<n.minX)n.minX=e.minX-n.padLeft,i=!0;if(n.maxY==null||e.maxY+n.padBottom>n.maxY)n.maxY=e.maxY+n.padBottom,i=!0;if(n.minY==null||e.minY-n.padTop<n.minY)n.minY=e.minY-n.padTop,i=!0;if(i)return Dv(n,r);return},Ul=function(e,r){var a=e.layoutNodes,n=[];for(var i=0;i<a.length;i++){var s=a[i],o=s.cmptId,l=n[o]=n[o]||[];l.push(s)}var u=0;for(var i=0;i<n.length;i++){var f=n[i];if(!f)continue;f.x1=1/0,f.x2=-1/0,f.y1=1/0,f.y2=-1/0;for(var v=0;v<f.length;v++){var h=f[v];f.x1=Math.min(f.x1,h.positionX-h.width/2),f.x2=Math.max(f.x2,h.positionX+h.width/2),f.y1=Math.min(f.y1,h.positionY-h.height/2),f.y2=Math.max(f.y2,h.positionY+h.height/2)}f.w=f.x2-f.x1,f.h=f.y2-f.y1,u+=f.w*f.h}n.sort(function(m,b){return b.w*b.h-m.w*m.h});var c=0,d=0,g=0,y=0,p=Math.sqrt(u)*e.clientWidth/e.clientHeight;for(var i=0;i<n.length;i++){var f=n[i];if(!f)continue;for(var v=0;v<f.length;v++){var h=f[v];if(!h.isLocked)h.positionX+=c-f.x1,h.positionY+=d-f.y1}if(c+=f.w+r.componentSpacing,g+=f.w+r.componentSpacing,y=Math.max(y,f.h),g>p)d+=y+r.componentSpacing,c=0,g=0,y=0}},ny={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,avoidOverlapPadding:10,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,condense:!1,rows:void 0,cols:void 0,position:function(e){},sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function Av(t){this.options=Oe({},ny,t)}Av.prototype.run=function(){var t=this.options,e=t,r=t.cy,a=e.eles,n=a.nodes().not(":parent");if(e.sort)n=n.sort(e.sort);var i=Ot(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()});if(i.h===0||i.w===0)a.nodes().layoutPositions(this,e,function(J){return{x:i.x1,y:i.y1}});else{var s=n.size(),o=Math.sqrt(s*i.h/i.w),l=Math.round(o),u=Math.round(i.w/i.h*o),f=function(X){if(X==null)return Math.min(l,u);else{var _=Math.min(l,u);if(_==l)l=X;else u=X}},v=function(X){if(X==null)return Math.max(l,u);else{var _=Math.max(l,u);if(_==l)l=X;else u=X}},h=e.rows,c=e.cols!=null?e.cols:e.columns;if(h!=null&&c!=null)l=h,u=c;else if(h!=null&&c==null)l=h,u=Math.ceil(s/l);else if(h==null&&c!=null)u=c,l=Math.ceil(s/u);else if(u*l>s){var d=f(),g=v();if((d-1)*g>=s)f(d-1);else if((g-1)*d>=s)v(g-1)}else while(u*l<s){var y=f(),p=v();if((p+1)*y>=s)v(p+1);else f(y+1)}var m=i.w/u,b=i.h/l;if(e.condense)m=0,b=0;if(e.avoidOverlap)for(var E=0;E<n.length;E++){var A=n[E],M=A._private.position;if(M.x==null||M.y==null)M.x=0,M.y=0;var S=A.layoutDimensions(e),P=e.avoidOverlapPadding,N=S.w+P,R=S.h+P;m=Math.max(m,N),b=Math.max(b,R)}var I={},w=function(X,_){return I["c-"+X+"-"+_]?!0:!1},x=function(X,_){I["c-"+X+"-"+_]=!0},T=0,D=0,C=function(){if(D++,D>=u)D=0,T++},O={};for(var B=0;B<n.length;B++){var z=n[B],V=e.position(z);if(V&&(V.row!==void 0||V.col!==void 0)){var k={row:V.row,col:V.col};if(k.col===void 0){k.col=0;while(w(k.row,k.col))k.col++}else if(k.row===void 0){k.row=0;while(w(k.row,k.col))k.row++}O[z.id()]=k,x(k.row,k.col)}}var G=function(X,_){var Q,q;if(X.locked()||X.isParent())return!1;var te=O[X.id()];if(te)Q=te.col*m+m/2+i.x1,q=te.row*b+b/2+i.y1;else{while(w(T,D))C();Q=D*m+m/2+i.x1,q=T*b+b/2+i.y1,x(T,D),C()}return{x:Q,y:q}};n.layoutPositions(this,e,G)}return this};var iy={ready:function(){},stop:function(){}};function Ro(t){this.options=Oe({},iy,t)}Ro.prototype.run=function(){var t=this.options,e=t.eles,r=this;return t.cy,r.emit("layoutstart"),e.nodes().positions(function(){return{x:0,y:0}}),r.one("layoutready",t.ready),r.emit("layoutready"),r.one("layoutstop",t.stop),r.emit("layoutstop"),this};Ro.prototype.stop=function(){return this};var sy={positions:void 0,zoom:void 0,pan:void 0,fit:!0,padding:30,spacingFactor:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function Mv(t){this.options=Oe({},sy,t)}Mv.prototype.run=function(){var t=this.options,e=t.eles,r=e.nodes(),a=st(t.positions);function n(i){if(t.positions==null)return Dc(i.position());if(a)return t.positions(i);var s=t.positions[i._private.data.id];if(s==null)return null;return s}return r.layoutPositions(this,t,function(i,s){var o=n(i);if(i.locked()||o==null)return!1;return o}),this};var oy={fit:!0,padding:30,boundingBox:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function Lv(t){this.options=Oe({},oy,t)}Lv.prototype.run=function(){var t=this.options,{cy:e,eles:r}=t,a=Ot(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),n=function(s,o){return{x:a.x1+Math.round(Math.random()*a.w),y:a.y1+Math.round(Math.random()*a.h)}};return r.nodes().layoutPositions(this,t,n),this};var uy=[{name:"breadthfirst",impl:Ev},{name:"circle",impl:xv},{name:"concentric",impl:Tv},{name:"cose",impl:fi},{name:"grid",impl:Av},{name:"null",impl:Ro},{name:"preset",impl:Mv},{name:"random",impl:Lv}];function Rv(t){this.options=t,this.notifications=0}var Hl=function(){},ql=function(){throw Error("A headless instance can not render images")};Rv.prototype={recalculateRenderedStyle:Hl,notify:function(){this.notifications++},init:Hl,isHeadless:function(){return!0},png:ql,jpg:ql};var Po={};Po.arrowShapeWidth=0.3;Po.registerArrowShapes=function(){var t=this.arrowShapes={},e=this,r=function(u,f,v,h,c,d,g){var y=c.x-v/2-g,p=c.x+v/2+g,m=c.y-v/2-g,b=c.y+v/2+g,E=y<=u&&u<=p&&m<=f&&f<=b;return E},a=function(u,f,v,h,c){var d=u*Math.cos(h)-f*Math.sin(h),g=u*Math.sin(h)+f*Math.cos(h),y=d*v,p=g*v,m=y+c.x,b=p+c.y;return{x:m,y:b}},n=function(u,f,v,h){var c=[];for(var d=0;d<u.length;d+=2){var g=u[d],y=u[d+1];c.push(a(g,y,f,v,h))}return c},i=function(u){var f=[];for(var v=0;v<u.length;v++){var h=u[v];f.push(h.x,h.y)}return f},s=function(u){return u.pstyle("width").pfValue*u.pstyle("arrow-scale").pfValue*2},o=function(u,f){if(Re(f))f=t[f];t[u]=Oe({name:u,points:[-0.15,-0.3,0.15,-0.3,0.15,0.3,-0.15,0.3],collide:function(h,c,d,g,y,p){var m=i(n(this.points,d+2*p,g,y)),b=Bt(h,c,m);return b},roughCollide:r,draw:function(h,c,d,g){var y=n(this.points,c,d,g);e.arrowShapeImpl("polygon")(h,y)},spacing:function(h){return 0},gap:s},f)};o("none",{collide:zn,roughCollide:zn,draw:po,spacing:au,gap:au}),o("triangle",{points:[-0.15,-0.3,0,0,0.15,-0.3]}),o("arrow","triangle"),o("triangle-backcurve",{points:t.triangle.points,controlPoint:[0,-0.15],roughCollide:r,draw:function(u,f,v,h,c){var d=n(this.points,f,v,h),g=this.controlPoint,y=a(g[0],g[1],f,v,h);e.arrowShapeImpl(this.name)(u,d,y)},gap:function(u){return s(u)*0.8}}),o("triangle-tee",{points:[0,0,0.15,-0.3,-0.15,-0.3,0,0],pointsTee:[-0.15,-0.4,-0.15,-0.5,0.15,-0.5,0.15,-0.4],collide:function(u,f,v,h,c,d,g){var y=i(n(this.points,v+2*g,h,c)),p=i(n(this.pointsTee,v+2*g,h,c)),m=Bt(u,f,y)||Bt(u,f,p);return m},draw:function(u,f,v,h,c){var d=n(this.points,f,v,h),g=n(this.pointsTee,f,v,h);e.arrowShapeImpl(this.name)(u,d,g)}}),o("circle-triangle",{radius:0.15,pointsTr:[0,-0.15,0.15,-0.45,-0.15,-0.45,0,-0.15],collide:function(u,f,v,h,c,d,g){var y=c,p=Math.pow(y.x-u,2)+Math.pow(y.y-f,2)<=Math.pow((v+2*g)*this.radius,2),m=i(n(this.points,v+2*g,h,c));return Bt(u,f,m)||p},draw:function(u,f,v,h,c){var d=n(this.pointsTr,f,v,h);e.arrowShapeImpl(this.name)(u,d,h.x,h.y,this.radius*f)},spacing:function(u){return e.getArrowWidth(u.pstyle("width").pfValue,u.pstyle("arrow-scale").value)*this.radius}}),o("triangle-cross",{points:[0,0,0.15,-0.3,-0.15,-0.3,0,0],baseCrossLinePts:[-0.15,-0.4,-0.15,-0.4,0.15,-0.4,0.15,-0.4],crossLinePts:function(u,f){var v=this.baseCrossLinePts.slice(),h=f/u,c=3,d=5;return v[c]=v[c]-h,v[d]=v[d]-h,v},collide:function(u,f,v,h,c,d,g){var y=i(n(this.points,v+2*g,h,c)),p=i(n(this.crossLinePts(v,d),v+2*g,h,c)),m=Bt(u,f,y)||Bt(u,f,p);return m},draw:function(u,f,v,h,c){var d=n(this.points,f,v,h),g=n(this.crossLinePts(f,c),f,v,h);e.arrowShapeImpl(this.name)(u,d,g)}}),o("vee",{points:[-0.15,-0.3,0,0,0.15,-0.3,0,-0.15],gap:function(u){return s(u)*0.525}}),o("circle",{radius:0.15,collide:function(u,f,v,h,c,d,g){var y=c,p=Math.pow(y.x-u,2)+Math.pow(y.y-f,2)<=Math.pow((v+2*g)*this.radius,2);return p},draw:function(u,f,v,h,c){e.arrowShapeImpl(this.name)(u,h.x,h.y,this.radius*f)},spacing:function(u){return e.getArrowWidth(u.pstyle("width").pfValue,u.pstyle("arrow-scale").value)*this.radius}}),o("tee",{points:[-0.15,0,-0.15,-0.1,0.15,-0.1,0.15,0],spacing:function(u){return 1},gap:function(u){return 1}}),o("square",{points:[-0.15,0,0.15,0,0.15,-0.3,-0.15,-0.3]}),o("diamond",{points:[-0.15,-0.15,0,-0.3,0.15,-0.15,0,0],gap:function(u){return u.pstyle("width").pfValue*u.pstyle("arrow-scale").value}}),o("chevron",{points:[0,0,-0.15,-0.15,-0.1,-0.2,0,-0.1,0.1,-0.2,0.15,-0.15],gap:function(u){return 0.95*u.pstyle("width").pfValue*u.pstyle("arrow-scale").value}})};var Xr={};Xr.projectIntoViewport=function(t,e){var r=this.cy,a=this.findContainerClientCoords(),n=a[0],i=a[1],s=a[4],o=r.pan(),l=r.zoom(),u=((t-n)/s-o.x)/l,f=((e-i)/s-o.y)/l;return[u,f]};Xr.findContainerClientCoords=function(){if(this.containerBB)return this.containerBB;var t=this.container,e=t.getBoundingClientRect(),r=this.cy.window().getComputedStyle(t),a=function(p){return parseFloat(r.getPropertyValue(p))},n={left:a("padding-left"),right:a("padding-right"),top:a("padding-top"),bottom:a("padding-bottom")},i={left:a("border-left-width"),right:a("border-right-width"),top:a("border-top-width"),bottom:a("border-bottom-width")},{clientWidth:s,clientHeight:o}=t,l=n.left+n.right,u=n.top+n.bottom,f=i.left+i.right,v=e.width/(s+f),h=s-l,c=o-u,d=e.left+n.left+i.left,g=e.top+n.top+i.top;return this.containerBB=[d,g,h,c,v]};Xr.invalidateContainerClientCoordsCache=function(){this.containerBB=null};Xr.findNearestElement=function(t,e,r,a){return this.findNearestElements(t,e,r,a)[0]};Xr.findNearestElements=function(t,e,r,a){var n=this,i=this,s=i.getCachedZSortedEles(),o=[],l=i.cy.zoom(),u=i.cy.hasCompoundNodes(),f=(a?24:8)/l,v=(a?8:2)/l,h=(a?8:2)/l,c=1/0,d,g;if(r)s=s.interactive;function y(S,P){if(S.isNode())if(g)return;else g=S,o.push(S);if(S.isEdge()&&(P==null||P<c))if(d){if(d.pstyle("z-compound-depth").value===S.pstyle("z-compound-depth").value&&d.pstyle("z-compound-depth").value===S.pstyle("z-compound-depth").value){for(var N=0;N<o.length;N++)if(o[N].isEdge()){o[N]=S,d=S,c=P!=null?P:c;break}}}else o.push(S),d=S,c=P!=null?P:c}function p(S){var P=S.outerWidth()+2*v,N=S.outerHeight()+2*v,R=P/2,I=N/2,w=S.position(),x=S.pstyle("corner-radius").value==="auto"?"auto":S.pstyle("corner-radius").pfValue,T=S._private.rscratch;if(w.x-R<=t&&t<=w.x+R&&w.y-I<=e&&e<=w.y+I){var D=i.nodeShapes[n.getNodeShape(S)];if(D.checkPoint(t,e,0,P,N,w.x,w.y,x,T))return y(S,0),!0}}function m(S){var P=S._private,N=P.rscratch,R=S.pstyle("width").pfValue,I=S.pstyle("arrow-scale").value,w=R/2+f,x=w*w,T=w*2,{source:B,target:z}=P,D;if(N.edgeType==="segments"||N.edgeType==="straight"||N.edgeType==="haystack"){var C=N.allpts;for(var O=0;O+3<C.length;O+=2)if(Uc(t,e,C[O],C[O+1],C[O+2],C[O+3],T)&&x>(D=Wc(t,e,C[O],C[O+1],C[O+2],C[O+3])))return y(S,D),!0}else if(N.edgeType==="bezier"||N.edgeType==="multibezier"||N.edgeType==="self"||N.edgeType==="compound"){var C=N.allpts;for(var O=0;O+5<N.allpts.length;O+=4)if(Hc(t,e,C[O],C[O+1],C[O+2],C[O+3],C[O+4],C[O+5],T)&&x>(D=Xc(t,e,C[O],C[O+1],C[O+2],C[O+3],C[O+4],C[O+5])))return y(S,D),!0}var B=B||P.source,z=z||P.target,V=n.getArrowWidth(R,I),k=[{name:"source",x:N.arrowStartX,y:N.arrowStartY,angle:N.srcArrowAngle},{name:"target",x:N.arrowEndX,y:N.arrowEndY,angle:N.tgtArrowAngle},{name:"mid-source",x:N.midX,y:N.midY,angle:N.midsrcArrowAngle},{name:"mid-target",x:N.midX,y:N.midY,angle:N.midtgtArrowAngle}];for(var O=0;O<k.length;O++){var G=k[O],J=i.arrowShapes[S.pstyle(G.name+"-arrow-shape").value],X=S.pstyle("width").pfValue;if(J.roughCollide(t,e,V,G.angle,{x:G.x,y:G.y},X,f)&&J.collide(t,e,V,G.angle,{x:G.x,y:G.y},X,f))return y(S),!0}if(u&&o.length>0)p(B),p(z)}function b(S,P,N){return Nt(S,P,N)}function E(S,P){var N=S._private,R=h,I;if(P)I=P+"-";else I="";S.boundingBox();var w=N.labelBounds[P||"main"],x=S.pstyle(I+"label").value,T=S.pstyle("text-events").strValue==="yes";if(!T||!x)return;var D=b(N.rscratch,"labelX",P),C=b(N.rscratch,"labelY",P),O=b(N.rscratch,"labelAngle",P),B=S.pstyle(I+"text-margin-x").pfValue,z=S.pstyle(I+"text-margin-y").pfValue,V=w.x1-R-B,k=w.x2+R-B,G=w.y1-R-z,J=w.y2+R-z;if(O){var X=Math.cos(O),_=Math.sin(O),Q=function(re,ee){return re=re-D,ee=ee-C,{x:re*X-ee*_+D,y:re*_+ee*X+C}},q=Q(V,G),te=Q(V,J),Z=Q(k,G),U=Q(k,J),W=[q.x+B,q.y+z,Z.x+B,Z.y+z,U.x+B,U.y+z,te.x+B,te.y+z];if(Bt(t,e,W))return y(S),!0}else if(mr(w,t,e))return y(S),!0}for(var A=s.length-1;A>=0;A--){var M=s[A];if(M.isNode())p(M)||E(M);else m(M)||E(M)||E(M,"source")||E(M,"target")}return o};Xr.getAllInBox=function(t,e,r,a){var n=this.getCachedZSortedEles().interactive,i=this.cy.zoom(),s=2/i,o=[],l=Math.min(t,r),u=Math.max(t,r),f=Math.min(e,a),v=Math.max(e,a);t=l,r=u,e=f,a=v;var h=Ot({x1:t,y1:e,x2:r,y2:a}),c=[{x:h.x1,y:h.y1},{x:h.x2,y:h.y1},{x:h.x2,y:h.y2},{x:h.x1,y:h.y2}],d=[[c[0],c[1]],[c[1],c[2]],[c[2],c[3]],[c[3],c[0]]];function g(re,ee,de){return Nt(re,ee,de)}function y(re,ee){var de=re._private,Ae=s,Ce="";re.boundingBox();var Se=de.labelBounds.main;if(!Se)return null;var ge=g(de.rscratch,"labelX",ee),ve=g(de.rscratch,"labelY",ee),ye=g(de.rscratch,"labelAngle",ee),Ee=re.pstyle(Ce+"text-margin-x").pfValue,Pe=re.pstyle(Ce+"text-margin-y").pfValue,Me=Se.x1-Ae-Ee,Ne=Se.x2+Ae-Ee,Fe=Se.y1-Ae-Pe,ze=Se.y2+Ae-Pe;if(ye){var Ue=Math.cos(ye),ie=Math.sin(ye),L=function(Y,H){return Y=Y-ge,H=H-ve,{x:Y*Ue-H*ie+ge,y:Y*ie+H*Ue+ve}};return[L(Me,Fe),L(Ne,Fe),L(Ne,ze),L(Me,ze)]}else return[{x:Me,y:Fe},{x:Ne,y:Fe},{x:Ne,y:ze},{x:Me,y:ze}]}function p(re,ee,de,Ae){function Ce(Se,ge,ve){return(ve.y-Se.y)*(ge.x-Se.x)>(ge.y-Se.y)*(ve.x-Se.x)}return Ce(re,de,Ae)!==Ce(ee,de,Ae)&&Ce(re,ee,de)!==Ce(re,ee,Ae)}for(var m=0;m<n.length;m++){var b=n[m];if(b.isNode()){var E=b,A=E.pstyle("text-events").strValue==="yes",M=E.pstyle("box-selection").strValue,S=E.pstyle("box-select-labels").strValue==="yes";if(M==="none")continue;var P=(M==="overlap"||S)&&A,N=E.boundingBox({includeNodes:!0,includeEdges:!1,includeLabels:P});if(M==="contain"){var R=!1;if(S&&A){var I=y(E);if(I&&Oi(I,c))o.push(E),R=!0}if(!R&&Ff(h,N))o.push(E)}else if(M==="overlap"){if(wo(h,N)){var w=E.boundingBox({includeNodes:!0,includeEdges:!0,includeLabels:!1,includeMainLabels:!1,includeSourceLabels:!1,includeTargetLabels:!1}),x=[{x:w.x1,y:w.y1},{x:w.x2,y:w.y1},{x:w.x2,y:w.y2},{x:w.x1,y:w.y2}];if(Oi(x,c))o.push(E);else{var T=y(E);if(T&&Oi(T,c))o.push(E)}}}}else{var D=b,C=D._private,O=C.rscratch,B=D.pstyle("box-selection").strValue;if(B==="none")continue;if(B==="contain"){if(O.startX!=null&&O.startY!=null&&!mr(h,O.startX,O.startY))continue;if(O.endX!=null&&O.endY!=null&&!mr(h,O.endX,O.endY))continue;if(O.edgeType==="bezier"||O.edgeType==="multibezier"||O.edgeType==="self"||O.edgeType==="compound"||O.edgeType==="segments"||O.edgeType==="haystack"){var z=C.rstyle.bezierPts||C.rstyle.linePts||C.rstyle.haystackPts,V=!0;for(var k=0;k<z.length;k++)if(!uu(h,z[k])){V=!1;break}if(V)o.push(D)}else if(O.edgeType==="straight")o.push(D)}else if(B==="overlap"){var G=!1;if(O.startX!=null&&O.startY!=null&&O.endX!=null&&O.endY!=null&&(mr(h,O.startX,O.startY)||mr(h,O.endX,O.endY)))o.push(D),G=!0;else if(!G&&O.edgeType==="haystack"){var J=C.rstyle.haystackPts;for(var X=0;X<J.length;X++)if(uu(h,J[X])){o.push(D),G=!0;break}}if(!G){var _=C.rstyle.bezierPts||C.rstyle.linePts||C.rstyle.haystackPts;if((!_||_.length<2)&&O.edgeType==="straight"){if(O.startX!=null&&O.startY!=null&&O.endX!=null&&O.endY!=null)_=[{x:O.startX,y:O.startY},{x:O.endX,y:O.endY}]}if(!_||_.length<2)continue;for(var Q=0;Q<_.length-1;Q++){var q=_[Q],te=_[Q+1];for(var Z=0;Z<d.length;Z++){var U=ct(d[Z],2),W=U[0],j=U[1];if(p(q,te,W,j)){o.push(D),G=!0;break}}if(G)break}}}}}return o};var Xn={};Xn.calculateArrowAngles=function(t){var e=t._private.rscratch,r=e.edgeType==="haystack",a=e.edgeType==="bezier",n=e.edgeType==="multibezier",i=e.edgeType==="segments",s=e.edgeType==="compound",o=e.edgeType==="self",l,u,f,v,h,c,p,m;if(r)f=e.haystackPts[0],v=e.haystackPts[1],h=e.haystackPts[2],c=e.haystackPts[3];else f=e.arrowStartX,v=e.arrowStartY,h=e.arrowEndX,c=e.arrowEndY;if(p=e.midX,m=e.midY,i)l=f-e.segpts[0],u=v-e.segpts[1];else if(n||s||o||a){var d=e.allpts,g=bt(d[0],d[2],d[4],0.1),y=bt(d[1],d[3],d[5],0.1);l=f-g,u=v-y}else l=f-p,u=v-m;e.srcArrowAngle=cn(l,u);var{midX:p,midY:m}=e;if(r)p=(f+h)/2,m=(v+c)/2;if(l=h-f,u=c-v,i){var d=e.allpts;if(d.length/2%2===0){var b=d.length/2,E=b-2;l=d[b]-d[E],u=d[b+1]-d[E+1]}else if(e.isRound)l=e.midVector[1],u=-e.midVector[0];else{var b=d.length/2-1,E=b-2;l=d[b]-d[E],u=d[b+1]-d[E+1]}}else if(n||s||o){var{allpts:d,ctrlpts:A}=e,M,S,P,N;if(A.length/2%2===0){var R=d.length/2-1,I=R+2,w=I+2;M=bt(d[R],d[I],d[w],0),S=bt(d[R+1],d[I+1],d[w+1],0),P=bt(d[R],d[I],d[w],0.0001),N=bt(d[R+1],d[I+1],d[w+1],0.0001)}else{var I=d.length/2-1,R=I-2,w=I+2;M=bt(d[R],d[I],d[w],0.4999),S=bt(d[R+1],d[I+1],d[w+1],0.4999),P=bt(d[R],d[I],d[w],0.5),N=bt(d[R+1],d[I+1],d[w+1],0.5)}l=P-M,u=N-S}if(e.midtgtArrowAngle=cn(l,u),e.midDispX=l,e.midDispY=u,l*=-1,u*=-1,i){var d=e.allpts;if(d.length/2%2===0);else if(!e.isRound){var b=d.length/2-1,x=b+2;l=-(d[x]-d[b]),u=-(d[x+1]-d[b+1])}}if(e.midsrcArrowAngle=cn(l,u),i)l=h-e.segpts[e.segpts.length-2],u=c-e.segpts[e.segpts.length-1];else if(n||s||o||a){var d=e.allpts,T=d.length,g=bt(d[T-6],d[T-4],d[T-2],0.9),y=bt(d[T-5],d[T-3],d[T-1],0.9);l=h-g,u=c-y}else l=h-p,u=c-m;e.tgtArrowAngle=cn(l,u)};Xn.getArrowWidth=Xn.getArrowHeight=function(t,e){var r=this.arrowWidthCache=this.arrowWidthCache||{},a=r[t+", "+e];if(a)return a;return a=Math.max(Math.pow(t*13.37,0.9),29)*e,r[t+", "+e]=a,a};var to,ro,_t={},Gt={},Yl,Xl,zr,Nn,ar,Or,kr,Kt,Jr,En,Pv,Nv,ao,no,Wl,$l=function(e,r,a){a.x=r.x-e.x,a.y=r.y-e.y,a.len=Math.sqrt(a.x*a.x+a.y*a.y),a.nx=a.x/a.len,a.ny=a.y/a.len,a.ang=Math.atan2(a.ny,a.nx)},ly=function(e,r){r.x=e.x*-1,r.y=e.y*-1,r.nx=e.nx*-1,r.ny=e.ny*-1,r.ang=e.ang>0?-(Math.PI-e.ang):Math.PI+e.ang},fy=function(e,r,a,n,i){if(e!==Wl?$l(r,e,_t):ly(Gt,_t),$l(r,a,Gt),Yl=_t.nx*Gt.ny-_t.ny*Gt.nx,Xl=_t.nx*Gt.nx-_t.ny*-Gt.ny,ar=Math.asin(Math.max(-1,Math.min(1,Yl))),Math.abs(ar)<0.000001){to=r.x,ro=r.y,kr=Jr=0;return}if(zr=1,Nn=!1,Xl<0)if(ar<0)ar=Math.PI+ar;else ar=Math.PI-ar,zr=-1,Nn=!0;else if(ar>0)zr=-1,Nn=!0;if(r.radius!==void 0)Jr=r.radius;else Jr=n;if(Or=ar/2,En=Math.min(_t.len/2,Gt.len/2),i)if(Kt=Math.abs(Math.cos(Or)*Jr/Math.sin(Or)),Kt>En)Kt=En,kr=Math.abs(Kt*Math.sin(Or)/Math.cos(Or));else kr=Jr;else Kt=Math.min(En,Jr),kr=Math.abs(Kt*Math.sin(Or)/Math.cos(Or));ao=r.x+Gt.nx*Kt,no=r.y+Gt.ny*Kt,to=ao-Gt.ny*kr*zr,ro=no+Gt.nx*kr*zr,Pv=r.x+_t.nx*Kt,Nv=r.y+_t.ny*Kt,Wl=r};function Ov(t,e){if(e.radius===0)t.lineTo(e.cx,e.cy);else t.arc(e.cx,e.cy,e.radius,e.startAngle,e.endAngle,e.counterClockwise)}function No(t,e,r,a){var n=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;if(a===0||e.radius===0)return{cx:e.x,cy:e.y,radius:0,startX:e.x,startY:e.y,stopX:e.x,stopY:e.y,startAngle:void 0,endAngle:void 0,counterClockwise:void 0};return fy(t,e,r,a,n),{cx:to,cy:ro,radius:kr,startX:Pv,startY:Nv,stopX:ao,stopY:no,startAngle:_t.ang+Math.PI/2*zr,endAngle:Gt.ang-Math.PI/2*zr,counterClockwise:Nn}}var $a=0.01,vy=Math.sqrt(2*$a),Lt={};Lt.findMidptPtsEtc=function(t,e){var{posPts:r,intersectionPts:a,vectorNormInverse:n}=e,i,s=t.pstyle("source-endpoint"),o=t.pstyle("target-endpoint"),l=s.units!=null&&o.units!=null,u=function(A,M,S,P){var N=P-M,R=S-A,I=Math.sqrt(R*R+N*N);return{x:-N/I,y:R/I}},f=t.pstyle("edge-distances").value;switch(f){case"node-position":i=r;break;case"intersection":i=a;break;case"endpoints":{if(l){var v=this.manualEndptToPx(t.source()[0],s),h=ct(v,2),c=h[0],d=h[1],g=this.manualEndptToPx(t.target()[0],o),y=ct(g,2),p=y[0],m=y[1],b={x1:c,y1:d,x2:p,y2:m};n=u(c,d,p,m),i=b}else _e("Edge ".concat(t.id()," has edge-distances:endpoints specified without manual endpoints specified via source-endpoint and target-endpoint. Falling back on edge-distances:intersection (default).")),i=a;break}}return{midptPts:i,vectorNormInverse:n}};Lt.findHaystackPoints=function(t){for(var e=0;e<t.length;e++){var r=t[e],a=r._private,n=a.rscratch;if(!n.haystack){var i=Math.random()*2*Math.PI;n.source={x:Math.cos(i),y:Math.sin(i)},i=Math.random()*2*Math.PI,n.target={x:Math.cos(i),y:Math.sin(i)}}var{source:s,target:o}=a,l=s.position(),u=o.position(),f=s.width(),v=o.width(),h=s.height(),c=o.height(),d=r.pstyle("haystack-radius").value,g=d/2;n.haystackPts=n.allpts=[n.source.x*f*g+l.x,n.source.y*h*g+l.y,n.target.x*v*g+u.x,n.target.y*c*g+u.y],n.midX=(n.allpts[0]+n.allpts[2])/2,n.midY=(n.allpts[1]+n.allpts[3])/2,n.edgeType="haystack",n.haystack=!0,this.storeEdgeProjections(r),this.calculateArrowAngles(r),this.recalculateEdgeLabelProjections(r),this.calculateLabelAngles(r)}};Lt.findSegmentsPoints=function(t,e){var r=t._private.rscratch,a=t.pstyle("segment-weights"),n=t.pstyle("segment-distances"),i=t.pstyle("segment-radii"),s=t.pstyle("radius-type"),o=Math.min(a.pfValue.length,n.pfValue.length),l=i.pfValue[i.pfValue.length-1],u=s.pfValue[s.pfValue.length-1];r.edgeType="segments",r.segpts=[],r.radii=[],r.isArcRadius=[];for(var f=0;f<o;f++){var v=a.pfValue[f],h=n.pfValue[f],c=1-v,d=v,g=this.findMidptPtsEtc(t,e),{midptPts:y,vectorNormInverse:p}=g,m={x:y.x1*c+y.x2*d,y:y.y1*c+y.y2*d};r.segpts.push(m.x+p.x*h,m.y+p.y*h),r.radii.push(i.pfValue[f]!==void 0?i.pfValue[f]:l),r.isArcRadius.push((s.pfValue[f]!==void 0?s.pfValue[f]:u)==="arc-radius")}};Lt.findLoopPoints=function(t,e,r,a){var n=t._private.rscratch,{dirCounts:i,srcPos:s}=e,o=t.pstyle("control-point-distances"),l=o?o.pfValue[0]:void 0,u=t.pstyle("loop-direction").pfValue,f=t.pstyle("loop-sweep").pfValue,v=t.pstyle("control-point-step-size").pfValue;n.edgeType="self";var h=r,c=v;if(a)h=0,c=l;var d=u-Math.PI/2,g=d-f/2,y=d+f/2,p=String(u+"_"+f);h=i[p]===void 0?i[p]=0:++i[p],n.ctrlpts=[s.x+Math.cos(g)*1.4*c*(h/3+1),s.y+Math.sin(g)*1.4*c*(h/3+1),s.x+Math.cos(y)*1.4*c*(h/3+1),s.y+Math.sin(y)*1.4*c*(h/3+1)]};Lt.findCompoundLoopPoints=function(t,e,r,a){var n=t._private.rscratch;n.edgeType="compound";var{srcPos:i,tgtPos:s,srcW:o,srcH:l,tgtW:u,tgtH:f}=e,v=t.pstyle("control-point-step-size").pfValue,h=t.pstyle("control-point-distances"),c=h?h.pfValue[0]:void 0,d=r,g=v;if(a)d=0,g=c;var y=50,p={x:i.x-o/2,y:i.y-l/2},m={x:s.x-u/2,y:s.y-f/2},b={x:Math.min(p.x,m.x),y:Math.min(p.y,m.y)},E=0.5,A=Math.max(E,Math.log(o*$a)),M=Math.max(E,Math.log(u*$a));n.ctrlpts=[b.x,b.y-(1+Math.pow(y,1.12)/100)*g*(d/3+1)*A,b.x-(1+Math.pow(y,1.12)/100)*g*(d/3+1)*M,b.y]};Lt.findStraightEdgePoints=function(t){t._private.rscratch.edgeType="straight"};Lt.findBezierPoints=function(t,e,r,a,n){var i=t._private.rscratch,s=t.pstyle("control-point-step-size").pfValue,o=t.pstyle("control-point-distances"),l=t.pstyle("control-point-weights"),u=o&&l?Math.min(o.value.length,l.value.length):1,f=o?o.pfValue[0]:void 0,v=l.value[0],h=a;i.edgeType=h?"multibezier":"bezier",i.ctrlpts=[];for(var c=0;c<u;c++){var d=(0.5-e.eles.length/2+r)*s*(n?-1:1),g=void 0,y=bo(d);if(h)f=o?o.pfValue[c]:s,v=l.value[c];if(a)g=f;else g=f!==void 0?y*f:void 0;var p=g!==void 0?g:d,m=1-v,b=v,E=this.findMidptPtsEtc(t,e),{midptPts:A,vectorNormInverse:M}=E,S={x:A.x1*m+A.x2*b,y:A.y1*m+A.y2*b};i.ctrlpts.push(S.x+M.x*p,S.y+M.y*p)}};Lt.findTaxiPoints=function(t,e){var r=t._private.rscratch;r.edgeType="segments";var a="vertical",n="horizontal",i="leftward",s="rightward",o="downward",l="upward",u="auto",{posPts:f,srcW:v,srcH:h,tgtW:c,tgtH:d}=e,g=t.pstyle("edge-distances").value,y=g!=="node-position",p=t.pstyle("taxi-direction").value,m=p,b=t.pstyle("taxi-turn"),E=b.units==="%",A=b.pfValue,M=A<0,S=t.pstyle("taxi-turn-min-distance").pfValue,P=y?(v+c)/2:0,N=y?(h+d)/2:0,R=f.x2-f.x1,I=f.y2-f.y1,w=function(H,K){if(H>0)return Math.max(H-K,0);else return Math.min(H+K,0)},x=w(R,P),T=w(I,N),D=!1;if(m===u)p=Math.abs(x)>Math.abs(T)?n:a;else if(m===l||m===o)p=a,D=!0;else if(m===i||m===s)p=n,D=!0;var C=p===a,O=C?T:x,B=C?I:R,z=bo(B),V=!1;if(!(D&&(E||M))&&(m===o&&B<0||m===l&&B>0||m===i&&B>0||m===s&&B<0))z*=-1,O=z*Math.abs(O),V=!0;var k;if(E){var G=A<0?1+A:A;k=G*O}else{var J=A<0?O:0;k=J+A*z}var X=function(H){return Math.abs(H)<S||Math.abs(H)>=Math.abs(O)},_=X(k),Q=X(Math.abs(O)-Math.abs(k)),q=_||Q;if(q&&!V)if(C){var te=Math.abs(B)<=h/2,Z=Math.abs(R)<=c/2;if(te){var U=(f.x1+f.x2)/2,{y1:W,y2:j}=f;r.segpts=[U,W,U,j]}else if(Z){var re=(f.y1+f.y2)/2,{x1:ee,x2:de}=f;r.segpts=[ee,re,de,re]}else r.segpts=[f.x1,f.y2]}else{var Ae=Math.abs(B)<=v/2,Ce=Math.abs(I)<=d/2;if(Ae){var Se=(f.y1+f.y2)/2,{x1:ge,x2:ve}=f;r.segpts=[ge,Se,ve,Se]}else if(Ce){var ye=(f.x1+f.x2)/2,{y1:Ee,y2:Pe}=f;r.segpts=[ye,Ee,ye,Pe]}else r.segpts=[f.x2,f.y1]}else if(C){var Me=f.y1+k+(y?h/2*z:0),{x1:Ne,x2:Fe}=f;r.segpts=[Ne,Me,Fe,Me]}else{var ze=f.x1+k+(y?v/2*z:0),{y1:Ue,y2:ie}=f;r.segpts=[ze,Ue,ze,ie]}if(r.isRound){var L=t.pstyle("taxi-radius").value,F=t.pstyle("radius-type").value[0]==="arc-radius";r.radii=Array(r.segpts.length/2).fill(L),r.isArcRadius=Array(r.segpts.length/2).fill(F)}};Lt.tryToCorrectInvalidPoints=function(t,e){var r=t._private.rscratch;if(r.edgeType==="bezier"){var{srcPos:a,tgtPos:n,srcW:i,srcH:s,tgtW:o,tgtH:l,srcShape:u,tgtShape:f,srcCornerRadius:v,tgtCornerRadius:h,srcRs:c,tgtRs:d}=e,g=!he(r.startX)||!he(r.startY),y=!he(r.arrowStartX)||!he(r.arrowStartY),p=!he(r.endX)||!he(r.endY),m=!he(r.arrowEndX)||!he(r.arrowEndY),b=3,E=this.getArrowWidth(t.pstyle("width").pfValue,t.pstyle("arrow-scale").value)*this.arrowShapeWidth,A=b*E,M=Ur({x:r.ctrlpts[0],y:r.ctrlpts[1]},{x:r.startX,y:r.startY}),S=M<A,P=Ur({x:r.ctrlpts[0],y:r.ctrlpts[1]},{x:r.endX,y:r.endY}),N=P<A,R=!1;if(g||y||S){R=!0;var I={x:r.ctrlpts[0]-a.x,y:r.ctrlpts[1]-a.y},w=Math.sqrt(I.x*I.x+I.y*I.y),x={x:I.x/w,y:I.y/w},T=Math.max(i,s),D={x:r.ctrlpts[0]+x.x*2*T,y:r.ctrlpts[1]+x.y*2*T},C=u.intersectLine(a.x,a.y,i,s,D.x,D.y,0,v,c);if(S)r.ctrlpts[0]=r.ctrlpts[0]+x.x*(A-M),r.ctrlpts[1]=r.ctrlpts[1]+x.y*(A-M);else r.ctrlpts[0]=C[0]+x.x*A,r.ctrlpts[1]=C[1]+x.y*A}if(p||m||N){R=!0;var O={x:r.ctrlpts[0]-n.x,y:r.ctrlpts[1]-n.y},B=Math.sqrt(O.x*O.x+O.y*O.y),z={x:O.x/B,y:O.y/B},V=Math.max(i,s),k={x:r.ctrlpts[0]+z.x*2*V,y:r.ctrlpts[1]+z.y*2*V},G=f.intersectLine(n.x,n.y,o,l,k.x,k.y,0,h,d);if(N)r.ctrlpts[0]=r.ctrlpts[0]+z.x*(A-P),r.ctrlpts[1]=r.ctrlpts[1]+z.y*(A-P);else r.ctrlpts[0]=G[0]+z.x*A,r.ctrlpts[1]=G[1]+z.y*A}if(R)this.findEndpoints(t)}};Lt.storeAllpts=function(t){var e=t._private.rscratch;if(e.edgeType==="multibezier"||e.edgeType==="bezier"||e.edgeType==="self"||e.edgeType==="compound"){e.allpts=[],e.allpts.push(e.startX,e.startY);for(var r=0;r+1<e.ctrlpts.length;r+=2)if(e.allpts.push(e.ctrlpts[r],e.ctrlpts[r+1]),r+3<e.ctrlpts.length)e.allpts.push((e.ctrlpts[r]+e.ctrlpts[r+2])/2,(e.ctrlpts[r+1]+e.ctrlpts[r+3])/2);e.allpts.push(e.endX,e.endY);var a,n;if(e.ctrlpts.length/2%2===0)a=e.allpts.length/2-1,e.midX=e.allpts[a],e.midY=e.allpts[a+1];else a=e.allpts.length/2-3,n=0.5,e.midX=bt(e.allpts[a],e.allpts[a+2],e.allpts[a+4],n),e.midY=bt(e.allpts[a+1],e.allpts[a+3],e.allpts[a+5],n)}else if(e.edgeType==="straight")e.allpts=[e.startX,e.startY,e.endX,e.endY],e.midX=(e.startX+e.endX+e.arrowStartX+e.arrowEndX)/4,e.midY=(e.startY+e.endY+e.arrowStartY+e.arrowEndY)/4;else if(e.edgeType==="segments"){if(e.allpts=[],e.allpts.push(e.startX,e.startY),e.allpts.push.apply(e.allpts,e.segpts),e.allpts.push(e.endX,e.endY),e.isRound){e.roundCorners=[];for(var i=2;i+3<e.allpts.length;i+=2){var s=e.radii[i/2-1],o=e.isArcRadius[i/2-1];e.roundCorners.push(No({x:e.allpts[i-2],y:e.allpts[i-1]},{x:e.allpts[i],y:e.allpts[i+1],radius:s},{x:e.allpts[i+2],y:e.allpts[i+3]},s,o))}}if(e.segpts.length%4===0){var l=e.segpts.length/2,u=l-2;e.midX=(e.segpts[u]+e.segpts[l])/2,e.midY=(e.segpts[u+1]+e.segpts[l+1])/2}else{var f=e.segpts.length/2-1;if(!e.isRound)e.midX=e.segpts[f],e.midY=e.segpts[f+1];else{var v={x:e.segpts[f],y:e.segpts[f+1]},h=e.roundCorners[f/2];if(h.radius===0){var c={x:e.segpts[f+2],y:e.segpts[f+3]};e.midX=v.x,e.midY=v.y,e.midVector=[v.y-c.y,c.x-v.x]}else{var d=[v.x-h.cx,v.y-h.cy],g=h.radius/Math.sqrt(Math.pow(d[0],2)+Math.pow(d[1],2));d=d.map(function(y){return y*g}),e.midX=h.cx+d[0],e.midY=h.cy+d[1],e.midVector=d}}}}};Lt.checkForInvalidEdgeWarning=function(t){var e=t[0]._private.rscratch;if(e.nodesOverlap||he(e.startX)&&he(e.startY)&&he(e.endX)&&he(e.endY))e.loggedErr=!1;else if(!e.loggedErr)e.loggedErr=!0,_e("Edge `"+t.id()+"` has invalid endpoints and so it is impossible to draw. Adjust your edge style (e.g. control points) accordingly or use an alternative edge type. This is expected behaviour when the source node and the target node overlap.")};Lt.findEdgeControlPoints=function(t){var e=this;if(!t||t.length===0)return;var r=this,a=r.cy,n=a.hasCompoundNodes(),i=new nr,s=function(N,R){return[].concat(Bn(N),[R?1:0]).join("-")},o=[],l=[];for(var u=0;u<t.length;u++){var f=t[u],v=f._private,h=f.pstyle("curve-style").value;if(f.removed()||!f.takesUpSpace())continue;if(h==="haystack"){l.push(f);continue}var c=h==="unbundled-bezier"||yr(h,"segments")||h==="straight"||h==="straight-triangle"||yr(h,"taxi"),d=h==="unbundled-bezier"||h==="bezier",{source:g,target:y}=v,p=g.poolIndex(),m=y.poolIndex(),b=[p,m].sort(),E=s(b,c),A=i.get(E);if(A==null)A={eles:[]},o.push({pairId:b,edgeIsUnbundled:c}),i.set(E,A);if(A.eles.push(f),c)A.hasUnbundled=!0;if(d)A.hasBezier=!0}var M=function(){var N=o[S],{pairId:R,edgeIsUnbundled:I}=N,w=s(R,I),x=i.get(w),T;if(!x.hasUnbundled){var D=x.eles[0].parallelEdges().filter(function(F){return F.isBundledBezier()});yo(x.eles),D.forEach(function(F){return x.eles.push(F)}),x.eles.sort(function(F,Y){return F.poolIndex()-Y.poolIndex()})}var C=x.eles[0],O=C.source(),B=C.target();if(O.poolIndex()>B.poolIndex()){var z=O;O=B,B=z}var V=x.srcPos=O.position(),k=x.tgtPos=B.position(),G=x.srcW=O.outerWidth(),J=x.srcH=O.outerHeight(),X=x.tgtW=B.outerWidth(),_=x.tgtH=B.outerHeight(),Q=x.srcShape=r.nodeShapes[e.getNodeShape(O)],q=x.tgtShape=r.nodeShapes[e.getNodeShape(B)],te=x.srcCornerRadius=O.pstyle("corner-radius").value==="auto"?"auto":O.pstyle("corner-radius").pfValue,Z=x.tgtCornerRadius=B.pstyle("corner-radius").value==="auto"?"auto":B.pstyle("corner-radius").pfValue,U=x.tgtRs=B._private.rscratch,W=x.srcRs=O._private.rscratch;x.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var j=0;j<x.eles.length;j++){var re=x.eles[j],ee=re[0]._private.rscratch,de=re.pstyle("curve-style").value,Ae=de==="unbundled-bezier"||yr(de,"segments")||yr(de,"taxi"),Ce=!O.same(re.source());if(!x.calculatedIntersection&&O!==B&&(x.hasBezier||x.hasUnbundled)){x.calculatedIntersection=!0;var Se=Q.intersectLine(V.x,V.y,G,J,k.x,k.y,0,te,W),ge=x.srcIntn=Se,ve=q.intersectLine(k.x,k.y,X,_,V.x,V.y,0,Z,U),ye=x.tgtIntn=ve,Ee=x.intersectionPts={x1:Se[0],x2:ve[0],y1:Se[1],y2:ve[1]},Pe=x.posPts={x1:V.x,x2:k.x,y1:V.y,y2:k.y},Me=ve[1]-Se[1],Ne=ve[0]-Se[0],Fe=Math.sqrt(Ne*Ne+Me*Me);if(he(Fe)&&Fe>=vy);else Fe=Math.sqrt(Math.max(Ne*Ne,$a)+Math.max(Me*Me,$a));var ze=x.vector={x:Ne,y:Me},Ue=x.vectorNorm={x:ze.x/Fe,y:ze.y/Fe},ie={x:-Ue.y,y:Ue.x};x.nodesOverlap=!he(Fe)||q.checkPoint(Se[0],Se[1],0,X,_,k.x,k.y,Z,U)||Q.checkPoint(ve[0],ve[1],0,G,J,V.x,V.y,te,W),x.vectorNormInverse=ie,T={nodesOverlap:x.nodesOverlap,dirCounts:x.dirCounts,calculatedIntersection:!0,hasBezier:x.hasBezier,hasUnbundled:x.hasUnbundled,eles:x.eles,srcPos:k,srcRs:U,tgtPos:V,tgtRs:W,srcW:X,srcH:_,tgtW:G,tgtH:J,srcIntn:ye,tgtIntn:ge,srcShape:q,tgtShape:Q,posPts:{x1:Pe.x2,y1:Pe.y2,x2:Pe.x1,y2:Pe.y1},intersectionPts:{x1:Ee.x2,y1:Ee.y2,x2:Ee.x1,y2:Ee.y1},vector:{x:-ze.x,y:-ze.y},vectorNorm:{x:-Ue.x,y:-Ue.y},vectorNormInverse:{x:-ie.x,y:-ie.y}}}var L=Ce?T:x;if(ee.nodesOverlap=L.nodesOverlap,ee.srcIntn=L.srcIntn,ee.tgtIntn=L.tgtIntn,ee.isRound=de.startsWith("round"),n&&(O.isParent()||O.isChild()||B.isParent()||B.isChild())&&(O.parents().anySame(B)||B.parents().anySame(O)||O.same(B)&&O.isParent()))e.findCompoundLoopPoints(re,L,j,Ae);else if(O===B)e.findLoopPoints(re,L,j,Ae);else if(de.endsWith("segments"))e.findSegmentsPoints(re,L);else if(de.endsWith("taxi"))e.findTaxiPoints(re,L);else if(de==="straight"||!Ae&&x.eles.length%2===1&&j===Math.floor(x.eles.length/2))e.findStraightEdgePoints(re);else e.findBezierPoints(re,L,j,Ae,Ce);e.findEndpoints(re),e.tryToCorrectInvalidPoints(re,L),e.checkForInvalidEdgeWarning(re),e.storeAllpts(re),e.storeEdgeProjections(re),e.calculateArrowAngles(re),e.recalculateEdgeLabelProjections(re),e.calculateLabelAngles(re)}};for(var S=0;S<o.length;S++)M();this.findHaystackPoints(l)};function Iv(t){var e=[];if(t==null)return;for(var r=0;r<t.length;r+=2){var a=t[r],n=t[r+1];e.push({x:a,y:n})}return e}Lt.getSegmentPoints=function(t){var e=t[0]._private.rscratch;this.recalculateRenderedStyle(t);var r=e.edgeType;if(r==="segments")return Iv(e.segpts)};Lt.getControlPoints=function(t){var e=t[0]._private.rscratch;this.recalculateRenderedStyle(t);var r=e.edgeType;if(r==="bezier"||r==="multibezier"||r==="self"||r==="compound")return Iv(e.ctrlpts)};Lt.getEdgeMidpoint=function(t){var e=t[0]._private.rscratch;return this.recalculateRenderedStyle(t),{x:e.midX,y:e.midY}};var an={};an.manualEndptToPx=function(t,e){var r=this,a=t.position(),n=t.outerWidth(),i=t.outerHeight(),s=t._private.rscratch;if(e.value.length===2){var o=[e.pfValue[0],e.pfValue[1]];if(e.units[0]==="%")o[0]=o[0]*n;if(e.units[1]==="%")o[1]=o[1]*i;return o[0]+=a.x,o[1]+=a.y,o}else{var l=e.pfValue[0];l=-Math.PI/2+l;var u=2*Math.max(n,i),f=[a.x+Math.cos(l)*u,a.y+Math.sin(l)*u];return r.nodeShapes[this.getNodeShape(t)].intersectLine(a.x,a.y,n,i,f[0],f[1],0,t.pstyle("corner-radius").value==="auto"?"auto":t.pstyle("corner-radius").pfValue,s)}};an.findEndpoints=function(t){var e,r,a,n,i=this,s,o=t.source()[0],l=t.target()[0],u=o.position(),f=l.position(),v=t.pstyle("target-arrow-shape").value,h=t.pstyle("source-arrow-shape").value,c=t.pstyle("target-distance-from-node").pfValue,d=t.pstyle("source-distance-from-node").pfValue,g=o._private.rscratch,y=l._private.rscratch,p=t.pstyle("curve-style").value,m=t._private.rscratch,b=m.edgeType,E=yr(p,"taxi"),A=b==="self"||b==="compound",M=b==="bezier"||b==="multibezier"||A,S=b!=="bezier",P=b==="straight"||b==="segments",N=b==="segments",R=M||S||P,I=A||E,w=t.pstyle("source-endpoint"),x=I?"outside-to-node":w.value,T=o.pstyle("corner-radius").value==="auto"?"auto":o.pstyle("corner-radius").pfValue,D=t.pstyle("target-endpoint"),C=I?"outside-to-node":D.value,O=l.pstyle("corner-radius").value==="auto"?"auto":l.pstyle("corner-radius").pfValue;m.srcManEndpt=w,m.tgtManEndpt=D;var B,z,V,k,G=(e=(D===null||D===void 0||(r=D.pfValue)===null||r===void 0?void 0:r.length)===2?D.pfValue:null)!==null&&e!==void 0?e:[0,0],J=(a=(w===null||w===void 0||(n=w.pfValue)===null||n===void 0?void 0:n.length)===2?w.pfValue:null)!==null&&a!==void 0?a:[0,0];if(M){var X=[m.ctrlpts[0],m.ctrlpts[1]],_=S?[m.ctrlpts[m.ctrlpts.length-2],m.ctrlpts[m.ctrlpts.length-1]]:X;B=_,z=X}else if(P){var Q=!N?[f.x+G[0],f.y+G[1]]:m.segpts.slice(0,2),q=!N?[u.x+J[0],u.y+J[1]]:m.segpts.slice(m.segpts.length-2);B=q,z=Q}if(C==="inside-to-node")s=[f.x,f.y];else if(D.units)s=this.manualEndptToPx(l,D);else if(C==="outside-to-line")s=m.tgtIntn;else{if(C==="outside-to-node"||C==="outside-to-node-or-label")V=B;else if(C==="outside-to-line"||C==="outside-to-line-or-label")V=[u.x,u.y];if(s=i.nodeShapes[this.getNodeShape(l)].intersectLine(f.x,f.y,l.outerWidth(),l.outerHeight(),V[0],V[1],0,O,y),C==="outside-to-node-or-label"||C==="outside-to-line-or-label"){var te=l._private.rscratch,{labelWidth:Z,labelHeight:U,labelX:W,labelY:j}=te,re=Z/2,ee=U/2,de=l.pstyle("text-valign").value;if(de=ca(de),de==="top")j-=ee;else if(de==="bottom")j+=ee;var Ae=l.pstyle("text-halign").value;if(Ae=ha(Ae),Ae==="left")W-=re;else if(Ae==="right")W+=re;var Ce=Ha(V[0],V[1],[W-re,j-ee,W+re,j-ee,W+re,j+ee,W-re,j+ee],f.x,f.y);if(Ce.length>0){var Se=u,ge=Br(Se,ra(s)),ve=Br(Se,ra(Ce)),ye=ge;if(ve<ge)s=Ce,ye=ve;if(Ce.length>2){var Ee=Br(Se,{x:Ce[2],y:Ce[3]});if(Ee<ye)s=[Ce[2],Ce[3]]}}}}var Pe=dn(s,B,i.arrowShapes[v].spacing(t)+c),Me=dn(s,B,i.arrowShapes[v].gap(t)+c);if(m.endX=Me[0],m.endY=Me[1],m.arrowEndX=Pe[0],m.arrowEndY=Pe[1],x==="inside-to-node")s=[u.x,u.y];else if(w.units)s=this.manualEndptToPx(o,w);else if(x==="outside-to-line")s=m.srcIntn;else{if(x==="outside-to-node"||x==="outside-to-node-or-label")k=z;else if(x==="outside-to-line"||x==="outside-to-line-or-label")k=[f.x,f.y];if(s=i.nodeShapes[this.getNodeShape(o)].intersectLine(u.x,u.y,o.outerWidth(),o.outerHeight(),k[0],k[1],0,T,g),x==="outside-to-node-or-label"||x==="outside-to-line-or-label"){var Ne=o._private.rscratch,{labelWidth:Fe,labelHeight:ze,labelX:Ue,labelY:ie}=Ne,L=Fe/2,F=ze/2,Y=o.pstyle("text-valign").value;if(Y=ca(Y),Y==="top")ie-=F;else if(Y==="bottom")ie+=F;var H=o.pstyle("text-halign").value;if(H=ha(H),H==="left")Ue-=L;else if(H==="right")Ue+=L;var K=Ha(k[0],k[1],[Ue-L,ie-F,Ue+L,ie-F,Ue+L,ie+F,Ue-L,ie+F],u.x,u.y);if(K.length>0){var se=f,ae=Br(se,ra(s)),oe=Br(se,ra(K)),ne=ae;if(oe<ae)s=[K[0],K[1]],ne=oe;if(K.length>2){var ue=Br(se,{x:K[2],y:K[3]});if(ue<ne)s=[K[2],K[3]]}}}}var be=dn(s,z,i.arrowShapes[h].spacing(t)+d),fe=dn(s,z,i.arrowShapes[h].gap(t)+d);if(m.startX=fe[0],m.startY=fe[1],m.arrowStartX=be[0],m.arrowStartY=be[1],R)if(!he(m.startX)||!he(m.startY)||!he(m.endX)||!he(m.endY))m.badLine=!0;else m.badLine=!1};an.getSourceEndpoint=function(t){var e=t[0]._private.rscratch;switch(this.recalculateRenderedStyle(t),e.edgeType){case"haystack":return{x:e.haystackPts[0],y:e.haystackPts[1]};default:return{x:e.arrowStartX,y:e.arrowStartY}}};an.getTargetEndpoint=function(t){var e=t[0]._private.rscratch;switch(this.recalculateRenderedStyle(t),e.edgeType){case"haystack":return{x:e.haystackPts[2],y:e.haystackPts[3]};default:return{x:e.arrowEndX,y:e.arrowEndY}}};var Oo={};function hy(t,e,r){var a=function(u,f,v,h){return bt(u,f,v,h)},n=e._private,i=n.rstyle.bezierPts;for(var s=0;s<t.bezierProjPcts.length;s++){var o=t.bezierProjPcts[s];i.push({x:a(r[0],r[2],r[4],o),y:a(r[1],r[3],r[5],o)})}}Oo.storeEdgeProjections=function(t){var e=t._private,r=e.rscratch,a=r.edgeType;if(e.rstyle.bezierPts=null,e.rstyle.linePts=null,e.rstyle.haystackPts=null,a==="multibezier"||a==="bezier"||a==="self"||a==="compound"){e.rstyle.bezierPts=[];for(var n=0;n+5<r.allpts.length;n+=4)hy(this,t,r.allpts.slice(n,n+6))}else if(a==="segments"){var i=e.rstyle.linePts=[];for(var n=0;n+1<r.allpts.length;n+=2)i.push({x:r.allpts[n],y:r.allpts[n+1]})}else if(a==="haystack"){var s=r.haystackPts;e.rstyle.haystackPts=[{x:s[0],y:s[1]},{x:s[2],y:s[3]}]}e.rstyle.arrowWidth=this.getArrowWidth(t.pstyle("width").pfValue,t.pstyle("arrow-scale").value)*this.arrowShapeWidth};Oo.recalculateEdgeProjections=function(t){this.findEdgeControlPoints(t)};var er={};er.recalculateNodeLabelProjection=function(t){var e=t.pstyle("label").strValue;if(xr(e))return;var r,a,n=t._private,i=t.width(),s=t.height(),o=t.padding(),l=t.position(),u=t.pstyle("text-halign").strValue,f=t.pstyle("text-valign").strValue,{rscratch:v,rstyle:h}=n;switch(u){case"left":r=l.x-i/2-o;break;case"left-inside":r=l.x-i/2+o;break;case"right":r=l.x+i/2+o;break;case"right-inside":r=l.x+i/2-o;break;default:r=l.x}switch(f){case"top":a=l.y-s/2-o;break;case"top-inside":a=l.y-s/2+o;break;case"bottom":a=l.y+s/2+o;break;case"bottom-inside":a=l.y+s/2-o;break;default:a=l.y}v.labelX=r,v.labelY=a,h.labelX=r,h.labelY=a,this.calculateLabelAngles(t),this.applyLabelDimensions(t)};var Bv=function(e,r){var a=Math.atan(r/e);if(e===0&&a<0)a=a*-1;return a},kv=function(e,r){var a=r.x-e.x,n=r.y-e.y;return Bv(a,n)},cy=function(e,r,a,n){var i=Ua(0,n-0.001,1),s=Ua(0,n+0.001,1),o=ia(e,r,a,i),l=ia(e,r,a,s);return kv(o,l)};er.recalculateEdgeLabelProjections=function(t){var e,r=t._private,a=r.rscratch,n=this,i={mid:t.pstyle("label").strValue,source:t.pstyle("source-label").strValue,target:t.pstyle("target-label").strValue};if(i.mid||i.source||i.target);else return;e={x:a.midX,y:a.midY};var s=function(v,h,c){Qt(r.rscratch,v,h,c),Qt(r.rstyle,v,h,c)};s("labelX",null,e.x),s("labelY",null,e.y);var o=Bv(a.midDispX,a.midDispY);s("labelAutoAngle",null,o);var l=function(){if(l.cache)return l.cache;var v=[];for(var h=0;h+5<a.allpts.length;h+=4){var c={x:a.allpts[h],y:a.allpts[h+1]},d={x:a.allpts[h+2],y:a.allpts[h+3]},g={x:a.allpts[h+4],y:a.allpts[h+5]};v.push({p0:c,p1:d,p2:g,startDist:0,length:0,segments:[]})}var y=r.rstyle.bezierPts,p=n.bezierProjPcts.length;function m(S,P,N,R,I){var w=Ur(P,N),x=S.segments[S.segments.length-1],T={p0:P,p1:N,t0:R,t1:I,startDist:x?x.startDist+x.length:0,length:w};S.segments.push(T),S.length+=w}for(var b=0;b<v.length;b++){var E=v[b],A=v[b-1];if(A)E.startDist=A.startDist+A.length;m(E,E.p0,y[b*p],0,n.bezierProjPcts[0]);for(var M=0;M<p-1;M++)m(E,y[b*p+M],y[b*p+M+1],n.bezierProjPcts[M],n.bezierProjPcts[M+1]);m(E,y[b*p+p-1],E.p2,n.bezierProjPcts[p-1],1)}return l.cache=v},u=function(v){var h,c=v==="source";if(!i[v])return;var d=t.pstyle(v+"-text-offset").pfValue;switch(a.edgeType){case"self":case"compound":case"bezier":case"multibezier":{var g=l(),y,p=0,m=0;for(var b=0;b<g.length;b++){var E=g[c?b:g.length-1-b];for(var A=0;A<E.segments.length;A++){var M=E.segments[c?A:E.segments.length-1-A],S=b===g.length-1&&A===E.segments.length-1;if(p=m,m+=M.length,m>=d||S){y={cp:E,segment:M};break}}if(y)break}var P=y.cp,N=y.segment,R=(d-p)/N.length,I=N.t1-N.t0,w=c?N.t0+I*R:N.t1-I*R;w=Ua(0,w,1),e=ia(P.p0,P.p1,P.p2,w),h=cy(P.p0,P.p1,P.p2,w);break}case"straight":case"segments":case"haystack":{var x=0,T,D,C,O,B=a.allpts.length;for(var z=0;z+3<B;z+=2){if(c)C={x:a.allpts[z],y:a.allpts[z+1]},O={x:a.allpts[z+2],y:a.allpts[z+3]};else C={x:a.allpts[B-2-z],y:a.allpts[B-1-z]},O={x:a.allpts[B-4-z],y:a.allpts[B-3-z]};if(T=Ur(C,O),D=x,x+=T,x>=d)break}var V=d-D,k=V/T;k=Ua(0,k,1),e=Ic(C,O,k),h=kv(C,O);break}}s("labelX",v,e.x),s("labelY",v,e.y),s("labelAutoAngle",v,h)};u("source"),u("target"),this.applyLabelDimensions(t)};er.applyLabelDimensions=function(t){if(this.applyPrefixedLabelDimensions(t),t.isEdge())this.applyPrefixedLabelDimensions(t,"source"),this.applyPrefixedLabelDimensions(t,"target")};er.applyPrefixedLabelDimensions=function(t,e){var r=t._private,a=this.getLabelText(t,e),n=Gr(a,t._private.labelDimsKey);if(Nt(r.rscratch,"prefixedLabelDimsKey",e)===n)return;Qt(r.rscratch,"prefixedLabelDimsKey",e,n);var i=this.calculateLabelDimensions(t,a),s=t.pstyle("line-height").pfValue,o=t.pstyle("font-size").pfValue,l=t.pstyle("text-wrap").strValue,u=Nt(r.rscratch,"labelWrapCachedLines",e)||[],f=l!=="wrap"?1:Math.max(u.length,1),v=o*s,h=i.width,c=i.height+(f-1)*(s-1)*o;Qt(r.rstyle,"labelWidth",e,h),Qt(r.rscratch,"labelWidth",e,h),Qt(r.rstyle,"labelHeight",e,c),Qt(r.rscratch,"labelHeight",e,c),Qt(r.rscratch,"labelLineHeight",e,v),Qt(r.rscratch,"labelActualDescent",e,i.labelActualDescent)};er.getLabelText=function(t,e){var r=t._private,a=e?e+"-":"",n=t.pstyle(a+"label").strValue,i=t.pstyle("text-transform").value,s=function(J,X){if(X)return Qt(r.rscratch,J,e,X),X;else return Nt(r.rscratch,J,e)};if(!n)return"";if(i=="none");else if(i=="uppercase")n=n.toUpperCase();else if(i=="lowercase")n=n.toLowerCase();var o=t.pstyle("text-wrap").value;if(o==="wrap"){var l=s("labelKey");if(l!=null&&s("labelWrapKey")===l)return s("labelWrapCachedText");var u="​",f=n.split(`
15
15
  `),v=t.pstyle("text-max-width").pfValue,h=t.pstyle("text-overflow-wrap").value,c=h==="anywhere",d=[],g=/[\s\u200b]+|$/g;for(var y=0;y<f.length;y++){var p=f[y],m=this.calculateLabelDimensions(t,p),b=m.width;if(c){var E=p.split("").join(u);p=E}if(b>v){var A=p.matchAll(g),M="",S=0,P=kt(A),N;try{for(P.s();!(N=P.n()).done;){var R=N.value,I=R[0],w=p.substring(S,R.index);S=R.index+I.length;var x=M.length===0?w:M+w+I,T=this.calculateLabelDimensions(t,x),D=T.width;if(D<=v)M+=w+I;else{if(M)d.push(M);M=w+I}}}catch(G){P.e(G)}finally{P.f()}if(!M.match(/^[\s\u200b]+$/))d.push(M)}else d.push(p)}s("labelWrapCachedLines",d),n=s("labelWrapCachedText",d.join(`
16
16
  `)),s("labelWrapKey",l)}else if(o==="ellipsis"){var C=t.pstyle("text-max-width").pfValue,O="",B="…",z=!1;if(this.calculateLabelDimensions(t,n).width<C)return n;for(var V=0;V<n.length;V++){var k=this.calculateLabelDimensions(t,O+n[V]+B).width;if(k>C)break;if(O+=n[V],V===n.length-1)z=!0}if(!z)O+=B;return O}return n};er.getLabelJustification=function(t){var e=t.pstyle("text-justification").strValue,r=t.pstyle("text-halign").strValue;if(e==="auto")if(t.isNode())return ep(r);else return"center";else return e};er.calculateLabelDimensions=function(t,e){var r=this,a=r.cy.window(),n=a.document,i=0,s=t.pstyle("font-style").strValue,o=t.pstyle("font-size").pfValue,l=t.pstyle("font-family").strValue,u=t.pstyle("font-weight").strValue,f=t.pstyle("text-metrics").strValue||"font",v=this.labelCalcCanvas,h=this.labelCalcCanvasContext;if(!v){v=this.labelCalcCanvas=n.createElement("canvas"),h=this.labelCalcCanvasContext=v.getContext("2d");var c=v.style;c.position="absolute",c.left="-9999px",c.top="-9999px",c.zIndex="-1",c.visibility="hidden",c.pointerEvents="none"}h.font="".concat(s," ").concat(u," ").concat(o,"px ").concat(l);var d=0,g=0,y=e.split(`
17
- `),p=y.length,m=0,b=0;for(var E=0;E<p;E++){var A=y[E],M=h.measureText(A),S=Math.ceil(M.width),P=o;if(f==="glyph"){if(E===0)b=M.actualBoundingBoxAscent;if(E===p-1)m=M.actualBoundingBoxDescent}d=Math.max(S,d),g+=P}if(f==="glyph")g-=o-b-m;return d+=i,g+=i,{width:d,height:g,labelActualAscent:b,labelActualDescent:m}};er.calculateLabelAngle=function(t,e){var r=t._private,a=r.rscratch,n=t.isEdge(),i=e?e+"-":"",s=t.pstyle(i+"text-rotation"),o=s.strValue;if(o==="none")return 0;else if(n&&o==="autorotate")return a.labelAutoAngle;else if(o==="autorotate")return 0;else return s.pfValue};er.calculateLabelAngles=function(t){var e=this,r=t.isEdge(),a=t._private,n=a.rscratch;if(n.labelAngle=e.calculateLabelAngle(t),r)n.sourceLabelAngle=e.calculateLabelAngle(t,"source"),n.targetLabelAngle=e.calculateLabelAngle(t,"target")};var Fv={},Kl=28,Zl=!1;Fv.getNodeShape=function(t){var e=this,r=t.pstyle("shape").value;if(r==="cutrectangle"&&(t.width()<Kl||t.height()<Kl)){if(!Zl)_e("The `cutrectangle` node shape can not be used at small sizes so `rectangle` is used instead"),Zl=!0;return"rectangle"}if(t.isParent())if(r==="rectangle"||r==="roundrectangle"||r==="round-rectangle"||r==="cutrectangle"||r==="cut-rectangle"||r==="barrel")return r;else return"rectangle";if(r==="polygon"){var a=t.pstyle("shape-polygon-points").value;return e.nodeShapes.makePolygon(a).name}return r};var vi={};vi.registerCalculationListeners=function(){var t=this.cy,e=t.collection(),r=this,a=function(s){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e.merge(s),o)for(var l=0;l<s.length;l++){var u=s[l],f=u._private,v=f.rstyle;v.clean=!1,v.cleanConnected=!1}};r.binder(t).on("bounds.* dirty.*",function(s){var o=s.target;a(o)}).on("style.* background.*",function(s){var o=s.target;a(o,!1)});var n=function(s){if(s){var o=r.onUpdateEleCalcsFns;e.cleanStyle();for(var l=0;l<e.length;l++){var u=e[l],f=u._private.rstyle;if(u.isNode()&&!f.cleanConnected)a(u.connectedEdges()),f.cleanConnected=!0}if(o)for(var v=0;v<o.length;v++){var h=o[v];h(s,e)}r.recalculateRenderedStyle(e),e=t.collection()}};r.flushRenderedStyleQueue=function(){n(!0)},r.beforeRender(n,r.beforeRenderPriorities.eleCalcs)};vi.onUpdateEleCalcs=function(t){var e=this.onUpdateEleCalcsFns=this.onUpdateEleCalcsFns||[];e.push(t)};vi.recalculateRenderedStyle=function(t,e){var r=function(E){return E._private.rstyle.cleanConnected};if(t.length===0)return;var a=[],n=[];if(this.destroyed)return;if(e===void 0)e=!0;for(var i=0;i<t.length;i++){var s=t[i],o=s._private,l=o.rstyle;if(s.isEdge()&&(!r(s.source())||!r(s.target())))l.clean=!1;if(s.isEdge()&&s.isBundledBezier()){if(s.parallelEdges().some(function(b){return!b._private.rstyle.clean&&b.isBundledBezier()}))l.clean=!1}if(e&&l.clean||s.removed())continue;if(s.pstyle("display").value==="none")continue;if(o.group==="nodes")n.push(s);else a.push(s);l.clean=!0}for(var u=0;u<n.length;u++){var f=n[u],v=f._private,h=v.rstyle,c=f.position();this.recalculateNodeLabelProjection(f),h.nodeX=c.x,h.nodeY=c.y,h.nodeW=f.pstyle("width").pfValue,h.nodeH=f.pstyle("height").pfValue}this.recalculateEdgeProjections(a);for(var d=0;d<a.length;d++){var g=a[d],y=g._private,{rstyle:p,rscratch:m}=y;p.srcX=m.arrowStartX,p.srcY=m.arrowStartY,p.tgtX=m.arrowEndX,p.tgtY=m.arrowEndY,p.midX=m.midX,p.midY=m.midY,p.labelAngle=m.labelAngle,p.sourceLabelAngle=m.sourceLabelAngle,p.targetLabelAngle=m.targetLabelAngle}};var hi={};hi.updateCachedGrabbedEles=function(){var t=this.cachedZSortedEles;if(!t)return;t.drag=[],t.nondrag=[];var e=[];for(var r=0;r<t.length;r++){var a=t[r],n=a._private.rscratch;if(a.grabbed()&&!a.isParent())e.push(a);else if(n.inDragLayer)t.drag.push(a);else t.nondrag.push(a)}for(var r=0;r<e.length;r++){var a=e[r];t.drag.push(a)}};hi.invalidateCachedZSortedEles=function(){this.cachedZSortedEles=null};hi.getCachedZSortedEles=function(t){if(t||!this.cachedZSortedEles){var e=this.cy.mutableElements().toArray();e.sort(mv),e.interactive=e.filter(function(r){return r.interactive()}),this.cachedZSortedEles=e,this.updateCachedGrabbedEles()}else e=this.cachedZSortedEles;return e};var zv={};[Xr,Xn,Lt,an,Oo,er,Fv,vi,hi].forEach(function(t){Oe(zv,t)});var Vv={};Vv.getCachedImage=function(t,e,r){var a=this,n=a.imageCache=a.imageCache||{},i=n[t];if(i){if(!i.image.complete)i.image.addEventListener("load",r);return i.image}else{i=n[t]=n[t]||{};var s=i.image=new Image;s.addEventListener("load",r),s.addEventListener("error",function(){s.error=!0});var o="data:",l=t.substring(0,o.length).toLowerCase()===o;if(!l)e=e==="null"?null:e,s.crossOrigin=e;return s.src=t,s}};var Gv=function(e,r){var a=e[0];if(!a||a._private.grabbed===r)return;a._private.grabbed=r,e.updateStyle(!1)},dy=function(e){Gv(e,!0)},gy=function(e){Gv(e,!1)},ma={};ma.registerBinding=function(t,e,r,a){var n=Array.prototype.slice.apply(arguments,[1]);if(Array.isArray(t)){var i=[];for(var s=0;s<t.length;s++){var o=t[s];if(o!==void 0){var l=this.binder(o);i.push(l.on.apply(l,n))}}return i}var l=this.binder(t);return l.on.apply(l,n)};ma.binder=function(t){var e=this,r=e.cy.window(),a=t===r||t===r.document||t===r.document.body||Th(t);if(e.supportsPassiveEvents==null){var n=!1;try{var i=Object.defineProperty({},"passive",{get:function(){return n=!0,!0}});r.addEventListener("test",null,i)}catch(o){}e.supportsPassiveEvents=n}var s=function(l,u,f){var v=Array.prototype.slice.call(arguments);if(a&&e.supportsPassiveEvents)v[2]={capture:f!=null?f:!1,passive:!1,once:!1};return e.bindings.push({target:t,args:v}),(t.addEventListener||t.on).apply(t,v),this};return{on:s,addEventListener:s,addListener:s,bind:s}};ma.nodeIsDraggable=function(t){return t&&t.isNode()&&!t.locked()&&t.grabbable()};ma.nodeIsGrabbable=function(t){return this.nodeIsDraggable(t)&&t.interactive()};ma.load=function(){var t=this,e=t.cy.window(),r=function(L){return L.selected()},a=function(L){var F=L.getRootNode();if(F&&F.nodeType===11&&F.host!==void 0)return F},n=function(L,F,Y,H){if(L==null)L=t.cy;for(var K=0;K<F.length;K++){var se=F[K];L.emit({originalEvent:Y,type:se,position:H})}},i=function(L){return L.shiftKey||L.metaKey||L.ctrlKey},s=function(L,F){var Y=!0;if(t.cy.hasCompoundNodes()&&L&&L.pannable())for(var H=0;F&&H<F.length;H++){var L=F[H];if(L.isNode()&&L.isParent()&&!L.pannable()){Y=!1;break}}else Y=!0;return Y},o=function(L){L[0]._private.rscratch.inDragLayer=!0},l=function(L){L[0]._private.rscratch.inDragLayer=!1},u=function(L){L[0]._private.rscratch.isGrabTarget=!0},f=function(L){L[0]._private.rscratch.isGrabTarget=!1},v=function(L,F){var Y=F.addToList,H=Y.has(L);if(!H&&L.grabbable()&&!L.locked())Y.merge(L),dy(L)},h=function(L,F){if(!L.cy().hasCompoundNodes())return;if(F.inDragLayer==null&&F.addToList==null)return;var Y=L.descendants();if(F.inDragLayer)Y.forEach(o),Y.connectedEdges().forEach(o);if(F.addToList)v(Y,F)},c=function(L,F){F=F||{};var Y=L.cy().hasCompoundNodes();if(F.inDragLayer)L.forEach(o),L.neighborhood().stdFilter(function(H){return!Y||H.isEdge()}).forEach(o);if(F.addToList)L.forEach(function(H){v(H,F)});h(L,F),y(L,{inDragLayer:F.inDragLayer}),t.updateCachedGrabbedEles()},d=c,g=function(L){if(!L)return;t.getCachedZSortedEles().forEach(function(F){gy(F),l(F),f(F)}),t.updateCachedGrabbedEles()},y=function(L,F){if(F.inDragLayer==null&&F.addToList==null)return;if(!L.cy().hasCompoundNodes())return;var Y=L.ancestors().orphans();if(Y.same(L))return;var H=Y.descendants().spawnSelf().merge(Y).unmerge(L).unmerge(L.descendants()),K=H.connectedEdges();if(F.inDragLayer)K.forEach(o),H.forEach(o);if(F.addToList)H.forEach(function(se){v(se,F)})},p=function(){if(document.activeElement!=null&&document.activeElement.blur!=null)document.activeElement.blur()},m=typeof MutationObserver<"u",b=typeof ResizeObserver<"u";if(m){if(t.removeObserver=new MutationObserver(function(ie){for(var L=0;L<ie.length;L++){var F=ie[L],Y=F.removedNodes;if(Y)for(var H=0;H<Y.length;H++){var K=Y[H];if(K===t.container){t.destroy();break}}}}),t.container.parentNode)t.removeObserver.observe(t.container.parentNode,{childList:!0})}else t.registerBinding(t.container,"DOMNodeRemoved",function(ie){t.destroy()});var E=ja(function(){t.cy.resize()},100);if(m)t.styleObserver=new MutationObserver(E),t.styleObserver.observe(t.container,{attributes:!0});if(t.registerBinding(e,"resize",E),b)t.resizeObserver=new ResizeObserver(E),t.resizeObserver.observe(t.container);var A=function(L,F){while(L!=null)F(L),L=L.parentNode},M=function(){t.invalidateContainerClientCoordsCache()};A(t.container,function(ie){t.registerBinding(ie,"transitionend",M),t.registerBinding(ie,"animationend",M),t.registerBinding(ie,"scroll",M)}),t.registerBinding(t.container,"contextmenu",function(ie){ie.preventDefault()});var S=function(){return t.selection[4]!==0},P=function(L){var F=t.findContainerClientCoords(),Y=F[0],H=F[1],K=F[2],se=F[3],ae=L.touches?L.touches:[L],oe=!1;for(var ne=0;ne<ae.length;ne++){var ue=ae[ne];if(Y<=ue.clientX&&ue.clientX<=Y+K&&H<=ue.clientY&&ue.clientY<=H+se){oe=!0;break}}if(!oe)return!1;var be=t.container,fe=L.target,le=fe.parentNode,De=!1;while(le){if(le===be){De=!0;break}le=le.parentNode}if(!De)return!1;return!0};t.registerBinding(t.container,"mousedown",function(L){if(!P(L))return;if(t.hoverData.which===1&&L.which!==1)return;L.preventDefault(),p(),t.hoverData.capture=!0,t.hoverData.which=L.which;var F=t.cy,Y=[L.clientX,L.clientY],H=t.projectIntoViewport(Y[0],Y[1]),K=t.selection,se=t.findNearestElements(H[0],H[1],!0,!1),ae=se[0],oe=t.dragData.possibleDragElements;t.hoverData.mdownPos=H,t.hoverData.mdownGPos=Y;var ne=function(ce){return{originalEvent:L,type:ce,position:{x:H[0],y:H[1]}}},ue=function(){t.hoverData.tapholdCancelled=!1,clearTimeout(t.hoverData.tapholdTimeout),t.hoverData.tapholdTimeout=setTimeout(function(){if(t.hoverData.tapholdCancelled)return;else{var ce=t.hoverData.down;if(ce)ce.emit(ne("taphold"));else F.emit(ne("taphold"))}},t.tapholdDuration)};if(L.which==3){t.hoverData.cxtStarted=!0;var be={originalEvent:L,type:"cxttapstart",position:{x:H[0],y:H[1]}};if(ae)ae.activate(),ae.emit(be),t.hoverData.down=ae;else F.emit(be);t.hoverData.downTime=new Date().getTime(),t.hoverData.cxtDragged=!1}else if(L.which==1){if(ae)ae.activate();{if(ae!=null){if(t.nodeIsGrabbable(ae)){var fe=function(ce){ce.emit(ne("grab"))};if(u(ae),!ae.selected())oe=t.dragData.possibleDragElements=F.collection(),d(ae,{addToList:oe}),ae.emit(ne("grabon")).emit(ne("grab"));else{oe=t.dragData.possibleDragElements=F.collection();var le=F.$(function(De){return De.isNode()&&De.selected()&&t.nodeIsGrabbable(De)});c(le,{addToList:oe}),ae.emit(ne("grabon")),le.forEach(fe)}t.redrawHint("eles",!0),t.redrawHint("drag",!0)}}t.hoverData.down=ae,t.hoverData.downs=se,t.hoverData.downTime=new Date().getTime()}if(n(ae,["mousedown","tapstart","vmousedown"],L,{x:H[0],y:H[1]}),ae==null)K[4]=1,t.data.bgActivePosistion={x:H[0],y:H[1]},t.redrawHint("select",!0),t.redraw();else if(ae.pannable())K[4]=1;ue()}K[0]=K[2]=H[0],K[1]=K[3]=H[1]},!1);var N=a(t.container);t.registerBinding([e,N],"mousemove",function(L){var F=t.hoverData.capture;if(!F&&!P(L))return;var Y=!1,H=t.cy,K=H.zoom(),se=[L.clientX,L.clientY],ae=t.projectIntoViewport(se[0],se[1]),oe=t.hoverData.mdownPos,ne=t.hoverData.mdownGPos,ue=t.selection,be=null;if(!t.hoverData.draggingEles&&!t.hoverData.dragging&&!t.hoverData.selecting)be=t.findNearestElement(ae[0],ae[1],!0,!1);var fe=t.hoverData.last,le=t.hoverData.down,De=[ae[0]-ue[2],ae[1]-ue[3]],ce=t.dragData.possibleDragElements,pe;if(ne){var Ie=se[0]-ne[0],xe=Ie*Ie,me=se[1]-ne[1],Ve=me*me,Be=xe+Ve;t.hoverData.isOverThresholdDrag=pe=Be>=t.desktopTapThreshold2}var Ke=i(L);if(pe)t.hoverData.tapholdCancelled=!0;var He=function(){var xt=t.hoverData.dragDelta=t.hoverData.dragDelta||[];if(xt.length===0)xt.push(De[0]),xt.push(De[1]);else xt[0]+=De[0],xt[1]+=De[1]};Y=!0,n(be,["mousemove","vmousemove","tapdrag"],L,{x:ae[0],y:ae[1]});var Le=function(xt){return{originalEvent:L,type:xt,position:{x:ae[0],y:ae[1]}}},nt=function(){if(t.data.bgActivePosistion=void 0,!t.hoverData.selecting)H.emit(Le("boxstart"));ue[4]=1,t.hoverData.selecting=!0,t.redrawHint("select",!0),t.redraw()};if(t.hoverData.which===3){if(pe){var Ye=Le("cxtdrag");if(le)le.emit(Ye);else H.emit(Ye);if(t.hoverData.cxtDragged=!0,!t.hoverData.cxtOver||be!==t.hoverData.cxtOver){if(t.hoverData.cxtOver)t.hoverData.cxtOver.emit(Le("cxtdragout"));if(t.hoverData.cxtOver=be,be)be.emit(Le("cxtdragover"))}}}else if(t.hoverData.dragging){if(Y=!0,H.panningEnabled()&&H.userPanningEnabled()){var tt;if(t.hoverData.justStartedPan){var ct=t.hoverData.mdownPos;tt={x:(ae[0]-ct[0])*K,y:(ae[1]-ct[1])*K},t.hoverData.justStartedPan=!1}else tt={x:De[0]*K,y:De[1]*K};H.panBy(tt),H.emit(Le("dragpan")),t.hoverData.dragged=!0}ae=t.projectIntoViewport(L.clientX,L.clientY)}else if(ue[4]==1&&(le==null||le.pannable())){if(pe){if(!t.hoverData.dragging&&H.boxSelectionEnabled()&&(Ke||!H.panningEnabled()||!H.userPanningEnabled()))nt();else if(!t.hoverData.selecting&&H.panningEnabled()&&H.userPanningEnabled()){var qt=s(le,t.hoverData.downs);if(qt)t.hoverData.dragging=!0,t.hoverData.justStartedPan=!0,ue[4]=0,t.data.bgActivePosistion=ra(oe),t.redrawHint("select",!0),t.redraw()}if(le&&le.pannable()&&le.active())le.unactivate()}}else{if(le&&le.pannable()&&le.active())le.unactivate();if((!le||!le.grabbed())&&be!=fe){if(fe)n(fe,["mouseout","tapdragout"],L,{x:ae[0],y:ae[1]});if(be)n(be,["mouseover","tapdragover"],L,{x:ae[0],y:ae[1]});t.hoverData.last=be}if(le)if(pe){if(H.boxSelectionEnabled()&&Ke){if(le&&le.grabbed()){if(g(ce),le.emit(Le("freeon")),ce.emit(Le("free")),t.dragData.didDrag)le.emit(Le("dragfreeon")),ce.emit(Le("dragfree"))}nt()}else if(le&&le.grabbed()&&t.nodeIsDraggable(le)){var ot=!t.dragData.didDrag;if(ot)t.redrawHint("eles",!0);if(t.dragData.didDrag=!0,!t.hoverData.draggingEles)c(ce,{inDragLayer:!0});var rt={x:0,y:0};if(he(De[0])&&he(De[1])){if(rt.x+=De[0],rt.y+=De[1],ot){var lt=t.hoverData.dragDelta;if(lt&&he(lt[0])&&he(lt[1]))rt.x+=lt[0],rt.y+=lt[1]}}t.hoverData.draggingEles=!0,ce.silentShift(rt).emit(Le("position")).emit(Le("drag")),t.redrawHint("drag",!0),t.redraw()}}else He();Y=!0}if(ue[2]=ae[0],ue[3]=ae[1],Y){if(L.stopPropagation)L.stopPropagation();if(L.preventDefault)L.preventDefault();return!1}},!1);var R,I,w;t.registerBinding(e,"mouseup",function(L){if(t.hoverData.which===1&&L.which!==1&&t.hoverData.capture)return;var F=t.hoverData.capture;if(!F)return;t.hoverData.capture=!1;var Y=t.cy,H=t.projectIntoViewport(L.clientX,L.clientY),K=t.selection,se=t.findNearestElement(H[0],H[1],!0,!1),ae=t.dragData.possibleDragElements,oe=t.hoverData.down,ne=i(L);if(t.data.bgActivePosistion)t.redrawHint("select",!0),t.redraw();if(t.hoverData.tapholdCancelled=!0,t.data.bgActivePosistion=void 0,oe)oe.unactivate();var ue=function(Ie){return{originalEvent:L,type:Ie,position:{x:H[0],y:H[1]}}};if(t.hoverData.which===3){var be=ue("cxttapend");if(oe)oe.emit(be);else Y.emit(be);if(!t.hoverData.cxtDragged){var fe=ue("cxttap");if(oe)oe.emit(fe);else Y.emit(fe)}t.hoverData.cxtDragged=!1,t.hoverData.which=null}else if(t.hoverData.which===1){if(n(se,["mouseup","tapend","vmouseup"],L,{x:H[0],y:H[1]}),!t.dragData.didDrag&&!t.hoverData.dragged&&!t.hoverData.selecting&&!t.hoverData.isOverThresholdDrag)if(n(oe,["click","tap","vclick"],L,{x:H[0],y:H[1]}),I=!1,L.timeStamp-w<=Y.multiClickDebounceTime())R&&clearTimeout(R),I=!0,w=null,n(oe,["dblclick","dbltap","vdblclick"],L,{x:H[0],y:H[1]});else R=setTimeout(function(){if(I)return;n(oe,["oneclick","onetap","voneclick"],L,{x:H[0],y:H[1]})},Y.multiClickDebounceTime()),w=L.timeStamp;if(oe==null&&!t.dragData.didDrag&&!t.hoverData.selecting&&!t.hoverData.dragged&&!i(L)){if(Y.$(r).unselect(["tapunselect"]),ae.length>0)t.redrawHint("eles",!0);t.dragData.possibleDragElements=ae=Y.collection()}if(se==oe&&!t.dragData.didDrag&&!t.hoverData.selecting){if(se!=null&&se._private.selectable){if(t.hoverData.dragging);else if(Y.selectionType()==="additive"||ne)if(se.selected())se.unselect(["tapunselect"]);else se.select(["tapselect"]);else if(!ne)Y.$(r).unmerge(se).unselect(["tapunselect"]),se.select(["tapselect"]);t.redrawHint("eles",!0)}}if(t.hoverData.selecting){var le=Y.collection(t.getAllInBox(K[0],K[1],K[2],K[3]));if(t.redrawHint("select",!0),le.length>0)t.redrawHint("eles",!0);Y.emit(ue("boxend"));var De=function(Ie){return Ie.selectable()&&!Ie.selected()};if(Y.selectionType()==="additive")le.emit(ue("box")).stdFilter(De).select().emit(ue("boxselect"));else{if(!ne)Y.$(r).unmerge(le).unselect();le.emit(ue("box")).stdFilter(De).select().emit(ue("boxselect"))}t.redraw()}if(t.hoverData.dragging)t.hoverData.dragging=!1,t.redrawHint("select",!0),t.redrawHint("eles",!0),t.redraw();if(!K[4]){t.redrawHint("drag",!0),t.redrawHint("eles",!0);var ce=oe&&oe.grabbed();if(g(ae),ce){if(oe.emit(ue("freeon")),ae.emit(ue("free")),t.dragData.didDrag)oe.emit(ue("dragfreeon")),ae.emit(ue("dragfree"))}}}K[4]=0,t.hoverData.down=null,t.hoverData.cxtStarted=!1,t.hoverData.draggingEles=!1,t.hoverData.selecting=!1,t.hoverData.isOverThresholdDrag=!1,t.dragData.didDrag=!1,t.hoverData.dragged=!1,t.hoverData.dragDelta=[],t.hoverData.mdownPos=null,t.hoverData.mdownGPos=null,t.hoverData.which=null},!1);var x=[],T=4,D,C=1e5,O=function(L){var F=Math.abs(L[0]);for(var Y=1;Y<L.length;Y++)if(Math.abs(L[Y])!==F)return!1;return!0},B=function(L){var F=!1,Y=L.deltaY;if(Y==null){if(L.wheelDeltaY!=null)Y=L.wheelDeltaY/4;else if(L.wheelDelta!=null)Y=L.wheelDelta/4}if(Y===0)return;if(D==null)if(x.length>=T){D=!1;var H=x;if(H[0]>=5){var K;if(O(H))K=H[0];else K=Pc(H);if(K>1)D=!0,C=K}}else x.push(Math.abs(Y)),F=!0;else if(D)C=Math.min(Math.abs(Y),C);if(t.scrollingPage)return;var se=t.cy,ae=se.zoom(),oe=se.pan(),ne=t.projectIntoViewport(L.clientX,L.clientY),ue=[ne[0]*ae+oe.x,ne[1]*ae+oe.y];if(t.hoverData.draggingEles||t.hoverData.dragging||t.hoverData.cxtStarted||S()){L.preventDefault();return}if(se.panningEnabled()&&se.userPanningEnabled()&&se.zoomingEnabled()&&se.userZoomingEnabled()){L.preventDefault(),t.data.wheelZooming=!0,clearTimeout(t.data.wheelTimeout),t.data.wheelTimeout=setTimeout(function(){t.data.wheelZooming=!1,t.redrawHint("eles",!0),t.redraw()},150);var be;if(F&&Math.abs(Y)>5)Y=bo(Y)*5;if(be=Y/-250,D)be/=C,be*=3;be=be*t.wheelSensitivity;var fe=L.deltaMode===1;if(fe)be*=33;var le=se.zoom()*Math.pow(10,be);if(L.type==="gesturechange")le=t.gestureStartZoom*L.scale;se.zoom({level:le,renderedPosition:{x:ue[0],y:ue[1]}}),se.emit({type:L.type==="gesturechange"?"pinchzoom":"scrollzoom",originalEvent:L,position:{x:ne[0],y:ne[1]}})}};t.registerBinding(t.container,"wheel",B,!0),t.registerBinding(e,"scroll",function(L){t.scrollingPage=!0,clearTimeout(t.scrollingPageTimeout),t.scrollingPageTimeout=setTimeout(function(){t.scrollingPage=!1},250)},!0),t.registerBinding(t.container,"gesturestart",function(L){if(t.gestureStartZoom=t.cy.zoom(),!t.hasTouchStarted)L.preventDefault()},!0),t.registerBinding(t.container,"gesturechange",function(ie){if(!t.hasTouchStarted)B(ie)},!0),t.registerBinding(t.container,"mouseout",function(L){var F=t.projectIntoViewport(L.clientX,L.clientY);t.cy.emit({originalEvent:L,type:"mouseout",position:{x:F[0],y:F[1]}})},!1),t.registerBinding(t.container,"mouseover",function(L){var F=t.projectIntoViewport(L.clientX,L.clientY);t.cy.emit({originalEvent:L,type:"mouseover",position:{x:F[0],y:F[1]}})},!1);var z,V,k,G,J,X,_,Q,q,te,Z,U,W,j=function(L,F,Y,H){return Math.sqrt((Y-L)*(Y-L)+(H-F)*(H-F))},re=function(L,F,Y,H){return(Y-L)*(Y-L)+(H-F)*(H-F)},ee;t.registerBinding(t.container,"touchstart",ee=function(L){if(t.hasTouchStarted=!0,!P(L))return;p(),t.touchData.capture=!0,t.data.bgActivePosistion=void 0;var F=t.cy,Y=t.touchData.now,H=t.touchData.earlier;if(L.touches[0]){var K=t.projectIntoViewport(L.touches[0].clientX,L.touches[0].clientY);Y[0]=K[0],Y[1]=K[1]}if(L.touches[1]){var K=t.projectIntoViewport(L.touches[1].clientX,L.touches[1].clientY);Y[2]=K[0],Y[3]=K[1]}if(L.touches[2]){var K=t.projectIntoViewport(L.touches[2].clientX,L.touches[2].clientY);Y[4]=K[0],Y[5]=K[1]}var se=function(Ke){return{originalEvent:L,type:Ke,position:{x:Y[0],y:Y[1]}}};if(L.touches[1]){t.touchData.singleTouchMoved=!0,g(t.dragData.touchDragEles);var ae=t.findContainerClientCoords();q=ae[0],te=ae[1],Z=ae[2],U=ae[3],z=L.touches[0].clientX-q,V=L.touches[0].clientY-te,k=L.touches[1].clientX-q,G=L.touches[1].clientY-te,W=0<=z&&z<=Z&&0<=k&&k<=Z&&0<=V&&V<=U&&0<=G&&G<=U;var oe=F.pan(),ne=F.zoom();J=j(z,V,k,G),X=re(z,V,k,G),_=[(z+k)/2,(V+G)/2],Q=[(_[0]-oe.x)/ne,(_[1]-oe.y)/ne];var ue=200,be=ue*ue;if(X<be&&!L.touches[2]){var fe=t.findNearestElement(Y[0],Y[1],!0,!0),le=t.findNearestElement(Y[2],Y[3],!0,!0);if(fe&&fe.isNode())fe.activate().emit(se("cxttapstart")),t.touchData.start=fe;else if(le&&le.isNode())le.activate().emit(se("cxttapstart")),t.touchData.start=le;else F.emit(se("cxttapstart"));if(t.touchData.start)t.touchData.start._private.grabbed=!1;t.touchData.cxt=!0,t.touchData.cxtDragged=!1,t.data.bgActivePosistion=void 0,t.redraw();return}}if(L.touches[2]){if(F.boxSelectionEnabled())L.preventDefault()}else if(L.touches[1]);else if(L.touches[0]){var De=t.findNearestElements(Y[0],Y[1],!0,!0),ce=De[0];if(ce!=null){if(ce.activate(),t.touchData.start=ce,t.touchData.starts=De,t.nodeIsGrabbable(ce)){var pe=t.dragData.touchDragEles=F.collection(),Ie=null;if(t.redrawHint("eles",!0),t.redrawHint("drag",!0),ce.selected())Ie=F.$(function(Be){return Be.selected()&&t.nodeIsGrabbable(Be)}),c(Ie,{addToList:pe});else d(ce,{addToList:pe});if(u(ce),ce.emit(se("grabon")),Ie)Ie.forEach(function(Be){Be.emit(se("grab"))});else ce.emit(se("grab"))}}if(n(ce,["touchstart","tapstart","vmousedown"],L,{x:Y[0],y:Y[1]}),ce==null)t.data.bgActivePosistion={x:K[0],y:K[1]},t.redrawHint("select",!0),t.redraw();t.touchData.singleTouchMoved=!1,t.touchData.singleTouchStartTime=+new Date,clearTimeout(t.touchData.tapholdTimeout),t.touchData.tapholdTimeout=setTimeout(function(){if(t.touchData.singleTouchMoved===!1&&!t.pinching&&!t.touchData.selecting)n(t.touchData.start,["taphold"],L,{x:Y[0],y:Y[1]})},t.tapholdDuration)}if(L.touches.length>=1){var xe=t.touchData.startPosition=[null,null,null,null,null,null];for(var me=0;me<Y.length;me++)xe[me]=H[me]=Y[me];var Ve=L.touches[0];t.touchData.startGPosition=[Ve.clientX,Ve.clientY]}},!1);var de;t.registerBinding(e,"touchmove",de=function(L){var F=t.touchData.capture;if(!F&&!P(L))return;var{selection:Y,cy:H}=t,K=t.touchData.now,se=t.touchData.earlier,ae=H.zoom();if(L.touches[0]){var oe=t.projectIntoViewport(L.touches[0].clientX,L.touches[0].clientY);K[0]=oe[0],K[1]=oe[1]}if(L.touches[1]){var oe=t.projectIntoViewport(L.touches[1].clientX,L.touches[1].clientY);K[2]=oe[0],K[3]=oe[1]}if(L.touches[2]){var oe=t.projectIntoViewport(L.touches[2].clientX,L.touches[2].clientY);K[4]=oe[0],K[5]=oe[1]}var ne=function(lh){return{originalEvent:L,type:lh,position:{x:K[0],y:K[1]}}},ue=t.touchData.startGPosition,be;if(F&&L.touches[0]&&ue){var fe=[];for(var le=0;le<K.length;le++)fe[le]=K[le]-se[le];var De=L.touches[0].clientX-ue[0],ce=De*De,pe=L.touches[0].clientY-ue[1],Ie=pe*pe,xe=ce+Ie;be=xe>=t.touchTapThreshold2}if(F&&t.touchData.cxt){L.preventDefault();var me=L.touches[0].clientX-q,Ve=L.touches[0].clientY-te,Be=L.touches[1].clientX-q,Ke=L.touches[1].clientY-te,He=re(me,Ve,Be,Ke),Le=He/X,nt=150,Ye=nt*nt,tt=1.5,ct=tt*tt;if(Le>=ct||He>=Ye){t.touchData.cxt=!1,t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var qt=ne("cxttapend");if(t.touchData.start)t.touchData.start.unactivate().emit(qt),t.touchData.start=null;else H.emit(qt)}}if(F&&t.touchData.cxt){var qt=ne("cxtdrag");if(t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.touchData.start)t.touchData.start.emit(qt);else H.emit(qt);if(t.touchData.start)t.touchData.start._private.grabbed=!1;t.touchData.cxtDragged=!0;var ot=t.findNearestElement(K[0],K[1],!0,!0);if(!t.touchData.cxtOver||ot!==t.touchData.cxtOver){if(t.touchData.cxtOver)t.touchData.cxtOver.emit(ne("cxtdragout"));if(t.touchData.cxtOver=ot,ot)ot.emit(ne("cxtdragover"))}}else if(F&&L.touches[2]&&H.boxSelectionEnabled()){if(L.preventDefault(),t.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,!t.touchData.selecting)H.emit(ne("boxstart"));if(t.touchData.selecting=!0,t.touchData.didSelect=!0,Y[4]=1,!Y||Y.length===0||Y[0]===void 0)Y[0]=(K[0]+K[2]+K[4])/3,Y[1]=(K[1]+K[3]+K[5])/3,Y[2]=(K[0]+K[2]+K[4])/3+1,Y[3]=(K[1]+K[3]+K[5])/3+1;else Y[2]=(K[0]+K[2]+K[4])/3,Y[3]=(K[1]+K[3]+K[5])/3;t.redrawHint("select",!0),t.redraw()}else if(F&&L.touches[1]&&!t.touchData.didSelect&&H.zoomingEnabled()&&H.panningEnabled()&&H.userZoomingEnabled()&&H.userPanningEnabled()){L.preventDefault(),t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var rt=t.dragData.touchDragEles;if(rt){t.redrawHint("drag",!0);for(var lt=0;lt<rt.length;lt++){var Ft=rt[lt]._private;Ft.grabbed=!1,Ft.rscratch.inDragLayer=!1}}var xt=t.touchData.start,me=L.touches[0].clientX-q,Ve=L.touches[0].clientY-te,Be=L.touches[1].clientX-q,Ke=L.touches[1].clientY-te,rr=j(me,Ve,Be,Ke),lr=rr/J;if(W){var ln=me-z,wa=Ve-V,fn=Be-k,Ea=Ke-G,ci=(ln+fn)/2,xa=(wa+Ea)/2,fr=H.zoom(),$r=fr*lr,hr=H.pan(),Ta=Q[0]*fr+hr.x,ft=Q[1]*fr+hr.y,ke={x:-$r/fr*(Ta-hr.x-ci)+Ta,y:-$r/fr*(ft-hr.y-xa)+ft};if(xt&&xt.active()){var rt=t.dragData.touchDragEles;if(g(rt),t.redrawHint("drag",!0),t.redrawHint("eles",!0),xt.unactivate().emit(ne("freeon")),rt)rt.emit(ne("free"));if(t.dragData.didDrag){if(xt.emit(ne("dragfreeon")),rt)rt.emit(ne("dragfree"))}}H.viewport({zoom:$r,pan:ke,cancelOnFailedZoom:!0}),H.emit(ne("pinchzoom")),J=rr,z=me,V=Ve,k=Be,G=Ke,t.pinching=!0}if(L.touches[0]){var oe=t.projectIntoViewport(L.touches[0].clientX,L.touches[0].clientY);K[0]=oe[0],K[1]=oe[1]}if(L.touches[1]){var oe=t.projectIntoViewport(L.touches[1].clientX,L.touches[1].clientY);K[2]=oe[0],K[3]=oe[1]}if(L.touches[2]){var oe=t.projectIntoViewport(L.touches[2].clientX,L.touches[2].clientY);K[4]=oe[0],K[5]=oe[1]}}else if(L.touches[0]&&!t.touchData.didSelect){var Ge=t.touchData.start,Vt=t.touchData.last,ot;if(!t.hoverData.draggingEles&&!t.swipePanning)ot=t.findNearestElement(K[0],K[1],!0,!0);if(F&&Ge!=null)L.preventDefault();if(F&&Ge!=null&&t.nodeIsDraggable(Ge))if(be){var rt=t.dragData.touchDragEles,Rt=!t.dragData.didDrag;if(Rt)c(rt,{inDragLayer:!0});t.dragData.didDrag=!0;var Ca={x:0,y:0};if(he(fe[0])&&he(fe[1])){if(Ca.x+=fe[0],Ca.y+=fe[1],Rt){t.redrawHint("eles",!0);var Yt=t.touchData.dragDelta;if(Yt&&he(Yt[0])&&he(Yt[1]))Ca.x+=Yt[0],Ca.y+=Yt[1]}}if(t.hoverData.draggingEles=!0,rt.silentShift(Ca).emit(ne("position")).emit(ne("drag")),t.redrawHint("drag",!0),t.touchData.startPosition[0]==se[0]&&t.touchData.startPosition[1]==se[1])t.redrawHint("eles",!0);t.redraw()}else{var Yt=t.touchData.dragDelta=t.touchData.dragDelta||[];if(Yt.length===0)Yt.push(fe[0]),Yt.push(fe[1]);else Yt[0]+=fe[0],Yt[1]+=fe[1]}{if(n(Ge||ot,["touchmove","tapdrag","vmousemove"],L,{x:K[0],y:K[1]}),(!Ge||!Ge.grabbed())&&ot!=Vt){if(Vt)Vt.emit(ne("tapdragout"));if(ot)ot.emit(ne("tapdragover"))}t.touchData.last=ot}if(F){for(var lt=0;lt<K.length;lt++)if(K[lt]&&t.touchData.startPosition[lt]&&be)t.touchData.singleTouchMoved=!0}if(F&&(Ge==null||Ge.pannable())&&H.panningEnabled()&&H.userPanningEnabled()){var uh=s(Ge,t.touchData.starts);if(uh){if(L.preventDefault(),!t.data.bgActivePosistion)t.data.bgActivePosistion=ra(t.touchData.startPosition);if(t.swipePanning)H.panBy({x:fe[0]*ae,y:fe[1]*ae}),H.emit(ne("dragpan"));else if(be){if(t.swipePanning=!0,H.panBy({x:De*ae,y:pe*ae}),H.emit(ne("dragpan")),Ge)Ge.unactivate(),t.redrawHint("select",!0),t.touchData.start=null}}var oe=t.projectIntoViewport(L.touches[0].clientX,L.touches[0].clientY);K[0]=oe[0],K[1]=oe[1]}}for(var le=0;le<K.length;le++)se[le]=K[le];if(F&&L.touches.length>0&&!t.hoverData.draggingEles&&!t.swipePanning&&t.data.bgActivePosistion!=null)t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.redraw()},!1);var Ae;t.registerBinding(e,"touchcancel",Ae=function(L){var F=t.touchData.start;if(t.touchData.capture=!1,F)F.unactivate()});var Ce,Se,ge,ve;if(t.registerBinding(e,"touchend",Ce=function(L){var F=t.touchData.start,Y=t.touchData.capture;if(Y){if(L.touches.length===0)t.touchData.capture=!1;L.preventDefault()}else return;var H=t.selection;t.swipePanning=!1,t.hoverData.draggingEles=!1;var K=t.cy,se=K.zoom(),ae=t.touchData.now,oe=t.touchData.earlier;if(L.touches[0]){var ne=t.projectIntoViewport(L.touches[0].clientX,L.touches[0].clientY);ae[0]=ne[0],ae[1]=ne[1]}if(L.touches[1]){var ne=t.projectIntoViewport(L.touches[1].clientX,L.touches[1].clientY);ae[2]=ne[0],ae[3]=ne[1]}if(L.touches[2]){var ne=t.projectIntoViewport(L.touches[2].clientX,L.touches[2].clientY);ae[4]=ne[0],ae[5]=ne[1]}var ue=function(Ye){return{originalEvent:L,type:Ye,position:{x:ae[0],y:ae[1]}}};if(F)F.unactivate();var be;if(t.touchData.cxt){if(be=ue("cxttapend"),F)F.emit(be);else K.emit(be);if(!t.touchData.cxtDragged){var fe=ue("cxttap");if(F)F.emit(fe);else K.emit(fe)}if(t.touchData.start)t.touchData.start._private.grabbed=!1;t.touchData.cxt=!1,t.touchData.start=null,t.redraw();return}if(!L.touches[2]&&K.boxSelectionEnabled()&&t.touchData.selecting){t.touchData.selecting=!1;var le=K.collection(t.getAllInBox(H[0],H[1],H[2],H[3]));H[0]=void 0,H[1]=void 0,H[2]=void 0,H[3]=void 0,H[4]=0,t.redrawHint("select",!0),K.emit(ue("boxend"));var De=function(Ye){return Ye.selectable()&&!Ye.selected()};if(le.emit(ue("box")).stdFilter(De).select().emit(ue("boxselect")),le.nonempty())t.redrawHint("eles",!0);t.redraw()}if(F!=null)F.unactivate();if(L.touches[2])t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);else if(L.touches[1]);else if(L.touches[0]);else if(!L.touches[0]){t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var ce=t.dragData.touchDragEles;if(F!=null){var pe=F._private.grabbed;if(g(ce),t.redrawHint("drag",!0),t.redrawHint("eles",!0),pe){if(F.emit(ue("freeon")),ce.emit(ue("free")),t.dragData.didDrag)F.emit(ue("dragfreeon")),ce.emit(ue("dragfree"))}n(F,["touchend","tapend","vmouseup","tapdragout"],L,{x:ae[0],y:ae[1]}),F.unactivate(),t.touchData.start=null}else{var Ie=t.findNearestElement(ae[0],ae[1],!0,!0);n(Ie,["touchend","tapend","vmouseup","tapdragout"],L,{x:ae[0],y:ae[1]})}var xe=t.touchData.startPosition[0]-ae[0],me=xe*xe,Ve=t.touchData.startPosition[1]-ae[1],Be=Ve*Ve,Ke=me+Be,He=Ke*se*se;if(!t.touchData.singleTouchMoved){if(!F)K.$(":selected").unselect(["tapunselect"]);if(n(F,["tap","vclick"],L,{x:ae[0],y:ae[1]}),Se=!1,L.timeStamp-ve<=K.multiClickDebounceTime())ge&&clearTimeout(ge),Se=!0,ve=null,n(F,["dbltap","vdblclick"],L,{x:ae[0],y:ae[1]});else ge=setTimeout(function(){if(Se)return;n(F,["onetap","voneclick"],L,{x:ae[0],y:ae[1]})},K.multiClickDebounceTime()),ve=L.timeStamp}if(F!=null&&!t.dragData.didDrag&&F._private.selectable&&He<t.touchTapThreshold2&&!t.pinching){if(K.selectionType()==="single")K.$(r).unmerge(F).unselect(["tapunselect"]),F.select(["tapselect"]);else if(F.selected())F.unselect(["tapunselect"]);else F.select(["tapselect"]);t.redrawHint("eles",!0)}t.touchData.singleTouchMoved=!0}for(var Le=0;Le<ae.length;Le++)oe[Le]=ae[Le];if(t.dragData.didDrag=!1,L.touches.length===0)t.touchData.dragDelta=[],t.touchData.startPosition=[null,null,null,null,null,null],t.touchData.startGPosition=null,t.touchData.didSelect=!1;if(L.touches.length<2){if(L.touches.length===1)t.touchData.startGPosition=[L.touches[0].clientX,L.touches[0].clientY];t.pinching=!1,t.redrawHint("eles",!0),t.redraw()}},!1),typeof TouchEvent>"u"){var ye=[],Ee=function(L){return{clientX:L.clientX,clientY:L.clientY,force:1,identifier:L.pointerId,pageX:L.pageX,pageY:L.pageY,radiusX:L.width/2,radiusY:L.height/2,screenX:L.screenX,screenY:L.screenY,target:L.target}},Pe=function(L){return{event:L,touch:Ee(L)}},Me=function(L){ye.push(Pe(L))},Ne=function(L){for(var F=0;F<ye.length;F++){var Y=ye[F];if(Y.event.pointerId===L.pointerId){ye.splice(F,1);return}}},Fe=function(L){var F=ye.filter(function(Y){return Y.event.pointerId===L.pointerId})[0];F.event=L,F.touch=Ee(L)},ze=function(L){L.touches=ye.map(function(F){return F.touch})},Ue=function(L){return L.pointerType==="mouse"||L.pointerType===4};t.registerBinding(t.container,"pointerdown",function(ie){if(Ue(ie))return;ie.preventDefault(),Me(ie),ze(ie),ee(ie)}),t.registerBinding(t.container,"pointerup",function(ie){if(Ue(ie))return;Ne(ie),ze(ie),Ce(ie)}),t.registerBinding(t.container,"pointercancel",function(ie){if(Ue(ie))return;Ne(ie),ze(ie),Ae(ie)}),t.registerBinding(t.container,"pointermove",function(ie){if(Ue(ie))return;ie.preventDefault(),Fe(ie),ze(ie),de(ie)})}};var or={};or.generatePolygon=function(t,e){return this.nodeShapes[t]={renderer:this,name:t,points:e,draw:function(a,n,i,s,o,l){this.renderer.nodeShapeImpl("polygon",a,n,i,s,o,this.points)},intersectLine:function(a,n,i,s,o,l,u,f){return Ha(o,l,this.points,a,n,i/2,s/2,u)},checkPoint:function(a,n,i,s,o,l,u,f){return sr(a,n,this.points,l,u,s,o,[0,-1],i)},hasMiterBounds:t!=="rectangle",miterBounds:function(a,n,i,s,o,l){return Gc(this.points,a,n,i,s,o)}}};or.generateEllipse=function(){return this.nodeShapes.ellipse={renderer:this,name:"ellipse",draw:function(e,r,a,n,i,s){this.renderer.nodeShapeImpl(this.name,e,r,a,n,i)},intersectLine:function(e,r,a,n,i,s,o,l){return Kc(i,s,e,r,a/2+o,n/2+o)},checkPoint:function(e,r,a,n,i,s,o,l){return Vr(e,r,n,i,s,o,a)}}};or.generateRoundPolygon=function(t,e){return this.nodeShapes[t]={renderer:this,name:t,points:e,getOrCreateCorners:function(a,n,i,s,o,l,u){if(l[u]!==void 0&&l[u+"-cx"]===a&&l[u+"-cy"]===n&&l[u+"-w"]===i&&l[u+"-h"]===s&&l[u+"-corner-radius"]===o)return l[u];l[u]=Array(e.length/2),l[u+"-cx"]=a,l[u+"-cy"]=n,l[u+"-w"]=i,l[u+"-h"]=s,l[u+"-corner-radius"]=o;var f=i/2,v=s/2;o=o==="auto"?Gf(i,s):o;var h=Array(e.length/2);for(var c=0;c<e.length/2;c++)h[c]={x:a+f*e[c*2],y:n+v*e[c*2+1]};var d,g,y,p,m=h.length;g=h[m-1];for(d=0;d<m;d++)y=h[d%m],p=h[(d+1)%m],l[u][d]=No(g,y,p,o),g=y,y=p;return l[u]},draw:function(a,n,i,s,o,l,u){this.renderer.nodeShapeImpl("round-polygon",a,n,i,s,o,this.points,this.getOrCreateCorners(n,i,s,o,l,u,"drawCorners"))},intersectLine:function(a,n,i,s,o,l,u,f,v){return _c(o,l,this.points,a,n,i,s,u,this.getOrCreateCorners(a,n,i,s,f,v,"corners"))},checkPoint:function(a,n,i,s,o,l,u,f,v){return $c(a,n,this.points,l,u,s,o,this.getOrCreateCorners(l,u,s,o,f,v,"corners"))}}};or.generateRoundRectangle=function(){return this.nodeShapes["round-rectangle"]=this.nodeShapes.roundrectangle={renderer:this,name:"round-rectangle",points:Pt(4,0),draw:function(e,r,a,n,i,s){this.renderer.nodeShapeImpl(this.name,e,r,a,n,i,this.points,s)},intersectLine:function(e,r,a,n,i,s,o,l){return zf(i,s,e,r,a,n,o,l)},checkPoint:function(e,r,a,n,i,s,o,l){var u=n/2,f=i/2;l=l==="auto"?Cr(n,i):l,l=Math.min(u,f,l);var v=l*2;if(sr(e,r,this.points,s,o,n,i-v,[0,-1],a))return!0;if(sr(e,r,this.points,s,o,n-v,i,[0,-1],a))return!0;if(Vr(e,r,v,v,s-u+l,o-f+l,a))return!0;if(Vr(e,r,v,v,s+u-l,o-f+l,a))return!0;if(Vr(e,r,v,v,s+u-l,o+f-l,a))return!0;if(Vr(e,r,v,v,s-u+l,o+f-l,a))return!0;return!1}}};or.generateCutRectangle=function(){return this.nodeShapes["cut-rectangle"]=this.nodeShapes.cutrectangle={renderer:this,name:"cut-rectangle",cornerLength:Eo(),points:Pt(4,0),draw:function(e,r,a,n,i,s){this.renderer.nodeShapeImpl(this.name,e,r,a,n,i,null,s)},generateCutTrianglePts:function(e,r,a,n,i){var s=i==="auto"?this.cornerLength:i,o=r/2,l=e/2,u=a-l,f=a+l,v=n-o,h=n+o;return{topLeft:[u,v+s,u+s,v,u+s,v+s],topRight:[f-s,v,f,v+s,f-s,v+s],bottomRight:[f,h-s,f-s,h,f-s,h-s],bottomLeft:[u+s,h,u,h-s,u+s,h-s]}},intersectLine:function(e,r,a,n,i,s,o,l){var u=this.generateCutTrianglePts(a+2*o,n+2*o,e,r,l),f=[].concat.apply([],[u.topLeft.splice(0,4),u.topRight.splice(0,4),u.bottomRight.splice(0,4),u.bottomLeft.splice(0,4)]);return Ha(i,s,f,e,r)},checkPoint:function(e,r,a,n,i,s,o,l){var u=l==="auto"?this.cornerLength:l;if(sr(e,r,this.points,s,o,n,i-2*u,[0,-1],a))return!0;if(sr(e,r,this.points,s,o,n-2*u,i,[0,-1],a))return!0;var f=this.generateCutTrianglePts(n,i,s,o);return Bt(e,r,f.topLeft)||Bt(e,r,f.topRight)||Bt(e,r,f.bottomRight)||Bt(e,r,f.bottomLeft)}}};or.generateBarrel=function(){return this.nodeShapes.barrel={renderer:this,name:"barrel",points:Pt(4,0),draw:function(e,r,a,n,i,s){this.renderer.nodeShapeImpl(this.name,e,r,a,n,i)},intersectLine:function(e,r,a,n,i,s,o,l){var u=0.15,f=0.5,v=0.85,h=this.generateBarrelBezierPts(a+2*o,n+2*o,e,r),c=function(y){var p=ia({x:y[0],y:y[1]},{x:y[2],y:y[3]},{x:y[4],y:y[5]},u),m=ia({x:y[0],y:y[1]},{x:y[2],y:y[3]},{x:y[4],y:y[5]},f),b=ia({x:y[0],y:y[1]},{x:y[2],y:y[3]},{x:y[4],y:y[5]},v);return[y[0],y[1],p.x,p.y,m.x,m.y,b.x,b.y,y[4],y[5]]},d=[].concat(c(h.topLeft),c(h.topRight),c(h.bottomRight),c(h.bottomLeft));return Ha(i,s,d,e,r)},generateBarrelBezierPts:function(e,r,a,n){var i=r/2,s=e/2,o=a-s,l=a+s,u=n-i,f=n+i,v=Ws(e,r),{heightOffset:h,widthOffset:c}=v,d=v.ctrlPtOffsetPct*e,g={topLeft:[o,u+h,o+d,u,o+c,u],topRight:[l-c,u,l-d,u,l,u+h],bottomRight:[l,f-h,l-d,f,l-c,f],bottomLeft:[o+c,f,o+d,f,o,f-h]};return g.topLeft.isTop=!0,g.topRight.isTop=!0,g.bottomLeft.isBottom=!0,g.bottomRight.isBottom=!0,g},checkPoint:function(e,r,a,n,i,s,o,l){var u=Ws(n,i),{heightOffset:f,widthOffset:v}=u;if(sr(e,r,this.points,s,o,n,i-2*f,[0,-1],a))return!0;if(sr(e,r,this.points,s,o,n-2*v,i,[0,-1],a))return!0;var h=this.generateBarrelBezierPts(n,i,s,o),c=function(P,N,R){var I=R[4],w=R[2],x=R[0],T=R[5],D=R[1],C=Math.min(I,x),O=Math.max(I,x),B=Math.min(T,D),z=Math.max(T,D);if(C<=P&&P<=O&&B<=N&&N<=z){var V=Qc(I,w,x),k=qc(V[0],V[1],V[2],P),G=k.filter(function(J){return 0<=J&&J<=1});if(G.length>0)return G[0]}return null},d=Object.keys(h);for(var g=0;g<d.length;g++){var y=d[g],p=h[y],m=c(e,r,p);if(m==null)continue;var b=p[5],E=p[3],A=p[1],M=bt(b,E,A,m);if(p.isTop&&M<=r)return!0;if(p.isBottom&&r<=M)return!0}return!1}}};or.generateBottomRoundrectangle=function(){return this.nodeShapes["bottom-round-rectangle"]=this.nodeShapes.bottomroundrectangle={renderer:this,name:"bottom-round-rectangle",points:Pt(4,0),draw:function(e,r,a,n,i,s){this.renderer.nodeShapeImpl(this.name,e,r,a,n,i,this.points,s)},intersectLine:function(e,r,a,n,i,s,o,l){var u=e-(a/2+o),f=r-(n/2+o),v=f,h=e+(a/2+o),c=br(i,s,e,r,u,f,h,v,!1);if(c.length>0)return c;return zf(i,s,e,r,a,n,o,l)},checkPoint:function(e,r,a,n,i,s,o,l){l=l==="auto"?Cr(n,i):l;var u=2*l;if(sr(e,r,this.points,s,o,n,i-u,[0,-1],a))return!0;if(sr(e,r,this.points,s,o,n-u,i,[0,-1],a))return!0;var f=n/2+2*a,v=i/2+2*a,h=[s-f,o-v,s-f,o,s+f,o,s+f,o-v];if(Bt(e,r,h))return!0;if(Vr(e,r,u,u,s+n/2-l,o+i/2-l,a))return!0;if(Vr(e,r,u,u,s-n/2+l,o+i/2-l,a))return!0;return!1}}};or.registerNodeShapes=function(){var t=this.nodeShapes={},e=this;this.generateEllipse(),this.generatePolygon("triangle",Pt(3,0)),this.generateRoundPolygon("round-triangle",Pt(3,0)),this.generatePolygon("rectangle",Pt(4,0)),t.square=t.rectangle,this.generateRoundRectangle(),this.generateCutRectangle(),this.generateBarrel(),this.generateBottomRoundrectangle();{var r=[0,1,1,0,0,-1,-1,0];this.generatePolygon("diamond",r),this.generateRoundPolygon("round-diamond",r)}this.generatePolygon("pentagon",Pt(5,0)),this.generateRoundPolygon("round-pentagon",Pt(5,0)),this.generatePolygon("hexagon",Pt(6,0)),this.generateRoundPolygon("round-hexagon",Pt(6,0)),this.generatePolygon("heptagon",Pt(7,0)),this.generateRoundPolygon("round-heptagon",Pt(7,0)),this.generatePolygon("octagon",Pt(8,0)),this.generateRoundPolygon("round-octagon",Pt(8,0));var a=Array(20);{var n=Xs(5,0),i=Xs(5,Math.PI/5),s=0.5*(3-Math.sqrt(5));s*=1.57;for(var o=0;o<i.length/2;o++)i[o*2]*=s,i[o*2+1]*=s;for(var o=0;o<5;o++)a[o*4]=n[o*2],a[o*4+1]=n[o*2+1],a[o*4+2]=i[o*2],a[o*4+3]=i[o*2+1]}a=Vf(a),this.generatePolygon("star",a),this.generatePolygon("vee",[-1,-1,0,-0.333,1,-1,0,1]),this.generatePolygon("rhomboid",[-1,-1,0.333,-1,1,1,-0.333,1]),this.generatePolygon("right-rhomboid",[-0.333,-1,1,-1,0.333,1,-1,1]),this.nodeShapes.concavehexagon=this.generatePolygon("concave-hexagon",[-1,-0.95,-0.75,0,-1,0.95,1,0.95,0.75,0,1,-0.95]);{var l=[-1,-1,0.25,-1,1,0,0.25,1,-1,1];this.generatePolygon("tag",l),this.generateRoundPolygon("round-tag",l)}t.makePolygon=function(u){var f=u.join("$"),v="polygon-"+f,h;if(h=this[v])return h;return e.generatePolygon(v,u)}};var nn={};nn.timeToRender=function(){return this.redrawTotalTime/this.redrawCount};nn.redraw=function(t){t=t||Of();var e=this;if(e.averageRedrawTime===void 0)e.averageRedrawTime=0;if(e.lastRedrawTime===void 0)e.lastRedrawTime=0;if(e.lastDrawTime===void 0)e.lastDrawTime=0;e.requestedFrame=!0,e.renderOptions=t};nn.beforeRender=function(t,e){if(this.destroyed)return;if(e==null)it("Priority is not optional for beforeRender");var r=this.beforeRenderCallbacks;r.push({fn:t,priority:e}),r.sort(function(a,n){return n.priority-a.priority})};var _l=function(e,r,a){var n=e.beforeRenderCallbacks;for(var i=0;i<n.length;i++)n[i].fn(r,a)};nn.startRenderLoop=function(){var t=this,e=t.cy;if(t.renderLoopStarted)return;else t.renderLoopStarted=!0;var r=function(n){if(t.destroyed)return;if(e.batching());else if(t.requestedFrame&&!t.skipFrame){_l(t,!0,n);var i=ir();t.render(t.renderOptions);var s=t.lastDrawTime=ir();if(t.averageRedrawTime===void 0)t.averageRedrawTime=s-i;if(t.redrawCount===void 0)t.redrawCount=0;if(t.redrawCount++,t.redrawTotalTime===void 0)t.redrawTotalTime=0;var o=s-i;t.redrawTotalTime+=o,t.lastRedrawTime=o,t.averageRedrawTime=t.averageRedrawTime/2+o/2,t.requestedFrame=!1}else _l(t,!1,n);t.skipFrame=!1,Fn(r)};Fn(r)};var py=function(e){this.init(e)},Uv=py,ba=Uv.prototype;ba.clientFunctions=["redrawHint","render","renderTo","matchCanvasSize","nodeShapeImpl","arrowShapeImpl"];ba.init=function(t){var e=this;e.options=t,e.cy=t.cy;var r=e.container=t.cy.container(),a=e.cy.window();if(a){var n=a.document,i=n.head,s="__________cytoscape_stylesheet",o="__________cytoscape_container",l=n.getElementById(s)!=null;if(r.className.indexOf(o)<0)r.className=(r.className||"")+" "+o;if(!l){var u=n.createElement("style");u.id=s,u.textContent="."+o+" { position: relative; }",i.insertBefore(u,i.children[0])}var f=a.getComputedStyle(r),v=f.getPropertyValue("position");if(v==="static")_e("A Cytoscape container has style position:static and so can not use UI extensions properly")}e.selection=[void 0,void 0,void 0,void 0,0],e.bezierProjPcts=[0.05,0.225,0.4,0.5,0.6,0.775,0.95],e.hoverData={down:null,last:null,downTime:null,triggerMode:null,dragging:!1,initialPan:[null,null],capture:!1},e.dragData={possibleDragElements:[]},e.touchData={start:null,capture:!1,startPosition:[null,null,null,null,null,null],singleTouchStartTime:null,singleTouchMoved:!0,now:[null,null,null,null,null,null],earlier:[null,null,null,null,null,null]},e.redraws=0,e.showFps=t.showFps,e.debug=t.debug,e.webgl=t.webgl,e.hideEdgesOnViewport=t.hideEdgesOnViewport,e.textureOnViewport=t.textureOnViewport,e.wheelSensitivity=t.wheelSensitivity,e.motionBlurEnabled=t.motionBlur,e.forcedPixelRatio=he(t.pixelRatio)?t.pixelRatio:null,e.motionBlur=t.motionBlur,e.motionBlurOpacity=t.motionBlurOpacity,e.motionBlurTransparency=1-e.motionBlurOpacity,e.motionBlurPxRatio=1,e.mbPxRBlurry=1,e.minMbLowQualFrames=4,e.fullQualityMb=!1,e.clearedForMotionBlur=[],e.desktopTapThreshold=t.desktopTapThreshold,e.desktopTapThreshold2=t.desktopTapThreshold*t.desktopTapThreshold,e.touchTapThreshold=t.touchTapThreshold,e.touchTapThreshold2=t.touchTapThreshold*t.touchTapThreshold,e.tapholdDuration=500,e.bindings=[],e.beforeRenderCallbacks=[],e.beforeRenderPriorities={animations:400,eleCalcs:300,eleTxrDeq:200,lyrTxrDeq:150,lyrTxrSkip:100},e.registerNodeShapes(),e.registerArrowShapes(),e.registerCalculationListeners()};ba.notify=function(t,e){var r=this,a=r.cy;if(this.destroyed)return;if(t==="init"){r.load();return}if(t==="destroy"){r.destroy();return}if(t==="add"||t==="remove"||t==="move"&&a.hasCompoundNodes()||t==="load"||t==="zorder"||t==="mount")r.invalidateCachedZSortedEles();if(t==="viewport")r.redrawHint("select",!0);if(t==="gc")r.redrawHint("gc",!0);if(t==="load"||t==="resize"||t==="mount")r.invalidateContainerClientCoordsCache(),r.matchCanvasSize(r.container);r.redrawHint("eles",!0),r.redrawHint("drag",!0),this.startRenderLoop(),this.redraw()};ba.destroy=function(){var t=this;t.destroyed=!0,t.cy.stopAnimationLoop();for(var e=0;e<t.bindings.length;e++){var r=t.bindings[e],a=r,n=a.target;(n.off||n.removeEventListener).apply(n,a.args)}if(t.bindings=[],t.beforeRenderCallbacks=[],t.onUpdateEleCalcsFns=[],t.removeObserver)t.removeObserver.disconnect();if(t.styleObserver)t.styleObserver.disconnect();if(t.resizeObserver)t.resizeObserver.disconnect();if(t.labelCalcDiv)try{document.body.removeChild(t.labelCalcDiv)}catch(i){}};ba.isHeadless=function(){return!1};[Po,zv,Vv,ma,or,nn].forEach(function(t){Oe(ba,t)});var ks=16.666666666666668,Hv={setupDequeueing:function(e){return function(){var a=this,n=this.renderer;if(a.dequeueingSetup)return;else a.dequeueingSetup=!0;var i=ja(function(){n.redrawHint("eles",!0),n.redrawHint("drag",!0),n.redraw()},e.deqRedrawThreshold),s=function(u,f){var v=ir(),{averageRedrawTime:h,lastRedrawTime:c}=n,d=[],g=n.cy.extent(),y=n.getPixelRatio();if(!u)n.flushRenderedStyleQueue();while(!0){var p=ir(),m=p-v,b=p-f;if(c<ks){var E=ks-(u?h:0);if(b>=e.deqFastCost*E)break}else if(u){if(m>=e.deqCost*c||m>=e.deqAvgCost*h)break}else if(b>=e.deqNoDrawCost*ks)break;var A=e.deq(a,y,g);if(A.length>0)for(var M=0;M<A.length;M++)d.push(A[M]);else break}if(d.length>0){if(e.onDeqd(a,d),!u&&e.shouldRedraw(a,d,y,g))i()}},o=e.priority||po;n.beforeRender(s,o(a))}}},yy=function(){function t(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:zn;Mr(this,t),this.idsByKey=new nr,this.keyForId=new nr,this.cachesByLvl=new nr,this.lvls=[],this.getKey=e,this.doesEleInvalidateKey=r}return Lr(t,[{key:"getIdsFor",value:function(r){if(r==null)it("Can not get id list for null key");var a=this.idsByKey,n=this.idsByKey.get(r);if(!n)n=new da,a.set(r,n);return n}},{key:"addIdForKey",value:function(r,a){if(r!=null)this.getIdsFor(r).add(a)}},{key:"deleteIdForKey",value:function(r,a){if(r!=null)this.getIdsFor(r).delete(a)}},{key:"getNumberOfIdsForKey",value:function(r){if(r==null)return 0;else return this.getIdsFor(r).size}},{key:"updateKeyMappingFor",value:function(r){var a=r.id(),n=this.keyForId.get(a),i=this.getKey(r);this.deleteIdForKey(n,a),this.addIdForKey(i,a),this.keyForId.set(a,i)}},{key:"deleteKeyMappingFor",value:function(r){var a=r.id(),n=this.keyForId.get(a);this.deleteIdForKey(n,a),this.keyForId.delete(a)}},{key:"keyHasChangedFor",value:function(r){var a=r.id(),n=this.keyForId.get(a),i=this.getKey(r);return n!==i}},{key:"isInvalid",value:function(r){return this.keyHasChangedFor(r)||this.doesEleInvalidateKey(r)}},{key:"getCachesAt",value:function(r){var a=this.cachesByLvl,n=this.lvls,i=a.get(r);if(!i)i=new nr,a.set(r,i),n.push(r);return i}},{key:"getCache",value:function(r,a){return this.getCachesAt(a).get(r)}},{key:"get",value:function(r,a){var n=this.getKey(r),i=this.getCache(n,a);if(i!=null)this.updateKeyMappingFor(r);return i}},{key:"getForCachedKey",value:function(r,a){var n=this.keyForId.get(r.id()),i=this.getCache(n,a);return i}},{key:"hasCache",value:function(r,a){return this.getCachesAt(a).has(r)}},{key:"has",value:function(r,a){var n=this.getKey(r);return this.hasCache(n,a)}},{key:"setCache",value:function(r,a,n){n.key=r,this.getCachesAt(a).set(r,n)}},{key:"set",value:function(r,a,n){var i=this.getKey(r);this.setCache(i,a,n),this.updateKeyMappingFor(r)}},{key:"deleteCache",value:function(r,a){this.getCachesAt(a).delete(r)}},{key:"delete",value:function(r,a){var n=this.getKey(r);this.deleteCache(n,a)}},{key:"invalidateKey",value:function(r){var a=this;this.lvls.forEach(function(n){return a.deleteCache(r,n)})}},{key:"invalidate",value:function(r){var a=r.id(),n=this.keyForId.get(a);this.deleteKeyMappingFor(r);var i=this.doesEleInvalidateKey(r);if(i)this.invalidateKey(n);return i||this.getNumberOfIdsForKey(n)===0}}])}(),Ql=25,xn=50,On=-4,io=3,qv=7.99,my=8,by=1024,wy=1024,Ey=1024,xy=0.2,Ty=0.8,Cy=10,Sy=0.15,Dy=0.1,Ay=0.9,My=0.9,Ly=100,Ry=1,na={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},Py=St({getKey:null,doesEleInvalidateKey:zn,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:Rf,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),Ia=function(e,r){var a=this;a.renderer=e,a.onDequeues=[];var n=Py(r);Oe(a,n),a.lookup=new yy(n.getKey,n.doesEleInvalidateKey),a.setupDequeueing()},yt=Ia.prototype;yt.reasons=na;yt.getTextureQueue=function(t){var e=this;return e.eleImgCaches=e.eleImgCaches||{},e.eleImgCaches[t]=e.eleImgCaches[t]||[]};yt.getRetiredTextureQueue=function(t){var e=this,r=e.eleImgCaches.retired=e.eleImgCaches.retired||{},a=r[t]=r[t]||[];return a};yt.getElementQueue=function(){var t=this,e=t.eleCacheQueue=t.eleCacheQueue||new en(function(r,a){return a.reqs-r.reqs});return e};yt.getElementKeyToQueue=function(){var t=this,e=t.eleKeyToCacheQueue=t.eleKeyToCacheQueue||{};return e};yt.getElement=function(t,e,r,a,n){var i=this,s=this.renderer,o=s.cy.zoom(),l=this.lookup;if(!e||e.w===0||e.h===0||isNaN(e.w)||isNaN(e.h)||!t.visible()||t.removed())return null;if(!i.allowEdgeTxrCaching&&t.isEdge()||!i.allowParentTxrCaching&&t.isParent())return null;if(a==null)a=Math.ceil(mo(o*r));if(a<On)a=On;else if(o>=qv||a>io)return null;var u=Math.pow(2,a),f=e.h*u,v=e.w*u,h=s.eleTextBiggerThanMin(t,u);if(!this.isVisible(t,h))return null;var c=l.get(t,a);if(c&&c.invalidated)c.invalidated=!1,c.texture.invalidatedWidth-=c.width;if(c)return c;var d;if(f<=Ql)d=Ql;else if(f<=xn)d=xn;else d=Math.ceil(f/xn)*xn;if(f>Ey||v>wy)return null;var g=i.getTextureQueue(d),y=g[g.length-2],p=function(){return i.recycleTexture(d,v)||i.addTexture(d,v)};if(!y)y=g[g.length-1];if(!y)y=p();if(y.width-y.usedWidth<v)y=p();var m=function(C){return C&&C.scaledLabelShown===h},b=n&&n===na.dequeue,E=n&&n===na.highQuality,A=n&&n===na.downscale,M;for(var S=a+1;S<=io;S++){var P=l.get(t,S);if(P){M=P;break}}var N=M&&M.level===a+1?M:null,R=function(){y.context.drawImage(N.texture.canvas,N.x,0,N.width,N.height,y.usedWidth,0,v,f)};if(y.context.setTransform(1,0,0,1,0,0),y.context.clearRect(y.usedWidth,0,v,d),m(N))R();else if(m(M))if(E){for(var I=M.level;I>a;I--)N=i.getElement(t,e,r,I,na.downscale);R()}else return i.queueElement(t,M.level-1),M;else{var w;if(!b&&!E&&!A)for(var x=a-1;x>=On;x--){var T=l.get(t,x);if(T){w=T;break}}if(m(w))return i.queueElement(t,a),w;y.context.translate(y.usedWidth,0),y.context.scale(u,u),this.drawElement(y.context,t,e,h,!1),y.context.scale(1/u,1/u),y.context.translate(-y.usedWidth,0)}return c={x:y.usedWidth,texture:y,level:a,scale:u,width:v,height:f,scaledLabelShown:h},y.usedWidth+=Math.ceil(v+my),y.eleCaches.push(c),l.set(t,a,c),i.checkTextureFullness(y),c};yt.invalidateElements=function(t){for(var e=0;e<t.length;e++)this.invalidateElement(t[e])};yt.invalidateElement=function(t){var e=this,r=e.lookup,a=[],n=r.isInvalid(t);if(!n)return;for(var i=On;i<=io;i++){var s=r.getForCachedKey(t,i);if(s)a.push(s)}var o=r.invalidate(t);if(o)for(var l=0;l<a.length;l++){var u=a[l],f=u.texture;f.invalidatedWidth+=u.width,u.invalidated=!0,e.checkTextureUtility(f)}e.removeFromQueue(t)};yt.checkTextureUtility=function(t){if(t.invalidatedWidth>=xy*t.width)this.retireTexture(t)};yt.checkTextureFullness=function(t){var e=this,r=e.getTextureQueue(t.height);if(t.usedWidth/t.width>Ty&&t.fullnessChecks>=Cy)Tr(r,t);else t.fullnessChecks++};yt.retireTexture=function(t){var e=this,r=t.height,a=e.getTextureQueue(r),n=this.lookup;Tr(a,t),t.retired=!0;var i=t.eleCaches;for(var s=0;s<i.length;s++){var o=i[s];n.deleteCache(o.key,o.level)}yo(i);var l=e.getRetiredTextureQueue(r);l.push(t)};yt.addTexture=function(t,e){var r=this,a=r.getTextureQueue(t),n={};return a.push(n),n.eleCaches=[],n.height=t,n.width=Math.max(by,e),n.usedWidth=0,n.invalidatedWidth=0,n.fullnessChecks=0,n.canvas=r.renderer.makeOffscreenCanvas(n.width,n.height),n.context=n.canvas.getContext("2d"),n};yt.recycleTexture=function(t,e){var r=this,a=r.getTextureQueue(t),n=r.getRetiredTextureQueue(t);for(var i=0;i<n.length;i++){var s=n[i];if(s.width>=e)return s.retired=!1,s.usedWidth=0,s.invalidatedWidth=0,s.fullnessChecks=0,yo(s.eleCaches),s.context.setTransform(1,0,0,1,0,0),s.context.clearRect(0,0,s.width,s.height),Tr(n,s),a.push(s),s}};yt.queueElement=function(t,e){var r=this,a=r.getElementQueue(),n=r.getElementKeyToQueue(),i=this.getKey(t),s=n[i];if(s)s.level=Math.max(s.level,e),s.eles.merge(t),s.reqs++,a.updateItem(s);else{var o={eles:t.spawn().merge(t),level:e,reqs:1,key:i};a.push(o),n[i]=o}};yt.dequeue=function(t){var e=this,r=e.getElementQueue(),a=e.getElementKeyToQueue(),n=[],i=e.lookup;for(var s=0;s<Ry;s++)if(r.size()>0){var o=r.pop(),l=o.key,u=o.eles[0],f=i.hasCache(u,o.level);if(a[l]=null,f)continue;n.push(o);var v=e.getBoundingBox(u);e.getElement(u,v,t,o.level,na.dequeue)}else break;return n};yt.removeFromQueue=function(t){var e=this,r=e.getElementQueue(),a=e.getElementKeyToQueue(),n=this.getKey(t),i=a[n];if(i!=null)if(i.eles.length===1)i.reqs=go,r.updateItem(i),r.pop(),a[n]=null;else i.eles.unmerge(t)};yt.onDequeue=function(t){this.onDequeues.push(t)};yt.offDequeue=function(t){Tr(this.onDequeues,t)};yt.setupDequeueing=Hv.setupDequeueing({deqRedrawThreshold:Ly,deqCost:Sy,deqAvgCost:Dy,deqNoDrawCost:Ay,deqFastCost:My,deq:function(e,r,a){return e.dequeue(r,a)},onDeqd:function(e,r){for(var a=0;a<e.onDequeues.length;a++){var n=e.onDequeues[a];n(r)}},shouldRedraw:function(e,r,a,n){for(var i=0;i<r.length;i++){var s=r[i].eles;for(var o=0;o<s.length;o++){var l=s[o].boundingBox();if(wo(l,n))return!0}}return!1},priority:function(e){return e.renderer.beforeRenderPriorities.eleTxrDeq}});var Ny=1,ka=-4,Wn=2,Oy=3.99,Iy=50,By=50,ky=0.15,Fy=0.1,zy=0.9,Vy=0.9,Gy=1,Jl=250,Uy=16000000,jl=32767,Hy=!0,Yv=function(e){var r=this,a=r.renderer=e,n=a.cy;r.layersByLevel={},r.firstGet=!0,r.lastInvalidationTime=ir()-2*Jl,r.skipping=!1,r.eleTxrDeqs=n.collection(),r.scheduleElementRefinement=ja(function(){r.refineElementTextures(r.eleTxrDeqs),r.eleTxrDeqs.unmerge(r.eleTxrDeqs)},By),a.beforeRender(function(s,o){if(o-r.lastInvalidationTime<=Jl)r.skipping=!0;else r.skipping=!1},a.beforeRenderPriorities.lyrTxrSkip);var i=function(o,l){return l.reqs-o.reqs};r.layersQueue=new en(i),r.setupDequeueing()},Dt=Yv.prototype,ef=0,qy=Math.pow(2,53)-1;Dt.makeLayer=function(t,e){var r=Math.pow(2,e),a=Math.ceil(t.w*r),n=Math.ceil(t.h*r),i=this.renderer.makeOffscreenCanvas(a,n),s={id:ef=++ef%qy,bb:t,level:e,width:a,height:n,canvas:i,context:i.getContext("2d"),eles:[],elesQueue:[],reqs:0},o=s.context,l=-s.bb.x1,u=-s.bb.y1;return o.scale(r,r),o.translate(l,u),s};Dt.getLayers=function(t,e,r){var a=this,n=a.renderer,i=n.cy,s=i.zoom(),o=a.firstGet;if(a.firstGet=!1,r==null){if(r=Math.ceil(mo(s*e)),r<ka)r=ka;else if(s>=Oy||r>Wn)return null}a.validateLayersElesOrdering(r,t);var l=a.layersByLevel,u=Math.pow(2,r),f=l[r]=l[r]||[],v,h=a.levelIsComplete(r,t),c,d=function(){var R=function(D){if(a.validateLayersElesOrdering(D,t),a.levelIsComplete(D,t))return c=l[D],!0},I=function(D){if(c)return;for(var C=r+D;ka<=C&&C<=Wn;C+=D)if(R(C))break};I(1),I(-1);for(var w=f.length-1;w>=0;w--){var x=f[w];if(x.invalid)Tr(f,x)}};if(!h)d();else return f;var g=function(){if(!v){v=Ot();for(var R=0;R<t.length;R++)Fc(v,t[R].boundingBox())}return v},y=function(R){R=R||{};var I=R.after;g();var w=Math.ceil(v.w*u),x=Math.ceil(v.h*u);if(w>jl||x>jl)return null;var T=w*x;if(T>Uy)return null;var D=a.makeLayer(v,r);if(I!=null){var C=f.indexOf(I)+1;f.splice(C,0,D)}else if(R.insert===void 0||R.insert)f.unshift(D);return D};if(a.skipping&&!o)return null;var p=null,m=t.length/Ny,b=!o;for(var E=0;E<t.length;E++){var A=t[E],M=A._private.rscratch,S=M.imgLayerCaches=M.imgLayerCaches||{},P=S[r];if(P){p=P;continue}if(!p||p.eles.length>=m||!Ff(p.bb,A.boundingBox())){if(p=y({insert:!0,after:p}),!p)return null}if(c||b)a.queueLayer(p,A);else a.drawEleInLayer(p,A,r,e);p.eles.push(A),S[r]=p}if(c)return c;if(b)return null;return f};Dt.getEleLevelForLayerLevel=function(t,e){return t};Dt.drawEleInLayer=function(t,e,r,a){var n=this,i=this.renderer,s=t.context,o=e.boundingBox();if(o.w===0||o.h===0||!e.visible())return;r=n.getEleLevelForLayerLevel(r,a),i.setImgSmoothing(s,!1),i.drawCachedElement(s,e,null,null,r,Hy),i.setImgSmoothing(s,!0)};Dt.levelIsComplete=function(t,e){var r=this,a=r.layersByLevel[t];if(!a||a.length===0)return!1;var n=0;for(var i=0;i<a.length;i++){var s=a[i];if(s.reqs>0)return!1;if(s.invalid)return!1;n+=s.eles.length}if(n!==e.length)return!1;return!0};Dt.validateLayersElesOrdering=function(t,e){var r=this.layersByLevel[t];if(!r)return;for(var a=0;a<r.length;a++){var n=r[a],i=-1;for(var s=0;s<e.length;s++)if(n.eles[0]===e[s]){i=s;break}if(i<0){this.invalidateLayer(n);continue}var o=i;for(var s=0;s<n.eles.length;s++)if(n.eles[s]!==e[o+s]){this.invalidateLayer(n);break}}};Dt.updateElementsInLayers=function(t,e){var r=this,a=Za(t[0]);for(var n=0;n<t.length;n++){var i=a?null:t[n],s=a?t[n]:t[n].ele,o=s._private.rscratch,l=o.imgLayerCaches=o.imgLayerCaches||{};for(var u=ka;u<=Wn;u++){var f=l[u];if(!f)continue;if(i&&r.getEleLevelForLayerLevel(f.level)!==i.level)continue;e(f,s,i)}}};Dt.haveLayers=function(){var t=this,e=!1;for(var r=ka;r<=Wn;r++){var a=t.layersByLevel[r];if(a&&a.length>0){e=!0;break}}return e};Dt.invalidateElements=function(t){var e=this;if(t.length===0)return;if(e.lastInvalidationTime=ir(),t.length===0||!e.haveLayers())return;e.updateElementsInLayers(t,function(a,n,i){e.invalidateLayer(a)})};Dt.invalidateLayer=function(t){if(this.lastInvalidationTime=ir(),t.invalid)return;var{level:e,eles:r}=t,a=this.layersByLevel[e];if(Tr(a,t),t.elesQueue=[],t.invalid=!0,t.replacement)t.replacement.invalid=!0;for(var n=0;n<r.length;n++){var i=r[n]._private.rscratch.imgLayerCaches;if(i)i[e]=null}};Dt.refineElementTextures=function(t){var e=this;e.updateElementsInLayers(t,function(a,n,i){var s=a.replacement;if(!s)s=a.replacement=e.makeLayer(a.bb,a.level),s.replaces=a,s.eles=a.eles;if(!s.reqs)for(var o=0;o<s.eles.length;o++)e.queueLayer(s,s.eles[o])})};Dt.enqueueElementRefinement=function(t){this.eleTxrDeqs.merge(t),this.scheduleElementRefinement()};Dt.queueLayer=function(t,e){var r=this,a=r.layersQueue,n=t.elesQueue,i=n.hasId=n.hasId||{};if(t.replacement)return;if(e){if(i[e.id()])return;n.push(e),i[e.id()]=!0}if(t.reqs)t.reqs++,a.updateItem(t);else t.reqs=1,a.push(t)};Dt.dequeue=function(t){var e=this,r=e.layersQueue,a=[],n=0;while(n<Gy){if(r.size()===0)break;var i=r.peek();if(i.replacement){r.pop();continue}if(i.replaces&&i!==i.replaces.replacement){r.pop();continue}if(i.invalid){r.pop();continue}var s=i.elesQueue.shift();if(s)e.drawEleInLayer(i,s,i.level,t),n++;if(a.length===0)a.push(!0);if(i.elesQueue.length===0){if(r.pop(),i.reqs=0,i.replaces)e.applyLayerReplacement(i);e.requestRedraw()}}return a};Dt.applyLayerReplacement=function(t){var e=this,r=e.layersByLevel[t.level],a=t.replaces,n=r.indexOf(a);if(n<0||a.invalid)return;r[n]=t;for(var i=0;i<t.eles.length;i++){var s=t.eles[i]._private,o=s.imgLayerCaches=s.imgLayerCaches||{};if(o)o[t.level]=t}e.requestRedraw()};Dt.requestRedraw=ja(function(){var t=this.renderer;t.redrawHint("eles",!0),t.redrawHint("drag",!0),t.redraw()},100);Dt.setupDequeueing=Hv.setupDequeueing({deqRedrawThreshold:Iy,deqCost:ky,deqAvgCost:Fy,deqNoDrawCost:zy,deqFastCost:Vy,deq:function(e,r){return e.dequeue(r)},onDeqd:po,shouldRedraw:Rf,priority:function(e){return e.renderer.beforeRenderPriorities.lyrTxrDeq}});var Xv={},tf;function Yy(t,e){for(var r=0;r<e.length;r++){var a=e[r];t.lineTo(a.x,a.y)}}function Xy(t,e,r){var a;for(var n=0;n<e.length;n++){var i=e[n];if(n===0)a=i;t.lineTo(i.x,i.y)}t.quadraticCurveTo(r.x,r.y,a.x,a.y)}function rf(t,e,r){if(t.beginPath)t.beginPath();var a=e;for(var n=0;n<a.length;n++){var i=a[n];t.lineTo(i.x,i.y)}var s=r,o=r[0];t.moveTo(o.x,o.y);for(var n=1;n<s.length;n++){var i=s[n];t.lineTo(i.x,i.y)}if(t.closePath)t.closePath()}function Wy(t,e,r,a,n){if(t.beginPath)t.beginPath();t.arc(r,a,n,0,Math.PI*2,!1);var i=e,s=i[0];t.moveTo(s.x,s.y);for(var o=0;o<i.length;o++){var l=i[o];t.lineTo(l.x,l.y)}if(t.closePath)t.closePath()}function $y(t,e,r,a){t.arc(e,r,a,0,Math.PI*2,!1)}Xv.arrowShapeImpl=function(t){return(tf||(tf={polygon:Yy,"triangle-backcurve":Xy,"triangle-tee":rf,"circle-triangle":Wy,"triangle-cross":rf,circle:$y}))[t]};var tr={};tr.drawElement=function(t,e,r,a,n,i){var s=this;if(e.isNode())s.drawNode(t,e,r,a,n,i);else s.drawEdge(t,e,r,a,n,i)};tr.drawElementOverlay=function(t,e){var r=this;if(e.isNode())r.drawNodeOverlay(t,e);else r.drawEdgeOverlay(t,e)};tr.drawElementUnderlay=function(t,e){var r=this;if(e.isNode())r.drawNodeUnderlay(t,e);else r.drawEdgeUnderlay(t,e)};tr.drawCachedElementPortion=function(t,e,r,a,n,i,s,o){var l=this,u=r.getBoundingBox(e);if(u.w===0||u.h===0)return;var f=r.getElement(e,u,a,n,i);if(f!=null){var v=o(l,e);if(v===0)return;var h=s(l,e),{x1:c,y1:d,w:g,h:y}=u,p,m,b,E,A;if(h!==0){var M=r.getRotationPoint(e);if(b=M.x,E=M.y,t.translate(b,E),t.rotate(h),A=l.getImgSmoothing(t),!A)l.setImgSmoothing(t,!0);var S=r.getRotationOffset(e);p=S.x,m=S.y}else p=c,m=d;var P;if(v!==1)P=t.globalAlpha,t.globalAlpha=P*v;if(t.drawImage(f.texture.canvas,f.x,0,f.width,f.height,p,m,g,y),v!==1)t.globalAlpha=P;if(h!==0){if(t.rotate(-h),t.translate(-b,-E),!A)l.setImgSmoothing(t,!1)}}else r.drawElement(t,e)};var Ky=function(){return 0},Zy=function(e,r){return e.getTextAngle(r,null)},_y=function(e,r){return e.getTextAngle(r,"source")},Qy=function(e,r){return e.getTextAngle(r,"target")},Jy=function(e,r){return r.effectiveOpacity()},Fs=function(e,r){return r.pstyle("text-opacity").pfValue*r.effectiveOpacity()};tr.drawCachedElement=function(t,e,r,a,n,i){var s=this,o=s.data,{eleTxrCache:l,lblTxrCache:u,slbTxrCache:f,tlbTxrCache:v}=o,h=e.boundingBox(),c=i===!0?l.reasons.highQuality:null;if(h.w===0||h.h===0||!e.visible())return;if(!a||wo(h,a)){var d=e.isEdge(),g=e.element()._private.rscratch.badLine;if(s.drawElementUnderlay(t,e),s.drawCachedElementPortion(t,e,l,r,n,c,Ky,Jy),!d||!g)s.drawCachedElementPortion(t,e,u,r,n,c,Zy,Fs);if(d&&!g)s.drawCachedElementPortion(t,e,f,r,n,c,_y,Fs),s.drawCachedElementPortion(t,e,v,r,n,c,Qy,Fs);s.drawElementOverlay(t,e)}};tr.drawElements=function(t,e){var r=this;for(var a=0;a<e.length;a++){var n=e[a];r.drawElement(t,n)}};tr.drawCachedElements=function(t,e,r,a){var n=this;for(var i=0;i<e.length;i++){var s=e[i];n.drawCachedElement(t,s,r,a)}};tr.drawCachedNodes=function(t,e,r,a){var n=this;for(var i=0;i<e.length;i++){var s=e[i];if(!s.isNode())continue;n.drawCachedElement(t,s,r,a)}};tr.drawLayeredElements=function(t,e,r,a){var n=this,i=n.data.lyrTxrCache.getLayers(e,r);if(i)for(var s=0;s<i.length;s++){var o=i[s],l=o.bb;if(l.w===0||l.h===0)continue;t.drawImage(o.canvas,l.x1,l.y1,l.w,l.h)}else n.drawCachedElements(t,e,r,a)};var ur={};ur.drawEdge=function(t,e,r){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,n=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,s=this,o=e._private.rscratch;if(i&&!e.visible())return;if(o.badLine||o.allpts==null||isNaN(o.allpts[0]))return;var l;if(r)l=r,t.translate(-l.x1,-l.y1);var u=i?e.pstyle("opacity").value:1,f=i?e.pstyle("line-opacity").value:1,v=e.pstyle("curve-style").value,h=e.pstyle("line-style").value,c=e.pstyle("width").pfValue,d=e.pstyle("line-cap").value,g=e.pstyle("line-outline-width").value,y=e.pstyle("line-outline-color").value,p=u*f,m=u*f,b=function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:p;if(v==="straight-triangle")s.eleStrokeStyle(t,e,D),s.drawEdgeTrianglePath(e,t,o.allpts);else t.lineWidth=c,t.lineCap=d,s.eleStrokeStyle(t,e,D),s.drawEdgePath(e,t,o.allpts,h),t.lineCap="butt"},E=function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:p;if(t.lineWidth=c+g,t.lineCap=d,g>0)s.colorStrokeStyle(t,y[0],y[1],y[2],D);else{t.lineCap="butt";return}if(v==="straight-triangle")s.drawEdgeTrianglePath(e,t,o.allpts);else s.drawEdgePath(e,t,o.allpts,h),t.lineCap="butt"},A=function(){if(!n)return;s.drawEdgeOverlay(t,e)},M=function(){if(!n)return;s.drawEdgeUnderlay(t,e)},S=function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:m;s.drawArrowheads(t,e,D)},P=function(){s.drawElementText(t,e,null,a)};t.lineJoin="round";var N=e.pstyle("ghost").value==="yes";if(N){var R=e.pstyle("ghost-offset-x").pfValue,I=e.pstyle("ghost-offset-y").pfValue,w=e.pstyle("ghost-opacity").value,x=p*w;t.translate(R,I),b(x),S(x),t.translate(-R,-I)}else E();if(M(),b(),S(),A(),P(),r)t.translate(l.x1,l.y1)};var Wv=function(e){if(!["overlay","underlay"].includes(e))throw Error("Invalid state");return function(r,a){if(!a.visible())return;var n=a.pstyle("".concat(e,"-opacity")).value;if(n===0)return;var i=this,s=i.usePaths(),o=a._private.rscratch,l=a.pstyle("".concat(e,"-padding")).pfValue,u=2*l,f=a.pstyle("".concat(e,"-color")).value;if(r.lineWidth=u,o.edgeType==="self"&&!s)r.lineCap="butt";else r.lineCap="round";i.colorStrokeStyle(r,f[0],f[1],f[2],n),i.drawEdgePath(a,r,o.allpts,"solid")}};ur.drawEdgeOverlay=Wv("overlay");ur.drawEdgeUnderlay=Wv("underlay");ur.drawEdgePath=function(t,e,r,a){var n=t._private.rscratch,i=e,s,o=!1,l=this.usePaths(),u=t.pstyle("line-dash-pattern").pfValue,f=t.pstyle("line-dash-offset").pfValue;if(l){var v=r.join("$"),h=n.pathCacheKey&&n.pathCacheKey===v;if(h)s=e=n.pathCache,o=!0;else s=e=new Path2D,n.pathCacheKey=v,n.pathCache=s}if(i.setLineDash)switch(a){case"dotted":i.setLineDash([1,1]);break;case"dashed":i.setLineDash(u),i.lineDashOffset=f;break;case"solid":i.setLineDash([]);break}if(!o&&!n.badLine){if(e.beginPath)e.beginPath();switch(e.moveTo(r[0],r[1]),n.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var c=2;c+3<r.length;c+=4)e.quadraticCurveTo(r[c],r[c+1],r[c+2],r[c+3]);break;case"straight":case"haystack":for(var d=2;d+1<r.length;d+=2)e.lineTo(r[d],r[d+1]);break;case"segments":if(n.isRound){var g=kt(n.roundCorners),y;try{for(g.s();!(y=g.n()).done;){var p=y.value;Ov(e,p)}}catch(b){g.e(b)}finally{g.f()}e.lineTo(r[r.length-2],r[r.length-1])}else for(var m=2;m+1<r.length;m+=2)e.lineTo(r[m],r[m+1]);break}}if(e=i,l)e.stroke(s);else e.stroke();if(e.setLineDash)e.setLineDash([])};ur.drawEdgeTrianglePath=function(t,e,r){e.fillStyle=e.strokeStyle;var a=t.pstyle("width").pfValue;for(var n=0;n+1<r.length;n+=2){var i=[r[n+2]-r[n],r[n+3]-r[n+1]],s=Math.sqrt(i[0]*i[0]+i[1]*i[1]),o=[i[1]/s,-i[0]/s],l=[o[0]*a/2,o[1]*a/2];e.beginPath(),e.moveTo(r[n]-l[0],r[n+1]-l[1]),e.lineTo(r[n]+l[0],r[n+1]+l[1]),e.lineTo(r[n+2],r[n+3]),e.closePath(),e.fill()}};ur.drawArrowheads=function(t,e,r){var a=e._private.rscratch,n=a.edgeType==="haystack";if(!n)this.drawArrowhead(t,e,"source",a.arrowStartX,a.arrowStartY,a.srcArrowAngle,r);if(this.drawArrowhead(t,e,"mid-target",a.midX,a.midY,a.midtgtArrowAngle,r),this.drawArrowhead(t,e,"mid-source",a.midX,a.midY,a.midsrcArrowAngle,r),!n)this.drawArrowhead(t,e,"target",a.arrowEndX,a.arrowEndY,a.tgtArrowAngle,r)};ur.drawArrowhead=function(t,e,r,a,n,i,s){if(isNaN(a)||a==null||isNaN(n)||n==null||isNaN(i)||i==null)return;var o=this,l=e.pstyle(r+"-arrow-shape").value;if(l==="none")return;var u=e.pstyle(r+"-arrow-fill").value==="hollow"?"both":"filled",f=e.pstyle(r+"-arrow-fill").value,v=e.pstyle("width").pfValue,h=e.pstyle(r+"-arrow-width"),c=h.value==="match-line"?v:h.pfValue;if(h.units==="%")c*=v;var d=e.pstyle("opacity").value;if(s===void 0)s=d;var g=t.globalCompositeOperation;if(s!==1||f==="hollow")t.globalCompositeOperation="destination-out",o.colorFillStyle(t,255,255,255,1),o.colorStrokeStyle(t,255,255,255,1),o.drawArrowShape(e,t,u,v,l,c,a,n,i),t.globalCompositeOperation=g;var y=e.pstyle(r+"-arrow-color").value;o.colorFillStyle(t,y[0],y[1],y[2],s),o.colorStrokeStyle(t,y[0],y[1],y[2],s),o.drawArrowShape(e,t,f,v,l,c,a,n,i)};ur.drawArrowShape=function(t,e,r,a,n,i,s,o,l){var u=this,f=this.usePaths()&&n!=="triangle-cross",v=!1,h,c=e,d={x:s,y:o},g=t.pstyle("arrow-scale").value,y=this.getArrowWidth(a,g),p=u.arrowShapes[n];if(f){var m=u.arrowPathCache=u.arrowPathCache||[],b=Gr(n),E=m[b];if(E!=null)h=e=E,v=!0;else h=e=new Path2D,m[b]=h}if(!v){if(e.beginPath)e.beginPath();if(f)p.draw(e,1,0,{x:0,y:0},1);else p.draw(e,y,l,d,a);if(e.closePath)e.closePath()}if(e=c,f)e.translate(s,o),e.rotate(l),e.scale(y,y);if(r==="filled"||r==="both")if(f)e.fill(h);else e.fill();if(r==="hollow"||r==="both")if(e.lineWidth=i/(f?y:1),e.lineJoin="miter",f)e.stroke(h);else e.stroke();if(f)e.scale(1/y,1/y),e.rotate(-l),e.translate(-s,-o)};var Io={};Io.safeDrawImage=function(t,e,r,a,n,i,s,o,l,u){if(n<=0||i<=0||l<=0||u<=0)return;try{t.drawImage(e,r,a,n,i,s,o,l,u)}catch(f){_e(f)}};Io.drawInscribedImage=function(t,e,r,a,n){var i=this,s=r.position(),{x:o,y:l}=s,u=r.cy().style(),f=u.getIndexedStyle.bind(u),v=f(r,"background-fit","value",a),h=f(r,"background-repeat","value",a),c=r.width(),d=r.height(),g=r.padding()*2,y=c+(f(r,"background-width-relative-to","value",a)==="inner"?0:g),p=d+(f(r,"background-height-relative-to","value",a)==="inner"?0:g),m=r._private.rscratch,b=f(r,"background-clip","value",a),E=b==="node",A=f(r,"background-image-opacity","value",a)*n,M=f(r,"background-image-smoothing","value",a),S=r.pstyle("corner-radius").value;if(S!=="auto")S=r.pstyle("corner-radius").pfValue;var P=e.width||e.cachedW,N=e.height||e.cachedH;if(P==null||N==null)document.body.appendChild(e),P=e.cachedW=e.width||e.offsetWidth,N=e.cachedH=e.height||e.offsetHeight,document.body.removeChild(e);var R=P,I=N;if(f(r,"background-width","value",a)!=="auto")if(f(r,"background-width","units",a)==="%")R=f(r,"background-width","pfValue",a)*y;else R=f(r,"background-width","pfValue",a);if(f(r,"background-height","value",a)!=="auto")if(f(r,"background-height","units",a)==="%")I=f(r,"background-height","pfValue",a)*p;else I=f(r,"background-height","pfValue",a);if(R===0||I===0)return;if(v==="contain"){var w=Math.min(y/R,p/I);R*=w,I*=w}else if(v==="cover"){var w=Math.max(y/R,p/I);R*=w,I*=w}var x=o-y/2,T=f(r,"background-position-x","units",a),D=f(r,"background-position-x","pfValue",a);if(T==="%")x+=(y-R)*D;else x+=D;var C=f(r,"background-offset-x","units",a),O=f(r,"background-offset-x","pfValue",a);if(C==="%")x+=(y-R)*O;else x+=O;var B=l-p/2,z=f(r,"background-position-y","units",a),V=f(r,"background-position-y","pfValue",a);if(z==="%")B+=(p-I)*V;else B+=V;var k=f(r,"background-offset-y","units",a),G=f(r,"background-offset-y","pfValue",a);if(k==="%")B+=(p-I)*G;else B+=G;if(m.pathCache)x-=o,B-=l,o=0,l=0;var J=t.globalAlpha;t.globalAlpha=A;var X=i.getImgSmoothing(t),_=!1;if(M==="no"&&X)i.setImgSmoothing(t,!1),_=!0;else if(M==="yes"&&!X)i.setImgSmoothing(t,!0),_=!0;if(h==="no-repeat"){if(E)if(t.save(),m.pathCache)t.clip(m.pathCache);else i.nodeShapes[i.getNodeShape(r)].draw(t,o,l,y,p,S,m),t.clip();if(i.safeDrawImage(t,e,0,0,P,N,x,B,R,I),E)t.restore()}else{var Q=t.createPattern(e,h);t.fillStyle=Q,i.nodeShapes[i.getNodeShape(r)].draw(t,o,l,y,p,S,m),t.translate(x,B),t.fill(),t.translate(-x,-B)}if(t.globalAlpha=J,_)i.setImgSmoothing(t,X)};var Wr={};Wr.eleTextBiggerThanMin=function(t,e){if(!e){var r=t.cy().zoom(),a=this.getPixelRatio(),n=Math.ceil(mo(r*a));e=Math.pow(2,n)}var i=t.pstyle("font-size").pfValue*e,s=t.pstyle("min-zoomed-font-size").pfValue;if(i<s)return!1;return!0};Wr.drawElementText=function(t,e,r,a,n){var i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,s=this;if(a==null){if(i&&!s.eleTextBiggerThanMin(e))return}else if(a===!1)return;if(e.isNode()){var o=e.pstyle("label");if(!o||!o.value)return;var l=s.getLabelJustification(e),u=e.pstyle("text-metrics").strValue==="glyph";t.textAlign=l,t.textBaseline=u?"alphabetic":"bottom"}else{var f=e.element()._private.rscratch.badLine,v=e.pstyle("label"),h=e.pstyle("source-label"),c=e.pstyle("target-label");if(f||(!v||!v.value)&&(!h||!h.value)&&(!c||!c.value))return;t.textAlign="center",t.textBaseline="bottom"}var d=!r,g;if(r)g=r,t.translate(-g.x1,-g.y1);if(n==null){if(s.drawText(t,e,null,d,i),e.isEdge())s.drawText(t,e,"source",d,i),s.drawText(t,e,"target",d,i)}else s.drawText(t,e,n,d,i);if(r)t.translate(g.x1,g.y1)};Wr.getFontCache=function(t){var e;this.fontCaches=this.fontCaches||[];for(var r=0;r<this.fontCaches.length;r++)if(e=this.fontCaches[r],e.context===t)return e;return e={context:t},this.fontCaches.push(e),e};Wr.setupTextStyle=function(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,a=e.pstyle("font-style").strValue,n=e.pstyle("font-size").pfValue+"px",i=e.pstyle("font-family").strValue,s=e.pstyle("font-weight").strValue,o=r?e.effectiveOpacity()*e.pstyle("text-opacity").value:1,l=e.pstyle("text-outline-opacity").value*o,u=e.pstyle("color").value,f=e.pstyle("text-outline-color").value;t.font=a+" "+s+" "+n+" "+i,t.lineJoin="round",this.colorFillStyle(t,u[0],u[1],u[2],o),this.colorStrokeStyle(t,f[0],f[1],f[2],l)};function jy(t,e,r,a,n){var i=Math.min(a,n),s=i/2,o=e+a/2,l=r+n/2;t.beginPath(),t.arc(o,l,s,0,Math.PI*2),t.closePath()}function af(t,e,r,a,n){var i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:5,s=Math.min(i,a/2,n/2);t.beginPath(),t.moveTo(e+s,r),t.lineTo(e+a-s,r),t.quadraticCurveTo(e+a,r,e+a,r+s),t.lineTo(e+a,r+n-s),t.quadraticCurveTo(e+a,r+n,e+a-s,r+n),t.lineTo(e+s,r+n),t.quadraticCurveTo(e,r+n,e,r+n-s),t.lineTo(e,r+s),t.quadraticCurveTo(e,r,e+s,r),t.closePath()}Wr.getTextAngle=function(t,e){var r,a=t._private,n=a.rscratch,i=e?e+"-":"",s=t.pstyle(i+"text-rotation");if(s.strValue==="autorotate"){var o=Nt(n,"labelAngle",e);r=t.isEdge()?o:0}else if(s.strValue==="none")r=0;else r=s.pfValue;return r};Wr.drawText=function(t,e,r){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,n=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=e._private,s=i.rscratch,o=n?e.effectiveOpacity():1;if(n&&(o===0||e.pstyle("text-opacity").value===0))return;if(r==="main")r=null;var l=Nt(s,"labelX",r),u=Nt(s,"labelY",r),f,v,h=this.getLabelText(e,r);if(h!=null&&h!==""&&!isNaN(l)&&!isNaN(u)){this.setupTextStyle(t,e,n);var c=r?r+"-":"",d=Nt(s,"labelWidth",r),g=Nt(s,"labelHeight",r),y=Nt(s,"labelActualDescent",r),p=e.pstyle(c+"text-margin-x").pfValue,m=e.pstyle(c+"text-margin-y").pfValue,b=e.isEdge(),E=e.pstyle("text-halign").value,A=e.pstyle("text-valign").value;if(b)E="center",A="center";l+=p,u+=m;var M;if(!a)M=0;else M=this.getTextAngle(e,r);if(M!==0)f=l,v=u,t.translate(f,v),t.rotate(M),l=0,u=0;var S=ha(E),P=ca(A);switch(P){case"top":break;case"center":u+=g/2;break;case"bottom":u+=g;break}var N=e.pstyle("text-background-opacity").value,R=e.pstyle("text-border-opacity").value,I=e.pstyle("text-border-width").pfValue,w=e.pstyle("text-background-padding").pfValue,x=e.pstyle("text-background-shape").strValue,T=x==="round-rectangle"||x==="roundrectangle",D=x==="circle",C=2;if(N>0||I>0&&R>0){var{fillStyle:O,strokeStyle:B,lineWidth:z}=t,V=e.pstyle("text-background-color").value,k=e.pstyle("text-border-color").value,G=e.pstyle("text-border-style").value,J=N>0,X=I>0&&R>0,_=l-w;switch(S){case"left":_-=d;break;case"center":_-=d/2;break}var Q=u-g-w,q=d+2*w,te=g+2*w;if(J)t.fillStyle="rgba(".concat(V[0],",").concat(V[1],",").concat(V[2],",").concat(N*o,")");if(X){if(t.strokeStyle="rgba(".concat(k[0],",").concat(k[1],",").concat(k[2],",").concat(R*o,")"),t.lineWidth=I,t.setLineDash)switch(G){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"double":t.lineWidth=I/4,t.setLineDash([]);break;case"solid":default:t.setLineDash([]);break}}if(T)t.beginPath(),af(t,_,Q,q,te,C);else if(D)t.beginPath(),jy(t,_,Q,q,te);else t.beginPath(),t.rect(_,Q,q,te);if(J)t.fill();if(X)t.stroke();if(X&&G==="double"){var Z=I/2;if(t.beginPath(),T)af(t,_+Z,Q+Z,q-2*Z,te-2*Z,C);else t.rect(_+Z,Q+Z,q-2*Z,te-2*Z);t.stroke()}if(t.fillStyle=O,t.strokeStyle=B,t.lineWidth=z,t.setLineDash)t.setLineDash([])}var U=2*e.pstyle("text-outline-width").pfValue;if(U>0)t.lineWidth=U;if(u-=y,e.pstyle("text-wrap").value==="wrap"){var W=Nt(s,"labelWrapCachedLines",r),j=Nt(s,"labelLineHeight",r),re=d/2,ee=this.getLabelJustification(e);if(ee==="auto");else if(S==="left"){if(ee==="left")l+=-d;else if(ee==="center")l+=-re}else if(S==="center"){if(ee==="left")l+=-re;else if(ee==="right")l+=re}else if(S==="right"){if(ee==="center")l+=re;else if(ee==="right")l+=d}switch(P){case"top":u-=(W.length-1)*j;break;case"center":case"bottom":u-=(W.length-1)*j;break}for(var de=0;de<W.length;de++){if(U>0)t.strokeText(W[de],l,u);t.fillText(W[de],l,u),u+=j}}else{if(U>0)t.strokeText(h,l,u);t.fillText(h,l,u)}if(M!==0)t.rotate(-M),t.translate(-f,-v)}};var Pr={};Pr.drawNode=function(t,e,r){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,n=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,s=this,o,l,u=e._private,f=u.rscratch,v=e.position();if(!he(v.x)||!he(v.y))return;if(i&&!e.visible())return;var h=i?e.effectiveOpacity():1,c=s.usePaths(),d,g=!1,y=e.padding();o=e.width()+2*y,l=e.height()+2*y;var p;if(r)p=r,t.translate(-p.x1,-p.y1);var m=e.pstyle("background-image"),b=m.value,E=Array(b.length),A=Array(b.length),M=0;for(var S=0;S<b.length;S++){var P=b[S],N=E[S]=P!=null&&P!=="none";if(N){var R=e.cy().style().getIndexedStyle(e,"background-image-crossorigin","value",S);M++,A[S]=s.getCachedImage(P,R,function(){u.backgroundTimestamp=Date.now(),e.emitAndNotify("background")})}}var I=e.pstyle("background-blacken").value,w=e.pstyle("border-width").pfValue,x=e.pstyle("background-opacity").value*h,T=e.pstyle("border-color").value,D=e.pstyle("border-style").value,C=e.pstyle("border-join").value,O=e.pstyle("border-cap").value,B=e.pstyle("border-position").value,z=e.pstyle("border-dash-pattern").pfValue,V=e.pstyle("border-dash-offset").pfValue,k=e.pstyle("border-opacity").value*h,G=e.pstyle("outline-width").pfValue,J=e.pstyle("outline-color").value,X=e.pstyle("outline-style").value,_=e.pstyle("outline-opacity").value*h,Q=e.pstyle("outline-offset").value,q=e.pstyle("corner-radius").value;if(q!=="auto")q=e.pstyle("corner-radius").pfValue;var te=function(){var F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:x;s.eleFillStyle(t,e,F)},Z=function(){var F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:k;s.colorStrokeStyle(t,T[0],T[1],T[2],F)},U=function(){var F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:_;s.colorStrokeStyle(t,J[0],J[1],J[2],F)},W=function(F,Y,H,K){var se=s.nodePathCache=s.nodePathCache||[],ae=Lf(H==="polygon"?H+","+K.join(","):H,""+Y,""+F,""+q),oe=se[ae],ne,ue=!1;if(oe!=null)ne=oe,ue=!0,f.pathCache=ne;else ne=new Path2D,se[ae]=f.pathCache=ne;return{path:ne,cacheHit:ue}},j=e.pstyle("shape").strValue,re=e.pstyle("shape-polygon-points").pfValue;if(c){t.translate(v.x,v.y);var ee=W(o,l,j,re);d=ee.path,g=ee.cacheHit}var de=function(){if(!g){var F=v;if(c)F={x:0,y:0};s.nodeShapes[s.getNodeShape(e)].draw(d||t,F.x,F.y,o,l,q,f)}if(c)t.fill(d);else t.fill()},Ae=function(){var F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:h,Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,H=u.backgrounding,K=0;for(var se=0;se<A.length;se++){var ae=e.cy().style().getIndexedStyle(e,"background-image-containment","value",se);if(Y&&ae==="over"||!Y&&ae==="inside"){K++;continue}if(E[se]&&A[se].complete&&!A[se].error)K++,s.drawInscribedImage(t,A[se],e,se,F)}if(u.backgrounding=K!==M,H!==u.backgrounding)e.updateStyle(!1)},Ce=function(){var F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:h;if(s.hasPie(e)){if(s.drawPie(t,e,Y),F){if(!c)s.nodeShapes[s.getNodeShape(e)].draw(t,v.x,v.y,o,l,q,f)}}},Se=function(){var F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:h;if(s.hasStripe(e)){if(t.save(),c)t.clip(f.pathCache);else s.nodeShapes[s.getNodeShape(e)].draw(t,v.x,v.y,o,l,q,f),t.clip();if(s.drawStripe(t,e,Y),t.restore(),F){if(!c)s.nodeShapes[s.getNodeShape(e)].draw(t,v.x,v.y,o,l,q,f)}}},ge=function(){var F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:h,Y=(I>0?I:-I)*F,H=I>0?0:255;if(I!==0)if(s.colorFillStyle(t,H,H,H,Y),c)t.fill(d);else t.fill()},ve=function(){if(w>0){if(t.lineWidth=w,t.lineCap=O,t.lineJoin=C,t.setLineDash)switch(D){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash(z),t.lineDashOffset=V;break;case"solid":case"double":t.setLineDash([]);break}if(B!=="center"){if(t.save(),t.lineWidth*=2,B==="inside")c?t.clip(d):t.clip();else{var F=new Path2D;F.rect(-o/2-w,-l/2-w,o+2*w,l+2*w),F.addPath(d),t.clip(F,"evenodd")}c?t.stroke(d):t.stroke(),t.restore()}else c?t.stroke(d):t.stroke();if(D==="double"){t.lineWidth=w/3;var Y=t.globalCompositeOperation;if(t.globalCompositeOperation="destination-out",c)t.stroke(d);else t.stroke();t.globalCompositeOperation=Y}if(t.setLineDash)t.setLineDash([])}},ye=function(){if(G>0){if(t.lineWidth=G,t.lineCap="butt",t.setLineDash)switch(X){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"solid":case"double":t.setLineDash([]);break}var F=v;if(c)F={x:0,y:0};var Y=s.getNodeShape(e),H=w;if(B==="inside")H=0;if(B==="outside")H*=2;var K=(o+H+(G+Q))/o,se=(l+H+(G+Q))/l,ae=o*K,oe=l*se,ne=s.nodeShapes[Y].points,ue;if(c){var be=W(ae,oe,Y,ne);ue=be.path}if(Y==="ellipse")s.drawEllipsePath(ue||t,F.x,F.y,ae,oe);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(Y)){var fe=0,le=0,De=0;if(Y==="round-diamond")fe=(H+Q+G)*1.4;else if(Y==="round-heptagon")fe=(H+Q+G)*1.075,De=-(H/2+Q+G)/35;else if(Y==="round-hexagon")fe=(H+Q+G)*1.12;else if(Y==="round-pentagon")fe=(H+Q+G)*1.13,De=-(H/2+Q+G)/15;else if(Y==="round-tag")fe=(H+Q+G)*1.12,le=(H/2+G+Q)*0.07;else if(Y==="round-triangle")fe=(H+Q+G)*(Math.PI/2),De=-(H+Q/2+G)/Math.PI;if(fe!==0){if(K=(o+fe)/o,ae=o*K,!["round-hexagon","round-tag"].includes(Y))se=(l+fe)/l,oe=l*se}q=q==="auto"?Gf(ae,oe):q;var ce=ae/2,pe=oe/2,Ie=q+(H+G+Q)/2,xe=Array(ne.length/2),me=Array(ne.length/2);for(var Ve=0;Ve<ne.length/2;Ve++)xe[Ve]={x:F.x+le+ce*ne[Ve*2],y:F.y+De+pe*ne[Ve*2+1]};var Be,Ke,He,Le,nt=xe.length;Ke=xe[nt-1];for(Be=0;Be<nt;Be++)He=xe[Be%nt],Le=xe[(Be+1)%nt],me[Be]=No(Ke,He,Le,Ie),Ke=He,He=Le;s.drawRoundPolygonPath(ue||t,F.x+le,F.y+De,o*K,l*se,ne,me)}else if(["roundrectangle","round-rectangle"].includes(Y))q=q==="auto"?Cr(ae,oe):q,s.drawRoundRectanglePath(ue||t,F.x,F.y,ae,oe,q+(H+G+Q)/2);else if(["cutrectangle","cut-rectangle"].includes(Y))q=q==="auto"?Eo():q,s.drawCutRectanglePath(ue||t,F.x,F.y,ae,oe,null,q+(H+G+Q)/4);else if(["bottomroundrectangle","bottom-round-rectangle"].includes(Y))q=q==="auto"?Cr(ae,oe):q,s.drawBottomRoundRectanglePath(ue||t,F.x,F.y,ae,oe,q+(H+G+Q)/2);else if(Y==="barrel")s.drawBarrelPath(ue||t,F.x,F.y,ae,oe);else if(Y.startsWith("polygon")||["rhomboid","right-rhomboid","round-tag","tag","vee"].includes(Y)){var Ye=(H+G+Q)/o;ne=Vn(Gn(ne,Ye)),s.drawPolygonPath(ue||t,F.x,F.y,o,l,ne)}else{var tt=(H+G+Q)/o;ne=Vn(Gn(ne,-tt)),s.drawPolygonPath(ue||t,F.x,F.y,o,l,ne)}if(c)t.stroke(ue);else t.stroke();if(X==="double"){t.lineWidth=H/3;var ct=t.globalCompositeOperation;if(t.globalCompositeOperation="destination-out",c)t.stroke(ue);else t.stroke();t.globalCompositeOperation=ct}if(t.setLineDash)t.setLineDash([])}},Ee=function(){if(n)s.drawNodeOverlay(t,e,v,o,l)},Pe=function(){if(n)s.drawNodeUnderlay(t,e,v,o,l)},Me=function(){s.drawElementText(t,e,null,a)},Ne=e.pstyle("ghost").value==="yes";if(Ne){var Fe=e.pstyle("ghost-offset-x").pfValue,ze=e.pstyle("ghost-offset-y").pfValue,Ue=e.pstyle("ghost-opacity").value,ie=Ue*h;t.translate(Fe,ze),U(),ye(),te(Ue*x),de(),Ae(ie,!0),Z(Ue*k),ve(),Ce(I!==0||w!==0),Se(I!==0||w!==0),Ae(ie,!1),ge(ie),t.translate(-Fe,-ze)}if(c)t.translate(-v.x,-v.y);if(Pe(),c)t.translate(v.x,v.y);if(U(),ye(),te(),de(),Ae(h,!0),Z(),ve(),Ce(I!==0||w!==0),Se(I!==0||w!==0),Ae(h,!1),ge(),c)t.translate(-v.x,-v.y);if(Me(),Ee(),r)t.translate(p.x1,p.y1)};var $v=function(e){if(!["overlay","underlay"].includes(e))throw Error("Invalid state");return function(r,a,n,i,s){var o=this;if(!a.visible())return;var l=a.pstyle("".concat(e,"-padding")).pfValue,u=a.pstyle("".concat(e,"-opacity")).value,f=a.pstyle("".concat(e,"-color")).value,v=a.pstyle("".concat(e,"-shape")).value,h=a.pstyle("".concat(e,"-corner-radius")).value;if(u>0){if(n=n||a.position(),i==null||s==null){var c=a.padding();i=a.width()+2*c,s=a.height()+2*c}o.colorFillStyle(r,f[0],f[1],f[2],u),o.nodeShapes[v].draw(r,n.x,n.y,i+l*2,s+l*2,h),r.fill()}}};Pr.drawNodeOverlay=$v("overlay");Pr.drawNodeUnderlay=$v("underlay");Pr.hasPie=function(t){return t=t[0],t._private.hasPie};Pr.hasStripe=function(t){return t=t[0],t._private.hasStripe};Pr.drawPie=function(t,e,r,a){e=e[0],a=a||e.position();var n=e.cy().style(),i=e.pstyle("pie-size"),s=e.pstyle("pie-hole"),o=e.pstyle("pie-start-angle").pfValue,l=a.x,u=a.y,f=e.width(),v=e.height(),h=Math.min(f,v)/2,c,d=0,g=this.usePaths();if(g)l=0,u=0;if(i.units==="%")h=h*i.pfValue;else if(i.pfValue!==void 0)h=i.pfValue/2;if(s.units==="%")c=h*s.pfValue;else if(s.pfValue!==void 0)c=s.pfValue/2;if(c>=h)return;for(var y=1;y<=n.pieBackgroundN;y++){var p=e.pstyle("pie-"+y+"-background-size").value,m=e.pstyle("pie-"+y+"-background-color").value,b=e.pstyle("pie-"+y+"-background-opacity").value*r,E=p/100;if(E+d>1)E=1-d;var A=1.5*Math.PI+2*Math.PI*d;A+=o;var M=2*Math.PI*E,S=A+M;if(p===0||d>=1||d+E>1)continue;if(c===0)t.beginPath(),t.moveTo(l,u),t.arc(l,u,h,A,S),t.closePath();else t.beginPath(),t.arc(l,u,h,A,S),t.arc(l,u,c,S,A,!0),t.closePath();this.colorFillStyle(t,m[0],m[1],m[2],b),t.fill(),d+=E}};Pr.drawStripe=function(t,e,r,a){e=e[0],a=a||e.position();var n=e.cy().style(),i=a.x,s=a.y,o=e.width(),l=e.height(),u=0,f=this.usePaths();t.save();var v=e.pstyle("stripe-direction").value,h=e.pstyle("stripe-size");switch(v){case"vertical":break;case"righward":t.rotate(-Math.PI/2);break}var c=o,d=l;if(h.units==="%")c=c*h.pfValue,d=d*h.pfValue;else if(h.pfValue!==void 0)c=h.pfValue,d=h.pfValue;if(f)i=0,s=0;s-=c/2,i-=d/2;for(var g=1;g<=n.stripeBackgroundN;g++){var y=e.pstyle("stripe-"+g+"-background-size").value,p=e.pstyle("stripe-"+g+"-background-color").value,m=e.pstyle("stripe-"+g+"-background-opacity").value*r,b=y/100;if(b+u>1)b=1-u;if(y===0||u>=1||u+b>1)continue;t.beginPath(),t.rect(i,s+d*u,c,d*b),t.closePath(),this.colorFillStyle(t,p[0],p[1],p[2],m),t.fill(),u+=b}t.restore()};var It={},em=100;It.getPixelRatio=function(){var t=this.data.contexts[0];if(this.forcedPixelRatio!=null)return this.forcedPixelRatio;var e=this.cy.window(),r=t.backingStorePixelRatio||t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return(e.devicePixelRatio||1)/r};It.paintCache=function(t){var e=this.paintCaches=this.paintCaches||[],r=!0,a;for(var n=0;n<e.length;n++)if(a=e[n],a.context===t){r=!1;break}if(r)a={context:t},e.push(a);return a};It.createGradientStyleFor=function(t,e,r,a,n){var i,s=this.usePaths(),o=r.pstyle(e+"-gradient-stop-colors").value,l=r.pstyle(e+"-gradient-stop-positions").pfValue;if(a==="radial-gradient")if(r.isEdge()){var u=r.sourceEndpoint(),f=r.targetEndpoint(),v=r.midpoint(),h=Ur(u,v),c=Ur(f,v);i=t.createRadialGradient(v.x,v.y,0,v.x,v.y,Math.max(h,c))}else{var d=s?{x:0,y:0}:r.position(),g=r.paddedWidth(),y=r.paddedHeight();i=t.createRadialGradient(d.x,d.y,0,d.x,d.y,Math.max(g,y))}else if(r.isEdge()){var p=r.sourceEndpoint(),m=r.targetEndpoint();i=t.createLinearGradient(p.x,p.y,m.x,m.y)}else{var b=s?{x:0,y:0}:r.position(),E=r.paddedWidth(),A=r.paddedHeight(),M=E/2,S=A/2,P=r.pstyle("background-gradient-direction").value;switch(P){case"to-bottom":i=t.createLinearGradient(b.x,b.y-S,b.x,b.y+S);break;case"to-top":i=t.createLinearGradient(b.x,b.y+S,b.x,b.y-S);break;case"to-left":i=t.createLinearGradient(b.x+M,b.y,b.x-M,b.y);break;case"to-right":i=t.createLinearGradient(b.x-M,b.y,b.x+M,b.y);break;case"to-bottom-right":case"to-right-bottom":i=t.createLinearGradient(b.x-M,b.y-S,b.x+M,b.y+S);break;case"to-top-right":case"to-right-top":i=t.createLinearGradient(b.x-M,b.y+S,b.x+M,b.y-S);break;case"to-bottom-left":case"to-left-bottom":i=t.createLinearGradient(b.x+M,b.y-S,b.x-M,b.y+S);break;case"to-top-left":case"to-left-top":i=t.createLinearGradient(b.x+M,b.y+S,b.x-M,b.y-S);break}}if(!i)return null;var N=l.length===o.length,R=o.length;for(var I=0;I<R;I++)i.addColorStop(N?l[I]:I/(R-1),"rgba("+o[I][0]+","+o[I][1]+","+o[I][2]+","+n+")");return i};It.gradientFillStyle=function(t,e,r,a){var n=this.createGradientStyleFor(t,"background",e,r,a);if(!n)return null;t.fillStyle=n};It.colorFillStyle=function(t,e,r,a,n){t.fillStyle="rgba("+e+","+r+","+a+","+n+")"};It.eleFillStyle=function(t,e,r){var a=e.pstyle("background-fill").value;if(a==="linear-gradient"||a==="radial-gradient")this.gradientFillStyle(t,e,a,r);else{var n=e.pstyle("background-color").value;this.colorFillStyle(t,n[0],n[1],n[2],r)}};It.gradientStrokeStyle=function(t,e,r,a){var n=this.createGradientStyleFor(t,"line",e,r,a);if(!n)return null;t.strokeStyle=n};It.colorStrokeStyle=function(t,e,r,a,n){t.strokeStyle="rgba("+e+","+r+","+a+","+n+")"};It.eleStrokeStyle=function(t,e,r){var a=e.pstyle("line-fill").value;if(a==="linear-gradient"||a==="radial-gradient")this.gradientStrokeStyle(t,e,a,r);else{var n=e.pstyle("line-color").value;this.colorStrokeStyle(t,n[0],n[1],n[2],r)}};It.matchCanvasSize=function(t){var e=this,r=e.data,a=e.findContainerClientCoords(),n=a[2],i=a[3],s=e.getPixelRatio(),o=e.motionBlurPxRatio;if(t===e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE]||t===e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG])s=o;var l=n*s,u=i*s,f;if(l===e.canvasWidth&&u===e.canvasHeight)return;e.fontCaches=null;var v=r.canvasContainer;v.style.width=n+"px",v.style.height=i+"px";for(var h=0;h<e.CANVAS_LAYERS;h++)f=r.canvases[h],f.width=l,f.height=u,f.style.width=n+"px",f.style.height=i+"px";for(var h=0;h<e.BUFFER_COUNT;h++)f=r.bufferCanvases[h],f.width=l,f.height=u,f.style.width=n+"px",f.style.height=i+"px";if(e.textureMult=1,s<=1)f=r.bufferCanvases[e.TEXTURE_BUFFER],e.textureMult=2,f.width=l*e.textureMult,f.height=u*e.textureMult;e.canvasWidth=l,e.canvasHeight=u,e.pixelRatio=s};It.renderTo=function(t,e,r,a){this.render({forcedContext:t,forcedZoom:e,forcedPan:r,drawAllLayers:!0,forcedPxRatio:a})};It.clearCanvas=function(){var t=this,e=t.data;function r(a){a.clearRect(0,0,t.canvasWidth,t.canvasHeight)}r(e.contexts[t.NODE]),r(e.contexts[t.DRAG])};It.render=function(t){var e=this;t=t||Of();var r=e.cy,a=t.forcedContext,n=t.drawAllLayers,i=t.drawOnlyNodeLayer,s=t.forcedZoom,o=t.forcedPan,l=t.forcedPxRatio===void 0?this.getPixelRatio():t.forcedPxRatio,u=e.data,f=u.canvasNeedsRedraw,v=e.textureOnViewport&&!a&&(e.pinching||e.hoverData.dragging||e.swipePanning||e.data.wheelZooming),h=t.motionBlur!==void 0?t.motionBlur:e.motionBlur,c=e.motionBlurPxRatio,d=r.hasCompoundNodes(),g=e.hoverData.draggingEles,y=e.hoverData.selecting||e.touchData.selecting?!0:!1;h=h&&!a&&e.motionBlurEnabled&&!y;var p=h;if(!a){if(e.prevPxRatio!==l)e.invalidateContainerClientCoordsCache(),e.matchCanvasSize(e.container),e.redrawHint("eles",!0),e.redrawHint("drag",!0);e.prevPxRatio=l}if(!a&&e.motionBlurTimeout)clearTimeout(e.motionBlurTimeout);if(h){if(e.mbFrames==null)e.mbFrames=0;if(e.mbFrames++,e.mbFrames<3)p=!1;if(e.mbFrames>e.minMbLowQualFrames)e.motionBlurPxRatio=e.mbPxRBlurry}if(e.clearingMotionBlur)e.motionBlurPxRatio=1;if(e.textureDrawLastFrame&&!v)f[e.NODE]=!0,f[e.SELECT_BOX]=!0;var m=r.style(),b=r.zoom(),E=s!==void 0?s:b,A=r.pan(),M={x:A.x,y:A.y},S={zoom:b,pan:{x:A.x,y:A.y}},P=e.prevViewport,N=P===void 0||S.zoom!==P.zoom||S.pan.x!==P.pan.x||S.pan.y!==P.pan.y;if(!N&&!(g&&!d))e.motionBlurPxRatio=1;if(o)M=o;E*=l,M.x*=l,M.y*=l;var R=e.getCachedZSortedEles();function I(Z,U,W,j,re){var ee=Z.globalCompositeOperation;Z.globalCompositeOperation="destination-out",e.colorFillStyle(Z,255,255,255,e.motionBlurTransparency),Z.fillRect(U,W,j,re),Z.globalCompositeOperation=ee}function w(Z,U){var W,j,re,ee;if(!e.clearingMotionBlur&&(Z===u.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]||Z===u.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG]))W={x:A.x*c,y:A.y*c},j=b*c,re=e.canvasWidth*c,ee=e.canvasHeight*c;else W=M,j=E,re=e.canvasWidth,ee=e.canvasHeight;if(Z.setTransform(1,0,0,1,0,0),U==="motionBlur")I(Z,0,0,re,ee);else if(!a&&(U===void 0||U))Z.clearRect(0,0,re,ee);if(!n)Z.translate(W.x,W.y),Z.scale(j,j);if(o)Z.translate(o.x,o.y);if(s)Z.scale(s,s)}if(!v)e.textureDrawLastFrame=!1;if(v){if(e.textureDrawLastFrame=!0,!e.textureCache){e.textureCache={},e.textureCache.bb=r.mutableElements().boundingBox(),e.textureCache.texture=e.data.bufferCanvases[e.TEXTURE_BUFFER];var x=e.data.bufferContexts[e.TEXTURE_BUFFER];x.setTransform(1,0,0,1,0,0),x.clearRect(0,0,e.canvasWidth*e.textureMult,e.canvasHeight*e.textureMult),e.render({forcedContext:x,drawOnlyNodeLayer:!0,forcedPxRatio:l*e.textureMult});var S=e.textureCache.viewport={zoom:r.zoom(),pan:r.pan(),width:e.canvasWidth,height:e.canvasHeight};S.mpan={x:(0-S.pan.x)/S.zoom,y:(0-S.pan.y)/S.zoom}}f[e.DRAG]=!1,f[e.NODE]=!1;var T=u.contexts[e.NODE],D=e.textureCache.texture,S=e.textureCache.viewport;if(T.setTransform(1,0,0,1,0,0),h)I(T,0,0,S.width,S.height);else T.clearRect(0,0,S.width,S.height);var C=m.core("outside-texture-bg-color").value,O=m.core("outside-texture-bg-opacity").value;e.colorFillStyle(T,C[0],C[1],C[2],O),T.fillRect(0,0,S.width,S.height);var b=r.zoom();w(T,!1),T.clearRect(S.mpan.x,S.mpan.y,S.width/S.zoom/l,S.height/S.zoom/l),T.drawImage(D,S.mpan.x,S.mpan.y,S.width/S.zoom/l,S.height/S.zoom/l)}else if(e.textureOnViewport&&!a)e.textureCache=null;var B=r.extent(),z=e.pinching||e.hoverData.dragging||e.swipePanning||e.data.wheelZooming||e.hoverData.draggingEles||e.cy.animated(),V=e.hideEdgesOnViewport&&z,k=[];if(k[e.NODE]=!f[e.NODE]&&h&&!e.clearedForMotionBlur[e.NODE]||e.clearingMotionBlur,k[e.NODE])e.clearedForMotionBlur[e.NODE]=!0;if(k[e.DRAG]=!f[e.DRAG]&&h&&!e.clearedForMotionBlur[e.DRAG]||e.clearingMotionBlur,k[e.DRAG])e.clearedForMotionBlur[e.DRAG]=!0;if(f[e.NODE]||n||i||k[e.NODE]){var G=h&&!k[e.NODE]&&c!==1,T=a||(G?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]:u.contexts[e.NODE]),J=h&&!G?"motionBlur":void 0;if(w(T,J),V)e.drawCachedNodes(T,R.nondrag,l,B);else e.drawLayeredElements(T,R.nondrag,l,B);if(e.debug)e.drawDebugPoints(T,R.nondrag);if(!n&&!h)f[e.NODE]=!1}if(!i&&(f[e.DRAG]||n||k[e.DRAG])){var G=h&&!k[e.DRAG]&&c!==1,T=a||(G?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG]:u.contexts[e.DRAG]);if(w(T,h&&!G?"motionBlur":void 0),V)e.drawCachedNodes(T,R.drag,l,B);else e.drawCachedElements(T,R.drag,l,B);if(e.debug)e.drawDebugPoints(T,R.drag);if(!n&&!h)f[e.DRAG]=!1}if(this.drawSelectionRectangle(t,w),h&&c!==1){var X=u.contexts[e.NODE],_=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE],Q=u.contexts[e.DRAG],q=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG],te=function(U,W,j){if(U.setTransform(1,0,0,1,0,0),j||!p)U.clearRect(0,0,e.canvasWidth,e.canvasHeight);else I(U,0,0,e.canvasWidth,e.canvasHeight);var re=c;U.drawImage(W,0,0,e.canvasWidth*re,e.canvasHeight*re,0,0,e.canvasWidth,e.canvasHeight)};if(f[e.NODE]||k[e.NODE])te(X,_,k[e.NODE]),f[e.NODE]=!1;if(f[e.DRAG]||k[e.DRAG])te(Q,q,k[e.DRAG]),f[e.DRAG]=!1}if(e.prevViewport=S,e.clearingMotionBlur)e.clearingMotionBlur=!1,e.motionBlurCleared=!0,e.motionBlur=!0;if(h)e.motionBlurTimeout=setTimeout(function(){e.motionBlurTimeout=null,e.clearedForMotionBlur[e.NODE]=!1,e.clearedForMotionBlur[e.DRAG]=!1,e.motionBlur=!1,e.clearingMotionBlur=!v,e.mbFrames=0,f[e.NODE]=!0,f[e.DRAG]=!0,e.redraw()},em);if(!a)r.emit("render")};var La;It.drawSelectionRectangle=function(t,e){var r=this,{cy:a,data:n}=r,i=a.style(),{drawOnlyNodeLayer:s,drawAllLayers:o}=t,l=n.canvasNeedsRedraw,u=t.forcedContext;if(r.showFps||!s&&l[r.SELECT_BOX]&&!o){var f=u||n.contexts[r.SELECT_BOX];if(e(f),r.selection[4]==1&&(r.hoverData.selecting||r.touchData.selecting)){var v=r.cy.zoom(),h=i.core("selection-box-border-width").value/v;if(f.lineWidth=h,f.fillStyle="rgba("+i.core("selection-box-color").value[0]+","+i.core("selection-box-color").value[1]+","+i.core("selection-box-color").value[2]+","+i.core("selection-box-opacity").value+")",f.fillRect(r.selection[0],r.selection[1],r.selection[2]-r.selection[0],r.selection[3]-r.selection[1]),h>0)f.strokeStyle="rgba("+i.core("selection-box-border-color").value[0]+","+i.core("selection-box-border-color").value[1]+","+i.core("selection-box-border-color").value[2]+","+i.core("selection-box-opacity").value+")",f.strokeRect(r.selection[0],r.selection[1],r.selection[2]-r.selection[0],r.selection[3]-r.selection[1])}if(n.bgActivePosistion&&!r.hoverData.selecting){var v=r.cy.zoom(),c=n.bgActivePosistion;f.fillStyle="rgba("+i.core("active-bg-color").value[0]+","+i.core("active-bg-color").value[1]+","+i.core("active-bg-color").value[2]+","+i.core("active-bg-opacity").value+")",f.beginPath(),f.arc(c.x,c.y,i.core("active-bg-size").pfValue/v,0,2*Math.PI),f.fill()}var d=r.lastRedrawTime;if(r.showFps&&d){d=Math.round(d);var g=Math.round(1000/d),y="1 frame = "+d+" ms = "+g+" fps";if(f.setTransform(1,0,0,1,0,0),f.fillStyle="rgba(255, 0, 0, 0.75)",f.strokeStyle="rgba(255, 0, 0, 0.75)",f.font="30px Arial",!La){var p=f.measureText(y);La=p.actualBoundingBoxAscent}f.fillText(y,0,La);var m=60;f.strokeRect(0,La+10,250,20),f.fillRect(0,La+10,250*Math.min(g/m,1),20)}if(!o)l[r.SELECT_BOX]=!1}};function nf(t,e,r){var a=t.createShader(e);if(t.shaderSource(a,r),t.compileShader(a),!t.getShaderParameter(a,t.COMPILE_STATUS))throw Error(t.getShaderInfoLog(a));return a}function tm(t,e,r){var a=nf(t,t.VERTEX_SHADER,e),n=nf(t,t.FRAGMENT_SHADER,r),i=t.createProgram();if(t.attachShader(i,a),t.attachShader(i,n),t.linkProgram(i),!t.getProgramParameter(i,t.LINK_STATUS))throw Error("Could not initialize shaders");return i}function rm(t,e,r){if(r===void 0)r=e;var a=t.makeOffscreenCanvas(e,r),n=a.context=a.getContext("2d");return a.clear=function(){return n.clearRect(0,0,a.width,a.height)},a.clear(),a}function Bo(t){var e=t.pixelRatio,r=t.cy.zoom(),a=t.cy.pan();return{zoom:r*e,pan:{x:a.x*e,y:a.y*e}}}function am(t){var e=t.pixelRatio,r=t.cy.zoom();return r*e}function nm(t,e,r,a,n){var i=a*r+e.x,s=n*r+e.y;return s=Math.round(t.canvasHeight-s),[i,s]}function im(t,e){if(e.picking)return!0;else{if(t.pstyle("background-fill").value!=="solid")return!1;if(t.pstyle("background-image").strValue!=="none")return!1;if(t.pstyle("border-width").value===0)return!0;if(t.pstyle("border-opacity").value===0)return!0;if(t.pstyle("border-style").value!=="solid")return!1;return!0}}function sm(t,e){if(t.length!==e.length)return!1;for(var r=0;r<t.length;r++)if(t[r]!==e[r])return!1;return!0}function Ir(t,e,r){var a=t[0]/255,n=t[1]/255,i=t[2]/255,s=e,o=r||[,,,,];return o[0]=a*s,o[1]=n*s,o[2]=i*s,o[3]=s,o}function jr(t,e){var r=e||[,,,,];return r[0]=(t>>0&255)/255,r[1]=(t>>8&255)/255,r[2]=(t>>16&255)/255,r[3]=(t>>24&255)/255,r}function om(t){return t[0]+(t[1]<<8)+(t[2]<<16)+(t[3]<<24)}function um(t,e){var r=t.createTexture();return r.buffer=function(a){t.bindTexture(t.TEXTURE_2D,r),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR_MIPMAP_NEAREST),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,a),t.generateMipmap(t.TEXTURE_2D),t.bindTexture(t.TEXTURE_2D,null)},r.deleteTexture=function(){t.deleteTexture(r)},r}function Kv(t,e){switch(e){case"float":return[1,t.FLOAT,4];case"vec2":return[2,t.FLOAT,4];case"vec3":return[3,t.FLOAT,4];case"vec4":return[4,t.FLOAT,4];case"int":return[1,t.INT,4];case"ivec2":return[2,t.INT,4]}}function Zv(t,e,r){switch(e){case t.FLOAT:return new Float32Array(r);case t.INT:return new Int32Array(r)}}function lm(t,e,r,a,n,i){switch(e){case t.FLOAT:return new Float32Array(r.buffer,i*a,n);case t.INT:return new Int32Array(r.buffer,i*a,n)}}function fm(t,e,r,a){var n=Kv(t,e),i=ht(n,2),s=i[0],o=i[1],l=Zv(t,o,a),u=t.createBuffer();if(t.bindBuffer(t.ARRAY_BUFFER,u),t.bufferData(t.ARRAY_BUFFER,l,t.STATIC_DRAW),o===t.FLOAT)t.vertexAttribPointer(r,s,o,!1,0,0);else if(o===t.INT)t.vertexAttribIPointer(r,s,o,0,0);return t.enableVertexAttribArray(r),t.bindBuffer(t.ARRAY_BUFFER,null),u}function Zt(t,e,r,a){var n=Kv(t,r),i=ht(n,3),s=i[0],o=i[1],l=i[2],u=Zv(t,o,e*s),f=s*l,v=t.createBuffer();if(t.bindBuffer(t.ARRAY_BUFFER,v),t.bufferData(t.ARRAY_BUFFER,e*f,t.DYNAMIC_DRAW),t.enableVertexAttribArray(a),o===t.FLOAT)t.vertexAttribPointer(a,s,o,!1,f,0);else if(o===t.INT)t.vertexAttribIPointer(a,s,o,f,0);t.vertexAttribDivisor(a,1),t.bindBuffer(t.ARRAY_BUFFER,null);var h=Array(e);for(var c=0;c<e;c++)h[c]=lm(t,o,u,f,s,c);return v.dataArray=u,v.stride=f,v.size=s,v.getView=function(d){return h[d]},v.setPoint=function(d,g,y){var p=h[d];p[0]=g,p[1]=y},v.bufferSubData=function(d){if(t.bindBuffer(t.ARRAY_BUFFER,v),d)t.bufferSubData(t.ARRAY_BUFFER,0,u,0,d*s);else t.bufferSubData(t.ARRAY_BUFFER,0,u)},v}function vm(t,e,r){var a=9,n=new Float32Array(e*a),i=Array(e);for(var s=0;s<e;s++){var o=s*a*4;i[s]=new Float32Array(n.buffer,o,a)}var l=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,l),t.bufferData(t.ARRAY_BUFFER,n.byteLength,t.DYNAMIC_DRAW);for(var u=0;u<3;u++){var f=r+u;t.enableVertexAttribArray(f),t.vertexAttribPointer(f,3,t.FLOAT,!1,36,u*12),t.vertexAttribDivisor(f,1)}return t.bindBuffer(t.ARRAY_BUFFER,null),l.getMatrixView=function(v){return i[v]},l.setData=function(v,h){i[h].set(v,0)},l.bufferSubData=function(){t.bindBuffer(t.ARRAY_BUFFER,l),t.bufferSubData(t.ARRAY_BUFFER,0,n)},l}function hm(t){var e=t.createFramebuffer();t.bindFramebuffer(t.FRAMEBUFFER,e);var r=t.createTexture();return t.bindTexture(t.TEXTURE_2D,r),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,r,0),t.bindFramebuffer(t.FRAMEBUFFER,null),e.setFramebufferAttachmentSizes=function(a,n){t.bindTexture(t.TEXTURE_2D,r),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,a,n,0,t.RGBA,t.UNSIGNED_BYTE,null)},e}var sf=typeof Float32Array<"u"?Float32Array:Array;if(!Math.hypot)Math.hypot=function(){var t=0,e=arguments.length;while(e--)t+=arguments[e]*arguments[e];return Math.sqrt(t)};function zs(){var t=new sf(9);if(sf!=Float32Array)t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0;return t[0]=1,t[4]=1,t[8]=1,t}function of(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function cm(t,e,r){var a=e[0],n=e[1],i=e[2],s=e[3],o=e[4],l=e[5],u=e[6],f=e[7],v=e[8],h=r[0],c=r[1],d=r[2],g=r[3],y=r[4],p=r[5],m=r[6],b=r[7],E=r[8];return t[0]=h*a+c*s+d*u,t[1]=h*n+c*o+d*f,t[2]=h*i+c*l+d*v,t[3]=g*a+y*s+p*u,t[4]=g*n+y*o+p*f,t[5]=g*i+y*l+p*v,t[6]=m*a+b*s+E*u,t[7]=m*n+b*o+E*f,t[8]=m*i+b*l+E*v,t}function In(t,e,r){var a=e[0],n=e[1],i=e[2],s=e[3],o=e[4],l=e[5],u=e[6],f=e[7],v=e[8],h=r[0],c=r[1];return t[0]=a,t[1]=n,t[2]=i,t[3]=s,t[4]=o,t[5]=l,t[6]=h*a+c*s+u,t[7]=h*n+c*o+f,t[8]=h*i+c*l+v,t}function uf(t,e,r){var a=e[0],n=e[1],i=e[2],s=e[3],o=e[4],l=e[5],u=e[6],f=e[7],v=e[8],h=Math.sin(r),c=Math.cos(r);return t[0]=c*a+h*s,t[1]=c*n+h*o,t[2]=c*i+h*l,t[3]=c*s-h*a,t[4]=c*o-h*n,t[5]=c*l-h*i,t[6]=u,t[7]=f,t[8]=v,t}function so(t,e,r){var a=r[0],n=r[1];return t[0]=a*e[0],t[1]=a*e[1],t[2]=a*e[2],t[3]=n*e[3],t[4]=n*e[4],t[5]=n*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function dm(t,e,r){return t[0]=2/e,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/r,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t}var gm=function(){function t(e,r,a,n){Mr(this,t),this.debugID=Math.floor(Math.random()*1e4),this.r=e,this.texSize=r,this.texRows=a,this.texHeight=Math.floor(r/a),this.enableWrapping=!0,this.locked=!1,this.texture=null,this.needsBuffer=!0,this.freePointer={x:0,row:0},this.keyToLocation=new Map,this.canvas=n(e,r,r),this.scratch=n(e,r,this.texHeight,"scratch")}return Lr(t,[{key:"lock",value:function(){this.locked=!0}},{key:"getKeys",value:function(){return new Set(this.keyToLocation.keys())}},{key:"getScale",value:function(r){var{w:a,h:n}=r,i=this.texHeight,s=this.texSize,o=i/n,l=a*o,u=n*o;if(l>s)o=s/a,l=a*o,u=n*o;return{scale:o,texW:l,texH:u}}},{key:"draw",value:function(r,a,n){var i=this;if(this.locked)throw Error("can't draw, atlas is locked");var s=this.texSize,o=this.texRows,l=this.texHeight,u=this.getScale(a),{scale:f,texW:v,texH:h}=u,c=function(b,E){if(n&&E){var A=E.context,{x:M,row:S}=b,P=M,N=l*S;A.save(),A.translate(P,N),A.scale(f,f),n(A,a),A.restore()}},d=[null,null],g=function(){if(c(i.freePointer,i.canvas),d[0]={x:i.freePointer.x,y:i.freePointer.row*l,w:v,h},d[1]={x:i.freePointer.x+v,y:i.freePointer.row*l,w:0,h},i.freePointer.x+=v,i.freePointer.x==s)i.freePointer.x=0,i.freePointer.row++},y=function(){var{scratch:b,canvas:E}=i;b.clear(),c({x:0,row:0},b);var A=s-i.freePointer.x,M=v-A,S=l;{var P=i.freePointer.x,N=i.freePointer.row*l,R=A;E.context.drawImage(b,0,0,R,S,P,N,R,S),d[0]={x:P,y:N,w:R,h}}{var I=A,w=(i.freePointer.row+1)*l,x=M;if(E)E.context.drawImage(b,I,0,x,S,0,w,x,S);d[1]={x:0,y:w,w:x,h}}i.freePointer.x=M,i.freePointer.row++},p=function(){i.freePointer.x=0,i.freePointer.row++};if(this.freePointer.x+v<=s)g();else if(this.freePointer.row>=o-1)return!1;else if(this.freePointer.x===s)p(),g();else if(this.enableWrapping)y();else p(),g();return this.keyToLocation.set(r,d),this.needsBuffer=!0,d}},{key:"getOffsets",value:function(r){return this.keyToLocation.get(r)}},{key:"isEmpty",value:function(){return this.freePointer.x===0&&this.freePointer.row===0}},{key:"canFit",value:function(r){if(this.locked)return!1;var a=this.texSize,n=this.texRows,i=this.getScale(r),s=i.texW;if(this.freePointer.x+s>a)return this.freePointer.row<n-1;return!0}},{key:"bufferIfNeeded",value:function(r){if(!this.texture)this.texture=um(r,this.debugID);if(this.needsBuffer){if(this.texture.buffer(this.canvas),this.needsBuffer=!1,this.locked)this.canvas=null,this.scratch=null}}},{key:"dispose",value:function(){if(this.texture)this.texture.deleteTexture(),this.texture=null;this.canvas=null,this.scratch=null,this.locked=!0}}])}(),pm=function(){function t(e,r,a,n){Mr(this,t),this.r=e,this.texSize=r,this.texRows=a,this.createTextureCanvas=n,this.atlases=[],this.styleKeyToAtlas=new Map,this.markedKeys=new Set}return Lr(t,[{key:"getKeys",value:function(){return new Set(this.styleKeyToAtlas.keys())}},{key:"_createAtlas",value:function(){var r=this.r,a=this.texSize,n=this.texRows,i=this.createTextureCanvas;return new gm(r,a,n,i)}},{key:"_getScratchCanvas",value:function(){if(!this.scratch){var r=this.r,a=this.texSize,n=this.texRows,i=this.createTextureCanvas,s=Math.floor(a/n);this.scratch=i(r,a,s,"scratch")}return this.scratch}},{key:"draw",value:function(r,a,n){var i=this.styleKeyToAtlas.get(r);if(!i){if(i=this.atlases[this.atlases.length-1],!i||!i.canFit(a)){if(i)i.lock();i=this._createAtlas(),this.atlases.push(i)}i.draw(r,a,n),this.styleKeyToAtlas.set(r,i)}return i}},{key:"getAtlas",value:function(r){return this.styleKeyToAtlas.get(r)}},{key:"hasAtlas",value:function(r){return this.styleKeyToAtlas.has(r)}},{key:"markKeyForGC",value:function(r){this.markedKeys.add(r)}},{key:"gc",value:function(){var r=this,a=this.markedKeys;if(a.size===0){console.log("nothing to garbage collect");return}var n=[],i=new Map,s=null,o=kt(this.atlases),l;try{var u=function(){var v=l.value,h=v.getKeys(),c=ym(a,h);if(c.size===0)return n.push(v),h.forEach(function(A){return i.set(A,v)}),1;if(!s)s=r._createAtlas(),n.push(s);var d=kt(h),g;try{for(d.s();!(g=d.n()).done;){var y=g.value;if(!c.has(y)){var p=v.getOffsets(y),m=ht(p,2),b=m[0],E=m[1];if(!s.canFit({w:b.w+E.w,h:b.h}))s.lock(),s=r._createAtlas(),n.push(s);if(v.canvas)r._copyTextureToNewAtlas(y,v,s),i.set(y,s)}}}catch(A){d.e(A)}finally{d.f()}v.dispose()};for(o.s();!(l=o.n()).done;)if(u())continue}catch(f){o.e(f)}finally{o.f()}this.atlases=n,this.styleKeyToAtlas=i,this.markedKeys=new Set}},{key:"_copyTextureToNewAtlas",value:function(r,a,n){var i=a.getOffsets(r),s=ht(i,2),o=s[0],l=s[1];if(l.w===0)n.draw(r,o,function(h){h.drawImage(a.canvas,o.x,o.y,o.w,o.h,0,0,o.w,o.h)});else{var u=this._getScratchCanvas();u.clear(),u.context.drawImage(a.canvas,o.x,o.y,o.w,o.h,0,0,o.w,o.h),u.context.drawImage(a.canvas,l.x,l.y,l.w,l.h,o.w,0,l.w,l.h);var f=o.w+l.w,v=o.h;n.draw(r,{w:f,h:v},function(h){h.drawImage(u,0,0,f,v,0,0,f,v)})}}},{key:"getCounts",value:function(){return{keyCount:this.styleKeyToAtlas.size,atlasCount:new Set(this.styleKeyToAtlas.values()).size}}}])}();function ym(t,e){if(t.intersection)return t.intersection(e);else return new Set(Bn(t).filter(function(r){return e.has(r)}))}var mm=function(){function t(e,r){Mr(this,t),this.r=e,this.globalOptions=r,this.atlasSize=r.webglTexSize,this.maxAtlasesPerBatch=r.webglTexPerBatch,this.renderTypes=new Map,this.collections=new Map,this.typeAndIdToKey=new Map}return Lr(t,[{key:"getAtlasSize",value:function(){return this.atlasSize}},{key:"addAtlasCollection",value:function(r,a){var n=this.globalOptions,{webglTexSize:i,createTextureCanvas:s}=n,o=a.texRows,l=this._cacheScratchCanvas(s),u=new pm(this.r,i,o,l);this.collections.set(r,u)}},{key:"addRenderType",value:function(r,a){var n=a.collection;if(!this.collections.has(n))throw Error("invalid atlas collection name '".concat(n,"'"));var i=this.collections.get(n),s=Oe({type:r,atlasCollection:i},a);this.renderTypes.set(r,s)}},{key:"getRenderTypeOpts",value:function(r){return this.renderTypes.get(r)}},{key:"getAtlasCollection",value:function(r){return this.collections.get(r)}},{key:"_cacheScratchCanvas",value:function(r){var a=-1,n=-1,i=null;return function(s,o,l,u){if(u){if(!i||o!=a||l!=n)a=o,n=l,i=r(s,o,l);return i}else return r(s,o,l)}}},{key:"_key",value:function(r,a){return"".concat(r,"-").concat(a)}},{key:"invalidate",value:function(r){var a=this,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.forceRedraw,s=i===void 0?!1:i,o=n.filterEle,l=o===void 0?function(){return!0}:o,u=n.filterType,f=u===void 0?function(){return!0}:u,v=!1,h=!1,c=kt(r),d;try{for(c.s();!(d=c.n()).done;){var g=d.value;if(l(g)){var y=kt(this.renderTypes.values()),p;try{var m=function(){var E=p.value,A=E.type;if(f(A)){var M=a.collections.get(E.collection),S=E.getKey(g),P=Array.isArray(S)?S:[S];if(s)P.forEach(function(w){return M.markKeyForGC(w)}),h=!0;else{var N=E.getID?E.getID(g):g.id(),R=a._key(A,N),I=a.typeAndIdToKey.get(R);if(I!==void 0&&!sm(P,I))v=!0,a.typeAndIdToKey.delete(R),I.forEach(function(w){return M.markKeyForGC(w)})}}};for(y.s();!(p=y.n()).done;)m()}catch(b){y.e(b)}finally{y.f()}}}}catch(b){c.e(b)}finally{c.f()}if(h)this.gc(),v=!1;return v}},{key:"gc",value:function(){var r=kt(this.collections.values()),a;try{for(r.s();!(a=r.n()).done;){var n=a.value;n.gc()}}catch(i){r.e(i)}finally{r.f()}}},{key:"getOrCreateAtlas",value:function(r,a,n,i){var s=this.renderTypes.get(a),o=this.collections.get(s.collection),l=!1,u=o.draw(i,n,function(h){if(s.drawClipped)h.save(),h.beginPath(),h.rect(0,0,n.w,n.h),h.clip(),s.drawElement(h,r,n,!0,!0),h.restore();else s.drawElement(h,r,n,!0,!0);l=!0});if(l){var f=s.getID?s.getID(r):r.id(),v=this._key(a,f);if(this.typeAndIdToKey.has(v))this.typeAndIdToKey.get(v).push(i);else this.typeAndIdToKey.set(v,[i])}return u}},{key:"getAtlasInfo",value:function(r,a){var n=this,i=this.renderTypes.get(a),s=i.getKey(r),o=Array.isArray(s)?s:[s];return o.map(function(l){var u=i.getBoundingBox(r,l),f=n.getOrCreateAtlas(r,a,u,l),v=f.getOffsets(l),h=ht(v,2),c=h[0],d=h[1];return{atlas:f,tex:c,tex1:c,tex2:d,bb:u}})}},{key:"getDebugInfo",value:function(){var r=[],a=kt(this.collections),n;try{for(a.s();!(n=a.n()).done;){var i=ht(n.value,2),s=i[0],o=i[1],l=o.getCounts(),{keyCount:u,atlasCount:f}=l;r.push({type:s,keyCount:u,atlasCount:f})}}catch(v){a.e(v)}finally{a.f()}return r}}])}(),bm=function(){function t(e){Mr(this,t),this.globalOptions=e,this.atlasSize=e.webglTexSize,this.maxAtlasesPerBatch=e.webglTexPerBatch,this.batchAtlases=[]}return Lr(t,[{key:"getMaxAtlasesPerBatch",value:function(){return this.maxAtlasesPerBatch}},{key:"getAtlasSize",value:function(){return this.atlasSize}},{key:"getIndexArray",value:function(){return Array.from({length:this.maxAtlasesPerBatch},function(r,a){return a})}},{key:"startBatch",value:function(){this.batchAtlases=[]}},{key:"getAtlasCount",value:function(){return this.batchAtlases.length}},{key:"getAtlases",value:function(){return this.batchAtlases}},{key:"canAddToCurrentBatch",value:function(r){if(this.batchAtlases.length===this.maxAtlasesPerBatch)return this.batchAtlases.includes(r);return!0}},{key:"getAtlasIndexForBatch",value:function(r){var a=this.batchAtlases.indexOf(r);if(a<0){if(this.batchAtlases.length===this.maxAtlasesPerBatch)throw Error("cannot add more atlases to batch");this.batchAtlases.push(r),a=this.batchAtlases.length-1}return a}}])}(),wm=`
17
+ `),p=y.length,m=0,b=0;for(var E=0;E<p;E++){var A=y[E],M=h.measureText(A),S=Math.ceil(M.width),P=o;if(f==="glyph"){if(E===0)b=M.actualBoundingBoxAscent;if(E===p-1)m=M.actualBoundingBoxDescent}d=Math.max(S,d),g+=P}if(f==="glyph")g-=o-b-m;return d+=i,g+=i,{width:d,height:g,labelActualAscent:b,labelActualDescent:m}};er.calculateLabelAngle=function(t,e){var r=t._private,a=r.rscratch,n=t.isEdge(),i=e?e+"-":"",s=t.pstyle(i+"text-rotation"),o=s.strValue;if(o==="none")return 0;else if(n&&o==="autorotate")return a.labelAutoAngle;else if(o==="autorotate")return 0;else return s.pfValue};er.calculateLabelAngles=function(t){var e=this,r=t.isEdge(),a=t._private,n=a.rscratch;if(n.labelAngle=e.calculateLabelAngle(t),r)n.sourceLabelAngle=e.calculateLabelAngle(t,"source"),n.targetLabelAngle=e.calculateLabelAngle(t,"target")};var Fv={},Kl=28,Zl=!1;Fv.getNodeShape=function(t){var e=this,r=t.pstyle("shape").value;if(r==="cutrectangle"&&(t.width()<Kl||t.height()<Kl)){if(!Zl)_e("The `cutrectangle` node shape can not be used at small sizes so `rectangle` is used instead"),Zl=!0;return"rectangle"}if(t.isParent())if(r==="rectangle"||r==="roundrectangle"||r==="round-rectangle"||r==="cutrectangle"||r==="cut-rectangle"||r==="barrel")return r;else return"rectangle";if(r==="polygon"){var a=t.pstyle("shape-polygon-points").value;return e.nodeShapes.makePolygon(a).name}return r};var vi={};vi.registerCalculationListeners=function(){var t=this.cy,e=t.collection(),r=this,a=function(s){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e.merge(s),o)for(var l=0;l<s.length;l++){var u=s[l],f=u._private,v=f.rstyle;v.clean=!1,v.cleanConnected=!1}};r.binder(t).on("bounds.* dirty.*",function(s){var o=s.target;a(o)}).on("style.* background.*",function(s){var o=s.target;a(o,!1)});var n=function(s){if(s){var o=r.onUpdateEleCalcsFns;e.cleanStyle();for(var l=0;l<e.length;l++){var u=e[l],f=u._private.rstyle;if(u.isNode()&&!f.cleanConnected)a(u.connectedEdges()),f.cleanConnected=!0}if(o)for(var v=0;v<o.length;v++){var h=o[v];h(s,e)}r.recalculateRenderedStyle(e),e=t.collection()}};r.flushRenderedStyleQueue=function(){n(!0)},r.beforeRender(n,r.beforeRenderPriorities.eleCalcs)};vi.onUpdateEleCalcs=function(t){var e=this.onUpdateEleCalcsFns=this.onUpdateEleCalcsFns||[];e.push(t)};vi.recalculateRenderedStyle=function(t,e){var r=function(E){return E._private.rstyle.cleanConnected};if(t.length===0)return;var a=[],n=[];if(this.destroyed)return;if(e===void 0)e=!0;for(var i=0;i<t.length;i++){var s=t[i],o=s._private,l=o.rstyle;if(s.isEdge()&&(!r(s.source())||!r(s.target())))l.clean=!1;if(s.isEdge()&&s.isBundledBezier()){if(s.parallelEdges().some(function(b){return!b._private.rstyle.clean&&b.isBundledBezier()}))l.clean=!1}if(e&&l.clean||s.removed())continue;if(s.pstyle("display").value==="none")continue;if(o.group==="nodes")n.push(s);else a.push(s);l.clean=!0}for(var u=0;u<n.length;u++){var f=n[u],v=f._private,h=v.rstyle,c=f.position();this.recalculateNodeLabelProjection(f),h.nodeX=c.x,h.nodeY=c.y,h.nodeW=f.pstyle("width").pfValue,h.nodeH=f.pstyle("height").pfValue}this.recalculateEdgeProjections(a);for(var d=0;d<a.length;d++){var g=a[d],y=g._private,{rstyle:p,rscratch:m}=y;p.srcX=m.arrowStartX,p.srcY=m.arrowStartY,p.tgtX=m.arrowEndX,p.tgtY=m.arrowEndY,p.midX=m.midX,p.midY=m.midY,p.labelAngle=m.labelAngle,p.sourceLabelAngle=m.sourceLabelAngle,p.targetLabelAngle=m.targetLabelAngle}};var hi={};hi.updateCachedGrabbedEles=function(){var t=this.cachedZSortedEles;if(!t)return;t.drag=[],t.nondrag=[];var e=[];for(var r=0;r<t.length;r++){var a=t[r],n=a._private.rscratch;if(a.grabbed()&&!a.isParent())e.push(a);else if(n.inDragLayer)t.drag.push(a);else t.nondrag.push(a)}for(var r=0;r<e.length;r++){var a=e[r];t.drag.push(a)}};hi.invalidateCachedZSortedEles=function(){this.cachedZSortedEles=null};hi.getCachedZSortedEles=function(t){if(t||!this.cachedZSortedEles){var e=this.cy.mutableElements().toArray();e.sort(mv),e.interactive=e.filter(function(r){return r.interactive()}),this.cachedZSortedEles=e,this.updateCachedGrabbedEles()}else e=this.cachedZSortedEles;return e};var zv={};[Xr,Xn,Lt,an,Oo,er,Fv,vi,hi].forEach(function(t){Oe(zv,t)});var Vv={};Vv.getCachedImage=function(t,e,r){var a=this,n=a.imageCache=a.imageCache||{},i=n[t];if(i){if(!i.image.complete)i.image.addEventListener("load",r);return i.image}else{i=n[t]=n[t]||{};var s=i.image=new Image;s.addEventListener("load",r),s.addEventListener("error",function(){s.error=!0});var o="data:",l=t.substring(0,o.length).toLowerCase()===o;if(!l)e=e==="null"?null:e,s.crossOrigin=e;return s.src=t,s}};var Gv=function(e,r){var a=e[0];if(!a||a._private.grabbed===r)return;a._private.grabbed=r,e.updateStyle(!1)},dy=function(e){Gv(e,!0)},gy=function(e){Gv(e,!1)},ma={};ma.registerBinding=function(t,e,r,a){var n=Array.prototype.slice.apply(arguments,[1]);if(Array.isArray(t)){var i=[];for(var s=0;s<t.length;s++){var o=t[s];if(o!==void 0){var l=this.binder(o);i.push(l.on.apply(l,n))}}return i}var l=this.binder(t);return l.on.apply(l,n)};ma.binder=function(t){var e=this,r=e.cy.window(),a=t===r||t===r.document||t===r.document.body||Th(t);if(e.supportsPassiveEvents==null){var n=!1;try{var i=Object.defineProperty({},"passive",{get:function(){return n=!0,!0}});r.addEventListener("test",null,i)}catch(o){}e.supportsPassiveEvents=n}var s=function(l,u,f){var v=Array.prototype.slice.call(arguments);if(a&&e.supportsPassiveEvents)v[2]={capture:f!=null?f:!1,passive:!1,once:!1};return e.bindings.push({target:t,args:v}),(t.addEventListener||t.on).apply(t,v),this};return{on:s,addEventListener:s,addListener:s,bind:s}};ma.nodeIsDraggable=function(t){return t&&t.isNode()&&!t.locked()&&t.grabbable()};ma.nodeIsGrabbable=function(t){return this.nodeIsDraggable(t)&&t.interactive()};ma.load=function(){var t=this,e=t.cy.window(),r=function(L){return L.selected()},a=function(L){var F=L.getRootNode();if(F&&F.nodeType===11&&F.host!==void 0)return F},n=function(L,F,Y,H){if(L==null)L=t.cy;for(var K=0;K<F.length;K++){var se=F[K];L.emit({originalEvent:Y,type:se,position:H})}},i=function(L){return L.shiftKey||L.metaKey||L.ctrlKey},s=function(L,F){var Y=!0;if(t.cy.hasCompoundNodes()&&L&&L.pannable())for(var H=0;F&&H<F.length;H++){var L=F[H];if(L.isNode()&&L.isParent()&&!L.pannable()){Y=!1;break}}else Y=!0;return Y},o=function(L){L[0]._private.rscratch.inDragLayer=!0},l=function(L){L[0]._private.rscratch.inDragLayer=!1},u=function(L){L[0]._private.rscratch.isGrabTarget=!0},f=function(L){L[0]._private.rscratch.isGrabTarget=!1},v=function(L,F){var Y=F.addToList,H=Y.has(L);if(!H&&L.grabbable()&&!L.locked())Y.merge(L),dy(L)},h=function(L,F){if(!L.cy().hasCompoundNodes())return;if(F.inDragLayer==null&&F.addToList==null)return;var Y=L.descendants();if(F.inDragLayer)Y.forEach(o),Y.connectedEdges().forEach(o);if(F.addToList)v(Y,F)},c=function(L,F){F=F||{};var Y=L.cy().hasCompoundNodes();if(F.inDragLayer)L.forEach(o),L.neighborhood().stdFilter(function(H){return!Y||H.isEdge()}).forEach(o);if(F.addToList)L.forEach(function(H){v(H,F)});h(L,F),y(L,{inDragLayer:F.inDragLayer}),t.updateCachedGrabbedEles()},d=c,g=function(L){if(!L)return;t.getCachedZSortedEles().forEach(function(F){gy(F),l(F),f(F)}),t.updateCachedGrabbedEles()},y=function(L,F){if(F.inDragLayer==null&&F.addToList==null)return;if(!L.cy().hasCompoundNodes())return;var Y=L.ancestors().orphans();if(Y.same(L))return;var H=Y.descendants().spawnSelf().merge(Y).unmerge(L).unmerge(L.descendants()),K=H.connectedEdges();if(F.inDragLayer)K.forEach(o),H.forEach(o);if(F.addToList)H.forEach(function(se){v(se,F)})},p=function(){if(document.activeElement!=null&&document.activeElement.blur!=null)document.activeElement.blur()},m=typeof MutationObserver<"u",b=typeof ResizeObserver<"u";if(m){if(t.removeObserver=new MutationObserver(function(ie){for(var L=0;L<ie.length;L++){var F=ie[L],Y=F.removedNodes;if(Y)for(var H=0;H<Y.length;H++){var K=Y[H];if(K===t.container){t.destroy();break}}}}),t.container.parentNode)t.removeObserver.observe(t.container.parentNode,{childList:!0})}else t.registerBinding(t.container,"DOMNodeRemoved",function(ie){t.destroy()});var E=ja(function(){t.cy.resize()},100);if(m)t.styleObserver=new MutationObserver(E),t.styleObserver.observe(t.container,{attributes:!0});if(t.registerBinding(e,"resize",E),b)t.resizeObserver=new ResizeObserver(E),t.resizeObserver.observe(t.container);var A=function(L,F){while(L!=null)F(L),L=L.parentNode},M=function(){t.invalidateContainerClientCoordsCache()};A(t.container,function(ie){t.registerBinding(ie,"transitionend",M),t.registerBinding(ie,"animationend",M),t.registerBinding(ie,"scroll",M)}),t.registerBinding(t.container,"contextmenu",function(ie){ie.preventDefault()});var S=function(){return t.selection[4]!==0},P=function(L){var F=t.findContainerClientCoords(),Y=F[0],H=F[1],K=F[2],se=F[3],ae=L.touches?L.touches:[L],oe=!1;for(var ne=0;ne<ae.length;ne++){var ue=ae[ne];if(Y<=ue.clientX&&ue.clientX<=Y+K&&H<=ue.clientY&&ue.clientY<=H+se){oe=!0;break}}if(!oe)return!1;var be=t.container,fe=L.target,le=fe.parentNode,De=!1;while(le){if(le===be){De=!0;break}le=le.parentNode}if(!De)return!1;return!0};t.registerBinding(t.container,"mousedown",function(L){if(!P(L))return;if(t.hoverData.which===1&&L.which!==1)return;L.preventDefault(),p(),t.hoverData.capture=!0,t.hoverData.which=L.which;var F=t.cy,Y=[L.clientX,L.clientY],H=t.projectIntoViewport(Y[0],Y[1]),K=t.selection,se=t.findNearestElements(H[0],H[1],!0,!1),ae=se[0],oe=t.dragData.possibleDragElements;t.hoverData.mdownPos=H,t.hoverData.mdownGPos=Y;var ne=function(ce){return{originalEvent:L,type:ce,position:{x:H[0],y:H[1]}}},ue=function(){t.hoverData.tapholdCancelled=!1,clearTimeout(t.hoverData.tapholdTimeout),t.hoverData.tapholdTimeout=setTimeout(function(){if(t.hoverData.tapholdCancelled)return;else{var ce=t.hoverData.down;if(ce)ce.emit(ne("taphold"));else F.emit(ne("taphold"))}},t.tapholdDuration)};if(L.which==3){t.hoverData.cxtStarted=!0;var be={originalEvent:L,type:"cxttapstart",position:{x:H[0],y:H[1]}};if(ae)ae.activate(),ae.emit(be),t.hoverData.down=ae;else F.emit(be);t.hoverData.downTime=new Date().getTime(),t.hoverData.cxtDragged=!1}else if(L.which==1){if(ae)ae.activate();{if(ae!=null){if(t.nodeIsGrabbable(ae)){var fe=function(ce){ce.emit(ne("grab"))};if(u(ae),!ae.selected())oe=t.dragData.possibleDragElements=F.collection(),d(ae,{addToList:oe}),ae.emit(ne("grabon")).emit(ne("grab"));else{oe=t.dragData.possibleDragElements=F.collection();var le=F.$(function(De){return De.isNode()&&De.selected()&&t.nodeIsGrabbable(De)});c(le,{addToList:oe}),ae.emit(ne("grabon")),le.forEach(fe)}t.redrawHint("eles",!0),t.redrawHint("drag",!0)}}t.hoverData.down=ae,t.hoverData.downs=se,t.hoverData.downTime=new Date().getTime()}if(n(ae,["mousedown","tapstart","vmousedown"],L,{x:H[0],y:H[1]}),ae==null)K[4]=1,t.data.bgActivePosistion={x:H[0],y:H[1]},t.redrawHint("select",!0),t.redraw();else if(ae.pannable())K[4]=1;ue()}K[0]=K[2]=H[0],K[1]=K[3]=H[1]},!1);var N=a(t.container);t.registerBinding([e,N],"mousemove",function(L){var F=t.hoverData.capture;if(!F&&!P(L))return;var Y=!1,H=t.cy,K=H.zoom(),se=[L.clientX,L.clientY],ae=t.projectIntoViewport(se[0],se[1]),oe=t.hoverData.mdownPos,ne=t.hoverData.mdownGPos,ue=t.selection,be=null;if(!t.hoverData.draggingEles&&!t.hoverData.dragging&&!t.hoverData.selecting)be=t.findNearestElement(ae[0],ae[1],!0,!1);var fe=t.hoverData.last,le=t.hoverData.down,De=[ae[0]-ue[2],ae[1]-ue[3]],ce=t.dragData.possibleDragElements,pe;if(ne){var Ie=se[0]-ne[0],xe=Ie*Ie,me=se[1]-ne[1],Ve=me*me,Be=xe+Ve;t.hoverData.isOverThresholdDrag=pe=Be>=t.desktopTapThreshold2}var Ke=i(L);if(pe)t.hoverData.tapholdCancelled=!0;var He=function(){var xt=t.hoverData.dragDelta=t.hoverData.dragDelta||[];if(xt.length===0)xt.push(De[0]),xt.push(De[1]);else xt[0]+=De[0],xt[1]+=De[1]};Y=!0,n(be,["mousemove","vmousemove","tapdrag"],L,{x:ae[0],y:ae[1]});var Le=function(xt){return{originalEvent:L,type:xt,position:{x:ae[0],y:ae[1]}}},nt=function(){if(t.data.bgActivePosistion=void 0,!t.hoverData.selecting)H.emit(Le("boxstart"));ue[4]=1,t.hoverData.selecting=!0,t.redrawHint("select",!0),t.redraw()};if(t.hoverData.which===3){if(pe){var Ye=Le("cxtdrag");if(le)le.emit(Ye);else H.emit(Ye);if(t.hoverData.cxtDragged=!0,!t.hoverData.cxtOver||be!==t.hoverData.cxtOver){if(t.hoverData.cxtOver)t.hoverData.cxtOver.emit(Le("cxtdragout"));if(t.hoverData.cxtOver=be,be)be.emit(Le("cxtdragover"))}}}else if(t.hoverData.dragging){if(Y=!0,H.panningEnabled()&&H.userPanningEnabled()){var tt;if(t.hoverData.justStartedPan){var dt=t.hoverData.mdownPos;tt={x:(ae[0]-dt[0])*K,y:(ae[1]-dt[1])*K},t.hoverData.justStartedPan=!1}else tt={x:De[0]*K,y:De[1]*K};H.panBy(tt),H.emit(Le("dragpan")),t.hoverData.dragged=!0}ae=t.projectIntoViewport(L.clientX,L.clientY)}else if(ue[4]==1&&(le==null||le.pannable())){if(pe){if(!t.hoverData.dragging&&H.boxSelectionEnabled()&&(Ke||!H.panningEnabled()||!H.userPanningEnabled()))nt();else if(!t.hoverData.selecting&&H.panningEnabled()&&H.userPanningEnabled()){var qt=s(le,t.hoverData.downs);if(qt)t.hoverData.dragging=!0,t.hoverData.justStartedPan=!0,ue[4]=0,t.data.bgActivePosistion=ra(oe),t.redrawHint("select",!0),t.redraw()}if(le&&le.pannable()&&le.active())le.unactivate()}}else{if(le&&le.pannable()&&le.active())le.unactivate();if((!le||!le.grabbed())&&be!=fe){if(fe)n(fe,["mouseout","tapdragout"],L,{x:ae[0],y:ae[1]});if(be)n(be,["mouseover","tapdragover"],L,{x:ae[0],y:ae[1]});t.hoverData.last=be}if(le)if(pe){if(H.boxSelectionEnabled()&&Ke){if(le&&le.grabbed()){if(g(ce),le.emit(Le("freeon")),ce.emit(Le("free")),t.dragData.didDrag)le.emit(Le("dragfreeon")),ce.emit(Le("dragfree"))}nt()}else if(le&&le.grabbed()&&t.nodeIsDraggable(le)){var ot=!t.dragData.didDrag;if(ot)t.redrawHint("eles",!0);if(t.dragData.didDrag=!0,!t.hoverData.draggingEles)c(ce,{inDragLayer:!0});var rt={x:0,y:0};if(he(De[0])&&he(De[1])){if(rt.x+=De[0],rt.y+=De[1],ot){var lt=t.hoverData.dragDelta;if(lt&&he(lt[0])&&he(lt[1]))rt.x+=lt[0],rt.y+=lt[1]}}t.hoverData.draggingEles=!0,ce.silentShift(rt).emit(Le("position")).emit(Le("drag")),t.redrawHint("drag",!0),t.redraw()}}else He();Y=!0}if(ue[2]=ae[0],ue[3]=ae[1],Y){if(L.stopPropagation)L.stopPropagation();if(L.preventDefault)L.preventDefault();return!1}},!1);var R,I,w;t.registerBinding(e,"mouseup",function(L){if(t.hoverData.which===1&&L.which!==1&&t.hoverData.capture)return;var F=t.hoverData.capture;if(!F)return;t.hoverData.capture=!1;var Y=t.cy,H=t.projectIntoViewport(L.clientX,L.clientY),K=t.selection,se=t.findNearestElement(H[0],H[1],!0,!1),ae=t.dragData.possibleDragElements,oe=t.hoverData.down,ne=i(L);if(t.data.bgActivePosistion)t.redrawHint("select",!0),t.redraw();if(t.hoverData.tapholdCancelled=!0,t.data.bgActivePosistion=void 0,oe)oe.unactivate();var ue=function(Ie){return{originalEvent:L,type:Ie,position:{x:H[0],y:H[1]}}};if(t.hoverData.which===3){var be=ue("cxttapend");if(oe)oe.emit(be);else Y.emit(be);if(!t.hoverData.cxtDragged){var fe=ue("cxttap");if(oe)oe.emit(fe);else Y.emit(fe)}t.hoverData.cxtDragged=!1,t.hoverData.which=null}else if(t.hoverData.which===1){if(n(se,["mouseup","tapend","vmouseup"],L,{x:H[0],y:H[1]}),!t.dragData.didDrag&&!t.hoverData.dragged&&!t.hoverData.selecting&&!t.hoverData.isOverThresholdDrag)if(n(oe,["click","tap","vclick"],L,{x:H[0],y:H[1]}),I=!1,L.timeStamp-w<=Y.multiClickDebounceTime())R&&clearTimeout(R),I=!0,w=null,n(oe,["dblclick","dbltap","vdblclick"],L,{x:H[0],y:H[1]});else R=setTimeout(function(){if(I)return;n(oe,["oneclick","onetap","voneclick"],L,{x:H[0],y:H[1]})},Y.multiClickDebounceTime()),w=L.timeStamp;if(oe==null&&!t.dragData.didDrag&&!t.hoverData.selecting&&!t.hoverData.dragged&&!i(L)){if(Y.$(r).unselect(["tapunselect"]),ae.length>0)t.redrawHint("eles",!0);t.dragData.possibleDragElements=ae=Y.collection()}if(se==oe&&!t.dragData.didDrag&&!t.hoverData.selecting){if(se!=null&&se._private.selectable){if(t.hoverData.dragging);else if(Y.selectionType()==="additive"||ne)if(se.selected())se.unselect(["tapunselect"]);else se.select(["tapselect"]);else if(!ne)Y.$(r).unmerge(se).unselect(["tapunselect"]),se.select(["tapselect"]);t.redrawHint("eles",!0)}}if(t.hoverData.selecting){var le=Y.collection(t.getAllInBox(K[0],K[1],K[2],K[3]));if(t.redrawHint("select",!0),le.length>0)t.redrawHint("eles",!0);Y.emit(ue("boxend"));var De=function(Ie){return Ie.selectable()&&!Ie.selected()};if(Y.selectionType()==="additive")le.emit(ue("box")).stdFilter(De).select().emit(ue("boxselect"));else{if(!ne)Y.$(r).unmerge(le).unselect();le.emit(ue("box")).stdFilter(De).select().emit(ue("boxselect"))}t.redraw()}if(t.hoverData.dragging)t.hoverData.dragging=!1,t.redrawHint("select",!0),t.redrawHint("eles",!0),t.redraw();if(!K[4]){t.redrawHint("drag",!0),t.redrawHint("eles",!0);var ce=oe&&oe.grabbed();if(g(ae),ce){if(oe.emit(ue("freeon")),ae.emit(ue("free")),t.dragData.didDrag)oe.emit(ue("dragfreeon")),ae.emit(ue("dragfree"))}}}K[4]=0,t.hoverData.down=null,t.hoverData.cxtStarted=!1,t.hoverData.draggingEles=!1,t.hoverData.selecting=!1,t.hoverData.isOverThresholdDrag=!1,t.dragData.didDrag=!1,t.hoverData.dragged=!1,t.hoverData.dragDelta=[],t.hoverData.mdownPos=null,t.hoverData.mdownGPos=null,t.hoverData.which=null},!1);var x=[],T=4,D,C=1e5,O=function(L){var F=Math.abs(L[0]);for(var Y=1;Y<L.length;Y++)if(Math.abs(L[Y])!==F)return!1;return!0},B=function(L){var F=!1,Y=L.deltaY;if(Y==null){if(L.wheelDeltaY!=null)Y=L.wheelDeltaY/4;else if(L.wheelDelta!=null)Y=L.wheelDelta/4}if(Y===0)return;if(D==null)if(x.length>=T){D=!1;var H=x;if(H[0]>=5){var K;if(O(H))K=H[0];else K=Pc(H);if(K>1)D=!0,C=K}}else x.push(Math.abs(Y)),F=!0;else if(D)C=Math.min(Math.abs(Y),C);if(t.scrollingPage)return;var se=t.cy,ae=se.zoom(),oe=se.pan(),ne=t.projectIntoViewport(L.clientX,L.clientY),ue=[ne[0]*ae+oe.x,ne[1]*ae+oe.y];if(t.hoverData.draggingEles||t.hoverData.dragging||t.hoverData.cxtStarted||S()){L.preventDefault();return}if(se.panningEnabled()&&se.userPanningEnabled()&&se.zoomingEnabled()&&se.userZoomingEnabled()){L.preventDefault(),t.data.wheelZooming=!0,clearTimeout(t.data.wheelTimeout),t.data.wheelTimeout=setTimeout(function(){t.data.wheelZooming=!1,t.redrawHint("eles",!0),t.redraw()},150);var be;if(F&&Math.abs(Y)>5)Y=bo(Y)*5;if(be=Y/-250,D)be/=C,be*=3;be=be*t.wheelSensitivity;var fe=L.deltaMode===1;if(fe)be*=33;var le=se.zoom()*Math.pow(10,be);if(L.type==="gesturechange")le=t.gestureStartZoom*L.scale;se.zoom({level:le,renderedPosition:{x:ue[0],y:ue[1]}}),se.emit({type:L.type==="gesturechange"?"pinchzoom":"scrollzoom",originalEvent:L,position:{x:ne[0],y:ne[1]}})}};t.registerBinding(t.container,"wheel",B,!0),t.registerBinding(e,"scroll",function(L){t.scrollingPage=!0,clearTimeout(t.scrollingPageTimeout),t.scrollingPageTimeout=setTimeout(function(){t.scrollingPage=!1},250)},!0),t.registerBinding(t.container,"gesturestart",function(L){if(t.gestureStartZoom=t.cy.zoom(),!t.hasTouchStarted)L.preventDefault()},!0),t.registerBinding(t.container,"gesturechange",function(ie){if(!t.hasTouchStarted)B(ie)},!0),t.registerBinding(t.container,"mouseout",function(L){var F=t.projectIntoViewport(L.clientX,L.clientY);t.cy.emit({originalEvent:L,type:"mouseout",position:{x:F[0],y:F[1]}})},!1),t.registerBinding(t.container,"mouseover",function(L){var F=t.projectIntoViewport(L.clientX,L.clientY);t.cy.emit({originalEvent:L,type:"mouseover",position:{x:F[0],y:F[1]}})},!1);var z,V,k,G,J,X,_,Q,q,te,Z,U,W,j=function(L,F,Y,H){return Math.sqrt((Y-L)*(Y-L)+(H-F)*(H-F))},re=function(L,F,Y,H){return(Y-L)*(Y-L)+(H-F)*(H-F)},ee;t.registerBinding(t.container,"touchstart",ee=function(L){if(t.hasTouchStarted=!0,!P(L))return;p(),t.touchData.capture=!0,t.data.bgActivePosistion=void 0;var F=t.cy,Y=t.touchData.now,H=t.touchData.earlier;if(L.touches[0]){var K=t.projectIntoViewport(L.touches[0].clientX,L.touches[0].clientY);Y[0]=K[0],Y[1]=K[1]}if(L.touches[1]){var K=t.projectIntoViewport(L.touches[1].clientX,L.touches[1].clientY);Y[2]=K[0],Y[3]=K[1]}if(L.touches[2]){var K=t.projectIntoViewport(L.touches[2].clientX,L.touches[2].clientY);Y[4]=K[0],Y[5]=K[1]}var se=function(Ke){return{originalEvent:L,type:Ke,position:{x:Y[0],y:Y[1]}}};if(L.touches[1]){t.touchData.singleTouchMoved=!0,g(t.dragData.touchDragEles);var ae=t.findContainerClientCoords();q=ae[0],te=ae[1],Z=ae[2],U=ae[3],z=L.touches[0].clientX-q,V=L.touches[0].clientY-te,k=L.touches[1].clientX-q,G=L.touches[1].clientY-te,W=0<=z&&z<=Z&&0<=k&&k<=Z&&0<=V&&V<=U&&0<=G&&G<=U;var oe=F.pan(),ne=F.zoom();J=j(z,V,k,G),X=re(z,V,k,G),_=[(z+k)/2,(V+G)/2],Q=[(_[0]-oe.x)/ne,(_[1]-oe.y)/ne];var ue=200,be=ue*ue;if(X<be&&!L.touches[2]){var fe=t.findNearestElement(Y[0],Y[1],!0,!0),le=t.findNearestElement(Y[2],Y[3],!0,!0);if(fe&&fe.isNode())fe.activate().emit(se("cxttapstart")),t.touchData.start=fe;else if(le&&le.isNode())le.activate().emit(se("cxttapstart")),t.touchData.start=le;else F.emit(se("cxttapstart"));if(t.touchData.start)t.touchData.start._private.grabbed=!1;t.touchData.cxt=!0,t.touchData.cxtDragged=!1,t.data.bgActivePosistion=void 0,t.redraw();return}}if(L.touches[2]){if(F.boxSelectionEnabled())L.preventDefault()}else if(L.touches[1]);else if(L.touches[0]){var De=t.findNearestElements(Y[0],Y[1],!0,!0),ce=De[0];if(ce!=null){if(ce.activate(),t.touchData.start=ce,t.touchData.starts=De,t.nodeIsGrabbable(ce)){var pe=t.dragData.touchDragEles=F.collection(),Ie=null;if(t.redrawHint("eles",!0),t.redrawHint("drag",!0),ce.selected())Ie=F.$(function(Be){return Be.selected()&&t.nodeIsGrabbable(Be)}),c(Ie,{addToList:pe});else d(ce,{addToList:pe});if(u(ce),ce.emit(se("grabon")),Ie)Ie.forEach(function(Be){Be.emit(se("grab"))});else ce.emit(se("grab"))}}if(n(ce,["touchstart","tapstart","vmousedown"],L,{x:Y[0],y:Y[1]}),ce==null)t.data.bgActivePosistion={x:K[0],y:K[1]},t.redrawHint("select",!0),t.redraw();t.touchData.singleTouchMoved=!1,t.touchData.singleTouchStartTime=+new Date,clearTimeout(t.touchData.tapholdTimeout),t.touchData.tapholdTimeout=setTimeout(function(){if(t.touchData.singleTouchMoved===!1&&!t.pinching&&!t.touchData.selecting)n(t.touchData.start,["taphold"],L,{x:Y[0],y:Y[1]})},t.tapholdDuration)}if(L.touches.length>=1){var xe=t.touchData.startPosition=[null,null,null,null,null,null];for(var me=0;me<Y.length;me++)xe[me]=H[me]=Y[me];var Ve=L.touches[0];t.touchData.startGPosition=[Ve.clientX,Ve.clientY]}},!1);var de;t.registerBinding(e,"touchmove",de=function(L){var F=t.touchData.capture;if(!F&&!P(L))return;var{selection:Y,cy:H}=t,K=t.touchData.now,se=t.touchData.earlier,ae=H.zoom();if(L.touches[0]){var oe=t.projectIntoViewport(L.touches[0].clientX,L.touches[0].clientY);K[0]=oe[0],K[1]=oe[1]}if(L.touches[1]){var oe=t.projectIntoViewport(L.touches[1].clientX,L.touches[1].clientY);K[2]=oe[0],K[3]=oe[1]}if(L.touches[2]){var oe=t.projectIntoViewport(L.touches[2].clientX,L.touches[2].clientY);K[4]=oe[0],K[5]=oe[1]}var ne=function(lh){return{originalEvent:L,type:lh,position:{x:K[0],y:K[1]}}},ue=t.touchData.startGPosition,be;if(F&&L.touches[0]&&ue){var fe=[];for(var le=0;le<K.length;le++)fe[le]=K[le]-se[le];var De=L.touches[0].clientX-ue[0],ce=De*De,pe=L.touches[0].clientY-ue[1],Ie=pe*pe,xe=ce+Ie;be=xe>=t.touchTapThreshold2}if(F&&t.touchData.cxt){L.preventDefault();var me=L.touches[0].clientX-q,Ve=L.touches[0].clientY-te,Be=L.touches[1].clientX-q,Ke=L.touches[1].clientY-te,He=re(me,Ve,Be,Ke),Le=He/X,nt=150,Ye=nt*nt,tt=1.5,dt=tt*tt;if(Le>=dt||He>=Ye){t.touchData.cxt=!1,t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var qt=ne("cxttapend");if(t.touchData.start)t.touchData.start.unactivate().emit(qt),t.touchData.start=null;else H.emit(qt)}}if(F&&t.touchData.cxt){var qt=ne("cxtdrag");if(t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.touchData.start)t.touchData.start.emit(qt);else H.emit(qt);if(t.touchData.start)t.touchData.start._private.grabbed=!1;t.touchData.cxtDragged=!0;var ot=t.findNearestElement(K[0],K[1],!0,!0);if(!t.touchData.cxtOver||ot!==t.touchData.cxtOver){if(t.touchData.cxtOver)t.touchData.cxtOver.emit(ne("cxtdragout"));if(t.touchData.cxtOver=ot,ot)ot.emit(ne("cxtdragover"))}}else if(F&&L.touches[2]&&H.boxSelectionEnabled()){if(L.preventDefault(),t.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,!t.touchData.selecting)H.emit(ne("boxstart"));if(t.touchData.selecting=!0,t.touchData.didSelect=!0,Y[4]=1,!Y||Y.length===0||Y[0]===void 0)Y[0]=(K[0]+K[2]+K[4])/3,Y[1]=(K[1]+K[3]+K[5])/3,Y[2]=(K[0]+K[2]+K[4])/3+1,Y[3]=(K[1]+K[3]+K[5])/3+1;else Y[2]=(K[0]+K[2]+K[4])/3,Y[3]=(K[1]+K[3]+K[5])/3;t.redrawHint("select",!0),t.redraw()}else if(F&&L.touches[1]&&!t.touchData.didSelect&&H.zoomingEnabled()&&H.panningEnabled()&&H.userZoomingEnabled()&&H.userPanningEnabled()){L.preventDefault(),t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var rt=t.dragData.touchDragEles;if(rt){t.redrawHint("drag",!0);for(var lt=0;lt<rt.length;lt++){var Ft=rt[lt]._private;Ft.grabbed=!1,Ft.rscratch.inDragLayer=!1}}var xt=t.touchData.start,me=L.touches[0].clientX-q,Ve=L.touches[0].clientY-te,Be=L.touches[1].clientX-q,Ke=L.touches[1].clientY-te,rr=j(me,Ve,Be,Ke),lr=rr/J;if(W){var ln=me-z,wa=Ve-V,fn=Be-k,Ea=Ke-G,ci=(ln+fn)/2,xa=(wa+Ea)/2,fr=H.zoom(),$r=fr*lr,vr=H.pan(),Ta=Q[0]*fr+vr.x,ft=Q[1]*fr+vr.y,ke={x:-$r/fr*(Ta-vr.x-ci)+Ta,y:-$r/fr*(ft-vr.y-xa)+ft};if(xt&&xt.active()){var rt=t.dragData.touchDragEles;if(g(rt),t.redrawHint("drag",!0),t.redrawHint("eles",!0),xt.unactivate().emit(ne("freeon")),rt)rt.emit(ne("free"));if(t.dragData.didDrag){if(xt.emit(ne("dragfreeon")),rt)rt.emit(ne("dragfree"))}}H.viewport({zoom:$r,pan:ke,cancelOnFailedZoom:!0}),H.emit(ne("pinchzoom")),J=rr,z=me,V=Ve,k=Be,G=Ke,t.pinching=!0}if(L.touches[0]){var oe=t.projectIntoViewport(L.touches[0].clientX,L.touches[0].clientY);K[0]=oe[0],K[1]=oe[1]}if(L.touches[1]){var oe=t.projectIntoViewport(L.touches[1].clientX,L.touches[1].clientY);K[2]=oe[0],K[3]=oe[1]}if(L.touches[2]){var oe=t.projectIntoViewport(L.touches[2].clientX,L.touches[2].clientY);K[4]=oe[0],K[5]=oe[1]}}else if(L.touches[0]&&!t.touchData.didSelect){var Ge=t.touchData.start,Vt=t.touchData.last,ot;if(!t.hoverData.draggingEles&&!t.swipePanning)ot=t.findNearestElement(K[0],K[1],!0,!0);if(F&&Ge!=null)L.preventDefault();if(F&&Ge!=null&&t.nodeIsDraggable(Ge))if(be){var rt=t.dragData.touchDragEles,Rt=!t.dragData.didDrag;if(Rt)c(rt,{inDragLayer:!0});t.dragData.didDrag=!0;var Ca={x:0,y:0};if(he(fe[0])&&he(fe[1])){if(Ca.x+=fe[0],Ca.y+=fe[1],Rt){t.redrawHint("eles",!0);var Yt=t.touchData.dragDelta;if(Yt&&he(Yt[0])&&he(Yt[1]))Ca.x+=Yt[0],Ca.y+=Yt[1]}}if(t.hoverData.draggingEles=!0,rt.silentShift(Ca).emit(ne("position")).emit(ne("drag")),t.redrawHint("drag",!0),t.touchData.startPosition[0]==se[0]&&t.touchData.startPosition[1]==se[1])t.redrawHint("eles",!0);t.redraw()}else{var Yt=t.touchData.dragDelta=t.touchData.dragDelta||[];if(Yt.length===0)Yt.push(fe[0]),Yt.push(fe[1]);else Yt[0]+=fe[0],Yt[1]+=fe[1]}{if(n(Ge||ot,["touchmove","tapdrag","vmousemove"],L,{x:K[0],y:K[1]}),(!Ge||!Ge.grabbed())&&ot!=Vt){if(Vt)Vt.emit(ne("tapdragout"));if(ot)ot.emit(ne("tapdragover"))}t.touchData.last=ot}if(F){for(var lt=0;lt<K.length;lt++)if(K[lt]&&t.touchData.startPosition[lt]&&be)t.touchData.singleTouchMoved=!0}if(F&&(Ge==null||Ge.pannable())&&H.panningEnabled()&&H.userPanningEnabled()){var uh=s(Ge,t.touchData.starts);if(uh){if(L.preventDefault(),!t.data.bgActivePosistion)t.data.bgActivePosistion=ra(t.touchData.startPosition);if(t.swipePanning)H.panBy({x:fe[0]*ae,y:fe[1]*ae}),H.emit(ne("dragpan"));else if(be){if(t.swipePanning=!0,H.panBy({x:De*ae,y:pe*ae}),H.emit(ne("dragpan")),Ge)Ge.unactivate(),t.redrawHint("select",!0),t.touchData.start=null}}var oe=t.projectIntoViewport(L.touches[0].clientX,L.touches[0].clientY);K[0]=oe[0],K[1]=oe[1]}}for(var le=0;le<K.length;le++)se[le]=K[le];if(F&&L.touches.length>0&&!t.hoverData.draggingEles&&!t.swipePanning&&t.data.bgActivePosistion!=null)t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.redraw()},!1);var Ae;t.registerBinding(e,"touchcancel",Ae=function(L){var F=t.touchData.start;if(t.touchData.capture=!1,F)F.unactivate()});var Ce,Se,ge,ve;if(t.registerBinding(e,"touchend",Ce=function(L){var F=t.touchData.start,Y=t.touchData.capture;if(Y){if(L.touches.length===0)t.touchData.capture=!1;L.preventDefault()}else return;var H=t.selection;t.swipePanning=!1,t.hoverData.draggingEles=!1;var K=t.cy,se=K.zoom(),ae=t.touchData.now,oe=t.touchData.earlier;if(L.touches[0]){var ne=t.projectIntoViewport(L.touches[0].clientX,L.touches[0].clientY);ae[0]=ne[0],ae[1]=ne[1]}if(L.touches[1]){var ne=t.projectIntoViewport(L.touches[1].clientX,L.touches[1].clientY);ae[2]=ne[0],ae[3]=ne[1]}if(L.touches[2]){var ne=t.projectIntoViewport(L.touches[2].clientX,L.touches[2].clientY);ae[4]=ne[0],ae[5]=ne[1]}var ue=function(Ye){return{originalEvent:L,type:Ye,position:{x:ae[0],y:ae[1]}}};if(F)F.unactivate();var be;if(t.touchData.cxt){if(be=ue("cxttapend"),F)F.emit(be);else K.emit(be);if(!t.touchData.cxtDragged){var fe=ue("cxttap");if(F)F.emit(fe);else K.emit(fe)}if(t.touchData.start)t.touchData.start._private.grabbed=!1;t.touchData.cxt=!1,t.touchData.start=null,t.redraw();return}if(!L.touches[2]&&K.boxSelectionEnabled()&&t.touchData.selecting){t.touchData.selecting=!1;var le=K.collection(t.getAllInBox(H[0],H[1],H[2],H[3]));H[0]=void 0,H[1]=void 0,H[2]=void 0,H[3]=void 0,H[4]=0,t.redrawHint("select",!0),K.emit(ue("boxend"));var De=function(Ye){return Ye.selectable()&&!Ye.selected()};if(le.emit(ue("box")).stdFilter(De).select().emit(ue("boxselect")),le.nonempty())t.redrawHint("eles",!0);t.redraw()}if(F!=null)F.unactivate();if(L.touches[2])t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);else if(L.touches[1]);else if(L.touches[0]);else if(!L.touches[0]){t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var ce=t.dragData.touchDragEles;if(F!=null){var pe=F._private.grabbed;if(g(ce),t.redrawHint("drag",!0),t.redrawHint("eles",!0),pe){if(F.emit(ue("freeon")),ce.emit(ue("free")),t.dragData.didDrag)F.emit(ue("dragfreeon")),ce.emit(ue("dragfree"))}n(F,["touchend","tapend","vmouseup","tapdragout"],L,{x:ae[0],y:ae[1]}),F.unactivate(),t.touchData.start=null}else{var Ie=t.findNearestElement(ae[0],ae[1],!0,!0);n(Ie,["touchend","tapend","vmouseup","tapdragout"],L,{x:ae[0],y:ae[1]})}var xe=t.touchData.startPosition[0]-ae[0],me=xe*xe,Ve=t.touchData.startPosition[1]-ae[1],Be=Ve*Ve,Ke=me+Be,He=Ke*se*se;if(!t.touchData.singleTouchMoved){if(!F)K.$(":selected").unselect(["tapunselect"]);if(n(F,["tap","vclick"],L,{x:ae[0],y:ae[1]}),Se=!1,L.timeStamp-ve<=K.multiClickDebounceTime())ge&&clearTimeout(ge),Se=!0,ve=null,n(F,["dbltap","vdblclick"],L,{x:ae[0],y:ae[1]});else ge=setTimeout(function(){if(Se)return;n(F,["onetap","voneclick"],L,{x:ae[0],y:ae[1]})},K.multiClickDebounceTime()),ve=L.timeStamp}if(F!=null&&!t.dragData.didDrag&&F._private.selectable&&He<t.touchTapThreshold2&&!t.pinching){if(K.selectionType()==="single")K.$(r).unmerge(F).unselect(["tapunselect"]),F.select(["tapselect"]);else if(F.selected())F.unselect(["tapunselect"]);else F.select(["tapselect"]);t.redrawHint("eles",!0)}t.touchData.singleTouchMoved=!0}for(var Le=0;Le<ae.length;Le++)oe[Le]=ae[Le];if(t.dragData.didDrag=!1,L.touches.length===0)t.touchData.dragDelta=[],t.touchData.startPosition=[null,null,null,null,null,null],t.touchData.startGPosition=null,t.touchData.didSelect=!1;if(L.touches.length<2){if(L.touches.length===1)t.touchData.startGPosition=[L.touches[0].clientX,L.touches[0].clientY];t.pinching=!1,t.redrawHint("eles",!0),t.redraw()}},!1),typeof TouchEvent>"u"){var ye=[],Ee=function(L){return{clientX:L.clientX,clientY:L.clientY,force:1,identifier:L.pointerId,pageX:L.pageX,pageY:L.pageY,radiusX:L.width/2,radiusY:L.height/2,screenX:L.screenX,screenY:L.screenY,target:L.target}},Pe=function(L){return{event:L,touch:Ee(L)}},Me=function(L){ye.push(Pe(L))},Ne=function(L){for(var F=0;F<ye.length;F++){var Y=ye[F];if(Y.event.pointerId===L.pointerId){ye.splice(F,1);return}}},Fe=function(L){var F=ye.filter(function(Y){return Y.event.pointerId===L.pointerId})[0];F.event=L,F.touch=Ee(L)},ze=function(L){L.touches=ye.map(function(F){return F.touch})},Ue=function(L){return L.pointerType==="mouse"||L.pointerType===4};t.registerBinding(t.container,"pointerdown",function(ie){if(Ue(ie))return;ie.preventDefault(),Me(ie),ze(ie),ee(ie)}),t.registerBinding(t.container,"pointerup",function(ie){if(Ue(ie))return;Ne(ie),ze(ie),Ce(ie)}),t.registerBinding(t.container,"pointercancel",function(ie){if(Ue(ie))return;Ne(ie),ze(ie),Ae(ie)}),t.registerBinding(t.container,"pointermove",function(ie){if(Ue(ie))return;ie.preventDefault(),Fe(ie),ze(ie),de(ie)})}};var or={};or.generatePolygon=function(t,e){return this.nodeShapes[t]={renderer:this,name:t,points:e,draw:function(a,n,i,s,o,l){this.renderer.nodeShapeImpl("polygon",a,n,i,s,o,this.points)},intersectLine:function(a,n,i,s,o,l,u,f){return Ha(o,l,this.points,a,n,i/2,s/2,u)},checkPoint:function(a,n,i,s,o,l,u,f){return sr(a,n,this.points,l,u,s,o,[0,-1],i)},hasMiterBounds:t!=="rectangle",miterBounds:function(a,n,i,s,o,l){return Gc(this.points,a,n,i,s,o)}}};or.generateEllipse=function(){return this.nodeShapes.ellipse={renderer:this,name:"ellipse",draw:function(e,r,a,n,i,s){this.renderer.nodeShapeImpl(this.name,e,r,a,n,i)},intersectLine:function(e,r,a,n,i,s,o,l){return Kc(i,s,e,r,a/2+o,n/2+o)},checkPoint:function(e,r,a,n,i,s,o,l){return Vr(e,r,n,i,s,o,a)}}};or.generateRoundPolygon=function(t,e){return this.nodeShapes[t]={renderer:this,name:t,points:e,getOrCreateCorners:function(a,n,i,s,o,l,u){if(l[u]!==void 0&&l[u+"-cx"]===a&&l[u+"-cy"]===n&&l[u+"-w"]===i&&l[u+"-h"]===s&&l[u+"-corner-radius"]===o)return l[u];l[u]=Array(e.length/2),l[u+"-cx"]=a,l[u+"-cy"]=n,l[u+"-w"]=i,l[u+"-h"]=s,l[u+"-corner-radius"]=o;var f=i/2,v=s/2;o=o==="auto"?Gf(i,s):o;var h=Array(e.length/2);for(var c=0;c<e.length/2;c++)h[c]={x:a+f*e[c*2],y:n+v*e[c*2+1]};var d,g,y,p,m=h.length;g=h[m-1];for(d=0;d<m;d++)y=h[d%m],p=h[(d+1)%m],l[u][d]=No(g,y,p,o),g=y,y=p;return l[u]},draw:function(a,n,i,s,o,l,u){this.renderer.nodeShapeImpl("round-polygon",a,n,i,s,o,this.points,this.getOrCreateCorners(n,i,s,o,l,u,"drawCorners"))},intersectLine:function(a,n,i,s,o,l,u,f,v){return _c(o,l,this.points,a,n,i,s,u,this.getOrCreateCorners(a,n,i,s,f,v,"corners"))},checkPoint:function(a,n,i,s,o,l,u,f,v){return $c(a,n,this.points,l,u,s,o,this.getOrCreateCorners(l,u,s,o,f,v,"corners"))}}};or.generateRoundRectangle=function(){return this.nodeShapes["round-rectangle"]=this.nodeShapes.roundrectangle={renderer:this,name:"round-rectangle",points:Pt(4,0),draw:function(e,r,a,n,i,s){this.renderer.nodeShapeImpl(this.name,e,r,a,n,i,this.points,s)},intersectLine:function(e,r,a,n,i,s,o,l){return zf(i,s,e,r,a,n,o,l)},checkPoint:function(e,r,a,n,i,s,o,l){var u=n/2,f=i/2;l=l==="auto"?Cr(n,i):l,l=Math.min(u,f,l);var v=l*2;if(sr(e,r,this.points,s,o,n,i-v,[0,-1],a))return!0;if(sr(e,r,this.points,s,o,n-v,i,[0,-1],a))return!0;if(Vr(e,r,v,v,s-u+l,o-f+l,a))return!0;if(Vr(e,r,v,v,s+u-l,o-f+l,a))return!0;if(Vr(e,r,v,v,s+u-l,o+f-l,a))return!0;if(Vr(e,r,v,v,s-u+l,o+f-l,a))return!0;return!1}}};or.generateCutRectangle=function(){return this.nodeShapes["cut-rectangle"]=this.nodeShapes.cutrectangle={renderer:this,name:"cut-rectangle",cornerLength:Eo(),points:Pt(4,0),draw:function(e,r,a,n,i,s){this.renderer.nodeShapeImpl(this.name,e,r,a,n,i,null,s)},generateCutTrianglePts:function(e,r,a,n,i){var s=i==="auto"?this.cornerLength:i,o=r/2,l=e/2,u=a-l,f=a+l,v=n-o,h=n+o;return{topLeft:[u,v+s,u+s,v,u+s,v+s],topRight:[f-s,v,f,v+s,f-s,v+s],bottomRight:[f,h-s,f-s,h,f-s,h-s],bottomLeft:[u+s,h,u,h-s,u+s,h-s]}},intersectLine:function(e,r,a,n,i,s,o,l){var u=this.generateCutTrianglePts(a+2*o,n+2*o,e,r,l),f=[].concat.apply([],[u.topLeft.splice(0,4),u.topRight.splice(0,4),u.bottomRight.splice(0,4),u.bottomLeft.splice(0,4)]);return Ha(i,s,f,e,r)},checkPoint:function(e,r,a,n,i,s,o,l){var u=l==="auto"?this.cornerLength:l;if(sr(e,r,this.points,s,o,n,i-2*u,[0,-1],a))return!0;if(sr(e,r,this.points,s,o,n-2*u,i,[0,-1],a))return!0;var f=this.generateCutTrianglePts(n,i,s,o);return Bt(e,r,f.topLeft)||Bt(e,r,f.topRight)||Bt(e,r,f.bottomRight)||Bt(e,r,f.bottomLeft)}}};or.generateBarrel=function(){return this.nodeShapes.barrel={renderer:this,name:"barrel",points:Pt(4,0),draw:function(e,r,a,n,i,s){this.renderer.nodeShapeImpl(this.name,e,r,a,n,i)},intersectLine:function(e,r,a,n,i,s,o,l){var u=0.15,f=0.5,v=0.85,h=this.generateBarrelBezierPts(a+2*o,n+2*o,e,r),c=function(y){var p=ia({x:y[0],y:y[1]},{x:y[2],y:y[3]},{x:y[4],y:y[5]},u),m=ia({x:y[0],y:y[1]},{x:y[2],y:y[3]},{x:y[4],y:y[5]},f),b=ia({x:y[0],y:y[1]},{x:y[2],y:y[3]},{x:y[4],y:y[5]},v);return[y[0],y[1],p.x,p.y,m.x,m.y,b.x,b.y,y[4],y[5]]},d=[].concat(c(h.topLeft),c(h.topRight),c(h.bottomRight),c(h.bottomLeft));return Ha(i,s,d,e,r)},generateBarrelBezierPts:function(e,r,a,n){var i=r/2,s=e/2,o=a-s,l=a+s,u=n-i,f=n+i,v=Ws(e,r),{heightOffset:h,widthOffset:c}=v,d=v.ctrlPtOffsetPct*e,g={topLeft:[o,u+h,o+d,u,o+c,u],topRight:[l-c,u,l-d,u,l,u+h],bottomRight:[l,f-h,l-d,f,l-c,f],bottomLeft:[o+c,f,o+d,f,o,f-h]};return g.topLeft.isTop=!0,g.topRight.isTop=!0,g.bottomLeft.isBottom=!0,g.bottomRight.isBottom=!0,g},checkPoint:function(e,r,a,n,i,s,o,l){var u=Ws(n,i),{heightOffset:f,widthOffset:v}=u;if(sr(e,r,this.points,s,o,n,i-2*f,[0,-1],a))return!0;if(sr(e,r,this.points,s,o,n-2*v,i,[0,-1],a))return!0;var h=this.generateBarrelBezierPts(n,i,s,o),c=function(P,N,R){var I=R[4],w=R[2],x=R[0],T=R[5],D=R[1],C=Math.min(I,x),O=Math.max(I,x),B=Math.min(T,D),z=Math.max(T,D);if(C<=P&&P<=O&&B<=N&&N<=z){var V=Qc(I,w,x),k=qc(V[0],V[1],V[2],P),G=k.filter(function(J){return 0<=J&&J<=1});if(G.length>0)return G[0]}return null},d=Object.keys(h);for(var g=0;g<d.length;g++){var y=d[g],p=h[y],m=c(e,r,p);if(m==null)continue;var b=p[5],E=p[3],A=p[1],M=bt(b,E,A,m);if(p.isTop&&M<=r)return!0;if(p.isBottom&&r<=M)return!0}return!1}}};or.generateBottomRoundrectangle=function(){return this.nodeShapes["bottom-round-rectangle"]=this.nodeShapes.bottomroundrectangle={renderer:this,name:"bottom-round-rectangle",points:Pt(4,0),draw:function(e,r,a,n,i,s){this.renderer.nodeShapeImpl(this.name,e,r,a,n,i,this.points,s)},intersectLine:function(e,r,a,n,i,s,o,l){var u=e-(a/2+o),f=r-(n/2+o),v=f,h=e+(a/2+o),c=br(i,s,e,r,u,f,h,v,!1);if(c.length>0)return c;return zf(i,s,e,r,a,n,o,l)},checkPoint:function(e,r,a,n,i,s,o,l){l=l==="auto"?Cr(n,i):l;var u=2*l;if(sr(e,r,this.points,s,o,n,i-u,[0,-1],a))return!0;if(sr(e,r,this.points,s,o,n-u,i,[0,-1],a))return!0;var f=n/2+2*a,v=i/2+2*a,h=[s-f,o-v,s-f,o,s+f,o,s+f,o-v];if(Bt(e,r,h))return!0;if(Vr(e,r,u,u,s+n/2-l,o+i/2-l,a))return!0;if(Vr(e,r,u,u,s-n/2+l,o+i/2-l,a))return!0;return!1}}};or.registerNodeShapes=function(){var t=this.nodeShapes={},e=this;this.generateEllipse(),this.generatePolygon("triangle",Pt(3,0)),this.generateRoundPolygon("round-triangle",Pt(3,0)),this.generatePolygon("rectangle",Pt(4,0)),t.square=t.rectangle,this.generateRoundRectangle(),this.generateCutRectangle(),this.generateBarrel(),this.generateBottomRoundrectangle();{var r=[0,1,1,0,0,-1,-1,0];this.generatePolygon("diamond",r),this.generateRoundPolygon("round-diamond",r)}this.generatePolygon("pentagon",Pt(5,0)),this.generateRoundPolygon("round-pentagon",Pt(5,0)),this.generatePolygon("hexagon",Pt(6,0)),this.generateRoundPolygon("round-hexagon",Pt(6,0)),this.generatePolygon("heptagon",Pt(7,0)),this.generateRoundPolygon("round-heptagon",Pt(7,0)),this.generatePolygon("octagon",Pt(8,0)),this.generateRoundPolygon("round-octagon",Pt(8,0));var a=Array(20);{var n=Xs(5,0),i=Xs(5,Math.PI/5),s=0.5*(3-Math.sqrt(5));s*=1.57;for(var o=0;o<i.length/2;o++)i[o*2]*=s,i[o*2+1]*=s;for(var o=0;o<5;o++)a[o*4]=n[o*2],a[o*4+1]=n[o*2+1],a[o*4+2]=i[o*2],a[o*4+3]=i[o*2+1]}a=Vf(a),this.generatePolygon("star",a),this.generatePolygon("vee",[-1,-1,0,-0.333,1,-1,0,1]),this.generatePolygon("rhomboid",[-1,-1,0.333,-1,1,1,-0.333,1]),this.generatePolygon("right-rhomboid",[-0.333,-1,1,-1,0.333,1,-1,1]),this.nodeShapes.concavehexagon=this.generatePolygon("concave-hexagon",[-1,-0.95,-0.75,0,-1,0.95,1,0.95,0.75,0,1,-0.95]);{var l=[-1,-1,0.25,-1,1,0,0.25,1,-1,1];this.generatePolygon("tag",l),this.generateRoundPolygon("round-tag",l)}t.makePolygon=function(u){var f=u.join("$"),v="polygon-"+f,h;if(h=this[v])return h;return e.generatePolygon(v,u)}};var nn={};nn.timeToRender=function(){return this.redrawTotalTime/this.redrawCount};nn.redraw=function(t){t=t||Of();var e=this;if(e.averageRedrawTime===void 0)e.averageRedrawTime=0;if(e.lastRedrawTime===void 0)e.lastRedrawTime=0;if(e.lastDrawTime===void 0)e.lastDrawTime=0;e.requestedFrame=!0,e.renderOptions=t};nn.beforeRender=function(t,e){if(this.destroyed)return;if(e==null)it("Priority is not optional for beforeRender");var r=this.beforeRenderCallbacks;r.push({fn:t,priority:e}),r.sort(function(a,n){return n.priority-a.priority})};var _l=function(e,r,a){var n=e.beforeRenderCallbacks;for(var i=0;i<n.length;i++)n[i].fn(r,a)};nn.startRenderLoop=function(){var t=this,e=t.cy;if(t.renderLoopStarted)return;else t.renderLoopStarted=!0;var r=function(n){if(t.destroyed)return;if(e.batching());else if(t.requestedFrame&&!t.skipFrame){_l(t,!0,n);var i=ir();t.render(t.renderOptions);var s=t.lastDrawTime=ir();if(t.averageRedrawTime===void 0)t.averageRedrawTime=s-i;if(t.redrawCount===void 0)t.redrawCount=0;if(t.redrawCount++,t.redrawTotalTime===void 0)t.redrawTotalTime=0;var o=s-i;t.redrawTotalTime+=o,t.lastRedrawTime=o,t.averageRedrawTime=t.averageRedrawTime/2+o/2,t.requestedFrame=!1}else _l(t,!1,n);t.skipFrame=!1,Fn(r)};Fn(r)};var py=function(e){this.init(e)},Uv=py,ba=Uv.prototype;ba.clientFunctions=["redrawHint","render","renderTo","matchCanvasSize","nodeShapeImpl","arrowShapeImpl"];ba.init=function(t){var e=this;e.options=t,e.cy=t.cy;var r=e.container=t.cy.container(),a=e.cy.window();if(a){var n=a.document,i=n.head,s="__________cytoscape_stylesheet",o="__________cytoscape_container",l=n.getElementById(s)!=null;if(r.className.indexOf(o)<0)r.className=(r.className||"")+" "+o;if(!l){var u=n.createElement("style");u.id=s,u.textContent="."+o+" { position: relative; }",i.insertBefore(u,i.children[0])}var f=a.getComputedStyle(r),v=f.getPropertyValue("position");if(v==="static")_e("A Cytoscape container has style position:static and so can not use UI extensions properly")}e.selection=[void 0,void 0,void 0,void 0,0],e.bezierProjPcts=[0.05,0.225,0.4,0.5,0.6,0.775,0.95],e.hoverData={down:null,last:null,downTime:null,triggerMode:null,dragging:!1,initialPan:[null,null],capture:!1},e.dragData={possibleDragElements:[]},e.touchData={start:null,capture:!1,startPosition:[null,null,null,null,null,null],singleTouchStartTime:null,singleTouchMoved:!0,now:[null,null,null,null,null,null],earlier:[null,null,null,null,null,null]},e.redraws=0,e.showFps=t.showFps,e.debug=t.debug,e.webgl=t.webgl,e.hideEdgesOnViewport=t.hideEdgesOnViewport,e.textureOnViewport=t.textureOnViewport,e.wheelSensitivity=t.wheelSensitivity,e.motionBlurEnabled=t.motionBlur,e.forcedPixelRatio=he(t.pixelRatio)?t.pixelRatio:null,e.motionBlur=t.motionBlur,e.motionBlurOpacity=t.motionBlurOpacity,e.motionBlurTransparency=1-e.motionBlurOpacity,e.motionBlurPxRatio=1,e.mbPxRBlurry=1,e.minMbLowQualFrames=4,e.fullQualityMb=!1,e.clearedForMotionBlur=[],e.desktopTapThreshold=t.desktopTapThreshold,e.desktopTapThreshold2=t.desktopTapThreshold*t.desktopTapThreshold,e.touchTapThreshold=t.touchTapThreshold,e.touchTapThreshold2=t.touchTapThreshold*t.touchTapThreshold,e.tapholdDuration=500,e.bindings=[],e.beforeRenderCallbacks=[],e.beforeRenderPriorities={animations:400,eleCalcs:300,eleTxrDeq:200,lyrTxrDeq:150,lyrTxrSkip:100},e.registerNodeShapes(),e.registerArrowShapes(),e.registerCalculationListeners()};ba.notify=function(t,e){var r=this,a=r.cy;if(this.destroyed)return;if(t==="init"){r.load();return}if(t==="destroy"){r.destroy();return}if(t==="add"||t==="remove"||t==="move"&&a.hasCompoundNodes()||t==="load"||t==="zorder"||t==="mount")r.invalidateCachedZSortedEles();if(t==="viewport")r.redrawHint("select",!0);if(t==="gc")r.redrawHint("gc",!0);if(t==="load"||t==="resize"||t==="mount")r.invalidateContainerClientCoordsCache(),r.matchCanvasSize(r.container);r.redrawHint("eles",!0),r.redrawHint("drag",!0),this.startRenderLoop(),this.redraw()};ba.destroy=function(){var t=this;t.destroyed=!0,t.cy.stopAnimationLoop();for(var e=0;e<t.bindings.length;e++){var r=t.bindings[e],a=r,n=a.target;(n.off||n.removeEventListener).apply(n,a.args)}if(t.bindings=[],t.beforeRenderCallbacks=[],t.onUpdateEleCalcsFns=[],t.removeObserver)t.removeObserver.disconnect();if(t.styleObserver)t.styleObserver.disconnect();if(t.resizeObserver)t.resizeObserver.disconnect();if(t.labelCalcDiv)try{document.body.removeChild(t.labelCalcDiv)}catch(i){}};ba.isHeadless=function(){return!1};[Po,zv,Vv,ma,or,nn].forEach(function(t){Oe(ba,t)});var ks=16.666666666666668,Hv={setupDequeueing:function(e){return function(){var a=this,n=this.renderer;if(a.dequeueingSetup)return;else a.dequeueingSetup=!0;var i=ja(function(){n.redrawHint("eles",!0),n.redrawHint("drag",!0),n.redraw()},e.deqRedrawThreshold),s=function(u,f){var v=ir(),{averageRedrawTime:h,lastRedrawTime:c}=n,d=[],g=n.cy.extent(),y=n.getPixelRatio();if(!u)n.flushRenderedStyleQueue();while(!0){var p=ir(),m=p-v,b=p-f;if(c<ks){var E=ks-(u?h:0);if(b>=e.deqFastCost*E)break}else if(u){if(m>=e.deqCost*c||m>=e.deqAvgCost*h)break}else if(b>=e.deqNoDrawCost*ks)break;var A=e.deq(a,y,g);if(A.length>0)for(var M=0;M<A.length;M++)d.push(A[M]);else break}if(d.length>0){if(e.onDeqd(a,d),!u&&e.shouldRedraw(a,d,y,g))i()}},o=e.priority||po;n.beforeRender(s,o(a))}}},yy=function(){function t(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:zn;Mr(this,t),this.idsByKey=new nr,this.keyForId=new nr,this.cachesByLvl=new nr,this.lvls=[],this.getKey=e,this.doesEleInvalidateKey=r}return Lr(t,[{key:"getIdsFor",value:function(r){if(r==null)it("Can not get id list for null key");var a=this.idsByKey,n=this.idsByKey.get(r);if(!n)n=new da,a.set(r,n);return n}},{key:"addIdForKey",value:function(r,a){if(r!=null)this.getIdsFor(r).add(a)}},{key:"deleteIdForKey",value:function(r,a){if(r!=null)this.getIdsFor(r).delete(a)}},{key:"getNumberOfIdsForKey",value:function(r){if(r==null)return 0;else return this.getIdsFor(r).size}},{key:"updateKeyMappingFor",value:function(r){var a=r.id(),n=this.keyForId.get(a),i=this.getKey(r);this.deleteIdForKey(n,a),this.addIdForKey(i,a),this.keyForId.set(a,i)}},{key:"deleteKeyMappingFor",value:function(r){var a=r.id(),n=this.keyForId.get(a);this.deleteIdForKey(n,a),this.keyForId.delete(a)}},{key:"keyHasChangedFor",value:function(r){var a=r.id(),n=this.keyForId.get(a),i=this.getKey(r);return n!==i}},{key:"isInvalid",value:function(r){return this.keyHasChangedFor(r)||this.doesEleInvalidateKey(r)}},{key:"getCachesAt",value:function(r){var a=this.cachesByLvl,n=this.lvls,i=a.get(r);if(!i)i=new nr,a.set(r,i),n.push(r);return i}},{key:"getCache",value:function(r,a){return this.getCachesAt(a).get(r)}},{key:"get",value:function(r,a){var n=this.getKey(r),i=this.getCache(n,a);if(i!=null)this.updateKeyMappingFor(r);return i}},{key:"getForCachedKey",value:function(r,a){var n=this.keyForId.get(r.id()),i=this.getCache(n,a);return i}},{key:"hasCache",value:function(r,a){return this.getCachesAt(a).has(r)}},{key:"has",value:function(r,a){var n=this.getKey(r);return this.hasCache(n,a)}},{key:"setCache",value:function(r,a,n){n.key=r,this.getCachesAt(a).set(r,n)}},{key:"set",value:function(r,a,n){var i=this.getKey(r);this.setCache(i,a,n),this.updateKeyMappingFor(r)}},{key:"deleteCache",value:function(r,a){this.getCachesAt(a).delete(r)}},{key:"delete",value:function(r,a){var n=this.getKey(r);this.deleteCache(n,a)}},{key:"invalidateKey",value:function(r){var a=this;this.lvls.forEach(function(n){return a.deleteCache(r,n)})}},{key:"invalidate",value:function(r){var a=r.id(),n=this.keyForId.get(a);this.deleteKeyMappingFor(r);var i=this.doesEleInvalidateKey(r);if(i)this.invalidateKey(n);return i||this.getNumberOfIdsForKey(n)===0}}])}(),Ql=25,xn=50,On=-4,io=3,qv=7.99,my=8,by=1024,wy=1024,Ey=1024,xy=0.2,Ty=0.8,Cy=10,Sy=0.15,Dy=0.1,Ay=0.9,My=0.9,Ly=100,Ry=1,na={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},Py=St({getKey:null,doesEleInvalidateKey:zn,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:Rf,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),Ia=function(e,r){var a=this;a.renderer=e,a.onDequeues=[];var n=Py(r);Oe(a,n),a.lookup=new yy(n.getKey,n.doesEleInvalidateKey),a.setupDequeueing()},mt=Ia.prototype;mt.reasons=na;mt.getTextureQueue=function(t){var e=this;return e.eleImgCaches=e.eleImgCaches||{},e.eleImgCaches[t]=e.eleImgCaches[t]||[]};mt.getRetiredTextureQueue=function(t){var e=this,r=e.eleImgCaches.retired=e.eleImgCaches.retired||{},a=r[t]=r[t]||[];return a};mt.getElementQueue=function(){var t=this,e=t.eleCacheQueue=t.eleCacheQueue||new en(function(r,a){return a.reqs-r.reqs});return e};mt.getElementKeyToQueue=function(){var t=this,e=t.eleKeyToCacheQueue=t.eleKeyToCacheQueue||{};return e};mt.getElement=function(t,e,r,a,n){var i=this,s=this.renderer,o=s.cy.zoom(),l=this.lookup;if(!e||e.w===0||e.h===0||isNaN(e.w)||isNaN(e.h)||!t.visible()||t.removed())return null;if(!i.allowEdgeTxrCaching&&t.isEdge()||!i.allowParentTxrCaching&&t.isParent())return null;if(a==null)a=Math.ceil(mo(o*r));if(a<On)a=On;else if(o>=qv||a>io)return null;var u=Math.pow(2,a),f=e.h*u,v=e.w*u,h=s.eleTextBiggerThanMin(t,u);if(!this.isVisible(t,h))return null;var c=l.get(t,a);if(c&&c.invalidated)c.invalidated=!1,c.texture.invalidatedWidth-=c.width;if(c)return c;var d;if(f<=Ql)d=Ql;else if(f<=xn)d=xn;else d=Math.ceil(f/xn)*xn;if(f>Ey||v>wy)return null;var g=i.getTextureQueue(d),y=g[g.length-2],p=function(){return i.recycleTexture(d,v)||i.addTexture(d,v)};if(!y)y=g[g.length-1];if(!y)y=p();if(y.width-y.usedWidth<v)y=p();var m=function(C){return C&&C.scaledLabelShown===h},b=n&&n===na.dequeue,E=n&&n===na.highQuality,A=n&&n===na.downscale,M;for(var S=a+1;S<=io;S++){var P=l.get(t,S);if(P){M=P;break}}var N=M&&M.level===a+1?M:null,R=function(){y.context.drawImage(N.texture.canvas,N.x,0,N.width,N.height,y.usedWidth,0,v,f)};if(y.context.setTransform(1,0,0,1,0,0),y.context.clearRect(y.usedWidth,0,v,d),m(N))R();else if(m(M))if(E){for(var I=M.level;I>a;I--)N=i.getElement(t,e,r,I,na.downscale);R()}else return i.queueElement(t,M.level-1),M;else{var w;if(!b&&!E&&!A)for(var x=a-1;x>=On;x--){var T=l.get(t,x);if(T){w=T;break}}if(m(w))return i.queueElement(t,a),w;y.context.translate(y.usedWidth,0),y.context.scale(u,u),this.drawElement(y.context,t,e,h,!1),y.context.scale(1/u,1/u),y.context.translate(-y.usedWidth,0)}return c={x:y.usedWidth,texture:y,level:a,scale:u,width:v,height:f,scaledLabelShown:h},y.usedWidth+=Math.ceil(v+my),y.eleCaches.push(c),l.set(t,a,c),i.checkTextureFullness(y),c};mt.invalidateElements=function(t){for(var e=0;e<t.length;e++)this.invalidateElement(t[e])};mt.invalidateElement=function(t){var e=this,r=e.lookup,a=[],n=r.isInvalid(t);if(!n)return;for(var i=On;i<=io;i++){var s=r.getForCachedKey(t,i);if(s)a.push(s)}var o=r.invalidate(t);if(o)for(var l=0;l<a.length;l++){var u=a[l],f=u.texture;f.invalidatedWidth+=u.width,u.invalidated=!0,e.checkTextureUtility(f)}e.removeFromQueue(t)};mt.checkTextureUtility=function(t){if(t.invalidatedWidth>=xy*t.width)this.retireTexture(t)};mt.checkTextureFullness=function(t){var e=this,r=e.getTextureQueue(t.height);if(t.usedWidth/t.width>Ty&&t.fullnessChecks>=Cy)Tr(r,t);else t.fullnessChecks++};mt.retireTexture=function(t){var e=this,r=t.height,a=e.getTextureQueue(r),n=this.lookup;Tr(a,t),t.retired=!0;var i=t.eleCaches;for(var s=0;s<i.length;s++){var o=i[s];n.deleteCache(o.key,o.level)}yo(i);var l=e.getRetiredTextureQueue(r);l.push(t)};mt.addTexture=function(t,e){var r=this,a=r.getTextureQueue(t),n={};return a.push(n),n.eleCaches=[],n.height=t,n.width=Math.max(by,e),n.usedWidth=0,n.invalidatedWidth=0,n.fullnessChecks=0,n.canvas=r.renderer.makeOffscreenCanvas(n.width,n.height),n.context=n.canvas.getContext("2d"),n};mt.recycleTexture=function(t,e){var r=this,a=r.getTextureQueue(t),n=r.getRetiredTextureQueue(t);for(var i=0;i<n.length;i++){var s=n[i];if(s.width>=e)return s.retired=!1,s.usedWidth=0,s.invalidatedWidth=0,s.fullnessChecks=0,yo(s.eleCaches),s.context.setTransform(1,0,0,1,0,0),s.context.clearRect(0,0,s.width,s.height),Tr(n,s),a.push(s),s}};mt.queueElement=function(t,e){var r=this,a=r.getElementQueue(),n=r.getElementKeyToQueue(),i=this.getKey(t),s=n[i];if(s)s.level=Math.max(s.level,e),s.eles.merge(t),s.reqs++,a.updateItem(s);else{var o={eles:t.spawn().merge(t),level:e,reqs:1,key:i};a.push(o),n[i]=o}};mt.dequeue=function(t){var e=this,r=e.getElementQueue(),a=e.getElementKeyToQueue(),n=[],i=e.lookup;for(var s=0;s<Ry;s++)if(r.size()>0){var o=r.pop(),l=o.key,u=o.eles[0],f=i.hasCache(u,o.level);if(a[l]=null,f)continue;n.push(o);var v=e.getBoundingBox(u);e.getElement(u,v,t,o.level,na.dequeue)}else break;return n};mt.removeFromQueue=function(t){var e=this,r=e.getElementQueue(),a=e.getElementKeyToQueue(),n=this.getKey(t),i=a[n];if(i!=null)if(i.eles.length===1)i.reqs=go,r.updateItem(i),r.pop(),a[n]=null;else i.eles.unmerge(t)};mt.onDequeue=function(t){this.onDequeues.push(t)};mt.offDequeue=function(t){Tr(this.onDequeues,t)};mt.setupDequeueing=Hv.setupDequeueing({deqRedrawThreshold:Ly,deqCost:Sy,deqAvgCost:Dy,deqNoDrawCost:Ay,deqFastCost:My,deq:function(e,r,a){return e.dequeue(r,a)},onDeqd:function(e,r){for(var a=0;a<e.onDequeues.length;a++){var n=e.onDequeues[a];n(r)}},shouldRedraw:function(e,r,a,n){for(var i=0;i<r.length;i++){var s=r[i].eles;for(var o=0;o<s.length;o++){var l=s[o].boundingBox();if(wo(l,n))return!0}}return!1},priority:function(e){return e.renderer.beforeRenderPriorities.eleTxrDeq}});var Ny=1,ka=-4,Wn=2,Oy=3.99,Iy=50,By=50,ky=0.15,Fy=0.1,zy=0.9,Vy=0.9,Gy=1,Jl=250,Uy=16000000,jl=32767,Hy=!0,Yv=function(e){var r=this,a=r.renderer=e,n=a.cy;r.layersByLevel={},r.firstGet=!0,r.lastInvalidationTime=ir()-2*Jl,r.skipping=!1,r.eleTxrDeqs=n.collection(),r.scheduleElementRefinement=ja(function(){r.refineElementTextures(r.eleTxrDeqs),r.eleTxrDeqs.unmerge(r.eleTxrDeqs)},By),a.beforeRender(function(s,o){if(o-r.lastInvalidationTime<=Jl)r.skipping=!0;else r.skipping=!1},a.beforeRenderPriorities.lyrTxrSkip);var i=function(o,l){return l.reqs-o.reqs};r.layersQueue=new en(i),r.setupDequeueing()},Dt=Yv.prototype,ef=0,qy=Math.pow(2,53)-1;Dt.makeLayer=function(t,e){var r=Math.pow(2,e),a=Math.ceil(t.w*r),n=Math.ceil(t.h*r),i=this.renderer.makeOffscreenCanvas(a,n),s={id:ef=++ef%qy,bb:t,level:e,width:a,height:n,canvas:i,context:i.getContext("2d"),eles:[],elesQueue:[],reqs:0},o=s.context,l=-s.bb.x1,u=-s.bb.y1;return o.scale(r,r),o.translate(l,u),s};Dt.getLayers=function(t,e,r){var a=this,n=a.renderer,i=n.cy,s=i.zoom(),o=a.firstGet;if(a.firstGet=!1,r==null){if(r=Math.ceil(mo(s*e)),r<ka)r=ka;else if(s>=Oy||r>Wn)return null}a.validateLayersElesOrdering(r,t);var l=a.layersByLevel,u=Math.pow(2,r),f=l[r]=l[r]||[],v,h=a.levelIsComplete(r,t),c,d=function(){var R=function(D){if(a.validateLayersElesOrdering(D,t),a.levelIsComplete(D,t))return c=l[D],!0},I=function(D){if(c)return;for(var C=r+D;ka<=C&&C<=Wn;C+=D)if(R(C))break};I(1),I(-1);for(var w=f.length-1;w>=0;w--){var x=f[w];if(x.invalid)Tr(f,x)}};if(!h)d();else return f;var g=function(){if(!v){v=Ot();for(var R=0;R<t.length;R++)Fc(v,t[R].boundingBox())}return v},y=function(R){R=R||{};var I=R.after;g();var w=Math.ceil(v.w*u),x=Math.ceil(v.h*u);if(w>jl||x>jl)return null;var T=w*x;if(T>Uy)return null;var D=a.makeLayer(v,r);if(I!=null){var C=f.indexOf(I)+1;f.splice(C,0,D)}else if(R.insert===void 0||R.insert)f.unshift(D);return D};if(a.skipping&&!o)return null;var p=null,m=t.length/Ny,b=!o;for(var E=0;E<t.length;E++){var A=t[E],M=A._private.rscratch,S=M.imgLayerCaches=M.imgLayerCaches||{},P=S[r];if(P){p=P;continue}if(!p||p.eles.length>=m||!Ff(p.bb,A.boundingBox())){if(p=y({insert:!0,after:p}),!p)return null}if(c||b)a.queueLayer(p,A);else a.drawEleInLayer(p,A,r,e);p.eles.push(A),S[r]=p}if(c)return c;if(b)return null;return f};Dt.getEleLevelForLayerLevel=function(t,e){return t};Dt.drawEleInLayer=function(t,e,r,a){var n=this,i=this.renderer,s=t.context,o=e.boundingBox();if(o.w===0||o.h===0||!e.visible())return;r=n.getEleLevelForLayerLevel(r,a),i.setImgSmoothing(s,!1),i.drawCachedElement(s,e,null,null,r,Hy),i.setImgSmoothing(s,!0)};Dt.levelIsComplete=function(t,e){var r=this,a=r.layersByLevel[t];if(!a||a.length===0)return!1;var n=0;for(var i=0;i<a.length;i++){var s=a[i];if(s.reqs>0)return!1;if(s.invalid)return!1;n+=s.eles.length}if(n!==e.length)return!1;return!0};Dt.validateLayersElesOrdering=function(t,e){var r=this.layersByLevel[t];if(!r)return;for(var a=0;a<r.length;a++){var n=r[a],i=-1;for(var s=0;s<e.length;s++)if(n.eles[0]===e[s]){i=s;break}if(i<0){this.invalidateLayer(n);continue}var o=i;for(var s=0;s<n.eles.length;s++)if(n.eles[s]!==e[o+s]){this.invalidateLayer(n);break}}};Dt.updateElementsInLayers=function(t,e){var r=this,a=Za(t[0]);for(var n=0;n<t.length;n++){var i=a?null:t[n],s=a?t[n]:t[n].ele,o=s._private.rscratch,l=o.imgLayerCaches=o.imgLayerCaches||{};for(var u=ka;u<=Wn;u++){var f=l[u];if(!f)continue;if(i&&r.getEleLevelForLayerLevel(f.level)!==i.level)continue;e(f,s,i)}}};Dt.haveLayers=function(){var t=this,e=!1;for(var r=ka;r<=Wn;r++){var a=t.layersByLevel[r];if(a&&a.length>0){e=!0;break}}return e};Dt.invalidateElements=function(t){var e=this;if(t.length===0)return;if(e.lastInvalidationTime=ir(),t.length===0||!e.haveLayers())return;e.updateElementsInLayers(t,function(a,n,i){e.invalidateLayer(a)})};Dt.invalidateLayer=function(t){if(this.lastInvalidationTime=ir(),t.invalid)return;var{level:e,eles:r}=t,a=this.layersByLevel[e];if(Tr(a,t),t.elesQueue=[],t.invalid=!0,t.replacement)t.replacement.invalid=!0;for(var n=0;n<r.length;n++){var i=r[n]._private.rscratch.imgLayerCaches;if(i)i[e]=null}};Dt.refineElementTextures=function(t){var e=this;e.updateElementsInLayers(t,function(a,n,i){var s=a.replacement;if(!s)s=a.replacement=e.makeLayer(a.bb,a.level),s.replaces=a,s.eles=a.eles;if(!s.reqs)for(var o=0;o<s.eles.length;o++)e.queueLayer(s,s.eles[o])})};Dt.enqueueElementRefinement=function(t){this.eleTxrDeqs.merge(t),this.scheduleElementRefinement()};Dt.queueLayer=function(t,e){var r=this,a=r.layersQueue,n=t.elesQueue,i=n.hasId=n.hasId||{};if(t.replacement)return;if(e){if(i[e.id()])return;n.push(e),i[e.id()]=!0}if(t.reqs)t.reqs++,a.updateItem(t);else t.reqs=1,a.push(t)};Dt.dequeue=function(t){var e=this,r=e.layersQueue,a=[],n=0;while(n<Gy){if(r.size()===0)break;var i=r.peek();if(i.replacement){r.pop();continue}if(i.replaces&&i!==i.replaces.replacement){r.pop();continue}if(i.invalid){r.pop();continue}var s=i.elesQueue.shift();if(s)e.drawEleInLayer(i,s,i.level,t),n++;if(a.length===0)a.push(!0);if(i.elesQueue.length===0){if(r.pop(),i.reqs=0,i.replaces)e.applyLayerReplacement(i);e.requestRedraw()}}return a};Dt.applyLayerReplacement=function(t){var e=this,r=e.layersByLevel[t.level],a=t.replaces,n=r.indexOf(a);if(n<0||a.invalid)return;r[n]=t;for(var i=0;i<t.eles.length;i++){var s=t.eles[i]._private,o=s.imgLayerCaches=s.imgLayerCaches||{};if(o)o[t.level]=t}e.requestRedraw()};Dt.requestRedraw=ja(function(){var t=this.renderer;t.redrawHint("eles",!0),t.redrawHint("drag",!0),t.redraw()},100);Dt.setupDequeueing=Hv.setupDequeueing({deqRedrawThreshold:Iy,deqCost:ky,deqAvgCost:Fy,deqNoDrawCost:zy,deqFastCost:Vy,deq:function(e,r){return e.dequeue(r)},onDeqd:po,shouldRedraw:Rf,priority:function(e){return e.renderer.beforeRenderPriorities.lyrTxrDeq}});var Xv={},tf;function Yy(t,e){for(var r=0;r<e.length;r++){var a=e[r];t.lineTo(a.x,a.y)}}function Xy(t,e,r){var a;for(var n=0;n<e.length;n++){var i=e[n];if(n===0)a=i;t.lineTo(i.x,i.y)}t.quadraticCurveTo(r.x,r.y,a.x,a.y)}function rf(t,e,r){if(t.beginPath)t.beginPath();var a=e;for(var n=0;n<a.length;n++){var i=a[n];t.lineTo(i.x,i.y)}var s=r,o=r[0];t.moveTo(o.x,o.y);for(var n=1;n<s.length;n++){var i=s[n];t.lineTo(i.x,i.y)}if(t.closePath)t.closePath()}function Wy(t,e,r,a,n){if(t.beginPath)t.beginPath();t.arc(r,a,n,0,Math.PI*2,!1);var i=e,s=i[0];t.moveTo(s.x,s.y);for(var o=0;o<i.length;o++){var l=i[o];t.lineTo(l.x,l.y)}if(t.closePath)t.closePath()}function $y(t,e,r,a){t.arc(e,r,a,0,Math.PI*2,!1)}Xv.arrowShapeImpl=function(t){return(tf||(tf={polygon:Yy,"triangle-backcurve":Xy,"triangle-tee":rf,"circle-triangle":Wy,"triangle-cross":rf,circle:$y}))[t]};var tr={};tr.drawElement=function(t,e,r,a,n,i){var s=this;if(e.isNode())s.drawNode(t,e,r,a,n,i);else s.drawEdge(t,e,r,a,n,i)};tr.drawElementOverlay=function(t,e){var r=this;if(e.isNode())r.drawNodeOverlay(t,e);else r.drawEdgeOverlay(t,e)};tr.drawElementUnderlay=function(t,e){var r=this;if(e.isNode())r.drawNodeUnderlay(t,e);else r.drawEdgeUnderlay(t,e)};tr.drawCachedElementPortion=function(t,e,r,a,n,i,s,o){var l=this,u=r.getBoundingBox(e);if(u.w===0||u.h===0)return;var f=r.getElement(e,u,a,n,i);if(f!=null){var v=o(l,e);if(v===0)return;var h=s(l,e),{x1:c,y1:d,w:g,h:y}=u,p,m,b,E,A;if(h!==0){var M=r.getRotationPoint(e);if(b=M.x,E=M.y,t.translate(b,E),t.rotate(h),A=l.getImgSmoothing(t),!A)l.setImgSmoothing(t,!0);var S=r.getRotationOffset(e);p=S.x,m=S.y}else p=c,m=d;var P;if(v!==1)P=t.globalAlpha,t.globalAlpha=P*v;if(t.drawImage(f.texture.canvas,f.x,0,f.width,f.height,p,m,g,y),v!==1)t.globalAlpha=P;if(h!==0){if(t.rotate(-h),t.translate(-b,-E),!A)l.setImgSmoothing(t,!1)}}else r.drawElement(t,e)};var Ky=function(){return 0},Zy=function(e,r){return e.getTextAngle(r,null)},_y=function(e,r){return e.getTextAngle(r,"source")},Qy=function(e,r){return e.getTextAngle(r,"target")},Jy=function(e,r){return r.effectiveOpacity()},Fs=function(e,r){return r.pstyle("text-opacity").pfValue*r.effectiveOpacity()};tr.drawCachedElement=function(t,e,r,a,n,i){var s=this,o=s.data,{eleTxrCache:l,lblTxrCache:u,slbTxrCache:f,tlbTxrCache:v}=o,h=e.boundingBox(),c=i===!0?l.reasons.highQuality:null;if(h.w===0||h.h===0||!e.visible())return;if(!a||wo(h,a)){var d=e.isEdge(),g=e.element()._private.rscratch.badLine;if(s.drawElementUnderlay(t,e),s.drawCachedElementPortion(t,e,l,r,n,c,Ky,Jy),!d||!g)s.drawCachedElementPortion(t,e,u,r,n,c,Zy,Fs);if(d&&!g)s.drawCachedElementPortion(t,e,f,r,n,c,_y,Fs),s.drawCachedElementPortion(t,e,v,r,n,c,Qy,Fs);s.drawElementOverlay(t,e)}};tr.drawElements=function(t,e){var r=this;for(var a=0;a<e.length;a++){var n=e[a];r.drawElement(t,n)}};tr.drawCachedElements=function(t,e,r,a){var n=this;for(var i=0;i<e.length;i++){var s=e[i];n.drawCachedElement(t,s,r,a)}};tr.drawCachedNodes=function(t,e,r,a){var n=this;for(var i=0;i<e.length;i++){var s=e[i];if(!s.isNode())continue;n.drawCachedElement(t,s,r,a)}};tr.drawLayeredElements=function(t,e,r,a){var n=this,i=n.data.lyrTxrCache.getLayers(e,r);if(i)for(var s=0;s<i.length;s++){var o=i[s],l=o.bb;if(l.w===0||l.h===0)continue;t.drawImage(o.canvas,l.x1,l.y1,l.w,l.h)}else n.drawCachedElements(t,e,r,a)};var ur={};ur.drawEdge=function(t,e,r){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,n=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,s=this,o=e._private.rscratch;if(i&&!e.visible())return;if(o.badLine||o.allpts==null||isNaN(o.allpts[0]))return;var l;if(r)l=r,t.translate(-l.x1,-l.y1);var u=i?e.pstyle("opacity").value:1,f=i?e.pstyle("line-opacity").value:1,v=e.pstyle("curve-style").value,h=e.pstyle("line-style").value,c=e.pstyle("width").pfValue,d=e.pstyle("line-cap").value,g=e.pstyle("line-outline-width").value,y=e.pstyle("line-outline-color").value,p=u*f,m=u*f,b=function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:p;if(v==="straight-triangle")s.eleStrokeStyle(t,e,D),s.drawEdgeTrianglePath(e,t,o.allpts);else t.lineWidth=c,t.lineCap=d,s.eleStrokeStyle(t,e,D),s.drawEdgePath(e,t,o.allpts,h),t.lineCap="butt"},E=function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:p;if(t.lineWidth=c+g,t.lineCap=d,g>0)s.colorStrokeStyle(t,y[0],y[1],y[2],D);else{t.lineCap="butt";return}if(v==="straight-triangle")s.drawEdgeTrianglePath(e,t,o.allpts);else s.drawEdgePath(e,t,o.allpts,h),t.lineCap="butt"},A=function(){if(!n)return;s.drawEdgeOverlay(t,e)},M=function(){if(!n)return;s.drawEdgeUnderlay(t,e)},S=function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:m;s.drawArrowheads(t,e,D)},P=function(){s.drawElementText(t,e,null,a)};t.lineJoin="round";var N=e.pstyle("ghost").value==="yes";if(N){var R=e.pstyle("ghost-offset-x").pfValue,I=e.pstyle("ghost-offset-y").pfValue,w=e.pstyle("ghost-opacity").value,x=p*w;t.translate(R,I),b(x),S(x),t.translate(-R,-I)}else E();if(M(),b(),S(),A(),P(),r)t.translate(l.x1,l.y1)};var Wv=function(e){if(!["overlay","underlay"].includes(e))throw Error("Invalid state");return function(r,a){if(!a.visible())return;var n=a.pstyle("".concat(e,"-opacity")).value;if(n===0)return;var i=this,s=i.usePaths(),o=a._private.rscratch,l=a.pstyle("".concat(e,"-padding")).pfValue,u=2*l,f=a.pstyle("".concat(e,"-color")).value;if(r.lineWidth=u,o.edgeType==="self"&&!s)r.lineCap="butt";else r.lineCap="round";i.colorStrokeStyle(r,f[0],f[1],f[2],n),i.drawEdgePath(a,r,o.allpts,"solid")}};ur.drawEdgeOverlay=Wv("overlay");ur.drawEdgeUnderlay=Wv("underlay");ur.drawEdgePath=function(t,e,r,a){var n=t._private.rscratch,i=e,s,o=!1,l=this.usePaths(),u=t.pstyle("line-dash-pattern").pfValue,f=t.pstyle("line-dash-offset").pfValue;if(l){var v=r.join("$"),h=n.pathCacheKey&&n.pathCacheKey===v;if(h)s=e=n.pathCache,o=!0;else s=e=new Path2D,n.pathCacheKey=v,n.pathCache=s}if(i.setLineDash)switch(a){case"dotted":i.setLineDash([1,1]);break;case"dashed":i.setLineDash(u),i.lineDashOffset=f;break;case"solid":i.setLineDash([]);break}if(!o&&!n.badLine){if(e.beginPath)e.beginPath();switch(e.moveTo(r[0],r[1]),n.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var c=2;c+3<r.length;c+=4)e.quadraticCurveTo(r[c],r[c+1],r[c+2],r[c+3]);break;case"straight":case"haystack":for(var d=2;d+1<r.length;d+=2)e.lineTo(r[d],r[d+1]);break;case"segments":if(n.isRound){var g=kt(n.roundCorners),y;try{for(g.s();!(y=g.n()).done;){var p=y.value;Ov(e,p)}}catch(b){g.e(b)}finally{g.f()}e.lineTo(r[r.length-2],r[r.length-1])}else for(var m=2;m+1<r.length;m+=2)e.lineTo(r[m],r[m+1]);break}}if(e=i,l)e.stroke(s);else e.stroke();if(e.setLineDash)e.setLineDash([])};ur.drawEdgeTrianglePath=function(t,e,r){e.fillStyle=e.strokeStyle;var a=t.pstyle("width").pfValue;for(var n=0;n+1<r.length;n+=2){var i=[r[n+2]-r[n],r[n+3]-r[n+1]],s=Math.sqrt(i[0]*i[0]+i[1]*i[1]),o=[i[1]/s,-i[0]/s],l=[o[0]*a/2,o[1]*a/2];e.beginPath(),e.moveTo(r[n]-l[0],r[n+1]-l[1]),e.lineTo(r[n]+l[0],r[n+1]+l[1]),e.lineTo(r[n+2],r[n+3]),e.closePath(),e.fill()}};ur.drawArrowheads=function(t,e,r){var a=e._private.rscratch,n=a.edgeType==="haystack";if(!n)this.drawArrowhead(t,e,"source",a.arrowStartX,a.arrowStartY,a.srcArrowAngle,r);if(this.drawArrowhead(t,e,"mid-target",a.midX,a.midY,a.midtgtArrowAngle,r),this.drawArrowhead(t,e,"mid-source",a.midX,a.midY,a.midsrcArrowAngle,r),!n)this.drawArrowhead(t,e,"target",a.arrowEndX,a.arrowEndY,a.tgtArrowAngle,r)};ur.drawArrowhead=function(t,e,r,a,n,i,s){if(isNaN(a)||a==null||isNaN(n)||n==null||isNaN(i)||i==null)return;var o=this,l=e.pstyle(r+"-arrow-shape").value;if(l==="none")return;var u=e.pstyle(r+"-arrow-fill").value==="hollow"?"both":"filled",f=e.pstyle(r+"-arrow-fill").value,v=e.pstyle("width").pfValue,h=e.pstyle(r+"-arrow-width"),c=h.value==="match-line"?v:h.pfValue;if(h.units==="%")c*=v;var d=e.pstyle("opacity").value;if(s===void 0)s=d;var g=t.globalCompositeOperation;if(s!==1||f==="hollow")t.globalCompositeOperation="destination-out",o.colorFillStyle(t,255,255,255,1),o.colorStrokeStyle(t,255,255,255,1),o.drawArrowShape(e,t,u,v,l,c,a,n,i),t.globalCompositeOperation=g;var y=e.pstyle(r+"-arrow-color").value;o.colorFillStyle(t,y[0],y[1],y[2],s),o.colorStrokeStyle(t,y[0],y[1],y[2],s),o.drawArrowShape(e,t,f,v,l,c,a,n,i)};ur.drawArrowShape=function(t,e,r,a,n,i,s,o,l){var u=this,f=this.usePaths()&&n!=="triangle-cross",v=!1,h,c=e,d={x:s,y:o},g=t.pstyle("arrow-scale").value,y=this.getArrowWidth(a,g),p=u.arrowShapes[n];if(f){var m=u.arrowPathCache=u.arrowPathCache||[],b=Gr(n),E=m[b];if(E!=null)h=e=E,v=!0;else h=e=new Path2D,m[b]=h}if(!v){if(e.beginPath)e.beginPath();if(f)p.draw(e,1,0,{x:0,y:0},1);else p.draw(e,y,l,d,a);if(e.closePath)e.closePath()}if(e=c,f)e.translate(s,o),e.rotate(l),e.scale(y,y);if(r==="filled"||r==="both")if(f)e.fill(h);else e.fill();if(r==="hollow"||r==="both")if(e.lineWidth=i/(f?y:1),e.lineJoin="miter",f)e.stroke(h);else e.stroke();if(f)e.scale(1/y,1/y),e.rotate(-l),e.translate(-s,-o)};var Io={};Io.safeDrawImage=function(t,e,r,a,n,i,s,o,l,u){if(n<=0||i<=0||l<=0||u<=0)return;try{t.drawImage(e,r,a,n,i,s,o,l,u)}catch(f){_e(f)}};Io.drawInscribedImage=function(t,e,r,a,n){var i=this,s=r.position(),{x:o,y:l}=s,u=r.cy().style(),f=u.getIndexedStyle.bind(u),v=f(r,"background-fit","value",a),h=f(r,"background-repeat","value",a),c=r.width(),d=r.height(),g=r.padding()*2,y=c+(f(r,"background-width-relative-to","value",a)==="inner"?0:g),p=d+(f(r,"background-height-relative-to","value",a)==="inner"?0:g),m=r._private.rscratch,b=f(r,"background-clip","value",a),E=b==="node",A=f(r,"background-image-opacity","value",a)*n,M=f(r,"background-image-smoothing","value",a),S=r.pstyle("corner-radius").value;if(S!=="auto")S=r.pstyle("corner-radius").pfValue;var P=e.width||e.cachedW,N=e.height||e.cachedH;if(P==null||N==null)document.body.appendChild(e),P=e.cachedW=e.width||e.offsetWidth,N=e.cachedH=e.height||e.offsetHeight,document.body.removeChild(e);var R=P,I=N;if(f(r,"background-width","value",a)!=="auto")if(f(r,"background-width","units",a)==="%")R=f(r,"background-width","pfValue",a)*y;else R=f(r,"background-width","pfValue",a);if(f(r,"background-height","value",a)!=="auto")if(f(r,"background-height","units",a)==="%")I=f(r,"background-height","pfValue",a)*p;else I=f(r,"background-height","pfValue",a);if(R===0||I===0)return;if(v==="contain"){var w=Math.min(y/R,p/I);R*=w,I*=w}else if(v==="cover"){var w=Math.max(y/R,p/I);R*=w,I*=w}var x=o-y/2,T=f(r,"background-position-x","units",a),D=f(r,"background-position-x","pfValue",a);if(T==="%")x+=(y-R)*D;else x+=D;var C=f(r,"background-offset-x","units",a),O=f(r,"background-offset-x","pfValue",a);if(C==="%")x+=(y-R)*O;else x+=O;var B=l-p/2,z=f(r,"background-position-y","units",a),V=f(r,"background-position-y","pfValue",a);if(z==="%")B+=(p-I)*V;else B+=V;var k=f(r,"background-offset-y","units",a),G=f(r,"background-offset-y","pfValue",a);if(k==="%")B+=(p-I)*G;else B+=G;if(m.pathCache)x-=o,B-=l,o=0,l=0;var J=t.globalAlpha;t.globalAlpha=A;var X=i.getImgSmoothing(t),_=!1;if(M==="no"&&X)i.setImgSmoothing(t,!1),_=!0;else if(M==="yes"&&!X)i.setImgSmoothing(t,!0),_=!0;if(h==="no-repeat"){if(E)if(t.save(),m.pathCache)t.clip(m.pathCache);else i.nodeShapes[i.getNodeShape(r)].draw(t,o,l,y,p,S,m),t.clip();if(i.safeDrawImage(t,e,0,0,P,N,x,B,R,I),E)t.restore()}else{var Q=t.createPattern(e,h);t.fillStyle=Q,i.nodeShapes[i.getNodeShape(r)].draw(t,o,l,y,p,S,m),t.translate(x,B),t.fill(),t.translate(-x,-B)}if(t.globalAlpha=J,_)i.setImgSmoothing(t,X)};var Wr={};Wr.eleTextBiggerThanMin=function(t,e){if(!e){var r=t.cy().zoom(),a=this.getPixelRatio(),n=Math.ceil(mo(r*a));e=Math.pow(2,n)}var i=t.pstyle("font-size").pfValue*e,s=t.pstyle("min-zoomed-font-size").pfValue;if(i<s)return!1;return!0};Wr.drawElementText=function(t,e,r,a,n){var i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,s=this;if(a==null){if(i&&!s.eleTextBiggerThanMin(e))return}else if(a===!1)return;if(e.isNode()){var o=e.pstyle("label");if(!o||!o.value)return;var l=s.getLabelJustification(e),u=e.pstyle("text-metrics").strValue==="glyph";t.textAlign=l,t.textBaseline=u?"alphabetic":"bottom"}else{var f=e.element()._private.rscratch.badLine,v=e.pstyle("label"),h=e.pstyle("source-label"),c=e.pstyle("target-label");if(f||(!v||!v.value)&&(!h||!h.value)&&(!c||!c.value))return;t.textAlign="center",t.textBaseline="bottom"}var d=!r,g;if(r)g=r,t.translate(-g.x1,-g.y1);if(n==null){if(s.drawText(t,e,null,d,i),e.isEdge())s.drawText(t,e,"source",d,i),s.drawText(t,e,"target",d,i)}else s.drawText(t,e,n,d,i);if(r)t.translate(g.x1,g.y1)};Wr.getFontCache=function(t){var e;this.fontCaches=this.fontCaches||[];for(var r=0;r<this.fontCaches.length;r++)if(e=this.fontCaches[r],e.context===t)return e;return e={context:t},this.fontCaches.push(e),e};Wr.setupTextStyle=function(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,a=e.pstyle("font-style").strValue,n=e.pstyle("font-size").pfValue+"px",i=e.pstyle("font-family").strValue,s=e.pstyle("font-weight").strValue,o=r?e.effectiveOpacity()*e.pstyle("text-opacity").value:1,l=e.pstyle("text-outline-opacity").value*o,u=e.pstyle("color").value,f=e.pstyle("text-outline-color").value;t.font=a+" "+s+" "+n+" "+i,t.lineJoin="round",this.colorFillStyle(t,u[0],u[1],u[2],o),this.colorStrokeStyle(t,f[0],f[1],f[2],l)};function jy(t,e,r,a,n){var i=Math.min(a,n),s=i/2,o=e+a/2,l=r+n/2;t.beginPath(),t.arc(o,l,s,0,Math.PI*2),t.closePath()}function af(t,e,r,a,n){var i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:5,s=Math.min(i,a/2,n/2);t.beginPath(),t.moveTo(e+s,r),t.lineTo(e+a-s,r),t.quadraticCurveTo(e+a,r,e+a,r+s),t.lineTo(e+a,r+n-s),t.quadraticCurveTo(e+a,r+n,e+a-s,r+n),t.lineTo(e+s,r+n),t.quadraticCurveTo(e,r+n,e,r+n-s),t.lineTo(e,r+s),t.quadraticCurveTo(e,r,e+s,r),t.closePath()}Wr.getTextAngle=function(t,e){var r,a=t._private,n=a.rscratch,i=e?e+"-":"",s=t.pstyle(i+"text-rotation");if(s.strValue==="autorotate"){var o=Nt(n,"labelAngle",e);r=t.isEdge()?o:0}else if(s.strValue==="none")r=0;else r=s.pfValue;return r};Wr.drawText=function(t,e,r){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,n=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=e._private,s=i.rscratch,o=n?e.effectiveOpacity():1;if(n&&(o===0||e.pstyle("text-opacity").value===0))return;if(r==="main")r=null;var l=Nt(s,"labelX",r),u=Nt(s,"labelY",r),f,v,h=this.getLabelText(e,r);if(h!=null&&h!==""&&!isNaN(l)&&!isNaN(u)){this.setupTextStyle(t,e,n);var c=r?r+"-":"",d=Nt(s,"labelWidth",r),g=Nt(s,"labelHeight",r),y=Nt(s,"labelActualDescent",r),p=e.pstyle(c+"text-margin-x").pfValue,m=e.pstyle(c+"text-margin-y").pfValue,b=e.isEdge(),E=e.pstyle("text-halign").value,A=e.pstyle("text-valign").value;if(b)E="center",A="center";l+=p,u+=m;var M;if(!a)M=0;else M=this.getTextAngle(e,r);if(M!==0)f=l,v=u,t.translate(f,v),t.rotate(M),l=0,u=0;var S=ha(E),P=ca(A);switch(P){case"top":break;case"center":u+=g/2;break;case"bottom":u+=g;break}var N=e.pstyle("text-background-opacity").value,R=e.pstyle("text-border-opacity").value,I=e.pstyle("text-border-width").pfValue,w=e.pstyle("text-background-padding").pfValue,x=e.pstyle("text-background-shape").strValue,T=x==="round-rectangle"||x==="roundrectangle",D=x==="circle",C=2;if(N>0||I>0&&R>0){var{fillStyle:O,strokeStyle:B,lineWidth:z}=t,V=e.pstyle("text-background-color").value,k=e.pstyle("text-border-color").value,G=e.pstyle("text-border-style").value,J=N>0,X=I>0&&R>0,_=l-w;switch(S){case"left":_-=d;break;case"center":_-=d/2;break}var Q=u-g-w,q=d+2*w,te=g+2*w;if(J)t.fillStyle="rgba(".concat(V[0],",").concat(V[1],",").concat(V[2],",").concat(N*o,")");if(X){if(t.strokeStyle="rgba(".concat(k[0],",").concat(k[1],",").concat(k[2],",").concat(R*o,")"),t.lineWidth=I,t.setLineDash)switch(G){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"double":t.lineWidth=I/4,t.setLineDash([]);break;case"solid":default:t.setLineDash([]);break}}if(T)t.beginPath(),af(t,_,Q,q,te,C);else if(D)t.beginPath(),jy(t,_,Q,q,te);else t.beginPath(),t.rect(_,Q,q,te);if(J)t.fill();if(X)t.stroke();if(X&&G==="double"){var Z=I/2;if(t.beginPath(),T)af(t,_+Z,Q+Z,q-2*Z,te-2*Z,C);else t.rect(_+Z,Q+Z,q-2*Z,te-2*Z);t.stroke()}if(t.fillStyle=O,t.strokeStyle=B,t.lineWidth=z,t.setLineDash)t.setLineDash([])}var U=2*e.pstyle("text-outline-width").pfValue;if(U>0)t.lineWidth=U;if(u-=y,e.pstyle("text-wrap").value==="wrap"){var W=Nt(s,"labelWrapCachedLines",r),j=Nt(s,"labelLineHeight",r),re=d/2,ee=this.getLabelJustification(e);if(ee==="auto");else if(S==="left"){if(ee==="left")l+=-d;else if(ee==="center")l+=-re}else if(S==="center"){if(ee==="left")l+=-re;else if(ee==="right")l+=re}else if(S==="right"){if(ee==="center")l+=re;else if(ee==="right")l+=d}switch(P){case"top":u-=(W.length-1)*j;break;case"center":case"bottom":u-=(W.length-1)*j;break}for(var de=0;de<W.length;de++){if(U>0)t.strokeText(W[de],l,u);t.fillText(W[de],l,u),u+=j}}else{if(U>0)t.strokeText(h,l,u);t.fillText(h,l,u)}if(M!==0)t.rotate(-M),t.translate(-f,-v)}};var Pr={};Pr.drawNode=function(t,e,r){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,n=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,s=this,o,l,u=e._private,f=u.rscratch,v=e.position();if(!he(v.x)||!he(v.y))return;if(i&&!e.visible())return;var h=i?e.effectiveOpacity():1,c=s.usePaths(),d,g=!1,y=e.padding();o=e.width()+2*y,l=e.height()+2*y;var p;if(r)p=r,t.translate(-p.x1,-p.y1);var m=e.pstyle("background-image"),b=m.value,E=Array(b.length),A=Array(b.length),M=0;for(var S=0;S<b.length;S++){var P=b[S],N=E[S]=P!=null&&P!=="none";if(N){var R=e.cy().style().getIndexedStyle(e,"background-image-crossorigin","value",S);M++,A[S]=s.getCachedImage(P,R,function(){u.backgroundTimestamp=Date.now(),e.emitAndNotify("background")})}}var I=e.pstyle("background-blacken").value,w=e.pstyle("border-width").pfValue,x=e.pstyle("background-opacity").value*h,T=e.pstyle("border-color").value,D=e.pstyle("border-style").value,C=e.pstyle("border-join").value,O=e.pstyle("border-cap").value,B=e.pstyle("border-position").value,z=e.pstyle("border-dash-pattern").pfValue,V=e.pstyle("border-dash-offset").pfValue,k=e.pstyle("border-opacity").value*h,G=e.pstyle("outline-width").pfValue,J=e.pstyle("outline-color").value,X=e.pstyle("outline-style").value,_=e.pstyle("outline-opacity").value*h,Q=e.pstyle("outline-offset").value,q=e.pstyle("corner-radius").value;if(q!=="auto")q=e.pstyle("corner-radius").pfValue;var te=function(){var F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:x;s.eleFillStyle(t,e,F)},Z=function(){var F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:k;s.colorStrokeStyle(t,T[0],T[1],T[2],F)},U=function(){var F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:_;s.colorStrokeStyle(t,J[0],J[1],J[2],F)},W=function(F,Y,H,K){var se=s.nodePathCache=s.nodePathCache||[],ae=Lf(H==="polygon"?H+","+K.join(","):H,""+Y,""+F,""+q),oe=se[ae],ne,ue=!1;if(oe!=null)ne=oe,ue=!0,f.pathCache=ne;else ne=new Path2D,se[ae]=f.pathCache=ne;return{path:ne,cacheHit:ue}},j=e.pstyle("shape").strValue,re=e.pstyle("shape-polygon-points").pfValue;if(c){t.translate(v.x,v.y);var ee=W(o,l,j,re);d=ee.path,g=ee.cacheHit}var de=function(){if(!g){var F=v;if(c)F={x:0,y:0};s.nodeShapes[s.getNodeShape(e)].draw(d||t,F.x,F.y,o,l,q,f)}if(c)t.fill(d);else t.fill()},Ae=function(){var F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:h,Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,H=u.backgrounding,K=0;for(var se=0;se<A.length;se++){var ae=e.cy().style().getIndexedStyle(e,"background-image-containment","value",se);if(Y&&ae==="over"||!Y&&ae==="inside"){K++;continue}if(E[se]&&A[se].complete&&!A[se].error)K++,s.drawInscribedImage(t,A[se],e,se,F)}if(u.backgrounding=K!==M,H!==u.backgrounding)e.updateStyle(!1)},Ce=function(){var F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:h;if(s.hasPie(e)){if(s.drawPie(t,e,Y),F){if(!c)s.nodeShapes[s.getNodeShape(e)].draw(t,v.x,v.y,o,l,q,f)}}},Se=function(){var F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:h;if(s.hasStripe(e)){if(t.save(),c)t.clip(f.pathCache);else s.nodeShapes[s.getNodeShape(e)].draw(t,v.x,v.y,o,l,q,f),t.clip();if(s.drawStripe(t,e,Y),t.restore(),F){if(!c)s.nodeShapes[s.getNodeShape(e)].draw(t,v.x,v.y,o,l,q,f)}}},ge=function(){var F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:h,Y=(I>0?I:-I)*F,H=I>0?0:255;if(I!==0)if(s.colorFillStyle(t,H,H,H,Y),c)t.fill(d);else t.fill()},ve=function(){if(w>0){if(t.lineWidth=w,t.lineCap=O,t.lineJoin=C,t.setLineDash)switch(D){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash(z),t.lineDashOffset=V;break;case"solid":case"double":t.setLineDash([]);break}if(B!=="center"){if(t.save(),t.lineWidth*=2,B==="inside")c?t.clip(d):t.clip();else{var F=new Path2D;F.rect(-o/2-w,-l/2-w,o+2*w,l+2*w),F.addPath(d),t.clip(F,"evenodd")}c?t.stroke(d):t.stroke(),t.restore()}else c?t.stroke(d):t.stroke();if(D==="double"){t.lineWidth=w/3;var Y=t.globalCompositeOperation;if(t.globalCompositeOperation="destination-out",c)t.stroke(d);else t.stroke();t.globalCompositeOperation=Y}if(t.setLineDash)t.setLineDash([])}},ye=function(){if(G>0){if(t.lineWidth=G,t.lineCap="butt",t.setLineDash)switch(X){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"solid":case"double":t.setLineDash([]);break}var F=v;if(c)F={x:0,y:0};var Y=s.getNodeShape(e),H=w;if(B==="inside")H=0;if(B==="outside")H*=2;var K=(o+H+(G+Q))/o,se=(l+H+(G+Q))/l,ae=o*K,oe=l*se,ne=s.nodeShapes[Y].points,ue;if(c){var be=W(ae,oe,Y,ne);ue=be.path}if(Y==="ellipse")s.drawEllipsePath(ue||t,F.x,F.y,ae,oe);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(Y)){var fe=0,le=0,De=0;if(Y==="round-diamond")fe=(H+Q+G)*1.4;else if(Y==="round-heptagon")fe=(H+Q+G)*1.075,De=-(H/2+Q+G)/35;else if(Y==="round-hexagon")fe=(H+Q+G)*1.12;else if(Y==="round-pentagon")fe=(H+Q+G)*1.13,De=-(H/2+Q+G)/15;else if(Y==="round-tag")fe=(H+Q+G)*1.12,le=(H/2+G+Q)*0.07;else if(Y==="round-triangle")fe=(H+Q+G)*(Math.PI/2),De=-(H+Q/2+G)/Math.PI;if(fe!==0){if(K=(o+fe)/o,ae=o*K,!["round-hexagon","round-tag"].includes(Y))se=(l+fe)/l,oe=l*se}q=q==="auto"?Gf(ae,oe):q;var ce=ae/2,pe=oe/2,Ie=q+(H+G+Q)/2,xe=Array(ne.length/2),me=Array(ne.length/2);for(var Ve=0;Ve<ne.length/2;Ve++)xe[Ve]={x:F.x+le+ce*ne[Ve*2],y:F.y+De+pe*ne[Ve*2+1]};var Be,Ke,He,Le,nt=xe.length;Ke=xe[nt-1];for(Be=0;Be<nt;Be++)He=xe[Be%nt],Le=xe[(Be+1)%nt],me[Be]=No(Ke,He,Le,Ie),Ke=He,He=Le;s.drawRoundPolygonPath(ue||t,F.x+le,F.y+De,o*K,l*se,ne,me)}else if(["roundrectangle","round-rectangle"].includes(Y))q=q==="auto"?Cr(ae,oe):q,s.drawRoundRectanglePath(ue||t,F.x,F.y,ae,oe,q+(H+G+Q)/2);else if(["cutrectangle","cut-rectangle"].includes(Y))q=q==="auto"?Eo():q,s.drawCutRectanglePath(ue||t,F.x,F.y,ae,oe,null,q+(H+G+Q)/4);else if(["bottomroundrectangle","bottom-round-rectangle"].includes(Y))q=q==="auto"?Cr(ae,oe):q,s.drawBottomRoundRectanglePath(ue||t,F.x,F.y,ae,oe,q+(H+G+Q)/2);else if(Y==="barrel")s.drawBarrelPath(ue||t,F.x,F.y,ae,oe);else if(Y.startsWith("polygon")||["rhomboid","right-rhomboid","round-tag","tag","vee"].includes(Y)){var Ye=(H+G+Q)/o;ne=Vn(Gn(ne,Ye)),s.drawPolygonPath(ue||t,F.x,F.y,o,l,ne)}else{var tt=(H+G+Q)/o;ne=Vn(Gn(ne,-tt)),s.drawPolygonPath(ue||t,F.x,F.y,o,l,ne)}if(c)t.stroke(ue);else t.stroke();if(X==="double"){t.lineWidth=H/3;var dt=t.globalCompositeOperation;if(t.globalCompositeOperation="destination-out",c)t.stroke(ue);else t.stroke();t.globalCompositeOperation=dt}if(t.setLineDash)t.setLineDash([])}},Ee=function(){if(n)s.drawNodeOverlay(t,e,v,o,l)},Pe=function(){if(n)s.drawNodeUnderlay(t,e,v,o,l)},Me=function(){s.drawElementText(t,e,null,a)},Ne=e.pstyle("ghost").value==="yes";if(Ne){var Fe=e.pstyle("ghost-offset-x").pfValue,ze=e.pstyle("ghost-offset-y").pfValue,Ue=e.pstyle("ghost-opacity").value,ie=Ue*h;t.translate(Fe,ze),U(),ye(),te(Ue*x),de(),Ae(ie,!0),Z(Ue*k),ve(),Ce(I!==0||w!==0),Se(I!==0||w!==0),Ae(ie,!1),ge(ie),t.translate(-Fe,-ze)}if(c)t.translate(-v.x,-v.y);if(Pe(),c)t.translate(v.x,v.y);if(U(),ye(),te(),de(),Ae(h,!0),Z(),ve(),Ce(I!==0||w!==0),Se(I!==0||w!==0),Ae(h,!1),ge(),c)t.translate(-v.x,-v.y);if(Me(),Ee(),r)t.translate(p.x1,p.y1)};var $v=function(e){if(!["overlay","underlay"].includes(e))throw Error("Invalid state");return function(r,a,n,i,s){var o=this;if(!a.visible())return;var l=a.pstyle("".concat(e,"-padding")).pfValue,u=a.pstyle("".concat(e,"-opacity")).value,f=a.pstyle("".concat(e,"-color")).value,v=a.pstyle("".concat(e,"-shape")).value,h=a.pstyle("".concat(e,"-corner-radius")).value;if(u>0){if(n=n||a.position(),i==null||s==null){var c=a.padding();i=a.width()+2*c,s=a.height()+2*c}o.colorFillStyle(r,f[0],f[1],f[2],u),o.nodeShapes[v].draw(r,n.x,n.y,i+l*2,s+l*2,h),r.fill()}}};Pr.drawNodeOverlay=$v("overlay");Pr.drawNodeUnderlay=$v("underlay");Pr.hasPie=function(t){return t=t[0],t._private.hasPie};Pr.hasStripe=function(t){return t=t[0],t._private.hasStripe};Pr.drawPie=function(t,e,r,a){e=e[0],a=a||e.position();var n=e.cy().style(),i=e.pstyle("pie-size"),s=e.pstyle("pie-hole"),o=e.pstyle("pie-start-angle").pfValue,l=a.x,u=a.y,f=e.width(),v=e.height(),h=Math.min(f,v)/2,c,d=0,g=this.usePaths();if(g)l=0,u=0;if(i.units==="%")h=h*i.pfValue;else if(i.pfValue!==void 0)h=i.pfValue/2;if(s.units==="%")c=h*s.pfValue;else if(s.pfValue!==void 0)c=s.pfValue/2;if(c>=h)return;for(var y=1;y<=n.pieBackgroundN;y++){var p=e.pstyle("pie-"+y+"-background-size").value,m=e.pstyle("pie-"+y+"-background-color").value,b=e.pstyle("pie-"+y+"-background-opacity").value*r,E=p/100;if(E+d>1)E=1-d;var A=1.5*Math.PI+2*Math.PI*d;A+=o;var M=2*Math.PI*E,S=A+M;if(p===0||d>=1||d+E>1)continue;if(c===0)t.beginPath(),t.moveTo(l,u),t.arc(l,u,h,A,S),t.closePath();else t.beginPath(),t.arc(l,u,h,A,S),t.arc(l,u,c,S,A,!0),t.closePath();this.colorFillStyle(t,m[0],m[1],m[2],b),t.fill(),d+=E}};Pr.drawStripe=function(t,e,r,a){e=e[0],a=a||e.position();var n=e.cy().style(),i=a.x,s=a.y,o=e.width(),l=e.height(),u=0,f=this.usePaths();t.save();var v=e.pstyle("stripe-direction").value,h=e.pstyle("stripe-size");switch(v){case"vertical":break;case"righward":t.rotate(-Math.PI/2);break}var c=o,d=l;if(h.units==="%")c=c*h.pfValue,d=d*h.pfValue;else if(h.pfValue!==void 0)c=h.pfValue,d=h.pfValue;if(f)i=0,s=0;s-=c/2,i-=d/2;for(var g=1;g<=n.stripeBackgroundN;g++){var y=e.pstyle("stripe-"+g+"-background-size").value,p=e.pstyle("stripe-"+g+"-background-color").value,m=e.pstyle("stripe-"+g+"-background-opacity").value*r,b=y/100;if(b+u>1)b=1-u;if(y===0||u>=1||u+b>1)continue;t.beginPath(),t.rect(i,s+d*u,c,d*b),t.closePath(),this.colorFillStyle(t,p[0],p[1],p[2],m),t.fill(),u+=b}t.restore()};var It={},em=100;It.getPixelRatio=function(){var t=this.data.contexts[0];if(this.forcedPixelRatio!=null)return this.forcedPixelRatio;var e=this.cy.window(),r=t.backingStorePixelRatio||t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return(e.devicePixelRatio||1)/r};It.paintCache=function(t){var e=this.paintCaches=this.paintCaches||[],r=!0,a;for(var n=0;n<e.length;n++)if(a=e[n],a.context===t){r=!1;break}if(r)a={context:t},e.push(a);return a};It.createGradientStyleFor=function(t,e,r,a,n){var i,s=this.usePaths(),o=r.pstyle(e+"-gradient-stop-colors").value,l=r.pstyle(e+"-gradient-stop-positions").pfValue;if(a==="radial-gradient")if(r.isEdge()){var u=r.sourceEndpoint(),f=r.targetEndpoint(),v=r.midpoint(),h=Ur(u,v),c=Ur(f,v);i=t.createRadialGradient(v.x,v.y,0,v.x,v.y,Math.max(h,c))}else{var d=s?{x:0,y:0}:r.position(),g=r.paddedWidth(),y=r.paddedHeight();i=t.createRadialGradient(d.x,d.y,0,d.x,d.y,Math.max(g,y))}else if(r.isEdge()){var p=r.sourceEndpoint(),m=r.targetEndpoint();i=t.createLinearGradient(p.x,p.y,m.x,m.y)}else{var b=s?{x:0,y:0}:r.position(),E=r.paddedWidth(),A=r.paddedHeight(),M=E/2,S=A/2,P=r.pstyle("background-gradient-direction").value;switch(P){case"to-bottom":i=t.createLinearGradient(b.x,b.y-S,b.x,b.y+S);break;case"to-top":i=t.createLinearGradient(b.x,b.y+S,b.x,b.y-S);break;case"to-left":i=t.createLinearGradient(b.x+M,b.y,b.x-M,b.y);break;case"to-right":i=t.createLinearGradient(b.x-M,b.y,b.x+M,b.y);break;case"to-bottom-right":case"to-right-bottom":i=t.createLinearGradient(b.x-M,b.y-S,b.x+M,b.y+S);break;case"to-top-right":case"to-right-top":i=t.createLinearGradient(b.x-M,b.y+S,b.x+M,b.y-S);break;case"to-bottom-left":case"to-left-bottom":i=t.createLinearGradient(b.x+M,b.y-S,b.x-M,b.y+S);break;case"to-top-left":case"to-left-top":i=t.createLinearGradient(b.x+M,b.y+S,b.x-M,b.y-S);break}}if(!i)return null;var N=l.length===o.length,R=o.length;for(var I=0;I<R;I++)i.addColorStop(N?l[I]:I/(R-1),"rgba("+o[I][0]+","+o[I][1]+","+o[I][2]+","+n+")");return i};It.gradientFillStyle=function(t,e,r,a){var n=this.createGradientStyleFor(t,"background",e,r,a);if(!n)return null;t.fillStyle=n};It.colorFillStyle=function(t,e,r,a,n){t.fillStyle="rgba("+e+","+r+","+a+","+n+")"};It.eleFillStyle=function(t,e,r){var a=e.pstyle("background-fill").value;if(a==="linear-gradient"||a==="radial-gradient")this.gradientFillStyle(t,e,a,r);else{var n=e.pstyle("background-color").value;this.colorFillStyle(t,n[0],n[1],n[2],r)}};It.gradientStrokeStyle=function(t,e,r,a){var n=this.createGradientStyleFor(t,"line",e,r,a);if(!n)return null;t.strokeStyle=n};It.colorStrokeStyle=function(t,e,r,a,n){t.strokeStyle="rgba("+e+","+r+","+a+","+n+")"};It.eleStrokeStyle=function(t,e,r){var a=e.pstyle("line-fill").value;if(a==="linear-gradient"||a==="radial-gradient")this.gradientStrokeStyle(t,e,a,r);else{var n=e.pstyle("line-color").value;this.colorStrokeStyle(t,n[0],n[1],n[2],r)}};It.matchCanvasSize=function(t){var e=this,r=e.data,a=e.findContainerClientCoords(),n=a[2],i=a[3],s=e.getPixelRatio(),o=e.motionBlurPxRatio;if(t===e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE]||t===e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG])s=o;var l=n*s,u=i*s,f;if(l===e.canvasWidth&&u===e.canvasHeight)return;e.fontCaches=null;var v=r.canvasContainer;v.style.width=n+"px",v.style.height=i+"px";for(var h=0;h<e.CANVAS_LAYERS;h++)f=r.canvases[h],f.width=l,f.height=u,f.style.width=n+"px",f.style.height=i+"px";for(var h=0;h<e.BUFFER_COUNT;h++)f=r.bufferCanvases[h],f.width=l,f.height=u,f.style.width=n+"px",f.style.height=i+"px";if(e.textureMult=1,s<=1)f=r.bufferCanvases[e.TEXTURE_BUFFER],e.textureMult=2,f.width=l*e.textureMult,f.height=u*e.textureMult;e.canvasWidth=l,e.canvasHeight=u,e.pixelRatio=s};It.renderTo=function(t,e,r,a){this.render({forcedContext:t,forcedZoom:e,forcedPan:r,drawAllLayers:!0,forcedPxRatio:a})};It.clearCanvas=function(){var t=this,e=t.data;function r(a){a.clearRect(0,0,t.canvasWidth,t.canvasHeight)}r(e.contexts[t.NODE]),r(e.contexts[t.DRAG])};It.render=function(t){var e=this;t=t||Of();var r=e.cy,a=t.forcedContext,n=t.drawAllLayers,i=t.drawOnlyNodeLayer,s=t.forcedZoom,o=t.forcedPan,l=t.forcedPxRatio===void 0?this.getPixelRatio():t.forcedPxRatio,u=e.data,f=u.canvasNeedsRedraw,v=e.textureOnViewport&&!a&&(e.pinching||e.hoverData.dragging||e.swipePanning||e.data.wheelZooming),h=t.motionBlur!==void 0?t.motionBlur:e.motionBlur,c=e.motionBlurPxRatio,d=r.hasCompoundNodes(),g=e.hoverData.draggingEles,y=e.hoverData.selecting||e.touchData.selecting?!0:!1;h=h&&!a&&e.motionBlurEnabled&&!y;var p=h;if(!a){if(e.prevPxRatio!==l)e.invalidateContainerClientCoordsCache(),e.matchCanvasSize(e.container),e.redrawHint("eles",!0),e.redrawHint("drag",!0);e.prevPxRatio=l}if(!a&&e.motionBlurTimeout)clearTimeout(e.motionBlurTimeout);if(h){if(e.mbFrames==null)e.mbFrames=0;if(e.mbFrames++,e.mbFrames<3)p=!1;if(e.mbFrames>e.minMbLowQualFrames)e.motionBlurPxRatio=e.mbPxRBlurry}if(e.clearingMotionBlur)e.motionBlurPxRatio=1;if(e.textureDrawLastFrame&&!v)f[e.NODE]=!0,f[e.SELECT_BOX]=!0;var m=r.style(),b=r.zoom(),E=s!==void 0?s:b,A=r.pan(),M={x:A.x,y:A.y},S={zoom:b,pan:{x:A.x,y:A.y}},P=e.prevViewport,N=P===void 0||S.zoom!==P.zoom||S.pan.x!==P.pan.x||S.pan.y!==P.pan.y;if(!N&&!(g&&!d))e.motionBlurPxRatio=1;if(o)M=o;E*=l,M.x*=l,M.y*=l;var R=e.getCachedZSortedEles();function I(Z,U,W,j,re){var ee=Z.globalCompositeOperation;Z.globalCompositeOperation="destination-out",e.colorFillStyle(Z,255,255,255,e.motionBlurTransparency),Z.fillRect(U,W,j,re),Z.globalCompositeOperation=ee}function w(Z,U){var W,j,re,ee;if(!e.clearingMotionBlur&&(Z===u.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]||Z===u.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG]))W={x:A.x*c,y:A.y*c},j=b*c,re=e.canvasWidth*c,ee=e.canvasHeight*c;else W=M,j=E,re=e.canvasWidth,ee=e.canvasHeight;if(Z.setTransform(1,0,0,1,0,0),U==="motionBlur")I(Z,0,0,re,ee);else if(!a&&(U===void 0||U))Z.clearRect(0,0,re,ee);if(!n)Z.translate(W.x,W.y),Z.scale(j,j);if(o)Z.translate(o.x,o.y);if(s)Z.scale(s,s)}if(!v)e.textureDrawLastFrame=!1;if(v){if(e.textureDrawLastFrame=!0,!e.textureCache){e.textureCache={},e.textureCache.bb=r.mutableElements().boundingBox(),e.textureCache.texture=e.data.bufferCanvases[e.TEXTURE_BUFFER];var x=e.data.bufferContexts[e.TEXTURE_BUFFER];x.setTransform(1,0,0,1,0,0),x.clearRect(0,0,e.canvasWidth*e.textureMult,e.canvasHeight*e.textureMult),e.render({forcedContext:x,drawOnlyNodeLayer:!0,forcedPxRatio:l*e.textureMult});var S=e.textureCache.viewport={zoom:r.zoom(),pan:r.pan(),width:e.canvasWidth,height:e.canvasHeight};S.mpan={x:(0-S.pan.x)/S.zoom,y:(0-S.pan.y)/S.zoom}}f[e.DRAG]=!1,f[e.NODE]=!1;var T=u.contexts[e.NODE],D=e.textureCache.texture,S=e.textureCache.viewport;if(T.setTransform(1,0,0,1,0,0),h)I(T,0,0,S.width,S.height);else T.clearRect(0,0,S.width,S.height);var C=m.core("outside-texture-bg-color").value,O=m.core("outside-texture-bg-opacity").value;e.colorFillStyle(T,C[0],C[1],C[2],O),T.fillRect(0,0,S.width,S.height);var b=r.zoom();w(T,!1),T.clearRect(S.mpan.x,S.mpan.y,S.width/S.zoom/l,S.height/S.zoom/l),T.drawImage(D,S.mpan.x,S.mpan.y,S.width/S.zoom/l,S.height/S.zoom/l)}else if(e.textureOnViewport&&!a)e.textureCache=null;var B=r.extent(),z=e.pinching||e.hoverData.dragging||e.swipePanning||e.data.wheelZooming||e.hoverData.draggingEles||e.cy.animated(),V=e.hideEdgesOnViewport&&z,k=[];if(k[e.NODE]=!f[e.NODE]&&h&&!e.clearedForMotionBlur[e.NODE]||e.clearingMotionBlur,k[e.NODE])e.clearedForMotionBlur[e.NODE]=!0;if(k[e.DRAG]=!f[e.DRAG]&&h&&!e.clearedForMotionBlur[e.DRAG]||e.clearingMotionBlur,k[e.DRAG])e.clearedForMotionBlur[e.DRAG]=!0;if(f[e.NODE]||n||i||k[e.NODE]){var G=h&&!k[e.NODE]&&c!==1,T=a||(G?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]:u.contexts[e.NODE]),J=h&&!G?"motionBlur":void 0;if(w(T,J),V)e.drawCachedNodes(T,R.nondrag,l,B);else e.drawLayeredElements(T,R.nondrag,l,B);if(e.debug)e.drawDebugPoints(T,R.nondrag);if(!n&&!h)f[e.NODE]=!1}if(!i&&(f[e.DRAG]||n||k[e.DRAG])){var G=h&&!k[e.DRAG]&&c!==1,T=a||(G?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG]:u.contexts[e.DRAG]);if(w(T,h&&!G?"motionBlur":void 0),V)e.drawCachedNodes(T,R.drag,l,B);else e.drawCachedElements(T,R.drag,l,B);if(e.debug)e.drawDebugPoints(T,R.drag);if(!n&&!h)f[e.DRAG]=!1}if(this.drawSelectionRectangle(t,w),h&&c!==1){var X=u.contexts[e.NODE],_=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE],Q=u.contexts[e.DRAG],q=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG],te=function(U,W,j){if(U.setTransform(1,0,0,1,0,0),j||!p)U.clearRect(0,0,e.canvasWidth,e.canvasHeight);else I(U,0,0,e.canvasWidth,e.canvasHeight);var re=c;U.drawImage(W,0,0,e.canvasWidth*re,e.canvasHeight*re,0,0,e.canvasWidth,e.canvasHeight)};if(f[e.NODE]||k[e.NODE])te(X,_,k[e.NODE]),f[e.NODE]=!1;if(f[e.DRAG]||k[e.DRAG])te(Q,q,k[e.DRAG]),f[e.DRAG]=!1}if(e.prevViewport=S,e.clearingMotionBlur)e.clearingMotionBlur=!1,e.motionBlurCleared=!0,e.motionBlur=!0;if(h)e.motionBlurTimeout=setTimeout(function(){e.motionBlurTimeout=null,e.clearedForMotionBlur[e.NODE]=!1,e.clearedForMotionBlur[e.DRAG]=!1,e.motionBlur=!1,e.clearingMotionBlur=!v,e.mbFrames=0,f[e.NODE]=!0,f[e.DRAG]=!0,e.redraw()},em);if(!a)r.emit("render")};var La;It.drawSelectionRectangle=function(t,e){var r=this,{cy:a,data:n}=r,i=a.style(),{drawOnlyNodeLayer:s,drawAllLayers:o}=t,l=n.canvasNeedsRedraw,u=t.forcedContext;if(r.showFps||!s&&l[r.SELECT_BOX]&&!o){var f=u||n.contexts[r.SELECT_BOX];if(e(f),r.selection[4]==1&&(r.hoverData.selecting||r.touchData.selecting)){var v=r.cy.zoom(),h=i.core("selection-box-border-width").value/v;if(f.lineWidth=h,f.fillStyle="rgba("+i.core("selection-box-color").value[0]+","+i.core("selection-box-color").value[1]+","+i.core("selection-box-color").value[2]+","+i.core("selection-box-opacity").value+")",f.fillRect(r.selection[0],r.selection[1],r.selection[2]-r.selection[0],r.selection[3]-r.selection[1]),h>0)f.strokeStyle="rgba("+i.core("selection-box-border-color").value[0]+","+i.core("selection-box-border-color").value[1]+","+i.core("selection-box-border-color").value[2]+","+i.core("selection-box-opacity").value+")",f.strokeRect(r.selection[0],r.selection[1],r.selection[2]-r.selection[0],r.selection[3]-r.selection[1])}if(n.bgActivePosistion&&!r.hoverData.selecting){var v=r.cy.zoom(),c=n.bgActivePosistion;f.fillStyle="rgba("+i.core("active-bg-color").value[0]+","+i.core("active-bg-color").value[1]+","+i.core("active-bg-color").value[2]+","+i.core("active-bg-opacity").value+")",f.beginPath(),f.arc(c.x,c.y,i.core("active-bg-size").pfValue/v,0,2*Math.PI),f.fill()}var d=r.lastRedrawTime;if(r.showFps&&d){d=Math.round(d);var g=Math.round(1000/d),y="1 frame = "+d+" ms = "+g+" fps";if(f.setTransform(1,0,0,1,0,0),f.fillStyle="rgba(255, 0, 0, 0.75)",f.strokeStyle="rgba(255, 0, 0, 0.75)",f.font="30px Arial",!La){var p=f.measureText(y);La=p.actualBoundingBoxAscent}f.fillText(y,0,La);var m=60;f.strokeRect(0,La+10,250,20),f.fillRect(0,La+10,250*Math.min(g/m,1),20)}if(!o)l[r.SELECT_BOX]=!1}};function nf(t,e,r){var a=t.createShader(e);if(t.shaderSource(a,r),t.compileShader(a),!t.getShaderParameter(a,t.COMPILE_STATUS))throw Error(t.getShaderInfoLog(a));return a}function tm(t,e,r){var a=nf(t,t.VERTEX_SHADER,e),n=nf(t,t.FRAGMENT_SHADER,r),i=t.createProgram();if(t.attachShader(i,a),t.attachShader(i,n),t.linkProgram(i),!t.getProgramParameter(i,t.LINK_STATUS))throw Error("Could not initialize shaders");return i}function rm(t,e,r){if(r===void 0)r=e;var a=t.makeOffscreenCanvas(e,r),n=a.context=a.getContext("2d");return a.clear=function(){return n.clearRect(0,0,a.width,a.height)},a.clear(),a}function Bo(t){var e=t.pixelRatio,r=t.cy.zoom(),a=t.cy.pan();return{zoom:r*e,pan:{x:a.x*e,y:a.y*e}}}function am(t){var e=t.pixelRatio,r=t.cy.zoom();return r*e}function nm(t,e,r,a,n){var i=a*r+e.x,s=n*r+e.y;return s=Math.round(t.canvasHeight-s),[i,s]}function im(t,e){if(e.picking)return!0;else{if(t.pstyle("background-fill").value!=="solid")return!1;if(t.pstyle("background-image").strValue!=="none")return!1;if(t.pstyle("border-width").value===0)return!0;if(t.pstyle("border-opacity").value===0)return!0;if(t.pstyle("border-style").value!=="solid")return!1;return!0}}function sm(t,e){if(t.length!==e.length)return!1;for(var r=0;r<t.length;r++)if(t[r]!==e[r])return!1;return!0}function Ir(t,e,r){var a=t[0]/255,n=t[1]/255,i=t[2]/255,s=e,o=r||[,,,,];return o[0]=a*s,o[1]=n*s,o[2]=i*s,o[3]=s,o}function jr(t,e){var r=e||[,,,,];return r[0]=(t>>0&255)/255,r[1]=(t>>8&255)/255,r[2]=(t>>16&255)/255,r[3]=(t>>24&255)/255,r}function om(t){return t[0]+(t[1]<<8)+(t[2]<<16)+(t[3]<<24)}function um(t,e){var r=t.createTexture();return r.buffer=function(a){t.bindTexture(t.TEXTURE_2D,r),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR_MIPMAP_NEAREST),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,a),t.generateMipmap(t.TEXTURE_2D),t.bindTexture(t.TEXTURE_2D,null)},r.deleteTexture=function(){t.deleteTexture(r)},r}function Kv(t,e){switch(e){case"float":return[1,t.FLOAT,4];case"vec2":return[2,t.FLOAT,4];case"vec3":return[3,t.FLOAT,4];case"vec4":return[4,t.FLOAT,4];case"int":return[1,t.INT,4];case"ivec2":return[2,t.INT,4]}}function Zv(t,e,r){switch(e){case t.FLOAT:return new Float32Array(r);case t.INT:return new Int32Array(r)}}function lm(t,e,r,a,n,i){switch(e){case t.FLOAT:return new Float32Array(r.buffer,i*a,n);case t.INT:return new Int32Array(r.buffer,i*a,n)}}function fm(t,e,r,a){var n=Kv(t,e),i=ct(n,2),s=i[0],o=i[1],l=Zv(t,o,a),u=t.createBuffer();if(t.bindBuffer(t.ARRAY_BUFFER,u),t.bufferData(t.ARRAY_BUFFER,l,t.STATIC_DRAW),o===t.FLOAT)t.vertexAttribPointer(r,s,o,!1,0,0);else if(o===t.INT)t.vertexAttribIPointer(r,s,o,0,0);return t.enableVertexAttribArray(r),t.bindBuffer(t.ARRAY_BUFFER,null),u}function Zt(t,e,r,a){var n=Kv(t,r),i=ct(n,3),s=i[0],o=i[1],l=i[2],u=Zv(t,o,e*s),f=s*l,v=t.createBuffer();if(t.bindBuffer(t.ARRAY_BUFFER,v),t.bufferData(t.ARRAY_BUFFER,e*f,t.DYNAMIC_DRAW),t.enableVertexAttribArray(a),o===t.FLOAT)t.vertexAttribPointer(a,s,o,!1,f,0);else if(o===t.INT)t.vertexAttribIPointer(a,s,o,f,0);t.vertexAttribDivisor(a,1),t.bindBuffer(t.ARRAY_BUFFER,null);var h=Array(e);for(var c=0;c<e;c++)h[c]=lm(t,o,u,f,s,c);return v.dataArray=u,v.stride=f,v.size=s,v.getView=function(d){return h[d]},v.setPoint=function(d,g,y){var p=h[d];p[0]=g,p[1]=y},v.bufferSubData=function(d){if(t.bindBuffer(t.ARRAY_BUFFER,v),d)t.bufferSubData(t.ARRAY_BUFFER,0,u,0,d*s);else t.bufferSubData(t.ARRAY_BUFFER,0,u)},v}function vm(t,e,r){var a=9,n=new Float32Array(e*a),i=Array(e);for(var s=0;s<e;s++){var o=s*a*4;i[s]=new Float32Array(n.buffer,o,a)}var l=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,l),t.bufferData(t.ARRAY_BUFFER,n.byteLength,t.DYNAMIC_DRAW);for(var u=0;u<3;u++){var f=r+u;t.enableVertexAttribArray(f),t.vertexAttribPointer(f,3,t.FLOAT,!1,36,u*12),t.vertexAttribDivisor(f,1)}return t.bindBuffer(t.ARRAY_BUFFER,null),l.getMatrixView=function(v){return i[v]},l.setData=function(v,h){i[h].set(v,0)},l.bufferSubData=function(){t.bindBuffer(t.ARRAY_BUFFER,l),t.bufferSubData(t.ARRAY_BUFFER,0,n)},l}function hm(t){var e=t.createFramebuffer();t.bindFramebuffer(t.FRAMEBUFFER,e);var r=t.createTexture();return t.bindTexture(t.TEXTURE_2D,r),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,r,0),t.bindFramebuffer(t.FRAMEBUFFER,null),e.setFramebufferAttachmentSizes=function(a,n){t.bindTexture(t.TEXTURE_2D,r),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,a,n,0,t.RGBA,t.UNSIGNED_BYTE,null)},e}var sf=typeof Float32Array<"u"?Float32Array:Array;if(!Math.hypot)Math.hypot=function(){var t=0,e=arguments.length;while(e--)t+=arguments[e]*arguments[e];return Math.sqrt(t)};function zs(){var t=new sf(9);if(sf!=Float32Array)t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0;return t[0]=1,t[4]=1,t[8]=1,t}function of(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function cm(t,e,r){var a=e[0],n=e[1],i=e[2],s=e[3],o=e[4],l=e[5],u=e[6],f=e[7],v=e[8],h=r[0],c=r[1],d=r[2],g=r[3],y=r[4],p=r[5],m=r[6],b=r[7],E=r[8];return t[0]=h*a+c*s+d*u,t[1]=h*n+c*o+d*f,t[2]=h*i+c*l+d*v,t[3]=g*a+y*s+p*u,t[4]=g*n+y*o+p*f,t[5]=g*i+y*l+p*v,t[6]=m*a+b*s+E*u,t[7]=m*n+b*o+E*f,t[8]=m*i+b*l+E*v,t}function In(t,e,r){var a=e[0],n=e[1],i=e[2],s=e[3],o=e[4],l=e[5],u=e[6],f=e[7],v=e[8],h=r[0],c=r[1];return t[0]=a,t[1]=n,t[2]=i,t[3]=s,t[4]=o,t[5]=l,t[6]=h*a+c*s+u,t[7]=h*n+c*o+f,t[8]=h*i+c*l+v,t}function uf(t,e,r){var a=e[0],n=e[1],i=e[2],s=e[3],o=e[4],l=e[5],u=e[6],f=e[7],v=e[8],h=Math.sin(r),c=Math.cos(r);return t[0]=c*a+h*s,t[1]=c*n+h*o,t[2]=c*i+h*l,t[3]=c*s-h*a,t[4]=c*o-h*n,t[5]=c*l-h*i,t[6]=u,t[7]=f,t[8]=v,t}function so(t,e,r){var a=r[0],n=r[1];return t[0]=a*e[0],t[1]=a*e[1],t[2]=a*e[2],t[3]=n*e[3],t[4]=n*e[4],t[5]=n*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function dm(t,e,r){return t[0]=2/e,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/r,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t}var gm=function(){function t(e,r,a,n){Mr(this,t),this.debugID=Math.floor(Math.random()*1e4),this.r=e,this.texSize=r,this.texRows=a,this.texHeight=Math.floor(r/a),this.enableWrapping=!0,this.locked=!1,this.texture=null,this.needsBuffer=!0,this.freePointer={x:0,row:0},this.keyToLocation=new Map,this.canvas=n(e,r,r),this.scratch=n(e,r,this.texHeight,"scratch")}return Lr(t,[{key:"lock",value:function(){this.locked=!0}},{key:"getKeys",value:function(){return new Set(this.keyToLocation.keys())}},{key:"getScale",value:function(r){var{w:a,h:n}=r,i=this.texHeight,s=this.texSize,o=i/n,l=a*o,u=n*o;if(l>s)o=s/a,l=a*o,u=n*o;return{scale:o,texW:l,texH:u}}},{key:"draw",value:function(r,a,n){var i=this;if(this.locked)throw Error("can't draw, atlas is locked");var s=this.texSize,o=this.texRows,l=this.texHeight,u=this.getScale(a),{scale:f,texW:v,texH:h}=u,c=function(b,E){if(n&&E){var A=E.context,{x:M,row:S}=b,P=M,N=l*S;A.save(),A.translate(P,N),A.scale(f,f),n(A,a),A.restore()}},d=[null,null],g=function(){if(c(i.freePointer,i.canvas),d[0]={x:i.freePointer.x,y:i.freePointer.row*l,w:v,h},d[1]={x:i.freePointer.x+v,y:i.freePointer.row*l,w:0,h},i.freePointer.x+=v,i.freePointer.x==s)i.freePointer.x=0,i.freePointer.row++},y=function(){var{scratch:b,canvas:E}=i;b.clear(),c({x:0,row:0},b);var A=s-i.freePointer.x,M=v-A,S=l;{var P=i.freePointer.x,N=i.freePointer.row*l,R=A;E.context.drawImage(b,0,0,R,S,P,N,R,S),d[0]={x:P,y:N,w:R,h}}{var I=A,w=(i.freePointer.row+1)*l,x=M;if(E)E.context.drawImage(b,I,0,x,S,0,w,x,S);d[1]={x:0,y:w,w:x,h}}i.freePointer.x=M,i.freePointer.row++},p=function(){i.freePointer.x=0,i.freePointer.row++};if(this.freePointer.x+v<=s)g();else if(this.freePointer.row>=o-1)return!1;else if(this.freePointer.x===s)p(),g();else if(this.enableWrapping)y();else p(),g();return this.keyToLocation.set(r,d),this.needsBuffer=!0,d}},{key:"getOffsets",value:function(r){return this.keyToLocation.get(r)}},{key:"isEmpty",value:function(){return this.freePointer.x===0&&this.freePointer.row===0}},{key:"canFit",value:function(r){if(this.locked)return!1;var a=this.texSize,n=this.texRows,i=this.getScale(r),s=i.texW;if(this.freePointer.x+s>a)return this.freePointer.row<n-1;return!0}},{key:"bufferIfNeeded",value:function(r){if(!this.texture)this.texture=um(r,this.debugID);if(this.needsBuffer){if(this.texture.buffer(this.canvas),this.needsBuffer=!1,this.locked)this.canvas=null,this.scratch=null}}},{key:"dispose",value:function(){if(this.texture)this.texture.deleteTexture(),this.texture=null;this.canvas=null,this.scratch=null,this.locked=!0}}])}(),pm=function(){function t(e,r,a,n){Mr(this,t),this.r=e,this.texSize=r,this.texRows=a,this.createTextureCanvas=n,this.atlases=[],this.styleKeyToAtlas=new Map,this.markedKeys=new Set}return Lr(t,[{key:"getKeys",value:function(){return new Set(this.styleKeyToAtlas.keys())}},{key:"_createAtlas",value:function(){var r=this.r,a=this.texSize,n=this.texRows,i=this.createTextureCanvas;return new gm(r,a,n,i)}},{key:"_getScratchCanvas",value:function(){if(!this.scratch){var r=this.r,a=this.texSize,n=this.texRows,i=this.createTextureCanvas,s=Math.floor(a/n);this.scratch=i(r,a,s,"scratch")}return this.scratch}},{key:"draw",value:function(r,a,n){var i=this.styleKeyToAtlas.get(r);if(!i){if(i=this.atlases[this.atlases.length-1],!i||!i.canFit(a)){if(i)i.lock();i=this._createAtlas(),this.atlases.push(i)}i.draw(r,a,n),this.styleKeyToAtlas.set(r,i)}return i}},{key:"getAtlas",value:function(r){return this.styleKeyToAtlas.get(r)}},{key:"hasAtlas",value:function(r){return this.styleKeyToAtlas.has(r)}},{key:"markKeyForGC",value:function(r){this.markedKeys.add(r)}},{key:"gc",value:function(){var r=this,a=this.markedKeys;if(a.size===0){console.log("nothing to garbage collect");return}var n=[],i=new Map,s=null,o=kt(this.atlases),l;try{var u=function(){var v=l.value,h=v.getKeys(),c=ym(a,h);if(c.size===0)return n.push(v),h.forEach(function(A){return i.set(A,v)}),1;if(!s)s=r._createAtlas(),n.push(s);var d=kt(h),g;try{for(d.s();!(g=d.n()).done;){var y=g.value;if(!c.has(y)){var p=v.getOffsets(y),m=ct(p,2),b=m[0],E=m[1];if(!s.canFit({w:b.w+E.w,h:b.h}))s.lock(),s=r._createAtlas(),n.push(s);if(v.canvas)r._copyTextureToNewAtlas(y,v,s),i.set(y,s)}}}catch(A){d.e(A)}finally{d.f()}v.dispose()};for(o.s();!(l=o.n()).done;)if(u())continue}catch(f){o.e(f)}finally{o.f()}this.atlases=n,this.styleKeyToAtlas=i,this.markedKeys=new Set}},{key:"_copyTextureToNewAtlas",value:function(r,a,n){var i=a.getOffsets(r),s=ct(i,2),o=s[0],l=s[1];if(l.w===0)n.draw(r,o,function(h){h.drawImage(a.canvas,o.x,o.y,o.w,o.h,0,0,o.w,o.h)});else{var u=this._getScratchCanvas();u.clear(),u.context.drawImage(a.canvas,o.x,o.y,o.w,o.h,0,0,o.w,o.h),u.context.drawImage(a.canvas,l.x,l.y,l.w,l.h,o.w,0,l.w,l.h);var f=o.w+l.w,v=o.h;n.draw(r,{w:f,h:v},function(h){h.drawImage(u,0,0,f,v,0,0,f,v)})}}},{key:"getCounts",value:function(){return{keyCount:this.styleKeyToAtlas.size,atlasCount:new Set(this.styleKeyToAtlas.values()).size}}}])}();function ym(t,e){if(t.intersection)return t.intersection(e);else return new Set(Bn(t).filter(function(r){return e.has(r)}))}var mm=function(){function t(e,r){Mr(this,t),this.r=e,this.globalOptions=r,this.atlasSize=r.webglTexSize,this.maxAtlasesPerBatch=r.webglTexPerBatch,this.renderTypes=new Map,this.collections=new Map,this.typeAndIdToKey=new Map}return Lr(t,[{key:"getAtlasSize",value:function(){return this.atlasSize}},{key:"addAtlasCollection",value:function(r,a){var n=this.globalOptions,{webglTexSize:i,createTextureCanvas:s}=n,o=a.texRows,l=this._cacheScratchCanvas(s),u=new pm(this.r,i,o,l);this.collections.set(r,u)}},{key:"addRenderType",value:function(r,a){var n=a.collection;if(!this.collections.has(n))throw Error("invalid atlas collection name '".concat(n,"'"));var i=this.collections.get(n),s=Oe({type:r,atlasCollection:i},a);this.renderTypes.set(r,s)}},{key:"getRenderTypeOpts",value:function(r){return this.renderTypes.get(r)}},{key:"getAtlasCollection",value:function(r){return this.collections.get(r)}},{key:"_cacheScratchCanvas",value:function(r){var a=-1,n=-1,i=null;return function(s,o,l,u){if(u){if(!i||o!=a||l!=n)a=o,n=l,i=r(s,o,l);return i}else return r(s,o,l)}}},{key:"_key",value:function(r,a){return"".concat(r,"-").concat(a)}},{key:"invalidate",value:function(r){var a=this,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.forceRedraw,s=i===void 0?!1:i,o=n.filterEle,l=o===void 0?function(){return!0}:o,u=n.filterType,f=u===void 0?function(){return!0}:u,v=!1,h=!1,c=kt(r),d;try{for(c.s();!(d=c.n()).done;){var g=d.value;if(l(g)){var y=kt(this.renderTypes.values()),p;try{var m=function(){var E=p.value,A=E.type;if(f(A)){var M=a.collections.get(E.collection),S=E.getKey(g),P=Array.isArray(S)?S:[S];if(s)P.forEach(function(w){return M.markKeyForGC(w)}),h=!0;else{var N=E.getID?E.getID(g):g.id(),R=a._key(A,N),I=a.typeAndIdToKey.get(R);if(I!==void 0&&!sm(P,I))v=!0,a.typeAndIdToKey.delete(R),I.forEach(function(w){return M.markKeyForGC(w)})}}};for(y.s();!(p=y.n()).done;)m()}catch(b){y.e(b)}finally{y.f()}}}}catch(b){c.e(b)}finally{c.f()}if(h)this.gc(),v=!1;return v}},{key:"gc",value:function(){var r=kt(this.collections.values()),a;try{for(r.s();!(a=r.n()).done;){var n=a.value;n.gc()}}catch(i){r.e(i)}finally{r.f()}}},{key:"getOrCreateAtlas",value:function(r,a,n,i){var s=this.renderTypes.get(a),o=this.collections.get(s.collection),l=!1,u=o.draw(i,n,function(h){if(s.drawClipped)h.save(),h.beginPath(),h.rect(0,0,n.w,n.h),h.clip(),s.drawElement(h,r,n,!0,!0),h.restore();else s.drawElement(h,r,n,!0,!0);l=!0});if(l){var f=s.getID?s.getID(r):r.id(),v=this._key(a,f);if(this.typeAndIdToKey.has(v))this.typeAndIdToKey.get(v).push(i);else this.typeAndIdToKey.set(v,[i])}return u}},{key:"getAtlasInfo",value:function(r,a){var n=this,i=this.renderTypes.get(a),s=i.getKey(r),o=Array.isArray(s)?s:[s];return o.map(function(l){var u=i.getBoundingBox(r,l),f=n.getOrCreateAtlas(r,a,u,l),v=f.getOffsets(l),h=ct(v,2),c=h[0],d=h[1];return{atlas:f,tex:c,tex1:c,tex2:d,bb:u}})}},{key:"getDebugInfo",value:function(){var r=[],a=kt(this.collections),n;try{for(a.s();!(n=a.n()).done;){var i=ct(n.value,2),s=i[0],o=i[1],l=o.getCounts(),{keyCount:u,atlasCount:f}=l;r.push({type:s,keyCount:u,atlasCount:f})}}catch(v){a.e(v)}finally{a.f()}return r}}])}(),bm=function(){function t(e){Mr(this,t),this.globalOptions=e,this.atlasSize=e.webglTexSize,this.maxAtlasesPerBatch=e.webglTexPerBatch,this.batchAtlases=[]}return Lr(t,[{key:"getMaxAtlasesPerBatch",value:function(){return this.maxAtlasesPerBatch}},{key:"getAtlasSize",value:function(){return this.atlasSize}},{key:"getIndexArray",value:function(){return Array.from({length:this.maxAtlasesPerBatch},function(r,a){return a})}},{key:"startBatch",value:function(){this.batchAtlases=[]}},{key:"getAtlasCount",value:function(){return this.batchAtlases.length}},{key:"getAtlases",value:function(){return this.batchAtlases}},{key:"canAddToCurrentBatch",value:function(r){if(this.batchAtlases.length===this.maxAtlasesPerBatch)return this.batchAtlases.includes(r);return!0}},{key:"getAtlasIndexForBatch",value:function(r){var a=this.batchAtlases.indexOf(r);if(a<0){if(this.batchAtlases.length===this.maxAtlasesPerBatch)throw Error("cannot add more atlases to batch");this.batchAtlases.push(r),a=this.batchAtlases.length-1}return a}}])}(),wm=`
18
18
  float circleSD(vec2 p, float r) {
19
19
  return distance(vec2(0), p) - r; // signed distance
20
20
  }
@@ -328,5 +328,5 @@ https://github.com/jquery/jquery/blob/master/src/event.js
328
328
  `).concat(r.picking?`if(outColor.a == 0.0) discard;
329
329
  else outColor = vIndex;`:"",`
330
330
  }
331
- `),o=tm(a,n,s);o.aPosition=a.getAttribLocation(o,"aPosition"),o.aIndex=a.getAttribLocation(o,"aIndex"),o.aVertType=a.getAttribLocation(o,"aVertType"),o.aTransform=a.getAttribLocation(o,"aTransform"),o.aAtlasId=a.getAttribLocation(o,"aAtlasId"),o.aTex=a.getAttribLocation(o,"aTex"),o.aPointAPointB=a.getAttribLocation(o,"aPointAPointB"),o.aPointCPointD=a.getAttribLocation(o,"aPointCPointD"),o.aLineWidth=a.getAttribLocation(o,"aLineWidth"),o.aColor=a.getAttribLocation(o,"aColor"),o.aCornerRadius=a.getAttribLocation(o,"aCornerRadius"),o.aBorderColor=a.getAttribLocation(o,"aBorderColor"),o.uPanZoomMatrix=a.getUniformLocation(o,"uPanZoomMatrix"),o.uAtlasSize=a.getUniformLocation(o,"uAtlasSize"),o.uBGColor=a.getUniformLocation(o,"uBGColor"),o.uZoom=a.getUniformLocation(o,"uZoom"),o.uTextures=[];for(var l=0;l<this.batchManager.getMaxAtlasesPerBatch();l++)o.uTextures.push(a.getUniformLocation(o,"uTexture".concat(l)));return o}},{key:"_createVAO",value:function(){var r=[0,0,1,0,1,1,0,0,1,1,0,1];this.vertexCount=r.length/2;var a=this.maxInstances,n=this.gl,i=this.program,s=n.createVertexArray();return n.bindVertexArray(s),fm(n,"vec2",i.aPosition,r),this.transformBuffer=vm(n,a,i.aTransform),this.indexBuffer=Zt(n,a,"vec4",i.aIndex),this.vertTypeBuffer=Zt(n,a,"int",i.aVertType),this.atlasIdBuffer=Zt(n,a,"int",i.aAtlasId),this.texBuffer=Zt(n,a,"vec4",i.aTex),this.pointAPointBBuffer=Zt(n,a,"vec4",i.aPointAPointB),this.pointCPointDBuffer=Zt(n,a,"vec4",i.aPointCPointD),this.lineWidthBuffer=Zt(n,a,"vec2",i.aLineWidth),this.colorBuffer=Zt(n,a,"vec4",i.aColor),this.cornerRadiusBuffer=Zt(n,a,"vec4",i.aCornerRadius),this.borderColorBuffer=Zt(n,a,"vec4",i.aBorderColor),n.bindVertexArray(null),s}},{key:"buffers",get:function(){var r=this;if(!this._buffers)this._buffers=Object.keys(this).filter(function(a){return yr(a,"Buffer")}).map(function(a){return r[a]});return this._buffers}},{key:"startFrame",value:function(r){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Fa.SCREEN;this.panZoomMatrix=r,this.renderTarget=a,this.batchDebugInfo=[],this.wrappedCount=0,this.simpleCount=0,this.startBatch()}},{key:"startBatch",value:function(){this.instanceCount=0,this.batchManager.startBatch()}},{key:"endFrame",value:function(){this.endBatch()}},{key:"_isVisible",value:function(r,a){if(r.visible()){if(a&&a.isVisible)return a.isVisible(r);return!0}return!1}},{key:"drawTexture",value:function(r,a,n){var i=this.atlasManager,s=this.batchManager,o=i.getRenderTypeOpts(n);if(!this._isVisible(r,o))return;if(r.isEdge()&&!this._isValidEdge(r))return;if(this.renderTarget.picking&&o.getTexPickingMode){var l=o.getTexPickingMode(r);if(l===$n.IGNORE)return;else if(l==$n.USE_BB){this.drawPickingRectangle(r,a,n);return}}var u=i.getAtlasInfo(r,n),f=kt(u),v;try{for(f.s();!(v=f.n()).done;){var h=v.value,{atlas:c,tex1:d,tex2:g}=h;if(!s.canAddToCurrentBatch(c))this.endBatch();var y=s.getAtlasIndexForBatch(c);for(var p=0,m=[[d,!0],[g,!1]];p<m.length;p++){var b=ht(m[p],2),E=b[0],A=b[1];if(E.w!=0){var M=this.instanceCount;this.vertTypeBuffer.getView(M)[0]=Vs;var S=this.indexBuffer.getView(M);jr(a,S);var P=this.atlasIdBuffer.getView(M);P[0]=y;var N=this.texBuffer.getView(M);N[0]=E.x,N[1]=E.y,N[2]=E.w,N[3]=E.h;var R=this.transformBuffer.getMatrixView(M);if(this.setTransformMatrix(r,R,o,h,A),this.instanceCount++,!A)this.wrappedCount++;if(this.instanceCount>=this.maxInstances)this.endBatch()}}}}catch(I){f.e(I)}finally{f.f()}}},{key:"setTransformMatrix",value:function(r,a,n,i){var s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=0;if(n.shapeProps&&n.shapeProps.padding)o=r.pstyle(n.shapeProps.padding).pfValue;if(i){var{bb:l,tex1:u,tex2:f}=i,v=u.w/(u.w+f.w);if(!s)v=1-v;var h=this._getAdjustedBB(l,o,s,v);this._applyTransformMatrix(a,h,n,r)}else{var c=n.getBoundingBox(r),d=this._getAdjustedBB(c,o,!0,1);this._applyTransformMatrix(a,d,n,r)}}},{key:"_applyTransformMatrix",value:function(r,a,n,i){var s,o;of(r);var l=n.getRotation?n.getRotation(i):0;if(l!==0){var u=n.getRotationPoint(i),{x:f,y:v}=u;In(r,r,[f,v]),uf(r,r,l);var h=n.getRotationOffset(i);s=h.x+(a.xOffset||0),o=h.y+(a.yOffset||0)}else s=a.x1,o=a.y1;In(r,r,[s,o]),so(r,r,[a.w,a.h])}},{key:"_getAdjustedBB",value:function(r,a,n,i){var{x1:s,y1:o,w:l,h:u,yOffset:f}=r;if(a)s-=a,o-=a,l+=2*a,u+=2*a;var v=0,h=l*i;if(n&&i<1)l=h;else if(!n&&i<1)v=l-h,s+=v,l=h;return{x1:s,y1:o,w:l,h:u,xOffset:v,yOffset:f}}},{key:"drawPickingRectangle",value:function(r,a,n){var i=this.atlasManager.getRenderTypeOpts(n),s=this.instanceCount;this.vertTypeBuffer.getView(s)[0]=ea;var o=this.indexBuffer.getView(s);jr(a,o);var l=this.colorBuffer.getView(s);Ir([0,0,0],1,l);var u=this.transformBuffer.getMatrixView(s);if(this.setTransformMatrix(r,u,i),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances)this.endBatch()}},{key:"drawNode",value:function(r,a,n){var i=this.simpleShapeOptions.get(n);if(!this._isVisible(r,i))return;var s=i.shapeProps,o=this._getVertTypeForShape(r,s.shape);if(o===void 0||i.isSimple&&!i.isSimple(r,this.renderTarget)){this.drawTexture(r,a,n);return}var l=this.instanceCount;if(this.vertTypeBuffer.getView(l)[0]=o,o===Tn||o===Ra){var u=i.getBoundingBox(r),f=this._getCornerRadius(r,s.radius,u),v=this.cornerRadiusBuffer.getView(l);if(v[0]=f,v[1]=f,v[2]=f,v[3]=f,o===Ra)v[0]=0,v[2]=0}var h=this.indexBuffer.getView(l);jr(a,h);var c=this.renderTarget.picking?1:n==="node-body"?r.effectiveOpacity():1,d=this.renderTarget.picking?1:r.pstyle(s.opacity).value*c,g=r.pstyle(s.color).value,y=this.colorBuffer.getView(l);Ir(g,d,y);var p=this.lineWidthBuffer.getView(l);if(p[0]=0,p[1]=0,s.border){var m=r.pstyle("border-width").value;if(m>0){var b=r.pstyle("border-color").value,E=c*r.pstyle("border-opacity").value,A=this.borderColorBuffer.getView(l);Ir(b,E,A);var M=r.pstyle("border-position").value;if(M==="inside")p[0]=0,p[1]=-m;else if(M==="outside")p[0]=m,p[1]=0;else{var S=m/2;p[0]=S,p[1]=-S}}}var P=this.transformBuffer.getMatrixView(l);if(this.setTransformMatrix(r,P,i),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances)this.endBatch()}},{key:"_getVertTypeForShape",value:function(r,a){var n=r.pstyle(a).value;switch(n){case"rectangle":return ea;case"ellipse":return Pa;case"roundrectangle":case"round-rectangle":return Tn;case"bottom-round-rectangle":return Ra;default:return}}},{key:"_getCornerRadius",value:function(r,a,n){var{w:i,h:s}=n;if(r.pstyle(a).value==="auto")return Cr(i,s);else{var o=r.pstyle(a).pfValue,l=i/2,u=s/2;return Math.min(o,u,l)}}},{key:"drawEdgeArrow",value:function(r,a,n){if(!r.visible())return;var i=r._private.rscratch,s,o,l;if(n==="source")s=i.arrowStartX,o=i.arrowStartY,l=i.srcArrowAngle;else s=i.arrowEndX,o=i.arrowEndY,l=i.tgtArrowAngle;if(isNaN(s)||s==null||isNaN(o)||o==null||isNaN(l)||l==null)return;var u=r.pstyle(n+"-arrow-shape").value;if(u==="none")return;var f=r.pstyle(n+"-arrow-color").value,v=r.pstyle("opacity").value,h=r.pstyle("line-opacity").value,c=v*h,d=r.pstyle("width").pfValue,g=r.pstyle("arrow-scale").value,y=this.r.getArrowWidth(d,g),p=this.instanceCount,m=this.transformBuffer.getMatrixView(p);of(m),In(m,m,[s,o]),so(m,m,[y,y]),uf(m,m,l),this.vertTypeBuffer.getView(p)[0]=Gs;var b=this.indexBuffer.getView(p);jr(a,b);var E=this.colorBuffer.getView(p);if(Ir(f,c,E),this.instanceCount++,this.instanceCount>=this.maxInstances)this.endBatch()}},{key:"drawEdgeLine",value:function(r,a){if(!r.visible())return;var n=this._getEdgePoints(r);if(!n)return;var i=r.pstyle("opacity").value,s=r.pstyle("line-opacity").value,o=r.pstyle("width").pfValue,l=r.pstyle("line-color").value,u=i*s;if(n.length/2+this.instanceCount>this.maxInstances)this.endBatch();if(n.length==4){var f=this.instanceCount;this.vertTypeBuffer.getView(f)[0]=lf;var v=this.indexBuffer.getView(f);jr(a,v);var h=this.colorBuffer.getView(f);Ir(l,u,h);var c=this.lineWidthBuffer.getView(f);c[0]=o;var d=this.pointAPointBBuffer.getView(f);if(d[0]=n[0],d[1]=n[1],d[2]=n[2],d[3]=n[3],this.instanceCount++,this.instanceCount>=this.maxInstances)this.endBatch()}else for(var g=0;g<n.length-2;g+=2){var y=this.instanceCount;this.vertTypeBuffer.getView(y)[0]=ff;var p=this.indexBuffer.getView(y);jr(a,p);var m=this.colorBuffer.getView(y);Ir(l,u,m);var b=this.lineWidthBuffer.getView(y);b[0]=o;var E=n[g-2],A=n[g-1],M=n[g],S=n[g+1],P=n[g+2],N=n[g+3],R=n[g+4],I=n[g+5];if(g==0)E=2*M-P+0.001,A=2*S-N+0.001;if(g==n.length-4)R=2*P-M+0.001,I=2*N-S+0.001;var w=this.pointAPointBBuffer.getView(y);w[0]=E,w[1]=A,w[2]=M,w[3]=S;var x=this.pointCPointDBuffer.getView(y);if(x[0]=P,x[1]=N,x[2]=R,x[3]=I,this.instanceCount++,this.instanceCount>=this.maxInstances)this.endBatch()}}},{key:"_isValidEdge",value:function(r){var a=r._private.rscratch;if(a.badLine||a.allpts==null||isNaN(a.allpts[0]))return!1;return!0}},{key:"_getEdgePoints",value:function(r){var a=r._private.rscratch;if(!this._isValidEdge(r))return;var n=a.allpts;if(n.length==4)return n;var i=this._getNumSegments(r);return this._getCurveSegmentPoints(n,i)}},{key:"_getNumSegments",value:function(r){var a=15;return Math.min(Math.max(a,5),this.maxInstances)}},{key:"_getCurveSegmentPoints",value:function(r,a){if(r.length==4)return r;var n=Array((a+1)*2);for(var i=0;i<=a;i++)if(i==0)n[0]=r[0],n[1]=r[1];else if(i==a)n[i*2]=r[r.length-2],n[i*2+1]=r[r.length-1];else{var s=i/a;this._setCurvePoint(r,s,n,i*2)}return n}},{key:"_setCurvePoint",value:function(r,a,n,i){if(r.length<=2)n[i]=r[0],n[i+1]=r[1];else{var s=Array(r.length-2);for(var o=0;o<s.length;o+=2){var l=(1-a)*r[o]+a*r[o+2],u=(1-a)*r[o+1]+a*r[o+3];s[o]=l,s[o+1]=u}return this._setCurvePoint(s,a,n,i)}}},{key:"endBatch",value:function(){var r=this.gl,a=this.vao,n=this.vertexCount,i=this.instanceCount;if(i===0)return;var s=this.renderTarget.picking?this.pickingProgram:this.program;r.useProgram(s),r.bindVertexArray(a);var o=kt(this.buffers),l;try{for(o.s();!(l=o.n()).done;){var u=l.value;u.bufferSubData(i)}}catch(d){o.e(d)}finally{o.f()}var f=this.batchManager.getAtlases();for(var v=0;v<f.length;v++)f[v].bufferIfNeeded(r);for(var h=0;h<f.length;h++)r.activeTexture(r.TEXTURE0+h),r.bindTexture(r.TEXTURE_2D,f[h].texture),r.uniform1i(s.uTextures[h],h);r.uniform1f(s.uZoom,am(this.r)),r.uniformMatrix3fv(s.uPanZoomMatrix,!1,this.panZoomMatrix),r.uniform1i(s.uAtlasSize,this.batchManager.getAtlasSize());var c=Ir(this.bgColor,1);if(r.uniform4fv(s.uBGColor,c),r.drawArraysInstanced(r.TRIANGLES,0,n,i),r.bindVertexArray(null),r.bindTexture(r.TEXTURE_2D,null),this.debug)this.batchDebugInfo.push({count:i,atlasCount:f.length});this.startBatch()}},{key:"getDebugInfo",value:function(){var r=this.atlasManager.getDebugInfo(),a=r.reduce(function(s,o){return s+o.atlasCount},0),n=this.batchDebugInfo,i=n.reduce(function(s,o){return s+o.count},0);return{atlasInfo:r,totalAtlases:a,wrappedCount:this.wrappedCount,simpleCount:this.simpleCount,batchCount:n.length,batchInfo:n,totalInstances:i}}}])}(),_v={};_v.initWebgl=function(t,e){var r=this,a=r.data.contexts[r.WEBGL];t.bgColor=Sm(r),t.webglTexSize=Math.min(t.webglTexSize,a.getParameter(a.MAX_TEXTURE_SIZE)),t.webglTexRows=Math.min(t.webglTexRows,54),t.webglTexRowsNodes=Math.min(t.webglTexRowsNodes,54),t.webglBatchSize=Math.min(t.webglBatchSize,16384),t.webglTexPerBatch=Math.min(t.webglTexPerBatch,a.getParameter(a.MAX_TEXTURE_IMAGE_UNITS)),r.webglDebug=t.webglDebug,r.webglDebugShowAtlases=t.webglDebugShowAtlases,r.pickingFrameBuffer=hm(a),r.pickingFrameBuffer.needsDraw=!0,r.drawing=new Cm(r,a,t);var n=function(v){return function(h){return r.getTextAngle(h,v)}},i=function(v){return function(h){var c=h.pstyle(v);return c&&c.value}},s=function(v){return function(h){return h.pstyle("".concat(v,"-opacity")).value>0}},o=function(v){var h=v.pstyle("text-events").strValue==="yes";return h?$n.USE_BB:$n.IGNORE},l=function(v){var h=v.position(),{x:c,y:d}=h,g=v.outerWidth(),y=v.outerHeight();return{w:g,h:y,x1:c-g/2,y1:d-y/2}};r.drawing.addAtlasCollection("node",{texRows:t.webglTexRowsNodes}),r.drawing.addAtlasCollection("label",{texRows:t.webglTexRows}),r.drawing.addTextureAtlasRenderType("node-body",{collection:"node",getKey:e.getStyleKey,getBoundingBox:e.getElementBox,drawElement:e.drawElement}),r.drawing.addSimpleShapeRenderType("node-body",{getBoundingBox:l,isSimple:im,shapeProps:{shape:"shape",color:"background-color",opacity:"background-opacity",radius:"corner-radius",border:!0}}),r.drawing.addSimpleShapeRenderType("node-overlay",{getBoundingBox:l,isVisible:s("overlay"),shapeProps:{shape:"overlay-shape",color:"overlay-color",opacity:"overlay-opacity",padding:"overlay-padding",radius:"overlay-corner-radius"}}),r.drawing.addSimpleShapeRenderType("node-underlay",{getBoundingBox:l,isVisible:s("underlay"),shapeProps:{shape:"underlay-shape",color:"underlay-color",opacity:"underlay-opacity",padding:"underlay-padding",radius:"underlay-corner-radius"}}),r.drawing.addTextureAtlasRenderType("label",{collection:"label",getTexPickingMode:o,getKey:Us(e.getLabelKey,null),getBoundingBox:Hs(e.getLabelBox,null),drawClipped:!0,drawElement:e.drawLabel,getRotation:n(null),getRotationPoint:e.getLabelRotationPoint,getRotationOffset:e.getLabelRotationOffset,isVisible:i("label")}),r.drawing.addTextureAtlasRenderType("edge-source-label",{collection:"label",getTexPickingMode:o,getKey:Us(e.getSourceLabelKey,"source"),getBoundingBox:Hs(e.getSourceLabelBox,"source"),drawClipped:!0,drawElement:e.drawSourceLabel,getRotation:n("source"),getRotationPoint:e.getSourceLabelRotationPoint,getRotationOffset:e.getSourceLabelRotationOffset,isVisible:i("source-label")}),r.drawing.addTextureAtlasRenderType("edge-target-label",{collection:"label",getTexPickingMode:o,getKey:Us(e.getTargetLabelKey,"target"),getBoundingBox:Hs(e.getTargetLabelBox,"target"),drawClipped:!0,drawElement:e.drawTargetLabel,getRotation:n("target"),getRotationPoint:e.getTargetLabelRotationPoint,getRotationOffset:e.getTargetLabelRotationOffset,isVisible:i("target-label")});var u=ja(function(){console.log("garbage collect flag set"),r.data.gc=!0},1e4);r.onUpdateEleCalcs(function(f,v){var h=!1;if(v&&v.length>0)h|=r.drawing.invalidate(v);if(h)u()}),Dm(r)};function Sm(t){var e=t.cy.container(),r=e&&e.style&&e.style.backgroundColor||"white";return xf(r)}function Qv(t,e){var r=t._private.rscratch;return Nt(r,"labelWrapCachedLines",e)||[]}var Us=function(e,r){return function(a){var n=e(a),i=Qv(a,r);if(i.length>1)return i.map(function(s,o){return"".concat(n,"_").concat(o)});return n}},Hs=function(e,r){return function(a,n){var i=e(a);if(typeof n==="string"){var s=n.indexOf("_");if(s>0){var o=Number(n.substring(s+1)),l=Qv(a,r),u=i.h/l.length,f=u*o,v=i.y1+f;return{x1:i.x1,w:i.w,y1:v,h:u,yOffset:f}}}return i}};function Dm(t){{var e=t.render;t.render=function(i){i=i||{};var s=t.cy;if(t.webgl)if(s.zoom()>qv)Am(t),e.call(t,i);else Mm(t),jv(t,i,Fa.SCREEN)}}{var r=t.matchCanvasSize;t.matchCanvasSize=function(i){r.call(t,i),t.pickingFrameBuffer.setFramebufferAttachmentSizes(t.canvasWidth,t.canvasHeight),t.pickingFrameBuffer.needsDraw=!0}}t.findNearestElements=function(i,s,o,l){return Im(t,i,s)};{var a=t.invalidateCachedZSortedEles;t.invalidateCachedZSortedEles=function(){a.call(t),t.pickingFrameBuffer.needsDraw=!0}}{var n=t.notify;t.notify=function(i,s){if(n.call(t,i,s),i==="viewport"||i==="bounds")t.pickingFrameBuffer.needsDraw=!0;else if(i==="background")t.drawing.invalidate(s,{type:"node-body"})}}}function Am(t){var e=t.data.contexts[t.WEBGL];e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT)}function Mm(t){var e=function(a){a.save(),a.setTransform(1,0,0,1,0,0),a.clearRect(0,0,t.canvasWidth,t.canvasHeight),a.restore()};e(t.data.contexts[t.NODE]),e(t.data.contexts[t.DRAG])}function Lm(t){var{canvasWidth:e,canvasHeight:r}=t,a=Bo(t),{pan:n,zoom:i}=a,s=zs();In(s,s,[n.x,n.y]),so(s,s,[i,i]);var o=zs();dm(o,e,r);var l=zs();return cm(l,o,s),l}function Jv(t,e){var{canvasWidth:r,canvasHeight:a}=t,n=Bo(t),{pan:i,zoom:s}=n;e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,r,a),e.translate(i.x,i.y),e.scale(s,s)}function Rm(t,e){t.drawSelectionRectangle(e,function(r){return Jv(t,r)})}function Pm(t){var e=t.data.contexts[t.NODE];e.save(),Jv(t,e),e.strokeStyle="rgba(0, 0, 0, 0.3)",e.beginPath(),e.moveTo(-1000,0),e.lineTo(1000,0),e.stroke(),e.beginPath(),e.moveTo(0,-1000),e.lineTo(0,1000),e.stroke(),e.restore()}function Nm(t){var e=function(n,i,s){var o=n.atlasManager.getAtlasCollection(i),l=t.data.contexts[t.NODE],u=o.atlases;for(var f=0;f<u.length;f++){var v=u[f],h=v.canvas;if(h){var{width:c,height:d}=h,g=c*f,y=h.height*s,p=0.4;l.save(),l.scale(p,p),l.drawImage(h,g,y),l.strokeStyle="black",l.rect(g,y,c,d),l.stroke(),l.restore()}}},r=0;e(t.drawing,"node",r++),e(t.drawing,"label",r++)}function Om(t,e,r,a,n){var i,s,o,l,u=Bo(t),{pan:f,zoom:v}=u;{var h=nm(t,f,v,e,r),c=ht(h,2),d=c[0],g=c[1],y=6;i=d-y/2,s=g-y/2,o=y,l=y}if(o===0||l===0)return[];var p=t.data.contexts[t.WEBGL];if(p.bindFramebuffer(p.FRAMEBUFFER,t.pickingFrameBuffer),t.pickingFrameBuffer.needsDraw)p.viewport(0,0,p.canvas.width,p.canvas.height),jv(t,null,Fa.PICKING),t.pickingFrameBuffer.needsDraw=!1;var m=o*l,b=new Uint8Array(m*4);p.readPixels(i,s,o,l,p.RGBA,p.UNSIGNED_BYTE,b),p.bindFramebuffer(p.FRAMEBUFFER,null);var E=new Set;for(var A=0;A<m;A++){var M=b.slice(A*4,A*4+4),S=om(M)-1;if(S>=0)E.add(S)}return E}function Im(t,e,r){var a=Om(t,e,r),n=t.getCachedZSortedEles(),i,s,o=kt(a),l;try{for(o.s();!(l=o.n()).done;){var u=l.value,f=n[u];if(!i&&f.isNode())i=f;if(!s&&f.isEdge())s=f;if(i&&s)break}}catch(v){o.e(v)}finally{o.f()}return[i,s].filter(Boolean)}function qs(t,e,r){var a=t.drawing;if(e+=1,r.isNode())a.drawNode(r,e,"node-underlay"),a.drawNode(r,e,"node-body"),a.drawTexture(r,e,"label"),a.drawNode(r,e,"node-overlay");else a.drawEdgeLine(r,e),a.drawEdgeArrow(r,e,"source"),a.drawEdgeArrow(r,e,"target"),a.drawTexture(r,e,"label"),a.drawTexture(r,e,"edge-source-label"),a.drawTexture(r,e,"edge-target-label")}function jv(t,e,r){var a;if(t.webglDebug)a=performance.now();var n=t.drawing,i=0;if(r.screen){if(t.data.canvasNeedsRedraw[t.SELECT_BOX])Rm(t,e)}if(t.data.canvasNeedsRedraw[t.NODE]||r.picking){var s=t.data.contexts[t.WEBGL];if(r.screen)s.clearColor(0,0,0,0),s.enable(s.BLEND),s.blendFunc(s.ONE,s.ONE_MINUS_SRC_ALPHA);else s.disable(s.BLEND);s.clear(s.COLOR_BUFFER_BIT|s.DEPTH_BUFFER_BIT),s.viewport(0,0,s.canvas.width,s.canvas.height);var o=Lm(t),l=t.getCachedZSortedEles();if(i=l.length,n.startFrame(o,r),r.screen){for(var u=0;u<l.nondrag.length;u++)qs(t,u,l.nondrag[u]);for(var f=0;f<l.drag.length;f++)qs(t,f,l.drag[f])}else if(r.picking)for(var v=0;v<l.length;v++)qs(t,v,l[v]);if(n.endFrame(),r.screen&&t.webglDebugShowAtlases)Pm(t),Nm(t);t.data.canvasNeedsRedraw[t.NODE]=!1,t.data.canvasNeedsRedraw[t.DRAG]=!1}if(t.webglDebug){var h=performance.now(),c=!1,d=Math.ceil(h-a),g=n.getDebugInfo(),y=["".concat(i," elements"),"".concat(g.totalInstances," instances"),"".concat(g.batchCount," batches"),"".concat(g.totalAtlases," atlases"),"".concat(g.wrappedCount," wrapped textures"),"".concat(g.simpleCount," simple shapes")].join(", ");if(c)console.log("WebGL (".concat(r.name,") - time ").concat(d,"ms, ").concat(y));else{console.log("WebGL (".concat(r.name,") - frame time ").concat(d,"ms")),console.log("Totals:"),console.log(" ".concat(y)),console.log("Texture Atlases Used:");var p=g.atlasInfo,m=kt(p),b;try{for(m.s();!(b=m.n()).done;){var E=b.value;console.log(" ".concat(E.type,": ").concat(E.keyCount," keys, ").concat(E.atlasCount," atlases"))}}catch(A){m.e(A)}finally{m.f()}console.log("")}}if(t.data.gc)console.log("Garbage Collect!"),t.data.gc=!1,n.gc()}var Nr={};Nr.drawPolygonPath=function(t,e,r,a,n,i){var s=a/2,o=n/2;if(t.beginPath)t.beginPath();t.moveTo(e+s*i[0],r+o*i[1]);for(var l=1;l<i.length/2;l++)t.lineTo(e+s*i[l*2],r+o*i[l*2+1]);t.closePath()};Nr.drawRoundPolygonPath=function(t,e,r,a,n,i,s){s.forEach(function(o){return Ov(t,o)}),t.closePath()};Nr.drawRoundRectanglePath=function(t,e,r,a,n,i){var s=a/2,o=n/2,l=i==="auto"?Cr(a,n):Math.min(i,o,s);if(t.beginPath)t.beginPath();t.moveTo(e,r-o),t.arcTo(e+s,r-o,e+s,r,l),t.arcTo(e+s,r+o,e,r+o,l),t.arcTo(e-s,r+o,e-s,r,l),t.arcTo(e-s,r-o,e,r-o,l),t.lineTo(e,r-o),t.closePath()};Nr.drawBottomRoundRectanglePath=function(t,e,r,a,n,i){var s=a/2,o=n/2,l=i==="auto"?Cr(a,n):i;if(t.beginPath)t.beginPath();t.moveTo(e,r-o),t.lineTo(e+s,r-o),t.lineTo(e+s,r),t.arcTo(e+s,r+o,e,r+o,l),t.arcTo(e-s,r+o,e-s,r,l),t.lineTo(e-s,r-o),t.lineTo(e,r-o),t.closePath()};Nr.drawCutRectanglePath=function(t,e,r,a,n,i,s){var o=a/2,l=n/2,u=s==="auto"?Eo():s;if(t.beginPath)t.beginPath();t.moveTo(e-o+u,r-l),t.lineTo(e+o-u,r-l),t.lineTo(e+o,r-l+u),t.lineTo(e+o,r+l-u),t.lineTo(e+o-u,r+l),t.lineTo(e-o+u,r+l),t.lineTo(e-o,r+l-u),t.lineTo(e-o,r-l+u),t.closePath()};Nr.drawBarrelPath=function(t,e,r,a,n){var i=a/2,s=n/2,o=e-i,l=e+i,u=r-s,f=r+s,v=Ws(a,n),{widthOffset:h,heightOffset:c}=v,d=v.ctrlPtOffsetPct*h;if(t.beginPath)t.beginPath();t.moveTo(o,u+c),t.lineTo(o,f-c),t.quadraticCurveTo(o+d,f,o+h,f),t.lineTo(l-h,f),t.quadraticCurveTo(l-d,f,l,f-c),t.lineTo(l,u+c),t.quadraticCurveTo(l-d,u,l-h,u),t.lineTo(o+h,u),t.quadraticCurveTo(o+d,u,o,u+c),t.closePath()};var vf=Math.sin(0),hf=Math.cos(0),oo={},uo={},eh=Math.PI/40;for(gr=0*Math.PI;gr<2*Math.PI;gr+=eh)oo[gr]=Math.sin(gr),uo[gr]=Math.cos(gr);var gr;Nr.drawEllipsePath=function(t,e,r,a,n){if(t.beginPath)t.beginPath();if(t.ellipse)t.ellipse(e,r,a/2,n/2,0,0,2*Math.PI);else{var i,s,o=a/2,l=n/2;for(var u=0*Math.PI;u<2*Math.PI;u+=eh)if(i=e-o*oo[u]*vf+o*uo[u]*hf,s=r+l*uo[u]*vf+l*oo[u]*hf,u===0)t.moveTo(i,s);else t.lineTo(i,s)}t.closePath()};var sn={};sn.createBuffer=function(t,e){var r=document.createElement("canvas");return r.width=t,r.height=e,[r,r.getContext("2d")]};sn.bufferCanvasImage=function(t){var e=this.cy,r=e.mutableElements(),a=r.boundingBox(),n=this.findContainerClientCoords(),i=t.full?Math.ceil(a.w):n[2],s=t.full?Math.ceil(a.h):n[3],o=he(t.maxWidth)||he(t.maxHeight),l=this.getPixelRatio(),u=1;if(t.scale!==void 0)i*=t.scale,s*=t.scale,u=t.scale;else if(o){var f=1/0,v=1/0;if(he(t.maxWidth))f=u*t.maxWidth/i;if(he(t.maxHeight))v=u*t.maxHeight/s;u=Math.min(f,v),i*=u,s*=u}if(!o)i*=l,s*=l,u*=l;var h=document.createElement("canvas");h.width=i,h.height=s,h.style.width=i+"px",h.style.height=s+"px";var c=h.getContext("2d");if(i>0&&s>0){c.clearRect(0,0,i,s),c.globalCompositeOperation="source-over";var d=this.getCachedZSortedEles();if(t.full)c.translate(-a.x1*u,-a.y1*u),c.scale(u,u),this.drawElements(c,d);else{var g=e.pan(),y={x:g.x*u,y:g.y*u};u*=e.zoom(),c.translate(y.x,y.y),c.scale(u,u),this.drawElements(c,d)}if(c.setTransform(1,0,0,1,0,0),t.bg)c.globalCompositeOperation="destination-over",c.fillStyle=t.bg,c.fillRect(0,0,i,s)}return h};function Bm(t,e){var r=atob(t),a=new ArrayBuffer(r.length),n=new Uint8Array(a);for(var i=0;i<r.length;i++)n[i]=r.charCodeAt(i);return new Blob([a],{type:e})}function cf(t){var e=t.indexOf(",");return t.substr(e+1)}function th(t,e,r){var a=function(){return e.toDataURL(r,t.quality)};switch(t.output){case"blob-promise":return new ga(function(n,i){try{e.toBlob(function(s){if(s!=null)n(s);else i(Error("`canvas.toBlob()` sent a null value in its callback"))},r,t.quality)}catch(s){i(s)}});case"blob":return Bm(cf(a()),r);case"base64":return cf(a());case"base64uri":default:return a()}}sn.png=function(t){return th(t,this.bufferCanvasImage(t),"image/png")};sn.jpg=function(t){return th(t,this.bufferCanvasImage(t),"image/jpeg")};var rh={};rh.nodeShapeImpl=function(t,e,r,a,n,i,s,o){switch(t){case"ellipse":return this.drawEllipsePath(e,r,a,n,i);case"polygon":return this.drawPolygonPath(e,r,a,n,i,s);case"round-polygon":return this.drawRoundPolygonPath(e,r,a,n,i,s,o);case"roundrectangle":case"round-rectangle":return this.drawRoundRectanglePath(e,r,a,n,i,o);case"cutrectangle":case"cut-rectangle":return this.drawCutRectanglePath(e,r,a,n,i,s,o);case"bottomroundrectangle":case"bottom-round-rectangle":return this.drawBottomRoundRectanglePath(e,r,a,n,i,o);case"barrel":return this.drawBarrelPath(e,r,a,n,i)}};var km=ah,qe=ah.prototype;qe.CANVAS_LAYERS=3;qe.SELECT_BOX=0;qe.DRAG=1;qe.NODE=2;qe.WEBGL=3;qe.CANVAS_TYPES=["2d","2d","2d","webgl2"];qe.BUFFER_COUNT=3;qe.TEXTURE_BUFFER=0;qe.MOTIONBLUR_BUFFER_NODE=1;qe.MOTIONBLUR_BUFFER_DRAG=2;function ah(t){var e=this,r=e.cy.window(),a=r.document;if(t.webgl)qe.CANVAS_LAYERS=e.CANVAS_LAYERS=4,console.log("webgl rendering enabled");e.data={canvases:Array(qe.CANVAS_LAYERS),contexts:Array(qe.CANVAS_LAYERS),canvasNeedsRedraw:Array(qe.CANVAS_LAYERS),bufferCanvases:Array(qe.BUFFER_COUNT),bufferContexts:Array(qe.CANVAS_LAYERS)};var n="-webkit-tap-highlight-color",i="rgba(0,0,0,0)";e.data.canvasContainer=a.createElement("div");var s=e.data.canvasContainer.style;e.data.canvasContainer.style[n]=i,s.position="relative",s.zIndex="0",s.overflow="hidden";var o=t.cy.container();o.appendChild(e.data.canvasContainer),o.style[n]=i;var l={"-webkit-user-select":"none","-moz-user-select":"-moz-none","user-select":"none","-webkit-tap-highlight-color":"rgba(0,0,0,0)","outline-style":"none"};if(Dh())l["-ms-touch-action"]="none",l["touch-action"]="none";for(var u=0;u<qe.CANVAS_LAYERS;u++){var f=e.data.canvases[u]=a.createElement("canvas"),v=qe.CANVAS_TYPES[u];if(e.data.contexts[u]=f.getContext(v),!e.data.contexts[u])it("Could not create canvas of type "+v);Object.keys(l).forEach(function(Z){f.style[Z]=l[Z]}),f.style.position="absolute",f.setAttribute("data-id","layer"+u),f.style.zIndex=String(qe.CANVAS_LAYERS-u),e.data.canvasContainer.appendChild(f),e.data.canvasNeedsRedraw[u]=!1}if(e.data.topCanvas=e.data.canvases[0],e.data.canvases[qe.NODE].setAttribute("data-id","layer"+qe.NODE+"-node"),e.data.canvases[qe.SELECT_BOX].setAttribute("data-id","layer"+qe.SELECT_BOX+"-selectbox"),e.data.canvases[qe.DRAG].setAttribute("data-id","layer"+qe.DRAG+"-drag"),e.data.canvases[qe.WEBGL])e.data.canvases[qe.WEBGL].setAttribute("data-id","layer"+qe.WEBGL+"-webgl");for(var u=0;u<qe.BUFFER_COUNT;u++)e.data.bufferCanvases[u]=a.createElement("canvas"),e.data.bufferContexts[u]=e.data.bufferCanvases[u].getContext("2d"),e.data.bufferCanvases[u].style.position="absolute",e.data.bufferCanvases[u].setAttribute("data-id","buffer"+u),e.data.bufferCanvases[u].style.zIndex=String(-u-1),e.data.bufferCanvases[u].style.visibility="hidden";e.pathsEnabled=!0;var h=Ot(),c=function(U){return{x:(U.x1+U.x2)/2,y:(U.y1+U.y2)/2}},d=function(U){return{x:-U.w/2,y:-U.h/2}},g=function(U){var W=U[0]._private,j=W.oldBackgroundTimestamp===W.backgroundTimestamp;return!j},y=function(U){return U[0]._private.nodeKey},p=function(U){return U[0]._private.labelStyleKey},m=function(U){return U[0]._private.sourceLabelStyleKey},b=function(U){return U[0]._private.targetLabelStyleKey},E=function(U,W,j,re,ee){return e.drawElement(U,W,j,!1,!1,ee)},A=function(U,W,j,re,ee){return e.drawElementText(U,W,j,re,"main",ee)},M=function(U,W,j,re,ee){return e.drawElementText(U,W,j,re,"source",ee)},S=function(U,W,j,re,ee){return e.drawElementText(U,W,j,re,"target",ee)},P=function(U){return U.boundingBox(),U[0]._private.bodyBounds},N=function(U){return U.boundingBox(),U[0]._private.labelBounds.main||h},R=function(U){return U.boundingBox(),U[0]._private.labelBounds.source||h},I=function(U){return U.boundingBox(),U[0]._private.labelBounds.target||h},w=function(U,W){return W},x=function(U){return c(P(U))},T=function(U,W,j){var re=U?U+"-":"";return{x:W.x+j.pstyle(re+"text-margin-x").pfValue,y:W.y+j.pstyle(re+"text-margin-y").pfValue}},D=function(U,W,j){var re=U[0]._private.rscratch;return{x:re[W],y:re[j]}},C=function(U){return T("",D(U,"labelX","labelY"),U)},O=function(U){return T("source",D(U,"sourceLabelX","sourceLabelY"),U)},B=function(U){return T("target",D(U,"targetLabelX","targetLabelY"),U)},z=function(U){return d(P(U))},V=function(U){return d(R(U))},k=function(U){return d(I(U))},G=function(U){var W=N(U),j=d(N(U));if(U.isNode()){switch(ha(U.pstyle("text-halign").value)){case"left":j.x=-W.w-(W.leftPad||0);break;case"right":j.x=-(W.rightPad||0);break}switch(ca(U.pstyle("text-valign").value)){case"top":j.y=-W.h-(W.topPad||0);break;case"bottom":j.y=-(W.botPad||0);break}}return j},J=e.data.eleTxrCache=new Ia(e,{getKey:y,doesEleInvalidateKey:g,drawElement:E,getBoundingBox:P,getRotationPoint:x,getRotationOffset:z,allowEdgeTxrCaching:!1,allowParentTxrCaching:!1}),X=e.data.lblTxrCache=new Ia(e,{getKey:p,drawElement:A,getBoundingBox:N,getRotationPoint:C,getRotationOffset:G,isVisible:w}),_=e.data.slbTxrCache=new Ia(e,{getKey:m,drawElement:M,getBoundingBox:R,getRotationPoint:O,getRotationOffset:V,isVisible:w}),Q=e.data.tlbTxrCache=new Ia(e,{getKey:b,drawElement:S,getBoundingBox:I,getRotationPoint:B,getRotationOffset:k,isVisible:w}),q=e.data.lyrTxrCache=new Yv(e);e.onUpdateEleCalcs(function(U,W){J.invalidateElements(W),X.invalidateElements(W),_.invalidateElements(W),Q.invalidateElements(W),q.invalidateElements(W);for(var j=0;j<W.length;j++){var re=W[j]._private;re.oldBackgroundTimestamp=re.backgroundTimestamp}});var te=function(U){for(var W=0;W<U.length;W++)q.enqueueElementRefinement(U[W].ele)};if(J.onDequeue(te),X.onDequeue(te),_.onDequeue(te),Q.onDequeue(te),t.webgl)e.initWebgl(t,{getStyleKey:y,getLabelKey:p,getSourceLabelKey:m,getTargetLabelKey:b,drawElement:E,drawLabel:A,drawSourceLabel:M,drawTargetLabel:S,getElementBox:P,getLabelBox:N,getSourceLabelBox:R,getTargetLabelBox:I,getElementRotationPoint:x,getElementRotationOffset:z,getLabelRotationPoint:C,getSourceLabelRotationPoint:O,getTargetLabelRotationPoint:B,getLabelRotationOffset:G,getSourceLabelRotationOffset:V,getTargetLabelRotationOffset:k})}qe.redrawHint=function(t,e){var r=this;switch(t){case"eles":r.data.canvasNeedsRedraw[qe.NODE]=e;break;case"drag":r.data.canvasNeedsRedraw[qe.DRAG]=e;break;case"select":r.data.canvasNeedsRedraw[qe.SELECT_BOX]=e;break;case"gc":r.data.gc=!0;break}};var Fm=typeof Path2D<"u";qe.path2dEnabled=function(t){if(t===void 0)return this.pathsEnabled;this.pathsEnabled=t?!0:!1};qe.usePaths=function(){return Fm&&this.pathsEnabled};qe.setImgSmoothing=function(t,e){if(t.imageSmoothingEnabled!=null)t.imageSmoothingEnabled=e;else t.webkitImageSmoothingEnabled=e,t.mozImageSmoothingEnabled=e,t.msImageSmoothingEnabled=e};qe.getImgSmoothing=function(t){if(t.imageSmoothingEnabled!=null)return t.imageSmoothingEnabled;else return t.webkitImageSmoothingEnabled||t.mozImageSmoothingEnabled||t.msImageSmoothingEnabled};qe.makeOffscreenCanvas=function(t,e){var r;if((typeof OffscreenCanvas>"u"?"undefined":pt(OffscreenCanvas))!=="undefined")r=new OffscreenCanvas(t,e);else{var a=this.cy.window(),n=a.document;r=n.createElement("canvas"),r.width=t,r.height=e}return r};[Xv,tr,ur,Io,Wr,Pr,It,_v,Nr,sn,rh].forEach(function(t){Oe(qe,t)});var zm=[{name:"null",impl:Rv},{name:"base",impl:Uv},{name:"canvas",impl:km}],Vm=[{type:"layout",extensions:uy},{type:"renderer",extensions:zm}],nh={},ih={};function sh(t,e,r){var a=r,n=function(P){_e("Can not register `"+e+"` for `"+t+"` since `"+P+"` already exists in the prototype and can not be overridden")};if(t==="core")if(Wa.prototype[e])return n(e);else Wa.prototype[e]=r;else if(t==="collection")if(Ct.prototype[e])return n(e);else Ct.prototype[e]=r;else if(t==="layout"){var i=function(P){if(this.options=P,r.call(this,P),!We(this._private))this._private={};this._private.cy=P.cy,this._private.listeners=[],this.createEmitter()},s=i.prototype=Object.create(r.prototype),o=[];for(var l=0;l<o.length;l++){var u=o[l];s[u]=s[u]||function(){return this}}if(s.start&&!s.run)s.run=function(){return this.start(),this};else if(!s.start&&s.run)s.start=function(){return this.run(),this};var f=r.prototype.stop;if(s.stop=function(){var S=this.options;if(S&&S.animate){var P=this.animations;if(P)for(var N=0;N<P.length;N++)P[N].stop()}if(f)f.call(this);else this.emit("layoutstop");return this},!s.destroy)s.destroy=function(){return this};s.cy=function(){return this._private.cy};var v=function(P){return P._private.cy},h={addEventFields:function(P,N){N.layout=P,N.cy=v(P),N.target=P},bubble:function(){return!0},parent:function(P){return v(P)}};Oe(s,{createEmitter:function(){return this._private.emitter=new ii(h,this),this},emitter:function(){return this._private.emitter},on:function(P,N){return this.emitter().on(P,N),this},one:function(P,N){return this.emitter().one(P,N),this},once:function(P,N){return this.emitter().one(P,N),this},removeListener:function(P,N){return this.emitter().removeListener(P,N),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},emit:function(P,N){return this.emitter().emit(P,N),this}}),Ze.eventAliasesOn(s),a=i}else if(t==="renderer"&&e!=="null"&&e!=="base"){var c=oh("renderer","base"),d=c.prototype,g=r,y=r.prototype,p=function(){c.apply(this,arguments),g.apply(this,arguments)},m=p.prototype;for(var b in d){var E=d[b],A=y[b]!=null;if(A)return n(b);m[b]=E}for(var M in y)m[M]=y[M];d.clientFunctions.forEach(function(S){m[S]=m[S]||function(){it("Renderer does not implement `renderer."+S+"()` on its prototype")}}),a=p}else if(t==="__proto__"||t==="constructor"||t==="prototype")return it(t+" is an illegal type to be registered, possibly lead to prototype pollutions");return Tf({map:nh,keys:[t,e],value:a})}function oh(t,e){return Cf({map:nh,keys:[t,e]})}function Gm(t,e,r,a,n){return Tf({map:ih,keys:[t,e,r,a],value:n})}function Um(t,e,r,a){return Cf({map:ih,keys:[t,e,r,a]})}var lo=function(){if(arguments.length===2)return oh.apply(null,arguments);else if(arguments.length===3)return sh.apply(null,arguments);else if(arguments.length===4)return Um.apply(null,arguments);else if(arguments.length===5)return Gm.apply(null,arguments);else it("Invalid extension access syntax")};Wa.prototype.extension=lo;Vm.forEach(function(t){t.extensions.forEach(function(e){sh(t.type,e.name,e.impl)})});var Kn=function(){if(!(this instanceof Kn))return new Kn;this.length=0},Yr=Kn.prototype;Yr.instanceString=function(){return"stylesheet"};Yr.selector=function(t){var e=this.length++;return this[e]={selector:t,properties:[]},this};Yr.css=function(t,e){var r=this.length-1;if(Re(t))this[r].properties.push({name:t,value:e});else if(We(t)){var a=t,n=Object.keys(a);for(var i=0;i<n.length;i++){var s=n[i],o=a[s];if(o==null)continue;var l=wt.properties[s]||wt.properties[Zn(s)];if(l==null)continue;var u=l.name,f=o;this[r].properties.push({name:u,value:f})}}return this};Yr.style=Yr.css;Yr.generateStyle=function(t){var e=new wt(t);return this.appendToStyle(e)};Yr.appendToStyle=function(t){for(var e=0;e<this.length;e++){var r=this[e],{selector:a,properties:n}=r;t.selector(a);for(var i=0;i<n.length;i++){var s=n[i];t.css(s.name,s.value)}}return t};var Hm="3.34.4",mt=function(e){if(e===void 0)e={};if(We(e))return new Wa(e);else if(Re(e))return lo.apply(lo,arguments)};mt.use=function(t){var e=Array.prototype.slice.call(arguments,1);return e.unshift(mt),t.apply(null,e),this};mt.warnings=function(t){return Pf(t)};mt.version=Hm;mt.stylesheet=mt.Stylesheet=Kn;
332
- export{mt,vr};
331
+ `),o=tm(a,n,s);o.aPosition=a.getAttribLocation(o,"aPosition"),o.aIndex=a.getAttribLocation(o,"aIndex"),o.aVertType=a.getAttribLocation(o,"aVertType"),o.aTransform=a.getAttribLocation(o,"aTransform"),o.aAtlasId=a.getAttribLocation(o,"aAtlasId"),o.aTex=a.getAttribLocation(o,"aTex"),o.aPointAPointB=a.getAttribLocation(o,"aPointAPointB"),o.aPointCPointD=a.getAttribLocation(o,"aPointCPointD"),o.aLineWidth=a.getAttribLocation(o,"aLineWidth"),o.aColor=a.getAttribLocation(o,"aColor"),o.aCornerRadius=a.getAttribLocation(o,"aCornerRadius"),o.aBorderColor=a.getAttribLocation(o,"aBorderColor"),o.uPanZoomMatrix=a.getUniformLocation(o,"uPanZoomMatrix"),o.uAtlasSize=a.getUniformLocation(o,"uAtlasSize"),o.uBGColor=a.getUniformLocation(o,"uBGColor"),o.uZoom=a.getUniformLocation(o,"uZoom"),o.uTextures=[];for(var l=0;l<this.batchManager.getMaxAtlasesPerBatch();l++)o.uTextures.push(a.getUniformLocation(o,"uTexture".concat(l)));return o}},{key:"_createVAO",value:function(){var r=[0,0,1,0,1,1,0,0,1,1,0,1];this.vertexCount=r.length/2;var a=this.maxInstances,n=this.gl,i=this.program,s=n.createVertexArray();return n.bindVertexArray(s),fm(n,"vec2",i.aPosition,r),this.transformBuffer=vm(n,a,i.aTransform),this.indexBuffer=Zt(n,a,"vec4",i.aIndex),this.vertTypeBuffer=Zt(n,a,"int",i.aVertType),this.atlasIdBuffer=Zt(n,a,"int",i.aAtlasId),this.texBuffer=Zt(n,a,"vec4",i.aTex),this.pointAPointBBuffer=Zt(n,a,"vec4",i.aPointAPointB),this.pointCPointDBuffer=Zt(n,a,"vec4",i.aPointCPointD),this.lineWidthBuffer=Zt(n,a,"vec2",i.aLineWidth),this.colorBuffer=Zt(n,a,"vec4",i.aColor),this.cornerRadiusBuffer=Zt(n,a,"vec4",i.aCornerRadius),this.borderColorBuffer=Zt(n,a,"vec4",i.aBorderColor),n.bindVertexArray(null),s}},{key:"buffers",get:function(){var r=this;if(!this._buffers)this._buffers=Object.keys(this).filter(function(a){return yr(a,"Buffer")}).map(function(a){return r[a]});return this._buffers}},{key:"startFrame",value:function(r){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Fa.SCREEN;this.panZoomMatrix=r,this.renderTarget=a,this.batchDebugInfo=[],this.wrappedCount=0,this.simpleCount=0,this.startBatch()}},{key:"startBatch",value:function(){this.instanceCount=0,this.batchManager.startBatch()}},{key:"endFrame",value:function(){this.endBatch()}},{key:"_isVisible",value:function(r,a){if(r.visible()){if(a&&a.isVisible)return a.isVisible(r);return!0}return!1}},{key:"drawTexture",value:function(r,a,n){var i=this.atlasManager,s=this.batchManager,o=i.getRenderTypeOpts(n);if(!this._isVisible(r,o))return;if(r.isEdge()&&!this._isValidEdge(r))return;if(this.renderTarget.picking&&o.getTexPickingMode){var l=o.getTexPickingMode(r);if(l===$n.IGNORE)return;else if(l==$n.USE_BB){this.drawPickingRectangle(r,a,n);return}}var u=i.getAtlasInfo(r,n),f=kt(u),v;try{for(f.s();!(v=f.n()).done;){var h=v.value,{atlas:c,tex1:d,tex2:g}=h;if(!s.canAddToCurrentBatch(c))this.endBatch();var y=s.getAtlasIndexForBatch(c);for(var p=0,m=[[d,!0],[g,!1]];p<m.length;p++){var b=ct(m[p],2),E=b[0],A=b[1];if(E.w!=0){var M=this.instanceCount;this.vertTypeBuffer.getView(M)[0]=Vs;var S=this.indexBuffer.getView(M);jr(a,S);var P=this.atlasIdBuffer.getView(M);P[0]=y;var N=this.texBuffer.getView(M);N[0]=E.x,N[1]=E.y,N[2]=E.w,N[3]=E.h;var R=this.transformBuffer.getMatrixView(M);if(this.setTransformMatrix(r,R,o,h,A),this.instanceCount++,!A)this.wrappedCount++;if(this.instanceCount>=this.maxInstances)this.endBatch()}}}}catch(I){f.e(I)}finally{f.f()}}},{key:"setTransformMatrix",value:function(r,a,n,i){var s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=0;if(n.shapeProps&&n.shapeProps.padding)o=r.pstyle(n.shapeProps.padding).pfValue;if(i){var{bb:l,tex1:u,tex2:f}=i,v=u.w/(u.w+f.w);if(!s)v=1-v;var h=this._getAdjustedBB(l,o,s,v);this._applyTransformMatrix(a,h,n,r)}else{var c=n.getBoundingBox(r),d=this._getAdjustedBB(c,o,!0,1);this._applyTransformMatrix(a,d,n,r)}}},{key:"_applyTransformMatrix",value:function(r,a,n,i){var s,o;of(r);var l=n.getRotation?n.getRotation(i):0;if(l!==0){var u=n.getRotationPoint(i),{x:f,y:v}=u;In(r,r,[f,v]),uf(r,r,l);var h=n.getRotationOffset(i);s=h.x+(a.xOffset||0),o=h.y+(a.yOffset||0)}else s=a.x1,o=a.y1;In(r,r,[s,o]),so(r,r,[a.w,a.h])}},{key:"_getAdjustedBB",value:function(r,a,n,i){var{x1:s,y1:o,w:l,h:u,yOffset:f}=r;if(a)s-=a,o-=a,l+=2*a,u+=2*a;var v=0,h=l*i;if(n&&i<1)l=h;else if(!n&&i<1)v=l-h,s+=v,l=h;return{x1:s,y1:o,w:l,h:u,xOffset:v,yOffset:f}}},{key:"drawPickingRectangle",value:function(r,a,n){var i=this.atlasManager.getRenderTypeOpts(n),s=this.instanceCount;this.vertTypeBuffer.getView(s)[0]=ea;var o=this.indexBuffer.getView(s);jr(a,o);var l=this.colorBuffer.getView(s);Ir([0,0,0],1,l);var u=this.transformBuffer.getMatrixView(s);if(this.setTransformMatrix(r,u,i),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances)this.endBatch()}},{key:"drawNode",value:function(r,a,n){var i=this.simpleShapeOptions.get(n);if(!this._isVisible(r,i))return;var s=i.shapeProps,o=this._getVertTypeForShape(r,s.shape);if(o===void 0||i.isSimple&&!i.isSimple(r,this.renderTarget)){this.drawTexture(r,a,n);return}var l=this.instanceCount;if(this.vertTypeBuffer.getView(l)[0]=o,o===Tn||o===Ra){var u=i.getBoundingBox(r),f=this._getCornerRadius(r,s.radius,u),v=this.cornerRadiusBuffer.getView(l);if(v[0]=f,v[1]=f,v[2]=f,v[3]=f,o===Ra)v[0]=0,v[2]=0}var h=this.indexBuffer.getView(l);jr(a,h);var c=this.renderTarget.picking?1:n==="node-body"?r.effectiveOpacity():1,d=this.renderTarget.picking?1:r.pstyle(s.opacity).value*c,g=r.pstyle(s.color).value,y=this.colorBuffer.getView(l);Ir(g,d,y);var p=this.lineWidthBuffer.getView(l);if(p[0]=0,p[1]=0,s.border){var m=r.pstyle("border-width").value;if(m>0){var b=r.pstyle("border-color").value,E=c*r.pstyle("border-opacity").value,A=this.borderColorBuffer.getView(l);Ir(b,E,A);var M=r.pstyle("border-position").value;if(M==="inside")p[0]=0,p[1]=-m;else if(M==="outside")p[0]=m,p[1]=0;else{var S=m/2;p[0]=S,p[1]=-S}}}var P=this.transformBuffer.getMatrixView(l);if(this.setTransformMatrix(r,P,i),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances)this.endBatch()}},{key:"_getVertTypeForShape",value:function(r,a){var n=r.pstyle(a).value;switch(n){case"rectangle":return ea;case"ellipse":return Pa;case"roundrectangle":case"round-rectangle":return Tn;case"bottom-round-rectangle":return Ra;default:return}}},{key:"_getCornerRadius",value:function(r,a,n){var{w:i,h:s}=n;if(r.pstyle(a).value==="auto")return Cr(i,s);else{var o=r.pstyle(a).pfValue,l=i/2,u=s/2;return Math.min(o,u,l)}}},{key:"drawEdgeArrow",value:function(r,a,n){if(!r.visible())return;var i=r._private.rscratch,s,o,l;if(n==="source")s=i.arrowStartX,o=i.arrowStartY,l=i.srcArrowAngle;else s=i.arrowEndX,o=i.arrowEndY,l=i.tgtArrowAngle;if(isNaN(s)||s==null||isNaN(o)||o==null||isNaN(l)||l==null)return;var u=r.pstyle(n+"-arrow-shape").value;if(u==="none")return;var f=r.pstyle(n+"-arrow-color").value,v=r.pstyle("opacity").value,h=r.pstyle("line-opacity").value,c=v*h,d=r.pstyle("width").pfValue,g=r.pstyle("arrow-scale").value,y=this.r.getArrowWidth(d,g),p=this.instanceCount,m=this.transformBuffer.getMatrixView(p);of(m),In(m,m,[s,o]),so(m,m,[y,y]),uf(m,m,l),this.vertTypeBuffer.getView(p)[0]=Gs;var b=this.indexBuffer.getView(p);jr(a,b);var E=this.colorBuffer.getView(p);if(Ir(f,c,E),this.instanceCount++,this.instanceCount>=this.maxInstances)this.endBatch()}},{key:"drawEdgeLine",value:function(r,a){if(!r.visible())return;var n=this._getEdgePoints(r);if(!n)return;var i=r.pstyle("opacity").value,s=r.pstyle("line-opacity").value,o=r.pstyle("width").pfValue,l=r.pstyle("line-color").value,u=i*s;if(n.length/2+this.instanceCount>this.maxInstances)this.endBatch();if(n.length==4){var f=this.instanceCount;this.vertTypeBuffer.getView(f)[0]=lf;var v=this.indexBuffer.getView(f);jr(a,v);var h=this.colorBuffer.getView(f);Ir(l,u,h);var c=this.lineWidthBuffer.getView(f);c[0]=o;var d=this.pointAPointBBuffer.getView(f);if(d[0]=n[0],d[1]=n[1],d[2]=n[2],d[3]=n[3],this.instanceCount++,this.instanceCount>=this.maxInstances)this.endBatch()}else for(var g=0;g<n.length-2;g+=2){var y=this.instanceCount;this.vertTypeBuffer.getView(y)[0]=ff;var p=this.indexBuffer.getView(y);jr(a,p);var m=this.colorBuffer.getView(y);Ir(l,u,m);var b=this.lineWidthBuffer.getView(y);b[0]=o;var E=n[g-2],A=n[g-1],M=n[g],S=n[g+1],P=n[g+2],N=n[g+3],R=n[g+4],I=n[g+5];if(g==0)E=2*M-P+0.001,A=2*S-N+0.001;if(g==n.length-4)R=2*P-M+0.001,I=2*N-S+0.001;var w=this.pointAPointBBuffer.getView(y);w[0]=E,w[1]=A,w[2]=M,w[3]=S;var x=this.pointCPointDBuffer.getView(y);if(x[0]=P,x[1]=N,x[2]=R,x[3]=I,this.instanceCount++,this.instanceCount>=this.maxInstances)this.endBatch()}}},{key:"_isValidEdge",value:function(r){var a=r._private.rscratch;if(a.badLine||a.allpts==null||isNaN(a.allpts[0]))return!1;return!0}},{key:"_getEdgePoints",value:function(r){var a=r._private.rscratch;if(!this._isValidEdge(r))return;var n=a.allpts;if(n.length==4)return n;var i=this._getNumSegments(r);return this._getCurveSegmentPoints(n,i)}},{key:"_getNumSegments",value:function(r){var a=15;return Math.min(Math.max(a,5),this.maxInstances)}},{key:"_getCurveSegmentPoints",value:function(r,a){if(r.length==4)return r;var n=Array((a+1)*2);for(var i=0;i<=a;i++)if(i==0)n[0]=r[0],n[1]=r[1];else if(i==a)n[i*2]=r[r.length-2],n[i*2+1]=r[r.length-1];else{var s=i/a;this._setCurvePoint(r,s,n,i*2)}return n}},{key:"_setCurvePoint",value:function(r,a,n,i){if(r.length<=2)n[i]=r[0],n[i+1]=r[1];else{var s=Array(r.length-2);for(var o=0;o<s.length;o+=2){var l=(1-a)*r[o]+a*r[o+2],u=(1-a)*r[o+1]+a*r[o+3];s[o]=l,s[o+1]=u}return this._setCurvePoint(s,a,n,i)}}},{key:"endBatch",value:function(){var r=this.gl,a=this.vao,n=this.vertexCount,i=this.instanceCount;if(i===0)return;var s=this.renderTarget.picking?this.pickingProgram:this.program;r.useProgram(s),r.bindVertexArray(a);var o=kt(this.buffers),l;try{for(o.s();!(l=o.n()).done;){var u=l.value;u.bufferSubData(i)}}catch(d){o.e(d)}finally{o.f()}var f=this.batchManager.getAtlases();for(var v=0;v<f.length;v++)f[v].bufferIfNeeded(r);for(var h=0;h<f.length;h++)r.activeTexture(r.TEXTURE0+h),r.bindTexture(r.TEXTURE_2D,f[h].texture),r.uniform1i(s.uTextures[h],h);r.uniform1f(s.uZoom,am(this.r)),r.uniformMatrix3fv(s.uPanZoomMatrix,!1,this.panZoomMatrix),r.uniform1i(s.uAtlasSize,this.batchManager.getAtlasSize());var c=Ir(this.bgColor,1);if(r.uniform4fv(s.uBGColor,c),r.drawArraysInstanced(r.TRIANGLES,0,n,i),r.bindVertexArray(null),r.bindTexture(r.TEXTURE_2D,null),this.debug)this.batchDebugInfo.push({count:i,atlasCount:f.length});this.startBatch()}},{key:"getDebugInfo",value:function(){var r=this.atlasManager.getDebugInfo(),a=r.reduce(function(s,o){return s+o.atlasCount},0),n=this.batchDebugInfo,i=n.reduce(function(s,o){return s+o.count},0);return{atlasInfo:r,totalAtlases:a,wrappedCount:this.wrappedCount,simpleCount:this.simpleCount,batchCount:n.length,batchInfo:n,totalInstances:i}}}])}(),_v={};_v.initWebgl=function(t,e){var r=this,a=r.data.contexts[r.WEBGL];t.bgColor=Sm(r),t.webglTexSize=Math.min(t.webglTexSize,a.getParameter(a.MAX_TEXTURE_SIZE)),t.webglTexRows=Math.min(t.webglTexRows,54),t.webglTexRowsNodes=Math.min(t.webglTexRowsNodes,54),t.webglBatchSize=Math.min(t.webglBatchSize,16384),t.webglTexPerBatch=Math.min(t.webglTexPerBatch,a.getParameter(a.MAX_TEXTURE_IMAGE_UNITS)),r.webglDebug=t.webglDebug,r.webglDebugShowAtlases=t.webglDebugShowAtlases,r.pickingFrameBuffer=hm(a),r.pickingFrameBuffer.needsDraw=!0,r.drawing=new Cm(r,a,t);var n=function(v){return function(h){return r.getTextAngle(h,v)}},i=function(v){return function(h){var c=h.pstyle(v);return c&&c.value}},s=function(v){return function(h){return h.pstyle("".concat(v,"-opacity")).value>0}},o=function(v){var h=v.pstyle("text-events").strValue==="yes";return h?$n.USE_BB:$n.IGNORE},l=function(v){var h=v.position(),{x:c,y:d}=h,g=v.outerWidth(),y=v.outerHeight();return{w:g,h:y,x1:c-g/2,y1:d-y/2}};r.drawing.addAtlasCollection("node",{texRows:t.webglTexRowsNodes}),r.drawing.addAtlasCollection("label",{texRows:t.webglTexRows}),r.drawing.addTextureAtlasRenderType("node-body",{collection:"node",getKey:e.getStyleKey,getBoundingBox:e.getElementBox,drawElement:e.drawElement}),r.drawing.addSimpleShapeRenderType("node-body",{getBoundingBox:l,isSimple:im,shapeProps:{shape:"shape",color:"background-color",opacity:"background-opacity",radius:"corner-radius",border:!0}}),r.drawing.addSimpleShapeRenderType("node-overlay",{getBoundingBox:l,isVisible:s("overlay"),shapeProps:{shape:"overlay-shape",color:"overlay-color",opacity:"overlay-opacity",padding:"overlay-padding",radius:"overlay-corner-radius"}}),r.drawing.addSimpleShapeRenderType("node-underlay",{getBoundingBox:l,isVisible:s("underlay"),shapeProps:{shape:"underlay-shape",color:"underlay-color",opacity:"underlay-opacity",padding:"underlay-padding",radius:"underlay-corner-radius"}}),r.drawing.addTextureAtlasRenderType("label",{collection:"label",getTexPickingMode:o,getKey:Us(e.getLabelKey,null),getBoundingBox:Hs(e.getLabelBox,null),drawClipped:!0,drawElement:e.drawLabel,getRotation:n(null),getRotationPoint:e.getLabelRotationPoint,getRotationOffset:e.getLabelRotationOffset,isVisible:i("label")}),r.drawing.addTextureAtlasRenderType("edge-source-label",{collection:"label",getTexPickingMode:o,getKey:Us(e.getSourceLabelKey,"source"),getBoundingBox:Hs(e.getSourceLabelBox,"source"),drawClipped:!0,drawElement:e.drawSourceLabel,getRotation:n("source"),getRotationPoint:e.getSourceLabelRotationPoint,getRotationOffset:e.getSourceLabelRotationOffset,isVisible:i("source-label")}),r.drawing.addTextureAtlasRenderType("edge-target-label",{collection:"label",getTexPickingMode:o,getKey:Us(e.getTargetLabelKey,"target"),getBoundingBox:Hs(e.getTargetLabelBox,"target"),drawClipped:!0,drawElement:e.drawTargetLabel,getRotation:n("target"),getRotationPoint:e.getTargetLabelRotationPoint,getRotationOffset:e.getTargetLabelRotationOffset,isVisible:i("target-label")});var u=ja(function(){console.log("garbage collect flag set"),r.data.gc=!0},1e4);r.onUpdateEleCalcs(function(f,v){var h=!1;if(v&&v.length>0)h|=r.drawing.invalidate(v);if(h)u()}),Dm(r)};function Sm(t){var e=t.cy.container(),r=e&&e.style&&e.style.backgroundColor||"white";return xf(r)}function Qv(t,e){var r=t._private.rscratch;return Nt(r,"labelWrapCachedLines",e)||[]}var Us=function(e,r){return function(a){var n=e(a),i=Qv(a,r);if(i.length>1)return i.map(function(s,o){return"".concat(n,"_").concat(o)});return n}},Hs=function(e,r){return function(a,n){var i=e(a);if(typeof n==="string"){var s=n.indexOf("_");if(s>0){var o=Number(n.substring(s+1)),l=Qv(a,r),u=i.h/l.length,f=u*o,v=i.y1+f;return{x1:i.x1,w:i.w,y1:v,h:u,yOffset:f}}}return i}};function Dm(t){{var e=t.render;t.render=function(i){i=i||{};var s=t.cy;if(t.webgl)if(s.zoom()>qv)Am(t),e.call(t,i);else Mm(t),jv(t,i,Fa.SCREEN)}}{var r=t.matchCanvasSize;t.matchCanvasSize=function(i){r.call(t,i),t.pickingFrameBuffer.setFramebufferAttachmentSizes(t.canvasWidth,t.canvasHeight),t.pickingFrameBuffer.needsDraw=!0}}t.findNearestElements=function(i,s,o,l){return Im(t,i,s)};{var a=t.invalidateCachedZSortedEles;t.invalidateCachedZSortedEles=function(){a.call(t),t.pickingFrameBuffer.needsDraw=!0}}{var n=t.notify;t.notify=function(i,s){if(n.call(t,i,s),i==="viewport"||i==="bounds")t.pickingFrameBuffer.needsDraw=!0;else if(i==="background")t.drawing.invalidate(s,{type:"node-body"})}}}function Am(t){var e=t.data.contexts[t.WEBGL];e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT)}function Mm(t){var e=function(a){a.save(),a.setTransform(1,0,0,1,0,0),a.clearRect(0,0,t.canvasWidth,t.canvasHeight),a.restore()};e(t.data.contexts[t.NODE]),e(t.data.contexts[t.DRAG])}function Lm(t){var{canvasWidth:e,canvasHeight:r}=t,a=Bo(t),{pan:n,zoom:i}=a,s=zs();In(s,s,[n.x,n.y]),so(s,s,[i,i]);var o=zs();dm(o,e,r);var l=zs();return cm(l,o,s),l}function Jv(t,e){var{canvasWidth:r,canvasHeight:a}=t,n=Bo(t),{pan:i,zoom:s}=n;e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,r,a),e.translate(i.x,i.y),e.scale(s,s)}function Rm(t,e){t.drawSelectionRectangle(e,function(r){return Jv(t,r)})}function Pm(t){var e=t.data.contexts[t.NODE];e.save(),Jv(t,e),e.strokeStyle="rgba(0, 0, 0, 0.3)",e.beginPath(),e.moveTo(-1000,0),e.lineTo(1000,0),e.stroke(),e.beginPath(),e.moveTo(0,-1000),e.lineTo(0,1000),e.stroke(),e.restore()}function Nm(t){var e=function(n,i,s){var o=n.atlasManager.getAtlasCollection(i),l=t.data.contexts[t.NODE],u=o.atlases;for(var f=0;f<u.length;f++){var v=u[f],h=v.canvas;if(h){var{width:c,height:d}=h,g=c*f,y=h.height*s,p=0.4;l.save(),l.scale(p,p),l.drawImage(h,g,y),l.strokeStyle="black",l.rect(g,y,c,d),l.stroke(),l.restore()}}},r=0;e(t.drawing,"node",r++),e(t.drawing,"label",r++)}function Om(t,e,r,a,n){var i,s,o,l,u=Bo(t),{pan:f,zoom:v}=u;{var h=nm(t,f,v,e,r),c=ct(h,2),d=c[0],g=c[1],y=6;i=d-y/2,s=g-y/2,o=y,l=y}if(o===0||l===0)return[];var p=t.data.contexts[t.WEBGL];if(p.bindFramebuffer(p.FRAMEBUFFER,t.pickingFrameBuffer),t.pickingFrameBuffer.needsDraw)p.viewport(0,0,p.canvas.width,p.canvas.height),jv(t,null,Fa.PICKING),t.pickingFrameBuffer.needsDraw=!1;var m=o*l,b=new Uint8Array(m*4);p.readPixels(i,s,o,l,p.RGBA,p.UNSIGNED_BYTE,b),p.bindFramebuffer(p.FRAMEBUFFER,null);var E=new Set;for(var A=0;A<m;A++){var M=b.slice(A*4,A*4+4),S=om(M)-1;if(S>=0)E.add(S)}return E}function Im(t,e,r){var a=Om(t,e,r),n=t.getCachedZSortedEles(),i,s,o=kt(a),l;try{for(o.s();!(l=o.n()).done;){var u=l.value,f=n[u];if(!i&&f.isNode())i=f;if(!s&&f.isEdge())s=f;if(i&&s)break}}catch(v){o.e(v)}finally{o.f()}return[i,s].filter(Boolean)}function qs(t,e,r){var a=t.drawing;if(e+=1,r.isNode())a.drawNode(r,e,"node-underlay"),a.drawNode(r,e,"node-body"),a.drawTexture(r,e,"label"),a.drawNode(r,e,"node-overlay");else a.drawEdgeLine(r,e),a.drawEdgeArrow(r,e,"source"),a.drawEdgeArrow(r,e,"target"),a.drawTexture(r,e,"label"),a.drawTexture(r,e,"edge-source-label"),a.drawTexture(r,e,"edge-target-label")}function jv(t,e,r){var a;if(t.webglDebug)a=performance.now();var n=t.drawing,i=0;if(r.screen){if(t.data.canvasNeedsRedraw[t.SELECT_BOX])Rm(t,e)}if(t.data.canvasNeedsRedraw[t.NODE]||r.picking){var s=t.data.contexts[t.WEBGL];if(r.screen)s.clearColor(0,0,0,0),s.enable(s.BLEND),s.blendFunc(s.ONE,s.ONE_MINUS_SRC_ALPHA);else s.disable(s.BLEND);s.clear(s.COLOR_BUFFER_BIT|s.DEPTH_BUFFER_BIT),s.viewport(0,0,s.canvas.width,s.canvas.height);var o=Lm(t),l=t.getCachedZSortedEles();if(i=l.length,n.startFrame(o,r),r.screen){for(var u=0;u<l.nondrag.length;u++)qs(t,u,l.nondrag[u]);for(var f=0;f<l.drag.length;f++)qs(t,f,l.drag[f])}else if(r.picking)for(var v=0;v<l.length;v++)qs(t,v,l[v]);if(n.endFrame(),r.screen&&t.webglDebugShowAtlases)Pm(t),Nm(t);t.data.canvasNeedsRedraw[t.NODE]=!1,t.data.canvasNeedsRedraw[t.DRAG]=!1}if(t.webglDebug){var h=performance.now(),c=!1,d=Math.ceil(h-a),g=n.getDebugInfo(),y=["".concat(i," elements"),"".concat(g.totalInstances," instances"),"".concat(g.batchCount," batches"),"".concat(g.totalAtlases," atlases"),"".concat(g.wrappedCount," wrapped textures"),"".concat(g.simpleCount," simple shapes")].join(", ");if(c)console.log("WebGL (".concat(r.name,") - time ").concat(d,"ms, ").concat(y));else{console.log("WebGL (".concat(r.name,") - frame time ").concat(d,"ms")),console.log("Totals:"),console.log(" ".concat(y)),console.log("Texture Atlases Used:");var p=g.atlasInfo,m=kt(p),b;try{for(m.s();!(b=m.n()).done;){var E=b.value;console.log(" ".concat(E.type,": ").concat(E.keyCount," keys, ").concat(E.atlasCount," atlases"))}}catch(A){m.e(A)}finally{m.f()}console.log("")}}if(t.data.gc)console.log("Garbage Collect!"),t.data.gc=!1,n.gc()}var Nr={};Nr.drawPolygonPath=function(t,e,r,a,n,i){var s=a/2,o=n/2;if(t.beginPath)t.beginPath();t.moveTo(e+s*i[0],r+o*i[1]);for(var l=1;l<i.length/2;l++)t.lineTo(e+s*i[l*2],r+o*i[l*2+1]);t.closePath()};Nr.drawRoundPolygonPath=function(t,e,r,a,n,i,s){s.forEach(function(o){return Ov(t,o)}),t.closePath()};Nr.drawRoundRectanglePath=function(t,e,r,a,n,i){var s=a/2,o=n/2,l=i==="auto"?Cr(a,n):Math.min(i,o,s);if(t.beginPath)t.beginPath();t.moveTo(e,r-o),t.arcTo(e+s,r-o,e+s,r,l),t.arcTo(e+s,r+o,e,r+o,l),t.arcTo(e-s,r+o,e-s,r,l),t.arcTo(e-s,r-o,e,r-o,l),t.lineTo(e,r-o),t.closePath()};Nr.drawBottomRoundRectanglePath=function(t,e,r,a,n,i){var s=a/2,o=n/2,l=i==="auto"?Cr(a,n):i;if(t.beginPath)t.beginPath();t.moveTo(e,r-o),t.lineTo(e+s,r-o),t.lineTo(e+s,r),t.arcTo(e+s,r+o,e,r+o,l),t.arcTo(e-s,r+o,e-s,r,l),t.lineTo(e-s,r-o),t.lineTo(e,r-o),t.closePath()};Nr.drawCutRectanglePath=function(t,e,r,a,n,i,s){var o=a/2,l=n/2,u=s==="auto"?Eo():s;if(t.beginPath)t.beginPath();t.moveTo(e-o+u,r-l),t.lineTo(e+o-u,r-l),t.lineTo(e+o,r-l+u),t.lineTo(e+o,r+l-u),t.lineTo(e+o-u,r+l),t.lineTo(e-o+u,r+l),t.lineTo(e-o,r+l-u),t.lineTo(e-o,r-l+u),t.closePath()};Nr.drawBarrelPath=function(t,e,r,a,n){var i=a/2,s=n/2,o=e-i,l=e+i,u=r-s,f=r+s,v=Ws(a,n),{widthOffset:h,heightOffset:c}=v,d=v.ctrlPtOffsetPct*h;if(t.beginPath)t.beginPath();t.moveTo(o,u+c),t.lineTo(o,f-c),t.quadraticCurveTo(o+d,f,o+h,f),t.lineTo(l-h,f),t.quadraticCurveTo(l-d,f,l,f-c),t.lineTo(l,u+c),t.quadraticCurveTo(l-d,u,l-h,u),t.lineTo(o+h,u),t.quadraticCurveTo(o+d,u,o,u+c),t.closePath()};var vf=Math.sin(0),hf=Math.cos(0),oo={},uo={},eh=Math.PI/40;for(dr=0*Math.PI;dr<2*Math.PI;dr+=eh)oo[dr]=Math.sin(dr),uo[dr]=Math.cos(dr);var dr;Nr.drawEllipsePath=function(t,e,r,a,n){if(t.beginPath)t.beginPath();if(t.ellipse)t.ellipse(e,r,a/2,n/2,0,0,2*Math.PI);else{var i,s,o=a/2,l=n/2;for(var u=0*Math.PI;u<2*Math.PI;u+=eh)if(i=e-o*oo[u]*vf+o*uo[u]*hf,s=r+l*uo[u]*vf+l*oo[u]*hf,u===0)t.moveTo(i,s);else t.lineTo(i,s)}t.closePath()};var sn={};sn.createBuffer=function(t,e){var r=document.createElement("canvas");return r.width=t,r.height=e,[r,r.getContext("2d")]};sn.bufferCanvasImage=function(t){var e=this.cy,r=e.mutableElements(),a=r.boundingBox(),n=this.findContainerClientCoords(),i=t.full?Math.ceil(a.w):n[2],s=t.full?Math.ceil(a.h):n[3],o=he(t.maxWidth)||he(t.maxHeight),l=this.getPixelRatio(),u=1;if(t.scale!==void 0)i*=t.scale,s*=t.scale,u=t.scale;else if(o){var f=1/0,v=1/0;if(he(t.maxWidth))f=u*t.maxWidth/i;if(he(t.maxHeight))v=u*t.maxHeight/s;u=Math.min(f,v),i*=u,s*=u}if(!o)i*=l,s*=l,u*=l;var h=document.createElement("canvas");h.width=i,h.height=s,h.style.width=i+"px",h.style.height=s+"px";var c=h.getContext("2d");if(i>0&&s>0){c.clearRect(0,0,i,s),c.globalCompositeOperation="source-over";var d=this.getCachedZSortedEles();if(t.full)c.translate(-a.x1*u,-a.y1*u),c.scale(u,u),this.drawElements(c,d);else{var g=e.pan(),y={x:g.x*u,y:g.y*u};u*=e.zoom(),c.translate(y.x,y.y),c.scale(u,u),this.drawElements(c,d)}if(c.setTransform(1,0,0,1,0,0),t.bg)c.globalCompositeOperation="destination-over",c.fillStyle=t.bg,c.fillRect(0,0,i,s)}return h};function Bm(t,e){var r=atob(t),a=new ArrayBuffer(r.length),n=new Uint8Array(a);for(var i=0;i<r.length;i++)n[i]=r.charCodeAt(i);return new Blob([a],{type:e})}function cf(t){var e=t.indexOf(",");return t.substr(e+1)}function th(t,e,r){var a=function(){return e.toDataURL(r,t.quality)};switch(t.output){case"blob-promise":return new ga(function(n,i){try{e.toBlob(function(s){if(s!=null)n(s);else i(Error("`canvas.toBlob()` sent a null value in its callback"))},r,t.quality)}catch(s){i(s)}});case"blob":return Bm(cf(a()),r);case"base64":return cf(a());case"base64uri":default:return a()}}sn.png=function(t){return th(t,this.bufferCanvasImage(t),"image/png")};sn.jpg=function(t){return th(t,this.bufferCanvasImage(t),"image/jpeg")};var rh={};rh.nodeShapeImpl=function(t,e,r,a,n,i,s,o){switch(t){case"ellipse":return this.drawEllipsePath(e,r,a,n,i);case"polygon":return this.drawPolygonPath(e,r,a,n,i,s);case"round-polygon":return this.drawRoundPolygonPath(e,r,a,n,i,s,o);case"roundrectangle":case"round-rectangle":return this.drawRoundRectanglePath(e,r,a,n,i,o);case"cutrectangle":case"cut-rectangle":return this.drawCutRectanglePath(e,r,a,n,i,s,o);case"bottomroundrectangle":case"bottom-round-rectangle":return this.drawBottomRoundRectanglePath(e,r,a,n,i,o);case"barrel":return this.drawBarrelPath(e,r,a,n,i)}};var km=ah,qe=ah.prototype;qe.CANVAS_LAYERS=3;qe.SELECT_BOX=0;qe.DRAG=1;qe.NODE=2;qe.WEBGL=3;qe.CANVAS_TYPES=["2d","2d","2d","webgl2"];qe.BUFFER_COUNT=3;qe.TEXTURE_BUFFER=0;qe.MOTIONBLUR_BUFFER_NODE=1;qe.MOTIONBLUR_BUFFER_DRAG=2;function ah(t){var e=this,r=e.cy.window(),a=r.document;if(t.webgl)qe.CANVAS_LAYERS=e.CANVAS_LAYERS=4,console.log("webgl rendering enabled");e.data={canvases:Array(qe.CANVAS_LAYERS),contexts:Array(qe.CANVAS_LAYERS),canvasNeedsRedraw:Array(qe.CANVAS_LAYERS),bufferCanvases:Array(qe.BUFFER_COUNT),bufferContexts:Array(qe.CANVAS_LAYERS)};var n="-webkit-tap-highlight-color",i="rgba(0,0,0,0)";e.data.canvasContainer=a.createElement("div");var s=e.data.canvasContainer.style;e.data.canvasContainer.style[n]=i,s.position="relative",s.zIndex="0",s.overflow="hidden";var o=t.cy.container();o.appendChild(e.data.canvasContainer),o.style[n]=i;var l={"-webkit-user-select":"none","-moz-user-select":"-moz-none","user-select":"none","-webkit-tap-highlight-color":"rgba(0,0,0,0)","outline-style":"none"};if(Dh())l["-ms-touch-action"]="none",l["touch-action"]="none";for(var u=0;u<qe.CANVAS_LAYERS;u++){var f=e.data.canvases[u]=a.createElement("canvas"),v=qe.CANVAS_TYPES[u];if(e.data.contexts[u]=f.getContext(v),!e.data.contexts[u])it("Could not create canvas of type "+v);Object.keys(l).forEach(function(Z){f.style[Z]=l[Z]}),f.style.position="absolute",f.setAttribute("data-id","layer"+u),f.style.zIndex=String(qe.CANVAS_LAYERS-u),e.data.canvasContainer.appendChild(f),e.data.canvasNeedsRedraw[u]=!1}if(e.data.topCanvas=e.data.canvases[0],e.data.canvases[qe.NODE].setAttribute("data-id","layer"+qe.NODE+"-node"),e.data.canvases[qe.SELECT_BOX].setAttribute("data-id","layer"+qe.SELECT_BOX+"-selectbox"),e.data.canvases[qe.DRAG].setAttribute("data-id","layer"+qe.DRAG+"-drag"),e.data.canvases[qe.WEBGL])e.data.canvases[qe.WEBGL].setAttribute("data-id","layer"+qe.WEBGL+"-webgl");for(var u=0;u<qe.BUFFER_COUNT;u++)e.data.bufferCanvases[u]=a.createElement("canvas"),e.data.bufferContexts[u]=e.data.bufferCanvases[u].getContext("2d"),e.data.bufferCanvases[u].style.position="absolute",e.data.bufferCanvases[u].setAttribute("data-id","buffer"+u),e.data.bufferCanvases[u].style.zIndex=String(-u-1),e.data.bufferCanvases[u].style.visibility="hidden";e.pathsEnabled=!0;var h=Ot(),c=function(U){return{x:(U.x1+U.x2)/2,y:(U.y1+U.y2)/2}},d=function(U){return{x:-U.w/2,y:-U.h/2}},g=function(U){var W=U[0]._private,j=W.oldBackgroundTimestamp===W.backgroundTimestamp;return!j},y=function(U){return U[0]._private.nodeKey},p=function(U){return U[0]._private.labelStyleKey},m=function(U){return U[0]._private.sourceLabelStyleKey},b=function(U){return U[0]._private.targetLabelStyleKey},E=function(U,W,j,re,ee){return e.drawElement(U,W,j,!1,!1,ee)},A=function(U,W,j,re,ee){return e.drawElementText(U,W,j,re,"main",ee)},M=function(U,W,j,re,ee){return e.drawElementText(U,W,j,re,"source",ee)},S=function(U,W,j,re,ee){return e.drawElementText(U,W,j,re,"target",ee)},P=function(U){return U.boundingBox(),U[0]._private.bodyBounds},N=function(U){return U.boundingBox(),U[0]._private.labelBounds.main||h},R=function(U){return U.boundingBox(),U[0]._private.labelBounds.source||h},I=function(U){return U.boundingBox(),U[0]._private.labelBounds.target||h},w=function(U,W){return W},x=function(U){return c(P(U))},T=function(U,W,j){var re=U?U+"-":"";return{x:W.x+j.pstyle(re+"text-margin-x").pfValue,y:W.y+j.pstyle(re+"text-margin-y").pfValue}},D=function(U,W,j){var re=U[0]._private.rscratch;return{x:re[W],y:re[j]}},C=function(U){return T("",D(U,"labelX","labelY"),U)},O=function(U){return T("source",D(U,"sourceLabelX","sourceLabelY"),U)},B=function(U){return T("target",D(U,"targetLabelX","targetLabelY"),U)},z=function(U){return d(P(U))},V=function(U){return d(R(U))},k=function(U){return d(I(U))},G=function(U){var W=N(U),j=d(N(U));if(U.isNode()){switch(ha(U.pstyle("text-halign").value)){case"left":j.x=-W.w-(W.leftPad||0);break;case"right":j.x=-(W.rightPad||0);break}switch(ca(U.pstyle("text-valign").value)){case"top":j.y=-W.h-(W.topPad||0);break;case"bottom":j.y=-(W.botPad||0);break}}return j},J=e.data.eleTxrCache=new Ia(e,{getKey:y,doesEleInvalidateKey:g,drawElement:E,getBoundingBox:P,getRotationPoint:x,getRotationOffset:z,allowEdgeTxrCaching:!1,allowParentTxrCaching:!1}),X=e.data.lblTxrCache=new Ia(e,{getKey:p,drawElement:A,getBoundingBox:N,getRotationPoint:C,getRotationOffset:G,isVisible:w}),_=e.data.slbTxrCache=new Ia(e,{getKey:m,drawElement:M,getBoundingBox:R,getRotationPoint:O,getRotationOffset:V,isVisible:w}),Q=e.data.tlbTxrCache=new Ia(e,{getKey:b,drawElement:S,getBoundingBox:I,getRotationPoint:B,getRotationOffset:k,isVisible:w}),q=e.data.lyrTxrCache=new Yv(e);e.onUpdateEleCalcs(function(U,W){J.invalidateElements(W),X.invalidateElements(W),_.invalidateElements(W),Q.invalidateElements(W),q.invalidateElements(W);for(var j=0;j<W.length;j++){var re=W[j]._private;re.oldBackgroundTimestamp=re.backgroundTimestamp}});var te=function(U){for(var W=0;W<U.length;W++)q.enqueueElementRefinement(U[W].ele)};if(J.onDequeue(te),X.onDequeue(te),_.onDequeue(te),Q.onDequeue(te),t.webgl)e.initWebgl(t,{getStyleKey:y,getLabelKey:p,getSourceLabelKey:m,getTargetLabelKey:b,drawElement:E,drawLabel:A,drawSourceLabel:M,drawTargetLabel:S,getElementBox:P,getLabelBox:N,getSourceLabelBox:R,getTargetLabelBox:I,getElementRotationPoint:x,getElementRotationOffset:z,getLabelRotationPoint:C,getSourceLabelRotationPoint:O,getTargetLabelRotationPoint:B,getLabelRotationOffset:G,getSourceLabelRotationOffset:V,getTargetLabelRotationOffset:k})}qe.redrawHint=function(t,e){var r=this;switch(t){case"eles":r.data.canvasNeedsRedraw[qe.NODE]=e;break;case"drag":r.data.canvasNeedsRedraw[qe.DRAG]=e;break;case"select":r.data.canvasNeedsRedraw[qe.SELECT_BOX]=e;break;case"gc":r.data.gc=!0;break}};var Fm=typeof Path2D<"u";qe.path2dEnabled=function(t){if(t===void 0)return this.pathsEnabled;this.pathsEnabled=t?!0:!1};qe.usePaths=function(){return Fm&&this.pathsEnabled};qe.setImgSmoothing=function(t,e){if(t.imageSmoothingEnabled!=null)t.imageSmoothingEnabled=e;else t.webkitImageSmoothingEnabled=e,t.mozImageSmoothingEnabled=e,t.msImageSmoothingEnabled=e};qe.getImgSmoothing=function(t){if(t.imageSmoothingEnabled!=null)return t.imageSmoothingEnabled;else return t.webkitImageSmoothingEnabled||t.mozImageSmoothingEnabled||t.msImageSmoothingEnabled};qe.makeOffscreenCanvas=function(t,e){var r;if((typeof OffscreenCanvas>"u"?"undefined":yt(OffscreenCanvas))!=="undefined")r=new OffscreenCanvas(t,e);else{var a=this.cy.window(),n=a.document;r=n.createElement("canvas"),r.width=t,r.height=e}return r};[Xv,tr,ur,Io,Wr,Pr,It,_v,Nr,sn,rh].forEach(function(t){Oe(qe,t)});var zm=[{name:"null",impl:Rv},{name:"base",impl:Uv},{name:"canvas",impl:km}],Vm=[{type:"layout",extensions:uy},{type:"renderer",extensions:zm}],nh={},ih={};function sh(t,e,r){var a=r,n=function(P){_e("Can not register `"+e+"` for `"+t+"` since `"+P+"` already exists in the prototype and can not be overridden")};if(t==="core")if(Wa.prototype[e])return n(e);else Wa.prototype[e]=r;else if(t==="collection")if(Ct.prototype[e])return n(e);else Ct.prototype[e]=r;else if(t==="layout"){var i=function(P){if(this.options=P,r.call(this,P),!We(this._private))this._private={};this._private.cy=P.cy,this._private.listeners=[],this.createEmitter()},s=i.prototype=Object.create(r.prototype),o=[];for(var l=0;l<o.length;l++){var u=o[l];s[u]=s[u]||function(){return this}}if(s.start&&!s.run)s.run=function(){return this.start(),this};else if(!s.start&&s.run)s.start=function(){return this.run(),this};var f=r.prototype.stop;if(s.stop=function(){var S=this.options;if(S&&S.animate){var P=this.animations;if(P)for(var N=0;N<P.length;N++)P[N].stop()}if(f)f.call(this);else this.emit("layoutstop");return this},!s.destroy)s.destroy=function(){return this};s.cy=function(){return this._private.cy};var v=function(P){return P._private.cy},h={addEventFields:function(P,N){N.layout=P,N.cy=v(P),N.target=P},bubble:function(){return!0},parent:function(P){return v(P)}};Oe(s,{createEmitter:function(){return this._private.emitter=new ii(h,this),this},emitter:function(){return this._private.emitter},on:function(P,N){return this.emitter().on(P,N),this},one:function(P,N){return this.emitter().one(P,N),this},once:function(P,N){return this.emitter().one(P,N),this},removeListener:function(P,N){return this.emitter().removeListener(P,N),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},emit:function(P,N){return this.emitter().emit(P,N),this}}),Ze.eventAliasesOn(s),a=i}else if(t==="renderer"&&e!=="null"&&e!=="base"){var c=oh("renderer","base"),d=c.prototype,g=r,y=r.prototype,p=function(){c.apply(this,arguments),g.apply(this,arguments)},m=p.prototype;for(var b in d){var E=d[b],A=y[b]!=null;if(A)return n(b);m[b]=E}for(var M in y)m[M]=y[M];d.clientFunctions.forEach(function(S){m[S]=m[S]||function(){it("Renderer does not implement `renderer."+S+"()` on its prototype")}}),a=p}else if(t==="__proto__"||t==="constructor"||t==="prototype")return it(t+" is an illegal type to be registered, possibly lead to prototype pollutions");return Tf({map:nh,keys:[t,e],value:a})}function oh(t,e){return Cf({map:nh,keys:[t,e]})}function Gm(t,e,r,a,n){return Tf({map:ih,keys:[t,e,r,a],value:n})}function Um(t,e,r,a){return Cf({map:ih,keys:[t,e,r,a]})}var lo=function(){if(arguments.length===2)return oh.apply(null,arguments);else if(arguments.length===3)return sh.apply(null,arguments);else if(arguments.length===4)return Um.apply(null,arguments);else if(arguments.length===5)return Gm.apply(null,arguments);else it("Invalid extension access syntax")};Wa.prototype.extension=lo;Vm.forEach(function(t){t.extensions.forEach(function(e){sh(t.type,e.name,e.impl)})});var Kn=function(){if(!(this instanceof Kn))return new Kn;this.length=0},Yr=Kn.prototype;Yr.instanceString=function(){return"stylesheet"};Yr.selector=function(t){var e=this.length++;return this[e]={selector:t,properties:[]},this};Yr.css=function(t,e){var r=this.length-1;if(Re(t))this[r].properties.push({name:t,value:e});else if(We(t)){var a=t,n=Object.keys(a);for(var i=0;i<n.length;i++){var s=n[i],o=a[s];if(o==null)continue;var l=wt.properties[s]||wt.properties[Zn(s)];if(l==null)continue;var u=l.name,f=o;this[r].properties.push({name:u,value:f})}}return this};Yr.style=Yr.css;Yr.generateStyle=function(t){var e=new wt(t);return this.appendToStyle(e)};Yr.appendToStyle=function(t){for(var e=0;e<this.length;e++){var r=this[e],{selector:a,properties:n}=r;t.selector(a);for(var i=0;i<n.length;i++){var s=n[i];t.css(s.name,s.value)}}return t};var Hm="3.34.4",ht=function(e){if(e===void 0)e={};if(We(e))return new Wa(e);else if(Re(e))return lo.apply(lo,arguments)};ht.use=function(t){var e=Array.prototype.slice.call(arguments,1);return e.unshift(ht),t.apply(null,e),this};ht.warnings=function(t){return Pf(t)};ht.version=Hm;ht.stylesheet=ht.Stylesheet=Kn;
332
+ export{ht,gr};