@smartmemory/compose 0.2.49-beta → 0.2.51-beta

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 (148) hide show
  1. package/.claude/skills/compose/SKILL.md +24 -1
  2. package/.claude/skills/compose/references/hermes-tools.md +80 -0
  3. package/README.md +1 -1
  4. package/bin/compose.js +340 -70
  5. package/dist/assets/App-CT0vXPgd.js +724 -0
  6. package/dist/assets/_baseUniq-CsOHc_iS.js +1 -0
  7. package/dist/assets/{arc-B1TqAC_R.js → arc-BXht3LyE.js} +1 -1
  8. package/dist/assets/architectureDiagram-Q4EWVU46-BV1r86-w.js +36 -0
  9. package/dist/assets/blockDiagram-DXYQGD6D-BgcMJjAR.js +132 -0
  10. package/dist/assets/{browser-DW2JlJCC.js → browser-CnKiSnlr.js} +6 -6
  11. package/dist/assets/{c4Diagram-AAUBKEIU-Dc6swoQo.js → c4Diagram-AHTNJAMY-nBIRLJTv.js} +1 -1
  12. package/dist/assets/channel-Dd4XaiYv.js +1 -0
  13. package/dist/assets/{chunk-4BX2VUAB-CdqXgd68.js → chunk-4BX2VUAB-CNmGyhrp.js} +1 -1
  14. package/dist/assets/chunk-4TB4RGXK-MLT7I7w4.js +206 -0
  15. package/dist/assets/{chunk-55IACEB6-D7VauOmU.js → chunk-55IACEB6-D8KuKVLa.js} +1 -1
  16. package/dist/assets/{chunk-2J33WTMH-6HKDSnOw.js → chunk-EDXVE4YY-TPlt1bS2.js} +1 -1
  17. package/dist/assets/{chunk-FMBD7UC4-C1Z5m8DP.js → chunk-FMBD7UC4-tYY8xcjr.js} +1 -1
  18. package/dist/assets/chunk-OYMX7WX6-yBPwT1AT.js +231 -0
  19. package/dist/assets/{chunk-QZHKN3VN-DY9GU2uD.js → chunk-QZHKN3VN-B4Wfybww.js} +1 -1
  20. package/dist/assets/{chunk-ND2GUHAM-DmqZMEQe.js → chunk-YZCP3GAM-DE6_5aqh.js} +1 -1
  21. package/dist/assets/classDiagram-6PBFFD2Q-DshSQDF9.js +1 -0
  22. package/dist/assets/classDiagram-v2-HSJHXN6E-DshSQDF9.js +1 -0
  23. package/dist/assets/clone-CBsbNGAa.js +1 -0
  24. package/dist/assets/{cose-bilkent-S5V4N54A-B34g9xzV.js → cose-bilkent-S5V4N54A-DzzRyJtB.js} +1 -1
  25. package/dist/assets/dagre-KV5264BT-CTcTVGdU.js +4 -0
  26. package/dist/assets/diagram-5BDNPKRD-qR6mc8kJ.js +10 -0
  27. package/dist/assets/diagram-G4DWMVQ6-CUcGXyNb.js +24 -0
  28. package/dist/assets/diagram-MMDJMWI5-B68cPonH.js +43 -0
  29. package/dist/assets/diagram-TYMM5635-q8Id8eFG.js +24 -0
  30. package/dist/assets/{erDiagram-TEJ5UH35-C05_Iqmb.js → erDiagram-SMLLAGMA-CtxJi57K.js} +1 -1
  31. package/dist/assets/{flowDiagram-I6XJVG4X-lXpnb-Ch.js → flowDiagram-DWJPFMVM-BzzO4JYU.js} +1 -1
  32. package/dist/assets/ganttDiagram-T4ZO3ILL-Dn0wIyhR.js +292 -0
  33. package/dist/assets/gitGraphDiagram-UUTBAWPF-tnNFXfMM.js +106 -0
  34. package/dist/assets/graph-DZe55uk8.js +331 -0
  35. package/dist/assets/graph-Tq_bs_r0.js +1 -0
  36. package/dist/assets/index-8UhRLbGq.js +123 -0
  37. package/dist/assets/index-CRqB9els.css +1 -0
  38. package/dist/assets/infoDiagram-42DDH7IO-BXLvLeS0.js +2 -0
  39. package/dist/assets/{ishikawaDiagram-YF4QCWOH-CgdsWdgu.js → ishikawaDiagram-UXIWVN3A-DWx-7BBy.js} +5 -5
  40. package/dist/assets/{journeyDiagram-JHISSGLW-CyvHmE3z.js → journeyDiagram-VCZTEJTY-C42hXNha.js} +1 -1
  41. package/dist/assets/{kanban-definition-UN3LZRKU-Bqjdyv0T.js → kanban-definition-6JOO6SKY-CEq930ew.js} +1 -1
  42. package/dist/assets/katex-DkKDou_j.js +257 -0
  43. package/dist/assets/layout-qtUgN9BC.js +1 -0
  44. package/dist/assets/{linear-DecnRXf0.js → linear-D158F7OT.js} +1 -1
  45. package/dist/assets/min-hESxN-c0.js +1 -0
  46. package/dist/assets/{mindmap-definition-RKZ34NQL-DM1x9vNY.js → mindmap-definition-QFDTVHPH-d9SSh2nG.js} +7 -7
  47. package/dist/assets/mobile-1gVCT0OK.css +1 -0
  48. package/dist/assets/mobile-Chw8RWyH.js +17 -0
  49. package/dist/assets/pieDiagram-DEJITSTG-gglmeMav.js +30 -0
  50. package/dist/assets/quadrantDiagram-34T5L4WZ-CqFC_htU.js +7 -0
  51. package/dist/assets/{requirementDiagram-4Y6WPE33-DD-Gg_y5.js → requirementDiagram-MS252O5E-B1ZFIotK.js} +1 -1
  52. package/dist/assets/sankeyDiagram-XADWPNL6-BvItvZt5.js +10 -0
  53. package/dist/assets/sequenceDiagram-FGHM5R23-CAIn5Z3U.js +157 -0
  54. package/dist/assets/stateDiagram-FHFEXIEX-CyJrGzib.js +1 -0
  55. package/dist/assets/stateDiagram-v2-QKLJ7IA2-DprhF_Ho.js +1 -0
  56. package/dist/assets/{timeline-definition-PNZ67QCA-BPm2AEQj.js → timeline-definition-GMOUNBTQ-k_0vJQAK.js} +1 -1
  57. package/dist/assets/{vennDiagram-CIIHVFJN-DQCDWwlj.js → vennDiagram-DHZGUBPP-TZAW60b0.js} +4 -4
  58. package/dist/assets/wardley-RL74JXVD-DzQEoG6X.js +162 -0
  59. package/dist/assets/wardleyDiagram-NUSXRM2D-BAoVVIjZ.js +20 -0
  60. package/dist/assets/{xychartDiagram-2RQKCTM6-Ba05SXXF.js → xychartDiagram-5P7HB3ND-CynkZcUb.js} +1 -1
  61. package/dist/index.html +4 -4
  62. package/lib/build-all.js +2 -1
  63. package/lib/build.js +363 -38
  64. package/lib/checkpoint/checkpoint-writer.js +3 -2
  65. package/lib/codex-preflight.js +151 -0
  66. package/lib/completion-writer.js +59 -15
  67. package/lib/feature-json.js +14 -3
  68. package/lib/feature-validator.js +27 -10
  69. package/lib/feature-write-guard.js +5 -7
  70. package/lib/feature-writer.js +3 -3
  71. package/lib/followup-writer.js +2 -2
  72. package/lib/get-roadmap.js +2 -2
  73. package/lib/gsd.js +2 -1
  74. package/lib/hooks-status.js +135 -0
  75. package/lib/ideabox.js +3 -2
  76. package/lib/install-agent-defs.js +22 -0
  77. package/lib/journal-writer.js +3 -3
  78. package/lib/migrate-anon.js +277 -0
  79. package/lib/migrate-roadmap.js +2 -3
  80. package/lib/paths-core.js +47 -0
  81. package/lib/project-paths.js +46 -37
  82. package/lib/roadmap-gen.js +3 -4
  83. package/lib/roadmap-graph/collect.js +5 -5
  84. package/lib/roadmap-graph/index.js +2 -2
  85. package/lib/roadmap-parser.js +1 -1
  86. package/lib/state-migrations.js +3 -3
  87. package/lib/test-bootstrap.js +165 -2
  88. package/lib/tracker/local-provider.js +2 -2
  89. package/lib/triage.js +7 -5
  90. package/lib/vocabulary-inject.js +103 -0
  91. package/lib/xref-push.js +4 -4
  92. package/lib/xref-sync.js +4 -4
  93. package/package.json +2 -1
  94. package/pipelines/build-quick.stratum.yaml +433 -0
  95. package/pipelines/build.stratum.yaml +60 -3
  96. package/scripts/watch-server.sh +32 -0
  97. package/server/build-routes.js +89 -9
  98. package/server/build-stream-bridge.js +12 -0
  99. package/server/compose-mcp-tools.js +73 -1
  100. package/server/compose-mcp.js +27 -0
  101. package/server/design-routes.js +9 -4
  102. package/server/drift-axes.js +5 -3
  103. package/server/feature-scaffold-routes.js +82 -0
  104. package/server/feature-scan.js +8 -2
  105. package/server/file-watcher.js +13 -7
  106. package/server/health-routes.js +261 -0
  107. package/server/ideabox-routes.js +12 -11
  108. package/server/project-root.js +7 -4
  109. package/server/qa-scope-routes.js +96 -0
  110. package/server/session-routes.js +2 -2
  111. package/server/stratum-sync.js +85 -9
  112. package/server/validate-routes.js +70 -0
  113. package/server/vision-routes.js +46 -2
  114. package/server/vision-server.js +25 -3
  115. package/server/vision-utils.js +23 -4
  116. package/dist/assets/App-DOerhoDp.js +0 -706
  117. package/dist/assets/architectureDiagram-3BPJPVTR-C4hfxNOw.js +0 -36
  118. package/dist/assets/blockDiagram-GPEHLZMM-DRqkGncy.js +0 -132
  119. package/dist/assets/channel-KsY1x-7s.js +0 -1
  120. package/dist/assets/chunk-727SXJPM-CeKpXDif.js +0 -206
  121. package/dist/assets/chunk-AQP2D5EJ-y2XL-YHV.js +0 -231
  122. package/dist/assets/classDiagram-4FO5ZUOK-zDEDoVPk.js +0 -1
  123. package/dist/assets/classDiagram-v2-Q7XG4LA2-zDEDoVPk.js +0 -1
  124. package/dist/assets/dagre-BM42HDAG-klZ_GOcw.js +0 -4
  125. package/dist/assets/diagram-2AECGRRQ-D0FmM6Wf.js +0 -43
  126. package/dist/assets/diagram-5GNKFQAL-DYuhby6q.js +0 -10
  127. package/dist/assets/diagram-KO2AKTUF-CCtQZgal.js +0 -3
  128. package/dist/assets/diagram-LMA3HP47-Cd1OqEln.js +0 -24
  129. package/dist/assets/diagram-OG6HWLK6-CiJrhoxo.js +0 -24
  130. package/dist/assets/ganttDiagram-6RSMTGT7-EPbL_2Hr.js +0 -292
  131. package/dist/assets/gitGraphDiagram-PVQCEYII-COCoF_vW.js +0 -106
  132. package/dist/assets/graph-BBXaecIU.js +0 -331
  133. package/dist/assets/graph-CAnANduQ.js +0 -1
  134. package/dist/assets/index-BwLfbbOu.css +0 -1
  135. package/dist/assets/index-DlgxA8dX.js +0 -123
  136. package/dist/assets/infoDiagram-5YYISTIA-B1sJw6j5.js +0 -2
  137. package/dist/assets/katex-C5jXJg4s.js +0 -257
  138. package/dist/assets/layout-DGIYPm2g.js +0 -1
  139. package/dist/assets/mobile-Cag5dHlF.css +0 -1
  140. package/dist/assets/mobile-DwmxS_O4.js +0 -17
  141. package/dist/assets/pieDiagram-4H26LBE5-CRtmCvwV.js +0 -30
  142. package/dist/assets/quadrantDiagram-W4KKPZXB-CsBLWg27.js +0 -7
  143. package/dist/assets/sankeyDiagram-5OEKKPKP-BPdMN8UU.js +0 -40
  144. package/dist/assets/sequenceDiagram-3UESZ5HK-D4AENdze.js +0 -162
  145. package/dist/assets/stateDiagram-AJRCARHV-DDplpCf_.js +0 -1
  146. package/dist/assets/stateDiagram-v2-BHNVJYJU-J4t9AVzF.js +0 -1
  147. package/dist/assets/wardley-L42UT6IY-WERqOmJt.js +0 -173
  148. package/dist/assets/wardleyDiagram-YWT4CUSO-5teUSOiI.js +0 -78
@@ -0,0 +1,331 @@
1
+ import{c as Pn,g as Cv}from"./mobile-Chw8RWyH.js";function nv(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 ux(t){if(Array.isArray(t))return t}function lx(t){if(Array.isArray(t))return nv(t)}function Pr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function fx(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,yE(a.key),a)}}function Fr(t,e,r){return e&&fx(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=Av(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(u){throw u},f:n}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
2
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i,o=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var u=r.next();return o=u.done,u},e:function(u){s=!0,i=u},f:function(){try{o||r.return==null||r.return()}finally{if(s)throw i}}}}function pE(t,e,r){return(e=yE(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function hx(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function cx(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var a,n,i,o,s=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,e===0){if(Object(r)!==r)return;u=!1}else for(;!(u=(a=i.call(r)).done)&&(s.push(a.value),s.length!==e);u=!0);}catch(f){l=!0,n=f}finally{try{if(!u&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(l)throw n}}return s}}function vx(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
3
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function dx(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
4
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function dt(t,e){return ux(t)||cx(t,e)||Av(t,e)||vx()}function ci(t){return lx(t)||hx(t)||Av(t)||dx()}function gx(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 new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function yE(t){var e=gx(t,"string");return typeof e=="symbol"?e:e+""}function bt(t){"@babel/helpers - typeof";return bt=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},bt(t)}function Av(t,e){if(t){if(typeof t=="string")return nv(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)?nv(t,e):void 0}}var yt=typeof window>"u"?null:window,gd=yt?yt.navigator:null;yt&&yt.document;var px=bt(""),mE=bt({}),yx=bt(function(){}),mx=typeof HTMLElement>"u"?"undefined":bt(HTMLElement),dn=function(e){return e&&e.instanceString&&ot(e.instanceString)?e.instanceString():null},Me=function(e){return e!=null&&bt(e)==px},ot=function(e){return e!=null&&bt(e)===yx},je=function(e){return!Ut(e)&&(Array.isArray?Array.isArray(e):e!=null&&e instanceof Array)},Ye=function(e){return e!=null&&bt(e)===mE&&!je(e)&&e.constructor===Object},bx=function(e){return e!=null&&bt(e)===mE},Te=function(e){return e!=null&&bt(e)===bt(1)&&!isNaN(e)},Ex=function(e){return Te(e)&&Math.floor(e)===e},vi=function(e){if(mx!=="undefined")return e!=null&&e instanceof HTMLElement},Ut=function(e){return gn(e)||bE(e)},gn=function(e){return dn(e)==="collection"&&e._private.single},bE=function(e){return dn(e)==="collection"&&!e._private.single},Lv=function(e){return dn(e)==="core"},EE=function(e){return dn(e)==="stylesheet"},wx=function(e){return dn(e)==="event"},Sr=function(e){return e==null?!0:!!(e===""||e.match(/^\s+$/))},Tx=function(e){return typeof HTMLElement>"u"?!1:e instanceof HTMLElement},xx=function(e){return Ye(e)&&Te(e.x1)&&Te(e.x2)&&Te(e.y1)&&Te(e.y2)},Cx=function(e){return bx(e)&&ot(e.then)},Ax=function(){return gd&&gd.userAgent.match(/msie|trident|edge/i)},Ta=function(e,r){r||(r=function(){if(arguments.length===1)return arguments[0];if(arguments.length===0)return"undefined";for(var i=[],o=0;o<arguments.length;o++)i.push(arguments[o]);return i.join("$")});var a=function(){var i=this,o=arguments,s,u=r.apply(i,o),l=a.cache;return(s=l[u])||(s=l[u]=e.apply(i,o)),s};return a.cache={},a},Rv=Ta(function(t){return t.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()})}),Ri=Ta(function(t){return t.replace(/(-\w)/g,function(e){return e[1].toUpperCase()})}),wE=Ta(function(t,e){return t+e[0].toUpperCase()+e.substring(1)},function(t,e){return t+"$"+e}),pd=function(e){return Sr(e)?e:e.charAt(0).toUpperCase()+e.substring(1)},xr=function(e,r){return e.slice(-1*r.length)===r},mt="(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))",Lx="rgb[a]?\\(("+mt+"[%]?)\\s*,\\s*("+mt+"[%]?)\\s*,\\s*("+mt+"[%]?)(?:\\s*,\\s*("+mt+"))?\\)",Rx="rgb[a]?\\((?:"+mt+"[%]?)\\s*,\\s*(?:"+mt+"[%]?)\\s*,\\s*(?:"+mt+"[%]?)(?:\\s*,\\s*(?:"+mt+"))?\\)",Sx="hsl[a]?\\(("+mt+")\\s*,\\s*("+mt+"[%])\\s*,\\s*("+mt+"[%])(?:\\s*,\\s*("+mt+"))?\\)",Dx="hsl[a]?\\((?:"+mt+")\\s*,\\s*(?:"+mt+"[%])\\s*,\\s*(?:"+mt+"[%])(?:\\s*,\\s*(?:"+mt+"))?\\)",Nx="\\#[0-9a-fA-F]{3}",Mx="\\#[0-9a-fA-F]{6}",TE=function(e,r){return e<r?-1:e>r?1:0},Ox=function(e,r){return-1*TE(e,r)},Be=Object.assign!=null?Object.assign.bind(Object):function(t){for(var e=arguments,r=1;r<e.length;r++){var a=e[r];if(a!=null)for(var n=Object.keys(a),i=0;i<n.length;i++){var o=n[i];t[o]=a[o]}}return t},Ix=function(e){if(!(!(e.length===4||e.length===7)||e[0]!=="#")){var r=e.length===4,a,n,i,o=16;return r?(a=parseInt(e[1]+e[1],o),n=parseInt(e[2]+e[2],o),i=parseInt(e[3]+e[3],o)):(a=parseInt(e[1]+e[2],o),n=parseInt(e[3]+e[4],o),i=parseInt(e[5]+e[6],o)),[a,n,i]}},Px=function(e){var r,a,n,i,o,s,u,l;function f(d,g,p){return p<0&&(p+=1),p>1&&(p-=1),p<1/6?d+(g-d)*6*p:p<1/2?g:p<2/3?d+(g-d)*(2/3-p)*6:d}var h=new RegExp("^"+Sx+"$").exec(e);if(h){if(a=parseInt(h[1]),a<0?a=(360- -1*a%360)%360:a>360&&(a=a%360),a/=360,n=parseFloat(h[2]),n<0||n>100||(n=n/100,i=parseFloat(h[3]),i<0||i>100)||(i=i/100,o=h[4],o!==void 0&&(o=parseFloat(o),o<0||o>1)))return;if(n===0)s=u=l=Math.round(i*255);else{var v=i<.5?i*(1+n):i+n-i*n,c=2*i-v;s=Math.round(255*f(c,v,a+1/3)),u=Math.round(255*f(c,v,a)),l=Math.round(255*f(c,v,a-1/3))}r=[s,u,l,o]}return r},Fx=function(e){var r,a=new RegExp("^"+Lx+"$").exec(e);if(a){r=[];for(var n=[],i=1;i<=3;i++){var o=a[i];if(o[o.length-1]==="%"&&(n[i]=!0),o=parseFloat(o),n[i]&&(o=o/100*255),o<0||o>255)return;r.push(Math.floor(o))}var s=n[1]||n[2]||n[3],u=n[1]&&n[2]&&n[3];if(s&&!u)return;var l=a[4];if(l!==void 0){if(l=parseFloat(l),l<0||l>1)return;r.push(l)}}return r},_x=function(e){return Bx[e.toLowerCase()]},xE=function(e){return(je(e)?e:null)||_x(e)||Ix(e)||Fx(e)||Px(e)},Bx={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]},CE=function(e){for(var r=e.map,a=e.keys,n=a.length,i=0;i<n;i++){var o=a[i];if(Ye(o))throw Error("Tried to set map with object key");i<a.length-1?(r[o]==null&&(r[o]={}),r=r[o]):r[o]=e.value}},AE=function(e){for(var r=e.map,a=e.keys,n=a.length,i=0;i<n;i++){var o=a[i];if(Ye(o))throw Error("Tried to get map with object key");if(r=r[o],r==null)return r}return r},Fn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function pn(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var lo,yd;function yn(){if(yd)return lo;yd=1;function t(e){var r=typeof e;return e!=null&&(r=="object"||r=="function")}return lo=t,lo}var fo,md;function kx(){if(md)return fo;md=1;var t=typeof Fn=="object"&&Fn&&Fn.Object===Object&&Fn;return fo=t,fo}var ho,bd;function Si(){if(bd)return ho;bd=1;var t=kx(),e=typeof self=="object"&&self&&self.Object===Object&&self,r=t||e||Function("return this")();return ho=r,ho}var co,Ed;function qx(){if(Ed)return co;Ed=1;var t=Si(),e=function(){return t.Date.now()};return co=e,co}var vo,wd;function Gx(){if(wd)return vo;wd=1;var t=/\s/;function e(r){for(var a=r.length;a--&&t.test(r.charAt(a)););return a}return vo=e,vo}var go,Td;function Ux(){if(Td)return go;Td=1;var t=Gx(),e=/^\s+/;function r(a){return a&&a.slice(0,t(a)+1).replace(e,"")}return go=r,go}var po,xd;function Sv(){if(xd)return po;xd=1;var t=Si(),e=t.Symbol;return po=e,po}var yo,Cd;function zx(){if(Cd)return yo;Cd=1;var t=Sv(),e=Object.prototype,r=e.hasOwnProperty,a=e.toString,n=t?t.toStringTag:void 0;function i(o){var s=r.call(o,n),u=o[n];try{o[n]=void 0;var l=!0}catch{}var f=a.call(o);return l&&(s?o[n]=u:delete o[n]),f}return yo=i,yo}var mo,Ad;function Vx(){if(Ad)return mo;Ad=1;var t=Object.prototype,e=t.toString;function r(a){return e.call(a)}return mo=r,mo}var bo,Ld;function LE(){if(Ld)return bo;Ld=1;var t=Sv(),e=zx(),r=Vx(),a="[object Null]",n="[object Undefined]",i=t?t.toStringTag:void 0;function o(s){return s==null?s===void 0?n:a:i&&i in Object(s)?e(s):r(s)}return bo=o,bo}var Eo,Rd;function Yx(){if(Rd)return Eo;Rd=1;function t(e){return e!=null&&typeof e=="object"}return Eo=t,Eo}var wo,Sd;function mn(){if(Sd)return wo;Sd=1;var t=LE(),e=Yx(),r="[object Symbol]";function a(n){return typeof n=="symbol"||e(n)&&t(n)==r}return wo=a,wo}var To,Dd;function Hx(){if(Dd)return To;Dd=1;var t=Ux(),e=yn(),r=mn(),a=NaN,n=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,o=/^0o[0-7]+$/i,s=parseInt;function u(l){if(typeof l=="number")return l;if(r(l))return a;if(e(l)){var f=typeof l.valueOf=="function"?l.valueOf():l;l=e(f)?f+"":f}if(typeof l!="string")return l===0?l:+l;l=t(l);var h=i.test(l);return h||o.test(l)?s(l.slice(2),h?2:8):n.test(l)?a:+l}return To=u,To}var xo,Nd;function Xx(){if(Nd)return xo;Nd=1;var t=yn(),e=qx(),r=Hx(),a="Expected a function",n=Math.max,i=Math.min;function o(s,u,l){var f,h,v,c,d,g,p=0,y=!1,b=!1,m=!0;if(typeof s!="function")throw new TypeError(a);u=r(u)||0,t(l)&&(y=!!l.leading,b="maxWait"in l,v=b?n(r(l.maxWait)||0,u):v,m="trailing"in l?!!l.trailing:m);function E(P){var x=f,N=h;return f=h=void 0,p=P,c=s.apply(N,x),c}function T(P){return p=P,d=setTimeout(C,u),y?E(P):c}function L(P){var x=P-g,N=P-p,M=u-x;return b?i(M,v-N):M}function w(P){var x=P-g,N=P-p;return g===void 0||x>=u||x<0||b&&N>=v}function C(){var P=e();if(w(P))return A(P);d=setTimeout(C,L(P))}function A(P){return d=void 0,m&&f?E(P):(f=h=void 0,c)}function R(){d!==void 0&&clearTimeout(d),p=0,f=g=h=d=void 0}function S(){return d===void 0?c:A(e())}function D(){var P=e(),x=w(P);if(f=arguments,h=this,g=P,x){if(d===void 0)return T(g);if(b)return clearTimeout(d),d=setTimeout(C,u),E(g)}return d===void 0&&(d=setTimeout(C,u)),c}return D.cancel=R,D.flush=S,D}return xo=o,xo}var $x=Xx(),bn=pn($x),Co=yt?yt.performance:null,RE=Co&&Co.now?function(){return Co.now()}:function(){return Date.now()},Wx=(function(){if(yt){if(yt.requestAnimationFrame)return function(t){yt.requestAnimationFrame(t)};if(yt.mozRequestAnimationFrame)return function(t){yt.mozRequestAnimationFrame(t)};if(yt.webkitRequestAnimationFrame)return function(t){yt.webkitRequestAnimationFrame(t)};if(yt.msRequestAnimationFrame)return function(t){yt.msRequestAnimationFrame(t)}}return function(t){t&&setTimeout(function(){t(RE())},1e3/60)}})(),di=function(e){return Wx(e)},cr=RE,Xr=9261,SE=65599,da=5381,DE=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Xr,a=r,n;n=e.next(),!n.done;)a=a*SE+n.value|0;return a},an=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Xr;return r*SE+e|0},nn=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:da;return(r<<5)+r+e|0},Kx=function(e,r){return e*2097152+r},Er=function(e){return e[0]*2097152+e[1]},_n=function(e,r){return[an(e[0],r[0]),nn(e[1],r[1])]},Md=function(e,r){var a={value:0,done:!1},n=0,i=e.length,o={next:function(){return n<i?a.value=e[n++]:a.done=!0,a}};return DE(o,r)},Kr=function(e,r){var a={value:0,done:!1},n=0,i=e.length,o={next:function(){return n<i?a.value=e.charCodeAt(n++):a.done=!0,a}};return DE(o,r)},NE=function(){return Zx(arguments)},Zx=function(e){for(var r,a=0;a<e.length;a++){var n=e[a];a===0?r=Kr(n):r=Kr(n,r)}return r};function Qx(t,e,r,a,n){var i=n*Math.PI/180,o=Math.cos(i)*(t-r)-Math.sin(i)*(e-a)+r,s=Math.sin(i)*(t-r)+Math.cos(i)*(e-a)+a;return{x:o,y:s}}var Jx=function(e,r,a,n,i,o){return{x:(e-a)*i+a,y:(r-n)*o+n}};function jx(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,o=1/i,s=Qx(t.x,t.y,a,n,r),u=Jx(s.x,s.y,a,n,i,o);return{x:u.x,y:u.y}}var Od=!0,eC=console.warn!=null,tC=console.trace!=null,Dv=Number.MAX_SAFE_INTEGER||9007199254740991,ME=function(){return!0},gi=function(){return!1},Id=function(){return 0},Nv=function(){},at=function(e){throw new Error(e)},OE=function(e){if(e!==void 0)Od=!!e;else return Od},Ze=function(e){OE()&&(eC?console.warn(e):(console.log(e),tC&&console.trace()))},rC=function(e){return Be({},e)},ar=function(e){return e==null?e:je(e)?e.slice():Ye(e)?rC(e):e},aC=function(e){return e.slice()},IE=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},nC={},PE=function(){return nC},Lt=function(e){var r=Object.keys(e);return function(a){for(var n={},i=0;i<r.length;i++){var o=r[i],s=a==null?void 0:a[o];n[o]=s===void 0?e[o]:s}return n}},Dr=function(e,r,a){for(var n=e.length-1;n>=0;n--)e[n]===r&&e.splice(n,1)},Mv=function(e){e.splice(0,e.length)},iC=function(e,r){for(var a=0;a<r.length;a++){var n=r[a];e.push(n)}},_t=function(e,r,a){return a&&(r=wE(a,r)),e[r]},fr=function(e,r,a,n){a&&(r=wE(a,r)),e[r]=n},oC=(function(){function t(){Pr(this,t),this._obj={}}return Fr(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]}}])})(),hr=typeof Map<"u"?Map:oC,sC="undefined",uC=(function(){function t(e){if(Pr(this,t),this._obj=Object.create(null),this.size=0,e!=null){var r;e.instanceString!=null&&e.instanceString()===this.instanceString()?r=e.toArray():r=e;for(var a=0;a<r.length;a++)this.add(r[a])}}return Fr(t,[{key:"instanceString",value:function(){return"set"}},{key:"add",value:function(r){var a=this._obj;a[r]!==1&&(a[r]=1,this.size++)}},{key:"delete",value:function(r){var a=this._obj;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)}}])})(),La=(typeof Set>"u"?"undefined":bt(Set))!==sC?Set:uC,Di=function(e,r){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0||r===void 0||!Lv(e)){at("An element must have a core reference and parameters set");return}var n=r.group;if(n==null&&(r.data&&r.data.source!=null&&r.data.target!=null?n="edges":n="nodes"),n!=="nodes"&&n!=="edges"){at("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,selectable:r.selectable===void 0?!0:!!r.selectable,locked:!!r.locked,grabbed:!1,grabbable:r.grabbable===void 0?!0:!!r.grabbable,pannable:r.pannable===void 0?n==="edges":!!r.pannable,active:!1,classes:new La,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),i.position.y==null&&(i.position.y=0),r.renderedPosition){var o=r.renderedPosition,s=e.pan(),u=e.zoom();i.position={x:(o.x-s.x)/u,y:(o.y-s.y)/u}}var l=[];je(r.classes)?l=r.classes:Me(r.classes)&&(l=r.classes.split(/\s+/));for(var f=0,h=l.length;f<h;f++){var v=l[f];!v||v===""||i.classes.add(v)}this.createEmitter(),(a===void 0||a)&&this.restore();var c=r.style||r.css;c&&(Ze("Setting a `style` bypass at element creation should be done only when absolutely necessary. Try to use the stylesheet instead."),this.style(c))},Pd=function(e){return e={bfs:e.bfs||!e.dfs,dfs:e.dfs||!e.bfs},function(a,n,i){var o;Ye(a)&&!Ut(a)&&(o=a,a=o.roots||o.root,n=o.visit,i=o.directed),i=arguments.length===2&&!ot(n)?n:i,n=ot(n)?n:function(){};for(var s=this._private.cy,u=a=Me(a)?this.filter(a):a,l=[],f=[],h={},v={},c={},d=0,g,p=this.byGroup(),y=p.nodes,b=p.edges,m=0;m<u.length;m++){var E=u[m],T=E.id();E.isNode()&&(l.unshift(E),e.bfs&&(c[T]=!0,f.push(E)),v[T]=0)}for(var L=function(){var P=e.bfs?l.shift():l.pop(),x=P.id();if(e.dfs){if(c[x])return 0;c[x]=!0,f.push(P)}var N=v[x],M=h[x],I=M!=null?M.source():null,O=M!=null?M.target():null,q=M==null?void 0:P.same(I)?O[0]:I[0],_;if(_=n(P,M,q,d++,N),_===!0)return g=P,1;if(_===!1)return 1;for(var B=P.connectedEdges().filter(function(U){return(!i||U.source().same(P))&&b.has(U)}),z=0;z<B.length;z++){var Y=B[z],k=Y.connectedNodes().filter(function(U){return!U.same(P)&&y.has(U)}),G=k.id();k.length!==0&&!c[G]&&(k=k[0],l.push(k),e.bfs&&(c[G]=!0,f.push(k)),h[G]=Y,v[G]=v[x]+1)}},w;l.length!==0&&(w=L(),!(w!==0&&w===1)););for(var C=s.collection(),A=0;A<f.length;A++){var R=f[A],S=h[R.id()];S!=null&&C.push(S),C.push(R)}return{path:s.collection(C),found:s.collection(g)}}},on={breadthFirstSearch:Pd({bfs:!0}),depthFirstSearch:Pd({dfs:!0})};on.bfs=on.breadthFirstSearch;on.dfs=on.depthFirstSearch;var Wn={exports:{}},lC=Wn.exports,Fd;function fC(){return Fd||(Fd=1,(function(t,e){(function(){var r,a,n,i,o,s,u,l,f,h,v,c,d,g,p;n=Math.floor,h=Math.min,a=function(y,b){return y<b?-1:y>b?1:0},f=function(y,b,m,E,T){var L;if(m==null&&(m=0),T==null&&(T=a),m<0)throw new Error("lo must be non-negative");for(E==null&&(E=y.length);m<E;)L=n((m+E)/2),T(b,y[L])<0?E=L:m=L+1;return[].splice.apply(y,[m,m-m].concat(b)),b},s=function(y,b,m){return m==null&&(m=a),y.push(b),g(y,0,y.length-1,m)},o=function(y,b){var m,E;return b==null&&(b=a),m=y.pop(),y.length?(E=y[0],y[0]=m,p(y,0,b)):E=m,E},l=function(y,b,m){var E;return m==null&&(m=a),E=y[0],y[0]=b,p(y,0,m),E},u=function(y,b,m){var E;return m==null&&(m=a),y.length&&m(y[0],b)<0&&(E=[y[0],b],b=E[0],y[0]=E[1],p(y,0,m)),b},i=function(y,b){var m,E,T,L,w,C;for(b==null&&(b=a),L=(function(){C=[];for(var A=0,R=n(y.length/2);0<=R?A<R:A>R;0<=R?A++:A--)C.push(A);return C}).apply(this).reverse(),w=[],E=0,T=L.length;E<T;E++)m=L[E],w.push(p(y,m,b));return w},d=function(y,b,m){var E;if(m==null&&(m=a),E=y.indexOf(b),E!==-1)return g(y,0,E,m),p(y,E,m)},v=function(y,b,m){var E,T,L,w,C;if(m==null&&(m=a),T=y.slice(0,b),!T.length)return T;for(i(T,m),C=y.slice(b),L=0,w=C.length;L<w;L++)E=C[L],u(T,E,m);return T.sort(m).reverse()},c=function(y,b,m){var E,T,L,w,C,A,R,S,D;if(m==null&&(m=a),b*10<=y.length){if(L=y.slice(0,b).sort(m),!L.length)return L;for(T=L[L.length-1],R=y.slice(b),w=0,A=R.length;w<A;w++)E=R[w],m(E,T)<0&&(f(L,E,0,null,m),L.pop(),T=L[L.length-1]);return L}for(i(y,m),D=[],C=0,S=h(b,y.length);0<=S?C<S:C>S;0<=S?++C:--C)D.push(o(y,m));return D},g=function(y,b,m,E){var T,L,w;for(E==null&&(E=a),T=y[m];m>b;){if(w=m-1>>1,L=y[w],E(T,L)<0){y[m]=L,m=w;continue}break}return y[m]=T},p=function(y,b,m){var E,T,L,w,C;for(m==null&&(m=a),T=y.length,C=b,L=y[b],E=2*b+1;E<T;)w=E+1,w<T&&!(m(y[E],y[w])<0)&&(E=w),y[b]=y[E],b=E,E=2*b+1;return y[b]=L,g(y,C,b,m)},r=(function(){y.push=s,y.pop=o,y.replace=l,y.pushpop=u,y.heapify=i,y.updateItem=d,y.nlargest=v,y.nsmallest=c;function y(b){this.cmp=b??a,this.nodes=[]}return y.prototype.push=function(b){return s(this.nodes,b,this.cmp)},y.prototype.pop=function(){return o(this.nodes,this.cmp)},y.prototype.peek=function(){return this.nodes[0]},y.prototype.contains=function(b){return this.nodes.indexOf(b)!==-1},y.prototype.replace=function(b){return l(this.nodes,b,this.cmp)},y.prototype.pushpop=function(b){return u(this.nodes,b,this.cmp)},y.prototype.heapify=function(){return i(this.nodes,this.cmp)},y.prototype.updateItem=function(b){return d(this.nodes,b,this.cmp)},y.prototype.clear=function(){return this.nodes=[]},y.prototype.empty=function(){return this.nodes.length===0},y.prototype.size=function(){return this.nodes.length},y.prototype.clone=function(){var b;return b=new y,b.nodes=this.nodes.slice(0),b},y.prototype.toArray=function(){return this.nodes.slice(0)},y.prototype.insert=y.prototype.push,y.prototype.top=y.prototype.peek,y.prototype.front=y.prototype.peek,y.prototype.has=y.prototype.contains,y.prototype.copy=y.prototype.clone,y})(),(function(y,b){return t.exports=b()})(this,function(){return r})}).call(lC)})(Wn)),Wn.exports}var Ao,_d;function hC(){return _d||(_d=1,Ao=fC()),Ao}var cC=hC(),En=pn(cC),vC=Lt({root:null,weight:function(e){return 1},directed:!1}),dC={dijkstra:function(e){if(!Ye(e)){var r=arguments;e={root:r[0],weight:r[1],directed:r[2]}}var a=vC(e),n=a.root,i=a.weight,o=a.directed,s=this,u=i,l=Me(n)?this.filter(n)[0]:n[0],f={},h={},v={},c=this.byGroup(),d=c.nodes,g=c.edges;g.unmergeBy(function(N){return N.isLoop()});for(var p=function(M){return f[M.id()]},y=function(M,I){f[M.id()]=I,b.updateItem(M)},b=new En(function(N,M){return p(N)-p(M)}),m=0;m<d.length;m++){var E=d[m];f[E.id()]=E.same(l)?0:1/0,b.push(E)}for(var T=function(M,I){for(var O=(o?M.edgesTo(I):M.edgesWith(I)).intersect(g),q=1/0,_,B=0;B<O.length;B++){var z=O[B],Y=u(z);(Y<q||!_)&&(q=Y,_=z)}return{edge:_,dist:q}};b.size()>0;){var L=b.pop(),w=p(L),C=L.id();if(v[C]=w,w!==1/0)for(var A=L.neighborhood().intersect(d),R=0;R<A.length;R++){var S=A[R],D=S.id(),P=T(L,S),x=w+P.dist;x<p(S)&&(y(S,x),h[D]={node:L,edge:P.edge})}}return{distanceTo:function(M){var I=Me(M)?d.filter(M)[0]:M[0];return v[I.id()]},pathTo:function(M){var I=Me(M)?d.filter(M)[0]:M[0],O=[],q=I,_=q.id();if(I.length>0)for(O.unshift(I);h[_];){var B=h[_];O.unshift(B.edge),O.unshift(B.node),q=B.node,_=q.id()}return s.spawn(O)}}}},gC={kruskal:function(e){e=e||function(m){return 1};for(var r=this.byGroup(),a=r.nodes,n=r.edges,i=a.length,o=new Array(i),s=a,u=function(E){for(var T=0;T<o.length;T++){var L=o[T];if(L.has(E))return T}},l=0;l<i;l++)o[l]=this.spawn(a[l]);for(var f=n.sort(function(m,E){return e(m)-e(E)}),h=0;h<f.length;h++){var v=f[h],c=v.source()[0],d=v.target()[0],g=u(c),p=u(d),y=o[g],b=o[p];g!==p&&(s.merge(v),y.merge(b),o.splice(p,1))}return s}},pC=Lt({root:null,goal:null,weight:function(e){return 1},heuristic:function(e){return 0},directed:!1}),yC={aStar:function(e){var r=this.cy(),a=pC(e),n=a.root,i=a.goal,o=a.heuristic,s=a.directed,u=a.weight;n=r.collection(n)[0],i=r.collection(i)[0];var l=n.id(),f=i.id(),h={},v={},c={},d=new En(function(_,B){return v[_.id()]-v[B.id()]}),g=new La,p={},y={},b=function(B,z){d.push(B),g.add(z)},m,E,T=function(){m=d.pop(),E=m.id(),g.delete(E)},L=function(B){return g.has(B)};b(n,l),h[l]=0,v[l]=o(n);for(var w=0;d.size()>0;){if(T(),w++,E===f){for(var C=[],A=i,R=f,S=y[R];C.unshift(A),S!=null&&C.unshift(S),A=p[R],A!=null;)R=A.id(),S=y[R];return{found:!0,distance:h[E],path:this.spawn(C),steps:w}}c[E]=!0;for(var D=m._private.edges,P=0;P<D.length;P++){var x=D[P];if(this.hasElementWithId(x.id())&&!(s&&x.data("source")!==E)){var N=x.source(),M=x.target(),I=N.id()!==E?N:M,O=I.id();if(this.hasElementWithId(O)&&!c[O]){var q=h[E]+u(x);if(!L(O)){h[O]=q,v[O]=q+o(I),b(I,O),p[O]=m,y[O]=x;continue}q<h[O]&&(h[O]=q,v[O]=q+o(I),p[O]=m,y[O]=x)}}}}return{found:!1,distance:void 0,path:void 0,steps:w}}},mC=Lt({weight:function(e){return 1},directed:!1}),bC={floydWarshall:function(e){for(var r=this.cy(),a=mC(e),n=a.weight,i=a.directed,o=n,s=this.byGroup(),u=s.nodes,l=s.edges,f=u.length,h=f*f,v=function(Y){return u.indexOf(Y)},c=function(Y){return u[Y]},d=new Array(h),g=0;g<h;g++){var p=g%f,y=(g-p)/f;y===p?d[g]=0:d[g]=1/0}for(var b=new Array(h),m=new Array(h),E=0;E<l.length;E++){var T=l[E],L=T.source()[0],w=T.target()[0];if(L!==w){var C=v(L),A=v(w),R=C*f+A,S=o(T);if(d[R]>S&&(d[R]=S,b[R]=A,m[R]=T),!i){var D=A*f+C;!i&&d[D]>S&&(d[D]=S,b[D]=C,m[D]=T)}}}for(var P=0;P<f;P++)for(var x=0;x<f;x++)for(var N=x*f+P,M=0;M<f;M++){var I=x*f+M,O=P*f+M;d[N]+d[O]<d[I]&&(d[I]=d[N]+d[O],b[I]=b[N])}var q=function(Y){return(Me(Y)?r.filter(Y):Y)[0]},_=function(Y){return v(q(Y))},B={distance:function(Y,k){var G=_(Y),U=_(k);return d[G*f+U]},path:function(Y,k){var G=_(Y),U=_(k),W=c(G);if(G===U)return W.collection();if(b[G*f+U]==null)return r.collection();var j=r.collection(),H=G,V;for(j.merge(W);G!==U;)H=G,G=b[G*f+U],V=m[H*f+G],j.merge(V),j.merge(c(G));return j}};return B}},EC=Lt({weight:function(e){return 1},directed:!1,root:null}),wC={bellmanFord:function(e){var r=this,a=EC(e),n=a.weight,i=a.directed,o=a.root,s=n,u=this,l=this.cy(),f=this.byGroup(),h=f.edges,v=f.nodes,c=v.length,d=new hr,g=!1,p=[];o=l.collection(o)[0],h.unmergeBy(function(se){return se.isLoop()});for(var y=h.length,b=function(oe){var he=d.get(oe.id());return he||(he={},d.set(oe.id(),he)),he},m=function(oe){return(Me(oe)?l.$(oe):oe)[0]},E=function(oe){return b(m(oe)).dist},T=function(oe){for(var he=arguments.length>1&&arguments[1]!==void 0?arguments[1]:o,le=m(oe),de=[],pe=le;;){if(pe==null)return r.spawn();var ce=b(pe),ye=ce.edge,Le=ce.pred;if(de.unshift(pe[0]),pe.same(he)&&de.length>0)break;ye!=null&&de.unshift(ye),pe=Le}return u.spawn(de)},L=0;L<c;L++){var w=v[L],C=b(w);w.same(o)?C.dist=0:C.dist=1/0,C.pred=null,C.edge=null}for(var A=!1,R=function(oe,he,le,de,pe,ce){var ye=de.dist+ce;ye<pe.dist&&!le.same(de.edge)&&(pe.dist=ye,pe.pred=oe,pe.edge=le,A=!0)},S=1;S<c;S++){A=!1;for(var D=0;D<y;D++){var P=h[D],x=P.source(),N=P.target(),M=s(P),I=b(x),O=b(N);R(x,N,P,I,O,M),i||R(N,x,P,O,I,M)}if(!A)break}if(A)for(var q=[],_=0;_<y;_++){var B=h[_],z=B.source(),Y=B.target(),k=s(B),G=b(z).dist,U=b(Y).dist;if(G+k<U||!i&&U+k<G)if(g||(Ze("Graph contains a negative weight cycle for Bellman-Ford"),g=!0),e.findNegativeWeightCycles!==!1){var W=[];G+k<U&&W.push(z),!i&&U+k<G&&W.push(Y);for(var j=W.length,H=0;H<j;H++){var V=W[H],X=[V];X.push(b(V).edge);for(var Z=b(V).pred;X.indexOf(Z)===-1;)X.push(Z),X.push(b(Z).edge),Z=b(Z).pred;X=X.slice(X.indexOf(Z));for(var ee=X[0].id(),re=0,ue=2;ue<X.length;ue+=2)X[ue].id()<ee&&(ee=X[ue].id(),re=ue);X=X.slice(re).concat(X.slice(0,re)),X.push(X[0]);var xe=X.map(function(se){return se.id()}).join(",");q.indexOf(xe)===-1&&(p.push(u.spawn(X)),q.push(xe))}}else break}return{distanceTo:E,pathTo:T,hasNegativeWeightCycle:g,negativeWeightCycles:p}}},TC=Math.sqrt(2),xC=function(e,r,a){a.length===0&&at("Karger-Stein must be run on a connected (sub)graph");for(var n=a[e],i=n[1],o=n[2],s=r[i],u=r[o],l=a,f=l.length-1;f>=0;f--){var h=l[f],v=h[1],c=h[2];(r[v]===s&&r[c]===u||r[v]===u&&r[c]===s)&&l.splice(f,1)}for(var d=0;d<l.length;d++){var g=l[d];g[1]===u?(l[d]=g.slice(),l[d][1]=s):g[2]===u&&(l[d]=g.slice(),l[d][2]=s)}for(var p=0;p<r.length;p++)r[p]===u&&(r[p]=s);return l},Lo=function(e,r,a,n){for(;a>n;){var i=Math.floor(Math.random()*r.length);r=xC(i,e,r),a--}return r},CC={kargerStein:function(){var e=this,r=this.byGroup(),a=r.nodes,n=r.edges;n.unmergeBy(function(O){return O.isLoop()});var i=a.length,o=n.length,s=Math.ceil(Math.pow(Math.log(i)/Math.LN2,2)),u=Math.floor(i/TC);if(i<2){at("At least 2 nodes are required for Karger-Stein algorithm");return}for(var l=[],f=0;f<o;f++){var h=n[f];l.push([f,a.indexOf(h.source()),a.indexOf(h.target())])}for(var v=1/0,c=[],d=new Array(i),g=new Array(i),p=new Array(i),y=function(q,_){for(var B=0;B<i;B++)_[B]=q[B]},b=0;b<=s;b++){for(var m=0;m<i;m++)g[m]=m;var E=Lo(g,l.slice(),i,u),T=E.slice();y(g,p);var L=Lo(g,E,u,2),w=Lo(p,T,u,2);L.length<=w.length&&L.length<v?(v=L.length,c=L,y(g,d)):w.length<=L.length&&w.length<v&&(v=w.length,c=w,y(p,d))}for(var C=this.spawn(c.map(function(O){return n[O[0]]})),A=this.spawn(),R=this.spawn(),S=d[0],D=0;D<d.length;D++){var P=d[D],x=a[D];P===S?A.merge(x):R.merge(x)}var N=function(q){var _=e.spawn();return q.forEach(function(B){_.merge(B),B.connectedEdges().forEach(function(z){e.contains(z)&&!C.contains(z)&&_.merge(z)})}),_},M=[N(A),N(R)],I={cut:C,components:M,partition1:A,partition2:R};return I}},Ro,AC=function(e){return{x:e.x,y:e.y}},Ni=function(e,r,a){return{x:e.x*r+a.x,y:e.y*r+a.y}},FE=function(e,r,a){return{x:(e.x-a.x)/r,y:(e.y-a.y)/r}},ga=function(e){return{x:e[0],y:e[1]}},LC=function(e){for(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,i=r;i<a;i++){var o=e[i];isFinite(o)&&(n=Math.min(o,n))}return n},RC=function(e){for(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,i=r;i<a;i++){var o=e[i];isFinite(o)&&(n=Math.max(o,n))}return n},SC=function(e){for(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,o=r;o<a;o++){var s=e[o];isFinite(s)&&(n+=s,i++)}return n/i},DC=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,o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;n?e=e.slice(r,a):(a<e.length&&e.splice(a,e.length-a),r>0&&e.splice(0,r));for(var s=0,u=e.length-1;u>=0;u--){var l=e[u];o?isFinite(l)||(e[u]=-1/0,s++):e.splice(u,1)}i&&e.sort(function(v,c){return v-c});var f=e.length,h=Math.floor(f/2);return f%2!==0?e[h+1+s]:(e[h-1+s]+e[h+s])/2},NC=function(e){return Math.PI*e/180},Bn=function(e,r){return Math.atan2(r,e)-Math.PI/2},Ov=Math.log2||function(t){return Math.log(t)/Math.log(2)},Iv=function(e){return e>0?1:e<0?-1:0},Zr=function(e,r){return Math.sqrt(Yr(e,r))},Yr=function(e,r){var a=r.x-e.x,n=r.y-e.y;return a*a+n*n},MC=function(e){for(var r=e.length,a=0,n=0;n<r;n++)a+=e[n];for(var i=0;i<r;i++)e[i]=e[i]/a;return e},wt=function(e,r,a,n){return(1-n)*(1-n)*e+2*(1-n)*n*r+n*n*a},ma=function(e,r,a,n){return{x:wt(e.x,r.x,a.x,n),y:wt(e.y,r.y,a.y,n)}},OC=function(e,r,a,n){var i={x:r.x-e.x,y:r.y-e.y},o=Zr(e,r),s={x:i.x/o,y:i.y/o};return a=a??0,n=n??a*o,{x:e.x+s.x*n,y:e.y+s.y*n}},sn=function(e,r,a){return Math.max(e,Math.min(a,r))},Pt=function(e){if(e==null)return{x1:1/0,y1:1/0,x2:-1/0,y2:-1/0,w:0,h:0};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};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}}},IC=function(e){return{x1:e.x1,x2:e.x2,w:e.w,y1:e.y1,y2:e.y2,h:e.h}},PC=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},_E=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},Kn=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},Zn=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0],a,n,i,o;if(r.length===1)a=n=i=o=r[0];else if(r.length===2)a=i=r[0],o=n=r[1];else if(r.length===4){var s=dt(r,4);a=s[0],n=s[1],i=s[2],o=s[3]}return e.x1-=o,e.x2+=n,e.y1-=a,e.y2+=i,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},Bd=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},Pv=function(e,r){return!(e.x1>r.x2||r.x1>e.x2||e.x2<r.x1||r.x2<e.x1||e.y2<r.y1||r.y2<e.y1||e.y1>r.y2||r.y1>e.y2)},Cr=function(e,r,a){return e.x1<=r&&r<=e.x2&&e.y1<=a&&a<=e.y2},kd=function(e,r){return Cr(e,r.x,r.y)},BE=function(e,r){return Cr(e,r.x1,r.y1)&&Cr(e,r.x2,r.y2)},_C=(Ro=Math.hypot)!==null&&Ro!==void 0?Ro:function(t,e){return Math.sqrt(t*t+e*e)};function BC(t,e){if(t.length<3)throw new Error("Need at least 3 vertices");var r=function(C,A){return{x:C.x+A.x,y:C.y+A.y}},a=function(C,A){return{x:C.x-A.x,y:C.y-A.y}},n=function(C,A){return{x:C.x*A,y:C.y*A}},i=function(C,A){return C.x*A.y-C.y*A.x},o=function(C){var A=_C(C.x,C.y);return A===0?{x:0,y:0}:{x:C.x/A,y:C.y/A}},s=function(C){for(var A=0,R=0;R<C.length;R++){var S=C[R],D=C[(R+1)%C.length];A+=S.x*D.y-D.x*S.y}return A/2},u=function(C,A,R,S){var D=a(A,C),P=a(S,R),x=i(D,P);if(Math.abs(x)<1e-9)return r(C,n(D,.5));var N=i(a(R,C),P)/x;return r(C,n(D,N))},l=t.map(function(w){return{x:w.x,y:w.y}});s(l)<0&&l.reverse();for(var f=l.length,h=[],v=0;v<f;v++){var c=l[v],d=l[(v+1)%f],g=a(d,c),p=o({x:g.y,y:-g.x});h.push(p)}for(var y=h.map(function(w,C){var A=r(l[C],n(w,e)),R=r(l[(C+1)%f],n(w,e));return{p1:A,p2:R}}),b=[],m=0;m<f;m++){var E=y[(m-1+f)%f],T=y[m],L=u(E.p1,E.p2,T.p1,T.p2);b.push(L)}return b}function kC(t,e,r,a,n,i){var o=$C(t,e,r,a,n),s=BC(o,i),u=Pt();return s.forEach(function(l){return _E(u,l.x,l.y)}),u}var kE=function(e,r,a,n,i,o,s){var u=arguments.length>7&&arguments[7]!==void 0?arguments[7]:"auto",l=u==="auto"?Nr(i,o):u,f=i/2,h=o/2;l=Math.min(l,f,h);var v=l!==f,c=l!==h,d;if(v){var g=a-f+l-s,p=n-h-s,y=a+f-l+s,b=p;if(d=Ar(e,r,a,n,g,p,y,b,!1),d.length>0)return d}if(c){var m=a+f+s,E=n-h+l-s,T=m,L=n+h-l+s;if(d=Ar(e,r,a,n,m,E,T,L,!1),d.length>0)return d}if(v){var w=a-f+l-s,C=n+h+s,A=a+f-l+s,R=C;if(d=Ar(e,r,a,n,w,C,A,R,!1),d.length>0)return d}if(c){var S=a-f-s,D=n-h+l-s,P=S,x=n+h-l+s;if(d=Ar(e,r,a,n,S,D,P,x,!1),d.length>0)return d}var N;{var M=a-f+l,I=n-h+l;if(N=Wa(e,r,a,n,M,I,l+s),N.length>0&&N[0]<=M&&N[1]<=I)return[N[0],N[1]]}{var O=a+f-l,q=n-h+l;if(N=Wa(e,r,a,n,O,q,l+s),N.length>0&&N[0]>=O&&N[1]<=q)return[N[0],N[1]]}{var _=a+f-l,B=n+h-l;if(N=Wa(e,r,a,n,_,B,l+s),N.length>0&&N[0]>=_&&N[1]>=B)return[N[0],N[1]]}{var z=a-f+l,Y=n+h-l;if(N=Wa(e,r,a,n,z,Y,l+s),N.length>0&&N[0]<=z&&N[1]>=Y)return[N[0],N[1]]}return[]},qC=function(e,r,a,n,i,o,s){var u=s,l=Math.min(a,i),f=Math.max(a,i),h=Math.min(n,o),v=Math.max(n,o);return l-u<=e&&e<=f+u&&h-u<=r&&r<=v+u},GC=function(e,r,a,n,i,o,s,u,l){var f={x1:Math.min(a,s,i)-l,x2:Math.max(a,s,i)+l,y1:Math.min(n,u,o)-l,y2:Math.max(n,u,o)+l};return!(e<f.x1||e>f.x2||r<f.y1||r>f.y2)},UC=function(e,r,a,n){a-=n;var i=r*r-4*e*a;if(i<0)return[];var o=Math.sqrt(i),s=2*e,u=(-r+o)/s,l=(-r-o)/s;return[u,l]},zC=function(e,r,a,n,i){var o=1e-5;e===0&&(e=o),r/=e,a/=e,n/=e;var s,u,l,f,h,v,c,d;if(u=(3*a-r*r)/9,l=-(27*n)+r*(9*a-2*(r*r)),l/=54,s=u*u*u+l*l,i[1]=0,c=r/3,s>0){h=l+Math.sqrt(s),h=h<0?-Math.pow(-h,1/3):Math.pow(h,1/3),v=l-Math.sqrt(s),v=v<0?-Math.pow(-v,1/3):Math.pow(v,1/3),i[0]=-c+h+v,c+=(h+v)/2,i[4]=i[2]=-c,c=Math.sqrt(3)*(-v+h)/2,i[3]=c,i[5]=-c;return}if(i[5]=i[3]=0,s===0){d=l<0?-Math.pow(-l,1/3):Math.pow(l,1/3),i[0]=-c+2*d,i[4]=i[2]=-(d+c);return}u=-u,f=u*u*u,f=Math.acos(l/Math.sqrt(f)),d=2*Math.sqrt(u),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)},VC=function(e,r,a,n,i,o,s,u){var l=1*a*a-4*a*i+2*a*s+4*i*i-4*i*s+s*s+n*n-4*n*o+2*n*u+4*o*o-4*o*u+u*u,f=9*a*i-3*a*a-3*a*s-6*i*i+3*i*s+9*n*o-3*n*n-3*n*u-6*o*o+3*o*u,h=3*a*a-6*a*i+a*s-a*e+2*i*i+2*i*e-s*e+3*n*n-6*n*o+n*u-n*r+2*o*o+2*o*r-u*r,v=1*a*i-a*a+a*e-i*e+n*o-n*n+n*r-o*r,c=[];zC(l,f,h,v,c);for(var d=1e-7,g=[],p=0;p<6;p+=2)Math.abs(c[p+1])<d&&c[p]>=0&&c[p]<=1&&g.push(c[p]);g.push(1),g.push(0);for(var y=-1,b,m,E,T=0;T<g.length;T++)b=Math.pow(1-g[T],2)*a+2*(1-g[T])*g[T]*i+g[T]*g[T]*s,m=Math.pow(1-g[T],2)*n+2*(1-g[T])*g[T]*o+g[T]*g[T]*u,E=Math.pow(b-e,2)+Math.pow(m-r,2),y>=0?E<y&&(y=E):y=E;return y},YC=function(e,r,a,n,i,o){var s=[e-a,r-n],u=[i-a,o-n],l=u[0]*u[0]+u[1]*u[1],f=s[0]*s[0]+s[1]*s[1],h=s[0]*u[0]+s[1]*u[1],v=h*h/l;return h<0?f:v>l?(e-i)*(e-i)+(r-o)*(r-o):f-v},Bt=function(e,r,a){for(var n,i,o,s,u,l=0,f=0;f<a.length/2;f++)if(n=a[f*2],i=a[f*2+1],f+1<a.length/2?(o=a[(f+1)*2],s=a[(f+1)*2+1]):(o=a[(f+1-a.length/2)*2],s=a[(f+1-a.length/2)*2+1]),!(n==e&&o==e))if(n>=e&&e>=o||n<=e&&e<=o)u=(e-n)/(o-n)*(s-i)+i,u>r&&l++;else continue;return l%2!==0},vr=function(e,r,a,n,i,o,s,u,l){var f=new Array(a.length),h;u[0]!=null?(h=Math.atan(u[1]/u[0]),u[0]<0?h=h+Math.PI/2:h=-h-Math.PI/2):h=u;for(var v=Math.cos(-h),c=Math.sin(-h),d=0;d<f.length/2;d++)f[d*2]=o/2*(a[d*2]*v-a[d*2+1]*c),f[d*2+1]=s/2*(a[d*2+1]*v+a[d*2]*c),f[d*2]+=n,f[d*2+1]+=i;var g;if(l>0){var p=yi(f,-l);g=pi(p)}else g=f;return Bt(e,r,g)},HC=function(e,r,a,n,i,o,s,u){for(var l=new Array(a.length*2),f=0;f<u.length;f++){var h=u[f];l[f*4+0]=h.startX,l[f*4+1]=h.startY,l[f*4+2]=h.stopX,l[f*4+3]=h.stopY;var v=Math.pow(h.cx-e,2)+Math.pow(h.cy-r,2);if(v<=Math.pow(h.radius,2))return!0}return Bt(e,r,l)},pi=function(e){for(var r=new Array(e.length/2),a,n,i,o,s,u,l,f,h=0;h<e.length/4;h++){a=e[h*4],n=e[h*4+1],i=e[h*4+2],o=e[h*4+3],h<e.length/4-1?(s=e[(h+1)*4],u=e[(h+1)*4+1],l=e[(h+1)*4+2],f=e[(h+1)*4+3]):(s=e[0],u=e[1],l=e[2],f=e[3]);var v=Ar(a,n,i,o,s,u,l,f,!0);r[h*2]=v[0],r[h*2+1]=v[1]}return r},yi=function(e,r){for(var a=new Array(e.length*2),n,i,o,s,u=0;u<e.length/2;u++){n=e[u*2],i=e[u*2+1],u<e.length/2-1?(o=e[(u+1)*2],s=e[(u+1)*2+1]):(o=e[0],s=e[1]);var l=s-i,f=-(o-n),h=Math.sqrt(l*l+f*f),v=l/h,c=f/h;a[u*4]=n+v*r,a[u*4+1]=i+c*r,a[u*4+2]=o+v*r,a[u*4+3]=s+c*r}return a},XC=function(e,r,a,n,i,o){var s=a-e,u=n-r;s/=i,u/=o;var l=Math.sqrt(s*s+u*u),f=l-1;if(f<0)return[];var h=f/l;return[(a-e)*h+e,(n-r)*h+r]},Wr=function(e,r,a,n,i,o,s){return e-=i,r-=o,e/=a/2+s,r/=n/2+s,e*e+r*r<=1},Wa=function(e,r,a,n,i,o,s){var u=[a-e,n-r],l=[e-i,r-o],f=u[0]*u[0]+u[1]*u[1],h=2*(l[0]*u[0]+l[1]*u[1]),v=l[0]*l[0]+l[1]*l[1]-s*s,c=h*h-4*f*v;if(c<0)return[];var d=(-h+Math.sqrt(c))/(2*f),g=(-h-Math.sqrt(c))/(2*f),p=Math.min(d,g),y=Math.max(d,g),b=[];if(p>=0&&p<=1&&b.push(p),y>=0&&y<=1&&b.push(y),b.length===0)return[];var m=b[0]*u[0]+e,E=b[0]*u[1]+r;if(b.length>1){if(b[0]==b[1])return[m,E];var T=b[1]*u[0]+e,L=b[1]*u[1]+r;return[m,E,T,L]}else return[m,E]},So=function(e,r,a){return r<=e&&e<=a||a<=e&&e<=r?e:e<=r&&r<=a||a<=r&&r<=e?r:a},Ar=function(e,r,a,n,i,o,s,u,l){var f=e-i,h=a-e,v=s-i,c=r-o,d=n-r,g=u-o,p=v*c-g*f,y=h*c-d*f,b=g*h-v*d;if(b!==0){var m=p/b,E=y/b,T=.001,L=0-T,w=1+T;return L<=m&&m<=w&&L<=E&&E<=w?[e+m*h,r+m*d]:l?[e+m*h,r+m*d]:[]}else return p===0||y===0?So(e,a,s)===s?[s,u]:So(e,a,i)===i?[i,o]:So(i,s,a)===a?[a,n]:[]:[]},$C=function(e,r,a,n,i){var o=[],s=n/2,u=i/2,l=r,f=a;o.push({x:l+s*e[0],y:f+u*e[1]});for(var h=1;h<e.length/2;h++)o.push({x:l+s*e[h*2],y:f+u*e[h*2+1]});return o},un=function(e,r,a,n,i,o,s,u){var l=[],f,h=new Array(a.length),v=!0;o==null&&(v=!1);var c;if(v){for(var d=0;d<h.length/2;d++)h[d*2]=a[d*2]*o+n,h[d*2+1]=a[d*2+1]*s+i;if(u>0){var g=yi(h,-u);c=pi(g)}else c=h}else c=a;for(var p,y,b,m,E=0;E<c.length/2;E++)p=c[E*2],y=c[E*2+1],E<c.length/2-1?(b=c[(E+1)*2],m=c[(E+1)*2+1]):(b=c[0],m=c[1]),f=Ar(e,r,n,i,p,y,b,m),f.length!==0&&l.push(f[0],f[1]);return l},WC=function(e,r,a,n,i,o,s,u,l){var f=[],h,v=new Array(a.length*2);l.forEach(function(b,m){m===0?(v[v.length-2]=b.startX,v[v.length-1]=b.startY):(v[m*4-2]=b.startX,v[m*4-1]=b.startY),v[m*4]=b.stopX,v[m*4+1]=b.stopY,h=Wa(e,r,n,i,b.cx,b.cy,b.radius),h.length!==0&&f.push(h[0],h[1])});for(var c=0;c<v.length/4;c++)h=Ar(e,r,n,i,v[c*4],v[c*4+1],v[c*4+2],v[c*4+3],!1),h.length!==0&&f.push(h[0],h[1]);if(f.length>2){for(var d=[f[0],f[1]],g=Math.pow(d[0]-e,2)+Math.pow(d[1]-r,2),p=1;p<f.length/2;p++){var y=Math.pow(f[p*2]-e,2)+Math.pow(f[p*2+1]-r,2);y<=g&&(d[0]=f[p*2],d[1]=f[p*2+1],g=y)}return d}return f},kn=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]),o=(i-a)/i;return o<0&&(o=1e-5),[r[0]+o*n[0],r[1]+o*n[1]]},It=function(e,r){var a=iv(e,r);return a=qE(a),a},qE=function(e){for(var r,a,n=e.length/2,i=1/0,o=1/0,s=-1/0,u=-1/0,l=0;l<n;l++)r=e[2*l],a=e[2*l+1],i=Math.min(i,r),s=Math.max(s,r),o=Math.min(o,a),u=Math.max(u,a);for(var f=2/(s-i),h=2/(u-o),v=0;v<n;v++)r=e[2*v]=e[2*v]*f,a=e[2*v+1]=e[2*v+1]*h,i=Math.min(i,r),s=Math.max(s,r),o=Math.min(o,a),u=Math.max(u,a);if(o<-1)for(var c=0;c<n;c++)a=e[2*c+1]=e[2*c+1]+(-1-o);return e},iv=function(e,r){var a=1/e*2*Math.PI,n=e%2===0?Math.PI/2+a/2:Math.PI/2;n+=r;for(var i=new Array(e*2),o,s=0;s<e;s++)o=s*a+n,i[2*s]=Math.cos(o),i[2*s+1]=Math.sin(-o);return i},Nr=function(e,r){return Math.min(e/4,r/4,8)},GE=function(e,r){return Math.min(e/10,r/10,8)},Fv=function(){return 8},KC=function(e,r,a){return[e-2*r+a,2*(r-e),e]},ov=function(e,r){return{heightOffset:Math.min(15,.05*r),widthOffset:Math.min(100,.25*e),ctrlPtOffsetPct:.05}};function Do(t,e){function r(h){for(var v=[],c=0;c<h.length;c++){var d=h[c],g=h[(c+1)%h.length],p={x:g.x-d.x,y:g.y-d.y},y={x:-p.y,y:p.x},b=Math.sqrt(y.x*y.x+y.y*y.y);v.push({x:y.x/b,y:y.y/b})}return v}function a(h,v){var c=1/0,d=-1/0,g=kt(h),p;try{for(g.s();!(p=g.n()).done;){var y=p.value,b=y.x*v.x+y.y*v.y;c=Math.min(c,b),d=Math.max(d,b)}}catch(m){g.e(m)}finally{g.f()}return{min:c,max:d}}function n(h,v){return!(h.max<v.min||v.max<h.min)}var i=[].concat(ci(r(t)),ci(r(e))),o=kt(i),s;try{for(o.s();!(s=o.n()).done;){var u=s.value,l=a(t,u),f=a(e,u);if(!n(l,f))return!1}}catch(h){o.e(h)}finally{o.f()}return!0}var ZC=Lt({dampingFactor:.8,precision:1e-6,iterations:200,weight:function(e){return 1}}),QC={pageRank:function(e){for(var r=ZC(e),a=r.dampingFactor,n=r.precision,i=r.iterations,o=r.weight,s=this._private.cy,u=this.byGroup(),l=u.nodes,f=u.edges,h=l.length,v=h*h,c=f.length,d=new Array(v),g=new Array(h),p=(1-a)/h,y=0;y<h;y++){for(var b=0;b<h;b++){var m=y*h+b;d[m]=0}g[y]=0}for(var E=0;E<c;E++){var T=f[E],L=T.data("source"),w=T.data("target");if(L!==w){var C=l.indexOfId(L),A=l.indexOfId(w),R=o(T),S=A*h+C;d[S]+=R,g[C]+=R}}for(var D=1/h+p,P=0;P<h;P++)if(g[P]===0)for(var x=0;x<h;x++){var N=x*h+P;d[N]=D}else for(var M=0;M<h;M++){var I=M*h+P;d[I]=d[I]/g[P]+p}for(var O=new Array(h),q=new Array(h),_,B=0;B<h;B++)O[B]=1;for(var z=0;z<i;z++){for(var Y=0;Y<h;Y++)q[Y]=0;for(var k=0;k<h;k++)for(var G=0;G<h;G++){var U=k*h+G;q[k]+=d[U]*O[G]}MC(q),_=O,O=q,q=_;for(var W=0,j=0;j<h;j++){var H=_[j]-O[j];W+=H*H}if(W<n)break}var V={rank:function(Z){return Z=s.collection(Z)[0],O[l.indexOf(Z)]}};return V}},qd=Lt({root:null,weight:function(e){return 1},directed:!1,alpha:0}),ba={degreeCentralityNormalized:function(e){e=qd(e);var r=this.cy(),a=this.nodes(),n=a.length;if(e.directed){for(var f={},h={},v=0,c=0,d=0;d<n;d++){var g=a[d],p=g.id();e.root=g;var y=this.degreeCentrality(e);v<y.indegree&&(v=y.indegree),c<y.outdegree&&(c=y.outdegree),f[p]=y.indegree,h[p]=y.outdegree}return{indegree:function(m){return v==0?0:(Me(m)&&(m=r.filter(m)),f[m.id()]/v)},outdegree:function(m){return c===0?0:(Me(m)&&(m=r.filter(m)),h[m.id()]/c)}}}else{for(var i={},o=0,s=0;s<n;s++){var u=a[s];e.root=u;var l=this.degreeCentrality(e);o<l.degree&&(o=l.degree),i[u.id()]=l.degree}return{degree:function(m){return o===0?0:(Me(m)&&(m=r.filter(m)),i[m.id()]/o)}}}},degreeCentrality:function(e){e=qd(e);var r=this.cy(),a=this,n=e,i=n.root,o=n.weight,s=n.directed,u=n.alpha;if(i=r.collection(i)[0],s){for(var c=i.connectedEdges(),d=c.filter(function(L){return L.target().same(i)&&a.has(L)}),g=c.filter(function(L){return L.source().same(i)&&a.has(L)}),p=d.length,y=g.length,b=0,m=0,E=0;E<d.length;E++)b+=o(d[E]);for(var T=0;T<g.length;T++)m+=o(g[T]);return{indegree:Math.pow(p,1-u)*Math.pow(b,u),outdegree:Math.pow(y,1-u)*Math.pow(m,u)}}else{for(var l=i.connectedEdges().intersection(a),f=l.length,h=0,v=0;v<l.length;v++)h+=o(l[v]);return{degree:Math.pow(f,1-u)*Math.pow(h,u)}}}};ba.dc=ba.degreeCentrality;ba.dcn=ba.degreeCentralityNormalised=ba.degreeCentralityNormalized;var Gd=Lt({harmonic:!0,weight:function(){return 1},directed:!1,root:null}),Ea={closenessCentralityNormalized:function(e){for(var r=Gd(e),a=r.harmonic,n=r.weight,i=r.directed,o=this.cy(),s={},u=0,l=this.nodes(),f=this.floydWarshall({weight:n,directed:i}),h=0;h<l.length;h++){for(var v=0,c=l[h],d=0;d<l.length;d++)if(h!==d){var g=f.distance(c,l[d]);a?v+=1/g:v+=g}a||(v=1/v),u<v&&(u=v),s[c.id()]=v}return{closeness:function(y){return u==0?0:(Me(y)?y=o.filter(y)[0].id():y=y.id(),s[y]/u)}}},closenessCentrality:function(e){var r=Gd(e),a=r.root,n=r.weight,i=r.directed,o=r.harmonic;a=this.filter(a)[0];for(var s=this.dijkstra({root:a,weight:n,directed:i}),u=0,l=this.nodes(),f=0;f<l.length;f++){var h=l[f];if(!h.same(a)){var v=s.distanceTo(h);o?u+=1/v:u+=v}}return o?u:1/u}};Ea.cc=Ea.closenessCentrality;Ea.ccn=Ea.closenessCentralityNormalised=Ea.closenessCentralityNormalized;var JC=Lt({weight:null,directed:!1}),sv={betweennessCentrality:function(e){for(var r=JC(e),a=r.directed,n=r.weight,i=n!=null,o=this.cy(),s=this.nodes(),u={},l={},f=0,h={set:function(m,E){l[m]=E,E>f&&(f=E)},get:function(m){return l[m]}},v=0;v<s.length;v++){var c=s[v],d=c.id();a?u[d]=c.outgoers().nodes():u[d]=c.openNeighborhood().nodes(),h.set(d,0)}for(var g=function(){for(var m=s[p].id(),E=[],T={},L={},w={},C=new En(function(k,G){return w[k]-w[G]}),A=0;A<s.length;A++){var R=s[A].id();T[R]=[],L[R]=0,w[R]=1/0}for(L[m]=1,w[m]=0,C.push(m);!C.empty();){var S=C.pop();if(E.push(S),i)for(var D=0;D<u[S].length;D++){var P=u[S][D],x=o.getElementById(S),N=void 0;x.edgesTo(P).length>0?N=x.edgesTo(P)[0]:N=P.edgesTo(x)[0];var M=n(N);P=P.id(),w[P]>w[S]+M&&(w[P]=w[S]+M,C.nodes.indexOf(P)<0?C.push(P):C.updateItem(P),L[P]=0,T[P]=[]),w[P]==w[S]+M&&(L[P]=L[P]+L[S],T[P].push(S))}else for(var I=0;I<u[S].length;I++){var O=u[S][I].id();w[O]==1/0&&(C.push(O),w[O]=w[S]+1),w[O]==w[S]+1&&(L[O]=L[O]+L[S],T[O].push(S))}}for(var q={},_=0;_<s.length;_++)q[s[_].id()]=0;for(;E.length>0;){for(var B=E.pop(),z=0;z<T[B].length;z++){var Y=T[B][z];q[Y]=q[Y]+L[Y]/L[B]*(1+q[B])}B!=s[p].id()&&h.set(B,h.get(B)+q[B])}},p=0;p<s.length;p++)g();var y={betweenness:function(m){var E=o.collection(m).id();return h.get(E)},betweennessNormalized:function(m){if(f==0)return 0;var E=o.collection(m).id();return h.get(E)/f}};return y.betweennessNormalised=y.betweennessNormalized,y}};sv.bc=sv.betweennessCentrality;var jC=Lt({expandFactor:2,inflateFactor:2,multFactor:1,maxIterations:20,attributes:[function(t){return 1}]}),eA=function(e){return jC(e)},tA=function(e,r){for(var a=0,n=0;n<r.length;n++)a+=r[n](e);return a},rA=function(e,r,a){for(var n=0;n<r;n++)e[n*r+n]=a},UE=function(e,r){for(var a,n=0;n<r;n++){a=0;for(var i=0;i<r;i++)a+=e[i*r+n];for(var o=0;o<r;o++)e[o*r+n]=e[o*r+n]/a}},aA=function(e,r,a){for(var n=new Array(a*a),i=0;i<a;i++){for(var o=0;o<a;o++)n[i*a+o]=0;for(var s=0;s<a;s++)for(var u=0;u<a;u++)n[i*a+u]+=e[i*a+s]*r[s*a+u]}return n},nA=function(e,r,a){for(var n=e.slice(0),i=1;i<a;i++)e=aA(e,n,r);return e},iA=function(e,r,a){for(var n=new Array(r*r),i=0;i<r*r;i++)n[i]=Math.pow(e[i],a);return UE(n,r),n},oA=function(e,r,a,n){for(var i=0;i<a;i++){var o=Math.round(e[i]*Math.pow(10,n))/Math.pow(10,n),s=Math.round(r[i]*Math.pow(10,n))/Math.pow(10,n);if(o!==s)return!1}return!0},sA=function(e,r,a,n){for(var i=[],o=0;o<r;o++){for(var s=[],u=0;u<r;u++)Math.round(e[o*r+u]*1e3)/1e3>0&&s.push(a[u]);s.length!==0&&i.push(n.collection(s))}return i},uA=function(e,r){for(var a=0;a<e.length;a++)if(!r[a]||e[a].id()!==r[a].id())return!1;return!0},lA=function(e){for(var r=0;r<e.length;r++)for(var a=0;a<e.length;a++)r!=a&&uA(e[r],e[a])&&e.splice(a,1);return e},Ud=function(e){for(var r=this.nodes(),a=this.edges(),n=this.cy(),i=eA(e),o={},s=0;s<r.length;s++)o[r[s].id()]=s;for(var u=r.length,l=u*u,f=new Array(l),h,v=0;v<l;v++)f[v]=0;for(var c=0;c<a.length;c++){var d=a[c],g=o[d.source().id()],p=o[d.target().id()],y=tA(d,i.attributes);f[g*u+p]+=y,f[p*u+g]+=y}rA(f,u,i.multFactor),UE(f,u);for(var b=!0,m=0;b&&m<i.maxIterations;)b=!1,h=nA(f,u,i.expandFactor),f=iA(h,u,i.inflateFactor),oA(f,h,l,4)||(b=!0),m++;var E=sA(f,u,r,n);return E=lA(E),E},fA={markovClustering:Ud,mcl:Ud},hA=function(e){return e},zE=function(e,r){return Math.abs(r-e)},zd=function(e,r,a){return e+zE(r,a)},Vd=function(e,r,a){return e+Math.pow(a-r,2)},cA=function(e){return Math.sqrt(e)},vA=function(e,r,a){return Math.max(e,zE(r,a))},Ua=function(e,r,a,n,i){for(var o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:hA,s=n,u,l,f=0;f<e;f++)u=r(f),l=a(f),s=i(s,u,l);return o(s)},xa={euclidean:function(e,r,a){return e>=2?Ua(e,r,a,0,Vd,cA):Ua(e,r,a,0,zd)},squaredEuclidean:function(e,r,a){return Ua(e,r,a,0,Vd)},manhattan:function(e,r,a){return Ua(e,r,a,0,zd)},max:function(e,r,a){return Ua(e,r,a,-1/0,vA)}};xa["squared-euclidean"]=xa.squaredEuclidean;xa.squaredeuclidean=xa.squaredEuclidean;function Mi(t,e,r,a,n,i){var o;return ot(t)?o=t:o=xa[t]||xa.euclidean,e===0&&ot(t)?o(n,i):o(e,r,a,n,i)}var dA=Lt({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),_v=function(e){return dA(e)},mi=function(e,r,a,n,i){var o=i!=="kMedoids",s=o?function(h){return a[h]}:function(h){return n[h](a)},u=function(v){return n[v](r)},l=a,f=r;return Mi(e,n.length,s,u,l,f)},No=function(e,r,a){for(var n=a.length,i=new Array(n),o=new Array(n),s=new Array(r),u=null,l=0;l<n;l++)i[l]=e.min(a[l]).value,o[l]=e.max(a[l]).value;for(var f=0;f<r;f++){u=[];for(var h=0;h<n;h++)u[h]=Math.random()*(o[h]-i[h])+i[h];s[f]=u}return s},VE=function(e,r,a,n,i){for(var o=1/0,s=0,u=0;u<r.length;u++){var l=mi(a,e,r[u],n,i);l<o&&(o=l,s=u)}return s},YE=function(e,r,a){for(var n=[],i=null,o=0;o<r.length;o++)i=r[o],a[i.id()]===e&&n.push(i);return n},gA=function(e,r,a){return Math.abs(r-e)<=a},pA=function(e,r,a){for(var n=0;n<e.length;n++)for(var i=0;i<e[n].length;i++){var o=Math.abs(e[n][i]-r[n][i]);if(o>a)return!1}return!0},yA=function(e,r,a){for(var n=0;n<a;n++)if(e===r[n])return!0;return!1},Yd=function(e,r){var a=new Array(r);if(e.length<50)for(var n=0;n<r;n++){for(var i=e[Math.floor(Math.random()*e.length)];yA(i,a,n);)i=e[Math.floor(Math.random()*e.length)];a[n]=i}else for(var o=0;o<r;o++)a[o]=e[Math.floor(Math.random()*e.length)];return a},Hd=function(e,r,a){for(var n=0,i=0;i<r.length;i++)n+=mi("manhattan",r[i],e,a,"kMedoids");return n},mA=function(e){var r=this.cy(),a=this.nodes(),n=null,i=_v(e),o=new Array(i.k),s={},u;i.testMode?typeof i.testCentroids=="number"?(i.testCentroids,u=No(a,i.k,i.attributes)):bt(i.testCentroids)==="object"?u=i.testCentroids:u=No(a,i.k,i.attributes):u=No(a,i.k,i.attributes);for(var l=!0,f=0;l&&f<i.maxIterations;){for(var h=0;h<a.length;h++)n=a[h],s[n.id()]=VE(n,u,i.distance,i.attributes,"kMeans");l=!1;for(var v=0;v<i.k;v++){var c=YE(v,a,s);if(c.length!==0){for(var d=i.attributes.length,g=u[v],p=new Array(d),y=new Array(d),b=0;b<d;b++){y[b]=0;for(var m=0;m<c.length;m++)n=c[m],y[b]+=i.attributes[b](n);p[b]=y[b]/c.length,gA(p[b],g[b],i.sensitivityThreshold)||(l=!0)}u[v]=p,o[v]=r.collection(c)}}f++}return o},bA=function(e){var r=this.cy(),a=this.nodes(),n=null,i=_v(e),o=new Array(i.k),s,u={},l,f=new Array(i.k);i.testMode?typeof i.testCentroids=="number"||(bt(i.testCentroids)==="object"?s=i.testCentroids:s=Yd(a,i.k)):s=Yd(a,i.k);for(var h=!0,v=0;h&&v<i.maxIterations;){for(var c=0;c<a.length;c++)n=a[c],u[n.id()]=VE(n,s,i.distance,i.attributes,"kMedoids");h=!1;for(var d=0;d<s.length;d++){var g=YE(d,a,u);if(g.length!==0){f[d]=Hd(s[d],g,i.attributes);for(var p=0;p<g.length;p++)l=Hd(g[p],g,i.attributes),l<f[d]&&(f[d]=l,s[d]=g[p],h=!0);o[d]=r.collection(g)}}v++}return o},EA=function(e,r,a,n,i){for(var o,s,u=0;u<r.length;u++)for(var l=0;l<e.length;l++)n[u][l]=Math.pow(a[u][l],i.m);for(var f=0;f<e.length;f++)for(var h=0;h<i.attributes.length;h++){o=0,s=0;for(var v=0;v<r.length;v++)o+=n[v][f]*i.attributes[h](r[v]),s+=n[v][f];e[f][h]=o/s}},wA=function(e,r,a,n,i){for(var o=0;o<e.length;o++)r[o]=e[o].slice();for(var s,u,l,f=2/(i.m-1),h=0;h<a.length;h++)for(var v=0;v<n.length;v++){s=0;for(var c=0;c<a.length;c++)u=mi(i.distance,n[v],a[h],i.attributes,"cmeans"),l=mi(i.distance,n[v],a[c],i.attributes,"cmeans"),s+=Math.pow(u/l,f);e[v][h]=1/s}},TA=function(e,r,a,n){for(var i=new Array(a.k),o=0;o<i.length;o++)i[o]=[];for(var s,u,l=0;l<r.length;l++){s=-1/0,u=-1;for(var f=0;f<r[0].length;f++)r[l][f]>s&&(s=r[l][f],u=f);i[u].push(e[l])}for(var h=0;h<i.length;h++)i[h]=n.collection(i[h]);return i},Xd=function(e){var r=this.cy(),a=this.nodes(),n=_v(e),i,o,s,u,l;u=new Array(a.length);for(var f=0;f<a.length;f++)u[f]=new Array(n.k);s=new Array(a.length);for(var h=0;h<a.length;h++)s[h]=new Array(n.k);for(var v=0;v<a.length;v++){for(var c=0,d=0;d<n.k;d++)s[v][d]=Math.random(),c+=s[v][d];for(var g=0;g<n.k;g++)s[v][g]=s[v][g]/c}o=new Array(n.k);for(var p=0;p<n.k;p++)o[p]=new Array(n.attributes.length);l=new Array(a.length);for(var y=0;y<a.length;y++)l[y]=new Array(n.k);for(var b=!0,m=0;b&&m<n.maxIterations;)b=!1,EA(o,a,s,l,n),wA(s,u,o,a,n),pA(s,u,n.sensitivityThreshold)||(b=!0),m++;return i=TA(a,s,n,r),{clusters:i,degreeOfMembership:s}},xA={kMeans:mA,kMedoids:bA,fuzzyCMeans:Xd,fcm:Xd},CA=Lt({distance:"euclidean",linkage:"min",mode:"threshold",threshold:1/0,addDendrogram:!1,dendrogramDepth:0,attributes:[]}),AA={single:"min",complete:"max"},LA=function(e){var r=CA(e),a=AA[r.linkage];return a!=null&&(r.linkage=a),r},$d=function(e,r,a,n,i){for(var o=0,s=1/0,u,l=i.attributes,f=function(A,R){return Mi(i.distance,l.length,function(S){return l[S](A)},function(S){return l[S](R)},A,R)},h=0;h<e.length;h++){var v=e[h].key,c=a[v][n[v]];c<s&&(o=v,s=c)}if(i.mode==="threshold"&&s>=i.threshold||i.mode==="dendrogram"&&e.length===1)return!1;var d=r[o],g=r[n[o]],p;i.mode==="dendrogram"?p={left:d,right:g,key:d.key}:p={value:d.value.concat(g.value),key:d.key},e[d.index]=p,e.splice(g.index,1),r[d.key]=p;for(var y=0;y<e.length;y++){var b=e[y];d.key===b.key?u=1/0:i.linkage==="min"?(u=a[d.key][b.key],a[d.key][b.key]>a[g.key][b.key]&&(u=a[g.key][b.key])):i.linkage==="max"?(u=a[d.key][b.key],a[d.key][b.key]<a[g.key][b.key]&&(u=a[g.key][b.key])):i.linkage==="mean"?u=(a[d.key][b.key]*d.size+a[g.key][b.key]*g.size)/(d.size+g.size):i.mode==="dendrogram"?u=f(b.value,d.value):u=f(b.value[0],d.value[0]),a[d.key][b.key]=a[b.key][d.key]=u}for(var m=0;m<e.length;m++){var E=e[m].key;if(n[E]===d.key||n[E]===g.key){for(var T=E,L=0;L<e.length;L++){var w=e[L].key;a[E][w]<a[E][T]&&(T=w)}n[E]=T}e[m].index=m}return d.key=g.key=d.index=g.index=null,!0},pa=function(e,r,a){e&&(e.value?r.push(e.value):(e.left&&pa(e.left,r),e.right&&pa(e.right,r)))},uv=function(e,r){if(!e)return"";if(e.left&&e.right){var a=uv(e.left,r),n=uv(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()},lv=function(e,r,a){if(!e)return[];var n=[],i=[],o=[];return r===0?(e.left&&pa(e.left,n),e.right&&pa(e.right,i),o=n.concat(i),[a.collection(o)]):r===1?e.value?[a.collection(e.value)]:(e.left&&pa(e.left,n),e.right&&pa(e.right,i),[a.collection(n),a.collection(i)]):e.value?[a.collection(e.value)]:(e.left&&(n=lv(e.left,r-1,a)),e.right&&(i=lv(e.right,r-1,a)),n.concat(i))},Wd=function(e){for(var r=this.cy(),a=this.nodes(),n=LA(e),i=n.attributes,o=function(m,E){return Mi(n.distance,i.length,function(T){return i[T](m)},function(T){return i[T](E)},m,E)},s=[],u=[],l=[],f=[],h=0;h<a.length;h++){var v={value:n.mode==="dendrogram"?a[h]:[a[h]],key:h,index:h};s[h]=v,f[h]=v,u[h]=[],l[h]=0}for(var c=0;c<s.length;c++)for(var d=0;d<=c;d++){var g=void 0;n.mode==="dendrogram"?g=c===d?1/0:o(s[c].value,s[d].value):g=c===d?1/0:o(s[c].value[0],s[d].value[0]),u[c][d]=g,u[d][c]=g,g<u[c][l[c]]&&(l[c]=d)}for(var p=$d(s,f,u,l,n);p;)p=$d(s,f,u,l,n);var y;return n.mode==="dendrogram"?(y=lv(s[0],n.dendrogramDepth,r),n.addDendrogram&&uv(s[0],r)):(y=new Array(s.length),s.forEach(function(b,m){b.key=b.index=null,y[m]=r.collection(b.value)})),y},RA={hierarchicalClustering:Wd,hca:Wd},SA=Lt({distance:"euclidean",preference:"median",damping:.8,maxIterations:1e3,minIterations:100,attributes:[]}),DA=function(e){var r=e.damping,a=e.preference;.5<=r&&r<1||at("Damping must range on [0.5, 1). Got: ".concat(r));var n=["median","mean","min","max"];return n.some(function(i){return i===a})||Te(a)||at("Preference must be one of [".concat(n.map(function(i){return"'".concat(i,"'")}).join(", "),"] or a number. Got: ").concat(a)),SA(e)},NA=function(e,r,a,n){var i=function(s,u){return n[u](s)};return-Mi(e,n.length,function(o){return i(r,o)},function(o){return i(a,o)},r,a)},MA=function(e,r){var a=null;return r==="median"?a=DC(e):r==="mean"?a=SC(e):r==="min"?a=LC(e):r==="max"?a=RC(e):a=r,a},OA=function(e,r,a){for(var n=[],i=0;i<e;i++)r[i*e+i]+a[i*e+i]>0&&n.push(i);return n},Kd=function(e,r,a){for(var n=[],i=0;i<e;i++){for(var o=-1,s=-1/0,u=0;u<a.length;u++){var l=a[u];r[i*e+l]>s&&(o=l,s=r[i*e+l])}o>0&&n.push(o)}for(var f=0;f<a.length;f++)n[a[f]]=a[f];return n},IA=function(e,r,a){for(var n=Kd(e,r,a),i=0;i<a.length;i++){for(var o=[],s=0;s<n.length;s++)n[s]===a[i]&&o.push(s);for(var u=-1,l=-1/0,f=0;f<o.length;f++){for(var h=0,v=0;v<o.length;v++)h+=r[o[v]*e+o[f]];h>l&&(u=f,l=h)}a[i]=o[u]}return n=Kd(e,r,a),n},Zd=function(e){for(var r=this.cy(),a=this.nodes(),n=DA(e),i={},o=0;o<a.length;o++)i[a[o].id()]=o;var s,u,l,f,h,v;s=a.length,u=s*s,l=new Array(u);for(var c=0;c<u;c++)l[c]=-1/0;for(var d=0;d<s;d++)for(var g=0;g<s;g++)d!==g&&(l[d*s+g]=NA(n.distance,a[d],a[g],n.attributes));f=MA(l,n.preference);for(var p=0;p<s;p++)l[p*s+p]=f;h=new Array(u);for(var y=0;y<u;y++)h[y]=0;v=new Array(u);for(var b=0;b<u;b++)v[b]=0;for(var m=new Array(s),E=new Array(s),T=new Array(s),L=0;L<s;L++)m[L]=0,E[L]=0,T[L]=0;for(var w=new Array(s*n.minIterations),C=0;C<w.length;C++)w[C]=0;var A;for(A=0;A<n.maxIterations;A++){for(var R=0;R<s;R++){for(var S=-1/0,D=-1/0,P=-1,x=0,N=0;N<s;N++)m[N]=h[R*s+N],x=v[R*s+N]+l[R*s+N],x>=S?(D=S,S=x,P=N):x>D&&(D=x);for(var M=0;M<s;M++)h[R*s+M]=(1-n.damping)*(l[R*s+M]-S)+n.damping*m[M];h[R*s+P]=(1-n.damping)*(l[R*s+P]-D)+n.damping*m[P]}for(var I=0;I<s;I++){for(var O=0,q=0;q<s;q++)m[q]=v[q*s+I],E[q]=Math.max(0,h[q*s+I]),O+=E[q];O-=E[I],E[I]=h[I*s+I],O+=E[I];for(var _=0;_<s;_++)v[_*s+I]=(1-n.damping)*Math.min(0,O-E[_])+n.damping*m[_];v[I*s+I]=(1-n.damping)*(O-E[I])+n.damping*m[I]}for(var B=0,z=0;z<s;z++){var Y=v[z*s+z]+h[z*s+z]>0?1:0;w[A%n.minIterations*s+z]=Y,B+=Y}if(B>0&&(A>=n.minIterations-1||A==n.maxIterations-1)){for(var k=0,G=0;G<s;G++){T[G]=0;for(var U=0;U<n.minIterations;U++)T[G]+=w[U*s+G];(T[G]===0||T[G]===n.minIterations)&&k++}if(k===s)break}}for(var W=OA(s,h,v),j=IA(s,l,W),H={},V=0;V<W.length;V++)H[W[V]]=[];for(var X=0;X<a.length;X++){var Z=i[a[X].id()],ee=j[Z];ee!=null&&H[ee].push(a[X])}for(var re=new Array(W.length),ue=0;ue<W.length;ue++)re[ue]=r.collection(H[W[ue]]);return re},PA={affinityPropagation:Zd,ap:Zd},FA=Lt({root:void 0,directed:!1}),_A={hierholzer:function(e){if(!Ye(e)){var r=arguments;e={root:r[0],directed:r[1]}}var a=FA(e),n=a.root,i=a.directed,o=this,s=!1,u,l,f;n&&(f=Me(n)?this.filter(n)[0].id():n[0].id());var h={},v={};i?o.forEach(function(b){var m=b.id();if(b.isNode()){var E=b.indegree(!0),T=b.outdegree(!0),L=E-T,w=T-E;L==1?u?s=!0:u=m:w==1?l?s=!0:l=m:(w>1||L>1)&&(s=!0),h[m]=[],b.outgoers().forEach(function(C){C.isEdge()&&h[m].push(C.id())})}else v[m]=[void 0,b.target().id()]}):o.forEach(function(b){var m=b.id();if(b.isNode()){var E=b.degree(!0);E%2&&(u?l?s=!0:l=m:u=m),h[m]=[],b.connectedEdges().forEach(function(T){return h[m].push(T.id())})}else v[m]=[b.source().id(),b.target().id()]});var c={found:!1,trail:void 0};if(s)return c;if(l&&u)if(i){if(f&&l!=f)return c;f=l}else{if(f&&l!=f&&u!=f)return c;f||(f=l)}else f||(f=o[0].id());var d=function(m){for(var E=m,T=[m],L,w,C;h[E].length;)L=h[E].shift(),w=v[L][0],C=v[L][1],E!=C?(h[C]=h[C].filter(function(A){return A!=L}),E=C):!i&&E!=w&&(h[w]=h[w].filter(function(A){return A!=L}),E=w),T.unshift(L),T.unshift(E);return T},g=[],p=[];for(p=d(f);p.length!=1;)h[p[0]].length==0?(g.unshift(o.getElementById(p.shift())),g.unshift(o.getElementById(p.shift()))):p=d(p.shift()).concat(p);g.unshift(o.getElementById(p.shift()));for(var y in h)if(h[y].length)return c;return c.found=!0,c.trail=this.spawn(g,!0),c}},qn=function(){var e=this,r={},a=0,n=0,i=[],o=[],s={},u=function(v,c){for(var d=o.length-1,g=[],p=e.spawn();o[d].x!=v||o[d].y!=c;)g.push(o.pop().edge),d--;g.push(o.pop().edge),g.forEach(function(y){var b=y.connectedNodes().intersection(e);p.merge(y),b.forEach(function(m){var E=m.id(),T=m.connectedEdges().intersection(e);p.merge(m),r[E].cutVertex?p.merge(T.filter(function(L){return L.isLoop()})):p.merge(T)})}),i.push(p)},l=function(v,c,d){v===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 p,y,b,m;g.forEach(function(E){p=E.source().id(),y=E.target().id(),b=p===c?y:p,b!==d&&(m=E.id(),s[m]||(s[m]=!0,o.push({x:c,y:b,edge:E})),b in r?r[c].low=Math.min(r[c].low,r[b].id):(l(v,b,c),r[c].low=Math.min(r[c].low,r[b].low),r[c].id<=r[b].low&&(r[c].cutVertex=!0,u(c,b))))})}};e.forEach(function(h){if(h.isNode()){var v=h.id();v in r||(n=0,l(v,v),r[v].cutVertex=n>1)}});var f=Object.keys(r).filter(function(h){return r[h].cutVertex}).map(function(h){return e.getElementById(h)});return{cut:e.spawn(f),components:i}},BA={hopcroftTarjanBiconnected:qn,htbc:qn,htb:qn,hopcroftTarjanBiconnectedComponents:qn},Gn=function(){var e=this,r={},a=0,n=[],i=[],o=e.spawn(e),s=function(l){i.push(l),r[l]={index:a,low:a++,explored:!1};var f=e.getElementById(l).connectedEdges().intersection(e);if(f.forEach(function(g){var p=g.target().id();p!==l&&(p in r||s(p),r[p].explored||(r[l].low=Math.min(r[l].low,r[p].low)))}),r[l].index===r[l].low){for(var h=e.spawn();;){var v=i.pop();if(h.merge(e.getElementById(v)),r[v].low=r[l].index,r[v].explored=!0,v===l)break}var c=h.edgesWith(h),d=h.merge(c);n.push(d),o=o.difference(d)}};return e.forEach(function(u){if(u.isNode()){var l=u.id();l in r||s(l)}}),{cut:o,components:n}},kA={tarjanStronglyConnected:Gn,tsc:Gn,tscc:Gn,tarjanStronglyConnectedComponents:Gn},HE={};[on,dC,gC,yC,bC,wC,CC,QC,ba,Ea,sv,fA,xA,RA,PA,_A,BA,kA].forEach(function(t){Be(HE,t)});/*!
5
+ Embeddable Minimum Strictly-Compliant Promises/A+ 1.1.1 Thenable
6
+ Copyright (c) 2013-2014 Ralf S. Engelschall (http://engelschall.com)
7
+ Licensed under The MIT License (http://opensource.org/licenses/MIT)
8
+ */var XE=0,$E=1,WE=2,Zt=function(e){if(!(this instanceof Zt))return new Zt(e);this.id="Thenable/1.0.7",this.state=XE,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))};Zt.prototype={fulfill:function(e){return Qd(this,$E,"fulfillValue",e)},reject:function(e){return Qd(this,WE,"rejectReason",e)},then:function(e,r){var a=this,n=new Zt;return a.onFulfilled.push(jd(e,n,"fulfill")),a.onRejected.push(jd(r,n,"reject")),KE(a),n.proxy}};var Qd=function(e,r,a,n){return e.state===XE&&(e.state=r,e[a]=n,KE(e)),e},KE=function(e){e.state===$E?Jd(e,"onFulfilled",e.fulfillValue):e.state===WE&&Jd(e,"onRejected",e.rejectReason)},Jd=function(e,r,a){if(e[r].length!==0){var n=e[r];e[r]=[];var i=function(){for(var s=0;s<n.length;s++)n[s](a)};typeof setImmediate=="function"?setImmediate(i):setTimeout(i,0)}},jd=function(e,r,a){return function(n){if(typeof e!="function")r[a].call(r,n);else{var i;try{i=e(n)}catch(o){r.reject(o);return}ZE(r,i)}}},ZE=function(e,r){if(e===r||e.proxy===r){e.reject(new TypeError("cannot resolve promise with itself"));return}var a;if(bt(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){n||(n=!0,i===r?e.reject(new TypeError("circular thenable chain")):ZE(e,i))},function(i){n||(n=!0,e.reject(i))})}catch(i){n||e.reject(i)}return}e.fulfill(r)};Zt.all=function(t){return new Zt(function(e,r){for(var a=new Array(t.length),n=0,i=function(u,l){a[u]=l,n++,n===t.length&&e(a)},o=0;o<t.length;o++)(function(s){var u=t[s],l=u!=null&&u.then!=null;if(l)u.then(function(h){i(s,h)},function(h){r(h)});else{var f=u;i(s,f)}})(o)})};Zt.resolve=function(t){return new Zt(function(e,r){e(t)})};Zt.reject=function(t){return new Zt(function(e,r){r(t)})};var Ra=typeof Promise<"u"?Promise:Zt,fv=function(e,r,a){var n=Lv(e),i=!n,o=this._private=Be({duration:1e3},r,a);if(o.target=e,o.style=o.style||o.css,o.started=!1,o.playing=!1,o.hooked=!1,o.applying=!1,o.progress=0,o.completes=[],o.frames=[],o.complete&&ot(o.complete)&&o.completes.push(o.complete),i){var s=e.position();o.startPosition=o.startPosition||{x:s.x,y:s.y},o.startStyle=o.startStyle||e.cy().style().getAnimationStartStyle(e,o.style)}if(n){var u=e.pan();o.startPan={x:u.x,y:u.y},o.startZoom=e.zoom()}this.length=1,this[0]=this},Qr=fv.prototype;Be(Qr,{instanceString:function(){return"animation"},hook:function(){var e=this._private;if(!e.hooked){var r,a=e.target._private.animation;e.queue?r=a.queue:r=a.current,r.push(this),Ut(e.target)&&e.target.cy().addToAnimationPool(e.target),e.hooked=!0}return this},play:function(){var e=this._private;return e.progress===1&&(e.progress=0),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;return e===void 0?r.progress*r.duration:this.progress(e/r.duration)},progress:function(e){var r=this._private,a=r.playing;return e===void 0?r.progress:(a&&this.pause(),r.progress=e,r.started=!1,a&&this.play(),this)},completed:function(){return this._private.progress===1},reverse:function(){var e=this._private,r=e.playing;r&&this.pause(),e.progress=1-e.progress,e.started=!1;var a=function(l,f){var h=e[l];h!=null&&(e[l]=e[f],e[f]=h)};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],o=i.name,s=e.startStyle[o];e.startStyle[o]=i,e.style[n]=s}return r&&this.play(),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 Ra(function(n,i){a.push(function(){n()})})}});Qr.complete=Qr.completed;Qr.run=Qr.play;Qr.running=Qr.playing;var qA={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 o=n[0];if(o)return o._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 o=0;o<n.length;o++){var s=n[o];s._private.animation.queue=[]}return this}},delay:function(){return function(r,a){var n=this._private.cy||this;return n.styleEnabled()?this.animate({delay:r,duration:r,complete:a}):this}},delayAnimation:function(){return function(r,a){var n=this._private.cy||this;return n.styleEnabled()?this.animation({delay:r,duration:r,complete:a}):this}},animation:function(){return function(r,a){var n=this,i=n.length!==void 0,o=i?n:[n],s=this._private.cy||this,u=!i,l=!u;if(!s.styleEnabled())return this;var f=s.style();r=Be({},r,a);var h=Object.keys(r).length===0;if(h)return new fv(o[0],r);switch(r.duration===void 0&&(r.duration=400),r.duration){case"slow":r.duration=600;break;case"fast":r.duration=200;break}if(l&&(r.style=f.getPropsList(r.style||r.css),r.css=void 0),l&&r.renderedPosition!=null){var v=r.renderedPosition,c=s.pan(),d=s.zoom();r.position=FE(v,d,c)}if(u&&r.panBy!=null){var g=r.panBy,p=s.pan();r.pan={x:p.x+g.x,y:p.y+g.y}}var y=r.center||r.centre;if(u&&y!=null){var b=s.getCenterPan(y.eles,r.zoom);b!=null&&(r.pan=b)}if(u&&r.fit!=null){var m=r.fit,E=s.getFitViewport(m.eles||m.boundingBox,m.padding);E!=null&&(r.pan=E.pan,r.zoom=E.zoom)}if(u&&Ye(r.zoom)){var T=s.getZoomedViewport(r.zoom);T!=null?(T.zoomed&&(r.zoom=T.zoom),T.panned&&(r.pan=T.pan)):r.zoom=null}return new fv(o[0],r)}},animate:function(){return function(r,a){var n=this,i=n.length!==void 0,o=i?n:[n],s=this._private.cy||this;if(!s.styleEnabled())return this;a&&(r=Be({},r,a));for(var u=0;u<o.length;u++){var l=o[u],f=l.animated()&&(r.queue===void 0||r.queue),h=l.animation(r,f?{queue:!0}:void 0);h.play()}return this}},stop:function(){return function(r,a){var n=this,i=n.length!==void 0,o=i?n:[n],s=this._private.cy||this;if(!s.styleEnabled())return this;for(var u=0;u<o.length;u++){for(var l=o[u],f=l._private,h=f.animation.current,v=0;v<h.length;v++){var c=h[v],d=c._private;a&&(d.duration=0)}r&&(f.animation.queue=[]),a||(f.animation.current=[])}return s.notify("draw"),this}}},Mo,eg;function Oi(){if(eg)return Mo;eg=1;var t=Array.isArray;return Mo=t,Mo}var Oo,tg;function GA(){if(tg)return Oo;tg=1;var t=Oi(),e=mn(),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;function n(i,o){if(t(i))return!1;var s=typeof i;return s=="number"||s=="symbol"||s=="boolean"||i==null||e(i)?!0:a.test(i)||!r.test(i)||o!=null&&i in Object(o)}return Oo=n,Oo}var Io,rg;function UA(){if(rg)return Io;rg=1;var t=LE(),e=yn(),r="[object AsyncFunction]",a="[object Function]",n="[object GeneratorFunction]",i="[object Proxy]";function o(s){if(!e(s))return!1;var u=t(s);return u==a||u==n||u==r||u==i}return Io=o,Io}var Po,ag;function zA(){if(ag)return Po;ag=1;var t=Si(),e=t["__core-js_shared__"];return Po=e,Po}var Fo,ng;function VA(){if(ng)return Fo;ng=1;var t=zA(),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 Fo=r,Fo}var _o,ig;function YA(){if(ig)return _o;ig=1;var t=Function.prototype,e=t.toString;function r(a){if(a!=null){try{return e.call(a)}catch{}try{return a+""}catch{}}return""}return _o=r,_o}var Bo,og;function HA(){if(og)return Bo;og=1;var t=UA(),e=VA(),r=yn(),a=YA(),n=/[\\^$.*+?()[\]{}|]/g,i=/^\[object .+?Constructor\]$/,o=Function.prototype,s=Object.prototype,u=o.toString,l=s.hasOwnProperty,f=RegExp("^"+u.call(l).replace(n,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function h(v){if(!r(v)||e(v))return!1;var c=t(v)?f:i;return c.test(a(v))}return Bo=h,Bo}var ko,sg;function XA(){if(sg)return ko;sg=1;function t(e,r){return e==null?void 0:e[r]}return ko=t,ko}var qo,ug;function Bv(){if(ug)return qo;ug=1;var t=HA(),e=XA();function r(a,n){var i=e(a,n);return t(i)?i:void 0}return qo=r,qo}var Go,lg;function Ii(){if(lg)return Go;lg=1;var t=Bv(),e=t(Object,"create");return Go=e,Go}var Uo,fg;function $A(){if(fg)return Uo;fg=1;var t=Ii();function e(){this.__data__=t?t(null):{},this.size=0}return Uo=e,Uo}var zo,hg;function WA(){if(hg)return zo;hg=1;function t(e){var r=this.has(e)&&delete this.__data__[e];return this.size-=r?1:0,r}return zo=t,zo}var Vo,cg;function KA(){if(cg)return Vo;cg=1;var t=Ii(),e="__lodash_hash_undefined__",r=Object.prototype,a=r.hasOwnProperty;function n(i){var o=this.__data__;if(t){var s=o[i];return s===e?void 0:s}return a.call(o,i)?o[i]:void 0}return Vo=n,Vo}var Yo,vg;function ZA(){if(vg)return Yo;vg=1;var t=Ii(),e=Object.prototype,r=e.hasOwnProperty;function a(n){var i=this.__data__;return t?i[n]!==void 0:r.call(i,n)}return Yo=a,Yo}var Ho,dg;function QA(){if(dg)return Ho;dg=1;var t=Ii(),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 Ho=r,Ho}var Xo,gg;function JA(){if(gg)return Xo;gg=1;var t=$A(),e=WA(),r=KA(),a=ZA(),n=QA();function i(o){var s=-1,u=o==null?0:o.length;for(this.clear();++s<u;){var l=o[s];this.set(l[0],l[1])}}return i.prototype.clear=t,i.prototype.delete=e,i.prototype.get=r,i.prototype.has=a,i.prototype.set=n,Xo=i,Xo}var $o,pg;function jA(){if(pg)return $o;pg=1;function t(){this.__data__=[],this.size=0}return $o=t,$o}var Wo,yg;function QE(){if(yg)return Wo;yg=1;function t(e,r){return e===r||e!==e&&r!==r}return Wo=t,Wo}var Ko,mg;function Pi(){if(mg)return Ko;mg=1;var t=QE();function e(r,a){for(var n=r.length;n--;)if(t(r[n][0],a))return n;return-1}return Ko=e,Ko}var Zo,bg;function eL(){if(bg)return Zo;bg=1;var t=Pi(),e=Array.prototype,r=e.splice;function a(n){var i=this.__data__,o=t(i,n);if(o<0)return!1;var s=i.length-1;return o==s?i.pop():r.call(i,o,1),--this.size,!0}return Zo=a,Zo}var Qo,Eg;function tL(){if(Eg)return Qo;Eg=1;var t=Pi();function e(r){var a=this.__data__,n=t(a,r);return n<0?void 0:a[n][1]}return Qo=e,Qo}var Jo,wg;function rL(){if(wg)return Jo;wg=1;var t=Pi();function e(r){return t(this.__data__,r)>-1}return Jo=e,Jo}var jo,Tg;function aL(){if(Tg)return jo;Tg=1;var t=Pi();function e(r,a){var n=this.__data__,i=t(n,r);return i<0?(++this.size,n.push([r,a])):n[i][1]=a,this}return jo=e,jo}var es,xg;function nL(){if(xg)return es;xg=1;var t=jA(),e=eL(),r=tL(),a=rL(),n=aL();function i(o){var s=-1,u=o==null?0:o.length;for(this.clear();++s<u;){var l=o[s];this.set(l[0],l[1])}}return i.prototype.clear=t,i.prototype.delete=e,i.prototype.get=r,i.prototype.has=a,i.prototype.set=n,es=i,es}var ts,Cg;function iL(){if(Cg)return ts;Cg=1;var t=Bv(),e=Si(),r=t(e,"Map");return ts=r,ts}var rs,Ag;function oL(){if(Ag)return rs;Ag=1;var t=JA(),e=nL(),r=iL();function a(){this.size=0,this.__data__={hash:new t,map:new(r||e),string:new t}}return rs=a,rs}var as,Lg;function sL(){if(Lg)return as;Lg=1;function t(e){var r=typeof e;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?e!=="__proto__":e===null}return as=t,as}var ns,Rg;function Fi(){if(Rg)return ns;Rg=1;var t=sL();function e(r,a){var n=r.__data__;return t(a)?n[typeof a=="string"?"string":"hash"]:n.map}return ns=e,ns}var is,Sg;function uL(){if(Sg)return is;Sg=1;var t=Fi();function e(r){var a=t(this,r).delete(r);return this.size-=a?1:0,a}return is=e,is}var os,Dg;function lL(){if(Dg)return os;Dg=1;var t=Fi();function e(r){return t(this,r).get(r)}return os=e,os}var ss,Ng;function fL(){if(Ng)return ss;Ng=1;var t=Fi();function e(r){return t(this,r).has(r)}return ss=e,ss}var us,Mg;function hL(){if(Mg)return us;Mg=1;var t=Fi();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 us=e,us}var ls,Og;function cL(){if(Og)return ls;Og=1;var t=oL(),e=uL(),r=lL(),a=fL(),n=hL();function i(o){var s=-1,u=o==null?0:o.length;for(this.clear();++s<u;){var l=o[s];this.set(l[0],l[1])}}return i.prototype.clear=t,i.prototype.delete=e,i.prototype.get=r,i.prototype.has=a,i.prototype.set=n,ls=i,ls}var fs,Ig;function vL(){if(Ig)return fs;Ig=1;var t=cL(),e="Expected a function";function r(a,n){if(typeof a!="function"||n!=null&&typeof n!="function")throw new TypeError(e);var i=function(){var o=arguments,s=n?n.apply(this,o):o[0],u=i.cache;if(u.has(s))return u.get(s);var l=a.apply(this,o);return i.cache=u.set(s,l)||u,l};return i.cache=new(r.Cache||t),i}return r.Cache=t,fs=r,fs}var hs,Pg;function dL(){if(Pg)return hs;Pg=1;var t=vL(),e=500;function r(a){var n=t(a,function(o){return i.size===e&&i.clear(),o}),i=n.cache;return n}return hs=r,hs}var cs,Fg;function JE(){if(Fg)return cs;Fg=1;var t=dL(),e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,r=/\\(\\)?/g,a=t(function(n){var i=[];return n.charCodeAt(0)===46&&i.push(""),n.replace(e,function(o,s,u,l){i.push(u?l.replace(r,"$1"):s||o)}),i});return cs=a,cs}var vs,_g;function jE(){if(_g)return vs;_g=1;function t(e,r){for(var a=-1,n=e==null?0:e.length,i=Array(n);++a<n;)i[a]=r(e[a],a,e);return i}return vs=t,vs}var ds,Bg;function gL(){if(Bg)return ds;Bg=1;var t=Sv(),e=jE(),r=Oi(),a=mn(),n=t?t.prototype:void 0,i=n?n.toString:void 0;function o(s){if(typeof s=="string")return s;if(r(s))return e(s,o)+"";if(a(s))return i?i.call(s):"";var u=s+"";return u=="0"&&1/s==-1/0?"-0":u}return ds=o,ds}var gs,kg;function ew(){if(kg)return gs;kg=1;var t=gL();function e(r){return r==null?"":t(r)}return gs=e,gs}var ps,qg;function tw(){if(qg)return ps;qg=1;var t=Oi(),e=GA(),r=JE(),a=ew();function n(i,o){return t(i)?i:e(i,o)?[i]:r(a(i))}return ps=n,ps}var ys,Gg;function kv(){if(Gg)return ys;Gg=1;var t=mn();function e(r){if(typeof r=="string"||t(r))return r;var a=r+"";return a=="0"&&1/r==-1/0?"-0":a}return ys=e,ys}var ms,Ug;function pL(){if(Ug)return ms;Ug=1;var t=tw(),e=kv();function r(a,n){n=t(n,a);for(var i=0,o=n.length;a!=null&&i<o;)a=a[e(n[i++])];return i&&i==o?a:void 0}return ms=r,ms}var bs,zg;function yL(){if(zg)return bs;zg=1;var t=pL();function e(r,a,n){var i=r==null?void 0:t(r,a);return i===void 0?n:i}return bs=e,bs}var mL=yL(),bL=pn(mL),Es,Vg;function EL(){if(Vg)return Es;Vg=1;var t=Bv(),e=(function(){try{var r=t(Object,"defineProperty");return r({},"",{}),r}catch{}})();return Es=e,Es}var ws,Yg;function wL(){if(Yg)return ws;Yg=1;var t=EL();function e(r,a,n){a=="__proto__"&&t?t(r,a,{configurable:!0,enumerable:!0,value:n,writable:!0}):r[a]=n}return ws=e,ws}var Ts,Hg;function TL(){if(Hg)return Ts;Hg=1;var t=wL(),e=QE(),r=Object.prototype,a=r.hasOwnProperty;function n(i,o,s){var u=i[o];(!(a.call(i,o)&&e(u,s))||s===void 0&&!(o in i))&&t(i,o,s)}return Ts=n,Ts}var xs,Xg;function xL(){if(Xg)return xs;Xg=1;var t=9007199254740991,e=/^(?:0|[1-9]\d*)$/;function r(a,n){var i=typeof a;return n=n??t,!!n&&(i=="number"||i!="symbol"&&e.test(a))&&a>-1&&a%1==0&&a<n}return xs=r,xs}var Cs,$g;function CL(){if($g)return Cs;$g=1;var t=TL(),e=tw(),r=xL(),a=yn(),n=kv();function i(o,s,u,l){if(!a(o))return o;s=e(s,o);for(var f=-1,h=s.length,v=h-1,c=o;c!=null&&++f<h;){var d=n(s[f]),g=u;if(d==="__proto__"||d==="constructor"||d==="prototype")return o;if(f!=v){var p=c[d];g=l?l(p,d,c):void 0,g===void 0&&(g=a(p)?p:r(s[f+1])?[]:{})}t(c,d,g),c=c[d]}return o}return Cs=i,Cs}var As,Wg;function AL(){if(Wg)return As;Wg=1;var t=CL();function e(r,a,n){return r==null?r:t(r,a,n)}return As=e,As}var LL=AL(),RL=pn(LL),Ls,Kg;function SL(){if(Kg)return Ls;Kg=1;function t(e,r){var a=-1,n=e.length;for(r||(r=Array(n));++a<n;)r[a]=e[a];return r}return Ls=t,Ls}var Rs,Zg;function DL(){if(Zg)return Rs;Zg=1;var t=jE(),e=SL(),r=Oi(),a=mn(),n=JE(),i=kv(),o=ew();function s(u){return r(u)?t(u,i):a(u)?[u]:e(n(o(u)))}return Rs=s,Rs}var NL=DL(),ML=pn(NL),OL={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=Be({},r,e),function(n,i){var o=e,s=this,u=s.length!==void 0,l=u?s:[s],f=u?s[0]:s;if(Me(n)){var h=n.indexOf(".")!==-1,v=h&&ML(n);if(o.allowGetting&&i===void 0){var c;return f&&(o.beforeGet(f),v&&f._private[o.field][n]===void 0?c=bL(f._private[o.field],v):c=f._private[o.field][n]),c}else if(o.allowSetting&&i!==void 0){var d=!o.immutableKeys[n];if(d){var g=pE({},n,i);o.beforeSet(s,g);for(var p=0,y=l.length;p<y;p++){var b=l[p];o.canSet(b)&&(v&&f._private[o.field][n]===void 0?RL(b._private[o.field],v,i):b._private[o.field][n]=i)}o.updateStyle&&s.updateStyle(),o.onSet(s),o.settingTriggersEvent&&s[o.triggerFnName](o.settingEvent)}}}else if(o.allowSetting&&Ye(n)){var m=n,E,T,L=Object.keys(m);o.beforeSet(s,m);for(var w=0;w<L.length;w++){E=L[w],T=m[E];var C=!o.immutableKeys[E];if(C)for(var A=0;A<l.length;A++){var R=l[A];o.canSet(R)&&(R._private[o.field][E]=T)}}o.updateStyle&&s.updateStyle(),o.onSet(s),o.settingTriggersEvent&&s[o.triggerFnName](o.settingEvent)}else if(o.allowBinding&&ot(n)){var S=n;s.on(o.bindingEvent,S)}else if(o.allowGetting&&n===void 0){var D;return f&&(o.beforeGet(f),D=f._private[o.field]),D}return s}},removeData:function(e){var r={field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!1,immutableKeys:{}};return e=Be({},r,e),function(n){var i=e,o=this,s=o.length!==void 0,u=s?o:[o];if(Me(n)){for(var l=n.split(/\s+/),f=l.length,h=0;h<f;h++){var v=l[h];if(!Sr(v)){var c=!i.immutableKeys[v];if(c)for(var d=0,g=u.length;d<g;d++)u[d]._private[i.field][v]=void 0}}i.triggerEvent&&o[i.triggerFnName](i.event)}else if(n===void 0){for(var p=0,y=u.length;p<y;p++)for(var b=u[p]._private[i.field],m=Object.keys(b),E=0;E<m.length;E++){var T=m[E],L=!i.immutableKeys[T];L&&(b[T]=void 0)}i.triggerEvent&&o[i.triggerFnName](i.event)}return o}}},IL={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,o=Array.prototype.slice.call(arguments,0);return new Ra(function(s,u){var l=function(c){i.off.apply(i,h),s(c)},f=o.concat([l]),h=f.concat([]);i.on.apply(i,f)})}}},Ke={};[qA,OL,IL].forEach(function(t){Be(Ke,t)});var PL={animate:Ke.animate(),animation:Ke.animation(),animated:Ke.animated(),clearQueue:Ke.clearQueue(),delay:Ke.delay(),delayAnimation:Ke.delayAnimation(),stop:Ke.stop()},Qn={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 je(e)||(e=(e||"").match(/\S+/g)||[]);for(var n=[],i=new La(e),o=0;o<r.length;o++){for(var s=r[o],u=s._private,l=u.classes,f=!1,h=0;h<e.length;h++){var v=e[h],c=l.has(v);if(!c){f=!0;break}}f||(f=l.size!==e.length),f&&(u.classes=i,n.push(s))}return n.length>0&&this.spawn(n).updateStyle().emit("class"),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){je(e)||(e=e.match(/\S+/g)||[]);for(var a=this,n=r===void 0,i=[],o=0,s=a.length;o<s;o++)for(var u=a[o],l=u._private.classes,f=!1,h=0;h<e.length;h++){var v=e[h],c=l.has(v),d=!1;r||n&&!c?(l.add(v),d=!0):(!r||n&&c)&&(l.delete(v),d=!0),!f&&d&&(i.push(u),f=!0)}return i.length>0&&this.spawn(i).updateStyle().emit("class"),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}};Qn.className=Qn.classNames=Qn.classes;var Ve={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:`"(?:\\\\"|[^"])*"|'(?:\\\\'|[^'])*'`,number:mt,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};Ve.variable="(?:[\\w-.]|(?:\\\\"+Ve.metaChar+"))+";Ve.className="(?:[\\w-]|(?:\\\\"+Ve.metaChar+"))+";Ve.value=Ve.string+"|"+Ve.number;Ve.id=Ve.variable;(function(){var t,e,r;for(t=Ve.comparatorOp.split("|"),r=0;r<t.length;r++)e=t[r],Ve.comparatorOp+="|@"+e;for(t=Ve.comparatorOp.split("|"),r=0;r<t.length;r++)e=t[r],!(e.indexOf("!")>=0)&&e!=="="&&(Ve.comparatorOp+="|\\!"+e)})();var Qe=function(){return{checks:[]}},De={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},hv=[{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){return e.isNode()?e.isParent():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 Ox(t.selector,e.selector)}),FL=(function(){for(var t={},e,r=0;r<hv.length;r++)e=hv[r],t[e.selector]=e.matches;return t})(),_L=function(e,r){return FL[e](r)},BL="("+hv.map(function(t){return t.selector}).join("|")+")",oa=function(e){return e.replace(new RegExp("\\\\("+Ve.metaChar+")","g"),function(r,a){return a})},wr=function(e,r,a){e[e.length-1]=a},cv=[{name:"group",query:!0,regex:"("+Ve.group+")",populate:function(e,r,a){var n=dt(a,1),i=n[0];r.checks.push({type:De.GROUP,value:i==="*"?i:i+"s"})}},{name:"state",query:!0,regex:BL,populate:function(e,r,a){var n=dt(a,1),i=n[0];r.checks.push({type:De.STATE,value:i})}},{name:"id",query:!0,regex:"\\#("+Ve.id+")",populate:function(e,r,a){var n=dt(a,1),i=n[0];r.checks.push({type:De.ID,value:oa(i)})}},{name:"className",query:!0,regex:"\\.("+Ve.className+")",populate:function(e,r,a){var n=dt(a,1),i=n[0];r.checks.push({type:De.CLASS,value:oa(i)})}},{name:"dataExists",query:!0,regex:"\\[\\s*("+Ve.variable+")\\s*\\]",populate:function(e,r,a){var n=dt(a,1),i=n[0];r.checks.push({type:De.DATA_EXIST,field:oa(i)})}},{name:"dataCompare",query:!0,regex:"\\[\\s*("+Ve.variable+")\\s*("+Ve.comparatorOp+")\\s*("+Ve.value+")\\s*\\]",populate:function(e,r,a){var n=dt(a,3),i=n[0],o=n[1],s=n[2],u=new RegExp("^"+Ve.string+"$").exec(s)!=null;u?s=s.substring(1,s.length-1):s=parseFloat(s),r.checks.push({type:De.DATA_COMPARE,field:oa(i),operator:o,value:s})}},{name:"dataBool",query:!0,regex:"\\[\\s*("+Ve.boolOp+")\\s*("+Ve.variable+")\\s*\\]",populate:function(e,r,a){var n=dt(a,2),i=n[0],o=n[1];r.checks.push({type:De.DATA_BOOL,field:oa(o),operator:i})}},{name:"metaCompare",query:!0,regex:"\\[\\[\\s*("+Ve.meta+")\\s*("+Ve.comparatorOp+")\\s*("+Ve.number+")\\s*\\]\\]",populate:function(e,r,a){var n=dt(a,3),i=n[0],o=n[1],s=n[2];r.checks.push({type:De.META_COMPARE,field:oa(i),operator:o,value:parseFloat(s)})}},{name:"nextQuery",separator:!0,regex:Ve.separator,populate:function(e,r){var a=e.currentSubject,n=e.edgeCount,i=e.compoundCount,o=e[e.length-1];a!=null&&(o.subject=a,e.currentSubject=null),o.edgeCount=n,o.compoundCount=i,e.edgeCount=0,e.compoundCount=0;var s=e[e.length++]=Qe();return s}},{name:"directedEdge",separator:!0,regex:Ve.directedEdge,populate:function(e,r){if(e.currentSubject==null){var a=Qe(),n=r,i=Qe();return a.checks.push({type:De.DIRECTED_EDGE,source:n,target:i}),wr(e,r,a),e.edgeCount++,i}else{var o=Qe(),s=r,u=Qe();return o.checks.push({type:De.NODE_SOURCE,source:s,target:u}),wr(e,r,o),e.edgeCount++,u}}},{name:"undirectedEdge",separator:!0,regex:Ve.undirectedEdge,populate:function(e,r){if(e.currentSubject==null){var a=Qe(),n=r,i=Qe();return a.checks.push({type:De.UNDIRECTED_EDGE,nodes:[n,i]}),wr(e,r,a),e.edgeCount++,i}else{var o=Qe(),s=r,u=Qe();return o.checks.push({type:De.NODE_NEIGHBOR,node:s,neighbor:u}),wr(e,r,o),u}}},{name:"child",separator:!0,regex:Ve.child,populate:function(e,r){if(e.currentSubject==null){var a=Qe(),n=Qe(),i=e[e.length-1];return a.checks.push({type:De.CHILD,parent:i,child:n}),wr(e,r,a),e.compoundCount++,n}else if(e.currentSubject===r){var o=Qe(),s=e[e.length-1],u=Qe(),l=Qe(),f=Qe(),h=Qe();return o.checks.push({type:De.COMPOUND_SPLIT,left:s,right:u,subject:l}),l.checks=r.checks,r.checks=[{type:De.TRUE}],h.checks.push({type:De.TRUE}),u.checks.push({type:De.PARENT,parent:h,child:f}),wr(e,s,o),e.currentSubject=l,e.compoundCount++,f}else{var v=Qe(),c=Qe(),d=[{type:De.PARENT,parent:v,child:c}];return v.checks=r.checks,r.checks=d,e.compoundCount++,c}}},{name:"descendant",separator:!0,regex:Ve.descendant,populate:function(e,r){if(e.currentSubject==null){var a=Qe(),n=Qe(),i=e[e.length-1];return a.checks.push({type:De.DESCENDANT,ancestor:i,descendant:n}),wr(e,r,a),e.compoundCount++,n}else if(e.currentSubject===r){var o=Qe(),s=e[e.length-1],u=Qe(),l=Qe(),f=Qe(),h=Qe();return o.checks.push({type:De.COMPOUND_SPLIT,left:s,right:u,subject:l}),l.checks=r.checks,r.checks=[{type:De.TRUE}],h.checks.push({type:De.TRUE}),u.checks.push({type:De.ANCESTOR,ancestor:h,descendant:f}),wr(e,s,o),e.currentSubject=l,e.compoundCount++,f}else{var v=Qe(),c=Qe(),d=[{type:De.ANCESTOR,ancestor:v,descendant:c}];return v.checks=r.checks,r.checks=d,e.compoundCount++,c}}},{name:"subject",modifier:!0,regex:Ve.subject,populate:function(e,r){if(e.currentSubject!=null&&e.currentSubject!==r)return Ze("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;i===De.DIRECTED_EDGE?n.type=De.NODE_TARGET:i===De.UNDIRECTED_EDGE&&(n.type=De.NODE_NEIGHBOR,n.node=n.nodes[1],n.neighbor=n.nodes[0],n.nodes=null)}}];cv.forEach(function(t){return t.regexObj=new RegExp("^"+t.regex)});var kL=function(e){for(var r,a,n,i=0;i<cv.length;i++){var o=cv[i],s=o.name,u=e.match(o.regexObj);if(u!=null){a=u,r=o,n=s;var l=u[0];e=e.substring(l.length);break}}return{expr:r,match:a,name:n,remaining:e}},qL=function(e){var r=e.match(/^\s+/);if(r){var a=r[0];e=e.substring(a.length)}return e},GL=function(e){var r=this,a=r.inputText=e,n=r[0]=Qe();for(r.length=1,a=qL(a);;){var i=kL(a);if(i.expr==null)return Ze("The selector `"+e+"`is invalid"),!1;var o=i.match.slice(1),s=i.expr.populate(r,n,o);if(s===!1)return!1;if(s!=null&&(n=s),a=i.remaining,a.match(/^\s*$/))break}var u=r[r.length-1];r.currentSubject!=null&&(u.subject=r.currentSubject),u.edgeCount=r.edgeCount,u.compoundCount=r.compoundCount;for(var l=0;l<r.length;l++){var f=r[l];if(f.compoundCount>0&&f.edgeCount>0)return Ze("The selector `"+e+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(f.edgeCount>1)return Ze("The selector `"+e+"` is invalid because it uses multiple edge selectors"),!1;f.edgeCount===1&&Ze("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},UL=function(){if(this.toStringCache!=null)return this.toStringCache;for(var e=function(f){return f??""},r=function(f){return Me(f)?'"'+f+'"':e(f)},a=function(f){return" "+f+" "},n=function(f,h){var v=f.type,c=f.value;switch(v){case De.GROUP:{var d=e(c);return d.substring(0,d.length-1)}case De.DATA_COMPARE:{var g=f.field,p=f.operator;return"["+g+a(e(p))+r(c)+"]"}case De.DATA_BOOL:{var y=f.operator,b=f.field;return"["+e(y)+b+"]"}case De.DATA_EXIST:{var m=f.field;return"["+m+"]"}case De.META_COMPARE:{var E=f.operator,T=f.field;return"[["+T+a(e(E))+r(c)+"]]"}case De.STATE:return c;case De.ID:return"#"+c;case De.CLASS:return"."+c;case De.PARENT:case De.CHILD:return i(f.parent,h)+a(">")+i(f.child,h);case De.ANCESTOR:case De.DESCENDANT:return i(f.ancestor,h)+" "+i(f.descendant,h);case De.COMPOUND_SPLIT:{var L=i(f.left,h),w=i(f.subject,h),C=i(f.right,h);return L+(L.length>0?" ":"")+w+C}case De.TRUE:return""}},i=function(f,h){return f.checks.reduce(function(v,c,d){return v+(h===f&&d===0?"$":"")+n(c,h)},"")},o="",s=0;s<this.length;s++){var u=this[s];o+=i(u,u.subject),this.length>1&&s<this.length-1&&(o+=", ")}return this.toStringCache=o,o},zL={parse:GL,toString:UL},rw=function(e,r,a){var n,i=Me(e),o=Te(e),s=Me(a),u,l,f=!1,h=!1,v=!1;switch(r.indexOf("!")>=0&&(r=r.replace("!",""),h=!0),r.indexOf("@")>=0&&(r=r.replace("@",""),f=!0),(i||s||f)&&(u=!i&&!o?"":""+e,l=""+a),f&&(e=u=u.toLowerCase(),a=l=l.toLowerCase()),r){case"*=":n=u.indexOf(l)>=0;break;case"$=":n=u.indexOf(l,u.length-l.length)>=0;break;case"^=":n=u.indexOf(l)===0;break;case"=":n=e===a;break;case">":v=!0,n=e>a;break;case">=":v=!0,n=e>=a;break;case"<":v=!0,n=e<a;break;case"<=":v=!0,n=e<=a;break;default:n=!1;break}return h&&(e!=null||!v)&&(n=!n),n},VL=function(e,r){switch(r){case"?":return!!e;case"!":return!e;case"^":return e===void 0}},YL=function(e){return e!==void 0},qv=function(e,r){return e.data(r)},HL=function(e,r){return e[r]()},ut=[],rt=function(e,r){return e.checks.every(function(a){return ut[a.type](a,r)})};ut[De.GROUP]=function(t,e){var r=t.value;return r==="*"||r===e.group()};ut[De.STATE]=function(t,e){var r=t.value;return _L(r,e)};ut[De.ID]=function(t,e){var r=t.value;return e.id()===r};ut[De.CLASS]=function(t,e){var r=t.value;return e.hasClass(r)};ut[De.META_COMPARE]=function(t,e){var r=t.field,a=t.operator,n=t.value;return rw(HL(e,r),a,n)};ut[De.DATA_COMPARE]=function(t,e){var r=t.field,a=t.operator,n=t.value;return rw(qv(e,r),a,n)};ut[De.DATA_BOOL]=function(t,e){var r=t.field,a=t.operator;return VL(qv(e,r),a)};ut[De.DATA_EXIST]=function(t,e){var r=t.field;return t.operator,YL(qv(e,r))};ut[De.UNDIRECTED_EDGE]=function(t,e){var r=t.nodes[0],a=t.nodes[1],n=e.source(),i=e.target();return rt(r,n)&&rt(a,i)||rt(a,n)&&rt(r,i)};ut[De.NODE_NEIGHBOR]=function(t,e){return rt(t.node,e)&&e.neighborhood().some(function(r){return r.isNode()&&rt(t.neighbor,r)})};ut[De.DIRECTED_EDGE]=function(t,e){return rt(t.source,e.source())&&rt(t.target,e.target())};ut[De.NODE_SOURCE]=function(t,e){return rt(t.source,e)&&e.outgoers().some(function(r){return r.isNode()&&rt(t.target,r)})};ut[De.NODE_TARGET]=function(t,e){return rt(t.target,e)&&e.incomers().some(function(r){return r.isNode()&&rt(t.source,r)})};ut[De.CHILD]=function(t,e){return rt(t.child,e)&&rt(t.parent,e.parent())};ut[De.PARENT]=function(t,e){return rt(t.parent,e)&&e.children().some(function(r){return rt(t.child,r)})};ut[De.DESCENDANT]=function(t,e){return rt(t.descendant,e)&&e.ancestors().some(function(r){return rt(t.ancestor,r)})};ut[De.ANCESTOR]=function(t,e){return rt(t.ancestor,e)&&e.descendants().some(function(r){return rt(t.descendant,r)})};ut[De.COMPOUND_SPLIT]=function(t,e){return rt(t.subject,e)&&rt(t.left,e)&&rt(t.right,e)};ut[De.TRUE]=function(){return!0};ut[De.COLLECTION]=function(t,e){var r=t.value;return r.has(e)};ut[De.FILTER]=function(t,e){var r=t.value;return r(e)};var XL=function(e){var r=this;if(r.length===1&&r[0].checks.length===1&&r[0].checks[0].type===De.ID)return e.getElementById(r[0].checks[0].value).collection();var a=function(i){for(var o=0;o<r.length;o++){var s=r[o];if(rt(s,i))return!0}return!1};return r.text()==null&&(a=function(){return!0}),e.filter(a)},$L=function(e){for(var r=this,a=0;a<r.length;a++){var n=r[a];if(rt(n,e))return!0}return!1},WL={matches:$L,filter:XL},Mr=function(e){this.inputText=e,this.currentSubject=null,this.compoundCount=0,this.edgeCount=0,this.length=0,e==null||Me(e)&&e.match(/^\s*$/)||(Ut(e)?this.addQuery({checks:[{type:De.COLLECTION,value:e.collection()}]}):ot(e)?this.addQuery({checks:[{type:De.FILTER,value:e}]}):Me(e)?this.parse(e)||(this.invalid=!0):at("A selector must be created from a string; found "))},Or=Mr.prototype;[zL,WL].forEach(function(t){return Be(Or,t)});Or.text=function(){return this.inputText};Or.size=function(){return this.length};Or.eq=function(t){return this[t]};Or.sameText=function(t){return!this.invalid&&!t.invalid&&this.text()===t.text()};Or.addQuery=function(t){this[this.length++]=t};Or.selector=Or.toString;var Lr={allAre:function(e){var r=new Mr(e);return this.every(function(a){return r.matches(a)})},is:function(e){var r=new Mr(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.apply(r,[this[a],a,this]):e(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.apply(r,[this[a],a,this]):e(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;return r!==a?!1:r===1?this[0]===e[0]: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())})}};Lr.allAreNeighbours=Lr.allAreNeighbors;Lr.has=Lr.contains;Lr.equal=Lr.equals=Lr.same;var Yt=function(e,r){return function(n,i,o,s){var u=n,l=this,f;if(u==null?f="":Ut(u)&&u.length===1&&(f=u.id()),l.length===1&&f){var h=l[0]._private,v=h.traversalCache=h.traversalCache||{},c=v[r]=v[r]||[],d=Kr(f),g=c[d];return g||(c[d]=e.call(l,n,i,o,s))}else return e.call(l,n,i,o,s)}},Ca={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],o=i._private.parent;o&&r.push(o)}return this.spawn(r,!0).filter(e)},parents:function(e){for(var r=[],a=this.parent();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){for(var r,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:Yt(function(t){for(var e=[],r=0;r<this.length;r++)for(var a=this[r],n=a._private.children,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 o=n[i];r.push(o),o.children().nonempty()&&a(o.children())}}return a(this.children()),this.spawn(r,!0).filter(e)}};function Gv(t,e,r,a){for(var n=[],i=new La,o=t.cy(),s=o.hasCompoundNodes(),u=0;u<t.length;u++){var l=t[u];r?n.push(l):s&&a(n,i,l)}for(;n.length>0;){var f=n.shift();e(f),i.add(f.id()),s&&a(n,i,f)}return t}function aw(t,e,r){if(r.isParent())for(var a=r._private.children,n=0;n<a.length;n++){var i=a[n];e.has(i.id())||t.push(i)}}Ca.forEachDown=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return Gv(this,t,e,aw)};function nw(t,e,r){if(r.isChild()){var a=r._private.parent;e.has(a.id())||t.push(a)}}Ca.forEachUp=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return Gv(this,t,e,nw)};function KL(t,e,r){nw(t,e,r),aw(t,e,r)}Ca.forEachUpAndDown=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return Gv(this,t,e,KL)};Ca.ancestors=Ca.parents;var ln,iw;ln=iw={data:Ke.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:Ke.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:Ke.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Ke.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:Ke.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:Ke.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}};ln.attr=ln.data;ln.removeAttr=ln.removeData;var ZL=iw,_i={};function Ss(t){return function(e){var r=this;if(e===void 0&&(e=!0),r.length!==0)if(r.isNode()&&!r.removed()){for(var a=0,n=r[0],i=n._private.edges,o=0;o<i.length;o++){var s=i[o];!e&&s.isLoop()||(a+=t(n,s))}return a}else return}}Be(_i,{degree:Ss(function(t,e){return e.source().same(e.target())?2:1}),indegree:Ss(function(t,e){return e.target().same(t)?1:0}),outdegree:Ss(function(t,e){return e.source().same(t)?1:0})});function sa(t,e){return function(r){for(var a,n=this.nodes(),i=0;i<n.length;i++){var o=n[i],s=o[t](r);s!==void 0&&(a===void 0||e(s,a))&&(a=s)}return a}}Be(_i,{minDegree:sa("degree",function(t,e){return t<e}),maxDegree:sa("degree",function(t,e){return t>e}),minIndegree:sa("indegree",function(t,e){return t<e}),maxIndegree:sa("indegree",function(t,e){return t>e}),minOutdegree:sa("outdegree",function(t,e){return t<e}),maxOutdegree:sa("outdegree",function(t,e){return t>e})});Be(_i,{totalDegree:function(e){for(var r=0,a=this.nodes(),n=0;n<a.length;n++)r+=a[n].degree(e);return r}});var Kt,ow,sw=function(e,r,a){for(var n=0;n<e.length;n++){var i=e[n];if(!i.locked()){var o=i._private.position,s={x:r.x!=null?r.x-o.x:0,y:r.y!=null?r.y-o.y:0};i.isParent()&&!(s.x===0&&s.y===0)&&i.children().shift(s,a),i.dirtyBoundingBoxCache()}}},Qg={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){sw(e,r,!1)},onSet:function(e){e.dirtyCompoundBoundsCache()},canSet:function(e){return!e.locked()}};Kt=ow={position:Ke.data(Qg),silentPosition:Ke.data(Be({},Qg,{allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!1,beforeSet:function(e,r){sw(e,r,!0)},onSet:function(e){e.dirtyCompoundBoundsCache()}})),positions:function(e,r){if(Ye(e))r?this.silentPosition(e):this.position(e);else if(ot(e)){var a=e,n=this.cy();n.startBatch();for(var i=0;i<this.length;i++){var o=this[i],s=void 0;(s=a(o,i))&&(r?o.silentPosition(s):o.position(s))}n.endBatch()}return this},silentPositions:function(e){return this.positions(e,!0)},shift:function(e,r,a){var n;if(Ye(e)?(n={x:Te(e.x)?e.x:0,y:Te(e.y)?e.y:0},a=r):Me(e)&&Te(r)&&(n={x:0,y:0},n[e]=r),n!=null){var i=this.cy();i.startBatch();for(var o=0;o<this.length;o++){var s=this[o];if(!(i.hasCompoundNodes()&&s.isChild()&&s.ancestors().anySame(this))){var u=s.position(),l={x:u.x+n.x,y:u.y+n.y};a?s.silentPosition(l):s.position(l)}}i.endBatch()}return this},silentShift:function(e,r){return Ye(e)?this.shift(e,!0):Me(e)&&Te(r)&&this.shift(e,r,!0),this},renderedPosition:function(e,r){var a=this[0],n=this.cy(),i=n.zoom(),o=n.pan(),s=Ye(e)?e:void 0,u=s!==void 0||r!==void 0&&Me(e);if(a&&a.isNode())if(u)for(var l=0;l<this.length;l++){var f=this[l];r!==void 0?f.position(e,(r-o[e])/i):s!==void 0&&f.position(FE(s,i,o))}else{var h=a.position();return s=Ni(h,i,o),e===void 0?s:s[e]}else if(!u)return;return this},relativePosition:function(e,r){var a=this[0],n=this.cy(),i=Ye(e)?e:void 0,o=i!==void 0||r!==void 0&&Me(e),s=n.hasCompoundNodes();if(a&&a.isNode())if(o)for(var u=0;u<this.length;u++){var l=this[u],f=s?l.parent():null,h=f&&f.length>0,v=h;h&&(f=f[0]);var c=v?f.position():{x:0,y:0};r!==void 0?l.position(e,r+c[e]):i!==void 0&&l.position({x:i.x+c.x,y:i.y+c.y})}else{var d=a.position(),g=s?a.parent():null,p=g&&g.length>0,y=p;p&&(g=g[0]);var b=y?g.position():{x:0,y:0};return i={x:d.x-b.x,y:d.y-b.y},e===void 0?i:i[e]}else if(!o)return;return this}};Kt.modelPosition=Kt.point=Kt.position;Kt.modelPositions=Kt.points=Kt.positions;Kt.renderedPoint=Kt.renderedPosition;Kt.relativePoint=Kt.relativePosition;var QL=ow,wa,_r;wa=_r={};_r.renderedBoundingBox=function(t){var e=this.boundingBox(t),r=this.cy(),a=r.zoom(),n=r.pan(),i=e.x1*a+n.x,o=e.x2*a+n.x,s=e.y1*a+n.y,u=e.y2*a+n.y;return{x1:i,x2:o,y1:s,y2:u,w:o-i,h:u-s}};_r.dirtyCompoundBoundsCache=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();return!e.styleEnabled()||!e.hasCompoundNodes()?this:(this.forEachUp(function(r){if(r.isParent()){var a=r._private;a.compoundBoundsClean=!1,a.bbCache=null,t||r.emitAndNotify("bounds")}}),this)};_r.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(o){if(!o.isParent())return;var s=o._private,u=o.children(),l=o.pstyle("compound-sizing-wrt-labels").value==="include",f={width:{val:o.pstyle("min-width").pfValue,left:o.pstyle("min-width-bias-left"),right:o.pstyle("min-width-bias-right")},height:{val:o.pstyle("min-height").pfValue,top:o.pstyle("min-height-bias-top"),bottom:o.pstyle("min-height-bias-bottom")}},h=u.boundingBox({includeLabels:l,includeOverlays:!1,useCache:!1}),v=s.position;(h.w===0||h.h===0)&&(h={w:o.pstyle("width").pfValue,h:o.pstyle("height").pfValue},h.x1=v.x-h.w/2,h.x2=v.x+h.w/2,h.y1=v.y-h.h/2,h.y2=v.y+h.h/2);function c(A,R,S){var D=0,P=0,x=R+S;return A>0&&x>0&&(D=R/x*A,P=S/x*A),{biasDiff:D,biasComplementDiff:P}}function d(A,R,S,D){if(S.units==="%")switch(D){case"width":return A>0?S.pfValue*A:0;case"height":return R>0?S.pfValue*R:0;case"average":return A>0&&R>0?S.pfValue*(A+R)/2:0;case"min":return A>0&&R>0?A>R?S.pfValue*R:S.pfValue*A:0;case"max":return A>0&&R>0?A>R?S.pfValue*A:S.pfValue*R:0;default:return 0}else return S.units==="px"?S.pfValue:0}var g=f.width.left.value;f.width.left.units==="px"&&f.width.val>0&&(g=g*100/f.width.val);var p=f.width.right.value;f.width.right.units==="px"&&f.width.val>0&&(p=p*100/f.width.val);var y=f.height.top.value;f.height.top.units==="px"&&f.height.val>0&&(y=y*100/f.height.val);var b=f.height.bottom.value;f.height.bottom.units==="px"&&f.height.val>0&&(b=b*100/f.height.val);var m=c(f.width.val-h.w,g,p),E=m.biasDiff,T=m.biasComplementDiff,L=c(f.height.val-h.h,y,b),w=L.biasDiff,C=L.biasComplementDiff;s.autoPadding=d(h.w,h.h,o.pstyle("padding"),o.pstyle("padding-relative-to").value),s.autoWidth=Math.max(h.w,f.width.val),v.x=(-E+h.x1+h.x2+T)/2,s.autoHeight=Math.max(h.h,f.height.val),v.y=(-w+h.y1+h.y2+C)/2}for(var a=0;a<this.length;a++){var n=this[a],i=n._private;(!i.compoundBoundsClean||t)&&(r(n),e.batching()||(i.compoundBoundsClean=!0))}return this};var Vt=function(e){return e===1/0||e===-1/0?0:e},Wt=function(e,r,a,n,i){n-r===0||i-a===0||r==null||a==null||n==null||i==null||(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)},Tr=function(e,r){return r==null?e:Wt(e,r.x1,r.y1,r.x2,r.y2)},za=function(e,r,a){return _t(e,r,a)},Un=function(e,r,a){if(!r.cy().headless()){var n=r._private,i=n.rstyle,o=i.arrowWidth/2,s=r.pstyle(a+"-arrow-shape").value,u,l;if(s!=="none"){a==="source"?(u=i.srcX,l=i.srcY):a==="target"?(u=i.tgtX,l=i.tgtY):(u=i.midX,l=i.midY);var f=n.arrowBounds=n.arrowBounds||{},h=f[a]=f[a]||{};h.x1=u-o,h.y1=l-o,h.x2=u+o,h.y2=l+o,h.w=h.x2-h.x1,h.h=h.y2-h.y1,Kn(h,1),Wt(e,h.x1,h.y1,h.x2,h.y2)}}},Ds=function(e,r,a){if(!r.cy().headless()){var n;a?n=a+"-":n="";var i=r._private,o=i.rstyle,s=r.pstyle(n+"label").strValue;if(s){var u=r.pstyle("text-halign"),l=r.pstyle("text-valign"),f=za(o,"labelWidth",a),h=za(o,"labelHeight",a),v=za(o,"labelX",a),c=za(o,"labelY",a),d=r.pstyle(n+"text-margin-x").pfValue,g=r.pstyle(n+"text-margin-y").pfValue,p=r.isEdge(),y=r.pstyle(n+"text-rotation"),b=r.pstyle("text-outline-width").pfValue,m=r.pstyle("text-border-width").pfValue,E=m/2,T=r.pstyle("text-background-padding").pfValue,L=2,w=h,C=f,A=C/2,R=w/2,S,D,P,x;if(p)S=v-A,D=v+A,P=c-R,x=c+R;else{switch(u.value){case"left":S=v-C,D=v;break;case"center":S=v-A,D=v+A;break;case"right":S=v,D=v+C;break}switch(l.value){case"top":P=c-w,x=c;break;case"center":P=c-R,x=c+R;break;case"bottom":P=c,x=c+w;break}}var N=d-Math.max(b,E)-T-L,M=d+Math.max(b,E)+T+L,I=g-Math.max(b,E)-T-L,O=g+Math.max(b,E)+T+L;S+=N,D+=M,P+=I,x+=O;var q=a||"main",_=i.labelBounds,B=_[q]=_[q]||{};B.x1=S,B.y1=P,B.x2=D,B.y2=x,B.w=D-S,B.h=x-P,B.leftPad=N,B.rightPad=M,B.topPad=I,B.botPad=O;var z=p&&y.strValue==="autorotate",Y=y.pfValue!=null&&y.pfValue!==0;if(z||Y){var k=z?za(i.rstyle,"labelAngle",a):y.pfValue,G=Math.cos(k),U=Math.sin(k),W=(S+D)/2,j=(P+x)/2;if(!p){switch(u.value){case"left":W=D;break;case"right":W=S;break}switch(l.value){case"top":j=x;break;case"bottom":j=P;break}}var H=function(se,oe){return se=se-W,oe=oe-j,{x:se*G-oe*U+W,y:se*U+oe*G+j}},V=H(S,P),X=H(S,x),Z=H(D,P),ee=H(D,x);S=Math.min(V.x,X.x,Z.x,ee.x),D=Math.max(V.x,X.x,Z.x,ee.x),P=Math.min(V.y,X.y,Z.y,ee.y),x=Math.max(V.y,X.y,Z.y,ee.y)}var re=q+"Rot",ue=_[re]=_[re]||{};ue.x1=S,ue.y1=P,ue.x2=D,ue.y2=x,ue.w=D-S,ue.h=x-P,Wt(e,S,P,D,x),Wt(i.labelBounds.all,S,P,D,x)}return e}},Jg=function(e,r){if(!r.cy().headless()){var a=r.pstyle("outline-opacity").value,n=r.pstyle("outline-width").value,i=r.pstyle("outline-offset").value,o=n+i;uw(e,r,a,o,"outside",o/2)}},uw=function(e,r,a,n,i,o){if(!(a===0||n<=0||i==="inside")){var s=r.cy(),u=s.renderer(),l=u.nodeShapes[u.getNodeShape(r)];if(l){var f=r.position(),h=f.x,v=f.y,c=r.width(),d=r.height();if(l.hasMiterBounds){i==="center"&&(n/=2);var g=l.miterBounds(h,v,c,d,n);Tr(e,g)}else o!=null&&o>0&&Zn(e,[o,o,o,o])}}},JL=function(e,r){if(!r.cy().headless()){var a=r.pstyle("border-opacity").value,n=r.pstyle("border-width").pfValue,i=r.pstyle("border-position").value;uw(e,r,a,n,i)}},jL=function(e,r){var a=e._private.cy,n=a.styleEnabled(),i=a.headless(),o=Pt(),s=e._private,u=e.isNode(),l=e.isEdge(),f,h,v,c,d,g,p=s.rstyle,y=u&&n?e.pstyle("bounds-expansion").pfValue:[0],b=function(xe){return xe.pstyle("display").value!=="none"},m=!n||b(e)&&(!l||b(e.source())&&b(e.target()));if(m){var E=0,T=0;n&&r.includeOverlays&&(E=e.pstyle("overlay-opacity").value,E!==0&&(T=e.pstyle("overlay-padding").value));var L=0,w=0;n&&r.includeUnderlays&&(L=e.pstyle("underlay-opacity").value,L!==0&&(w=e.pstyle("underlay-padding").value));var C=Math.max(T,w),A=0,R=0;if(n&&(A=e.pstyle("width").pfValue,R=A/2),u&&r.includeNodes){var S=e.position();d=S.x,g=S.y;var D=e.outerWidth(),P=D/2,x=e.outerHeight(),N=x/2;f=d-P,h=d+P,v=g-N,c=g+N,Wt(o,f,v,h,c),n&&Jg(o,e),n&&r.includeOutlines&&!i&&Jg(o,e),n&&JL(o,e)}else if(l&&r.includeEdges)if(n&&!i){var M=e.pstyle("curve-style").strValue;if(f=Math.min(p.srcX,p.midX,p.tgtX),h=Math.max(p.srcX,p.midX,p.tgtX),v=Math.min(p.srcY,p.midY,p.tgtY),c=Math.max(p.srcY,p.midY,p.tgtY),f-=R,h+=R,v-=R,c+=R,Wt(o,f,v,h,c),M==="haystack"){var I=p.haystackPts;if(I&&I.length===2){if(f=I[0].x,v=I[0].y,h=I[1].x,c=I[1].y,f>h){var O=f;f=h,h=O}if(v>c){var q=v;v=c,c=q}Wt(o,f-R,v-R,h+R,c+R)}}else if(M==="bezier"||M==="unbundled-bezier"||xr(M,"segments")||xr(M,"taxi")){var _;switch(M){case"bezier":case"unbundled-bezier":_=p.bezierPts;break;case"segments":case"taxi":case"round-segments":case"round-taxi":_=p.linePts;break}if(_!=null)for(var B=0;B<_.length;B++){var z=_[B];f=z.x-R,h=z.x+R,v=z.y-R,c=z.y+R,Wt(o,f,v,h,c)}}}else{var Y=e.source(),k=Y.position(),G=e.target(),U=G.position();if(f=k.x,h=U.x,v=k.y,c=U.y,f>h){var W=f;f=h,h=W}if(v>c){var j=v;v=c,c=j}f-=R,h+=R,v-=R,c+=R,Wt(o,f,v,h,c)}if(n&&r.includeEdges&&l&&(Un(o,e,"mid-source"),Un(o,e,"mid-target"),Un(o,e,"source"),Un(o,e,"target")),n){var H=e.pstyle("ghost").value==="yes";if(H){var V=e.pstyle("ghost-offset-x").pfValue,X=e.pstyle("ghost-offset-y").pfValue;Wt(o,o.x1+V,o.y1+X,o.x2+V,o.y2+X)}}var Z=s.bodyBounds=s.bodyBounds||{};Bd(Z,o),Zn(Z,y),Kn(Z,1),n&&(f=o.x1,h=o.x2,v=o.y1,c=o.y2,Wt(o,f-C,v-C,h+C,c+C));var ee=s.overlayBounds=s.overlayBounds||{};Bd(ee,o),Zn(ee,y),Kn(ee,1);var re=s.labelBounds=s.labelBounds||{};re.all!=null?PC(re.all):re.all=Pt(),n&&r.includeLabels&&(r.includeMainLabels&&Ds(o,e,null),l&&(r.includeSourceLabels&&Ds(o,e,"source"),r.includeTargetLabels&&Ds(o,e,"target")))}return o.x1=Vt(o.x1),o.y1=Vt(o.y1),o.x2=Vt(o.x2),o.y2=Vt(o.y2),o.w=Vt(o.x2-o.x1),o.h=Vt(o.y2-o.y1),o.w>0&&o.h>0&&m&&(Zn(o,y),Kn(o,1)),o},lw=function(e){var r=0,a=function(o){return(o?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},fw=function(e){var r=function(s){return Math.round(s)};if(e.isEdge()){var a=e.source().position(),n=e.target().position();return Md([r(a.x),r(a.y),r(n.x),r(n.y)])}else{var i=e.position();return Md([r(i.x),r(i.y)])}},jg=function(e,r){var a=e._private,n,i=e.isEdge(),o=r==null?ep:lw(r),s=o===ep;if(a.bbCache==null?(n=jL(e,fn),a.bbCache=n,a.bbCachePosKey=fw(e)):n=a.bbCache,!s){var u=e.isNode();n=Pt(),(r.includeNodes&&u||r.includeEdges&&!u)&&(r.includeOverlays?Tr(n,a.overlayBounds):Tr(n,a.bodyBounds)),r.includeLabels&&(r.includeMainLabels&&(!i||r.includeSourceLabels&&r.includeTargetLabels)?Tr(n,a.labelBounds.all):(r.includeMainLabels&&Tr(n,a.labelBounds.mainRot),r.includeSourceLabels&&Tr(n,a.labelBounds.sourceRot),r.includeTargetLabels&&Tr(n,a.labelBounds.targetRot))),n.w=n.x2-n.x1,n.h=n.y2-n.y1}return n},fn={includeNodes:!0,includeEdges:!0,includeLabels:!0,includeMainLabels:!0,includeSourceLabels:!0,includeTargetLabels:!0,includeOverlays:!0,includeUnderlays:!0,includeOutlines:!0,useCache:!0},ep=lw(fn),tp=Lt(fn);_r.boundingBox=function(t){var e,r=t===void 0||t.useCache===void 0||t.useCache===!0,a=Ta(function(f){var h=f._private;return h.bbCache==null||h.styleDirty||h.bbCachePosKey!==fw(f)},function(f){return f.id()});if(r&&this.length===1&&!a(this[0]))t===void 0?t=fn:t=tp(t),e=jg(this[0],t);else{e=Pt(),t=t||fn;var n=tp(t),i=this,o=i.cy(),s=o.styleEnabled();this.edges().forEach(a),this.nodes().forEach(a),s&&this.recalculateRenderedStyle(r),this.updateCompoundBounds(!r);for(var u=0;u<i.length;u++){var l=i[u];a(l)&&l.dirtyBoundingBoxCache(),Tr(e,jg(l,n))}}return e.x1=Vt(e.x1),e.y1=Vt(e.y1),e.x2=Vt(e.x2),e.y2=Vt(e.y2),e.w=Vt(e.x2-e.x1),e.h=Vt(e.y2-e.y1),e};_r.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};_r.boundingBoxAt=function(t){var e=this.nodes(),r=this.cy(),a=r.hasCompoundNodes(),n=r.collection();if(a&&(n=e.filter(function(l){return l.isParent()}),e=e.not(n)),Ye(t)){var i=t;t=function(){return i}}var o=function(f,h){return f._private.bbAtOldPos=t(f,h)},s=function(f){return f._private.bbAtOldPos};r.startBatch(),e.forEach(o).silentPositions(t),a&&(n.dirtyCompoundBoundsCache(),n.dirtyBoundingBoxCache(),n.updateCompoundBounds(!0));var u=IC(this.boundingBox({useCache:!1}));return e.silentPositions(s),a&&(n.dirtyCompoundBoundsCache(),n.dirtyBoundingBoxCache(),n.updateCompoundBounds(!0)),r.endBatch(),u};wa.boundingbox=wa.bb=wa.boundingBox;wa.renderedBoundingbox=wa.renderedBoundingBox;var eR=_r,Ka,wn;Ka=wn={};var hw=function(e){e.uppercaseName=pd(e.name),e.autoName="auto"+e.uppercaseName,e.labelName="label"+e.uppercaseName,e.outerName="outer"+e.uppercaseName,e.uppercaseOuterName=pd(e.outerName),Ka[e.name]=function(){var a=this[0],n=a._private,i=n.cy,o=i._private.styleEnabled;if(a)if(o){if(a.isParent())return a.updateCompoundBounds(),n[e.autoName]||0;var s=a.pstyle(e.name);switch(s.strValue){case"label":return a.recalculateRenderedStyle(),n.rstyle[e.labelName]||0;default:return s.pfValue}}else return 1},Ka["outer"+e.uppercaseName]=function(){var a=this[0],n=a._private,i=n.cy,o=i._private.styleEnabled;if(a)if(o){var s=a[e.name](),u=a.pstyle("border-position").value,l;u==="center"?l=a.pstyle("border-width").pfValue:u==="outside"?l=2*a.pstyle("border-width").pfValue:l=0;var f=2*a.padding();return s+l+f}else return 1},Ka["rendered"+e.uppercaseName]=function(){var a=this[0];if(a){var n=a[e.name]();return n*this.cy().zoom()}},Ka["rendered"+e.uppercaseOuterName]=function(){var a=this[0];if(a){var n=a[e.outerName]();return n*this.cy().zoom()}}};hw({name:"width"});hw({name:"height"});wn.padding=function(){var t=this[0],e=t._private;return t.isParent()?(t.updateCompoundBounds(),e.autoPadding!==void 0?e.autoPadding:t.pstyle("padding").pfValue):t.pstyle("padding").pfValue};wn.paddedHeight=function(){var t=this[0];return t.height()+2*t.padding()};wn.paddedWidth=function(){var t=this[0];return t.width()+2*t.padding()};var tR=wn,rR=function(e,r){if(e.isEdge()&&e.takesUpSpace())return r(e)},aR=function(e,r){if(e.isEdge()&&e.takesUpSpace()){var a=e.cy();return Ni(r(e),a.zoom(),a.pan())}},nR=function(e,r){if(e.isEdge()&&e.takesUpSpace()){var a=e.cy(),n=a.pan(),i=a.zoom();return r(e).map(function(o){return Ni(o,i,n)})}},iR=function(e){return e.renderer().getControlPoints(e)},oR=function(e){return e.renderer().getSegmentPoints(e)},sR=function(e){return e.renderer().getSourceEndpoint(e)},uR=function(e){return e.renderer().getTargetEndpoint(e)},lR=function(e){return e.renderer().getEdgeMidpoint(e)},rp={controlPoints:{get:iR,mult:!0},segmentPoints:{get:oR,mult:!0},sourceEndpoint:{get:sR},targetEndpoint:{get:uR},midpoint:{get:lR}},fR=function(e){return"rendered"+e[0].toUpperCase()+e.substr(1)},hR=Object.keys(rp).reduce(function(t,e){var r=rp[e],a=fR(e);return t[e]=function(){return rR(this,r.get)},r.mult?t[a]=function(){return nR(this,r.get)}:t[a]=function(){return aR(this,r.get)},t},{}),cR=Be({},QL,eR,tR,hR);/*!
9
+ Event object based on jQuery events, MIT license
10
+
11
+ https://jquery.org/license/
12
+ https://tldrlegal.com/license/mit-license
13
+ https://github.com/jquery/jquery/blob/master/src/event.js
14
+ */var cw=function(e,r){this.recycle(e,r)};function Va(){return!1}function zn(){return!0}cw.prototype={instanceString:function(){return"event"},recycle:function(e,r){if(this.isImmediatePropagationStopped=this.isPropagationStopped=this.isDefaultPrevented=Va,e!=null&&e.preventDefault?(this.type=e.type,this.isDefaultPrevented=e.defaultPrevented?zn:Va):e!=null&&e.type?r=e:this.type=e,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),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=zn;var e=this.originalEvent;e&&e.preventDefault&&e.preventDefault()},stopPropagation:function(){this.isPropagationStopped=zn;var e=this.originalEvent;e&&e.stopPropagation&&e.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=zn,this.stopPropagation()},isDefaultPrevented:Va,isPropagationStopped:Va,isImmediatePropagationStopped:Va};var vw=/^([^.]+)(\.(?:[^.]+))?$/,vR=".*",dw={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},ap=Object.keys(dw),dR={};function Bi(){for(var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:dR,e=arguments.length>1?arguments[1]:void 0,r=0;r<ap.length;r++){var a=ap[r];this[a]=t[a]||dw[a]}this.context=e||this.context,this.listeners=[],this.emitting=0}var Ir=Bi.prototype,gw=function(e,r,a,n,i,o,s){ot(n)&&(i=n,n=null),s&&(o==null?o=s:o=Be({},o,s));for(var u=je(a)?a:a.split(/\s+/),l=0;l<u.length;l++){var f=u[l];if(!Sr(f)){var h=f.match(vw);if(h){var v=h[1],c=h[2]?h[2]:null,d=r(e,f,v,c,n,i,o);if(d===!1)break}}}},np=function(e,r){return e.addEventFields(e.context,r),new cw(r.type,r)},gR=function(e,r,a){if(wx(a)){r(e,a);return}else if(Ye(a)){r(e,np(e,a));return}for(var n=je(a)?a:a.split(/\s+/),i=0;i<n.length;i++){var o=n[i];if(!Sr(o)){var s=o.match(vw);if(s){var u=s[1],l=s[2]?s[2]:null,f=np(e,{type:u,namespace:l,target:e.context});r(e,f)}}}};Ir.on=Ir.addListener=function(t,e,r,a,n){return gw(this,function(i,o,s,u,l,f,h){ot(f)&&i.listeners.push({event:o,callback:f,type:s,namespace:u,qualifier:l,conf:h})},t,e,r,a,n),this};Ir.one=function(t,e,r,a){return this.on(t,e,r,a,{one:!0})};Ir.removeListener=Ir.off=function(t,e,r,a){var n=this;this.emitting!==0&&(this.listeners=aC(this.listeners));for(var i=this.listeners,o=function(l){var f=i[l];gw(n,function(h,v,c,d,g,p){if((f.type===c||t==="*")&&(!d&&f.namespace!==".*"||f.namespace===d)&&(!g||h.qualifierCompare(f.qualifier,g))&&(!p||f.callback===p))return i.splice(l,1),!1},t,e,r,a)},s=i.length-1;s>=0;s--)o(s);return this};Ir.removeAllListeners=function(){return this.removeListener("*")};Ir.emit=Ir.trigger=function(t,e,r){var a=this.listeners,n=a.length;return this.emitting++,je(e)||(e=[e]),gR(this,function(i,o){r!=null&&(a=[{event:o.event,type:o.type,namespace:o.namespace,callback:r}],n=a.length);for(var s=function(){var f=a[u];if(f.type===o.type&&(!f.namespace||f.namespace===o.namespace||f.namespace===vR)&&i.eventMatches(i.context,f,o)){var h=[o];e!=null&&iC(h,e),i.beforeEmit(i.context,f,o),f.conf&&f.conf.one&&(i.listeners=i.listeners.filter(function(d){return d!==f}));var v=i.callbackContext(i.context,f,o),c=f.callback.apply(v,h);i.afterEmit(i.context,f,o),c===!1&&(o.stopPropagation(),o.preventDefault())}},u=0;u<n;u++)s();i.bubble(i.context)&&!o.isPropagationStopped()&&i.parent(i.context).emit(o,e)},t),this.emitting--,this};var pR={qualifierCompare:function(e,r){return e==null||r==null?e==null&&r==null:e.sameText(r)},eventMatches:function(e,r,a){var n=r.qualifier;return n!=null?e!==a.target&&gn(a.target)&&n.matches(a.target):!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){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()}},Vn=function(e){return Me(e)?new Mr(e):e},pw={createEmitter:function(){for(var e=0;e<this.length;e++){var r=this[e],a=r._private;a.emitter||(a.emitter=new Bi(pR,r))}return this},emitter:function(){return this._private.emitter},on:function(e,r,a){for(var n=Vn(r),i=0;i<this.length;i++){var o=this[i];o.emitter().on(e,n,a)}return this},removeListener:function(e,r,a){for(var n=Vn(r),i=0;i<this.length;i++){var o=this[i];o.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){for(var n=Vn(r),i=0;i<this.length;i++){var o=this[i];o.emitter().one(e,n,a)}return this},once:function(e,r,a){for(var n=Vn(r),i=0;i<this.length;i++){var o=this[i];o.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 this.cy().notify(e,this),this.emit(e,r),this}};Ke.eventAliasesOn(pw);var yw={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(){for(var e=this.spawn(),r=this.spawn(),a=0;a<this.length;a++){var n=this[a];n.isNode()?e.push(n):r.push(n)}return{nodes:e,edges:r}},filter:function(e,r){if(e===void 0)return this;if(Me(e)||Ut(e))return new Mr(e).filter(this);if(ot(e)){for(var a=this.spawn(),n=this,i=0;i<n.length;i++){var o=n[i],s=r?e.apply(r,[o,i,n]):e(o,i,n);s&&a.push(o)}return a}return this.spawn()},not:function(e){if(e){Me(e)&&(e=this.filter(e));for(var r=this.spawn(),a=0;a<this.length;a++){var n=this[a],i=e.has(n);i||r.push(n)}return r}else return this},absoluteComplement:function(){var e=this.cy();return e.mutableElements().not(this)},intersect:function(e){if(Me(e)){var r=e;return this.filter(r)}for(var a=this.spawn(),n=this,i=e,o=this.length<e.length,s=o?n:i,u=o?i:n,l=0;l<s.length;l++){var f=s[l];u.has(f)&&a.push(f)}return a},xor:function(e){var r=this._private.cy;Me(e)&&(e=r.$(e));var a=this.spawn(),n=this,i=e,o=function(u,l){for(var f=0;f<u.length;f++){var h=u[f],v=h._private.data.id,c=l.hasElementWithId(v);c||a.push(h)}};return o(n,i),o(i,n),a},diff:function(e){var r=this._private.cy;Me(e)&&(e=r.$(e));var a=this.spawn(),n=this.spawn(),i=this.spawn(),o=this,s=e,u=function(f,h,v){for(var c=0;c<f.length;c++){var d=f[c],g=d._private.data.id,p=h.hasElementWithId(g);p?i.merge(d):v.push(d)}};return u(o,s,a),u(s,o,n),{left:a,right:n,both:i}},add:function(e){var r=this._private.cy;if(!e)return this;if(Me(e)){var a=e;e=r.mutableElements().filter(a)}for(var n=this.spawnSelf(),i=0;i<e.length;i++){var o=e[i],s=!this.has(o);s&&n.push(o)}return n},merge:function(e){var r=this._private,a=r.cy;if(!e)return this;if(e&&Me(e)){var n=e;e=a.mutableElements().filter(n)}for(var i=r.map,o=0;o<e.length;o++){var s=e[o],u=s._private.data.id,l=!i.has(u);if(l){var f=this.length++;this[f]=s,i.set(u,{ele:s,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 o=e===this.length-1;if(this.length>1&&!o){var s=this.length-1,u=this[s],l=u._private.data.id;this[s]=void 0,this[e]=u,i.set(l,{ele:u,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 o=i.index;return this.unmergeAt(o),this},unmerge:function(e){var r=this._private.cy;if(!e)return this;if(e&&Me(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];e(a)&&this.unmergeAt(r)}return this},map:function(e,r){for(var a=[],n=this,i=0;i<n.length;i++){var o=n[i],s=r?e.apply(r,[o,i,n]):e(o,i,n);a.push(s)}return a},reduce:function(e,r){for(var a=r,n=this,i=0;i<n.length;i++)a=e(a,n[i],i,n);return a},max:function(e,r){for(var a=-1/0,n,i=this,o=0;o<i.length;o++){var s=i[o],u=r?e.apply(r,[s,o,i]):e(s,o,i);u>a&&(a=u,n=s)}return{value:a,ele:n}},min:function(e,r){for(var a=1/0,n,i=this,o=0;o<i.length;o++){var s=i[o],u=r?e.apply(r,[s,o,i]):e(s,o,i);u<a&&(a=u,n=s)}return{value:a,ele:n}}},He=yw;He.u=He["|"]=He["+"]=He.union=He.or=He.add;He["\\"]=He["!"]=He["-"]=He.difference=He.relativeComplement=He.subtract=He.not;He.n=He["&"]=He["."]=He.and=He.intersection=He.intersect;He["^"]=He["(+)"]=He["(-)"]=He.symmetricDifference=He.symdiff=He.xor;He.fnFilter=He.filterFn=He.stdFilter=He.filter;He.complement=He.abscomp=He.absoluteComplement;var yR={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}},mw=function(e,r){var a=e.cy(),n=a.hasCompoundNodes();function i(f){var h=f.pstyle("z-compound-depth");return h.value==="auto"?n?f.zDepth():0:h.value==="bottom"?-1:h.value==="top"?Dv:0}var o=i(e)-i(r);if(o!==0)return o;function s(f){var h=f.pstyle("z-index-compare");return h.value==="auto"&&f.isNode()?1:0}var u=s(e)-s(r);if(u!==0)return u;var l=e.pstyle("z-index").value-r.pstyle("z-index").value;return l!==0?l:e.poolIndex()-r.poolIndex()},bi={forEach:function(e,r){if(ot(e))for(var a=this.length,n=0;n<a;n++){var i=this[n],o=r?e.apply(r,[i,n,this]):e(i,n,this);if(o===!1)break}return this},toArray:function(){for(var e=[],r=0;r<this.length;r++)e.push(this[r]);return e},slice:function(e,r){var a=[],n=this.length;r==null&&(r=n),e==null&&(e=0),e<0&&(e=n+e),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(!ot(e))return this;var r=this.toArray().sort(e);return this.spawn(r)},sortByZIndex:function(){return this.sort(mw)},zDepth:function(){var e=this[0];if(e){var r=e._private,a=r.group;if(a==="nodes"){var n=r.data.parent?e.parents().size():0;return e.isParent()?n:Dv-1}else{var i=r.source,o=r.target,s=i.zDepth(),u=o.zDepth();return Math.max(s,u,0)}}}};bi.each=bi.forEach;var mR=function(){var e="undefined",r=(typeof Symbol>"u"?"undefined":bt(Symbol))!=e&&bt(Symbol.iterator)!=e;r&&(bi[Symbol.iterator]=function(){var a=this,n={value:void 0,done:!1},i=0,o=this.length;return pE({next:function(){return i<o?n.value=a[i++]:(n.value=void 0,n.done=!0),n}},Symbol.iterator,function(){return this})})};mR();var bR=Lt({nodeDimensionsIncludeLabels:!1}),Jn={layoutDimensions:function(e){e=bR(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()};return(r.w===0||r.h===0)&&(r.w=r.h=1),r},layoutPositions:function(e,r,a){var n=this.nodes().filter(function(T){return!T.isParent()}),i=this.cy(),o=r.eles,s=function(L){return L.id()},u=Ta(a,s);e.emit({type:"layoutstart",layout:e}),e.animations=[];var l=function(L,w,C){var A={x:w.x1+w.w/2,y:w.y1+w.h/2},R={x:(C.x-A.x)*L,y:(C.y-A.y)*L};return{x:A.x+R.x,y:A.y+R.y}},f=r.spacingFactor&&r.spacingFactor!==1,h=function(){if(!f)return null;for(var L=Pt(),w=0;w<n.length;w++){var C=n[w],A=u(C,w);_E(L,A.x,A.y)}return L},v=h(),c=Ta(function(T,L){var w=u(T,L);if(f){var C=Math.abs(r.spacingFactor);w=l(C,v,w)}return r.transform!=null&&(w=r.transform(T,w)),w},s);if(r.animate){for(var d=0;d<n.length;d++){var g=n[d],p=c(g,d),y=r.animateFilter==null||r.animateFilter(g,d);if(y){var b=g.animation({position:p,duration:r.animationDuration,easing:r.animationEasing});e.animations.push(b)}else g.position(p)}if(r.fit){var m=i.animation({fit:{boundingBox:o.boundingBoxAt(c),padding:r.padding},duration:r.animationDuration,easing:r.animationEasing});e.animations.push(m)}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(T){return T.play()}),e.one("layoutready",r.ready),e.emit({type:"layoutready",layout:e}),Ra.all(e.animations.map(function(T){return T.promise()})).then(function(){e.one("layoutstop",r.stop),e.emit({type:"layoutstop",layout:e})})}else n.positions(c),r.fit&&i.fit(r.eles,r.padding),r.zoom!=null&&i.zoom(r.zoom),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(Be({},e,{eles:this}))}};Jn.createLayout=Jn.makeLayout=Jn.layout;function bw(t,e,r){var a=r._private,n=a.styleCache=a.styleCache||[],i;return(i=n[t])!=null||(i=n[t]=e(r)),i}function ki(t,e){return t=Kr(t),function(a){return bw(t,e,a)}}function qi(t,e){t=Kr(t);var r=function(n){return e.call(n)};return function(){var n=this[0];if(n)return bw(t,r,n)}}var Ct={recalculateRenderedStyle:function(e){var r=this.cy(),a=r.renderer(),n=r.styleEnabled();return a&&n&&a.recalculateRenderedStyle(this,e),this},dirtyStyleCache:function(){var e=this.cy(),r=function(i){return i._private.styleCache=null};if(e.hasCompoundNodes()){var a;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;e=!!(e||e===void 0),n&&(i=this.spawnSelf().merge(this.descendants()).merge(this.parents()));var o=i;return e?o.emitAndNotify("style"):o.emit("style"),i.forEach(function(s){return s._private.styleDirty=!0}),this},cleanStyle:function(){var e=this.cy();if(e.styleEnabled())for(var r=0;r<this.length;r++){var a=this[r];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()&&a){a._private.styleDirty&&(a._private.styleDirty=!1,n.style().apply(a));var i=a._private.style[e];return i??(r?n.style().getDefaultProperty(e):null)}},numericStyle:function(e){var r=this[0];if(r.cy().styleEnabled()&&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()&&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(Ye(e)){var o=e;i.applyBypass(this,o,n),this.emitAndNotify("style")}else if(Me(e))if(r===void 0){var s=this[0];return s?i.getStylePropertyValue(s,e):void 0}else i.applyBypass(this,e,r,n),this.emitAndNotify("style");else if(e===void 0){var u=this[0];return u?i.getRawStyle(u):void 0}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 o=0;o<i.length;o++){var s=i[o];n.removeAllBypasses(s,a)}else{e=e.split(/\s+/);for(var u=0;u<i.length;u++){var l=i[u];n.removeBypasses(l,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 o=n.data.parent?a.parents():null;if(o)for(var s=0;s<o.length;s++){var u=o[s],l=u.pstyle("opacity").value;i=l*i}return i}},transparent:function(){var e=this.cy();if(!e.styleEnabled())return!1;var r=this[0],a=r.cy().hasCompoundNodes();if(r)return a?r.effectiveOpacity()===0:r.pstyle("opacity").value===0},backgrounding:function(){var e=this.cy();if(!e.styleEnabled())return!1;var r=this[0];return!!r._private.backgrounding}};function Ns(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 Uv(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],o=n.hasCompoundNodes();if(i){var s=i._private;if(!e(i))return!1;if(i.isNode())return!o||Ns(i,a);var u=s.source,l=s.target;return r(u)&&(!o||Ns(u,r))&&(u===l||r(l)&&(!o||Ns(l,r)))}}}var Sa=ki("eleTakesUpSpace",function(t){return t.pstyle("display").value==="element"&&t.width()!==0&&(t.isNode()?t.height()!==0:!0)});Ct.takesUpSpace=qi("takesUpSpace",Uv({ok:Sa}));var ER=ki("eleInteractive",function(t){return t.pstyle("events").value==="yes"&&t.pstyle("visibility").value==="visible"&&Sa(t)}),wR=ki("parentInteractive",function(t){return t.pstyle("visibility").value==="visible"&&Sa(t)});Ct.interactive=qi("interactive",Uv({ok:ER,parentOk:wR,edgeOkViaNode:Sa}));Ct.noninteractive=function(){var t=this[0];if(t)return!t.interactive()};var TR=ki("eleVisible",function(t){return t.pstyle("visibility").value==="visible"&&t.pstyle("opacity").pfValue!==0&&Sa(t)}),xR=Sa;Ct.visible=qi("visible",Uv({ok:TR,edgeOkViaNode:xR}));Ct.hidden=function(){var t=this[0];if(t)return!t.visible()};Ct.isBundledBezier=qi("isBundledBezier",function(){return this.cy().styleEnabled()?!this.removed()&&this.pstyle("curve-style").value==="bezier"&&this.takesUpSpace():!1});Ct.bypass=Ct.css=Ct.style;Ct.renderedCss=Ct.renderedStyle;Ct.removeBypass=Ct.removeCss=Ct.removeStyle;Ct.pstyle=Ct.parsedStyle;var Rr={};function ip(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&&ot(e[0])){var i=e[0];this.on(t.event,i)}else if(e.length===0||e.length===1&&je(e[0])){for(var o=e.length===1?e[0]:null,s=0;s<this.length;s++){var u=this[s],l=!t.ableField||u._private[t.ableField],f=u._private[t.field]!=t.value;if(t.overrideAble){var h=t.overrideAble(u);if(h!==void 0&&(l=h,!h))return this}l&&(u._private[t.field]=t.value,f&&r.push(u))}var v=this.spawn(r);v.updateStyle(),v.emit(t.event),o&&v.emit(o)}return this}}function Da(t){Rr[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]}},Rr[t.on]=ip({event:t.on,field:t.field,ableField:t.ableField,overrideAble:t.overrideAble,value:!0}),Rr[t.off]=ip({event:t.off,field:t.field,ableField:t.ableField,overrideAble:t.overrideAble,value:!1})}Da({field:"locked",overrideField:function(e){return e.cy().autolock()?!0:void 0},on:"lock",off:"unlock"});Da({field:"grabbable",overrideField:function(e){return e.cy().autoungrabify()||e.pannable()?!1:void 0},on:"grabify",off:"ungrabify"});Da({field:"selected",ableField:"selectable",overrideAble:function(e){return e.cy().autounselectify()?!1:void 0},on:"select",off:"unselect"});Da({field:"selectable",overrideField:function(e){return e.cy().autounselectify()?!1:void 0},on:"selectify",off:"unselectify"});Rr.deselect=Rr.unselect;Rr.grabbed=function(){var t=this[0];if(t)return t._private.grabbed};Da({field:"active",on:"activate",off:"unactivate"});Da({field:"pannable",on:"panify",off:"unpanify"});Rr.inactive=function(){var t=this[0];if(t)return!t._private.active};var Dt={},op=function(e){return function(a){for(var n=this,i=[],o=0;o<n.length;o++){var s=n[o];if(s.isNode()){for(var u=!1,l=s.connectedEdges(),f=0;f<l.length;f++){var h=l[f],v=h.source(),c=h.target();if(e.noIncomingEdges&&c===s&&v!==s||e.noOutgoingEdges&&v===s&&c!==s){u=!0;break}}u||i.push(s)}}return this.spawn(i,!0).filter(a)}},sp=function(e){return function(r){for(var a=this,n=[],i=0;i<a.length;i++){var o=a[i];if(o.isNode())for(var s=o.connectedEdges(),u=0;u<s.length;u++){var l=s[u],f=l.source(),h=l.target();e.outgoing&&f===o?(n.push(l),n.push(h)):e.incoming&&h===o&&(n.push(l),n.push(f))}}return this.spawn(n,!0).filter(r)}},up=function(e){return function(r){for(var a=this,n=[],i={};;){var o=e.outgoing?a.outgoers():a.incomers();if(o.length===0)break;for(var s=!1,u=0;u<o.length;u++){var l=o[u],f=l.id();i[f]||(i[f]=!0,n.push(l),s=!0)}if(!s)break;a=o}return this.spawn(n,!0).filter(r)}};Dt.clearTraversalCache=function(){for(var t=0;t<this.length;t++)this[t]._private.traversalCache=null};Be(Dt,{roots:op({noIncomingEdges:!0}),leaves:op({noOutgoingEdges:!0}),outgoers:Yt(sp({outgoing:!0}),"outgoers"),successors:up({outgoing:!0}),incomers:Yt(sp({incoming:!0}),"incomers"),predecessors:up({})});Be(Dt,{neighborhood:Yt(function(t){for(var e=[],r=this.nodes(),a=0;a<r.length;a++)for(var n=r[a],i=n.connectedEdges(),o=0;o<i.length;o++){var s=i[o],u=s.source(),l=s.target(),f=n===u?l:u;f.length>0&&e.push(f[0]),e.push(s[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)}});Dt.neighbourhood=Dt.neighborhood;Dt.closedNeighbourhood=Dt.closedNeighborhood;Dt.openNeighbourhood=Dt.openNeighborhood;Be(Dt,{source:Yt(function(e){var r=this[0],a;return r&&(a=r._private.source||r.cy().collection()),a&&e?a.filter(e):a},"source"),target:Yt(function(e){var r=this[0],a;return r&&(a=r._private.target||r.cy().collection()),a&&e?a.filter(e):a},"target"),sources:lp({attr:"source"}),targets:lp({attr:"target"})});function lp(t){return function(r){for(var a=[],n=0;n<this.length;n++){var i=this[n],o=i._private[t.attr];o&&a.push(o)}return this.spawn(a,!0).filter(r)}}Be(Dt,{edgesWith:Yt(fp(),"edgesWith"),edgesTo:Yt(fp({thisIsSrc:!0}),"edgesTo")});function fp(t){return function(r){var a=[],n=this._private.cy,i=t||{};Me(r)&&(r=n.$(r));for(var o=0;o<r.length;o++)for(var s=r[o]._private.edges,u=0;u<s.length;u++){var l=s[u],f=l._private.data,h=this.hasElementWithId(f.source)&&r.hasElementWithId(f.target),v=r.hasElementWithId(f.source)&&this.hasElementWithId(f.target),c=h||v;c&&((i.thisIsSrc||i.thisIsTgt)&&(i.thisIsSrc&&!h||i.thisIsTgt&&!v)||a.push(l))}return this.spawn(a,!0)}}Be(Dt,{connectedEdges:Yt(function(t){for(var e=[],r=this,a=0;a<r.length;a++){var n=r[a];if(n.isNode())for(var i=n._private.edges,o=0;o<i.length;o++){var s=i[o];e.push(s)}}return this.spawn(e,!0).filter(t)},"connectedEdges"),connectedNodes:Yt(function(t){for(var e=[],r=this,a=0;a<r.length;a++){var n=r[a];n.isEdge()&&(e.push(n.source()[0]),e.push(n.target()[0]))}return this.spawn(e,!0).filter(t)},"connectedNodes"),parallelEdges:Yt(hp(),"parallelEdges"),codirectedEdges:Yt(hp({codirected:!0}),"codirectedEdges")});function hp(t){var e={codirected:!1};return t=Be({},e,t),function(a){for(var n=[],i=this.edges(),o=t,s=0;s<i.length;s++)for(var u=i[s],l=u._private,f=l.source,h=f._private.data.id,v=l.data.target,c=f._private.edges,d=0;d<c.length;d++){var g=c[d],p=g._private.data,y=p.target,b=p.source,m=y===v&&b===h,E=h===y&&v===b;(o.codirected&&m||!o.codirected&&(m||E))&&n.push(g)}return this.spawn(n,!0).filter(a)}}Be(Dt,{components:function(e){var r=this,a=r.cy(),n=a.collection(),i=e==null?r.nodes():e.nodes(),o=[];e!=null&&i.empty()&&(i=e.sources());var s=function(f,h){n.merge(f),i.unmerge(f),h.merge(f)};if(i.empty())return r.spawn();var u=function(){var f=a.collection();o.push(f);var h=i[0];s(h,f),r.bfs({directed:!1,roots:h,visit:function(c){return s(c,f)}}),f.forEach(function(v){v.connectedEdges().forEach(function(c){r.has(c)&&f.has(c.source())&&f.has(c.target())&&f.merge(c)})})};do u();while(i.length>0);return o},component:function(){var e=this[0];return e.cy().mutableElements().components(e)[0]}});Dt.componentsOf=Dt.components;var At=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){at("A collection must have a reference to the core");return}var i=new hr,o=!1;if(!r)r=[];else if(r.length>0&&Ye(r[0])&&!gn(r[0])){o=!0;for(var s=[],u=new La,l=0,f=r.length;l<f;l++){var h=r[l];h.data==null&&(h.data={});var v=h.data;if(v.id==null)v.id=IE();else if(e.hasElementWithId(v.id)||u.has(v.id))continue;var c=new Di(e,h,!1);s.push(c),u.add(v.id)}r=s}this.length=0;for(var d=0,g=r.length;d<g;d++){var p=r[d][0];if(p!=null){var y=p._private.data.id;(!a||!i.has(y))&&(a&&i.set(y,{index:this.length,ele:p}),this[this.length]=p,this.length++)}}this._private={eles:this,cy:e,get map(){return this.lazyMap==null&&this.rebuildMap(),this.lazyMap},set map(b){this.lazyMap=b},rebuildMap:function(){for(var m=this.lazyMap=new hr,E=this.eles,T=0;T<E.length;T++){var L=E[T];m.set(L.id(),{index:T,ele:L})}}},a&&(this._private.map=i),o&&!n&&this.restore()},tt=Di.prototype=At.prototype=Object.create(Array.prototype);tt.instanceString=function(){return"collection"};tt.spawn=function(t,e){return new At(this.cy(),t,e)};tt.spawnSelf=function(){return this.spawn(this)};tt.cy=function(){return this._private.cy};tt.renderer=function(){return this._private.cy.renderer()};tt.element=function(){return this[0]};tt.collection=function(){return bE(this)?this:new At(this._private.cy,[this])};tt.unique=function(){return new At(this._private.cy,this,!0)};tt.hasElementWithId=function(t){return t=""+t,this._private.map.has(t)};tt.getElementById=function(t){t=""+t;var e=this._private.cy,r=this._private.map.get(t);return r?r.ele:new At(e)};tt.$id=tt.getElementById;tt.poolIndex=function(){var t=this._private.cy,e=t._private.elements,r=this[0]._private.data.id;return e._private.map.get(r).index};tt.indexOf=function(t){var e=t[0]._private.data.id;return this._private.map.get(e).index};tt.indexOfId=function(t){return t=""+t,this._private.map.get(t).index};tt.json=function(t){var e=this.element(),r=this.cy();if(e==null&&t)return this;if(e!=null){var a=e._private;if(Ye(t)){if(r.startBatch(),t.data){e.data(t.data);var n=a.data;if(e.isEdge()){var i=!1,o={},s=t.data.source,u=t.data.target;s!=null&&s!=n.source&&(o.source=""+s,i=!0),u!=null&&u!=n.target&&(o.target=""+u,i=!0),i&&(e=e.move(o))}else{var l="parent"in t.data,f=t.data.parent;l&&(f!=null||n.parent!=null)&&f!=n.parent&&(f===void 0&&(f=null),f!=null&&(f=""+f),e=e.move({parent:f}))}}t.position&&e.position(t.position);var h=function(g,p,y){var b=t[g];b!=null&&b!==a[g]&&(b?e[p]():e[y]())};return h("removed","remove","restore"),h("selected","select","unselect"),h("selectable","selectify","unselectify"),h("locked","lock","unlock"),h("grabbable","grabify","ungrabify"),h("pannable","panify","unpanify"),t.classes!=null&&e.classes(t.classes),r.endBatch(),this}else if(t===void 0){var v={data:ar(a.data),position:ar(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};v.classes="";var c=0;return a.classes.forEach(function(d){return v.classes+=c++===0?d:" "+d}),v}}};tt.jsons=function(){for(var t=[],e=0;e<this.length;e++){var r=this[e],a=r.json();t.push(a)}return t};tt.clone=function(){for(var t=this.cy(),e=[],r=0;r<this.length;r++){var a=this[r],n=a.json(),i=new Di(t,n,!1);e.push(i)}return new At(t,e)};tt.copy=tt.clone;tt.restore=function(){for(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=[],o=[],s,u=0,l=r.length;u<l;u++){var f=r[u];e&&!f.removed()||(f.isNode()?i.push(f):o.push(f))}s=i.concat(o);var h,v=function(){s.splice(h,1),h--};for(h=0;h<s.length;h++){var c=s[h],d=c._private,g=d.data;if(c.clearTraversalCache(),!(!e&&!d.removed)){if(g.id===void 0)g.id=IE();else if(Te(g.id))g.id=""+g.id;else if(Sr(g.id)||!Me(g.id)){at("Can not create element with invalid string ID `"+g.id+"`"),v();continue}else if(a.hasElementWithId(g.id)){at("Can not create second element with ID `"+g.id+"`"),v();continue}}var p=g.id;if(c.isNode()){var y=d.position;y.x==null&&(y.x=0),y.y==null&&(y.y=0)}if(c.isEdge()){for(var b=c,m=["source","target"],E=m.length,T=!1,L=0;L<E;L++){var w=m[L],C=g[w];Te(C)&&(C=g[w]=""+g[w]),C==null||C===""?(at("Can not create edge `"+p+"` with unspecified "+w),T=!0):a.hasElementWithId(C)||(at("Can not create edge `"+p+"` with nonexistent "+w+" `"+C+"`"),T=!0)}if(T){v();continue}var A=a.getElementById(g.source),R=a.getElementById(g.target);A.same(R)?A._private.edges.push(b):(A._private.edges.push(b),R._private.edges.push(b)),b._private.source=A,b._private.target=R}d.map=new hr,d.map.set(p,{ele:c,index:0}),d.removed=!1,e&&a.addToPool(c)}for(var S=0;S<i.length;S++){var D=i[S],P=D._private.data;Te(P.parent)&&(P.parent=""+P.parent);var x=P.parent,N=x!=null;if(N||D._private.parent){var M=D._private.parent?a.collection().merge(D._private.parent):a.getElementById(x);if(M.empty())P.parent=void 0;else if(M[0].removed())Ze("Node added with missing parent, reference to parent removed"),P.parent=void 0,D._private.parent=null;else{for(var I=!1,O=M;!O.empty();){if(D.same(O)){I=!0,P.parent=void 0;break}O=O.parent()}I||(M[0]._private.children.push(D),D._private.parent=M[0],n.hasCompoundNodes=!0)}}}if(s.length>0){for(var q=s.length===r.length?r:new At(a,s),_=0;_<q.length;_++){var B=q[_];B.isNode()||(B.parallelEdges().clearTraversalCache(),B.source().clearTraversalCache(),B.target().clearTraversalCache())}var z;n.hasCompoundNodes?z=a.collection().merge(q).merge(q.connectedNodes()).merge(q.parent()):z=q,z.dirtyCompoundBoundsCache().dirtyBoundingBoxCache().updateStyle(t),t?q.emitAndNotify("add"):e&&q.emit("add")}return r};tt.removed=function(){var t=this[0];return t&&t._private.removed};tt.inside=function(){var t=this[0];return t&&!t._private.removed};tt.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 o(x){for(var N=x._private.edges,M=0;M<N.length;M++)u(N[M])}function s(x){for(var N=x._private.children,M=0;M<N.length;M++)u(N[M])}function u(x){var N=n[x.id()];e&&x.removed()||N||(n[x.id()]=!0,x.isNode()?(a.push(x),o(x),s(x)):a.unshift(x))}for(var l=0,f=r.length;l<f;l++){var h=r[l];u(h)}function v(x,N){var M=x._private.edges;Dr(M,N),x.clearTraversalCache()}function c(x){x.clearTraversalCache()}var d=[];d.ids={};function g(x,N){N=N[0],x=x[0];var M=x._private.children,I=x.id();Dr(M,N),N._private.parent=null,d.ids[I]||(d.ids[I]=!0,d.push(x))}r.dirtyCompoundBoundsCache(),e&&i.removeFromPool(a);for(var p=0;p<a.length;p++){var y=a[p];if(y.isEdge()){var b=y.source()[0],m=y.target()[0];v(b,y),v(m,y);for(var E=y.parallelEdges(),T=0;T<E.length;T++){var L=E[T];c(L),L.isBundledBezier()&&L.dirtyBoundingBoxCache()}}else{var w=y.parent();w.length!==0&&g(w,y)}e&&(y._private.removed=!0)}var C=i._private.elements;i._private.hasCompoundNodes=!1;for(var A=0;A<C.length;A++){var R=C[A];if(R.isParent()){i._private.hasCompoundNodes=!0;break}}var S=new At(this.cy(),a);S.size()>0&&(t?S.emitAndNotify("remove"):e&&S.emit("remove"));for(var D=0;D<d.length;D++){var P=d[D];(!e||!P.removed())&&P.updateStyle()}return S};tt.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 o=i(t.source),s=i(t.target),u=o!=null&&e.hasElementWithId(o),l=s!=null&&e.hasElementWithId(s);(u||l)&&(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;d.isEdge()&&(u&&(g.source=o),l&&(g.target=s))}r.restore(a,n)}),r.emitAndNotify("move"))}else if(t.parent!==void 0){var f=i(t.parent),h=f===null||e.hasElementWithId(f);if(h){var v=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],p=g._private.data;g.isNode()&&(p.parent=v)}c.restore(a,n)}),r.emitAndNotify("move")}}return this};[HE,PL,Qn,Lr,Ca,ZL,_i,cR,pw,yw,yR,bi,Jn,Ct,Rr,Dt].forEach(function(t){Be(tt,t)});var CR={add:function(e){var r,a=this;if(Ut(e)){var n=e;if(n._private.cy===a)r=n.restore();else{for(var i=[],o=0;o<n.length;o++){var s=n[o];i.push(s.json())}r=new At(a,i)}}else if(je(e)){var u=e;r=new At(a,u)}else if(Ye(e)&&(je(e.nodes)||je(e.edges))){for(var l=e,f=[],h=["nodes","edges"],v=0,c=h.length;v<c;v++){var d=h[v],g=l[d];if(je(g))for(var p=0,y=g.length;p<y;p++){var b=Be({group:d},g[p]);f.push(b)}}r=new At(a,f)}else{var m=e;r=new Di(a,m).collection()}return r},remove:function(e){if(!Ut(e)){if(Me(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 AR(t,e,r,a){var n=4,i=.001,o=1e-7,s=10,u=11,l=1/(u-1),f=typeof Float32Array<"u";if(arguments.length!==4)return!1;for(var h=0;h<4;++h)if(typeof arguments[h]!="number"||isNaN(arguments[h])||!isFinite(arguments[h]))return!1;t=Math.min(t,1),r=Math.min(r,1),t=Math.max(t,0),r=Math.max(r,0);var v=f?new Float32Array(u):new Array(u);function c(R,S){return 1-3*S+3*R}function d(R,S){return 3*S-6*R}function g(R){return 3*R}function p(R,S,D){return((c(S,D)*R+d(S,D))*R+g(S))*R}function y(R,S,D){return 3*c(S,D)*R*R+2*d(S,D)*R+g(S)}function b(R,S){for(var D=0;D<n;++D){var P=y(S,t,r);if(P===0)return S;var x=p(S,t,r)-R;S-=x/P}return S}function m(){for(var R=0;R<u;++R)v[R]=p(R*l,t,r)}function E(R,S,D){var P,x,N=0;do x=S+(D-S)/2,P=p(x,t,r)-R,P>0?D=x:S=x;while(Math.abs(P)>o&&++N<s);return x}function T(R){for(var S=0,D=1,P=u-1;D!==P&&v[D]<=R;++D)S+=l;--D;var x=(R-v[D])/(v[D+1]-v[D]),N=S+x*l,M=y(N,t,r);return M>=i?b(R,N):M===0?N:E(R,S,S+l)}var L=!1;function w(){L=!0,(t!==e||r!==a)&&m()}var C=function(S){return L||w(),t===e&&r===a?S:S===0?0:S===1?1:p(T(S),e,a)};C.getControlPoints=function(){return[{x:t,y:e},{x:r,y:a}]};var A="generateBezier("+[t,e,r,a]+")";return C.toString=function(){return A},C}/*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License */var LR=(function(){function t(a){return-a.tension*a.x-a.friction*a.v}function e(a,n,i){var o={x:a.x+i.dx*n,v:a.v+i.dv*n,tension:a.tension,friction:a.friction};return{dx:o.v,dv:t(o)}}function r(a,n){var i={dx:a.v,dv:t(a)},o=e(a,n*.5,i),s=e(a,n*.5,o),u=e(a,n,s),l=1/6*(i.dx+2*(o.dx+s.dx)+u.dx),f=1/6*(i.dv+2*(o.dv+s.dv)+u.dv);return a.x=a.x+l*n,a.v=a.v+f*n,a}return function a(n,i,o){var s={x:-1,v:0,tension:null,friction:null},u=[0],l=0,f=1/1e4,h=16/1e3,v,c,d;for(n=parseFloat(n)||500,i=parseFloat(i)||20,o=o||null,s.tension=n,s.friction=i,v=o!==null,v?(l=a(n,i),c=l/o*h):c=h;d=r(d||s,c),u.push(1+d.x),l+=16,Math.abs(d.x)>f&&Math.abs(d.v)>f;);return v?function(g){return u[g*(u.length-1)|0]}:l}})(),et=function(e,r,a,n){var i=AR(e,r,a,n);return function(o,s,u){return o+(s-o)*i(u)}},jn={linear:function(e,r,a){return e+(r-e)*a},ease:et(.25,.1,.25,1),"ease-in":et(.42,0,1,1),"ease-out":et(0,0,.58,1),"ease-in-out":et(.42,0,.58,1),"ease-in-sine":et(.47,0,.745,.715),"ease-out-sine":et(.39,.575,.565,1),"ease-in-out-sine":et(.445,.05,.55,.95),"ease-in-quad":et(.55,.085,.68,.53),"ease-out-quad":et(.25,.46,.45,.94),"ease-in-out-quad":et(.455,.03,.515,.955),"ease-in-cubic":et(.55,.055,.675,.19),"ease-out-cubic":et(.215,.61,.355,1),"ease-in-out-cubic":et(.645,.045,.355,1),"ease-in-quart":et(.895,.03,.685,.22),"ease-out-quart":et(.165,.84,.44,1),"ease-in-out-quart":et(.77,0,.175,1),"ease-in-quint":et(.755,.05,.855,.06),"ease-out-quint":et(.23,1,.32,1),"ease-in-out-quint":et(.86,0,.07,1),"ease-in-expo":et(.95,.05,.795,.035),"ease-out-expo":et(.19,1,.22,1),"ease-in-out-expo":et(1,0,0,1),"ease-in-circ":et(.6,.04,.98,.335),"ease-out-circ":et(.075,.82,.165,1),"ease-in-out-circ":et(.785,.135,.15,.86),spring:function(e,r,a){if(a===0)return jn.linear;var n=LR(e,r,a);return function(i,o,s){return i+(o-i)*n(s)}},"cubic-bezier":et};function cp(t,e,r,a,n){if(a===1||e===r)return r;var i=n(e,r,a);return t==null||((t.roundValue||t.color)&&(i=Math.round(i)),t.min!==void 0&&(i=Math.max(i,t.min)),t.max!==void 0&&(i=Math.min(i,t.max))),i}function vp(t,e){return t.pfValue!=null||t.value!=null?t.pfValue!=null&&(e==null||e.type.units!=="%")?t.pfValue:t.value:t}function ua(t,e,r,a,n){var i=n!=null?n.type:null;r<0?r=0:r>1&&(r=1);var o=vp(t,n),s=vp(e,n);if(Te(o)&&Te(s))return cp(i,o,s,r,a);if(je(o)&&je(s)){for(var u=[],l=0;l<s.length;l++){var f=o[l],h=s[l];if(f!=null&&h!=null){var v=cp(i,f,h,r,a);u.push(v)}else u.push(h)}return u}}function RR(t,e,r,a){var n=!a,i=t._private,o=e._private,s=o.easing,u=o.startTime,l=a?t:t.cy(),f=l.style();if(!o.easingImpl)if(s==null)o.easingImpl=jn.linear;else{var h;if(Me(s)){var v=f.parse("transition-timing-function",s);h=v.value}else h=s;var c,d;Me(h)?(c=h,d=[]):(c=h[1],d=h.slice(2).map(function(q){return+q})),d.length>0?(c==="spring"&&d.push(o.duration),o.easingImpl=jn[c].apply(null,d)):o.easingImpl=jn[c]}var g=o.easingImpl,p;if(o.duration===0?p=1:p=(r-u)/o.duration,o.applying&&(p=o.progress),p<0?p=0:p>1&&(p=1),o.delay==null){var y=o.startPosition,b=o.position;if(b&&n&&!t.locked()){var m={};Ya(y.x,b.x)&&(m.x=ua(y.x,b.x,p,g)),Ya(y.y,b.y)&&(m.y=ua(y.y,b.y,p,g)),t.position(m)}var E=o.startPan,T=o.pan,L=i.pan,w=T!=null&&a;w&&(Ya(E.x,T.x)&&(L.x=ua(E.x,T.x,p,g)),Ya(E.y,T.y)&&(L.y=ua(E.y,T.y,p,g)),t.emit("pan"));var C=o.startZoom,A=o.zoom,R=A!=null&&a;R&&(Ya(C,A)&&(i.zoom=sn(i.minZoom,ua(C,A,p,g),i.maxZoom)),t.emit("zoom")),(w||R)&&t.emit("viewport");var S=o.style;if(S&&S.length>0&&n){for(var D=0;D<S.length;D++){var P=S[D],x=P.name,N=P,M=o.startStyle[x],I=f.properties[M.name],O=ua(M,N,p,g,I);f.overrideBypass(t,x,O)}t.emit("style")}}return o.progress=p,p}function Ya(t,e){return t==null||e==null?!1:Te(t)&&Te(e)?!0:!!(t&&e)}function SR(t,e,r,a){var n=e._private;n.started=!0,n.startTime=r-n.progress*n.duration}function dp(t,e){var r=e._private.aniEles,a=[];function n(f,h){var v=f._private,c=v.animation.current,d=v.animation.queue,g=!1;if(c.length===0){var p=d.shift();p&&c.push(p)}for(var y=function(L){for(var w=L.length-1;w>=0;w--){var C=L[w];C()}L.splice(0,L.length)},b=c.length-1;b>=0;b--){var m=c[b],E=m._private;if(E.stopped){c.splice(b,1),E.hooked=!1,E.playing=!1,E.started=!1,y(E.frames);continue}!E.playing&&!E.applying||(E.playing&&E.applying&&(E.applying=!1),E.started||SR(f,m,t),RR(f,m,t,h),E.applying&&(E.applying=!1),y(E.frames),E.step!=null&&E.step(t),m.completed()&&(c.splice(b,1),E.hooked=!1,E.playing=!1,E.started=!1,y(E.completes)),g=!0)}return!h&&c.length===0&&d.length===0&&a.push(f),g}for(var i=!1,o=0;o<r.length;o++){var s=r[o],u=n(s);i=i||u}var l=n(e,!0);(i||l)&&(r.length>0?e.notify("draw",r):e.notify("draw")),r.unmerge(a),e.emit("step")}var DR={animate:Ke.animate(),animation:Ke.animation(),animated:Ke.animated(),clearQueue:Ke.clearQueue(),delay:Ke.delay(),delayAnimation:Ke.delayAnimation(),stop:Ke.stop(),addToAnimationPool:function(e){var r=this;r.styleEnabled()&&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(){e._private.animationsRunning&&di(function(i){dp(i,e),r()})}var a=e.renderer();a&&a.beforeRender?a.beforeRender(function(i,o){dp(o,e)},a.beforeRenderPriorities.animations):r()}},NR={qualifierCompare:function(e,r){return e==null||r==null?e==null&&r==null:e.sameText(r)},eventMatches:function(e,r,a){var n=r.qualifier;return n!=null?e!==a.target&&gn(a.target)&&n.matches(a.target):!0},addEventFields:function(e,r){r.cy=e,r.target=e},callbackContext:function(e,r,a){return r.qualifier!=null?a.target:e}},Yn=function(e){return Me(e)?new Mr(e):e},Ew={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new Bi(NR,this)),this},emitter:function(){return this._private.emitter},on:function(e,r,a){return this.emitter().on(e,Yn(r),a),this},removeListener:function(e,r,a){return this.emitter().removeListener(e,Yn(r),a),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,r,a){return this.emitter().one(e,Yn(r),a),this},once:function(e,r,a){return this.emitter().one(e,Yn(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}};Ke.eventAliasesOn(Ew);var vv={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)}};vv.jpeg=vv.jpg;var ei={layout:function(e){var r=this;if(e==null){at("Layout options must be specified to make a layout");return}if(e.name==null){at("A `name` must be specified to make a layout");return}var a=e.name,n=r.extension("layout",a);if(n==null){at("No such layout `"+a+"` found. Did you forget to import it and `cytoscape.use()` it?");return}var i;Me(e.eles)?i=r.$(e.eles):i=e.eles!=null?e.eles:r.$();var o=new n(Be({},e,{cy:r,eles:i}));return o}};ei.createLayout=ei.makeLayout=ei.layout;var MR={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();r!=null&&n.merge(r);return}if(a.notificationsEnabled){var i=this.renderer();this.destroyed()||!i||i.notify(e,r)}},notifications:function(e){var r=this._private;return e===void 0?r.notificationsEnabled:(r.notificationsEnabled=!!e,this)},noNotifications:function(e){this.notifications(!1),e(),this.notifications(!0)},batching:function(){return this._private.batchCount>0},startBatch:function(){var e=this._private;return e.batchCount==null&&(e.batchCount=0),e.batchCount===0&&(e.batchStyleEles=this.collection(),e.batchNotifications={}),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];n.empty()?r.notify(a):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(){for(var a=Object.keys(e),n=0;n<a.length;n++){var i=a[n],o=e[i],s=r.getElementById(i);s.data(o)}})}},OR=Lt({hideEdgesOnViewport:!1,textureOnViewport:!1,motionBlur:!1,motionBlurOpacity:.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]}),dv={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){at("Can not initialise: No such renderer `".concat(e.name,"` found. Did you forget to import it and `cytoscape.use()` it?"));return}e.wheelSensitivity!==void 0&&Ze("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=OR(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)for(r._cyreg=null;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)}};dv.invalidateDimensions=dv.resize;var ti={collection:function(e,r){return Me(e)?this.$(e):Ut(e)?e.collection():je(e)?(r||(r={}),new At(this,e,r.unique,r.removed)):new At(this)},nodes:function(e){var r=this.$(function(a){return a.isNode()});return e?r.filter(e):r},edges:function(e){var r=this.$(function(a){return a.isEdge()});return e?r.filter(e):r},$:function(e){var r=this._private.elements;return e?r.filter(e):r.spawnSelf()},mutableElements:function(){return this._private.elements}};ti.elements=ti.filter=ti.$;var xt={},en="t",IR="f";xt.apply=function(t){for(var e=this,r=e._private,a=r.cy,n=a.collection(),i=0;i<t.length;i++){var o=t[i],s=e.getContextMeta(o);if(!s.empty){var u=e.getContextStyle(s),l=e.applyContextStyle(s,u,o);o._private.appliedInitStyle?e.updateTransitions(o,l.diffProps):o._private.appliedInitStyle=!0;var f=e.updateStyleHints(o);f&&n.push(o)}}return n};xt.getPropertiesDiff=function(t,e){var r=this,a=r._private.propDiffs=r._private.propDiffs||{},n=t+"-"+e,i=a[n];if(i)return i;for(var o=[],s={},u=0;u<r.length;u++){var l=r[u],f=t[u]===en,h=e[u]===en,v=f!==h,c=l.mappedProperties.length>0;if(v||h&&c){var d=void 0;v&&c||v?d=l.properties:c&&(d=l.mappedProperties);for(var g=0;g<d.length;g++){for(var p=d[g],y=p.name,b=!1,m=u+1;m<r.length;m++){var E=r[m],T=e[m]===en;if(T&&(b=E.properties[p.name]!=null,b))break}!s[y]&&!b&&(s[y]=!0,o.push(y))}}}return a[n]=o,o};xt.getContextMeta=function(t){for(var e=this,r="",a,n=t._private.styleCxtKey||"",i=0;i<e.length;i++){var o=e[i],s=o.selector&&o.selector.matches(t);s?r+=en:r+=IR}return a=e.getPropertiesDiff(n,r),t._private.styleCxtKey=r,{key:r,diffPropNames:a,empty:a.length===0}};xt.getContextStyle=function(t){var e=t.key,r=this,a=this._private.contextStyles=this._private.contextStyles||{};if(a[e])return a[e];for(var n={_private:{key:e}},i=0;i<r.length;i++){var o=r[i],s=e[i]===en;if(s)for(var u=0;u<o.properties.length;u++){var l=o.properties[u];n[l.name]=l}}return a[e]=n,n};xt.applyContextStyle=function(t,e,r){for(var a=this,n=t.diffPropNames,i={},o=a.types,s=0;s<n.length;s++){var u=n[s],l=e[u],f=r.pstyle(u);if(!l)if(f)f.bypass?l={name:u,deleteBypassed:!0}:l={name:u,delete:!0};else continue;if(f!==l){if(l.mapped===o.fn&&f!=null&&f.mapping!=null&&f.mapping.value===l.value){var h=f.mapping,v=h.fnValue=l.value(r);if(v===h.prevFnValue)continue}var c=i[u]={prev:f};a.applyParsedProperty(r,l),c.next=r.pstyle(u),c.next&&c.next.bypass&&(c.next=c.next.bypassed)}}return{diffProps:i}};xt.updateStyleHints=function(t){var e=t._private,r=this,a=r.propertyGroupNames,n=r.propertyGroupKeys,i=function(Z,ee,re){return r.getPropertiesHash(Z,ee,re)},o=e.styleKey;if(t.removed())return!1;var s=e.group==="nodes",u=t._private.style;a=Object.keys(u);for(var l=0;l<n.length;l++){var f=n[l];e.styleKeys[f]=[Xr,da]}for(var h=function(Z,ee){return e.styleKeys[ee][0]=an(Z,e.styleKeys[ee][0])},v=function(Z,ee){return e.styleKeys[ee][1]=nn(Z,e.styleKeys[ee][1])},c=function(Z,ee){h(Z,ee),v(Z,ee)},d=function(Z,ee){for(var re=0;re<Z.length;re++){var ue=Z.charCodeAt(re);h(ue,ee),v(ue,ee)}},g=2e9,p=function(Z){return-128<Z&&Z<128&&Math.floor(Z)!==Z?g-(Z*1024|0):Z},y=0;y<a.length;y++){var b=a[y],m=u[b];if(m!=null){var E=this.properties[b],T=E.type,L=E.groupKey,w=void 0;E.hashOverride!=null?w=E.hashOverride(t,m):m.pfValue!=null&&(w=m.pfValue);var C=E.enums==null?m.value:null,A=w!=null,R=C!=null,S=A||R,D=m.units;if(T.number&&S&&!T.multiple){var P=A?w:C;c(p(P),L),!A&&D!=null&&d(D,L)}else d(m.strValue,L)}}for(var x=[Xr,da],N=0;N<n.length;N++){var M=n[N],I=e.styleKeys[M];x[0]=an(I[0],x[0]),x[1]=nn(I[1],x[1])}e.styleKey=Kx(x[0],x[1]);var O=e.styleKeys;e.labelDimsKey=Er(O.labelDimensions);var q=i(t,["label"],O.labelDimensions);if(e.labelKey=Er(q),e.labelStyleKey=Er(_n(O.commonLabel,q)),!s){var _=i(t,["source-label"],O.labelDimensions);e.sourceLabelKey=Er(_),e.sourceLabelStyleKey=Er(_n(O.commonLabel,_));var B=i(t,["target-label"],O.labelDimensions);e.targetLabelKey=Er(B),e.targetLabelStyleKey=Er(_n(O.commonLabel,B))}if(s){var z=e.styleKeys,Y=z.nodeBody,k=z.nodeBorder,G=z.nodeOutline,U=z.backgroundImage,W=z.compound,j=z.pie,H=z.stripe,V=[Y,k,G,U,W,j,H].filter(function(X){return X!=null}).reduce(_n,[Xr,da]);e.nodeKey=Er(V),e.hasPie=j!=null&&j[0]!==Xr&&j[1]!==da,e.hasStripe=H!=null&&H[0]!==Xr&&H[1]!==da}return o!==e.styleKey};xt.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};xt.applyParsedProperty=function(t,e){var r=this,a=e,n=t._private.style,i,o=r.types,s=r.properties[a.name].type,u=a.bypass,l=n[a.name],f=l&&l.bypass,h=t._private,v="mapping",c=function(Y){return Y==null?null:Y.pfValue!=null?Y.pfValue:Y.value},d=function(){var Y=c(l),k=c(a);r.checkTriggers(t,a.name,Y,k)};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",u)),a.delete)return n[a.name]=void 0,d(),!0;if(a.deleteBypassed)return l?l.bypass?(l.bypassed=void 0,d(),!0):!1:(d(),!0);if(a.deleteBypass)return l?l.bypass?(n[a.name]=l.bypassed,d(),!0):!1:(d(),!0);var g=function(){Ze("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 o.mapData:{for(var p=a.field.split("."),y=h.data,b=0;b<p.length&&y;b++){var m=p[b];y=y[m]}if(y==null)return g(),!1;var E;if(Te(y)){var T=a.fieldMax-a.fieldMin;T===0?E=0:E=(y-a.fieldMin)/T}else return Ze("Do not use continuous mappers without specifying numeric data (i.e. `"+a.field+": "+y+"` for `"+t.id()+"` is non-numeric)"),!1;if(E<0?E=0:E>1&&(E=1),s.color){var L=a.valueMin[0],w=a.valueMax[0],C=a.valueMin[1],A=a.valueMax[1],R=a.valueMin[2],S=a.valueMax[2],D=a.valueMin[3]==null?1:a.valueMin[3],P=a.valueMax[3]==null?1:a.valueMax[3],x=[Math.round(L+(w-L)*E),Math.round(C+(A-C)*E),Math.round(R+(S-R)*E),Math.round(D+(P-D)*E)];i={bypass:a.bypass,name:a.name,value:x,strValue:"rgb("+x[0]+", "+x[1]+", "+x[2]+")"}}else if(s.number){var N=a.valueMin+(a.valueMax-a.valueMin)*E;i=this.parse(a.name,N,a.bypass,v)}else return!1;if(!i)return g(),!1;i.mapping=a,a=i;break}case o.data:{for(var M=a.field.split("."),I=h.data,O=0;O<M.length&&I;O++){var q=M[O];I=I[q]}if(I!=null&&(i=this.parse(a.name,I,a.bypass,v)),!i)return g(),!1;i.mapping=a,a=i;break}case o.fn:{var _=a.value,B=a.fnValue!=null?a.fnValue:_(t);if(a.prevFnValue=B,B==null)return Ze("Custom function mappers may not return null (i.e. `"+a.name+"` for ele `"+t.id()+"` is null)"),!1;if(i=this.parse(a.name,B,a.bypass,v),!i)return Ze("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=ar(a),a=i;break}case void 0:break;default:return!1}return u?(f?a.bypassed=l.bypassed:a.bypassed=l,n[a.name]=a):f?l.bypassed=a:n[a.name]=a,d(),!0};xt.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 for(var n=a._private.style,i=Object.keys(n),o=0;o<i.length;o++){var s=i[o],u=n[s];u!=null&&(u.bypass?u.bypassed=null:n[s]=null)}}};xt.update=function(){var t=this._private.cy,e=t.mutableElements();e.updateStyle()};xt.updateTransitions=function(t,e){var r=this,a=t._private,n=t.pstyle("transition-property").value,i=t.pstyle("transition-duration").pfValue,o=t.pstyle("transition-delay").pfValue;if(n.length>0&&i>0){for(var s={},u=!1,l=0;l<n.length;l++){var f=n[l],h=t.pstyle(f),v=e[f];if(v){var c=v.prev,d=c,g=v.next!=null?v.next:h,p=!1,y=void 0,b=1e-6;d&&(Te(d.pfValue)&&Te(g.pfValue)?(p=g.pfValue-d.pfValue,y=d.pfValue+b*p):Te(d.value)&&Te(g.value)?(p=g.value-d.value,y=d.value+b*p):je(d.value)&&je(g.value)&&(p=d.value[0]!==g.value[0]||d.value[1]!==g.value[1]||d.value[2]!==g.value[2],y=d.strValue),p&&(s[f]=g.strValue,this.applyBypass(t,f,y),u=!0))}}if(!u)return;a.transitioning=!0,new Ra(function(m){o>0?t.delayAnimation(o).play().promise().then(m):m()}).then(function(){return t.animation({style:s,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 a.transitioning&&(this.removeBypasses(t,n),t.emitAndNotify("style"),a.transitioning=!1)};xt.checkTrigger=function(t,e,r,a,n,i){var o=this.properties[e],s=n(o);t.removed()||s!=null&&s(r,a,t)&&i(o)};xt.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)})};xt.checkBoundsTrigger=function(t,e,r,a){this.checkTrigger(t,e,r,a,function(n){return n.triggersBounds},function(n){t.dirtyCompoundBoundsCache(),t.dirtyBoundingBoxCache()})};xt.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()})})};xt.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()})})};xt.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 Tn={};Tn.applyBypass=function(t,e,r,a){var n=this,i=[],o=!0;if(e==="*"||e==="**"){if(r!==void 0)for(var s=0;s<n.properties.length;s++){var u=n.properties[s],l=u.name,f=this.parse(l,r,!0);f&&i.push(f)}}else if(Me(e)){var h=this.parse(e,r,!0);h&&i.push(h)}else if(Ye(e)){var v=e;a=r;for(var c=Object.keys(v),d=0;d<c.length;d++){var g=c[d],p=v[g];if(p===void 0&&(p=v[Ri(g)]),p!==void 0){var y=this.parse(g,p,!0);y&&i.push(y)}}}else return!1;if(i.length===0)return!1;for(var b=!1,m=0;m<t.length;m++){for(var E=t[m],T={},L=void 0,w=0;w<i.length;w++){var C=i[w];if(a){var A=E.pstyle(C.name);L=T[C.name]={prev:A}}b=this.applyParsedProperty(E,ar(C))||b,a&&(L.next=E.pstyle(C.name))}b&&this.updateStyleHints(E),a&&this.updateTransitions(E,T,o)}return b};Tn.overrideBypass=function(t,e,r){e=Rv(e);for(var a=0;a<t.length;a++){var n=t[a],i=n._private.style[e],o=this.properties[e].type,s=o.color,u=o.mutiple,l=i?i.pfValue!=null?i.pfValue:i.value:null;!i||!i.bypass?this.applyBypass(n,e,r):(i.value=r,i.pfValue!=null&&(i.pfValue=r),s?i.strValue="rgb("+r.join(",")+")":u?i.strValue=r.join(" "):i.strValue=""+r,this.updateStyleHints(n)),this.checkTriggers(n,e,l,r)}};Tn.removeAllBypasses=function(t,e){return this.removeBypasses(t,this.propertyNames,e)};Tn.removeBypasses=function(t,e,r){for(var a=!0,n=0;n<t.length;n++){for(var i=t[n],o={},s=0;s<e.length;s++){var u=e[s],l=this.properties[u],f=i.pstyle(l.name);if(!(!f||!f.bypass)){var h="",v=this.parse(u,h,!0),c=o[l.name]={prev:f};this.applyParsedProperty(i,v),c.next=i.pstyle(l.name)}}this.updateStyleHints(i),r&&this.updateTransitions(i,o,a)}};var zv={};zv.getEmSizeInPixels=function(){var t=this.containerCss("font-size");return t!=null?parseFloat(t):1};zv.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 nr={};nr.getRenderedStyle=function(t,e){return e?this.getStylePropertyValue(t,e,!0):this.getRawStyle(t,!0)};nr.getRawStyle=function(t,e){var r=this;if(t=t[0],t){for(var a={},n=0;n<r.properties.length;n++){var i=r.properties[n],o=r.getStylePropertyValue(t,i.name,e);o!=null&&(a[i.name]=o,a[Ri(i.name)]=o)}return a}};nr.getIndexedStyle=function(t,e,r,a){var n=t.pstyle(e)[r][a];return n??t.cy().style().getDefaultProperty(e)[r][0]};nr.getStylePropertyValue=function(t,e,r){var a=this;if(t=t[0],t){var n=a.properties[e];n.alias&&(n=n.pointsTo);var i=n.type,o=t.pstyle(n.name);if(o){var s=o.value,u=o.units,l=o.strValue;if(r&&i.number&&s!=null&&Te(s)){var f=t.cy().zoom(),h=function(p){return p*f},v=function(p,y){return h(p)+y},c=je(s),d=c?u.every(function(g){return g!=null}):u!=null;return d?c?s.map(function(g,p){return v(g,u[p])}).join(" "):v(s,u):c?s.map(function(g){return Me(g)?g:""+h(g)}).join(" "):""+h(s)}else if(l!=null)return l}return null}};nr.getAnimationStartStyle=function(t,e){for(var r={},a=0;a<e.length;a++){var n=e[a],i=n.name,o=t.pstyle(i);o!==void 0&&(Ye(o)?o=this.parse(i,o.strValue):o=this.parse(i,o)),o&&(r[i]=o)}return r};nr.getPropsList=function(t){var e=this,r=[],a=t,n=e.properties;if(a)for(var i=Object.keys(a),o=0;o<i.length;o++){var s=i[o],u=a[s],l=n[s]||n[Rv(s)],f=this.parse(l.name,u);f&&r.push(f)}return r};nr.getNonDefaultPropertiesHash=function(t,e,r){var a=r.slice(),n,i,o,s,u,l;for(u=0;u<e.length;u++)if(n=e[u],i=t.pstyle(n,!1),i!=null)if(i.pfValue!=null)a[0]=an(s,a[0]),a[1]=nn(s,a[1]);else for(o=i.strValue,l=0;l<o.length;l++)s=o.charCodeAt(l),a[0]=an(s,a[0]),a[1]=nn(s,a[1]);return a};nr.getPropertiesHash=nr.getNonDefaultPropertiesHash;var Gi={};Gi.appendFromJson=function(t){for(var e=this,r=0;r<t.length;r++){var a=t[r],n=a.selector,i=a.style||a.css,o=Object.keys(i);e.selector(n);for(var s=0;s<o.length;s++){var u=o[s],l=i[u];e.css(u,l)}}return e};Gi.fromJson=function(t){var e=this;return e.resetToDefault(),e.appendFromJson(t),e};Gi.json=function(){for(var t=[],e=this.defaultLength;e<this.length;e++){for(var r=this[e],a=r.selector,n=r.properties,i={},o=0;o<n.length;o++){var s=n[o];i[s.name]=s.strValue}t.push({selector:a?a.toString():"core",style:i})}return t};var Vv={};Vv.appendFromString=function(t){var e=this,r=this,a=""+t,n,i,o;a=a.replace(/[/][*](\s|.)+?[*][/]/g,"");function s(){a.length>n.length?a=a.substr(n.length):a=""}function u(){i.length>o.length?i=i.substr(o.length):i=""}for(;;){var l=a.match(/^\s*$/);if(l)break;var f=a.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!f){Ze("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+a);break}n=f[0];var h=f[1];if(h!=="core"){var v=new Mr(h);if(v.invalid){Ze("Skipping parsing of block: Invalid selector found in string stylesheet: "+h),s();continue}}var c=f[2],d=!1;i=c;for(var g=[];;){var p=i.match(/^\s*$/);if(p)break;var y=i.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!y){Ze("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+c),d=!0;break}o=y[0];var b=y[1],m=y[2],E=e.properties[b];if(!E){Ze("Skipping property: Invalid property name in: "+o),u();continue}var T=r.parse(b,m);if(!T){Ze("Skipping property: Invalid property definition in: "+o),u();continue}g.push({name:b,val:m}),u()}if(d){s();break}r.selector(h);for(var L=0;L<g.length;L++){var w=g[L];r.css(w.name,w.val)}s()}return r};Vv.fromString=function(t){var e=this;return e.resetToDefault(),e.appendFromString(t),e};var vt={};(function(){var t=mt,e=Rx,r=Dx,a=Nx,n=Mx,i=function(X){return"^"+X+"\\s*\\(\\s*([\\w\\.]+)\\s*\\)$"},o=function(X){var Z=t+"|\\w+|"+e+"|"+r+"|"+a+"|"+n;return"^"+X+"\\s*\\(([\\w\\.]+)\\s*\\,\\s*("+t+")\\s*\\,\\s*("+t+")\\s*,\\s*("+Z+")\\s*\\,\\s*("+Z+")\\)$"},s=[`^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","center","bottom"]},halign:{enums:["left","center","right"]},justification:{enums:["left","center","right","auto"]},text:{string:!0},data:{mapping:!0,regex:i("data")},layoutData:{mapping:!0,regex:i("layoutData")},scratch:{mapping:!0,regex:i("scratch")},mapData:{mapping:!0,regex:o("mapData")},mapLayoutData:{mapping:!0,regex:o("mapLayoutData")},mapScratch:{mapping:!0,regex:o("mapScratch")},fn:{mapping:!0,fn:!0},url:{regexes:s,singleRegexMatchValue:!0},urls:{regexes:s,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(X,Z){switch(X.length){case 2:return Z[0]!=="deg"&&Z[0]!=="rad"&&Z[1]!=="deg"&&Z[1]!=="rad";case 1:return Me(X[0])||Z[0]==="deg"||Z[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(X){var Z=X.length;return Z===1||Z===2||Z===4}}};var u={zeroNonZero:function(X,Z){return(X==null||Z==null)&&X!==Z||X==0&&Z!=0?!0:X!=0&&Z==0},any:function(X,Z){return X!=Z},emptyNonEmpty:function(X,Z){var ee=Sr(X),re=Sr(Z);return ee&&!re||!ee&&re}},l=vt.types,f=[{name:"label",type:l.text,triggersBounds:u.any,triggersZOrder:u.emptyNonEmpty},{name:"text-rotation",type:l.textRotation,triggersBounds:u.any},{name:"text-margin-x",type:l.bidirectionalSize,triggersBounds:u.any},{name:"text-margin-y",type:l.bidirectionalSize,triggersBounds:u.any}],h=[{name:"source-label",type:l.text,triggersBounds:u.any},{name:"source-text-rotation",type:l.textRotation,triggersBounds:u.any},{name:"source-text-margin-x",type:l.bidirectionalSize,triggersBounds:u.any},{name:"source-text-margin-y",type:l.bidirectionalSize,triggersBounds:u.any},{name:"source-text-offset",type:l.size,triggersBounds:u.any}],v=[{name:"target-label",type:l.text,triggersBounds:u.any},{name:"target-text-rotation",type:l.textRotation,triggersBounds:u.any},{name:"target-text-margin-x",type:l.bidirectionalSize,triggersBounds:u.any},{name:"target-text-margin-y",type:l.bidirectionalSize,triggersBounds:u.any},{name:"target-text-offset",type:l.size,triggersBounds:u.any}],c=[{name:"font-family",type:l.fontFamily,triggersBounds:u.any},{name:"font-style",type:l.fontStyle,triggersBounds:u.any},{name:"font-weight",type:l.fontWeight,triggersBounds:u.any},{name:"font-size",type:l.size,triggersBounds:u.any},{name:"text-transform",type:l.textTransform,triggersBounds:u.any},{name:"text-wrap",type:l.textWrap,triggersBounds:u.any},{name:"text-overflow-wrap",type:l.textOverflowWrap,triggersBounds:u.any},{name:"text-max-width",type:l.size,triggersBounds:u.any},{name:"text-outline-width",type:l.size,triggersBounds:u.any},{name:"line-height",type:l.positiveNumber,triggersBounds:u.any}],d=[{name:"text-valign",type:l.valign,triggersBounds:u.any},{name:"text-halign",type:l.halign,triggersBounds:u.any},{name:"color",type:l.color},{name:"text-outline-color",type:l.color},{name:"text-outline-opacity",type:l.zeroOneNumber},{name:"text-background-color",type:l.color},{name:"text-background-opacity",type:l.zeroOneNumber},{name:"text-background-padding",type:l.size,triggersBounds:u.any},{name:"text-border-opacity",type:l.zeroOneNumber},{name:"text-border-color",type:l.color},{name:"text-border-width",type:l.size,triggersBounds:u.any},{name:"text-border-style",type:l.borderStyle,triggersBounds:u.any},{name:"text-background-shape",type:l.textBackgroundShape,triggersBounds:u.any},{name:"text-justification",type:l.justification},{name:"box-select-labels",type:l.bool,triggersBounds:u.any}],g=[{name:"events",type:l.bool,triggersZOrder:u.any},{name:"text-events",type:l.bool,triggersZOrder:u.any},{name:"box-selection",type:l.boxSelection,triggersZOrder:u.any}],p=[{name:"display",type:l.display,triggersZOrder:u.any,triggersBounds:u.any,triggersBoundsOfConnectedEdges:u.any,triggersBoundsOfParallelEdges:function(X,Z,ee){return X===Z?!1:ee.pstyle("curve-style").value==="bezier"}},{name:"visibility",type:l.visibility,triggersZOrder:u.any},{name:"opacity",type:l.zeroOneNumber,triggersZOrder:u.zeroNonZero},{name:"text-opacity",type:l.zeroOneNumber},{name:"min-zoomed-font-size",type:l.size},{name:"z-compound-depth",type:l.zCompoundDepth,triggersZOrder:u.any},{name:"z-index-compare",type:l.zIndexCompare,triggersZOrder:u.any},{name:"z-index",type:l.number,triggersZOrder:u.any}],y=[{name:"overlay-padding",type:l.size,triggersBounds:u.any},{name:"overlay-color",type:l.color},{name:"overlay-opacity",type:l.zeroOneNumber,triggersBounds:u.zeroNonZero},{name:"overlay-shape",type:l.overlayShape,triggersBounds:u.any},{name:"overlay-corner-radius",type:l.cornerRadius}],b=[{name:"underlay-padding",type:l.size,triggersBounds:u.any},{name:"underlay-color",type:l.color},{name:"underlay-opacity",type:l.zeroOneNumber,triggersBounds:u.zeroNonZero},{name:"underlay-shape",type:l.overlayShape,triggersBounds:u.any},{name:"underlay-corner-radius",type:l.cornerRadius}],m=[{name:"transition-property",type:l.propList},{name:"transition-duration",type:l.time},{name:"transition-delay",type:l.time},{name:"transition-timing-function",type:l.easing}],E=function(X,Z){return Z.value==="label"?-X.poolIndex():Z.pfValue},T=[{name:"height",type:l.nodeSize,triggersBounds:u.any,hashOverride:E},{name:"width",type:l.nodeSize,triggersBounds:u.any,hashOverride:E},{name:"shape",type:l.nodeShape,triggersBounds:u.any},{name:"shape-polygon-points",type:l.polygonPointList,triggersBounds:u.any},{name:"corner-radius",type:l.cornerRadius},{name:"background-color",type:l.color},{name:"background-fill",type:l.fill},{name:"background-opacity",type:l.zeroOneNumber},{name:"background-blacken",type:l.nOneOneNumber},{name:"background-gradient-stop-colors",type:l.colors},{name:"background-gradient-stop-positions",type:l.percentages},{name:"background-gradient-direction",type:l.gradientDirection},{name:"padding",type:l.sizeMaybePercent,triggersBounds:u.any},{name:"padding-relative-to",type:l.paddingRelativeTo,triggersBounds:u.any},{name:"bounds-expansion",type:l.boundsExpansion,triggersBounds:u.any}],L=[{name:"border-color",type:l.color},{name:"border-opacity",type:l.zeroOneNumber},{name:"border-width",type:l.size,triggersBounds:u.any},{name:"border-style",type:l.borderStyle},{name:"border-cap",type:l.lineCap},{name:"border-join",type:l.lineJoin},{name:"border-dash-pattern",type:l.numbers},{name:"border-dash-offset",type:l.number},{name:"border-position",type:l.linePosition}],w=[{name:"outline-color",type:l.color},{name:"outline-opacity",type:l.zeroOneNumber},{name:"outline-width",type:l.size,triggersBounds:u.any},{name:"outline-style",type:l.borderStyle},{name:"outline-offset",type:l.size,triggersBounds:u.any}],C=[{name:"background-image",type:l.urls},{name:"background-image-crossorigin",type:l.bgCrossOrigin},{name:"background-image-opacity",type:l.zeroOneNumbers},{name:"background-image-containment",type:l.bgContainment},{name:"background-image-smoothing",type:l.bools},{name:"background-position-x",type:l.bgPos},{name:"background-position-y",type:l.bgPos},{name:"background-width-relative-to",type:l.bgRelativeTo},{name:"background-height-relative-to",type:l.bgRelativeTo},{name:"background-repeat",type:l.bgRepeat},{name:"background-fit",type:l.bgFit},{name:"background-clip",type:l.bgClip},{name:"background-width",type:l.bgWH},{name:"background-height",type:l.bgWH},{name:"background-offset-x",type:l.bgPos},{name:"background-offset-y",type:l.bgPos}],A=[{name:"position",type:l.position,triggersBounds:u.any},{name:"compound-sizing-wrt-labels",type:l.compoundIncludeLabels,triggersBounds:u.any},{name:"min-width",type:l.size,triggersBounds:u.any},{name:"min-width-bias-left",type:l.sizeMaybePercent,triggersBounds:u.any},{name:"min-width-bias-right",type:l.sizeMaybePercent,triggersBounds:u.any},{name:"min-height",type:l.size,triggersBounds:u.any},{name:"min-height-bias-top",type:l.sizeMaybePercent,triggersBounds:u.any},{name:"min-height-bias-bottom",type:l.sizeMaybePercent,triggersBounds:u.any}],R=[{name:"line-style",type:l.lineStyle},{name:"line-color",type:l.color},{name:"line-fill",type:l.fill},{name:"line-cap",type:l.lineCap},{name:"line-opacity",type:l.zeroOneNumber},{name:"line-dash-pattern",type:l.numbers},{name:"line-dash-offset",type:l.number},{name:"line-outline-width",type:l.size},{name:"line-outline-color",type:l.color},{name:"line-gradient-stop-colors",type:l.colors},{name:"line-gradient-stop-positions",type:l.percentages},{name:"curve-style",type:l.curveStyle,triggersBounds:u.any,triggersBoundsOfParallelEdges:function(X,Z){return X===Z?!1:X==="bezier"||Z==="bezier"}},{name:"haystack-radius",type:l.zeroOneNumber,triggersBounds:u.any},{name:"source-endpoint",type:l.edgeEndpoint,triggersBounds:u.any},{name:"target-endpoint",type:l.edgeEndpoint,triggersBounds:u.any},{name:"control-point-step-size",type:l.size,triggersBounds:u.any},{name:"control-point-distances",type:l.bidirectionalSizes,triggersBounds:u.any},{name:"control-point-weights",type:l.numbers,triggersBounds:u.any},{name:"segment-distances",type:l.bidirectionalSizes,triggersBounds:u.any},{name:"segment-weights",type:l.numbers,triggersBounds:u.any},{name:"segment-radii",type:l.numbers,triggersBounds:u.any},{name:"radius-type",type:l.radiusType,triggersBounds:u.any},{name:"taxi-turn",type:l.bidirectionalSizeMaybePercent,triggersBounds:u.any},{name:"taxi-turn-min-distance",type:l.size,triggersBounds:u.any},{name:"taxi-direction",type:l.axisDirection,triggersBounds:u.any},{name:"taxi-radius",type:l.number,triggersBounds:u.any},{name:"edge-distances",type:l.edgeDistances,triggersBounds:u.any},{name:"arrow-scale",type:l.positiveNumber,triggersBounds:u.any},{name:"loop-direction",type:l.angle,triggersBounds:u.any},{name:"loop-sweep",type:l.angle,triggersBounds:u.any},{name:"source-distance-from-node",type:l.size,triggersBounds:u.any},{name:"target-distance-from-node",type:l.size,triggersBounds:u.any}],S=[{name:"ghost",type:l.bool,triggersBounds:u.any},{name:"ghost-offset-x",type:l.bidirectionalSize,triggersBounds:u.any},{name:"ghost-offset-y",type:l.bidirectionalSize,triggersBounds:u.any},{name:"ghost-opacity",type:l.zeroOneNumber}],D=[{name:"selection-box-color",type:l.color},{name:"selection-box-opacity",type:l.zeroOneNumber},{name:"selection-box-border-color",type:l.color},{name:"selection-box-border-width",type:l.size},{name:"active-bg-color",type:l.color},{name:"active-bg-opacity",type:l.zeroOneNumber},{name:"active-bg-size",type:l.size},{name:"outside-texture-bg-color",type:l.color},{name:"outside-texture-bg-opacity",type:l.zeroOneNumber}],P=[];vt.pieBackgroundN=16,P.push({name:"pie-size",type:l.sizeMaybePercent}),P.push({name:"pie-hole",type:l.sizeMaybePercent}),P.push({name:"pie-start-angle",type:l.angle});for(var x=1;x<=vt.pieBackgroundN;x++)P.push({name:"pie-"+x+"-background-color",type:l.color}),P.push({name:"pie-"+x+"-background-size",type:l.percent}),P.push({name:"pie-"+x+"-background-opacity",type:l.zeroOneNumber});var N=[];vt.stripeBackgroundN=16,N.push({name:"stripe-size",type:l.sizeMaybePercent}),N.push({name:"stripe-direction",type:l.axisDirectionPrimary});for(var M=1;M<=vt.stripeBackgroundN;M++)N.push({name:"stripe-"+M+"-background-color",type:l.color}),N.push({name:"stripe-"+M+"-background-size",type:l.percent}),N.push({name:"stripe-"+M+"-background-opacity",type:l.zeroOneNumber});var I=[],O=vt.arrowPrefixes=["source","mid-source","target","mid-target"];[{name:"arrow-shape",type:l.arrowShape,triggersBounds:u.any},{name:"arrow-color",type:l.color},{name:"arrow-fill",type:l.arrowFill},{name:"arrow-width",type:l.arrowWidth}].forEach(function(V){O.forEach(function(X){var Z=X+"-"+V.name,ee=V.type,re=V.triggersBounds;I.push({name:Z,type:ee,triggersBounds:re})})},{});var q=vt.properties=[].concat(g,m,p,y,b,S,d,c,f,h,v,T,L,w,C,P,N,A,R,I,D),_=vt.propertyGroups={behavior:g,transition:m,visibility:p,overlay:y,underlay:b,ghost:S,commonLabel:d,labelDimensions:c,mainLabel:f,sourceLabel:h,targetLabel:v,nodeBody:T,nodeBorder:L,nodeOutline:w,backgroundImage:C,pie:P,stripe:N,compound:A,edgeLine:R,edgeArrow:I,core:D},B=vt.propertyGroupNames={},z=vt.propertyGroupKeys=Object.keys(_);z.forEach(function(V){B[V]=_[V].map(function(X){return X.name}),_[V].forEach(function(X){return X.groupKey=V})});var Y=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=q.map(function(V){return V.name});for(var k=0;k<q.length;k++){var G=q[k];q[G.name]=G}for(var U=0;U<Y.length;U++){var W=Y[U],j=q[W.pointsTo],H={name:W.name,alias:!0,pointsTo:j};q.push(H),q[W.name]=H}})();vt.getDefaultProperty=function(t){return this.getDefaultProperties()[t]};vt.getDefaultProperties=function(){var t=this._private;if(t.defaultProperties!=null)return t.defaultProperties;for(var e=Be({"selection-box-color":"#ddd","selection-box-opacity":.65,"selection-box-border-color":"#aaa","selection-box-border-width":1,"active-bg-color":"black","active-bg-opacity":.15,"active-bg-size":30,"outside-texture-bg-color":"#000","outside-texture-bg-opacity":.125,events:"yes","text-events":"no","text-valign":"top","text-halign":"center","text-justification":"auto","line-height":1,color:"#000","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","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(u,l){for(var f=1;f<=vt.pieBackgroundN;f++){var h=l.name.replace("{{i}}",f),v=l.value;u[h]=v}return u},{}),{"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(u,l){for(var f=1;f<=vt.stripeBackgroundN;f++){var h=l.name.replace("{{i}}",f),v=l.value;u[h]=v}return u},{}),{"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":.5,"segment-weights":.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(u,l){return vt.arrowPrefixes.forEach(function(f){var h=f+"-"+l.name,v=l.value;u[h]=v}),u},{})),r={},a=0;a<this.properties.length;a++){var n=this.properties[a];if(!n.pointsTo){var i=n.name,o=e[i],s=this.parse(i,o);r[i]=s}}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":.25}),this.defaultLength=this.length};var Ui={};Ui.parse=function(t,e,r,a){var n=this;if(ot(e))return n.parseImplWarn(t,e,r,a);var i=a==="mapping"||a===!0||a===!1||a==null?"dontcare":a,o=r?"t":"f",s=""+e,u=NE(t,s,o,i),l=n.propCache=n.propCache||[],f;return(f=l[u])||(f=l[u]=n.parseImplWarn(t,e,r,a)),(r||a==="mapping")&&(f=ar(f),f&&(f.value=ar(f.value))),f};Ui.parseImplWarn=function(t,e,r,a){var n=this.parseImpl(t,e,r,a);return!n&&e!=null&&Ze("The style property `".concat(t,": ").concat(e,"` is invalid")),n&&(n.name==="width"||n.name==="height")&&e==="label"&&Ze("The style value of `label` is deprecated for `"+n.name+"`"),n};Ui.parseImpl=function(t,e,r,a){var n=this;t=Rv(t);var i=n.properties[t],o=e,s=n.types;if(!i||e===void 0)return null;i.alias&&(i=i.pointsTo,t=i.name);var u=Me(e);u&&(e=e.trim());var l=i.type;if(!l)return null;if(r&&(e===""||e===null))return{name:t,value:e,bypass:!0,deleteBypass:!0};if(ot(e))return{name:t,value:e,strValue:"fn",mapped:s.fn,bypass:r};var f,h;if(!(!u||a||e.length<7||e[1]!=="a")){if(e.length>=7&&e[0]==="d"&&(f=new RegExp(s.data.regex).exec(e))){if(r)return!1;var v=s.data;return{name:t,value:f,strValue:""+e,mapped:v,field:f[1],bypass:r}}else if(e.length>=10&&e[0]==="m"&&(h=new RegExp(s.mapData.regex).exec(e))){if(r||l.multiple)return!1;var c=s.mapData;if(!(l.color||l.number))return!1;var d=this.parse(t,h[4]);if(!d||d.mapped)return!1;var g=this.parse(t,h[5]);if(!g||g.mapped)return!1;if(d.pfValue===g.pfValue||d.strValue===g.strValue)return Ze("`"+t+": "+e+"` is not a valid mapper because the output range is zero; converting to `"+t+": "+d.strValue+"`"),this.parse(t,d.strValue);if(l.color){var p=d.value,y=g.value,b=p[0]===y[0]&&p[1]===y[1]&&p[2]===y[2]&&(p[3]===y[3]||(p[3]==null||p[3]===1)&&(y[3]==null||y[3]===1));if(b)return!1}return{name:t,value:h,strValue:""+e,mapped:c,field:h[1],fieldMin:parseFloat(h[2]),fieldMax:parseFloat(h[3]),valueMin:d.value,valueMax:g.value,bypass:r}}}if(l.multiple&&a!=="multiple"){var m;if(u?m=e.split(/\s+/):je(e)?m=e:m=[e],l.evenMultiple&&m.length%2!==0)return null;for(var E=[],T=[],L=[],w="",C=!1,A=0;A<m.length;A++){var R=n.parse(t,m[A],r,"multiple");C=C||Me(R.value),E.push(R.value),L.push(R.pfValue!=null?R.pfValue:R.value),T.push(R.units),w+=(A>0?" ":"")+R.strValue}return l.validate&&!l.validate(E,T)?null:l.singleEnum&&C?E.length===1&&Me(E[0])?{name:t,value:E[0],strValue:E[0],bypass:r}:null:{name:t,value:E,pfValue:L,strValue:w,bypass:r,units:T}}var S=function(){for(var H=0;H<l.enums.length;H++){var V=l.enums[H];if(V===e)return{name:t,value:e,strValue:""+e,bypass:r}}return null};if(l.number){var D,P="px";if(l.units&&(D=l.units),l.implicitUnits&&(P=l.implicitUnits),!l.unitless)if(u){var x="px|em"+(l.allowPercent?"|\\%":"");D&&(x=D);var N=e.match("^("+mt+")("+x+")?$");N&&(e=N[1],D=N[2]||P)}else(!D||l.implicitUnits)&&(D=P);if(e=parseFloat(e),isNaN(e)&&l.enums===void 0)return null;if(isNaN(e)&&l.enums!==void 0)return e=o,S();if(l.integer&&!Ex(e)||l.min!==void 0&&(e<l.min||l.strictMin&&e===l.min)||l.max!==void 0&&(e>l.max||l.strictMax&&e===l.max))return null;var M={name:t,value:e,strValue:""+e+(D||""),units:D,bypass:r};return l.unitless||D!=="px"&&D!=="em"?M.pfValue=e:M.pfValue=D==="px"||!D?e:this.getEmSizeInPixels()*e,(D==="ms"||D==="s")&&(M.pfValue=D==="ms"?e:1e3*e),(D==="deg"||D==="rad")&&(M.pfValue=D==="rad"?e:NC(e)),D==="%"&&(M.pfValue=e/100),M}else if(l.propList){var I=[],O=""+e;if(O!=="none"){for(var q=O.split(/\s*,\s*|\s+/),_=0;_<q.length;_++){var B=q[_].trim();n.properties[B]?I.push(B):Ze("`"+B+"` is not a valid property name")}if(I.length===0)return null}return{name:t,value:I,strValue:I.length===0?"none":I.join(" "),bypass:r}}else if(l.color){var z=xE(e);return z?{name:t,value:z,pfValue:z,strValue:"rgb("+z[0]+","+z[1]+","+z[2]+")",bypass:r}:null}else if(l.regex||l.regexes){if(l.enums){var Y=S();if(Y)return Y}for(var k=l.regexes?l.regexes:[l.regex],G=0;G<k.length;G++){var U=new RegExp(k[G]),W=U.exec(e);if(W)return{name:t,value:l.singleRegexMatchValue?W[1]:W,strValue:""+e,bypass:r}}return null}else return l.string?{name:t,value:""+e,strValue:""+e,bypass:r}:l.enums?S():null};var Tt=function(e){if(!(this instanceof Tt))return new Tt(e);if(!Lv(e)){at("A style must have a core reference");return}this._private={cy:e,coreStyle:{}},this.length=0,this.resetToDefault()},Nt=Tt.prototype;Nt.instanceString=function(){return"style"};Nt.clear=function(){for(var t=this._private,e=t.cy,r=e.elements(),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};Nt.resetToDefault=function(){return this.clear(),this.addDefaultStylesheet(),this};Nt.core=function(t){return this._private.coreStyle[t]||this.getDefaultProperty(t)};Nt.selector=function(t){var e=t==="core"?null:new Mr(t),r=this.length++;return this[r]={selector:e,properties:[],mappedProperties:[],index:r},this};Nt.css=function(){var t=this,e=arguments;if(e.length===1)for(var r=e[0],a=0;a<t.properties.length;a++){var n=t.properties[a],i=r[n.name];i===void 0&&(i=r[Ri(n.name)]),i!==void 0&&this.cssRule(n.name,i)}else e.length===2&&this.cssRule(e[0],e[1]);return this};Nt.style=Nt.css;Nt.cssRule=function(t,e){var r=this.parse(t,e);if(r){var a=this.length-1;this[a].properties.push(r),this[a].properties[r.name]=r,r.name.match(/pie-(\d+)-background-size/)&&r.value&&(this._private.hasPie=!0),r.name.match(/stripe-(\d+)-background-size/)&&r.value&&(this._private.hasStripe=!0),r.mapped&&this[a].mappedProperties.push(r);var n=!this[a].selector;n&&(this._private.coreStyle[r.name]=r)}return this};Nt.append=function(t){return EE(t)?t.appendToStyle(this):je(t)?this.appendFromJson(t):Me(t)&&this.appendFromString(t),this};Tt.fromJson=function(t,e){var r=new Tt(t);return r.fromJson(e),r};Tt.fromString=function(t,e){return new Tt(t).fromString(e)};[xt,Tn,zv,nr,Gi,Vv,vt,Ui].forEach(function(t){Be(Nt,t)});Tt.types=Nt.types;Tt.properties=Nt.properties;Tt.propertyGroups=Nt.propertyGroups;Tt.propertyGroupNames=Nt.propertyGroupNames;Tt.propertyGroupKeys=Nt.propertyGroupKeys;var PR={style:function(e){if(e){var r=this.setStyle(e);r.update()}return this._private.style},setStyle:function(e){var r=this._private;return EE(e)?r.style=e.generateStyle(this):je(e)?r.style=Tt.fromJson(this,e):Me(e)?r.style=Tt.fromString(this,e):r.style=Tt(this),r.style},updateStyle:function(){this.mutableElements().updateStyle()}},FR="single",Jr={autolock:function(e){if(e!==void 0)this._private.autolock=!!e;else return this._private.autolock;return this},autoungrabify:function(e){if(e!==void 0)this._private.autoungrabify=!!e;else return this._private.autoungrabify;return this},autounselectify:function(e){if(e!==void 0)this._private.autounselectify=!!e;else return this._private.autounselectify;return this},selectionType:function(e){var r=this._private;if(r.selectionType==null&&(r.selectionType=FR),e!==void 0)(e==="additive"||e==="single")&&(r.selectionType=e);else return r.selectionType;return this},panningEnabled:function(e){if(e!==void 0)this._private.panningEnabled=!!e;else return this._private.panningEnabled;return this},userPanningEnabled:function(e){if(e!==void 0)this._private.userPanningEnabled=!!e;else return this._private.userPanningEnabled;return this},zoomingEnabled:function(e){if(e!==void 0)this._private.zoomingEnabled=!!e;else return this._private.zoomingEnabled;return this},userZoomingEnabled:function(e){if(e!==void 0)this._private.userZoomingEnabled=!!e;else return this._private.userZoomingEnabled;return this},boxSelectionEnabled:function(e){if(e!==void 0)this._private.boxSelectionEnabled=!!e;else return this._private.boxSelectionEnabled;return this},pan:function(){var e=arguments,r=this._private.pan,a,n,i,o,s;switch(e.length){case 0:return r;case 1:if(Me(e[0]))return a=e[0],r[a];if(Ye(e[0])){if(!this._private.panningEnabled)return this;i=e[0],o=i.x,s=i.y,Te(o)&&(r.x=o),Te(s)&&(r.y=s),this.emit("pan viewport")}break;case 2:if(!this._private.panningEnabled)return this;a=e[0],n=e[1],(a==="x"||a==="y")&&Te(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,o,s,u,l;if(!this._private.panningEnabled)return this;switch(a.length){case 1:Ye(e)&&(s=a[0],u=s.x,l=s.y,Te(u)&&(n.x+=u),Te(l)&&(n.y+=l),this.emit("pan viewport"));break;case 2:i=e,o=r,(i==="x"||i==="y")&&Te(o)&&(n[i]+=o),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(Te(e)&&r===void 0&&(r=e,e=void 0),!(!this._private.panningEnabled||!this._private.zoomingEnabled)){var a;if(Me(e)){var n=e;e=this.$(n)}else if(xx(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 Ut(e)||(e=this.mutableElements());if(!(Ut(e)&&e.empty())){a=a||e.boundingBox();var o=this.width(),s=this.height(),u;if(r=Te(r)?r:0,!isNaN(o)&&!isNaN(s)&&o>0&&s>0&&!isNaN(a.w)&&!isNaN(a.h)&&a.w>0&&a.h>0){u=Math.min((o-2*r)/a.w,(s-2*r)/a.h),u=u>this._private.maxZoom?this._private.maxZoom:u,u=u<this._private.minZoom?this._private.minZoom:u;var l={x:(o-u*(a.x1+a.x2))/2,y:(s-u*(a.y1+a.y2))/2};return{zoom:u,pan:l}}}}},zoomRange:function(e,r){var a=this._private;if(r==null){var n=e;e=n.min,r=n.max}return Te(e)&&Te(r)&&e<=r?(a.minZoom=e,a.maxZoom=r):Te(e)&&r===void 0&&e<=a.maxZoom?a.minZoom=e:Te(r)&&e===void 0&&r>=a.minZoom&&(a.maxZoom=r),this},minZoom:function(e){return e===void 0?this._private.minZoom:this.zoomRange({min:e})},maxZoom:function(e){return e===void 0?this._private.maxZoom:this.zoomRange({max:e})},getZoomedViewport:function(e){var r=this._private,a=r.pan,n=r.zoom,i,o,s=!1;if(r.zoomingEnabled||(s=!0),Te(e)?o=e:Ye(e)&&(o=e.level,e.position!=null?i=Ni(e.position,n,a):e.renderedPosition!=null&&(i=e.renderedPosition),i!=null&&!r.panningEnabled&&(s=!0)),o=o>r.maxZoom?r.maxZoom:o,o=o<r.minZoom?r.minZoom:o,s||!Te(o)||o===n||i!=null&&(!Te(i.x)||!Te(i.y)))return null;if(i!=null){var u=a,l=n,f=o,h={x:-f/l*(i.x-u.x)+i.x,y:-f/l*(i.y-u.y)+i.y};return{zoomed:!0,panned:!0,zoom:f,pan:h}}else return{zoomed:!0,panned:!1,zoom:o,pan:a}},zoom:function(e){if(e===void 0)return this._private.zoom;var r=this.getZoomedViewport(e),a=this._private;return r==null||!r.zoomed?this:(a.zoom=r.zoom,r.panned&&(a.pan.x=r.pan.x,a.pan.y=r.pan.y),this.emit("zoom"+(r.panned?" pan":"")+" viewport"),this.notify("viewport"),this)},viewport:function(e){var r=this._private,a=!0,n=!0,i=[],o=!1,s=!1;if(!e)return this;if(Te(e.zoom)||(a=!1),Ye(e.pan)||(n=!1),!a&&!n)return this;if(a){var u=e.zoom;u<r.minZoom||u>r.maxZoom||!r.zoomingEnabled?o=!0:(r.zoom=u,i.push("zoom"))}if(n&&(!o||!e.cancelOnFailedZoom)&&r.panningEnabled){var l=e.pan;Te(l.x)&&(r.pan.x=l.x,s=!1),Te(l.y)&&(r.pan.y=l.y,s=!1),s||i.push("pan")}return i.length>0&&(i.push("viewport"),this.emit(i.join(" ")),this.notify("viewport")),this},center:function(e){var r=this.getCenterPan(e);return r&&(this._private.pan=r,this.emit("pan viewport"),this.notify("viewport")),this},getCenterPan:function(e,r){if(this._private.panningEnabled){if(Me(e)){var a=e;e=this.mutableElements().filter(a)}else Ut(e)||(e=this.mutableElements());if(e.length!==0){var n=e.boundingBox(),i=this.width(),o=this.height();r=r===void 0?this._private.zoom:r;var s={x:(i-r*(n.x1+n.x2))/2,y:(o-r*(n.y1+n.y2))/2};return s}}},reset:function(){return!this._private.panningEnabled||!this._private.zoomingEnabled?this:(this.viewport({pan:{x:0,y:0},zoom:1}),this)},invalidateSize:function(){this._private.sizeCache=null},size:function(){var e=this._private,r=e.container,a=this;return e.sizeCache=e.sizeCache||(r?(function(){var n=a.window().getComputedStyle(r),i=function(s){return parseFloat(n.getPropertyValue(s))};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}};Jr.centre=Jr.center;Jr.autolockNodes=Jr.autolock;Jr.autoungrabifyNodes=Jr.autoungrabify;var hn={data:Ke.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:Ke.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:Ke.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Ke.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};hn.attr=hn.data;hn.removeAttr=hn.removeData;var cn=function(e){var r=this;e=Be({},e);var a=e.container;a&&!vi(a)&&vi(a[0])&&(a=a[0]);var n=a?a._cyreg:null;n=n||{},n&&n.cy&&(n.cy.destroy(),n={});var i=n.readies=n.readies||[];a&&(a._cyreg=n),n.cy=r;var o=yt!==void 0&&a!==void 0&&!e.headless,s=e;s.layout=Be({name:o?"grid":"null"},s.layout),s.renderer=Be({name:o?"canvas":"null"},s.renderer);var u=function(d,g,p){return g!==void 0?g:p!==void 0?p:d},l=this._private={container:a,ready:!1,options:s,elements:new At(this),listeners:[],aniEles:new At(this),data:s.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:u(!0,s.zoomingEnabled),userZoomingEnabled:u(!0,s.userZoomingEnabled),panningEnabled:u(!0,s.panningEnabled),userPanningEnabled:u(!0,s.userPanningEnabled),boxSelectionEnabled:u(!0,s.boxSelectionEnabled),autolock:u(!1,s.autolock,s.autolockNodes),autoungrabify:u(!1,s.autoungrabify,s.autoungrabifyNodes),autounselectify:u(!1,s.autounselectify),styleEnabled:s.styleEnabled===void 0?o:s.styleEnabled,zoom:Te(s.zoom)?s.zoom:1,pan:{x:Ye(s.pan)&&Te(s.pan.x)?s.pan.x:0,y:Ye(s.pan)&&Te(s.pan.y)?s.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:u(250,s.multiClickDebounceTime)};this.createEmitter(),this.selectionType(s.selectionType),this.zoomRange({min:s.minZoom,max:s.maxZoom});var f=function(d,g){var p=d.some(Cx);if(p)return Ra.all(d).then(g);g(d)};l.styleEnabled&&r.setStyle([]);var h=Be({},s,s.renderer);r.initRenderer(h);var v=function(d,g,p){r.notifications(!1);var y=r.mutableElements();y.length>0&&y.remove(),d!=null&&(Ye(d)||je(d))&&r.add(d),r.one("layoutready",function(m){r.notifications(!0),r.emit(m),r.one("load",g),r.emitAndNotify("load")}).one("layoutstop",function(){r.one("done",p),r.emit("done")});var b=Be({},r._private.options.layout);b.eles=r.elements(),r.layout(b).run()};f([s.style,s.elements],function(c){var d=c[0],g=c[1];l.styleEnabled&&r.style().append(d),v(g,function(){r.startAnimationLoop(),l.ready=!0,ot(s.ready)&&r.on("ready",s.ready);for(var p=0;p<i.length;p++){var y=i[p];r.on("ready",y)}n&&(n.readies=[]),r.emit("ready")},s.done)})},Ei=cn.prototype;Be(Ei,{instanceString:function(){return"core"},isReady:function(){return this._private.ready},destroyed:function(){return this._private.destroyed},ready:function(e){return this.isReady()?this.emitter().emit("ready",[],e):this.on("ready",e),this},destroy:function(){var e=this;if(!e.destroyed())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 yt;var r=this._private.container.ownerDocument;return r===void 0||r==null?yt:r.defaultView||yt},mount:function(e){if(e!=null){var r=this,a=r._private,n=a.options;return!vi(e)&&vi(e[0])&&(e=e[0]),r.stopAnimationLoop(),r.destroyRenderer(),a.container=e,a.styleEnabled=!0,r.invalidateSize(),r.initRenderer(Be({},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 ar(this._private.options)},json:function(e){var r=this,a=r._private,n=r.mutableElements(),i=function(E){return r.getElementById(E.id())};if(Ye(e)){if(r.startBatch(),e.elements){var o={},s=function(E,T){for(var L=[],w=[],C=0;C<E.length;C++){var A=E[C];if(!A.data.id){Ze("cy.json() cannot handle elements without an ID attribute");continue}var R=""+A.data.id,S=r.getElementById(R);o[R]=!0,S.length!==0?w.push({ele:S,json:A}):(T&&(A.group=T),L.push(A))}r.add(L);for(var D=0;D<w.length;D++){var P=w[D],x=P.ele,N=P.json;x.json(N)}};if(je(e.elements))s(e.elements);else for(var u=["nodes","edges"],l=0;l<u.length;l++){var f=u[l],h=e.elements[f];je(h)&&s(h,f)}var v=r.collection();n.filter(function(m){return!o[m.id()]}).forEach(function(m){m.isParent()?v.merge(m):m.remove()}),v.forEach(function(m){return m.children().move({parent:null})}),v.forEach(function(m){return i(m).remove()})}e.style&&r.style(e.style),e.zoom!=null&&e.zoom!==a.zoom&&r.zoom(e.zoom),e.pan&&(e.pan.x!==a.pan.x||e.pan.y!==a.pan.y)&&r.pan(e.pan),e.data&&r.data(e.data);for(var c=["minZoom","maxZoom","zoomingEnabled","userZoomingEnabled","panningEnabled","userPanningEnabled","boxSelectionEnabled","autolock","autoungrabify","autounselectify","multiClickDebounceTime"],d=0;d<c.length;d++){var g=c[d];e[g]!=null&&r[g](e[g])}return r.endBatch(),this}else{var p=!!e,y={};p?y.elements=this.elements().map(function(m){return m.json()}):(y.elements={},n.forEach(function(m){var E=m.group();y.elements[E]||(y.elements[E]=[]),y.elements[E].push(m.json())})),this._private.styleEnabled&&(y.style=r.style().json()),y.data=ar(r.data());var b=a.options;return y.zoomingEnabled=a.zoomingEnabled,y.userZoomingEnabled=a.userZoomingEnabled,y.zoom=a.zoom,y.minZoom=a.minZoom,y.maxZoom=a.maxZoom,y.panningEnabled=a.panningEnabled,y.userPanningEnabled=a.userPanningEnabled,y.pan=ar(a.pan),y.boxSelectionEnabled=a.boxSelectionEnabled,y.renderer=ar(b.renderer),y.hideEdgesOnViewport=b.hideEdgesOnViewport,y.textureOnViewport=b.textureOnViewport,y.wheelSensitivity=b.wheelSensitivity,y.motionBlur=b.motionBlur,y.multiClickDebounceTime=b.multiClickDebounceTime,y}}});Ei.$id=Ei.getElementById;[CR,DR,Ew,vv,ei,MR,dv,ti,PR,Jr,hn].forEach(function(t){Be(Ei,t)});var _R={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}},BR={maximal:!1,acyclic:!1},la=function(e){return e.scratch("breadthfirst")},gp=function(e,r){return e.scratch("breadthfirst",r)};function ww(t){this.options=Be({},_R,BR,t)}ww.prototype.run=function(){var t=this.options,e=t.cy,r=t.eles,a=r.nodes().filter(function(he){return he.isChildless()}),n=r,i=t.directed,o=t.acyclic||t.maximal||t.maximalAdjustments>0,s=!!t.boundingBox,u=Pt(s?t.boundingBox:structuredClone(e.extent())),l;if(Ut(t.roots))l=t.roots;else if(je(t.roots)){for(var f=[],h=0;h<t.roots.length;h++){var v=t.roots[h],c=e.getElementById(v);f.push(c)}l=e.collection(f)}else if(Me(t.roots))l=e.$(t.roots);else if(i)l=a.roots();else{var d=r.components();l=e.collection();for(var g=function(){var le=d[p],de=le.maxDegree(!1),pe=le.filter(function(ce){return ce.degree(!1)===de});l=l.add(pe)},p=0;p<d.length;p++)g()}var y=[],b={},m=function(le,de){y[de]==null&&(y[de]=[]);var pe=y[de].length;y[de].push(le),gp(le,{index:pe,depth:de})},E=function(le,de){var pe=la(le),ce=pe.depth,ye=pe.index;y[ce][ye]=null,le.isChildless()&&m(le,de)};n.bfs({roots:l,directed:t.directed,visit:function(le,de,pe,ce,ye){var Le=le[0],_e=Le.id();Le.isChildless()&&m(Le,ye),b[_e]=!0}});for(var T=[],L=0;L<a.length;L++){var w=a[L];b[w.id()]||T.push(w)}var C=function(le){for(var de=y[le],pe=0;pe<de.length;pe++){var ce=de[pe];if(ce==null){de.splice(pe,1),pe--;continue}gp(ce,{depth:le,index:pe})}},A=function(le,de){for(var pe=la(le),ce=le.incomers().filter(function(Re){return Re.isNode()&&r.has(Re)}),ye=-1,Le=le.id(),_e=0;_e<ce.length;_e++){var ke=ce[_e],Oe=la(ke);ye=Math.max(ye,Oe.depth)}if(pe.depth<=ye){if(!t.acyclic&&de[Le])return null;var Fe=ye+1;return E(le,Fe),de[Le]=Fe,!0}return!1};if(i&&o){var R=[],S={},D=function(le){return R.push(le)},P=function(){return R.shift()};for(a.forEach(function(he){return R.push(he)});R.length>0;){var x=P(),N=A(x,S);if(N)x.outgoers().filter(function(he){return he.isNode()&&r.has(he)}).forEach(D);else if(N===null){Ze("Detected double maximal shift for node `"+x.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}var M=0;if(t.avoidOverlap)for(var I=0;I<a.length;I++){var O=a[I],q=O.layoutDimensions(t),_=q.w,B=q.h;M=Math.max(M,_,B)}var z={},Y=function(le){if(z[le.id()])return z[le.id()];for(var de=la(le).depth,pe=le.neighborhood(),ce=0,ye=0,Le=0;Le<pe.length;Le++){var _e=pe[Le];if(!(_e.isEdge()||_e.isParent()||!a.has(_e))){var ke=la(_e);if(ke!=null){var Oe=ke.index,Fe=ke.depth;if(!(Oe==null||Fe==null)){var Re=y[Fe].length;Fe<de&&(ce+=Oe/Re,ye++)}}}}return ye=Math.max(1,ye),ce=ce/ye,ye===0&&(ce=0),z[le.id()]=ce,ce},k=function(le,de){var pe=Y(le),ce=Y(de),ye=pe-ce;return ye===0?TE(le.id(),de.id()):ye};t.depthSort!==void 0&&(k=t.depthSort);for(var G=y.length,U=0;U<G;U++)y[U].sort(k),C(U);for(var W=[],j=0;j<T.length;j++)W.push(T[j]);var H=function(){for(var le=0;le<G;le++)C(le)};W.length&&(y.unshift(W),G=y.length,H());for(var V=0,X=0;X<G;X++)V=Math.max(y[X].length,V);var Z={x:u.x1+u.w/2,y:u.y1+u.h/2},ee=a.reduce(function(he,le){return(function(de){return{w:he.w===-1?de.w:(he.w+de.w)/2,h:he.h===-1?de.h:(he.h+de.h)/2}})(le.boundingBox({includeLabels:t.nodeDimensionsIncludeLabels}))},{w:-1,h:-1}),re=Math.max(G===1?0:s?(u.h-t.padding*2-ee.h)/(G-1):(u.h-t.padding*2-ee.h)/(G+1),M),ue=y.reduce(function(he,le){return Math.max(he,le.length)},0),xe=function(le){var de=la(le),pe=de.depth,ce=de.index;if(t.circle){var ye=Math.min(u.w/2/G,u.h/2/G);ye=Math.max(ye,M);var Le=ye*pe+ye-(G>0&&y[0].length<=3?ye/2:0),_e=2*Math.PI/y[pe].length*ce;return pe===0&&y[0].length===1&&(Le=1),{x:Z.x+Le*Math.cos(_e),y:Z.y+Le*Math.sin(_e)}}else{var ke=y[pe].length,Oe=Math.max(ke===1?0:s?(u.w-t.padding*2-ee.w)/((t.grid?ue:ke)-1):(u.w-t.padding*2-ee.w)/((t.grid?ue:ke)+1),M),Fe={x:Z.x+(ce+1-(ke+1)/2)*Oe,y:Z.y+(pe+1-(G+1)/2)*re};return Fe}},se={downward:0,leftward:90,upward:180,rightward:-90};Object.keys(se).indexOf(t.direction)===-1&&at("Invalid direction '".concat(t.direction,"' specified for breadthfirst layout. Valid values are: ").concat(Object.keys(se).join(", ")));var oe=function(le){return jx(xe(le),u,se[t.direction])};return r.nodes().layoutPositions(this,t,oe),this};var kR={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,radius:void 0,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function Tw(t){this.options=Be({},kR,t)}Tw.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");e.sort&&(i=i.sort(e.sort));for(var o=Pt(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),s={x:o.x1+o.w/2,y:o.y1+o.h/2},u=e.sweep===void 0?2*Math.PI-2*Math.PI/i.length:e.sweep,l=u/Math.max(1,i.length-1),f,h=0,v=0;v<i.length;v++){var c=i[v],d=c.layoutDimensions(e),g=d.w,p=d.h;h=Math.max(h,g,p)}if(Te(e.radius)?f=e.radius:i.length<=1?f=0:f=Math.min(o.h,o.w)/2-h,i.length>1&&e.avoidOverlap){h*=1.75;var y=Math.cos(l)-Math.cos(0),b=Math.sin(l)-Math.sin(0),m=Math.sqrt(h*h/(y*y+b*b));f=Math.max(m,f)}var E=function(L,w){var C=e.startAngle+w*l*(n?1:-1),A=f*Math.cos(C),R=f*Math.sin(C),S={x:s.x+A,y:s.y+R};return S};return a.nodes().layoutPositions(this,e,E),this};var qR={fit:!0,padding:30,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,equidistant:!1,minNodeSpacing:10,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,height:void 0,width:void 0,spacingFactor:void 0,concentric:function(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 xw(t){this.options=Be({},qR,t)}xw.prototype.run=function(){for(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"),o=Pt(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:a.width(),h:a.height()}),s={x:o.x1+o.w/2,y:o.y1+o.h/2},u=[],l=0,f=0;f<i.length;f++){var h=i[f],v=void 0;v=e.concentric(h),u.push({value:v,node:h}),h._private.scratch.concentric=v}i.updateStyle();for(var c=0;c<i.length;c++){var d=i[c],g=d.layoutDimensions(e);l=Math.max(l,g.w,g.h)}u.sort(function(re,ue){return ue.value-re.value});for(var p=e.levelWidth(i),y=[[]],b=y[0],m=0;m<u.length;m++){var E=u[m];if(b.length>0){var T=Math.abs(b[0].value-E.value);T>=p&&(b=[],y.push(b))}b.push(E)}var L=l+e.minNodeSpacing;if(!e.avoidOverlap){var w=y.length>0&&y[0].length>1,C=Math.min(o.w,o.h)/2-L,A=C/(y.length+w?1:0);L=Math.min(L,A)}for(var R=0,S=0;S<y.length;S++){var D=y[S],P=e.sweep===void 0?2*Math.PI-2*Math.PI/D.length:e.sweep,x=D.dTheta=P/Math.max(1,D.length-1);if(D.length>1&&e.avoidOverlap){var N=Math.cos(x)-Math.cos(0),M=Math.sin(x)-Math.sin(0),I=Math.sqrt(L*L/(N*N+M*M));R=Math.max(I,R)}D.r=R,R+=L}if(e.equidistant){for(var O=0,q=0,_=0;_<y.length;_++){var B=y[_],z=B.r-q;O=Math.max(O,z)}q=0;for(var Y=0;Y<y.length;Y++){var k=y[Y];Y===0&&(q=k.r),k.r=q,q+=O}}for(var G={},U=0;U<y.length;U++)for(var W=y[U],j=W.dTheta,H=W.r,V=0;V<W.length;V++){var X=W[V],Z=e.startAngle+(r?1:-1)*j*V,ee={x:s.x+H*Math.cos(Z),y:s.y+H*Math.sin(Z)};G[X.node.id()]=ee}return n.nodes().layoutPositions(this,e,function(re){var ue=re.id();return G[ue]}),this};var Ms,GR={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:1e3,initialTemp:1e3,coolingFactor:.99,minTemp:1};function zi(t){this.options=Be({},GR,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"),o=n.target().data("id"),s=e.some(function(l){return l.data("id")===i}),u=e.some(function(l){return l.data("id")===o});return!s||!u});this.options.eles=this.options.eles.not(a)}zi.prototype.run=function(){var t=this.options,e=t.cy,r=this;r.stopped=!1,(t.animate===!0||t.animate===!1)&&r.emit({type:"layoutstart",layout:r}),t.debug===!0?Ms=!0:Ms=!1;var a=UR(e,r,t);Ms&&VR(a),t.randomize&&YR(a);var n=cr(),i=function(){HR(a,e,t),t.fit===!0&&e.fit(t.padding)},o=function(v){return!(r.stopped||v>=t.numIter||(XR(a,t),a.temperature=a.temperature*t.coolingFactor,a.temperature<t.minTemp))},s=function(){if(t.animate===!0||t.animate===!1)i(),r.one("layoutstop",t.stop),r.emit({type:"layoutstop",layout:r});else{var v=t.eles.nodes(),c=Aw(a,t,v);v.layoutPositions(r,t,c)}},u=0,l=!0;if(t.animate===!0){var f=function(){for(var v=0;l&&v<t.refresh;)l=o(u),u++,v++;if(!l)yp(a,t),s();else{var c=cr();c-n>=t.animationThreshold&&i(),di(f)}};f()}else{for(;l;)l=o(u),u++;yp(a,t),s()}return this};zi.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this};zi.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var UR=function(e,r,a){for(var n=a.eles.edges(),i=a.eles.nodes(),o=Pt(a.boundingBox?a.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),s={isCompound:e.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:i.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:n.size(),temperature:a.initialTemp,clientWidth:o.w,clientHeight:o.h,boundingBox:o},u=a.eles.components(),l={},f=0;f<u.length;f++)for(var h=u[f],v=0;v<h.length;v++){var c=h[v];l[c.id()]=f}for(var f=0;f<s.nodeSize;f++){var d=i[f],g=d.layoutDimensions(a),p={};p.isLocked=d.locked(),p.id=d.data("id"),p.parentId=d.data("parent"),p.cmptId=l[d.id()],p.children=[],p.positionX=d.position("x"),p.positionY=d.position("y"),p.offsetX=0,p.offsetY=0,p.height=g.w,p.width=g.h,p.maxX=p.positionX+p.width/2,p.minX=p.positionX-p.width/2,p.maxY=p.positionY+p.height/2,p.minY=p.positionY-p.height/2,p.padLeft=parseFloat(d.style("padding")),p.padRight=parseFloat(d.style("padding")),p.padTop=parseFloat(d.style("padding")),p.padBottom=parseFloat(d.style("padding")),p.nodeRepulsion=ot(a.nodeRepulsion)?a.nodeRepulsion(d):a.nodeRepulsion,s.layoutNodes.push(p),s.idToIndex[p.id]=f}for(var y=[],b=0,m=-1,E=[],f=0;f<s.nodeSize;f++){var d=s.layoutNodes[f],T=d.parentId;T!=null?s.layoutNodes[s.idToIndex[T]].children.push(d.id):(y[++m]=d.id,E.push(d.id))}for(s.graphSet.push(E);b<=m;){var L=y[b++],w=s.idToIndex[L],c=s.layoutNodes[w],C=c.children;if(C.length>0){s.graphSet.push(C);for(var f=0;f<C.length;f++)y[++m]=C[f]}}for(var f=0;f<s.graphSet.length;f++)for(var A=s.graphSet[f],v=0;v<A.length;v++){var R=s.idToIndex[A[v]];s.indexToGraph[R]=f}for(var f=0;f<s.edgeSize;f++){var S=n[f],D={};D.id=S.data("id"),D.sourceId=S.data("source"),D.targetId=S.data("target");var P=ot(a.idealEdgeLength)?a.idealEdgeLength(S):a.idealEdgeLength,x=ot(a.edgeElasticity)?a.edgeElasticity(S):a.edgeElasticity,N=s.idToIndex[D.sourceId],M=s.idToIndex[D.targetId],I=s.indexToGraph[N],O=s.indexToGraph[M];if(I!=O){for(var q=zR(D.sourceId,D.targetId,s),_=s.graphSet[q],B=0,p=s.layoutNodes[N];_.indexOf(p.id)===-1;)p=s.layoutNodes[s.idToIndex[p.parentId]],B++;for(p=s.layoutNodes[M];_.indexOf(p.id)===-1;)p=s.layoutNodes[s.idToIndex[p.parentId]],B++;P*=B*a.nestingFactor}D.idealLength=P,D.elasticity=x,s.layoutEdges.push(D)}return s},zR=function(e,r,a){var n=Cw(e,r,0,a);return 2>n.count?0:n.graph},Cw=function(e,r,a,n){var i=n.graphSet[a];if(-1<i.indexOf(e)&&-1<i.indexOf(r))return{count:2,graph:a};for(var o=0,s=0;s<i.length;s++){var u=i[s],l=n.idToIndex[u],f=n.layoutNodes[l].children;if(f.length!==0){var h=n.indexToGraph[n.idToIndex[f[0]]],v=Cw(e,r,h,n);if(v.count!==0)if(v.count===1){if(o++,o===2)break}else return v}}return{count:o,graph:a}},VR,YR=function(e,r){for(var a=e.clientWidth,n=e.clientHeight,i=0;i<e.nodeSize;i++){var o=e.layoutNodes[i];o.children.length===0&&!o.isLocked&&(o.positionX=Math.random()*a,o.positionY=Math.random()*n)}},Aw=function(e,r,a){var n=e.boundingBox,i={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0};return r.boundingBox&&(a.forEach(function(o){var s=e.layoutNodes[e.idToIndex[o.data("id")]];i.x1=Math.min(i.x1,s.positionX),i.x2=Math.max(i.x2,s.positionX),i.y1=Math.min(i.y1,s.positionY),i.y2=Math.max(i.y2,s.positionY)}),i.w=i.x2-i.x1,i.h=i.y2-i.y1),function(o,s){var u=e.layoutNodes[e.idToIndex[o.data("id")]];if(r.boundingBox){var l=i.w===0?.5:(u.positionX-i.x1)/i.w,f=i.h===0?.5:(u.positionY-i.y1)/i.h;return{x:n.x1+l*n.w,y:n.y1+f*n.h}}else return{x:u.positionX,y:u.positionY}}},HR=function(e,r,a){var n=a.layout,i=a.eles.nodes(),o=Aw(e,a,i);i.positions(o),e.ready!==!0&&(e.ready=!0,n.one("layoutready",a.ready),n.emit({type:"layoutready",layout:this}))},XR=function(e,r,a){$R(e,r),ZR(e),QR(e,r),JR(e),jR(e)},$R=function(e,r){for(var a=0;a<e.graphSet.length;a++)for(var n=e.graphSet[a],i=n.length,o=0;o<i;o++)for(var s=e.layoutNodes[e.idToIndex[n[o]]],u=o+1;u<i;u++){var l=e.layoutNodes[e.idToIndex[n[u]]];WR(s,l,e,r)}},pp=function(e){return-1+2*e*Math.random()},WR=function(e,r,a,n){var i=e.cmptId,o=r.cmptId;if(!(i!==o&&!a.isCompound)){var s=r.positionX-e.positionX,u=r.positionY-e.positionY,l=1;s===0&&u===0&&(s=pp(l),u=pp(l));var f=KR(e,r,s,u);if(f>0)var h=n.nodeOverlap*f,v=Math.sqrt(s*s+u*u),c=h*s/v,d=h*u/v;else var g=wi(e,s,u),p=wi(r,-1*s,-1*u),y=p.x-g.x,b=p.y-g.y,m=y*y+b*b,v=Math.sqrt(m),h=(e.nodeRepulsion+r.nodeRepulsion)/m,c=h*y/v,d=h*b/v;e.isLocked||(e.offsetX-=c,e.offsetY-=d),r.isLocked||(r.offsetX+=c,r.offsetY+=d)}},KR=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 o=e.maxY-r.minY;else var o=r.maxY-e.minY;return i>=0&&o>=0?Math.sqrt(i*i+o*o):0},wi=function(e,r,a){var n=e.positionX,i=e.positionY,o=e.height||1,s=e.width||1,u=a/r,l=o/s,f={};return r===0&&0<a||r===0&&0>a?(f.x=n,f.y=i+o/2,f):0<r&&-1*l<=u&&u<=l?(f.x=n+s/2,f.y=i+s*a/2/r,f):0>r&&-1*l<=u&&u<=l?(f.x=n-s/2,f.y=i-s*a/2/r,f):0<a&&(u<=-1*l||u>=l)?(f.x=n+o*r/2/a,f.y=i+o/2,f):(0>a&&(u<=-1*l||u>=l)&&(f.x=n-o*r/2/a,f.y=i-o/2),f)},ZR=function(e,r){for(var a=0;a<e.edgeSize;a++){var n=e.layoutEdges[a],i=e.idToIndex[n.sourceId],o=e.layoutNodes[i],s=e.idToIndex[n.targetId],u=e.layoutNodes[s],l=u.positionX-o.positionX,f=u.positionY-o.positionY;if(!(l===0&&f===0)){var h=wi(o,l,f),v=wi(u,-1*l,-1*f),c=v.x-h.x,d=v.y-h.y,g=Math.sqrt(c*c+d*d),p=Math.pow(n.idealLength-g,2)/n.elasticity;if(g!==0)var y=p*c/g,b=p*d/g;else var y=0,b=0;o.isLocked||(o.offsetX+=y,o.offsetY+=b),u.isLocked||(u.offsetX-=y,u.offsetY-=b)}}},QR=function(e,r){if(r.gravity!==0)for(var a=1,n=0;n<e.graphSet.length;n++){var i=e.graphSet[n],o=i.length;if(n===0)var s=e.clientHeight/2,u=e.clientWidth/2;else var l=e.layoutNodes[e.idToIndex[i[0]]],f=e.layoutNodes[e.idToIndex[l.parentId]],s=f.positionX,u=f.positionY;for(var h=0;h<o;h++){var v=e.layoutNodes[e.idToIndex[i[h]]];if(!v.isLocked){var c=s-v.positionX,d=u-v.positionY,g=Math.sqrt(c*c+d*d);if(g>a){var p=r.gravity*c/g,y=r.gravity*d/g;v.offsetX+=p,v.offsetY+=y}}}}},JR=function(e,r){var a=[],n=0,i=-1;for(a.push.apply(a,e.graphSet[0]),i+=e.graphSet[0].length;n<=i;){var o=a[n++],s=e.idToIndex[o],u=e.layoutNodes[s],l=u.children;if(0<l.length&&!u.isLocked){for(var f=u.offsetX,h=u.offsetY,v=0;v<l.length;v++){var c=e.layoutNodes[e.idToIndex[l[v]]];c.offsetX+=f,c.offsetY+=h,a[++i]=l[v]}u.offsetX=0,u.offsetY=0}}},jR=function(e,r){for(var a=0;a<e.nodeSize;a++){var n=e.layoutNodes[a];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)){var i=eS(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,Lw(n,e)}}for(var a=0;a<e.nodeSize;a++){var n=e.layoutNodes[a];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)}},eS=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},Lw=function(e,r){var a=e.parentId;if(a!=null){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),(n.minX==null||e.minX-n.padLeft<n.minX)&&(n.minX=e.minX-n.padLeft,i=!0),(n.maxY==null||e.maxY+n.padBottom>n.maxY)&&(n.maxY=e.maxY+n.padBottom,i=!0),(n.minY==null||e.minY-n.padTop<n.minY)&&(n.minY=e.minY-n.padTop,i=!0),i)return Lw(n,r)}},yp=function(e,r){for(var a=e.layoutNodes,n=[],i=0;i<a.length;i++){var o=a[i],s=o.cmptId,u=n[s]=n[s]||[];u.push(o)}for(var l=0,i=0;i<n.length;i++){var f=n[i];if(f){f.x1=1/0,f.x2=-1/0,f.y1=1/0,f.y2=-1/0;for(var h=0;h<f.length;h++){var v=f[h];f.x1=Math.min(f.x1,v.positionX-v.width/2),f.x2=Math.max(f.x2,v.positionX+v.width/2),f.y1=Math.min(f.y1,v.positionY-v.height/2),f.y2=Math.max(f.y2,v.positionY+v.height/2)}f.w=f.x2-f.x1,f.h=f.y2-f.y1,l+=f.w*f.h}}n.sort(function(b,m){return m.w*m.h-b.w*b.h});for(var c=0,d=0,g=0,p=0,y=Math.sqrt(l)*e.clientWidth/e.clientHeight,i=0;i<n.length;i++){var f=n[i];if(f){for(var h=0;h<f.length;h++){var v=f[h];v.isLocked||(v.positionX+=c-f.x1,v.positionY+=d-f.y1)}c+=f.w+r.componentSpacing,g+=f.w+r.componentSpacing,p=Math.max(p,f.h),g>y&&(d+=p+r.componentSpacing,c=0,g=0,p=0)}}},tS={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 Rw(t){this.options=Be({},tS,t)}Rw.prototype.run=function(){var t=this.options,e=t,r=t.cy,a=e.eles,n=a.nodes().not(":parent");e.sort&&(n=n.sort(e.sort));var i=Pt(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(Y){return{x:i.x1,y:i.y1}});else{var o=n.size(),s=Math.sqrt(o*i.h/i.w),u=Math.round(s),l=Math.round(i.w/i.h*s),f=function(k){if(k==null)return Math.min(u,l);var G=Math.min(u,l);G==u?u=k:l=k},h=function(k){if(k==null)return Math.max(u,l);var G=Math.max(u,l);G==u?u=k:l=k},v=e.rows,c=e.cols!=null?e.cols:e.columns;if(v!=null&&c!=null)u=v,l=c;else if(v!=null&&c==null)u=v,l=Math.ceil(o/u);else if(v==null&&c!=null)l=c,u=Math.ceil(o/l);else if(l*u>o){var d=f(),g=h();(d-1)*g>=o?f(d-1):(g-1)*d>=o&&h(g-1)}else for(;l*u<o;){var p=f(),y=h();(y+1)*p>=o?h(y+1):f(p+1)}var b=i.w/l,m=i.h/u;if(e.condense&&(b=0,m=0),e.avoidOverlap)for(var E=0;E<n.length;E++){var T=n[E],L=T._private.position;(L.x==null||L.y==null)&&(L.x=0,L.y=0);var w=T.layoutDimensions(e),C=e.avoidOverlapPadding,A=w.w+C,R=w.h+C;b=Math.max(b,A),m=Math.max(m,R)}for(var S={},D=function(k,G){return!!S["c-"+k+"-"+G]},P=function(k,G){S["c-"+k+"-"+G]=!0},x=0,N=0,M=function(){N++,N>=l&&(N=0,x++)},I={},O=0;O<n.length;O++){var q=n[O],_=e.position(q);if(_&&(_.row!==void 0||_.col!==void 0)){var B={row:_.row,col:_.col};if(B.col===void 0)for(B.col=0;D(B.row,B.col);)B.col++;else if(B.row===void 0)for(B.row=0;D(B.row,B.col);)B.row++;I[q.id()]=B,P(B.row,B.col)}}var z=function(k,G){var U,W;if(k.locked()||k.isParent())return!1;var j=I[k.id()];if(j)U=j.col*b+b/2+i.x1,W=j.row*m+m/2+i.y1;else{for(;D(x,N);)M();U=N*b+b/2+i.x1,W=x*m+m/2+i.y1,P(x,N),M()}return{x:U,y:W}};n.layoutPositions(this,e,z)}return this};var rS={ready:function(){},stop:function(){}};function Yv(t){this.options=Be({},rS,t)}Yv.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};Yv.prototype.stop=function(){return this};var aS={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 Sw(t){this.options=Be({},aS,t)}Sw.prototype.run=function(){var t=this.options,e=t.eles,r=e.nodes(),a=ot(t.positions);function n(i){if(t.positions==null)return AC(i.position());if(a)return t.positions(i);var o=t.positions[i._private.data.id];return o??null}return r.layoutPositions(this,t,function(i,o){var s=n(i);return i.locked()||s==null?!1:s}),this};var nS={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 Dw(t){this.options=Be({},nS,t)}Dw.prototype.run=function(){var t=this.options,e=t.cy,r=t.eles,a=Pt(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),n=function(o,s){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 iS=[{name:"breadthfirst",impl:ww},{name:"circle",impl:Tw},{name:"concentric",impl:xw},{name:"cose",impl:zi},{name:"grid",impl:Rw},{name:"null",impl:Yv},{name:"preset",impl:Sw},{name:"random",impl:Dw}];function Nw(t){this.options=t,this.notifications=0}var mp=function(){},bp=function(){throw new Error("A headless instance can not render images")};Nw.prototype={recalculateRenderedStyle:mp,notify:function(){this.notifications++},init:mp,isHeadless:function(){return!0},png:bp,jpg:bp};var Hv={};Hv.arrowShapeWidth=.3;Hv.registerArrowShapes=function(){var t=this.arrowShapes={},e=this,r=function(l,f,h,v,c,d,g){var p=c.x-h/2-g,y=c.x+h/2+g,b=c.y-h/2-g,m=c.y+h/2+g,E=p<=l&&l<=y&&b<=f&&f<=m;return E},a=function(l,f,h,v,c){var d=l*Math.cos(v)-f*Math.sin(v),g=l*Math.sin(v)+f*Math.cos(v),p=d*h,y=g*h,b=p+c.x,m=y+c.y;return{x:b,y:m}},n=function(l,f,h,v){for(var c=[],d=0;d<l.length;d+=2){var g=l[d],p=l[d+1];c.push(a(g,p,f,h,v))}return c},i=function(l){for(var f=[],h=0;h<l.length;h++){var v=l[h];f.push(v.x,v.y)}return f},o=function(l){return l.pstyle("width").pfValue*l.pstyle("arrow-scale").pfValue*2},s=function(l,f){Me(f)&&(f=t[f]),t[l]=Be({name:l,points:[-.15,-.3,.15,-.3,.15,.3,-.15,.3],collide:function(v,c,d,g,p,y){var b=i(n(this.points,d+2*y,g,p)),m=Bt(v,c,b);return m},roughCollide:r,draw:function(v,c,d,g){var p=n(this.points,c,d,g);e.arrowShapeImpl("polygon")(v,p)},spacing:function(v){return 0},gap:o},f)};s("none",{collide:gi,roughCollide:gi,draw:Nv,spacing:Id,gap:Id}),s("triangle",{points:[-.15,-.3,0,0,.15,-.3]}),s("arrow","triangle"),s("triangle-backcurve",{points:t.triangle.points,controlPoint:[0,-.15],roughCollide:r,draw:function(l,f,h,v,c){var d=n(this.points,f,h,v),g=this.controlPoint,p=a(g[0],g[1],f,h,v);e.arrowShapeImpl(this.name)(l,d,p)},gap:function(l){return o(l)*.8}}),s("triangle-tee",{points:[0,0,.15,-.3,-.15,-.3,0,0],pointsTee:[-.15,-.4,-.15,-.5,.15,-.5,.15,-.4],collide:function(l,f,h,v,c,d,g){var p=i(n(this.points,h+2*g,v,c)),y=i(n(this.pointsTee,h+2*g,v,c)),b=Bt(l,f,p)||Bt(l,f,y);return b},draw:function(l,f,h,v,c){var d=n(this.points,f,h,v),g=n(this.pointsTee,f,h,v);e.arrowShapeImpl(this.name)(l,d,g)}}),s("circle-triangle",{radius:.15,pointsTr:[0,-.15,.15,-.45,-.15,-.45,0,-.15],collide:function(l,f,h,v,c,d,g){var p=c,y=Math.pow(p.x-l,2)+Math.pow(p.y-f,2)<=Math.pow((h+2*g)*this.radius,2),b=i(n(this.points,h+2*g,v,c));return Bt(l,f,b)||y},draw:function(l,f,h,v,c){var d=n(this.pointsTr,f,h,v);e.arrowShapeImpl(this.name)(l,d,v.x,v.y,this.radius*f)},spacing:function(l){return e.getArrowWidth(l.pstyle("width").pfValue,l.pstyle("arrow-scale").value)*this.radius}}),s("triangle-cross",{points:[0,0,.15,-.3,-.15,-.3,0,0],baseCrossLinePts:[-.15,-.4,-.15,-.4,.15,-.4,.15,-.4],crossLinePts:function(l,f){var h=this.baseCrossLinePts.slice(),v=f/l,c=3,d=5;return h[c]=h[c]-v,h[d]=h[d]-v,h},collide:function(l,f,h,v,c,d,g){var p=i(n(this.points,h+2*g,v,c)),y=i(n(this.crossLinePts(h,d),h+2*g,v,c)),b=Bt(l,f,p)||Bt(l,f,y);return b},draw:function(l,f,h,v,c){var d=n(this.points,f,h,v),g=n(this.crossLinePts(f,c),f,h,v);e.arrowShapeImpl(this.name)(l,d,g)}}),s("vee",{points:[-.15,-.3,0,0,.15,-.3,0,-.15],gap:function(l){return o(l)*.525}}),s("circle",{radius:.15,collide:function(l,f,h,v,c,d,g){var p=c,y=Math.pow(p.x-l,2)+Math.pow(p.y-f,2)<=Math.pow((h+2*g)*this.radius,2);return y},draw:function(l,f,h,v,c){e.arrowShapeImpl(this.name)(l,v.x,v.y,this.radius*f)},spacing:function(l){return e.getArrowWidth(l.pstyle("width").pfValue,l.pstyle("arrow-scale").value)*this.radius}}),s("tee",{points:[-.15,0,-.15,-.1,.15,-.1,.15,0],spacing:function(l){return 1},gap:function(l){return 1}}),s("square",{points:[-.15,0,.15,0,.15,-.3,-.15,-.3]}),s("diamond",{points:[-.15,-.15,0,-.3,.15,-.15,0,0],gap:function(l){return l.pstyle("width").pfValue*l.pstyle("arrow-scale").value}}),s("chevron",{points:[0,0,-.15,-.15,-.1,-.2,0,-.1,.1,-.2,.15,-.15],gap:function(l){return .95*l.pstyle("width").pfValue*l.pstyle("arrow-scale").value}})};var ea={};ea.projectIntoViewport=function(t,e){var r=this.cy,a=this.findContainerClientCoords(),n=a[0],i=a[1],o=a[4],s=r.pan(),u=r.zoom(),l=((t-n)/o-s.x)/u,f=((e-i)/o-s.y)/u;return[l,f]};ea.findContainerClientCoords=function(){if(this.containerBB)return this.containerBB;var t=this.container,e=t.getBoundingClientRect(),r=this.cy.window().getComputedStyle(t),a=function(y){return parseFloat(r.getPropertyValue(y))},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")},o=t.clientWidth,s=t.clientHeight,u=n.left+n.right,l=n.top+n.bottom,f=i.left+i.right,h=e.width/(o+f),v=o-u,c=s-l,d=e.left+n.left+i.left,g=e.top+n.top+i.top;return this.containerBB=[d,g,v,c,h]};ea.invalidateContainerClientCoordsCache=function(){this.containerBB=null};ea.findNearestElement=function(t,e,r,a){return this.findNearestElements(t,e,r,a)[0]};ea.findNearestElements=function(t,e,r,a){var n=this,i=this,o=i.getCachedZSortedEles(),s=[],u=i.cy.zoom(),l=i.cy.hasCompoundNodes(),f=(a?24:8)/u,h=(a?8:2)/u,v=(a?8:2)/u,c=1/0,d,g;r&&(o=o.interactive);function p(w,C){if(w.isNode()){if(g)return;g=w,s.push(w)}if(w.isEdge()&&(C==null||C<c))if(d){if(d.pstyle("z-compound-depth").value===w.pstyle("z-compound-depth").value&&d.pstyle("z-compound-depth").value===w.pstyle("z-compound-depth").value){for(var A=0;A<s.length;A++)if(s[A].isEdge()){s[A]=w,d=w,c=C??c;break}}}else s.push(w),d=w,c=C??c}function y(w){var C=w.outerWidth()+2*h,A=w.outerHeight()+2*h,R=C/2,S=A/2,D=w.position(),P=w.pstyle("corner-radius").value==="auto"?"auto":w.pstyle("corner-radius").pfValue,x=w._private.rscratch;if(D.x-R<=t&&t<=D.x+R&&D.y-S<=e&&e<=D.y+S){var N=i.nodeShapes[n.getNodeShape(w)];if(N.checkPoint(t,e,0,C,A,D.x,D.y,P,x))return p(w,0),!0}}function b(w){var C=w._private,A=C.rscratch,R=w.pstyle("width").pfValue,S=w.pstyle("arrow-scale").value,D=R/2+f,P=D*D,x=D*2,O=C.source,q=C.target,N;if(A.edgeType==="segments"||A.edgeType==="straight"||A.edgeType==="haystack"){for(var M=A.allpts,I=0;I+3<M.length;I+=2)if(qC(t,e,M[I],M[I+1],M[I+2],M[I+3],x)&&P>(N=YC(t,e,M[I],M[I+1],M[I+2],M[I+3])))return p(w,N),!0}else if(A.edgeType==="bezier"||A.edgeType==="multibezier"||A.edgeType==="self"||A.edgeType==="compound"){for(var M=A.allpts,I=0;I+5<A.allpts.length;I+=4)if(GC(t,e,M[I],M[I+1],M[I+2],M[I+3],M[I+4],M[I+5],x)&&P>(N=VC(t,e,M[I],M[I+1],M[I+2],M[I+3],M[I+4],M[I+5])))return p(w,N),!0}for(var O=O||C.source,q=q||C.target,_=n.getArrowWidth(R,S),B=[{name:"source",x:A.arrowStartX,y:A.arrowStartY,angle:A.srcArrowAngle},{name:"target",x:A.arrowEndX,y:A.arrowEndY,angle:A.tgtArrowAngle},{name:"mid-source",x:A.midX,y:A.midY,angle:A.midsrcArrowAngle},{name:"mid-target",x:A.midX,y:A.midY,angle:A.midtgtArrowAngle}],I=0;I<B.length;I++){var z=B[I],Y=i.arrowShapes[w.pstyle(z.name+"-arrow-shape").value],k=w.pstyle("width").pfValue;if(Y.roughCollide(t,e,_,z.angle,{x:z.x,y:z.y},k,f)&&Y.collide(t,e,_,z.angle,{x:z.x,y:z.y},k,f))return p(w),!0}l&&s.length>0&&(y(O),y(q))}function m(w,C,A){return _t(w,C,A)}function E(w,C){var A=w._private,R=v,S;C?S=C+"-":S="",w.boundingBox();var D=A.labelBounds[C||"main"],P=w.pstyle(S+"label").value,x=w.pstyle("text-events").strValue==="yes";if(!(!x||!P)){var N=m(A.rscratch,"labelX",C),M=m(A.rscratch,"labelY",C),I=m(A.rscratch,"labelAngle",C),O=w.pstyle(S+"text-margin-x").pfValue,q=w.pstyle(S+"text-margin-y").pfValue,_=D.x1-R-O,B=D.x2+R-O,z=D.y1-R-q,Y=D.y2+R-q;if(I){var k=Math.cos(I),G=Math.sin(I),U=function(ee,re){return ee=ee-N,re=re-M,{x:ee*k-re*G+N,y:ee*G+re*k+M}},W=U(_,z),j=U(_,Y),H=U(B,z),V=U(B,Y),X=[W.x+O,W.y+q,H.x+O,H.y+q,V.x+O,V.y+q,j.x+O,j.y+q];if(Bt(t,e,X))return p(w),!0}else if(Cr(D,t,e))return p(w),!0}}for(var T=o.length-1;T>=0;T--){var L=o[T];L.isNode()?y(L)||E(L):b(L)||E(L)||E(L,"source")||E(L,"target")}return s};ea.getAllInBox=function(t,e,r,a){var n=this.getCachedZSortedEles().interactive,i=this.cy.zoom(),o=2/i,s=[],u=Math.min(t,r),l=Math.max(t,r),f=Math.min(e,a),h=Math.max(e,a);t=u,r=l,e=f,a=h;var v=Pt({x1:t,y1:e,x2:r,y2:a}),c=[{x:v.x1,y:v.y1},{x:v.x2,y:v.y1},{x:v.x2,y:v.y2},{x:v.x1,y:v.y2}],d=[[c[0],c[1]],[c[1],c[2]],[c[2],c[3]],[c[3],c[0]]];function g(ee,re,ue){return _t(ee,re,ue)}function p(ee,re){var ue=ee._private,xe=o,se="";ee.boundingBox();var oe=ue.labelBounds.main;if(!oe)return null;var he=g(ue.rscratch,"labelX",re),le=g(ue.rscratch,"labelY",re),de=g(ue.rscratch,"labelAngle",re),pe=ee.pstyle(se+"text-margin-x").pfValue,ce=ee.pstyle(se+"text-margin-y").pfValue,ye=oe.x1-xe-pe,Le=oe.x2+xe-pe,_e=oe.y1-xe-ce,ke=oe.y2+xe-ce;if(de){var Oe=Math.cos(de),Fe=Math.sin(de),Re=function(K,F){return K=K-he,F=F-le,{x:K*Oe-F*Fe+he,y:K*Fe+F*Oe+le}};return[Re(ye,_e),Re(Le,_e),Re(Le,ke),Re(ye,ke)]}else return[{x:ye,y:_e},{x:Le,y:_e},{x:Le,y:ke},{x:ye,y:ke}]}function y(ee,re,ue,xe){function se(oe,he,le){return(le.y-oe.y)*(he.x-oe.x)>(he.y-oe.y)*(le.x-oe.x)}return se(ee,ue,xe)!==se(re,ue,xe)&&se(ee,re,ue)!==se(ee,re,xe)}for(var b=0;b<n.length;b++){var m=n[b];if(m.isNode()){var E=m,T=E.pstyle("text-events").strValue==="yes",L=E.pstyle("box-selection").strValue,w=E.pstyle("box-select-labels").strValue==="yes";if(L==="none")continue;var C=(L==="overlap"||w)&&T,A=E.boundingBox({includeNodes:!0,includeEdges:!1,includeLabels:C});if(L==="contain"){var R=!1;if(w&&T){var S=p(E);S&&Do(S,c)&&(s.push(E),R=!0)}!R&&BE(v,A)&&s.push(E)}else if(L==="overlap"&&Pv(v,A)){var D=E.boundingBox({includeNodes:!0,includeEdges:!0,includeLabels:!1,includeMainLabels:!1,includeSourceLabels:!1,includeTargetLabels:!1}),P=[{x:D.x1,y:D.y1},{x:D.x2,y:D.y1},{x:D.x2,y:D.y2},{x:D.x1,y:D.y2}];if(Do(P,c))s.push(E);else{var x=p(E);x&&Do(x,c)&&s.push(E)}}}else{var N=m,M=N._private,I=M.rscratch,O=N.pstyle("box-selection").strValue;if(O==="none")continue;if(O==="contain"){if(I.startX!=null&&I.startY!=null&&!Cr(v,I.startX,I.startY)||I.endX!=null&&I.endY!=null&&!Cr(v,I.endX,I.endY))continue;if(I.edgeType==="bezier"||I.edgeType==="multibezier"||I.edgeType==="self"||I.edgeType==="compound"||I.edgeType==="segments"||I.edgeType==="haystack"){for(var q=M.rstyle.bezierPts||M.rstyle.linePts||M.rstyle.haystackPts,_=!0,B=0;B<q.length;B++)if(!kd(v,q[B])){_=!1;break}_&&s.push(N)}else I.edgeType==="straight"&&s.push(N)}else if(O==="overlap"){var z=!1;if(I.startX!=null&&I.startY!=null&&I.endX!=null&&I.endY!=null&&(Cr(v,I.startX,I.startY)||Cr(v,I.endX,I.endY)))s.push(N),z=!0;else if(!z&&I.edgeType==="haystack"){for(var Y=M.rstyle.haystackPts,k=0;k<Y.length;k++)if(kd(v,Y[k])){s.push(N),z=!0;break}}if(!z){var G=M.rstyle.bezierPts||M.rstyle.linePts||M.rstyle.haystackPts;if((!G||G.length<2)&&I.edgeType==="straight"&&I.startX!=null&&I.startY!=null&&I.endX!=null&&I.endY!=null&&(G=[{x:I.startX,y:I.startY},{x:I.endX,y:I.endY}]),!G||G.length<2)continue;for(var U=0;U<G.length-1;U++){for(var W=G[U],j=G[U+1],H=0;H<d.length;H++){var V=dt(d[H],2),X=V[0],Z=V[1];if(y(W,j,X,Z)){s.push(N),z=!0;break}}if(z)break}}}}}return s};var Ti={};Ti.calculateArrowAngles=function(t){var e=t._private.rscratch,r=e.edgeType==="haystack",a=e.edgeType==="bezier",n=e.edgeType==="multibezier",i=e.edgeType==="segments",o=e.edgeType==="compound",s=e.edgeType==="self",u,l,f,h,v,c,y,b;if(r?(f=e.haystackPts[0],h=e.haystackPts[1],v=e.haystackPts[2],c=e.haystackPts[3]):(f=e.arrowStartX,h=e.arrowStartY,v=e.arrowEndX,c=e.arrowEndY),y=e.midX,b=e.midY,i)u=f-e.segpts[0],l=h-e.segpts[1];else if(n||o||s||a){var d=e.allpts,g=wt(d[0],d[2],d[4],.1),p=wt(d[1],d[3],d[5],.1);u=f-g,l=h-p}else u=f-y,l=h-b;e.srcArrowAngle=Bn(u,l);var y=e.midX,b=e.midY;if(r&&(y=(f+v)/2,b=(h+c)/2),u=v-f,l=c-h,i){var d=e.allpts;if(d.length/2%2===0){var m=d.length/2,E=m-2;u=d[m]-d[E],l=d[m+1]-d[E+1]}else if(e.isRound)u=e.midVector[1],l=-e.midVector[0];else{var m=d.length/2-1,E=m-2;u=d[m]-d[E],l=d[m+1]-d[E+1]}}else if(n||o||s){var d=e.allpts,T=e.ctrlpts,L,w,C,A;if(T.length/2%2===0){var R=d.length/2-1,S=R+2,D=S+2;L=wt(d[R],d[S],d[D],0),w=wt(d[R+1],d[S+1],d[D+1],0),C=wt(d[R],d[S],d[D],1e-4),A=wt(d[R+1],d[S+1],d[D+1],1e-4)}else{var S=d.length/2-1,R=S-2,D=S+2;L=wt(d[R],d[S],d[D],.4999),w=wt(d[R+1],d[S+1],d[D+1],.4999),C=wt(d[R],d[S],d[D],.5),A=wt(d[R+1],d[S+1],d[D+1],.5)}u=C-L,l=A-w}if(e.midtgtArrowAngle=Bn(u,l),e.midDispX=u,e.midDispY=l,u*=-1,l*=-1,i){var d=e.allpts;if(d.length/2%2!==0){if(!e.isRound){var m=d.length/2-1,P=m+2;u=-(d[P]-d[m]),l=-(d[P+1]-d[m+1])}}}if(e.midsrcArrowAngle=Bn(u,l),i)u=v-e.segpts[e.segpts.length-2],l=c-e.segpts[e.segpts.length-1];else if(n||o||s||a){var d=e.allpts,x=d.length,g=wt(d[x-6],d[x-4],d[x-2],.9),p=wt(d[x-5],d[x-3],d[x-1],.9);u=v-g,l=c-p}else u=v-y,l=c-b;e.tgtArrowAngle=Bn(u,l)};Ti.getArrowWidth=Ti.getArrowHeight=function(t,e){var r=this.arrowWidthCache=this.arrowWidthCache||{},a=r[t+", "+e];return a||(a=Math.max(Math.pow(t*13.37,.9),29)*e,r[t+", "+e]=a,a)};var gv,pv,rr={},zt={},Ep,wp,$r,ri,lr,zr,Hr,er,fa,Hn,Mw,Ow,yv,mv,Tp,xp=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)},oS=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},sS=function(e,r,a,n,i){if(e!==Tp?xp(r,e,rr):oS(zt,rr),xp(r,a,zt),Ep=rr.nx*zt.ny-rr.ny*zt.nx,wp=rr.nx*zt.nx-rr.ny*-zt.ny,lr=Math.asin(Math.max(-1,Math.min(1,Ep))),Math.abs(lr)<1e-6){gv=r.x,pv=r.y,Hr=fa=0;return}$r=1,ri=!1,wp<0?lr<0?lr=Math.PI+lr:(lr=Math.PI-lr,$r=-1,ri=!0):lr>0&&($r=-1,ri=!0),r.radius!==void 0?fa=r.radius:fa=n,zr=lr/2,Hn=Math.min(rr.len/2,zt.len/2),i?(er=Math.abs(Math.cos(zr)*fa/Math.sin(zr)),er>Hn?(er=Hn,Hr=Math.abs(er*Math.sin(zr)/Math.cos(zr))):Hr=fa):(er=Math.min(Hn,fa),Hr=Math.abs(er*Math.sin(zr)/Math.cos(zr))),yv=r.x+zt.nx*er,mv=r.y+zt.ny*er,gv=yv-zt.ny*Hr*$r,pv=mv+zt.nx*Hr*$r,Mw=r.x+rr.nx*er,Ow=r.y+rr.ny*er,Tp=r};function Iw(t,e){e.radius===0?t.lineTo(e.cx,e.cy):t.arc(e.cx,e.cy,e.radius,e.startAngle,e.endAngle,e.counterClockwise)}function Xv(t,e,r,a){var n=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;return a===0||e.radius===0?{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}:(sS(t,e,r,a,n),{cx:gv,cy:pv,radius:Hr,startX:Mw,startY:Ow,stopX:yv,stopY:mv,startAngle:rr.ang+Math.PI/2*$r,endAngle:zt.ang-Math.PI/2*$r,counterClockwise:ri})}var vn=.01,uS=Math.sqrt(2*vn),Mt={};Mt.findMidptPtsEtc=function(t,e){var r=e.posPts,a=e.intersectionPts,n=e.vectorNormInverse,i,o=t.pstyle("source-endpoint"),s=t.pstyle("target-endpoint"),u=o.units!=null&&s.units!=null,l=function(T,L,w,C){var A=C-L,R=w-T,S=Math.sqrt(R*R+A*A);return{x:-A/S,y:R/S}},f=t.pstyle("edge-distances").value;switch(f){case"node-position":i=r;break;case"intersection":i=a;break;case"endpoints":{if(u){var h=this.manualEndptToPx(t.source()[0],o),v=dt(h,2),c=v[0],d=v[1],g=this.manualEndptToPx(t.target()[0],s),p=dt(g,2),y=p[0],b=p[1],m={x1:c,y1:d,x2:y,y2:b};n=l(c,d,y,b),i=m}else Ze("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}};Mt.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 o=a.source,s=a.target,u=o.position(),l=s.position(),f=o.width(),h=s.width(),v=o.height(),c=s.height(),d=r.pstyle("haystack-radius").value,g=d/2;n.haystackPts=n.allpts=[n.source.x*f*g+u.x,n.source.y*v*g+u.y,n.target.x*h*g+l.x,n.target.y*c*g+l.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)}};Mt.findSegmentsPoints=function(t,e){var r=t._private.rscratch,a=t.pstyle("segment-weights"),n=t.pstyle("segment-distances"),i=t.pstyle("segment-radii"),o=t.pstyle("radius-type"),s=Math.min(a.pfValue.length,n.pfValue.length),u=i.pfValue[i.pfValue.length-1],l=o.pfValue[o.pfValue.length-1];r.edgeType="segments",r.segpts=[],r.radii=[],r.isArcRadius=[];for(var f=0;f<s;f++){var h=a.pfValue[f],v=n.pfValue[f],c=1-h,d=h,g=this.findMidptPtsEtc(t,e),p=g.midptPts,y=g.vectorNormInverse,b={x:p.x1*c+p.x2*d,y:p.y1*c+p.y2*d};r.segpts.push(b.x+y.x*v,b.y+y.y*v),r.radii.push(i.pfValue[f]!==void 0?i.pfValue[f]:u),r.isArcRadius.push((o.pfValue[f]!==void 0?o.pfValue[f]:l)==="arc-radius")}};Mt.findLoopPoints=function(t,e,r,a){var n=t._private.rscratch,i=e.dirCounts,o=e.srcPos,s=t.pstyle("control-point-distances"),u=s?s.pfValue[0]:void 0,l=t.pstyle("loop-direction").pfValue,f=t.pstyle("loop-sweep").pfValue,h=t.pstyle("control-point-step-size").pfValue;n.edgeType="self";var v=r,c=h;a&&(v=0,c=u);var d=l-Math.PI/2,g=d-f/2,p=d+f/2,y=l+"_"+f;v=i[y]===void 0?i[y]=0:++i[y],n.ctrlpts=[o.x+Math.cos(g)*1.4*c*(v/3+1),o.y+Math.sin(g)*1.4*c*(v/3+1),o.x+Math.cos(p)*1.4*c*(v/3+1),o.y+Math.sin(p)*1.4*c*(v/3+1)]};Mt.findCompoundLoopPoints=function(t,e,r,a){var n=t._private.rscratch;n.edgeType="compound";var i=e.srcPos,o=e.tgtPos,s=e.srcW,u=e.srcH,l=e.tgtW,f=e.tgtH,h=t.pstyle("control-point-step-size").pfValue,v=t.pstyle("control-point-distances"),c=v?v.pfValue[0]:void 0,d=r,g=h;a&&(d=0,g=c);var p=50,y={x:i.x-s/2,y:i.y-u/2},b={x:o.x-l/2,y:o.y-f/2},m={x:Math.min(y.x,b.x),y:Math.min(y.y,b.y)},E=.5,T=Math.max(E,Math.log(s*vn)),L=Math.max(E,Math.log(l*vn));n.ctrlpts=[m.x,m.y-(1+Math.pow(p,1.12)/100)*g*(d/3+1)*T,m.x-(1+Math.pow(p,1.12)/100)*g*(d/3+1)*L,m.y]};Mt.findStraightEdgePoints=function(t){t._private.rscratch.edgeType="straight"};Mt.findBezierPoints=function(t,e,r,a,n){var i=t._private.rscratch,o=t.pstyle("control-point-step-size").pfValue,s=t.pstyle("control-point-distances"),u=t.pstyle("control-point-weights"),l=s&&u?Math.min(s.value.length,u.value.length):1,f=s?s.pfValue[0]:void 0,h=u.value[0],v=a;i.edgeType=v?"multibezier":"bezier",i.ctrlpts=[];for(var c=0;c<l;c++){var d=(.5-e.eles.length/2+r)*o*(n?-1:1),g=void 0,p=Iv(d);v&&(f=s?s.pfValue[c]:o,h=u.value[c]),a?g=f:g=f!==void 0?p*f:void 0;var y=g!==void 0?g:d,b=1-h,m=h,E=this.findMidptPtsEtc(t,e),T=E.midptPts,L=E.vectorNormInverse,w={x:T.x1*b+T.x2*m,y:T.y1*b+T.y2*m};i.ctrlpts.push(w.x+L.x*y,w.y+L.y*y)}};Mt.findTaxiPoints=function(t,e){var r=t._private.rscratch;r.edgeType="segments";var a="vertical",n="horizontal",i="leftward",o="rightward",s="downward",u="upward",l="auto",f=e.posPts,h=e.srcW,v=e.srcH,c=e.tgtW,d=e.tgtH,g=t.pstyle("edge-distances").value,p=g!=="node-position",y=t.pstyle("taxi-direction").value,b=y,m=t.pstyle("taxi-turn"),E=m.units==="%",T=m.pfValue,L=T<0,w=t.pstyle("taxi-turn-min-distance").pfValue,C=p?(h+c)/2:0,A=p?(v+d)/2:0,R=f.x2-f.x1,S=f.y2-f.y1,D=function(F,$){return F>0?Math.max(F-$,0):Math.min(F+$,0)},P=D(R,C),x=D(S,A),N=!1;b===l?y=Math.abs(P)>Math.abs(x)?n:a:b===u||b===s?(y=a,N=!0):(b===i||b===o)&&(y=n,N=!0);var M=y===a,I=M?x:P,O=M?S:R,q=Iv(O),_=!1;!(N&&(E||L))&&(b===s&&O<0||b===u&&O>0||b===i&&O>0||b===o&&O<0)&&(q*=-1,I=q*Math.abs(I),_=!0);var B;if(E){var z=T<0?1+T:T;B=z*I}else{var Y=T<0?I:0;B=Y+T*q}var k=function(F){return Math.abs(F)<w||Math.abs(F)>=Math.abs(I)},G=k(B),U=k(Math.abs(I)-Math.abs(B)),W=G||U;if(W&&!_)if(M){var j=Math.abs(O)<=v/2,H=Math.abs(R)<=c/2;if(j){var V=(f.x1+f.x2)/2,X=f.y1,Z=f.y2;r.segpts=[V,X,V,Z]}else if(H){var ee=(f.y1+f.y2)/2,re=f.x1,ue=f.x2;r.segpts=[re,ee,ue,ee]}else r.segpts=[f.x1,f.y2]}else{var xe=Math.abs(O)<=h/2,se=Math.abs(S)<=d/2;if(xe){var oe=(f.y1+f.y2)/2,he=f.x1,le=f.x2;r.segpts=[he,oe,le,oe]}else if(se){var de=(f.x1+f.x2)/2,pe=f.y1,ce=f.y2;r.segpts=[de,pe,de,ce]}else r.segpts=[f.x2,f.y1]}else if(M){var ye=f.y1+B+(p?v/2*q:0),Le=f.x1,_e=f.x2;r.segpts=[Le,ye,_e,ye]}else{var ke=f.x1+B+(p?h/2*q:0),Oe=f.y1,Fe=f.y2;r.segpts=[ke,Oe,ke,Fe]}if(r.isRound){var Re=t.pstyle("taxi-radius").value,we=t.pstyle("radius-type").value[0]==="arc-radius";r.radii=new Array(r.segpts.length/2).fill(Re),r.isArcRadius=new Array(r.segpts.length/2).fill(we)}};Mt.tryToCorrectInvalidPoints=function(t,e){var r=t._private.rscratch;if(r.edgeType==="bezier"){var a=e.srcPos,n=e.tgtPos,i=e.srcW,o=e.srcH,s=e.tgtW,u=e.tgtH,l=e.srcShape,f=e.tgtShape,h=e.srcCornerRadius,v=e.tgtCornerRadius,c=e.srcRs,d=e.tgtRs,g=!Te(r.startX)||!Te(r.startY),p=!Te(r.arrowStartX)||!Te(r.arrowStartY),y=!Te(r.endX)||!Te(r.endY),b=!Te(r.arrowEndX)||!Te(r.arrowEndY),m=3,E=this.getArrowWidth(t.pstyle("width").pfValue,t.pstyle("arrow-scale").value)*this.arrowShapeWidth,T=m*E,L=Zr({x:r.ctrlpts[0],y:r.ctrlpts[1]},{x:r.startX,y:r.startY}),w=L<T,C=Zr({x:r.ctrlpts[0],y:r.ctrlpts[1]},{x:r.endX,y:r.endY}),A=C<T,R=!1;if(g||p||w){R=!0;var S={x:r.ctrlpts[0]-a.x,y:r.ctrlpts[1]-a.y},D=Math.sqrt(S.x*S.x+S.y*S.y),P={x:S.x/D,y:S.y/D},x=Math.max(i,o),N={x:r.ctrlpts[0]+P.x*2*x,y:r.ctrlpts[1]+P.y*2*x},M=l.intersectLine(a.x,a.y,i,o,N.x,N.y,0,h,c);w?(r.ctrlpts[0]=r.ctrlpts[0]+P.x*(T-L),r.ctrlpts[1]=r.ctrlpts[1]+P.y*(T-L)):(r.ctrlpts[0]=M[0]+P.x*T,r.ctrlpts[1]=M[1]+P.y*T)}if(y||b||A){R=!0;var I={x:r.ctrlpts[0]-n.x,y:r.ctrlpts[1]-n.y},O=Math.sqrt(I.x*I.x+I.y*I.y),q={x:I.x/O,y:I.y/O},_=Math.max(i,o),B={x:r.ctrlpts[0]+q.x*2*_,y:r.ctrlpts[1]+q.y*2*_},z=f.intersectLine(n.x,n.y,s,u,B.x,B.y,0,v,d);A?(r.ctrlpts[0]=r.ctrlpts[0]+q.x*(T-C),r.ctrlpts[1]=r.ctrlpts[1]+q.y*(T-C)):(r.ctrlpts[0]=z[0]+q.x*T,r.ctrlpts[1]=z[1]+q.y*T)}R&&this.findEndpoints(t)}};Mt.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)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;e.ctrlpts.length/2%2===0?(a=e.allpts.length/2-1,e.midX=e.allpts[a],e.midY=e.allpts[a+1]):(a=e.allpts.length/2-3,n=.5,e.midX=wt(e.allpts[a],e.allpts[a+2],e.allpts[a+4],n),e.midY=wt(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 o=e.radii[i/2-1],s=e.isArcRadius[i/2-1];e.roundCorners.push(Xv({x:e.allpts[i-2],y:e.allpts[i-1]},{x:e.allpts[i],y:e.allpts[i+1],radius:o},{x:e.allpts[i+2],y:e.allpts[i+3]},o,s))}}if(e.segpts.length%4===0){var u=e.segpts.length/2,l=u-2;e.midX=(e.segpts[l]+e.segpts[u])/2,e.midY=(e.segpts[l+1]+e.segpts[u+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 h={x:e.segpts[f],y:e.segpts[f+1]},v=e.roundCorners[f/2];if(v.radius===0){var c={x:e.segpts[f+2],y:e.segpts[f+3]};e.midX=h.x,e.midY=h.y,e.midVector=[h.y-c.y,c.x-h.x]}else{var d=[h.x-v.cx,h.y-v.cy],g=v.radius/Math.sqrt(Math.pow(d[0],2)+Math.pow(d[1],2));d=d.map(function(p){return p*g}),e.midX=v.cx+d[0],e.midY=v.cy+d[1],e.midVector=d}}}}};Mt.checkForInvalidEdgeWarning=function(t){var e=t[0]._private.rscratch;e.nodesOverlap||Te(e.startX)&&Te(e.startY)&&Te(e.endX)&&Te(e.endY)?e.loggedErr=!1:e.loggedErr||(e.loggedErr=!0,Ze("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."))};Mt.findEdgeControlPoints=function(t){var e=this;if(!(!t||t.length===0)){for(var r=this,a=r.cy,n=a.hasCompoundNodes(),i=new hr,o=function(A,R){return[].concat(ci(A),[R?1:0]).join("-")},s=[],u=[],l=0;l<t.length;l++){var f=t[l],h=f._private,v=f.pstyle("curve-style").value;if(!(f.removed()||!f.takesUpSpace())){if(v==="haystack"){u.push(f);continue}var c=v==="unbundled-bezier"||xr(v,"segments")||v==="straight"||v==="straight-triangle"||xr(v,"taxi"),d=v==="unbundled-bezier"||v==="bezier",g=h.source,p=h.target,y=g.poolIndex(),b=p.poolIndex(),m=[y,b].sort(),E=o(m,c),T=i.get(E);T==null&&(T={eles:[]},s.push({pairId:m,edgeIsUnbundled:c}),i.set(E,T)),T.eles.push(f),c&&(T.hasUnbundled=!0),d&&(T.hasBezier=!0)}}for(var L=function(){var A=s[w],R=A.pairId,S=A.edgeIsUnbundled,D=o(R,S),P=i.get(D),x;if(!P.hasUnbundled){var N=P.eles[0].parallelEdges().filter(function(we){return we.isBundledBezier()});Mv(P.eles),N.forEach(function(we){return P.eles.push(we)}),P.eles.sort(function(we,K){return we.poolIndex()-K.poolIndex()})}var M=P.eles[0],I=M.source(),O=M.target();if(I.poolIndex()>O.poolIndex()){var q=I;I=O,O=q}var _=P.srcPos=I.position(),B=P.tgtPos=O.position(),z=P.srcW=I.outerWidth(),Y=P.srcH=I.outerHeight(),k=P.tgtW=O.outerWidth(),G=P.tgtH=O.outerHeight(),U=P.srcShape=r.nodeShapes[e.getNodeShape(I)],W=P.tgtShape=r.nodeShapes[e.getNodeShape(O)],j=P.srcCornerRadius=I.pstyle("corner-radius").value==="auto"?"auto":I.pstyle("corner-radius").pfValue,H=P.tgtCornerRadius=O.pstyle("corner-radius").value==="auto"?"auto":O.pstyle("corner-radius").pfValue,V=P.tgtRs=O._private.rscratch,X=P.srcRs=I._private.rscratch;P.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var Z=0;Z<P.eles.length;Z++){var ee=P.eles[Z],re=ee[0]._private.rscratch,ue=ee.pstyle("curve-style").value,xe=ue==="unbundled-bezier"||xr(ue,"segments")||xr(ue,"taxi"),se=!I.same(ee.source());if(!P.calculatedIntersection&&I!==O&&(P.hasBezier||P.hasUnbundled)){P.calculatedIntersection=!0;var oe=U.intersectLine(_.x,_.y,z,Y,B.x,B.y,0,j,X),he=P.srcIntn=oe,le=W.intersectLine(B.x,B.y,k,G,_.x,_.y,0,H,V),de=P.tgtIntn=le,pe=P.intersectionPts={x1:oe[0],x2:le[0],y1:oe[1],y2:le[1]},ce=P.posPts={x1:_.x,x2:B.x,y1:_.y,y2:B.y},ye=le[1]-oe[1],Le=le[0]-oe[0],_e=Math.sqrt(Le*Le+ye*ye);Te(_e)&&_e>=uS||(_e=Math.sqrt(Math.max(Le*Le,vn)+Math.max(ye*ye,vn)));var ke=P.vector={x:Le,y:ye},Oe=P.vectorNorm={x:ke.x/_e,y:ke.y/_e},Fe={x:-Oe.y,y:Oe.x};P.nodesOverlap=!Te(_e)||W.checkPoint(oe[0],oe[1],0,k,G,B.x,B.y,H,V)||U.checkPoint(le[0],le[1],0,z,Y,_.x,_.y,j,X),P.vectorNormInverse=Fe,x={nodesOverlap:P.nodesOverlap,dirCounts:P.dirCounts,calculatedIntersection:!0,hasBezier:P.hasBezier,hasUnbundled:P.hasUnbundled,eles:P.eles,srcPos:B,srcRs:V,tgtPos:_,tgtRs:X,srcW:k,srcH:G,tgtW:z,tgtH:Y,srcIntn:de,tgtIntn:he,srcShape:W,tgtShape:U,posPts:{x1:ce.x2,y1:ce.y2,x2:ce.x1,y2:ce.y1},intersectionPts:{x1:pe.x2,y1:pe.y2,x2:pe.x1,y2:pe.y1},vector:{x:-ke.x,y:-ke.y},vectorNorm:{x:-Oe.x,y:-Oe.y},vectorNormInverse:{x:-Fe.x,y:-Fe.y}}}var Re=se?x:P;re.nodesOverlap=Re.nodesOverlap,re.srcIntn=Re.srcIntn,re.tgtIntn=Re.tgtIntn,re.isRound=ue.startsWith("round"),n&&(I.isParent()||I.isChild()||O.isParent()||O.isChild())&&(I.parents().anySame(O)||O.parents().anySame(I)||I.same(O)&&I.isParent())?e.findCompoundLoopPoints(ee,Re,Z,xe):I===O?e.findLoopPoints(ee,Re,Z,xe):ue.endsWith("segments")?e.findSegmentsPoints(ee,Re):ue.endsWith("taxi")?e.findTaxiPoints(ee,Re):ue==="straight"||!xe&&P.eles.length%2===1&&Z===Math.floor(P.eles.length/2)?e.findStraightEdgePoints(ee):e.findBezierPoints(ee,Re,Z,xe,se),e.findEndpoints(ee),e.tryToCorrectInvalidPoints(ee,Re),e.checkForInvalidEdgeWarning(ee),e.storeAllpts(ee),e.storeEdgeProjections(ee),e.calculateArrowAngles(ee),e.recalculateEdgeLabelProjections(ee),e.calculateLabelAngles(ee)}},w=0;w<s.length;w++)L();this.findHaystackPoints(u)}};function Pw(t){var e=[];if(t!=null){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}}Mt.getSegmentPoints=function(t){var e=t[0]._private.rscratch;this.recalculateRenderedStyle(t);var r=e.edgeType;if(r==="segments")return Pw(e.segpts)};Mt.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 Pw(e.ctrlpts)};Mt.getEdgeMidpoint=function(t){var e=t[0]._private.rscratch;return this.recalculateRenderedStyle(t),{x:e.midX,y:e.midY}};var xn={};xn.manualEndptToPx=function(t,e){var r=this,a=t.position(),n=t.outerWidth(),i=t.outerHeight(),o=t._private.rscratch;if(e.value.length===2){var s=[e.pfValue[0],e.pfValue[1]];return e.units[0]==="%"&&(s[0]=s[0]*n),e.units[1]==="%"&&(s[1]=s[1]*i),s[0]+=a.x,s[1]+=a.y,s}else{var u=e.pfValue[0];u=-Math.PI/2+u;var l=2*Math.max(n,i),f=[a.x+Math.cos(u)*l,a.y+Math.sin(u)*l];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,o)}};xn.findEndpoints=function(t){var e,r,a,n,i=this,o,s=t.source()[0],u=t.target()[0],l=s.position(),f=u.position(),h=t.pstyle("target-arrow-shape").value,v=t.pstyle("source-arrow-shape").value,c=t.pstyle("target-distance-from-node").pfValue,d=t.pstyle("source-distance-from-node").pfValue,g=s._private.rscratch,p=u._private.rscratch,y=t.pstyle("curve-style").value,b=t._private.rscratch,m=b.edgeType,E=xr(y,"taxi"),T=m==="self"||m==="compound",L=m==="bezier"||m==="multibezier"||T,w=m!=="bezier",C=m==="straight"||m==="segments",A=m==="segments",R=L||w||C,S=T||E,D=t.pstyle("source-endpoint"),P=S?"outside-to-node":D.value,x=s.pstyle("corner-radius").value==="auto"?"auto":s.pstyle("corner-radius").pfValue,N=t.pstyle("target-endpoint"),M=S?"outside-to-node":N.value,I=u.pstyle("corner-radius").value==="auto"?"auto":u.pstyle("corner-radius").pfValue;b.srcManEndpt=D,b.tgtManEndpt=N;var O,q,_,B,z=(e=(N==null||(r=N.pfValue)===null||r===void 0?void 0:r.length)===2?N.pfValue:null)!==null&&e!==void 0?e:[0,0],Y=(a=(D==null||(n=D.pfValue)===null||n===void 0?void 0:n.length)===2?D.pfValue:null)!==null&&a!==void 0?a:[0,0];if(L){var k=[b.ctrlpts[0],b.ctrlpts[1]],G=w?[b.ctrlpts[b.ctrlpts.length-2],b.ctrlpts[b.ctrlpts.length-1]]:k;O=G,q=k}else if(C){var U=A?b.segpts.slice(0,2):[f.x+z[0],f.y+z[1]],W=A?b.segpts.slice(b.segpts.length-2):[l.x+Y[0],l.y+Y[1]];O=W,q=U}if(M==="inside-to-node")o=[f.x,f.y];else if(N.units)o=this.manualEndptToPx(u,N);else if(M==="outside-to-line")o=b.tgtIntn;else if(M==="outside-to-node"||M==="outside-to-node-or-label"?_=O:(M==="outside-to-line"||M==="outside-to-line-or-label")&&(_=[l.x,l.y]),o=i.nodeShapes[this.getNodeShape(u)].intersectLine(f.x,f.y,u.outerWidth(),u.outerHeight(),_[0],_[1],0,I,p),M==="outside-to-node-or-label"||M==="outside-to-line-or-label"){var j=u._private.rscratch,H=j.labelWidth,V=j.labelHeight,X=j.labelX,Z=j.labelY,ee=H/2,re=V/2,ue=u.pstyle("text-valign").value;ue==="top"?Z-=re:ue==="bottom"&&(Z+=re);var xe=u.pstyle("text-halign").value;xe==="left"?X-=ee:xe==="right"&&(X+=ee);var se=un(_[0],_[1],[X-ee,Z-re,X+ee,Z-re,X+ee,Z+re,X-ee,Z+re],f.x,f.y);if(se.length>0){var oe=l,he=Yr(oe,ga(o)),le=Yr(oe,ga(se)),de=he;if(le<he&&(o=se,de=le),se.length>2){var pe=Yr(oe,{x:se[2],y:se[3]});pe<de&&(o=[se[2],se[3]])}}}var ce=kn(o,O,i.arrowShapes[h].spacing(t)+c),ye=kn(o,O,i.arrowShapes[h].gap(t)+c);if(b.endX=ye[0],b.endY=ye[1],b.arrowEndX=ce[0],b.arrowEndY=ce[1],P==="inside-to-node")o=[l.x,l.y];else if(D.units)o=this.manualEndptToPx(s,D);else if(P==="outside-to-line")o=b.srcIntn;else if(P==="outside-to-node"||P==="outside-to-node-or-label"?B=q:(P==="outside-to-line"||P==="outside-to-line-or-label")&&(B=[f.x,f.y]),o=i.nodeShapes[this.getNodeShape(s)].intersectLine(l.x,l.y,s.outerWidth(),s.outerHeight(),B[0],B[1],0,x,g),P==="outside-to-node-or-label"||P==="outside-to-line-or-label"){var Le=s._private.rscratch,_e=Le.labelWidth,ke=Le.labelHeight,Oe=Le.labelX,Fe=Le.labelY,Re=_e/2,we=ke/2,K=s.pstyle("text-valign").value;K==="top"?Fe-=we:K==="bottom"&&(Fe+=we);var F=s.pstyle("text-halign").value;F==="left"?Oe-=Re:F==="right"&&(Oe+=Re);var $=un(B[0],B[1],[Oe-Re,Fe-we,Oe+Re,Fe-we,Oe+Re,Fe+we,Oe-Re,Fe+we],l.x,l.y);if($.length>0){var J=f,Q=Yr(J,ga(o)),te=Yr(J,ga($)),fe=Q;if(te<Q&&(o=[$[0],$[1]],fe=te),$.length>2){var ae=Yr(J,{x:$[2],y:$[3]});ae<fe&&(o=[$[2],$[3]])}}}var ie=kn(o,q,i.arrowShapes[v].spacing(t)+d),ne=kn(o,q,i.arrowShapes[v].gap(t)+d);b.startX=ne[0],b.startY=ne[1],b.arrowStartX=ie[0],b.arrowStartY=ie[1],R&&(!Te(b.startX)||!Te(b.startY)||!Te(b.endX)||!Te(b.endY)?b.badLine=!0:b.badLine=!1)};xn.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}}};xn.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 $v={};function lS(t,e,r){for(var a=function(l,f,h,v){return wt(l,f,h,v)},n=e._private,i=n.rstyle.bezierPts,o=0;o<t.bezierProjPcts.length;o++){var s=t.bezierProjPcts[o];i.push({x:a(r[0],r[2],r[4],s),y:a(r[1],r[3],r[5],s)})}}$v.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)lS(this,t,r.allpts.slice(n,n+6))}else if(a==="segments")for(var i=e.rstyle.linePts=[],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 o=r.haystackPts;e.rstyle.haystackPts=[{x:o[0],y:o[1]},{x:o[2],y:o[3]}]}e.rstyle.arrowWidth=this.getArrowWidth(t.pstyle("width").pfValue,t.pstyle("arrow-scale").value)*this.arrowShapeWidth};$v.recalculateEdgeProjections=function(t){this.findEdgeControlPoints(t)};var ir={};ir.recalculateNodeLabelProjection=function(t){var e=t.pstyle("label").strValue;if(!Sr(e)){var r,a,n=t._private,i=t.width(),o=t.height(),s=t.padding(),u=t.position(),l=t.pstyle("text-halign").strValue,f=t.pstyle("text-valign").strValue,h=n.rscratch,v=n.rstyle;switch(l){case"left":r=u.x-i/2-s;break;case"right":r=u.x+i/2+s;break;default:r=u.x}switch(f){case"top":a=u.y-o/2-s;break;case"bottom":a=u.y+o/2+s;break;default:a=u.y}h.labelX=r,h.labelY=a,v.labelX=r,v.labelY=a,this.calculateLabelAngles(t),this.applyLabelDimensions(t)}};var Fw=function(e,r){var a=Math.atan(r/e);return e===0&&a<0&&(a=a*-1),a},_w=function(e,r){var a=r.x-e.x,n=r.y-e.y;return Fw(a,n)},fS=function(e,r,a,n){var i=sn(0,n-.001,1),o=sn(0,n+.001,1),s=ma(e,r,a,i),u=ma(e,r,a,o);return _w(s,u)};ir.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){e={x:a.midX,y:a.midY};var o=function(h,v,c){fr(r.rscratch,h,v,c),fr(r.rstyle,h,v,c)};o("labelX",null,e.x),o("labelY",null,e.y);var s=Fw(a.midDispX,a.midDispY);o("labelAutoAngle",null,s);var u=function(){if(u.cache)return u.cache;for(var h=[],v=0;v+5<a.allpts.length;v+=4){var c={x:a.allpts[v],y:a.allpts[v+1]},d={x:a.allpts[v+2],y:a.allpts[v+3]},g={x:a.allpts[v+4],y:a.allpts[v+5]};h.push({p0:c,p1:d,p2:g,startDist:0,length:0,segments:[]})}var p=r.rstyle.bezierPts,y=n.bezierProjPcts.length;function b(w,C,A,R,S){var D=Zr(C,A),P=w.segments[w.segments.length-1],x={p0:C,p1:A,t0:R,t1:S,startDist:P?P.startDist+P.length:0,length:D};w.segments.push(x),w.length+=D}for(var m=0;m<h.length;m++){var E=h[m],T=h[m-1];T&&(E.startDist=T.startDist+T.length),b(E,E.p0,p[m*y],0,n.bezierProjPcts[0]);for(var L=0;L<y-1;L++)b(E,p[m*y+L],p[m*y+L+1],n.bezierProjPcts[L],n.bezierProjPcts[L+1]);b(E,p[m*y+y-1],E.p2,n.bezierProjPcts[y-1],1)}return u.cache=h},l=function(h){var v,c=h==="source";if(i[h]){var d=t.pstyle(h+"-text-offset").pfValue;switch(a.edgeType){case"self":case"compound":case"bezier":case"multibezier":{for(var g=u(),p,y=0,b=0,m=0;m<g.length;m++){for(var E=g[c?m:g.length-1-m],T=0;T<E.segments.length;T++){var L=E.segments[c?T:E.segments.length-1-T],w=m===g.length-1&&T===E.segments.length-1;if(y=b,b+=L.length,b>=d||w){p={cp:E,segment:L};break}}if(p)break}var C=p.cp,A=p.segment,R=(d-y)/A.length,S=A.t1-A.t0,D=c?A.t0+S*R:A.t1-S*R;D=sn(0,D,1),e=ma(C.p0,C.p1,C.p2,D),v=fS(C.p0,C.p1,C.p2,D);break}case"straight":case"segments":case"haystack":{for(var P=0,x,N,M,I,O=a.allpts.length,q=0;q+3<O&&(c?(M={x:a.allpts[q],y:a.allpts[q+1]},I={x:a.allpts[q+2],y:a.allpts[q+3]}):(M={x:a.allpts[O-2-q],y:a.allpts[O-1-q]},I={x:a.allpts[O-4-q],y:a.allpts[O-3-q]}),x=Zr(M,I),N=P,P+=x,!(P>=d));q+=2);var _=d-N,B=_/x;B=sn(0,B,1),e=OC(M,I,B),v=_w(M,I);break}}o("labelX",h,e.x),o("labelY",h,e.y),o("labelAutoAngle",h,v)}};l("source"),l("target"),this.applyLabelDimensions(t)}};ir.applyLabelDimensions=function(t){this.applyPrefixedLabelDimensions(t),t.isEdge()&&(this.applyPrefixedLabelDimensions(t,"source"),this.applyPrefixedLabelDimensions(t,"target"))};ir.applyPrefixedLabelDimensions=function(t,e){var r=t._private,a=this.getLabelText(t,e),n=Kr(a,t._private.labelDimsKey);if(_t(r.rscratch,"prefixedLabelDimsKey",e)!==n){fr(r.rscratch,"prefixedLabelDimsKey",e,n);var i=this.calculateLabelDimensions(t,a),o=t.pstyle("line-height").pfValue,s=t.pstyle("text-wrap").strValue,u=_t(r.rscratch,"labelWrapCachedLines",e)||[],l=s!=="wrap"?1:Math.max(u.length,1),f=i.height/l,h=f*o,v=i.width,c=i.height+(l-1)*(o-1)*f;fr(r.rstyle,"labelWidth",e,v),fr(r.rscratch,"labelWidth",e,v),fr(r.rstyle,"labelHeight",e,c),fr(r.rscratch,"labelHeight",e,c),fr(r.rscratch,"labelLineHeight",e,h)}};ir.getLabelText=function(t,e){var r=t._private,a=e?e+"-":"",n=t.pstyle(a+"label").strValue,i=t.pstyle("text-transform").value,o=function(Y,k){return k?(fr(r.rscratch,Y,e,k),k):_t(r.rscratch,Y,e)};if(!n)return"";i=="none"||(i=="uppercase"?n=n.toUpperCase():i=="lowercase"&&(n=n.toLowerCase()));var s=t.pstyle("text-wrap").value;if(s==="wrap"){var u=o("labelKey");if(u!=null&&o("labelWrapKey")===u)return o("labelWrapCachedText");for(var l="​",f=n.split(`
15
+ `),h=t.pstyle("text-max-width").pfValue,v=t.pstyle("text-overflow-wrap").value,c=v==="anywhere",d=[],g=/[\s\u200b]+|$/g,p=0;p<f.length;p++){var y=f[p],b=this.calculateLabelDimensions(t,y),m=b.width;if(c){var E=y.split("").join(l);y=E}if(m>h){var T=y.matchAll(g),L="",w=0,C=kt(T),A;try{for(C.s();!(A=C.n()).done;){var R=A.value,S=R[0],D=y.substring(w,R.index);w=R.index+S.length;var P=L.length===0?D:L+D+S,x=this.calculateLabelDimensions(t,P),N=x.width;N<=h?L+=D+S:(L&&d.push(L),L=D+S)}}catch(z){C.e(z)}finally{C.f()}L.match(/^[\s\u200b]+$/)||d.push(L)}else d.push(y)}o("labelWrapCachedLines",d),n=o("labelWrapCachedText",d.join(`
16
+ `)),o("labelWrapKey",u)}else if(s==="ellipsis"){var M=t.pstyle("text-max-width").pfValue,I="",O="…",q=!1;if(this.calculateLabelDimensions(t,n).width<M)return n;for(var _=0;_<n.length;_++){var B=this.calculateLabelDimensions(t,I+n[_]+O).width;if(B>M)break;I+=n[_],_===n.length-1&&(q=!0)}return q||(I+=O),I}return n};ir.getLabelJustification=function(t){var e=t.pstyle("text-justification").strValue,r=t.pstyle("text-halign").strValue;if(e==="auto")if(t.isNode())switch(r){case"left":return"right";case"right":return"left";default:return"center"}else return"center";else return e};ir.calculateLabelDimensions=function(t,e){var r=this,a=r.cy.window(),n=a.document,i=0,o=t.pstyle("font-style").strValue,s=t.pstyle("font-size").pfValue,u=t.pstyle("font-family").strValue,l=t.pstyle("font-weight").strValue,f=this.labelCalcCanvas,h=this.labelCalcCanvasContext;if(!f){f=this.labelCalcCanvas=n.createElement("canvas"),h=this.labelCalcCanvasContext=f.getContext("2d");var v=f.style;v.position="absolute",v.left="-9999px",v.top="-9999px",v.zIndex="-1",v.visibility="hidden",v.pointerEvents="none"}h.font="".concat(o," ").concat(l," ").concat(s,"px ").concat(u);for(var c=0,d=0,g=e.split(`
17
+ `),p=0;p<g.length;p++){var y=g[p],b=h.measureText(y),m=Math.ceil(b.width),E=s;c=Math.max(m,c),d+=E}return c+=i,d+=i,{width:c,height:d}};ir.calculateLabelAngle=function(t,e){var r=t._private,a=r.rscratch,n=t.isEdge(),i=e?e+"-":"",o=t.pstyle(i+"text-rotation"),s=o.strValue;return s==="none"?0:n&&s==="autorotate"?a.labelAutoAngle:s==="autorotate"?0:o.pfValue};ir.calculateLabelAngles=function(t){var e=this,r=t.isEdge(),a=t._private,n=a.rscratch;n.labelAngle=e.calculateLabelAngle(t),r&&(n.sourceLabelAngle=e.calculateLabelAngle(t,"source"),n.targetLabelAngle=e.calculateLabelAngle(t,"target"))};var Bw={},Cp=28,Ap=!1;Bw.getNodeShape=function(t){var e=this,r=t.pstyle("shape").value;if(r==="cutrectangle"&&(t.width()<Cp||t.height()<Cp))return Ap||(Ze("The `cutrectangle` node shape can not be used at small sizes so `rectangle` is used instead"),Ap=!0),"rectangle";if(t.isParent())return r==="rectangle"||r==="roundrectangle"||r==="round-rectangle"||r==="cutrectangle"||r==="cut-rectangle"||r==="barrel"?r:"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(o){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e.merge(o),s)for(var u=0;u<o.length;u++){var l=o[u],f=l._private,h=f.rstyle;h.clean=!1,h.cleanConnected=!1}};r.binder(t).on("bounds.* dirty.*",function(o){var s=o.target;a(s)}).on("style.* background.*",function(o){var s=o.target;a(s,!1)});var n=function(o){if(o){var s=r.onUpdateEleCalcsFns;e.cleanStyle();for(var u=0;u<e.length;u++){var l=e[u],f=l._private.rstyle;l.isNode()&&!f.cleanConnected&&(a(l.connectedEdges()),f.cleanConnected=!0)}if(s)for(var h=0;h<s.length;h++){var v=s[h];v(o,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){var a=[],n=[];if(!this.destroyed){e===void 0&&(e=!0);for(var i=0;i<t.length;i++){var o=t[i],s=o._private,u=s.rstyle;o.isEdge()&&(!r(o.source())||!r(o.target()))&&(u.clean=!1),o.isEdge()&&o.isBundledBezier()&&o.parallelEdges().some(function(m){return!m._private.rstyle.clean&&m.isBundledBezier()})&&(u.clean=!1),!(e&&u.clean||o.removed())&&o.pstyle("display").value!=="none"&&(s.group==="nodes"?n.push(o):a.push(o),u.clean=!0)}for(var l=0;l<n.length;l++){var f=n[l],h=f._private,v=h.rstyle,c=f.position();this.recalculateNodeLabelProjection(f),v.nodeX=c.x,v.nodeY=c.y,v.nodeW=f.pstyle("width").pfValue,v.nodeH=f.pstyle("height").pfValue}this.recalculateEdgeProjections(a);for(var d=0;d<a.length;d++){var g=a[d],p=g._private,y=p.rstyle,b=p.rscratch;y.srcX=b.arrowStartX,y.srcY=b.arrowStartY,y.tgtX=b.arrowEndX,y.tgtY=b.arrowEndY,y.midX=b.midX,y.midY=b.midY,y.labelAngle=b.labelAngle,y.sourceLabelAngle=b.sourceLabelAngle,y.targetLabelAngle=b.targetLabelAngle}}}};var Yi={};Yi.updateCachedGrabbedEles=function(){var t=this.cachedZSortedEles;if(t){t.drag=[],t.nondrag=[];for(var e=[],r=0;r<t.length;r++){var a=t[r],n=a._private.rscratch;a.grabbed()&&!a.isParent()?e.push(a):n.inDragLayer?t.drag.push(a):t.nondrag.push(a)}for(var r=0;r<e.length;r++){var a=e[r];t.drag.push(a)}}};Yi.invalidateCachedZSortedEles=function(){this.cachedZSortedEles=null};Yi.getCachedZSortedEles=function(t){if(t||!this.cachedZSortedEles){var e=this.cy.mutableElements().toArray();e.sort(mw),e.interactive=e.filter(function(r){return r.interactive()}),this.cachedZSortedEles=e,this.updateCachedGrabbedEles()}else e=this.cachedZSortedEles;return e};var kw={};[ea,Ti,Mt,xn,$v,ir,Bw,Vi,Yi].forEach(function(t){Be(kw,t)});var qw={};qw.getCachedImage=function(t,e,r){var a=this,n=a.imageCache=a.imageCache||{},i=n[t];if(i)return i.image.complete||i.image.addEventListener("load",r),i.image;i=n[t]=n[t]||{};var o=i.image=new Image;o.addEventListener("load",r),o.addEventListener("error",function(){o.error=!0});var s="data:",u=t.substring(0,s.length).toLowerCase()===s;return u||(e=e==="null"?null:e,o.crossOrigin=e),o.src=t,o};var Na={};Na.registerBinding=function(t,e,r,a){var n=Array.prototype.slice.apply(arguments,[1]);if(Array.isArray(t)){for(var i=[],o=0;o<t.length;o++){var s=t[o];if(s!==void 0){var u=this.binder(s);i.push(u.on.apply(u,n))}}return i}var u=this.binder(t);return u.on.apply(u,n)};Na.binder=function(t){var e=this,r=e.cy.window(),a=t===r||t===r.document||t===r.document.body||Tx(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{}e.supportsPassiveEvents=n}var o=function(u,l,f){var h=Array.prototype.slice.call(arguments);return a&&e.supportsPassiveEvents&&(h[2]={capture:f??!1,passive:!1,once:!1}),e.bindings.push({target:t,args:h}),(t.addEventListener||t.on).apply(t,h),this};return{on:o,addEventListener:o,addListener:o,bind:o}};Na.nodeIsDraggable=function(t){return t&&t.isNode()&&!t.locked()&&t.grabbable()};Na.nodeIsGrabbable=function(t){return this.nodeIsDraggable(t)&&t.interactive()};Na.load=function(){var t=this,e=t.cy.window(),r=function(F){return F.selected()},a=function(F){var $=F.getRootNode();if($&&$.nodeType===11&&$.host!==void 0)return $},n=function(F,$,J,Q){F==null&&(F=t.cy);for(var te=0;te<$.length;te++){var fe=$[te];F.emit({originalEvent:J,type:fe,position:Q})}},i=function(F){return F.shiftKey||F.metaKey||F.ctrlKey},o=function(F,$){var J=!0;if(t.cy.hasCompoundNodes()&&F&&F.pannable())for(var Q=0;$&&Q<$.length;Q++){var F=$[Q];if(F.isNode()&&F.isParent()&&!F.pannable()){J=!1;break}}else J=!0;return J},s=function(F){F[0]._private.grabbed=!0},u=function(F){F[0]._private.grabbed=!1},l=function(F){F[0]._private.rscratch.inDragLayer=!0},f=function(F){F[0]._private.rscratch.inDragLayer=!1},h=function(F){F[0]._private.rscratch.isGrabTarget=!0},v=function(F){F[0]._private.rscratch.isGrabTarget=!1},c=function(F,$){var J=$.addToList,Q=J.has(F);!Q&&F.grabbable()&&!F.locked()&&(J.merge(F),s(F))},d=function(F,$){if(F.cy().hasCompoundNodes()&&!($.inDragLayer==null&&$.addToList==null)){var J=F.descendants();$.inDragLayer&&(J.forEach(l),J.connectedEdges().forEach(l)),$.addToList&&c(J,$)}},g=function(F,$){$=$||{};var J=F.cy().hasCompoundNodes();$.inDragLayer&&(F.forEach(l),F.neighborhood().stdFilter(function(Q){return!J||Q.isEdge()}).forEach(l)),$.addToList&&F.forEach(function(Q){c(Q,$)}),d(F,$),b(F,{inDragLayer:$.inDragLayer}),t.updateCachedGrabbedEles()},p=g,y=function(F){F&&(t.getCachedZSortedEles().forEach(function($){u($),f($),v($)}),t.updateCachedGrabbedEles())},b=function(F,$){if(!($.inDragLayer==null&&$.addToList==null)&&F.cy().hasCompoundNodes()){var J=F.ancestors().orphans();if(!J.same(F)){var Q=J.descendants().spawnSelf().merge(J).unmerge(F).unmerge(F.descendants()),te=Q.connectedEdges();$.inDragLayer&&(te.forEach(l),Q.forEach(l)),$.addToList&&Q.forEach(function(fe){c(fe,$)})}}},m=function(){document.activeElement!=null&&document.activeElement.blur!=null&&document.activeElement.blur()},E=typeof MutationObserver<"u",T=typeof ResizeObserver<"u";E?(t.removeObserver=new MutationObserver(function(K){for(var F=0;F<K.length;F++){var $=K[F],J=$.removedNodes;if(J)for(var Q=0;Q<J.length;Q++){var te=J[Q];if(te===t.container){t.destroy();break}}}}),t.container.parentNode&&t.removeObserver.observe(t.container.parentNode,{childList:!0})):t.registerBinding(t.container,"DOMNodeRemoved",function(K){t.destroy()});var L=bn(function(){t.cy.resize()},100);E&&(t.styleObserver=new MutationObserver(L),t.styleObserver.observe(t.container,{attributes:!0})),t.registerBinding(e,"resize",L),T&&(t.resizeObserver=new ResizeObserver(L),t.resizeObserver.observe(t.container));var w=function(F,$){for(;F!=null;)$(F),F=F.parentNode},C=function(){t.invalidateContainerClientCoordsCache()};w(t.container,function(K){t.registerBinding(K,"transitionend",C),t.registerBinding(K,"animationend",C),t.registerBinding(K,"scroll",C)}),t.registerBinding(t.container,"contextmenu",function(K){K.preventDefault()});var A=function(){return t.selection[4]!==0},R=function(F){for(var $=t.findContainerClientCoords(),J=$[0],Q=$[1],te=$[2],fe=$[3],ae=F.touches?F.touches:[F],ie=!1,ne=0;ne<ae.length;ne++){var ve=ae[ne];if(J<=ve.clientX&&ve.clientX<=J+te&&Q<=ve.clientY&&ve.clientY<=Q+fe){ie=!0;break}}if(!ie)return!1;for(var Ce=t.container,Ee=F.target,be=Ee.parentNode,me=!1;be;){if(be===Ce){me=!0;break}be=be.parentNode}return!!me};t.registerBinding(t.container,"mousedown",function(F){if(R(F)&&!(t.hoverData.which===1&&F.which!==1)){F.preventDefault(),m(),t.hoverData.capture=!0,t.hoverData.which=F.which;var $=t.cy,J=[F.clientX,F.clientY],Q=t.projectIntoViewport(J[0],J[1]),te=t.selection,fe=t.findNearestElements(Q[0],Q[1],!0,!1),ae=fe[0],ie=t.dragData.possibleDragElements;t.hoverData.mdownPos=Q,t.hoverData.mdownGPos=J;var ne=function(ge){return{originalEvent:F,type:ge,position:{x:Q[0],y:Q[1]}}},ve=function(){t.hoverData.tapholdCancelled=!1,clearTimeout(t.hoverData.tapholdTimeout),t.hoverData.tapholdTimeout=setTimeout(function(){if(!t.hoverData.tapholdCancelled){var ge=t.hoverData.down;ge?ge.emit(ne("taphold")):$.emit(ne("taphold"))}},t.tapholdDuration)};if(F.which==3){t.hoverData.cxtStarted=!0;var Ce={originalEvent:F,type:"cxttapstart",position:{x:Q[0],y:Q[1]}};ae?(ae.activate(),ae.emit(Ce),t.hoverData.down=ae):$.emit(Ce),t.hoverData.downTime=new Date().getTime(),t.hoverData.cxtDragged=!1}else if(F.which==1){ae&&ae.activate();{if(ae!=null&&t.nodeIsGrabbable(ae)){var Ee=function(ge){ge.emit(ne("grab"))};if(h(ae),!ae.selected())ie=t.dragData.possibleDragElements=$.collection(),p(ae,{addToList:ie}),ae.emit(ne("grabon")).emit(ne("grab"));else{ie=t.dragData.possibleDragElements=$.collection();var be=$.$(function(me){return me.isNode()&&me.selected()&&t.nodeIsGrabbable(me)});g(be,{addToList:ie}),ae.emit(ne("grabon")),be.forEach(Ee)}t.redrawHint("eles",!0),t.redrawHint("drag",!0)}t.hoverData.down=ae,t.hoverData.downs=fe,t.hoverData.downTime=new Date().getTime()}n(ae,["mousedown","tapstart","vmousedown"],F,{x:Q[0],y:Q[1]}),ae==null?(te[4]=1,t.data.bgActivePosistion={x:Q[0],y:Q[1]},t.redrawHint("select",!0),t.redraw()):ae.pannable()&&(te[4]=1),ve()}te[0]=te[2]=Q[0],te[1]=te[3]=Q[1]}},!1);var S=a(t.container);t.registerBinding([e,S],"mousemove",function(F){var $=t.hoverData.capture;if(!(!$&&!R(F))){var J=!1,Q=t.cy,te=Q.zoom(),fe=[F.clientX,F.clientY],ae=t.projectIntoViewport(fe[0],fe[1]),ie=t.hoverData.mdownPos,ne=t.hoverData.mdownGPos,ve=t.selection,Ce=null;!t.hoverData.draggingEles&&!t.hoverData.dragging&&!t.hoverData.selecting&&(Ce=t.findNearestElement(ae[0],ae[1],!0,!1));var Ee=t.hoverData.last,be=t.hoverData.down,me=[ae[0]-ve[2],ae[1]-ve[3]],ge=t.dragData.possibleDragElements,Ie;if(ne){var Ae=fe[0]-ne[0],Se=Ae*Ae,Ue=fe[1]-ne[1],Ne=Ue*Ue,Pe=Se+Ne;t.hoverData.isOverThresholdDrag=Ie=Pe>=t.desktopTapThreshold2}var We=i(F);Ie&&(t.hoverData.tapholdCancelled=!0);var Je=function(){var pt=t.hoverData.dragDelta=t.hoverData.dragDelta||[];pt.length===0?(pt.push(me[0]),pt.push(me[1])):(pt[0]+=me[0],pt[1]+=me[1])};J=!0,n(Ce,["mousemove","vmousemove","tapdrag"],F,{x:ae[0],y:ae[1]});var ze=function(pt){return{originalEvent:F,type:pt,position:{x:ae[0],y:ae[1]}}},Xe=function(){t.data.bgActivePosistion=void 0,t.hoverData.selecting||Q.emit(ze("boxstart")),ve[4]=1,t.hoverData.selecting=!0,t.redrawHint("select",!0),t.redraw()};if(t.hoverData.which===3){if(Ie){var ft=ze("cxtdrag");be?be.emit(ft):Q.emit(ft),t.hoverData.cxtDragged=!0,(!t.hoverData.cxtOver||Ce!==t.hoverData.cxtOver)&&(t.hoverData.cxtOver&&t.hoverData.cxtOver.emit(ze("cxtdragout")),t.hoverData.cxtOver=Ce,Ce&&Ce.emit(ze("cxtdragover")))}}else if(t.hoverData.dragging){if(J=!0,Q.panningEnabled()&&Q.userPanningEnabled()){var Gt;if(t.hoverData.justStartedPan){var mr=t.hoverData.mdownPos;Gt={x:(ae[0]-mr[0])*te,y:(ae[1]-mr[1])*te},t.hoverData.justStartedPan=!1}else Gt={x:me[0]*te,y:me[1]*te};Q.panBy(Gt),Q.emit(ze("dragpan")),t.hoverData.dragged=!0}ae=t.projectIntoViewport(F.clientX,F.clientY)}else if(ve[4]==1&&(be==null||be.pannable())){if(Ie){if(!t.hoverData.dragging&&Q.boxSelectionEnabled()&&(We||!Q.panningEnabled()||!Q.userPanningEnabled()))Xe();else if(!t.hoverData.selecting&&Q.panningEnabled()&&Q.userPanningEnabled()){var Ot=o(be,t.hoverData.downs);Ot&&(t.hoverData.dragging=!0,t.hoverData.justStartedPan=!0,ve[4]=0,t.data.bgActivePosistion=ga(ie),t.redrawHint("select",!0),t.redraw())}be&&be.pannable()&&be.active()&&be.unactivate()}}else{if(be&&be.pannable()&&be.active()&&be.unactivate(),(!be||!be.grabbed())&&Ce!=Ee&&(Ee&&n(Ee,["mouseout","tapdragout"],F,{x:ae[0],y:ae[1]}),Ce&&n(Ce,["mouseover","tapdragover"],F,{x:ae[0],y:ae[1]}),t.hoverData.last=Ce),be)if(Ie){if(Q.boxSelectionEnabled()&&We)be&&be.grabbed()&&(y(ge),be.emit(ze("freeon")),ge.emit(ze("free")),t.dragData.didDrag&&(be.emit(ze("dragfreeon")),ge.emit(ze("dragfree")))),Xe();else if(be&&be.grabbed()&&t.nodeIsDraggable(be)){var lt=!t.dragData.didDrag;lt&&t.redrawHint("eles",!0),t.dragData.didDrag=!0,t.hoverData.draggingEles||g(ge,{inDragLayer:!0});var it={x:0,y:0};if(Te(me[0])&&Te(me[1])&&(it.x+=me[0],it.y+=me[1],lt)){var st=t.hoverData.dragDelta;st&&Te(st[0])&&Te(st[1])&&(it.x+=st[0],it.y+=st[1])}t.hoverData.draggingEles=!0,ge.silentShift(it).emit(ze("position")).emit(ze("drag")),t.redrawHint("drag",!0),t.redraw()}}else Je();J=!0}if(ve[2]=ae[0],ve[3]=ae[1],J)return F.stopPropagation&&F.stopPropagation(),F.preventDefault&&F.preventDefault(),!1}},!1);var D,P,x;t.registerBinding(e,"mouseup",function(F){if(!(t.hoverData.which===1&&F.which!==1&&t.hoverData.capture)){var $=t.hoverData.capture;if($){t.hoverData.capture=!1;var J=t.cy,Q=t.projectIntoViewport(F.clientX,F.clientY),te=t.selection,fe=t.findNearestElement(Q[0],Q[1],!0,!1),ae=t.dragData.possibleDragElements,ie=t.hoverData.down,ne=i(F);t.data.bgActivePosistion&&(t.redrawHint("select",!0),t.redraw()),t.hoverData.tapholdCancelled=!0,t.data.bgActivePosistion=void 0,ie&&ie.unactivate();var ve=function(Ae){return{originalEvent:F,type:Ae,position:{x:Q[0],y:Q[1]}}};if(t.hoverData.which===3){var Ce=ve("cxttapend");if(ie?ie.emit(Ce):J.emit(Ce),!t.hoverData.cxtDragged){var Ee=ve("cxttap");ie?ie.emit(Ee):J.emit(Ee)}t.hoverData.cxtDragged=!1,t.hoverData.which=null}else if(t.hoverData.which===1){if(n(fe,["mouseup","tapend","vmouseup"],F,{x:Q[0],y:Q[1]}),!t.dragData.didDrag&&!t.hoverData.dragged&&!t.hoverData.selecting&&!t.hoverData.isOverThresholdDrag&&(n(ie,["click","tap","vclick"],F,{x:Q[0],y:Q[1]}),P=!1,F.timeStamp-x<=J.multiClickDebounceTime()?(D&&clearTimeout(D),P=!0,x=null,n(ie,["dblclick","dbltap","vdblclick"],F,{x:Q[0],y:Q[1]})):(D=setTimeout(function(){P||n(ie,["oneclick","onetap","voneclick"],F,{x:Q[0],y:Q[1]})},J.multiClickDebounceTime()),x=F.timeStamp)),ie==null&&!t.dragData.didDrag&&!t.hoverData.selecting&&!t.hoverData.dragged&&!i(F)&&(J.$(r).unselect(["tapunselect"]),ae.length>0&&t.redrawHint("eles",!0),t.dragData.possibleDragElements=ae=J.collection()),fe==ie&&!t.dragData.didDrag&&!t.hoverData.selecting&&fe!=null&&fe._private.selectable&&(t.hoverData.dragging||(J.selectionType()==="additive"||ne?fe.selected()?fe.unselect(["tapunselect"]):fe.select(["tapselect"]):ne||(J.$(r).unmerge(fe).unselect(["tapunselect"]),fe.select(["tapselect"]))),t.redrawHint("eles",!0)),t.hoverData.selecting){var be=J.collection(t.getAllInBox(te[0],te[1],te[2],te[3]));t.redrawHint("select",!0),be.length>0&&t.redrawHint("eles",!0),J.emit(ve("boxend"));var me=function(Ae){return Ae.selectable()&&!Ae.selected()};J.selectionType()==="additive"||ne||J.$(r).unmerge(be).unselect(),be.emit(ve("box")).stdFilter(me).select().emit(ve("boxselect")),t.redraw()}if(t.hoverData.dragging&&(t.hoverData.dragging=!1,t.redrawHint("select",!0),t.redrawHint("eles",!0),t.redraw()),!te[4]){t.redrawHint("drag",!0),t.redrawHint("eles",!0);var ge=ie&&ie.grabbed();y(ae),ge&&(ie.emit(ve("freeon")),ae.emit(ve("free")),t.dragData.didDrag&&(ie.emit(ve("dragfreeon")),ae.emit(ve("dragfree"))))}}te[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 N=[],M=4,I,O=1e5,q=function(F,$){for(var J=0;J<F.length;J++)if(F[J]%$!==0)return!1;return!0},_=function(F){for(var $=Math.abs(F[0]),J=1;J<F.length;J++)if(Math.abs(F[J])!==$)return!1;return!0},B=function(F){var $=!1,J=F.deltaY;if(J==null&&(F.wheelDeltaY!=null?J=F.wheelDeltaY/4:F.wheelDelta!=null&&(J=F.wheelDelta/4)),J!==0){if(I==null)if(N.length>=M){var Q=N;if(I=q(Q,5),!I){var te=Math.abs(Q[0]);I=_(Q)&&te>5}if(I)for(var fe=0;fe<Q.length;fe++)O=Math.min(Math.abs(Q[fe]),O)}else N.push(J),$=!0;else I&&(O=Math.min(Math.abs(J),O));if(!t.scrollingPage){var ae=t.cy,ie=ae.zoom(),ne=ae.pan(),ve=t.projectIntoViewport(F.clientX,F.clientY),Ce=[ve[0]*ie+ne.x,ve[1]*ie+ne.y];if(t.hoverData.draggingEles||t.hoverData.dragging||t.hoverData.cxtStarted||A()){F.preventDefault();return}if(ae.panningEnabled()&&ae.userPanningEnabled()&&ae.zoomingEnabled()&&ae.userZoomingEnabled()){F.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 Ee;$&&Math.abs(J)>5&&(J=Iv(J)*5),Ee=J/-250,I&&(Ee/=O,Ee*=3),Ee=Ee*t.wheelSensitivity;var be=F.deltaMode===1;be&&(Ee*=33);var me=ae.zoom()*Math.pow(10,Ee);F.type==="gesturechange"&&(me=t.gestureStartZoom*F.scale),ae.zoom({level:me,renderedPosition:{x:Ce[0],y:Ce[1]}}),ae.emit({type:F.type==="gesturechange"?"pinchzoom":"scrollzoom",originalEvent:F,position:{x:ve[0],y:ve[1]}})}}}};t.registerBinding(t.container,"wheel",B,!0),t.registerBinding(e,"scroll",function(F){t.scrollingPage=!0,clearTimeout(t.scrollingPageTimeout),t.scrollingPageTimeout=setTimeout(function(){t.scrollingPage=!1},250)},!0),t.registerBinding(t.container,"gesturestart",function(F){t.gestureStartZoom=t.cy.zoom(),t.hasTouchStarted||F.preventDefault()},!0),t.registerBinding(t.container,"gesturechange",function(K){t.hasTouchStarted||B(K)},!0),t.registerBinding(t.container,"mouseout",function(F){var $=t.projectIntoViewport(F.clientX,F.clientY);t.cy.emit({originalEvent:F,type:"mouseout",position:{x:$[0],y:$[1]}})},!1),t.registerBinding(t.container,"mouseover",function(F){var $=t.projectIntoViewport(F.clientX,F.clientY);t.cy.emit({originalEvent:F,type:"mouseover",position:{x:$[0],y:$[1]}})},!1);var z,Y,k,G,U,W,j,H,V,X,Z,ee,re,ue=function(F,$,J,Q){return Math.sqrt((J-F)*(J-F)+(Q-$)*(Q-$))},xe=function(F,$,J,Q){return(J-F)*(J-F)+(Q-$)*(Q-$)},se;t.registerBinding(t.container,"touchstart",se=function(F){if(t.hasTouchStarted=!0,!!R(F)){m(),t.touchData.capture=!0,t.data.bgActivePosistion=void 0;var $=t.cy,J=t.touchData.now,Q=t.touchData.earlier;if(F.touches[0]){var te=t.projectIntoViewport(F.touches[0].clientX,F.touches[0].clientY);J[0]=te[0],J[1]=te[1]}if(F.touches[1]){var te=t.projectIntoViewport(F.touches[1].clientX,F.touches[1].clientY);J[2]=te[0],J[3]=te[1]}if(F.touches[2]){var te=t.projectIntoViewport(F.touches[2].clientX,F.touches[2].clientY);J[4]=te[0],J[5]=te[1]}var fe=function(We){return{originalEvent:F,type:We,position:{x:J[0],y:J[1]}}};if(F.touches[1]){t.touchData.singleTouchMoved=!0,y(t.dragData.touchDragEles);var ae=t.findContainerClientCoords();V=ae[0],X=ae[1],Z=ae[2],ee=ae[3],z=F.touches[0].clientX-V,Y=F.touches[0].clientY-X,k=F.touches[1].clientX-V,G=F.touches[1].clientY-X,re=0<=z&&z<=Z&&0<=k&&k<=Z&&0<=Y&&Y<=ee&&0<=G&&G<=ee;var ie=$.pan(),ne=$.zoom();U=ue(z,Y,k,G),W=xe(z,Y,k,G),j=[(z+k)/2,(Y+G)/2],H=[(j[0]-ie.x)/ne,(j[1]-ie.y)/ne];var ve=200,Ce=ve*ve;if(W<Ce&&!F.touches[2]){var Ee=t.findNearestElement(J[0],J[1],!0,!0),be=t.findNearestElement(J[2],J[3],!0,!0);Ee&&Ee.isNode()?(Ee.activate().emit(fe("cxttapstart")),t.touchData.start=Ee):be&&be.isNode()?(be.activate().emit(fe("cxttapstart")),t.touchData.start=be):$.emit(fe("cxttapstart")),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(F.touches[2])$.boxSelectionEnabled()&&F.preventDefault();else if(!F.touches[1]){if(F.touches[0]){var me=t.findNearestElements(J[0],J[1],!0,!0),ge=me[0];if(ge!=null&&(ge.activate(),t.touchData.start=ge,t.touchData.starts=me,t.nodeIsGrabbable(ge))){var Ie=t.dragData.touchDragEles=$.collection(),Ae=null;t.redrawHint("eles",!0),t.redrawHint("drag",!0),ge.selected()?(Ae=$.$(function(Pe){return Pe.selected()&&t.nodeIsGrabbable(Pe)}),g(Ae,{addToList:Ie})):p(ge,{addToList:Ie}),h(ge),ge.emit(fe("grabon")),Ae?Ae.forEach(function(Pe){Pe.emit(fe("grab"))}):ge.emit(fe("grab"))}n(ge,["touchstart","tapstart","vmousedown"],F,{x:J[0],y:J[1]}),ge==null&&(t.data.bgActivePosistion={x:te[0],y:te[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(){t.touchData.singleTouchMoved===!1&&!t.pinching&&!t.touchData.selecting&&n(t.touchData.start,["taphold"],F,{x:J[0],y:J[1]})},t.tapholdDuration)}}if(F.touches.length>=1){for(var Se=t.touchData.startPosition=[null,null,null,null,null,null],Ue=0;Ue<J.length;Ue++)Se[Ue]=Q[Ue]=J[Ue];var Ne=F.touches[0];t.touchData.startGPosition=[Ne.clientX,Ne.clientY]}}},!1);var oe;t.registerBinding(e,"touchmove",oe=function(F){var $=t.touchData.capture;if(!(!$&&!R(F))){var J=t.selection,Q=t.cy,te=t.touchData.now,fe=t.touchData.earlier,ae=Q.zoom();if(F.touches[0]){var ie=t.projectIntoViewport(F.touches[0].clientX,F.touches[0].clientY);te[0]=ie[0],te[1]=ie[1]}if(F.touches[1]){var ie=t.projectIntoViewport(F.touches[1].clientX,F.touches[1].clientY);te[2]=ie[0],te[3]=ie[1]}if(F.touches[2]){var ie=t.projectIntoViewport(F.touches[2].clientX,F.touches[2].clientY);te[4]=ie[0],te[5]=ie[1]}var ne=function(sx){return{originalEvent:F,type:sx,position:{x:te[0],y:te[1]}}},ve=t.touchData.startGPosition,Ce;if($&&F.touches[0]&&ve){for(var Ee=[],be=0;be<te.length;be++)Ee[be]=te[be]-fe[be];var me=F.touches[0].clientX-ve[0],ge=me*me,Ie=F.touches[0].clientY-ve[1],Ae=Ie*Ie,Se=ge+Ae;Ce=Se>=t.touchTapThreshold2}if($&&t.touchData.cxt){F.preventDefault();var Ue=F.touches[0].clientX-V,Ne=F.touches[0].clientY-X,Pe=F.touches[1].clientX-V,We=F.touches[1].clientY-X,Je=xe(Ue,Ne,Pe,We),ze=Je/W,Xe=150,ft=Xe*Xe,Gt=1.5,mr=Gt*Gt;if(ze>=mr||Je>=ft){t.touchData.cxt=!1,t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var Ot=ne("cxttapend");t.touchData.start?(t.touchData.start.unactivate().emit(Ot),t.touchData.start=null):Q.emit(Ot)}}if($&&t.touchData.cxt){var Ot=ne("cxtdrag");t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.touchData.start?t.touchData.start.emit(Ot):Q.emit(Ot),t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxtDragged=!0;var lt=t.findNearestElement(te[0],te[1],!0,!0);(!t.touchData.cxtOver||lt!==t.touchData.cxtOver)&&(t.touchData.cxtOver&&t.touchData.cxtOver.emit(ne("cxtdragout")),t.touchData.cxtOver=lt,lt&&lt.emit(ne("cxtdragover")))}else if($&&F.touches[2]&&Q.boxSelectionEnabled())F.preventDefault(),t.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,t.touchData.selecting||Q.emit(ne("boxstart")),t.touchData.selecting=!0,t.touchData.didSelect=!0,J[4]=1,!J||J.length===0||J[0]===void 0?(J[0]=(te[0]+te[2]+te[4])/3,J[1]=(te[1]+te[3]+te[5])/3,J[2]=(te[0]+te[2]+te[4])/3+1,J[3]=(te[1]+te[3]+te[5])/3+1):(J[2]=(te[0]+te[2]+te[4])/3,J[3]=(te[1]+te[3]+te[5])/3),t.redrawHint("select",!0),t.redraw();else if($&&F.touches[1]&&!t.touchData.didSelect&&Q.zoomingEnabled()&&Q.panningEnabled()&&Q.userZoomingEnabled()&&Q.userPanningEnabled()){F.preventDefault(),t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var it=t.dragData.touchDragEles;if(it){t.redrawHint("drag",!0);for(var st=0;st<it.length;st++){var jt=it[st]._private;jt.grabbed=!1,jt.rscratch.inDragLayer=!1}}var pt=t.touchData.start,Ue=F.touches[0].clientX-V,Ne=F.touches[0].clientY-X,Pe=F.touches[1].clientX-V,We=F.touches[1].clientY-X,ur=ue(Ue,Ne,Pe,We),Mn=ur/U;if(re){var Ba=Ue-z,On=Ne-Y,ka=Pe-k,uo=We-G,qa=(Ba+ka)/2,In=(On+uo)/2,br=Q.zoom(),Gr=br*Mn,Ur=Q.pan(),ht=H[0]*br+Ur.x,qe=H[1]*br+Ur.y,$e={x:-Gr/br*(ht-Ur.x-qa)+ht,y:-Gr/br*(qe-Ur.y-In)+qe};if(pt&&pt.active()){var it=t.dragData.touchDragEles;y(it),t.redrawHint("drag",!0),t.redrawHint("eles",!0),pt.unactivate().emit(ne("freeon")),it.emit(ne("free")),t.dragData.didDrag&&(pt.emit(ne("dragfreeon")),it.emit(ne("dragfree")))}Q.viewport({zoom:Gr,pan:$e,cancelOnFailedZoom:!0}),Q.emit(ne("pinchzoom")),U=ur,z=Ue,Y=Ne,k=Pe,G=We,t.pinching=!0}if(F.touches[0]){var ie=t.projectIntoViewport(F.touches[0].clientX,F.touches[0].clientY);te[0]=ie[0],te[1]=ie[1]}if(F.touches[1]){var ie=t.projectIntoViewport(F.touches[1].clientX,F.touches[1].clientY);te[2]=ie[0],te[3]=ie[1]}if(F.touches[2]){var ie=t.projectIntoViewport(F.touches[2].clientX,F.touches[2].clientY);te[4]=ie[0],te[5]=ie[1]}}else if(F.touches[0]&&!t.touchData.didSelect){var ct=t.touchData.start,St=t.touchData.last,lt;if(!t.hoverData.draggingEles&&!t.swipePanning&&(lt=t.findNearestElement(te[0],te[1],!0,!0)),$&&ct!=null&&F.preventDefault(),$&&ct!=null&&t.nodeIsDraggable(ct))if(Ce){var it=t.dragData.touchDragEles,dd=!t.dragData.didDrag;dd&&g(it,{inDragLayer:!0}),t.dragData.didDrag=!0;var Ga={x:0,y:0};if(Te(Ee[0])&&Te(Ee[1])&&(Ga.x+=Ee[0],Ga.y+=Ee[1],dd)){t.redrawHint("eles",!0);var $t=t.touchData.dragDelta;$t&&Te($t[0])&&Te($t[1])&&(Ga.x+=$t[0],Ga.y+=$t[1])}t.hoverData.draggingEles=!0,it.silentShift(Ga).emit(ne("position")).emit(ne("drag")),t.redrawHint("drag",!0),t.touchData.startPosition[0]==fe[0]&&t.touchData.startPosition[1]==fe[1]&&t.redrawHint("eles",!0),t.redraw()}else{var $t=t.touchData.dragDelta=t.touchData.dragDelta||[];$t.length===0?($t.push(Ee[0]),$t.push(Ee[1])):($t[0]+=Ee[0],$t[1]+=Ee[1])}if(n(ct||lt,["touchmove","tapdrag","vmousemove"],F,{x:te[0],y:te[1]}),(!ct||!ct.grabbed())&&lt!=St&&(St&&St.emit(ne("tapdragout")),lt&&lt.emit(ne("tapdragover"))),t.touchData.last=lt,$)for(var st=0;st<te.length;st++)te[st]&&t.touchData.startPosition[st]&&Ce&&(t.touchData.singleTouchMoved=!0);if($&&(ct==null||ct.pannable())&&Q.panningEnabled()&&Q.userPanningEnabled()){var ox=o(ct,t.touchData.starts);ox&&(F.preventDefault(),t.data.bgActivePosistion||(t.data.bgActivePosistion=ga(t.touchData.startPosition)),t.swipePanning?(Q.panBy({x:Ee[0]*ae,y:Ee[1]*ae}),Q.emit(ne("dragpan"))):Ce&&(t.swipePanning=!0,Q.panBy({x:me*ae,y:Ie*ae}),Q.emit(ne("dragpan")),ct&&(ct.unactivate(),t.redrawHint("select",!0),t.touchData.start=null)));var ie=t.projectIntoViewport(F.touches[0].clientX,F.touches[0].clientY);te[0]=ie[0],te[1]=ie[1]}}for(var be=0;be<te.length;be++)fe[be]=te[be];$&&F.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 he;t.registerBinding(e,"touchcancel",he=function(F){var $=t.touchData.start;t.touchData.capture=!1,$&&$.unactivate()});var le,de,pe,ce;if(t.registerBinding(e,"touchend",le=function(F){var $=t.touchData.start,J=t.touchData.capture;if(J)F.touches.length===0&&(t.touchData.capture=!1),F.preventDefault();else return;var Q=t.selection;t.swipePanning=!1,t.hoverData.draggingEles=!1;var te=t.cy,fe=te.zoom(),ae=t.touchData.now,ie=t.touchData.earlier;if(F.touches[0]){var ne=t.projectIntoViewport(F.touches[0].clientX,F.touches[0].clientY);ae[0]=ne[0],ae[1]=ne[1]}if(F.touches[1]){var ne=t.projectIntoViewport(F.touches[1].clientX,F.touches[1].clientY);ae[2]=ne[0],ae[3]=ne[1]}if(F.touches[2]){var ne=t.projectIntoViewport(F.touches[2].clientX,F.touches[2].clientY);ae[4]=ne[0],ae[5]=ne[1]}var ve=function(ft){return{originalEvent:F,type:ft,position:{x:ae[0],y:ae[1]}}};$&&$.unactivate();var Ce;if(t.touchData.cxt){if(Ce=ve("cxttapend"),$?$.emit(Ce):te.emit(Ce),!t.touchData.cxtDragged){var Ee=ve("cxttap");$?$.emit(Ee):te.emit(Ee)}t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxt=!1,t.touchData.start=null,t.redraw();return}if(!F.touches[2]&&te.boxSelectionEnabled()&&t.touchData.selecting){t.touchData.selecting=!1;var be=te.collection(t.getAllInBox(Q[0],Q[1],Q[2],Q[3]));Q[0]=void 0,Q[1]=void 0,Q[2]=void 0,Q[3]=void 0,Q[4]=0,t.redrawHint("select",!0),te.emit(ve("boxend"));var me=function(ft){return ft.selectable()&&!ft.selected()};be.emit(ve("box")).stdFilter(me).select().emit(ve("boxselect")),be.nonempty()&&t.redrawHint("eles",!0),t.redraw()}if($!=null&&$.unactivate(),F.touches[2])t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);else if(!F.touches[1]){if(!F.touches[0]){if(!F.touches[0]){t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var ge=t.dragData.touchDragEles;if($!=null){var Ie=$._private.grabbed;y(ge),t.redrawHint("drag",!0),t.redrawHint("eles",!0),Ie&&($.emit(ve("freeon")),ge.emit(ve("free")),t.dragData.didDrag&&($.emit(ve("dragfreeon")),ge.emit(ve("dragfree")))),n($,["touchend","tapend","vmouseup","tapdragout"],F,{x:ae[0],y:ae[1]}),$.unactivate(),t.touchData.start=null}else{var Ae=t.findNearestElement(ae[0],ae[1],!0,!0);n(Ae,["touchend","tapend","vmouseup","tapdragout"],F,{x:ae[0],y:ae[1]})}var Se=t.touchData.startPosition[0]-ae[0],Ue=Se*Se,Ne=t.touchData.startPosition[1]-ae[1],Pe=Ne*Ne,We=Ue+Pe,Je=We*fe*fe;t.touchData.singleTouchMoved||($||te.$(":selected").unselect(["tapunselect"]),n($,["tap","vclick"],F,{x:ae[0],y:ae[1]}),de=!1,F.timeStamp-ce<=te.multiClickDebounceTime()?(pe&&clearTimeout(pe),de=!0,ce=null,n($,["dbltap","vdblclick"],F,{x:ae[0],y:ae[1]})):(pe=setTimeout(function(){de||n($,["onetap","voneclick"],F,{x:ae[0],y:ae[1]})},te.multiClickDebounceTime()),ce=F.timeStamp)),$!=null&&!t.dragData.didDrag&&$._private.selectable&&Je<t.touchTapThreshold2&&!t.pinching&&(te.selectionType()==="single"?(te.$(r).unmerge($).unselect(["tapunselect"]),$.select(["tapselect"])):$.selected()?$.unselect(["tapunselect"]):$.select(["tapselect"]),t.redrawHint("eles",!0)),t.touchData.singleTouchMoved=!0}}}for(var ze=0;ze<ae.length;ze++)ie[ze]=ae[ze];t.dragData.didDrag=!1,F.touches.length===0&&(t.touchData.dragDelta=[],t.touchData.startPosition=[null,null,null,null,null,null],t.touchData.startGPosition=null,t.touchData.didSelect=!1),F.touches.length<2&&(F.touches.length===1&&(t.touchData.startGPosition=[F.touches[0].clientX,F.touches[0].clientY]),t.pinching=!1,t.redrawHint("eles",!0),t.redraw())},!1),typeof TouchEvent>"u"){var ye=[],Le=function(F){return{clientX:F.clientX,clientY:F.clientY,force:1,identifier:F.pointerId,pageX:F.pageX,pageY:F.pageY,radiusX:F.width/2,radiusY:F.height/2,screenX:F.screenX,screenY:F.screenY,target:F.target}},_e=function(F){return{event:F,touch:Le(F)}},ke=function(F){ye.push(_e(F))},Oe=function(F){for(var $=0;$<ye.length;$++){var J=ye[$];if(J.event.pointerId===F.pointerId){ye.splice($,1);return}}},Fe=function(F){var $=ye.filter(function(J){return J.event.pointerId===F.pointerId})[0];$.event=F,$.touch=Le(F)},Re=function(F){F.touches=ye.map(function($){return $.touch})},we=function(F){return F.pointerType==="mouse"||F.pointerType===4};t.registerBinding(t.container,"pointerdown",function(K){we(K)||(K.preventDefault(),ke(K),Re(K),se(K))}),t.registerBinding(t.container,"pointerup",function(K){we(K)||(Oe(K),Re(K),le(K))}),t.registerBinding(t.container,"pointercancel",function(K){we(K)||(Oe(K),Re(K),he(K))}),t.registerBinding(t.container,"pointermove",function(K){we(K)||(K.preventDefault(),Fe(K),Re(K),oe(K))})}};var dr={};dr.generatePolygon=function(t,e){return this.nodeShapes[t]={renderer:this,name:t,points:e,draw:function(a,n,i,o,s,u){this.renderer.nodeShapeImpl("polygon",a,n,i,o,s,this.points)},intersectLine:function(a,n,i,o,s,u,l,f){return un(s,u,this.points,a,n,i/2,o/2,l)},checkPoint:function(a,n,i,o,s,u,l,f){return vr(a,n,this.points,u,l,o,s,[0,-1],i)},hasMiterBounds:t!=="rectangle",miterBounds:function(a,n,i,o,s,u){return kC(this.points,a,n,i,o,s)}}};dr.generateEllipse=function(){return this.nodeShapes.ellipse={renderer:this,name:"ellipse",draw:function(e,r,a,n,i,o){this.renderer.nodeShapeImpl(this.name,e,r,a,n,i)},intersectLine:function(e,r,a,n,i,o,s,u){return XC(i,o,e,r,a/2+s,n/2+s)},checkPoint:function(e,r,a,n,i,o,s,u){return Wr(e,r,n,i,o,s,a)}}};dr.generateRoundPolygon=function(t,e){return this.nodeShapes[t]={renderer:this,name:t,points:e,getOrCreateCorners:function(a,n,i,o,s,u,l){if(u[l]!==void 0&&u[l+"-cx"]===a&&u[l+"-cy"]===n)return u[l];u[l]=new Array(e.length/2),u[l+"-cx"]=a,u[l+"-cy"]=n;var f=i/2,h=o/2;s=s==="auto"?GE(i,o):s;for(var v=new Array(e.length/2),c=0;c<e.length/2;c++)v[c]={x:a+f*e[c*2],y:n+h*e[c*2+1]};var d,g,p,y,b=v.length;for(g=v[b-1],d=0;d<b;d++)p=v[d%b],y=v[(d+1)%b],u[l][d]=Xv(g,p,y,s),g=p,p=y;return u[l]},draw:function(a,n,i,o,s,u,l){this.renderer.nodeShapeImpl("round-polygon",a,n,i,o,s,this.points,this.getOrCreateCorners(n,i,o,s,u,l,"drawCorners"))},intersectLine:function(a,n,i,o,s,u,l,f,h){return WC(s,u,this.points,a,n,i,o,l,this.getOrCreateCorners(a,n,i,o,f,h,"corners"))},checkPoint:function(a,n,i,o,s,u,l,f,h){return HC(a,n,this.points,u,l,o,s,this.getOrCreateCorners(u,l,o,s,f,h,"corners"))}}};dr.generateRoundRectangle=function(){return this.nodeShapes["round-rectangle"]=this.nodeShapes.roundrectangle={renderer:this,name:"round-rectangle",points:It(4,0),draw:function(e,r,a,n,i,o){this.renderer.nodeShapeImpl(this.name,e,r,a,n,i,this.points,o)},intersectLine:function(e,r,a,n,i,o,s,u){return kE(i,o,e,r,a,n,s,u)},checkPoint:function(e,r,a,n,i,o,s,u){var l=n/2,f=i/2;u=u==="auto"?Nr(n,i):u,u=Math.min(l,f,u);var h=u*2;return!!(vr(e,r,this.points,o,s,n,i-h,[0,-1],a)||vr(e,r,this.points,o,s,n-h,i,[0,-1],a)||Wr(e,r,h,h,o-l+u,s-f+u,a)||Wr(e,r,h,h,o+l-u,s-f+u,a)||Wr(e,r,h,h,o+l-u,s+f-u,a)||Wr(e,r,h,h,o-l+u,s+f-u,a))}}};dr.generateCutRectangle=function(){return this.nodeShapes["cut-rectangle"]=this.nodeShapes.cutrectangle={renderer:this,name:"cut-rectangle",cornerLength:Fv(),points:It(4,0),draw:function(e,r,a,n,i,o){this.renderer.nodeShapeImpl(this.name,e,r,a,n,i,null,o)},generateCutTrianglePts:function(e,r,a,n,i){var o=i==="auto"?this.cornerLength:i,s=r/2,u=e/2,l=a-u,f=a+u,h=n-s,v=n+s;return{topLeft:[l,h+o,l+o,h,l+o,h+o],topRight:[f-o,h,f,h+o,f-o,h+o],bottomRight:[f,v-o,f-o,v,f-o,v-o],bottomLeft:[l+o,v,l,v-o,l+o,v-o]}},intersectLine:function(e,r,a,n,i,o,s,u){var l=this.generateCutTrianglePts(a+2*s,n+2*s,e,r,u),f=[].concat.apply([],[l.topLeft.splice(0,4),l.topRight.splice(0,4),l.bottomRight.splice(0,4),l.bottomLeft.splice(0,4)]);return un(i,o,f,e,r)},checkPoint:function(e,r,a,n,i,o,s,u){var l=u==="auto"?this.cornerLength:u;if(vr(e,r,this.points,o,s,n,i-2*l,[0,-1],a)||vr(e,r,this.points,o,s,n-2*l,i,[0,-1],a))return!0;var f=this.generateCutTrianglePts(n,i,o,s);return Bt(e,r,f.topLeft)||Bt(e,r,f.topRight)||Bt(e,r,f.bottomRight)||Bt(e,r,f.bottomLeft)}}};dr.generateBarrel=function(){return this.nodeShapes.barrel={renderer:this,name:"barrel",points:It(4,0),draw:function(e,r,a,n,i,o){this.renderer.nodeShapeImpl(this.name,e,r,a,n,i)},intersectLine:function(e,r,a,n,i,o,s,u){var l=.15,f=.5,h=.85,v=this.generateBarrelBezierPts(a+2*s,n+2*s,e,r),c=function(p){var y=ma({x:p[0],y:p[1]},{x:p[2],y:p[3]},{x:p[4],y:p[5]},l),b=ma({x:p[0],y:p[1]},{x:p[2],y:p[3]},{x:p[4],y:p[5]},f),m=ma({x:p[0],y:p[1]},{x:p[2],y:p[3]},{x:p[4],y:p[5]},h);return[p[0],p[1],y.x,y.y,b.x,b.y,m.x,m.y,p[4],p[5]]},d=[].concat(c(v.topLeft),c(v.topRight),c(v.bottomRight),c(v.bottomLeft));return un(i,o,d,e,r)},generateBarrelBezierPts:function(e,r,a,n){var i=r/2,o=e/2,s=a-o,u=a+o,l=n-i,f=n+i,h=ov(e,r),v=h.heightOffset,c=h.widthOffset,d=h.ctrlPtOffsetPct*e,g={topLeft:[s,l+v,s+d,l,s+c,l],topRight:[u-c,l,u-d,l,u,l+v],bottomRight:[u,f-v,u-d,f,u-c,f],bottomLeft:[s+c,f,s+d,f,s,f-v]};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,o,s,u){var l=ov(n,i),f=l.heightOffset,h=l.widthOffset;if(vr(e,r,this.points,o,s,n,i-2*f,[0,-1],a)||vr(e,r,this.points,o,s,n-2*h,i,[0,-1],a))return!0;for(var v=this.generateBarrelBezierPts(n,i,o,s),c=function(C,A,R){var S=R[4],D=R[2],P=R[0],x=R[5],N=R[1],M=Math.min(S,P),I=Math.max(S,P),O=Math.min(x,N),q=Math.max(x,N);if(M<=C&&C<=I&&O<=A&&A<=q){var _=KC(S,D,P),B=UC(_[0],_[1],_[2],C),z=B.filter(function(Y){return 0<=Y&&Y<=1});if(z.length>0)return z[0]}return null},d=Object.keys(v),g=0;g<d.length;g++){var p=d[g],y=v[p],b=c(e,r,y);if(b!=null){var m=y[5],E=y[3],T=y[1],L=wt(m,E,T,b);if(y.isTop&&L<=r||y.isBottom&&r<=L)return!0}}return!1}}};dr.generateBottomRoundrectangle=function(){return this.nodeShapes["bottom-round-rectangle"]=this.nodeShapes.bottomroundrectangle={renderer:this,name:"bottom-round-rectangle",points:It(4,0),draw:function(e,r,a,n,i,o){this.renderer.nodeShapeImpl(this.name,e,r,a,n,i,this.points,o)},intersectLine:function(e,r,a,n,i,o,s,u){var l=e-(a/2+s),f=r-(n/2+s),h=f,v=e+(a/2+s),c=Ar(i,o,e,r,l,f,v,h,!1);return c.length>0?c:kE(i,o,e,r,a,n,s,u)},checkPoint:function(e,r,a,n,i,o,s,u){u=u==="auto"?Nr(n,i):u;var l=2*u;if(vr(e,r,this.points,o,s,n,i-l,[0,-1],a)||vr(e,r,this.points,o,s,n-l,i,[0,-1],a))return!0;var f=n/2+2*a,h=i/2+2*a,v=[o-f,s-h,o-f,s,o+f,s,o+f,s-h];return!!(Bt(e,r,v)||Wr(e,r,l,l,o+n/2-u,s+i/2-u,a)||Wr(e,r,l,l,o-n/2+u,s+i/2-u,a))}}};dr.registerNodeShapes=function(){var t=this.nodeShapes={},e=this;this.generateEllipse(),this.generatePolygon("triangle",It(3,0)),this.generateRoundPolygon("round-triangle",It(3,0)),this.generatePolygon("rectangle",It(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",It(5,0)),this.generateRoundPolygon("round-pentagon",It(5,0)),this.generatePolygon("hexagon",It(6,0)),this.generateRoundPolygon("round-hexagon",It(6,0)),this.generatePolygon("heptagon",It(7,0)),this.generateRoundPolygon("round-heptagon",It(7,0)),this.generatePolygon("octagon",It(8,0)),this.generateRoundPolygon("round-octagon",It(8,0));var a=new Array(20);{var n=iv(5,0),i=iv(5,Math.PI/5),o=.5*(3-Math.sqrt(5));o*=1.57;for(var s=0;s<i.length/2;s++)i[s*2]*=o,i[s*2+1]*=o;for(var s=0;s<20/4;s++)a[s*4]=n[s*2],a[s*4+1]=n[s*2+1],a[s*4+2]=i[s*2],a[s*4+3]=i[s*2+1]}a=qE(a),this.generatePolygon("star",a),this.generatePolygon("vee",[-1,-1,0,-.333,1,-1,0,1]),this.generatePolygon("rhomboid",[-1,-1,.333,-1,1,1,-.333,1]),this.generatePolygon("right-rhomboid",[-.333,-1,1,-1,.333,1,-1,1]),this.nodeShapes.concavehexagon=this.generatePolygon("concave-hexagon",[-1,-.95,-.75,0,-1,.95,1,.95,.75,0,1,-.95]);{var u=[-1,-1,.25,-1,1,0,.25,1,-1,1];this.generatePolygon("tag",u),this.generateRoundPolygon("round-tag",u)}t.makePolygon=function(l){var f=l.join("$"),h="polygon-"+f,v;return(v=this[h])?v:e.generatePolygon(h,l)}};var Cn={};Cn.timeToRender=function(){return this.redrawTotalTime/this.redrawCount};Cn.redraw=function(t){t=t||PE();var e=this;e.averageRedrawTime===void 0&&(e.averageRedrawTime=0),e.lastRedrawTime===void 0&&(e.lastRedrawTime=0),e.lastDrawTime===void 0&&(e.lastDrawTime=0),e.requestedFrame=!0,e.renderOptions=t};Cn.beforeRender=function(t,e){if(!this.destroyed){e==null&&at("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 Lp=function(e,r,a){for(var n=e.beforeRenderCallbacks,i=0;i<n.length;i++)n[i].fn(r,a)};Cn.startRenderLoop=function(){var t=this,e=t.cy;if(!t.renderLoopStarted){t.renderLoopStarted=!0;var r=function(n){if(!t.destroyed){if(!e.batching())if(t.requestedFrame&&!t.skipFrame){Lp(t,!0,n);var i=cr();t.render(t.renderOptions);var o=t.lastDrawTime=cr();t.averageRedrawTime===void 0&&(t.averageRedrawTime=o-i),t.redrawCount===void 0&&(t.redrawCount=0),t.redrawCount++,t.redrawTotalTime===void 0&&(t.redrawTotalTime=0);var s=o-i;t.redrawTotalTime+=s,t.lastRedrawTime=s,t.averageRedrawTime=t.averageRedrawTime/2+s/2,t.requestedFrame=!1}else Lp(t,!1,n);t.skipFrame=!1,di(r)}};di(r)}};var hS=function(e){this.init(e)},Gw=hS,Ma=Gw.prototype;Ma.clientFunctions=["redrawHint","render","renderTo","matchCanvasSize","nodeShapeImpl","arrowShapeImpl"];Ma.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,o="__________cytoscape_stylesheet",s="__________cytoscape_container",u=n.getElementById(o)!=null;if(r.className.indexOf(s)<0&&(r.className=(r.className||"")+" "+s),!u){var l=n.createElement("style");l.id=o,l.textContent="."+s+" { position: relative; }",i.insertBefore(l,i.children[0])}var f=a.getComputedStyle(r),h=f.getPropertyValue("position");h==="static"&&Ze("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=[.05,.225,.4,.5,.6,.775,.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=Te(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()};Ma.notify=function(t,e){var r=this,a=r.cy;if(!this.destroyed){if(t==="init"){r.load();return}if(t==="destroy"){r.destroy();return}(t==="add"||t==="remove"||t==="move"&&a.hasCompoundNodes()||t==="load"||t==="zorder"||t==="mount")&&r.invalidateCachedZSortedEles(),t==="viewport"&&r.redrawHint("select",!0),t==="gc"&&r.redrawHint("gc",!0),(t==="load"||t==="resize"||t==="mount")&&(r.invalidateContainerClientCoordsCache(),r.matchCanvasSize(r.container)),r.redrawHint("eles",!0),r.redrawHint("drag",!0),this.startRenderLoop(),this.redraw()}};Ma.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(),t.styleObserver&&t.styleObserver.disconnect(),t.resizeObserver&&t.resizeObserver.disconnect(),t.labelCalcDiv)try{document.body.removeChild(t.labelCalcDiv)}catch{}};Ma.isHeadless=function(){return!1};[Hv,kw,qw,Na,dr,Cn].forEach(function(t){Be(Ma,t)});var Os=1e3/60,Uw={setupDequeueing:function(e){return function(){var a=this,n=this.renderer;if(!a.dequeueingSetup){a.dequeueingSetup=!0;var i=bn(function(){n.redrawHint("eles",!0),n.redrawHint("drag",!0),n.redraw()},e.deqRedrawThreshold),o=function(l,f){var h=cr(),v=n.averageRedrawTime,c=n.lastRedrawTime,d=[],g=n.cy.extent(),p=n.getPixelRatio();for(l||n.flushRenderedStyleQueue();;){var y=cr(),b=y-h,m=y-f;if(c<Os){var E=Os-(l?v:0);if(m>=e.deqFastCost*E)break}else if(l){if(b>=e.deqCost*c||b>=e.deqAvgCost*v)break}else if(m>=e.deqNoDrawCost*Os)break;var T=e.deq(a,p,g);if(T.length>0)for(var L=0;L<T.length;L++)d.push(T[L]);else break}d.length>0&&(e.onDeqd(a,d),!l&&e.shouldRedraw(a,d,p,g)&&i())},s=e.priority||Nv;n.beforeRender(o,s(a))}}}},cS=(function(){function t(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:gi;Pr(this,t),this.idsByKey=new hr,this.keyForId=new hr,this.cachesByLvl=new hr,this.lvls=[],this.getKey=e,this.doesEleInvalidateKey=r}return Fr(t,[{key:"getIdsFor",value:function(r){r==null&&at("Can not get id list for null key");var a=this.idsByKey,n=this.idsByKey.get(r);return n||(n=new La,a.set(r,n)),n}},{key:"addIdForKey",value:function(r,a){r!=null&&this.getIdsFor(r).add(a)}},{key:"deleteIdForKey",value:function(r,a){r!=null&&this.getIdsFor(r).delete(a)}},{key:"getNumberOfIdsForKey",value:function(r){return r==null?0:this.getIdsFor(r).size}},{key:"updateKeyMappingFor",value:function(r){var a=r.id(),n=this.keyForId.get(a),i=this.getKey(r);this.deleteIdForKey(n,a),this.addIdForKey(i,a),this.keyForId.set(a,i)}},{key:"deleteKeyMappingFor",value:function(r){var a=r.id(),n=this.keyForId.get(a);this.deleteIdForKey(n,a),this.keyForId.delete(a)}},{key:"keyHasChangedFor",value:function(r){var a=r.id(),n=this.keyForId.get(a),i=this.getKey(r);return n!==i}},{key:"isInvalid",value:function(r){return this.keyHasChangedFor(r)||this.doesEleInvalidateKey(r)}},{key:"getCachesAt",value:function(r){var a=this.cachesByLvl,n=this.lvls,i=a.get(r);return i||(i=new hr,a.set(r,i),n.push(r)),i}},{key:"getCache",value:function(r,a){return this.getCachesAt(a).get(r)}},{key:"get",value:function(r,a){var n=this.getKey(r),i=this.getCache(n,a);return i!=null&&this.updateKeyMappingFor(r),i}},{key:"getForCachedKey",value:function(r,a){var n=this.keyForId.get(r.id()),i=this.getCache(n,a);return i}},{key:"hasCache",value:function(r,a){return this.getCachesAt(a).has(r)}},{key:"has",value:function(r,a){var n=this.getKey(r);return this.hasCache(n,a)}},{key:"setCache",value:function(r,a,n){n.key=r,this.getCachesAt(a).set(r,n)}},{key:"set",value:function(r,a,n){var i=this.getKey(r);this.setCache(i,a,n),this.updateKeyMappingFor(r)}},{key:"deleteCache",value:function(r,a){this.getCachesAt(a).delete(r)}},{key:"delete",value:function(r,a){var n=this.getKey(r);this.deleteCache(n,a)}},{key:"invalidateKey",value:function(r){var a=this;this.lvls.forEach(function(n){return a.deleteCache(r,n)})}},{key:"invalidate",value:function(r){var a=r.id(),n=this.keyForId.get(a);this.deleteKeyMappingFor(r);var i=this.doesEleInvalidateKey(r);return i&&this.invalidateKey(n),i||this.getNumberOfIdsForKey(n)===0}}])})(),Rp=25,Xn=50,ai=-4,bv=3,zw=7.99,vS=8,dS=1024,gS=1024,pS=1024,yS=.2,mS=.8,bS=10,ES=.15,wS=.1,TS=.9,xS=.9,CS=100,AS=1,ya={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},LS=Lt({getKey:null,doesEleInvalidateKey:gi,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:ME,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),Za=function(e,r){var a=this;a.renderer=e,a.onDequeues=[];var n=LS(r);Be(a,n),a.lookup=new cS(n.getKey,n.doesEleInvalidateKey),a.setupDequeueing()},Et=Za.prototype;Et.reasons=ya;Et.getTextureQueue=function(t){var e=this;return e.eleImgCaches=e.eleImgCaches||{},e.eleImgCaches[t]=e.eleImgCaches[t]||[]};Et.getRetiredTextureQueue=function(t){var e=this,r=e.eleImgCaches.retired=e.eleImgCaches.retired||{},a=r[t]=r[t]||[];return a};Et.getElementQueue=function(){var t=this,e=t.eleCacheQueue=t.eleCacheQueue||new En(function(r,a){return a.reqs-r.reqs});return e};Et.getElementKeyToQueue=function(){var t=this,e=t.eleKeyToCacheQueue=t.eleKeyToCacheQueue||{};return e};Et.getElement=function(t,e,r,a,n){var i=this,o=this.renderer,s=o.cy.zoom(),u=this.lookup;if(!e||e.w===0||e.h===0||isNaN(e.w)||isNaN(e.h)||!t.visible()||t.removed()||!i.allowEdgeTxrCaching&&t.isEdge()||!i.allowParentTxrCaching&&t.isParent())return null;if(a==null&&(a=Math.ceil(Ov(s*r))),a<ai)a=ai;else if(s>=zw||a>bv)return null;var l=Math.pow(2,a),f=e.h*l,h=e.w*l,v=o.eleTextBiggerThanMin(t,l);if(!this.isVisible(t,v))return null;var c=u.get(t,a);if(c&&c.invalidated&&(c.invalidated=!1,c.texture.invalidatedWidth-=c.width),c)return c;var d;if(f<=Rp?d=Rp:f<=Xn?d=Xn:d=Math.ceil(f/Xn)*Xn,f>pS||h>gS)return null;var g=i.getTextureQueue(d),p=g[g.length-2],y=function(){return i.recycleTexture(d,h)||i.addTexture(d,h)};p||(p=g[g.length-1]),p||(p=y()),p.width-p.usedWidth<h&&(p=y());for(var b=function(M){return M&&M.scaledLabelShown===v},m=n&&n===ya.dequeue,E=n&&n===ya.highQuality,T=n&&n===ya.downscale,L,w=a+1;w<=bv;w++){var C=u.get(t,w);if(C){L=C;break}}var A=L&&L.level===a+1?L:null,R=function(){p.context.drawImage(A.texture.canvas,A.x,0,A.width,A.height,p.usedWidth,0,h,f)};if(p.context.setTransform(1,0,0,1,0,0),p.context.clearRect(p.usedWidth,0,h,d),b(A))R();else if(b(L))if(E){for(var S=L.level;S>a;S--)A=i.getElement(t,e,r,S,ya.downscale);R()}else return i.queueElement(t,L.level-1),L;else{var D;if(!m&&!E&&!T)for(var P=a-1;P>=ai;P--){var x=u.get(t,P);if(x){D=x;break}}if(b(D))return i.queueElement(t,a),D;p.context.translate(p.usedWidth,0),p.context.scale(l,l),this.drawElement(p.context,t,e,v,!1),p.context.scale(1/l,1/l),p.context.translate(-p.usedWidth,0)}return c={x:p.usedWidth,texture:p,level:a,scale:l,width:h,height:f,scaledLabelShown:v},p.usedWidth+=Math.ceil(h+vS),p.eleCaches.push(c),u.set(t,a,c),i.checkTextureFullness(p),c};Et.invalidateElements=function(t){for(var e=0;e<t.length;e++)this.invalidateElement(t[e])};Et.invalidateElement=function(t){var e=this,r=e.lookup,a=[],n=r.isInvalid(t);if(n){for(var i=ai;i<=bv;i++){var o=r.getForCachedKey(t,i);o&&a.push(o)}var s=r.invalidate(t);if(s)for(var u=0;u<a.length;u++){var l=a[u],f=l.texture;f.invalidatedWidth+=l.width,l.invalidated=!0,e.checkTextureUtility(f)}e.removeFromQueue(t)}};Et.checkTextureUtility=function(t){t.invalidatedWidth>=yS*t.width&&this.retireTexture(t)};Et.checkTextureFullness=function(t){var e=this,r=e.getTextureQueue(t.height);t.usedWidth/t.width>mS&&t.fullnessChecks>=bS?Dr(r,t):t.fullnessChecks++};Et.retireTexture=function(t){var e=this,r=t.height,a=e.getTextureQueue(r),n=this.lookup;Dr(a,t),t.retired=!0;for(var i=t.eleCaches,o=0;o<i.length;o++){var s=i[o];n.deleteCache(s.key,s.level)}Mv(i);var u=e.getRetiredTextureQueue(r);u.push(t)};Et.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(dS,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};Et.recycleTexture=function(t,e){for(var r=this,a=r.getTextureQueue(t),n=r.getRetiredTextureQueue(t),i=0;i<n.length;i++){var o=n[i];if(o.width>=e)return o.retired=!1,o.usedWidth=0,o.invalidatedWidth=0,o.fullnessChecks=0,Mv(o.eleCaches),o.context.setTransform(1,0,0,1,0,0),o.context.clearRect(0,0,o.width,o.height),Dr(n,o),a.push(o),o}};Et.queueElement=function(t,e){var r=this,a=r.getElementQueue(),n=r.getElementKeyToQueue(),i=this.getKey(t),o=n[i];if(o)o.level=Math.max(o.level,e),o.eles.merge(t),o.reqs++,a.updateItem(o);else{var s={eles:t.spawn().merge(t),level:e,reqs:1,key:i};a.push(s),n[i]=s}};Et.dequeue=function(t){for(var e=this,r=e.getElementQueue(),a=e.getElementKeyToQueue(),n=[],i=e.lookup,o=0;o<AS&&r.size()>0;o++){var s=r.pop(),u=s.key,l=s.eles[0],f=i.hasCache(l,s.level);if(a[u]=null,f)continue;n.push(s);var h=e.getBoundingBox(l);e.getElement(l,h,t,s.level,ya.dequeue)}return n};Et.removeFromQueue=function(t){var e=this,r=e.getElementQueue(),a=e.getElementKeyToQueue(),n=this.getKey(t),i=a[n];i!=null&&(i.eles.length===1?(i.reqs=Dv,r.updateItem(i),r.pop(),a[n]=null):i.eles.unmerge(t))};Et.onDequeue=function(t){this.onDequeues.push(t)};Et.offDequeue=function(t){Dr(this.onDequeues,t)};Et.setupDequeueing=Uw.setupDequeueing({deqRedrawThreshold:CS,deqCost:ES,deqAvgCost:wS,deqNoDrawCost:TS,deqFastCost:xS,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++)for(var o=r[i].eles,s=0;s<o.length;s++){var u=o[s].boundingBox();if(Pv(u,n))return!0}return!1},priority:function(e){return e.renderer.beforeRenderPriorities.eleTxrDeq}});var RS=1,tn=-4,xi=2,SS=3.99,DS=50,NS=50,MS=.15,OS=.1,IS=.9,PS=.9,FS=1,Sp=250,_S=4e3*4e3,Dp=32767,BS=!0,Vw=function(e){var r=this,a=r.renderer=e,n=a.cy;r.layersByLevel={},r.firstGet=!0,r.lastInvalidationTime=cr()-2*Sp,r.skipping=!1,r.eleTxrDeqs=n.collection(),r.scheduleElementRefinement=bn(function(){r.refineElementTextures(r.eleTxrDeqs),r.eleTxrDeqs.unmerge(r.eleTxrDeqs)},NS),a.beforeRender(function(o,s){s-r.lastInvalidationTime<=Sp?r.skipping=!0:r.skipping=!1},a.beforeRenderPriorities.lyrTxrSkip);var i=function(s,u){return u.reqs-s.reqs};r.layersQueue=new En(i),r.setupDequeueing()},Rt=Vw.prototype,Np=0,kS=Math.pow(2,53)-1;Rt.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),o={id:Np=++Np%kS,bb:t,level:e,width:a,height:n,canvas:i,context:i.getContext("2d"),eles:[],elesQueue:[],reqs:0},s=o.context,u=-o.bb.x1,l=-o.bb.y1;return s.scale(r,r),s.translate(u,l),o};Rt.getLayers=function(t,e,r){var a=this,n=a.renderer,i=n.cy,o=i.zoom(),s=a.firstGet;if(a.firstGet=!1,r==null){if(r=Math.ceil(Ov(o*e)),r<tn)r=tn;else if(o>=SS||r>xi)return null}a.validateLayersElesOrdering(r,t);var u=a.layersByLevel,l=Math.pow(2,r),f=u[r]=u[r]||[],h,v=a.levelIsComplete(r,t),c,d=function(){var R=function(N){if(a.validateLayersElesOrdering(N,t),a.levelIsComplete(N,t))return c=u[N],!0},S=function(N){if(!c)for(var M=r+N;tn<=M&&M<=xi&&!R(M);M+=N);};S(1),S(-1);for(var D=f.length-1;D>=0;D--){var P=f[D];P.invalid&&Dr(f,P)}};if(!v)d();else return f;var g=function(){if(!h){h=Pt();for(var R=0;R<t.length;R++)FC(h,t[R].boundingBox())}return h},p=function(R){R=R||{};var S=R.after;g();var D=Math.ceil(h.w*l),P=Math.ceil(h.h*l);if(D>Dp||P>Dp)return null;var x=D*P;if(x>_S)return null;var N=a.makeLayer(h,r);if(S!=null){var M=f.indexOf(S)+1;f.splice(M,0,N)}else(R.insert===void 0||R.insert)&&f.unshift(N);return N};if(a.skipping&&!s)return null;for(var y=null,b=t.length/RS,m=!s,E=0;E<t.length;E++){var T=t[E],L=T._private.rscratch,w=L.imgLayerCaches=L.imgLayerCaches||{},C=w[r];if(C){y=C;continue}if((!y||y.eles.length>=b||!BE(y.bb,T.boundingBox()))&&(y=p({insert:!0,after:y}),!y))return null;c||m?a.queueLayer(y,T):a.drawEleInLayer(y,T,r,e),y.eles.push(T),w[r]=y}return c||(m?null:f)};Rt.getEleLevelForLayerLevel=function(t,e){return t};Rt.drawEleInLayer=function(t,e,r,a){var n=this,i=this.renderer,o=t.context,s=e.boundingBox();s.w===0||s.h===0||!e.visible()||(r=n.getEleLevelForLayerLevel(r,a),i.setImgSmoothing(o,!1),i.drawCachedElement(o,e,null,null,r,BS),i.setImgSmoothing(o,!0))};Rt.levelIsComplete=function(t,e){var r=this,a=r.layersByLevel[t];if(!a||a.length===0)return!1;for(var n=0,i=0;i<a.length;i++){var o=a[i];if(o.reqs>0||o.invalid)return!1;n+=o.eles.length}return n===e.length};Rt.validateLayersElesOrdering=function(t,e){var r=this.layersByLevel[t];if(r)for(var a=0;a<r.length;a++){for(var n=r[a],i=-1,o=0;o<e.length;o++)if(n.eles[0]===e[o]){i=o;break}if(i<0){this.invalidateLayer(n);continue}for(var s=i,o=0;o<n.eles.length;o++)if(n.eles[o]!==e[s+o]){this.invalidateLayer(n);break}}};Rt.updateElementsInLayers=function(t,e){for(var r=this,a=gn(t[0]),n=0;n<t.length;n++)for(var i=a?null:t[n],o=a?t[n]:t[n].ele,s=o._private.rscratch,u=s.imgLayerCaches=s.imgLayerCaches||{},l=tn;l<=xi;l++){var f=u[l];f&&(i&&r.getEleLevelForLayerLevel(f.level)!==i.level||e(f,o,i))}};Rt.haveLayers=function(){for(var t=this,e=!1,r=tn;r<=xi;r++){var a=t.layersByLevel[r];if(a&&a.length>0){e=!0;break}}return e};Rt.invalidateElements=function(t){var e=this;t.length!==0&&(e.lastInvalidationTime=cr(),!(t.length===0||!e.haveLayers())&&e.updateElementsInLayers(t,function(a,n,i){e.invalidateLayer(a)}))};Rt.invalidateLayer=function(t){if(this.lastInvalidationTime=cr(),!t.invalid){var e=t.level,r=t.eles,a=this.layersByLevel[e];Dr(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;i&&(i[e]=null)}}};Rt.refineElementTextures=function(t){var e=this;e.updateElementsInLayers(t,function(a,n,i){var o=a.replacement;if(o||(o=a.replacement=e.makeLayer(a.bb,a.level),o.replaces=a,o.eles=a.eles),!o.reqs)for(var s=0;s<o.eles.length;s++)e.queueLayer(o,o.eles[s])})};Rt.enqueueElementRefinement=function(t){this.eleTxrDeqs.merge(t),this.scheduleElementRefinement()};Rt.queueLayer=function(t,e){var r=this,a=r.layersQueue,n=t.elesQueue,i=n.hasId=n.hasId||{};if(!t.replacement){if(e){if(i[e.id()])return;n.push(e),i[e.id()]=!0}t.reqs?(t.reqs++,a.updateItem(t)):(t.reqs=1,a.push(t))}};Rt.dequeue=function(t){for(var e=this,r=e.layersQueue,a=[],n=0;n<FS&&r.size()!==0;){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 o=i.elesQueue.shift();o&&(e.drawEleInLayer(i,o,i.level,t),n++),a.length===0&&a.push(!0),i.elesQueue.length===0&&(r.pop(),i.reqs=0,i.replaces&&e.applyLayerReplacement(i),e.requestRedraw())}return a};Rt.applyLayerReplacement=function(t){var e=this,r=e.layersByLevel[t.level],a=t.replaces,n=r.indexOf(a);if(!(n<0||a.invalid)){r[n]=t;for(var i=0;i<t.eles.length;i++){var o=t.eles[i]._private,s=o.imgLayerCaches=o.imgLayerCaches||{};s&&(s[t.level]=t)}e.requestRedraw()}};Rt.requestRedraw=bn(function(){var t=this.renderer;t.redrawHint("eles",!0),t.redrawHint("drag",!0),t.redraw()},100);Rt.setupDequeueing=Uw.setupDequeueing({deqRedrawThreshold:DS,deqCost:MS,deqAvgCost:OS,deqNoDrawCost:IS,deqFastCost:PS,deq:function(e,r){return e.dequeue(r)},onDeqd:Nv,shouldRedraw:ME,priority:function(e){return e.renderer.beforeRenderPriorities.lyrTxrDeq}});var Yw={},Mp;function qS(t,e){for(var r=0;r<e.length;r++){var a=e[r];t.lineTo(a.x,a.y)}}function GS(t,e,r){for(var a,n=0;n<e.length;n++){var i=e[n];n===0&&(a=i),t.lineTo(i.x,i.y)}t.quadraticCurveTo(r.x,r.y,a.x,a.y)}function Op(t,e,r){t.beginPath&&t.beginPath();for(var a=e,n=0;n<a.length;n++){var i=a[n];t.lineTo(i.x,i.y)}var o=r,s=r[0];t.moveTo(s.x,s.y);for(var n=1;n<o.length;n++){var i=o[n];t.lineTo(i.x,i.y)}t.closePath&&t.closePath()}function US(t,e,r,a,n){t.beginPath&&t.beginPath(),t.arc(r,a,n,0,Math.PI*2,!1);var i=e,o=i[0];t.moveTo(o.x,o.y);for(var s=0;s<i.length;s++){var u=i[s];t.lineTo(u.x,u.y)}t.closePath&&t.closePath()}function zS(t,e,r,a){t.arc(e,r,a,0,Math.PI*2,!1)}Yw.arrowShapeImpl=function(t){return(Mp||(Mp={polygon:qS,"triangle-backcurve":GS,"triangle-tee":Op,"circle-triangle":US,"triangle-cross":Op,circle:zS}))[t]};var or={};or.drawElement=function(t,e,r,a,n,i){var o=this;e.isNode()?o.drawNode(t,e,r,a,n,i):o.drawEdge(t,e,r,a,n,i)};or.drawElementOverlay=function(t,e){var r=this;e.isNode()?r.drawNodeOverlay(t,e):r.drawEdgeOverlay(t,e)};or.drawElementUnderlay=function(t,e){var r=this;e.isNode()?r.drawNodeUnderlay(t,e):r.drawEdgeUnderlay(t,e)};or.drawCachedElementPortion=function(t,e,r,a,n,i,o,s){var u=this,l=r.getBoundingBox(e);if(!(l.w===0||l.h===0)){var f=r.getElement(e,l,a,n,i);if(f!=null){var h=s(u,e);if(h===0)return;var v=o(u,e),c=l.x1,d=l.y1,g=l.w,p=l.h,y,b,m,E,T;if(v!==0){var L=r.getRotationPoint(e);m=L.x,E=L.y,t.translate(m,E),t.rotate(v),T=u.getImgSmoothing(t),T||u.setImgSmoothing(t,!0);var w=r.getRotationOffset(e);y=w.x,b=w.y}else y=c,b=d;var C;h!==1&&(C=t.globalAlpha,t.globalAlpha=C*h),t.drawImage(f.texture.canvas,f.x,0,f.width,f.height,y,b,g,p),h!==1&&(t.globalAlpha=C),v!==0&&(t.rotate(-v),t.translate(-m,-E),T||u.setImgSmoothing(t,!1))}else r.drawElement(t,e)}};var VS=function(){return 0},YS=function(e,r){return e.getTextAngle(r,null)},HS=function(e,r){return e.getTextAngle(r,"source")},XS=function(e,r){return e.getTextAngle(r,"target")},$S=function(e,r){return r.effectiveOpacity()},Is=function(e,r){return r.pstyle("text-opacity").pfValue*r.effectiveOpacity()};or.drawCachedElement=function(t,e,r,a,n,i){var o=this,s=o.data,u=s.eleTxrCache,l=s.lblTxrCache,f=s.slbTxrCache,h=s.tlbTxrCache,v=e.boundingBox(),c=i===!0?u.reasons.highQuality:null;if(!(v.w===0||v.h===0||!e.visible())&&(!a||Pv(v,a))){var d=e.isEdge(),g=e.element()._private.rscratch.badLine;o.drawElementUnderlay(t,e),o.drawCachedElementPortion(t,e,u,r,n,c,VS,$S),(!d||!g)&&o.drawCachedElementPortion(t,e,l,r,n,c,YS,Is),d&&!g&&(o.drawCachedElementPortion(t,e,f,r,n,c,HS,Is),o.drawCachedElementPortion(t,e,h,r,n,c,XS,Is)),o.drawElementOverlay(t,e)}};or.drawElements=function(t,e){for(var r=this,a=0;a<e.length;a++){var n=e[a];r.drawElement(t,n)}};or.drawCachedElements=function(t,e,r,a){for(var n=this,i=0;i<e.length;i++){var o=e[i];n.drawCachedElement(t,o,r,a)}};or.drawCachedNodes=function(t,e,r,a){for(var n=this,i=0;i<e.length;i++){var o=e[i];o.isNode()&&n.drawCachedElement(t,o,r,a)}};or.drawLayeredElements=function(t,e,r,a){var n=this,i=n.data.lyrTxrCache.getLayers(e,r);if(i)for(var o=0;o<i.length;o++){var s=i[o],u=s.bb;u.w===0||u.h===0||t.drawImage(s.canvas,u.x1,u.y1,u.w,u.h)}else n.drawCachedElements(t,e,r,a)};var gr={};gr.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,o=this,s=e._private.rscratch;if(!(i&&!e.visible())&&!(s.badLine||s.allpts==null||isNaN(s.allpts[0]))){var u;r&&(u=r,t.translate(-u.x1,-u.y1));var l=i?e.pstyle("opacity").value:1,f=i?e.pstyle("line-opacity").value:1,h=e.pstyle("curve-style").value,v=e.pstyle("line-style").value,c=e.pstyle("width").pfValue,d=e.pstyle("line-cap").value,g=e.pstyle("line-outline-width").value,p=e.pstyle("line-outline-color").value,y=l*f,b=l*f,m=function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:y;h==="straight-triangle"?(o.eleStrokeStyle(t,e,N),o.drawEdgeTrianglePath(e,t,s.allpts)):(t.lineWidth=c,t.lineCap=d,o.eleStrokeStyle(t,e,N),o.drawEdgePath(e,t,s.allpts,v),t.lineCap="butt")},E=function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:y;if(t.lineWidth=c+g,t.lineCap=d,g>0)o.colorStrokeStyle(t,p[0],p[1],p[2],N);else{t.lineCap="butt";return}h==="straight-triangle"?o.drawEdgeTrianglePath(e,t,s.allpts):(o.drawEdgePath(e,t,s.allpts,v),t.lineCap="butt")},T=function(){n&&o.drawEdgeOverlay(t,e)},L=function(){n&&o.drawEdgeUnderlay(t,e)},w=function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:b;o.drawArrowheads(t,e,N)},C=function(){o.drawElementText(t,e,null,a)};t.lineJoin="round";var A=e.pstyle("ghost").value==="yes";if(A){var R=e.pstyle("ghost-offset-x").pfValue,S=e.pstyle("ghost-offset-y").pfValue,D=e.pstyle("ghost-opacity").value,P=y*D;t.translate(R,S),m(P),w(P),t.translate(-R,-S)}else E();L(),m(),w(),T(),C(),r&&t.translate(u.x1,u.y1)}};var Hw=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(r,a){if(a.visible()){var n=a.pstyle("".concat(e,"-opacity")).value;if(n!==0){var i=this,o=i.usePaths(),s=a._private.rscratch,u=a.pstyle("".concat(e,"-padding")).pfValue,l=2*u,f=a.pstyle("".concat(e,"-color")).value;r.lineWidth=l,s.edgeType==="self"&&!o?r.lineCap="butt":r.lineCap="round",i.colorStrokeStyle(r,f[0],f[1],f[2],n),i.drawEdgePath(a,r,s.allpts,"solid")}}}};gr.drawEdgeOverlay=Hw("overlay");gr.drawEdgeUnderlay=Hw("underlay");gr.drawEdgePath=function(t,e,r,a){var n=t._private.rscratch,i=e,o,s=!1,u=this.usePaths(),l=t.pstyle("line-dash-pattern").pfValue,f=t.pstyle("line-dash-offset").pfValue;if(u){var h=r.join("$"),v=n.pathCacheKey&&n.pathCacheKey===h;v?(o=e=n.pathCache,s=!0):(o=e=new Path2D,n.pathCacheKey=h,n.pathCache=o)}if(i.setLineDash)switch(a){case"dotted":i.setLineDash([1,1]);break;case"dashed":i.setLineDash(l),i.lineDashOffset=f;break;case"solid":i.setLineDash([]);break}if(!s&&!n.badLine)switch(e.beginPath&&e.beginPath(),e.moveTo(r[0],r[1]),n.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var 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),p;try{for(g.s();!(p=g.n()).done;){var y=p.value;Iw(e,y)}}catch(m){g.e(m)}finally{g.f()}e.lineTo(r[r.length-2],r[r.length-1])}else for(var b=2;b+1<r.length;b+=2)e.lineTo(r[b],r[b+1]);break}e=i,u?e.stroke(o):e.stroke(),e.setLineDash&&e.setLineDash([])};gr.drawEdgeTrianglePath=function(t,e,r){e.fillStyle=e.strokeStyle;for(var a=t.pstyle("width").pfValue,n=0;n+1<r.length;n+=2){var i=[r[n+2]-r[n],r[n+3]-r[n+1]],o=Math.sqrt(i[0]*i[0]+i[1]*i[1]),s=[i[1]/o,-i[0]/o],u=[s[0]*a/2,s[1]*a/2];e.beginPath(),e.moveTo(r[n]-u[0],r[n+1]-u[1]),e.lineTo(r[n]+u[0],r[n+1]+u[1]),e.lineTo(r[n+2],r[n+3]),e.closePath(),e.fill()}};gr.drawArrowheads=function(t,e,r){var a=e._private.rscratch,n=a.edgeType==="haystack";n||this.drawArrowhead(t,e,"source",a.arrowStartX,a.arrowStartY,a.srcArrowAngle,r),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)};gr.drawArrowhead=function(t,e,r,a,n,i,o){if(!(isNaN(a)||a==null||isNaN(n)||n==null||isNaN(i)||i==null)){var s=this,u=e.pstyle(r+"-arrow-shape").value;if(u!=="none"){var l=e.pstyle(r+"-arrow-fill").value==="hollow"?"both":"filled",f=e.pstyle(r+"-arrow-fill").value,h=e.pstyle("width").pfValue,v=e.pstyle(r+"-arrow-width"),c=v.value==="match-line"?h:v.pfValue;v.units==="%"&&(c*=h);var d=e.pstyle("opacity").value;o===void 0&&(o=d);var g=t.globalCompositeOperation;(o!==1||f==="hollow")&&(t.globalCompositeOperation="destination-out",s.colorFillStyle(t,255,255,255,1),s.colorStrokeStyle(t,255,255,255,1),s.drawArrowShape(e,t,l,h,u,c,a,n,i),t.globalCompositeOperation=g);var p=e.pstyle(r+"-arrow-color").value;s.colorFillStyle(t,p[0],p[1],p[2],o),s.colorStrokeStyle(t,p[0],p[1],p[2],o),s.drawArrowShape(e,t,f,h,u,c,a,n,i)}}};gr.drawArrowShape=function(t,e,r,a,n,i,o,s,u){var l=this,f=this.usePaths()&&n!=="triangle-cross",h=!1,v,c=e,d={x:o,y:s},g=t.pstyle("arrow-scale").value,p=this.getArrowWidth(a,g),y=l.arrowShapes[n];if(f){var b=l.arrowPathCache=l.arrowPathCache||[],m=Kr(n),E=b[m];E!=null?(v=e=E,h=!0):(v=e=new Path2D,b[m]=v)}h||(e.beginPath&&e.beginPath(),f?y.draw(e,1,0,{x:0,y:0},1):y.draw(e,p,u,d,a),e.closePath&&e.closePath()),e=c,f&&(e.translate(o,s),e.rotate(u),e.scale(p,p)),(r==="filled"||r==="both")&&(f?e.fill(v):e.fill()),(r==="hollow"||r==="both")&&(e.lineWidth=i/(f?p:1),e.lineJoin="miter",f?e.stroke(v):e.stroke()),f&&(e.scale(1/p,1/p),e.rotate(-u),e.translate(-o,-s))};var Wv={};Wv.safeDrawImage=function(t,e,r,a,n,i,o,s,u,l){if(!(n<=0||i<=0||u<=0||l<=0))try{t.drawImage(e,r,a,n,i,o,s,u,l)}catch(f){Ze(f)}};Wv.drawInscribedImage=function(t,e,r,a,n){var i=this,o=r.position(),s=o.x,u=o.y,l=r.cy().style(),f=l.getIndexedStyle.bind(l),h=f(r,"background-fit","value",a),v=f(r,"background-repeat","value",a),c=r.width(),d=r.height(),g=r.padding()*2,p=c+(f(r,"background-width-relative-to","value",a)==="inner"?0:g),y=d+(f(r,"background-height-relative-to","value",a)==="inner"?0:g),b=r._private.rscratch,m=f(r,"background-clip","value",a),E=m==="node",T=f(r,"background-image-opacity","value",a)*n,L=f(r,"background-image-smoothing","value",a),w=r.pstyle("corner-radius").value;w!=="auto"&&(w=r.pstyle("corner-radius").pfValue);var C=e.width||e.cachedW,A=e.height||e.cachedH;(C==null||A==null)&&(document.body.appendChild(e),C=e.cachedW=e.width||e.offsetWidth,A=e.cachedH=e.height||e.offsetHeight,document.body.removeChild(e));var R=C,S=A;if(f(r,"background-width","value",a)!=="auto"&&(f(r,"background-width","units",a)==="%"?R=f(r,"background-width","pfValue",a)*p:R=f(r,"background-width","pfValue",a)),f(r,"background-height","value",a)!=="auto"&&(f(r,"background-height","units",a)==="%"?S=f(r,"background-height","pfValue",a)*y:S=f(r,"background-height","pfValue",a)),!(R===0||S===0)){if(h==="contain"){var D=Math.min(p/R,y/S);R*=D,S*=D}else if(h==="cover"){var D=Math.max(p/R,y/S);R*=D,S*=D}var P=s-p/2,x=f(r,"background-position-x","units",a),N=f(r,"background-position-x","pfValue",a);x==="%"?P+=(p-R)*N:P+=N;var M=f(r,"background-offset-x","units",a),I=f(r,"background-offset-x","pfValue",a);M==="%"?P+=(p-R)*I:P+=I;var O=u-y/2,q=f(r,"background-position-y","units",a),_=f(r,"background-position-y","pfValue",a);q==="%"?O+=(y-S)*_:O+=_;var B=f(r,"background-offset-y","units",a),z=f(r,"background-offset-y","pfValue",a);B==="%"?O+=(y-S)*z:O+=z,b.pathCache&&(P-=s,O-=u,s=0,u=0);var Y=t.globalAlpha;t.globalAlpha=T;var k=i.getImgSmoothing(t),G=!1;if(L==="no"&&k?(i.setImgSmoothing(t,!1),G=!0):L==="yes"&&!k&&(i.setImgSmoothing(t,!0),G=!0),v==="no-repeat")E&&(t.save(),b.pathCache?t.clip(b.pathCache):(i.nodeShapes[i.getNodeShape(r)].draw(t,s,u,p,y,w,b),t.clip())),i.safeDrawImage(t,e,0,0,C,A,P,O,R,S),E&&t.restore();else{var U=t.createPattern(e,v);t.fillStyle=U,i.nodeShapes[i.getNodeShape(r)].draw(t,s,u,p,y,w,b),t.translate(P,O),t.fill(),t.translate(-P,-O)}t.globalAlpha=Y,G&&i.setImgSmoothing(t,k)}};var ta={};ta.eleTextBiggerThanMin=function(t,e){if(!e){var r=t.cy().zoom(),a=this.getPixelRatio(),n=Math.ceil(Ov(r*a));e=Math.pow(2,n)}var i=t.pstyle("font-size").pfValue*e,o=t.pstyle("min-zoomed-font-size").pfValue;return!(i<o)};ta.drawElementText=function(t,e,r,a,n){var i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,o=this;if(a==null){if(i&&!o.eleTextBiggerThanMin(e))return}else if(a===!1)return;if(e.isNode()){var s=e.pstyle("label");if(!s||!s.value)return;var u=o.getLabelJustification(e);t.textAlign=u,t.textBaseline="bottom"}else{var l=e.element()._private.rscratch.badLine,f=e.pstyle("label"),h=e.pstyle("source-label"),v=e.pstyle("target-label");if(l||(!f||!f.value)&&(!h||!h.value)&&(!v||!v.value))return;t.textAlign="center",t.textBaseline="bottom"}var c=!r,d;r&&(d=r,t.translate(-d.x1,-d.y1)),n==null?(o.drawText(t,e,null,c,i),e.isEdge()&&(o.drawText(t,e,"source",c,i),o.drawText(t,e,"target",c,i))):o.drawText(t,e,n,c,i),r&&t.translate(d.x1,d.y1)};ta.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};ta.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,o=e.pstyle("font-weight").strValue,s=r?e.effectiveOpacity()*e.pstyle("text-opacity").value:1,u=e.pstyle("text-outline-opacity").value*s,l=e.pstyle("color").value,f=e.pstyle("text-outline-color").value;t.font=a+" "+o+" "+n+" "+i,t.lineJoin="round",this.colorFillStyle(t,l[0],l[1],l[2],s),this.colorStrokeStyle(t,f[0],f[1],f[2],u)};function WS(t,e,r,a,n){var i=Math.min(a,n),o=i/2,s=e+a/2,u=r+n/2;t.beginPath(),t.arc(s,u,o,0,Math.PI*2),t.closePath()}function Ip(t,e,r,a,n){var i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:5,o=Math.min(i,a/2,n/2);t.beginPath(),t.moveTo(e+o,r),t.lineTo(e+a-o,r),t.quadraticCurveTo(e+a,r,e+a,r+o),t.lineTo(e+a,r+n-o),t.quadraticCurveTo(e+a,r+n,e+a-o,r+n),t.lineTo(e+o,r+n),t.quadraticCurveTo(e,r+n,e,r+n-o),t.lineTo(e,r+o),t.quadraticCurveTo(e,r,e+o,r),t.closePath()}ta.getTextAngle=function(t,e){var r,a=t._private,n=a.rscratch,i=e?e+"-":"",o=t.pstyle(i+"text-rotation");if(o.strValue==="autorotate"){var s=_t(n,"labelAngle",e);r=t.isEdge()?s:0}else o.strValue==="none"?r=0:r=o.pfValue;return r};ta.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,o=i.rscratch,s=n?e.effectiveOpacity():1;if(!(n&&(s===0||e.pstyle("text-opacity").value===0))){r==="main"&&(r=null);var u=_t(o,"labelX",r),l=_t(o,"labelY",r),f,h,v=this.getLabelText(e,r);if(v!=null&&v!==""&&!isNaN(u)&&!isNaN(l)){this.setupTextStyle(t,e,n);var c=r?r+"-":"",d=_t(o,"labelWidth",r),g=_t(o,"labelHeight",r),p=e.pstyle(c+"text-margin-x").pfValue,y=e.pstyle(c+"text-margin-y").pfValue,b=e.isEdge(),m=e.pstyle("text-halign").value,E=e.pstyle("text-valign").value;b&&(m="center",E="center"),u+=p,l+=y;var T;switch(a?T=this.getTextAngle(e,r):T=0,T!==0&&(f=u,h=l,t.translate(f,h),t.rotate(T),u=0,l=0),E){case"top":break;case"center":l+=g/2;break;case"bottom":l+=g;break}var L=e.pstyle("text-background-opacity").value,w=e.pstyle("text-border-opacity").value,C=e.pstyle("text-border-width").pfValue,A=e.pstyle("text-background-padding").pfValue,R=e.pstyle("text-background-shape").strValue,S=R==="round-rectangle"||R==="roundrectangle",D=R==="circle",P=2;if(L>0||C>0&&w>0){var x=t.fillStyle,N=t.strokeStyle,M=t.lineWidth,I=e.pstyle("text-background-color").value,O=e.pstyle("text-border-color").value,q=e.pstyle("text-border-style").value,_=L>0,B=C>0&&w>0,z=u-A;switch(m){case"left":z-=d;break;case"center":z-=d/2;break}var Y=l-g-A,k=d+2*A,G=g+2*A;if(_&&(t.fillStyle="rgba(".concat(I[0],",").concat(I[1],",").concat(I[2],",").concat(L*s,")")),B&&(t.strokeStyle="rgba(".concat(O[0],",").concat(O[1],",").concat(O[2],",").concat(w*s,")"),t.lineWidth=C,t.setLineDash))switch(q){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"double":t.lineWidth=C/4,t.setLineDash([]);break;case"solid":default:t.setLineDash([]);break}if(S?(t.beginPath(),Ip(t,z,Y,k,G,P)):D?(t.beginPath(),WS(t,z,Y,k,G)):(t.beginPath(),t.rect(z,Y,k,G)),_&&t.fill(),B&&t.stroke(),B&&q==="double"){var U=C/2;t.beginPath(),S?Ip(t,z+U,Y+U,k-2*U,G-2*U,P):t.rect(z+U,Y+U,k-2*U,G-2*U),t.stroke()}t.fillStyle=x,t.strokeStyle=N,t.lineWidth=M,t.setLineDash&&t.setLineDash([])}var W=2*e.pstyle("text-outline-width").pfValue;if(W>0&&(t.lineWidth=W),e.pstyle("text-wrap").value==="wrap"){var j=_t(o,"labelWrapCachedLines",r),H=_t(o,"labelLineHeight",r),V=d/2,X=this.getLabelJustification(e);switch(X==="auto"||(m==="left"?X==="left"?u+=-d:X==="center"&&(u+=-V):m==="center"?X==="left"?u+=-V:X==="right"&&(u+=V):m==="right"&&(X==="center"?u+=V:X==="right"&&(u+=d))),E){case"top":l-=(j.length-1)*H;break;case"center":case"bottom":l-=(j.length-1)*H;break}for(var Z=0;Z<j.length;Z++)W>0&&t.strokeText(j[Z],u,l),t.fillText(j[Z],u,l),l+=H}else W>0&&t.strokeText(v,u,l),t.fillText(v,u,l);T!==0&&(t.rotate(-T),t.translate(-f,-h))}}};var Br={};Br.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,o=this,s,u,l=e._private,f=l.rscratch,h=e.position();if(!(!Te(h.x)||!Te(h.y))&&!(i&&!e.visible())){var v=i?e.effectiveOpacity():1,c=o.usePaths(),d,g=!1,p=e.padding();s=e.width()+2*p,u=e.height()+2*p;var y;r&&(y=r,t.translate(-y.x1,-y.y1));for(var b=e.pstyle("background-image"),m=b.value,E=new Array(m.length),T=new Array(m.length),L=0,w=0;w<m.length;w++){var C=m[w],A=E[w]=C!=null&&C!=="none";if(A){var R=e.cy().style().getIndexedStyle(e,"background-image-crossorigin","value",w);L++,T[w]=o.getCachedImage(C,R,function(){l.backgroundTimestamp=Date.now(),e.emitAndNotify("background")})}}var S=e.pstyle("background-blacken").value,D=e.pstyle("border-width").pfValue,P=e.pstyle("background-opacity").value*v,x=e.pstyle("border-color").value,N=e.pstyle("border-style").value,M=e.pstyle("border-join").value,I=e.pstyle("border-cap").value,O=e.pstyle("border-position").value,q=e.pstyle("border-dash-pattern").pfValue,_=e.pstyle("border-dash-offset").pfValue,B=e.pstyle("border-opacity").value*v,z=e.pstyle("outline-width").pfValue,Y=e.pstyle("outline-color").value,k=e.pstyle("outline-style").value,G=e.pstyle("outline-opacity").value*v,U=e.pstyle("outline-offset").value,W=e.pstyle("corner-radius").value;W!=="auto"&&(W=e.pstyle("corner-radius").pfValue);var j=function(){var we=arguments.length>0&&arguments[0]!==void 0?arguments[0]:P;o.eleFillStyle(t,e,we)},H=function(){var we=arguments.length>0&&arguments[0]!==void 0?arguments[0]:B;o.colorStrokeStyle(t,x[0],x[1],x[2],we)},V=function(){var we=arguments.length>0&&arguments[0]!==void 0?arguments[0]:G;o.colorStrokeStyle(t,Y[0],Y[1],Y[2],we)},X=function(we,K,F,$){var J=o.nodePathCache=o.nodePathCache||[],Q=NE(F==="polygon"?F+","+$.join(","):F,""+K,""+we,""+W),te=J[Q],fe,ae=!1;return te!=null?(fe=te,ae=!0,f.pathCache=fe):(fe=new Path2D,J[Q]=f.pathCache=fe),{path:fe,cacheHit:ae}},Z=e.pstyle("shape").strValue,ee=e.pstyle("shape-polygon-points").pfValue;if(c){t.translate(h.x,h.y);var re=X(s,u,Z,ee);d=re.path,g=re.cacheHit}var ue=function(){if(!g){var we=h;c&&(we={x:0,y:0}),o.nodeShapes[o.getNodeShape(e)].draw(d||t,we.x,we.y,s,u,W,f)}c?t.fill(d):t.fill()},xe=function(){for(var we=arguments.length>0&&arguments[0]!==void 0?arguments[0]:v,K=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,F=l.backgrounding,$=0,J=0;J<T.length;J++){var Q=e.cy().style().getIndexedStyle(e,"background-image-containment","value",J);if(K&&Q==="over"||!K&&Q==="inside"){$++;continue}E[J]&&T[J].complete&&!T[J].error&&($++,o.drawInscribedImage(t,T[J],e,J,we))}l.backgrounding=$!==L,F!==l.backgrounding&&e.updateStyle(!1)},se=function(){var we=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,K=arguments.length>1&&arguments[1]!==void 0?arguments[1]:v;o.hasPie(e)&&(o.drawPie(t,e,K),we&&(c||o.nodeShapes[o.getNodeShape(e)].draw(t,h.x,h.y,s,u,W,f)))},oe=function(){var we=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,K=arguments.length>1&&arguments[1]!==void 0?arguments[1]:v;o.hasStripe(e)&&(t.save(),c?t.clip(f.pathCache):(o.nodeShapes[o.getNodeShape(e)].draw(t,h.x,h.y,s,u,W,f),t.clip()),o.drawStripe(t,e,K),t.restore(),we&&(c||o.nodeShapes[o.getNodeShape(e)].draw(t,h.x,h.y,s,u,W,f)))},he=function(){var we=arguments.length>0&&arguments[0]!==void 0?arguments[0]:v,K=(S>0?S:-S)*we,F=S>0?0:255;S!==0&&(o.colorFillStyle(t,F,F,F,K),c?t.fill(d):t.fill())},le=function(){if(D>0){if(t.lineWidth=D,t.lineCap=I,t.lineJoin=M,t.setLineDash)switch(N){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash(q),t.lineDashOffset=_;break;case"solid":case"double":t.setLineDash([]);break}if(O!=="center"){if(t.save(),t.lineWidth*=2,O==="inside")c?t.clip(d):t.clip();else{var we=new Path2D;we.rect(-s/2-D,-u/2-D,s+2*D,u+2*D),we.addPath(d),t.clip(we,"evenodd")}c?t.stroke(d):t.stroke(),t.restore()}else c?t.stroke(d):t.stroke();if(N==="double"){t.lineWidth=D/3;var K=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",c?t.stroke(d):t.stroke(),t.globalCompositeOperation=K}t.setLineDash&&t.setLineDash([])}},de=function(){if(z>0){if(t.lineWidth=z,t.lineCap="butt",t.setLineDash)switch(k){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"solid":case"double":t.setLineDash([]);break}var we=h;c&&(we={x:0,y:0});var K=o.getNodeShape(e),F=D;O==="inside"&&(F=0),O==="outside"&&(F*=2);var $=(s+F+(z+U))/s,J=(u+F+(z+U))/u,Q=s*$,te=u*J,fe=o.nodeShapes[K].points,ae;if(c){var ie=X(Q,te,K,fe);ae=ie.path}if(K==="ellipse")o.drawEllipsePath(ae||t,we.x,we.y,Q,te);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(K)){var ne=0,ve=0,Ce=0;K==="round-diamond"?ne=(F+U+z)*1.4:K==="round-heptagon"?(ne=(F+U+z)*1.075,Ce=-(F/2+U+z)/35):K==="round-hexagon"?ne=(F+U+z)*1.12:K==="round-pentagon"?(ne=(F+U+z)*1.13,Ce=-(F/2+U+z)/15):K==="round-tag"?(ne=(F+U+z)*1.12,ve=(F/2+z+U)*.07):K==="round-triangle"&&(ne=(F+U+z)*(Math.PI/2),Ce=-(F+U/2+z)/Math.PI),ne!==0&&($=(s+ne)/s,Q=s*$,["round-hexagon","round-tag"].includes(K)||(J=(u+ne)/u,te=u*J)),W=W==="auto"?GE(Q,te):W;for(var Ee=Q/2,be=te/2,me=W+(F+z+U)/2,ge=new Array(fe.length/2),Ie=new Array(fe.length/2),Ae=0;Ae<fe.length/2;Ae++)ge[Ae]={x:we.x+ve+Ee*fe[Ae*2],y:we.y+Ce+be*fe[Ae*2+1]};var Se,Ue,Ne,Pe,We=ge.length;for(Ue=ge[We-1],Se=0;Se<We;Se++)Ne=ge[Se%We],Pe=ge[(Se+1)%We],Ie[Se]=Xv(Ue,Ne,Pe,me),Ue=Ne,Ne=Pe;o.drawRoundPolygonPath(ae||t,we.x+ve,we.y+Ce,s*$,u*J,fe,Ie)}else if(["roundrectangle","round-rectangle"].includes(K))W=W==="auto"?Nr(Q,te):W,o.drawRoundRectanglePath(ae||t,we.x,we.y,Q,te,W+(F+z+U)/2);else if(["cutrectangle","cut-rectangle"].includes(K))W=W==="auto"?Fv():W,o.drawCutRectanglePath(ae||t,we.x,we.y,Q,te,null,W+(F+z+U)/4);else if(["bottomroundrectangle","bottom-round-rectangle"].includes(K))W=W==="auto"?Nr(Q,te):W,o.drawBottomRoundRectanglePath(ae||t,we.x,we.y,Q,te,W+(F+z+U)/2);else if(K==="barrel")o.drawBarrelPath(ae||t,we.x,we.y,Q,te);else if(K.startsWith("polygon")||["rhomboid","right-rhomboid","round-tag","tag","vee"].includes(K)){var Je=(F+z+U)/s;fe=pi(yi(fe,Je)),o.drawPolygonPath(ae||t,we.x,we.y,s,u,fe)}else{var ze=(F+z+U)/s;fe=pi(yi(fe,-ze)),o.drawPolygonPath(ae||t,we.x,we.y,s,u,fe)}if(c?t.stroke(ae):t.stroke(),k==="double"){t.lineWidth=F/3;var Xe=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",c?t.stroke(ae):t.stroke(),t.globalCompositeOperation=Xe}t.setLineDash&&t.setLineDash([])}},pe=function(){n&&o.drawNodeOverlay(t,e,h,s,u)},ce=function(){n&&o.drawNodeUnderlay(t,e,h,s,u)},ye=function(){o.drawElementText(t,e,null,a)},Le=e.pstyle("ghost").value==="yes";if(Le){var _e=e.pstyle("ghost-offset-x").pfValue,ke=e.pstyle("ghost-offset-y").pfValue,Oe=e.pstyle("ghost-opacity").value,Fe=Oe*v;t.translate(_e,ke),V(),de(),j(Oe*P),ue(),xe(Fe,!0),H(Oe*B),le(),se(S!==0||D!==0),oe(S!==0||D!==0),xe(Fe,!1),he(Fe),t.translate(-_e,-ke)}c&&t.translate(-h.x,-h.y),ce(),c&&t.translate(h.x,h.y),V(),de(),j(),ue(),xe(v,!0),H(),le(),se(S!==0||D!==0),oe(S!==0||D!==0),xe(v,!1),he(),c&&t.translate(-h.x,-h.y),ye(),pe(),r&&t.translate(y.x1,y.y1)}};var Xw=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(r,a,n,i,o){var s=this;if(a.visible()){var u=a.pstyle("".concat(e,"-padding")).pfValue,l=a.pstyle("".concat(e,"-opacity")).value,f=a.pstyle("".concat(e,"-color")).value,h=a.pstyle("".concat(e,"-shape")).value,v=a.pstyle("".concat(e,"-corner-radius")).value;if(l>0){if(n=n||a.position(),i==null||o==null){var c=a.padding();i=a.width()+2*c,o=a.height()+2*c}s.colorFillStyle(r,f[0],f[1],f[2],l),s.nodeShapes[h].draw(r,n.x,n.y,i+u*2,o+u*2,v),r.fill()}}}};Br.drawNodeOverlay=Xw("overlay");Br.drawNodeUnderlay=Xw("underlay");Br.hasPie=function(t){return t=t[0],t._private.hasPie};Br.hasStripe=function(t){return t=t[0],t._private.hasStripe};Br.drawPie=function(t,e,r,a){e=e[0],a=a||e.position();var n=e.cy().style(),i=e.pstyle("pie-size"),o=e.pstyle("pie-hole"),s=e.pstyle("pie-start-angle").pfValue,u=a.x,l=a.y,f=e.width(),h=e.height(),v=Math.min(f,h)/2,c,d=0,g=this.usePaths();if(g&&(u=0,l=0),i.units==="%"?v=v*i.pfValue:i.pfValue!==void 0&&(v=i.pfValue/2),o.units==="%"?c=v*o.pfValue:o.pfValue!==void 0&&(c=o.pfValue/2),!(c>=v))for(var p=1;p<=n.pieBackgroundN;p++){var y=e.pstyle("pie-"+p+"-background-size").value,b=e.pstyle("pie-"+p+"-background-color").value,m=e.pstyle("pie-"+p+"-background-opacity").value*r,E=y/100;E+d>1&&(E=1-d);var T=1.5*Math.PI+2*Math.PI*d;T+=s;var L=2*Math.PI*E,w=T+L;y===0||d>=1||d+E>1||(c===0?(t.beginPath(),t.moveTo(u,l),t.arc(u,l,v,T,w),t.closePath()):(t.beginPath(),t.arc(u,l,v,T,w),t.arc(u,l,c,w,T,!0),t.closePath()),this.colorFillStyle(t,b[0],b[1],b[2],m),t.fill(),d+=E)}};Br.drawStripe=function(t,e,r,a){e=e[0],a=a||e.position();var n=e.cy().style(),i=a.x,o=a.y,s=e.width(),u=e.height(),l=0,f=this.usePaths();t.save();var h=e.pstyle("stripe-direction").value,v=e.pstyle("stripe-size");switch(h){case"vertical":break;case"righward":t.rotate(-Math.PI/2);break}var c=s,d=u;v.units==="%"?(c=c*v.pfValue,d=d*v.pfValue):v.pfValue!==void 0&&(c=v.pfValue,d=v.pfValue),f&&(i=0,o=0),o-=c/2,i-=d/2;for(var g=1;g<=n.stripeBackgroundN;g++){var p=e.pstyle("stripe-"+g+"-background-size").value,y=e.pstyle("stripe-"+g+"-background-color").value,b=e.pstyle("stripe-"+g+"-background-opacity").value*r,m=p/100;m+l>1&&(m=1-l),!(p===0||l>=1||l+m>1)&&(t.beginPath(),t.rect(i,o+d*l,c,d*m),t.closePath(),this.colorFillStyle(t,y[0],y[1],y[2],b),t.fill(),l+=m)}t.restore()};var Ft={},KS=100;Ft.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};Ft.paintCache=function(t){for(var e=this.paintCaches=this.paintCaches||[],r=!0,a,n=0;n<e.length;n++)if(a=e[n],a.context===t){r=!1;break}return r&&(a={context:t},e.push(a)),a};Ft.createGradientStyleFor=function(t,e,r,a,n){var i,o=this.usePaths(),s=r.pstyle(e+"-gradient-stop-colors").value,u=r.pstyle(e+"-gradient-stop-positions").pfValue;if(a==="radial-gradient")if(r.isEdge()){var l=r.sourceEndpoint(),f=r.targetEndpoint(),h=r.midpoint(),v=Zr(l,h),c=Zr(f,h);i=t.createRadialGradient(h.x,h.y,0,h.x,h.y,Math.max(v,c))}else{var d=o?{x:0,y:0}:r.position(),g=r.paddedWidth(),p=r.paddedHeight();i=t.createRadialGradient(d.x,d.y,0,d.x,d.y,Math.max(g,p))}else if(r.isEdge()){var y=r.sourceEndpoint(),b=r.targetEndpoint();i=t.createLinearGradient(y.x,y.y,b.x,b.y)}else{var m=o?{x:0,y:0}:r.position(),E=r.paddedWidth(),T=r.paddedHeight(),L=E/2,w=T/2,C=r.pstyle("background-gradient-direction").value;switch(C){case"to-bottom":i=t.createLinearGradient(m.x,m.y-w,m.x,m.y+w);break;case"to-top":i=t.createLinearGradient(m.x,m.y+w,m.x,m.y-w);break;case"to-left":i=t.createLinearGradient(m.x+L,m.y,m.x-L,m.y);break;case"to-right":i=t.createLinearGradient(m.x-L,m.y,m.x+L,m.y);break;case"to-bottom-right":case"to-right-bottom":i=t.createLinearGradient(m.x-L,m.y-w,m.x+L,m.y+w);break;case"to-top-right":case"to-right-top":i=t.createLinearGradient(m.x-L,m.y+w,m.x+L,m.y-w);break;case"to-bottom-left":case"to-left-bottom":i=t.createLinearGradient(m.x+L,m.y-w,m.x-L,m.y+w);break;case"to-top-left":case"to-left-top":i=t.createLinearGradient(m.x+L,m.y+w,m.x-L,m.y-w);break}}if(!i)return null;for(var A=u.length===s.length,R=s.length,S=0;S<R;S++)i.addColorStop(A?u[S]:S/(R-1),"rgba("+s[S][0]+","+s[S][1]+","+s[S][2]+","+n+")");return i};Ft.gradientFillStyle=function(t,e,r,a){var n=this.createGradientStyleFor(t,"background",e,r,a);if(!n)return null;t.fillStyle=n};Ft.colorFillStyle=function(t,e,r,a,n){t.fillStyle="rgba("+e+","+r+","+a+","+n+")"};Ft.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)}};Ft.gradientStrokeStyle=function(t,e,r,a){var n=this.createGradientStyleFor(t,"line",e,r,a);if(!n)return null;t.strokeStyle=n};Ft.colorStrokeStyle=function(t,e,r,a,n){t.strokeStyle="rgba("+e+","+r+","+a+","+n+")"};Ft.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)}};Ft.matchCanvasSize=function(t){var e=this,r=e.data,a=e.findContainerClientCoords(),n=a[2],i=a[3],o=e.getPixelRatio(),s=e.motionBlurPxRatio;(t===e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE]||t===e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG])&&(o=s);var u=n*o,l=i*o,f;if(!(u===e.canvasWidth&&l===e.canvasHeight)){e.fontCaches=null;var h=r.canvasContainer;h.style.width=n+"px",h.style.height=i+"px";for(var v=0;v<e.CANVAS_LAYERS;v++)f=r.canvases[v],f.width=u,f.height=l,f.style.width=n+"px",f.style.height=i+"px";for(var v=0;v<e.BUFFER_COUNT;v++)f=r.bufferCanvases[v],f.width=u,f.height=l,f.style.width=n+"px",f.style.height=i+"px";e.textureMult=1,o<=1&&(f=r.bufferCanvases[e.TEXTURE_BUFFER],e.textureMult=2,f.width=u*e.textureMult,f.height=l*e.textureMult),e.canvasWidth=u,e.canvasHeight=l,e.pixelRatio=o}};Ft.renderTo=function(t,e,r,a){this.render({forcedContext:t,forcedZoom:e,forcedPan:r,drawAllLayers:!0,forcedPxRatio:a})};Ft.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])};Ft.render=function(t){var e=this;t=t||PE();var r=e.cy,a=t.forcedContext,n=t.drawAllLayers,i=t.drawOnlyNodeLayer,o=t.forcedZoom,s=t.forcedPan,u=t.forcedPxRatio===void 0?this.getPixelRatio():t.forcedPxRatio,l=e.data,f=l.canvasNeedsRedraw,h=e.textureOnViewport&&!a&&(e.pinching||e.hoverData.dragging||e.swipePanning||e.data.wheelZooming),v=t.motionBlur!==void 0?t.motionBlur:e.motionBlur,c=e.motionBlurPxRatio,d=r.hasCompoundNodes(),g=e.hoverData.draggingEles,p=!!(e.hoverData.selecting||e.touchData.selecting);v=v&&!a&&e.motionBlurEnabled&&!p;var y=v;a||(e.prevPxRatio!==u&&(e.invalidateContainerClientCoordsCache(),e.matchCanvasSize(e.container),e.redrawHint("eles",!0),e.redrawHint("drag",!0)),e.prevPxRatio=u),!a&&e.motionBlurTimeout&&clearTimeout(e.motionBlurTimeout),v&&(e.mbFrames==null&&(e.mbFrames=0),e.mbFrames++,e.mbFrames<3&&(y=!1),e.mbFrames>e.minMbLowQualFrames&&(e.motionBlurPxRatio=e.mbPxRBlurry)),e.clearingMotionBlur&&(e.motionBlurPxRatio=1),e.textureDrawLastFrame&&!h&&(f[e.NODE]=!0,f[e.SELECT_BOX]=!0);var b=r.style(),m=r.zoom(),E=o!==void 0?o:m,T=r.pan(),L={x:T.x,y:T.y},w={zoom:m,pan:{x:T.x,y:T.y}},C=e.prevViewport,A=C===void 0||w.zoom!==C.zoom||w.pan.x!==C.pan.x||w.pan.y!==C.pan.y;!A&&!(g&&!d)&&(e.motionBlurPxRatio=1),s&&(L=s),E*=u,L.x*=u,L.y*=u;var R=e.getCachedZSortedEles();function S(H,V,X,Z,ee){var re=H.globalCompositeOperation;H.globalCompositeOperation="destination-out",e.colorFillStyle(H,255,255,255,e.motionBlurTransparency),H.fillRect(V,X,Z,ee),H.globalCompositeOperation=re}function D(H,V){var X,Z,ee,re;!e.clearingMotionBlur&&(H===l.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]||H===l.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG])?(X={x:T.x*c,y:T.y*c},Z=m*c,ee=e.canvasWidth*c,re=e.canvasHeight*c):(X=L,Z=E,ee=e.canvasWidth,re=e.canvasHeight),H.setTransform(1,0,0,1,0,0),V==="motionBlur"?S(H,0,0,ee,re):!a&&(V===void 0||V)&&H.clearRect(0,0,ee,re),n||(H.translate(X.x,X.y),H.scale(Z,Z)),s&&H.translate(s.x,s.y),o&&H.scale(o,o)}if(h||(e.textureDrawLastFrame=!1),h){if(e.textureDrawLastFrame=!0,!e.textureCache){e.textureCache={},e.textureCache.bb=r.mutableElements().boundingBox(),e.textureCache.texture=e.data.bufferCanvases[e.TEXTURE_BUFFER];var P=e.data.bufferContexts[e.TEXTURE_BUFFER];P.setTransform(1,0,0,1,0,0),P.clearRect(0,0,e.canvasWidth*e.textureMult,e.canvasHeight*e.textureMult),e.render({forcedContext:P,drawOnlyNodeLayer:!0,forcedPxRatio:u*e.textureMult});var w=e.textureCache.viewport={zoom:r.zoom(),pan:r.pan(),width:e.canvasWidth,height:e.canvasHeight};w.mpan={x:(0-w.pan.x)/w.zoom,y:(0-w.pan.y)/w.zoom}}f[e.DRAG]=!1,f[e.NODE]=!1;var x=l.contexts[e.NODE],N=e.textureCache.texture,w=e.textureCache.viewport;x.setTransform(1,0,0,1,0,0),v?S(x,0,0,w.width,w.height):x.clearRect(0,0,w.width,w.height);var M=b.core("outside-texture-bg-color").value,I=b.core("outside-texture-bg-opacity").value;e.colorFillStyle(x,M[0],M[1],M[2],I),x.fillRect(0,0,w.width,w.height);var m=r.zoom();D(x,!1),x.clearRect(w.mpan.x,w.mpan.y,w.width/w.zoom/u,w.height/w.zoom/u),x.drawImage(N,w.mpan.x,w.mpan.y,w.width/w.zoom/u,w.height/w.zoom/u)}else e.textureOnViewport&&!a&&(e.textureCache=null);var O=r.extent(),q=e.pinching||e.hoverData.dragging||e.swipePanning||e.data.wheelZooming||e.hoverData.draggingEles||e.cy.animated(),_=e.hideEdgesOnViewport&&q,B=[];if(B[e.NODE]=!f[e.NODE]&&v&&!e.clearedForMotionBlur[e.NODE]||e.clearingMotionBlur,B[e.NODE]&&(e.clearedForMotionBlur[e.NODE]=!0),B[e.DRAG]=!f[e.DRAG]&&v&&!e.clearedForMotionBlur[e.DRAG]||e.clearingMotionBlur,B[e.DRAG]&&(e.clearedForMotionBlur[e.DRAG]=!0),f[e.NODE]||n||i||B[e.NODE]){var z=v&&!B[e.NODE]&&c!==1,x=a||(z?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]:l.contexts[e.NODE]),Y=v&&!z?"motionBlur":void 0;D(x,Y),_?e.drawCachedNodes(x,R.nondrag,u,O):e.drawLayeredElements(x,R.nondrag,u,O),e.debug&&e.drawDebugPoints(x,R.nondrag),!n&&!v&&(f[e.NODE]=!1)}if(!i&&(f[e.DRAG]||n||B[e.DRAG])){var z=v&&!B[e.DRAG]&&c!==1,x=a||(z?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG]:l.contexts[e.DRAG]);D(x,v&&!z?"motionBlur":void 0),_?e.drawCachedNodes(x,R.drag,u,O):e.drawCachedElements(x,R.drag,u,O),e.debug&&e.drawDebugPoints(x,R.drag),!n&&!v&&(f[e.DRAG]=!1)}if(this.drawSelectionRectangle(t,D),v&&c!==1){var k=l.contexts[e.NODE],G=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE],U=l.contexts[e.DRAG],W=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG],j=function(V,X,Z){V.setTransform(1,0,0,1,0,0),Z||!y?V.clearRect(0,0,e.canvasWidth,e.canvasHeight):S(V,0,0,e.canvasWidth,e.canvasHeight);var ee=c;V.drawImage(X,0,0,e.canvasWidth*ee,e.canvasHeight*ee,0,0,e.canvasWidth,e.canvasHeight)};(f[e.NODE]||B[e.NODE])&&(j(k,G,B[e.NODE]),f[e.NODE]=!1),(f[e.DRAG]||B[e.DRAG])&&(j(U,W,B[e.DRAG]),f[e.DRAG]=!1)}e.prevViewport=w,e.clearingMotionBlur&&(e.clearingMotionBlur=!1,e.motionBlurCleared=!0,e.motionBlur=!0),v&&(e.motionBlurTimeout=setTimeout(function(){e.motionBlurTimeout=null,e.clearedForMotionBlur[e.NODE]=!1,e.clearedForMotionBlur[e.DRAG]=!1,e.motionBlur=!1,e.clearingMotionBlur=!h,e.mbFrames=0,f[e.NODE]=!0,f[e.DRAG]=!0,e.redraw()},KS)),a||r.emit("render")};var Ha;Ft.drawSelectionRectangle=function(t,e){var r=this,a=r.cy,n=r.data,i=a.style(),o=t.drawOnlyNodeLayer,s=t.drawAllLayers,u=n.canvasNeedsRedraw,l=t.forcedContext;if(r.showFps||!o&&u[r.SELECT_BOX]&&!s){var f=l||n.contexts[r.SELECT_BOX];if(e(f),r.selection[4]==1&&(r.hoverData.selecting||r.touchData.selecting)){var h=r.cy.zoom(),v=i.core("selection-box-border-width").value/h;f.lineWidth=v,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]),v>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 h=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/h,0,2*Math.PI),f.fill()}var d=r.lastRedrawTime;if(r.showFps&&d){d=Math.round(d);var g=Math.round(1e3/d),p="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",!Ha){var y=f.measureText(p);Ha=y.actualBoundingBoxAscent}f.fillText(p,0,Ha);var b=60;f.strokeRect(0,Ha+10,250,20),f.fillRect(0,Ha+10,250*Math.min(g/b,1),20)}s||(u[r.SELECT_BOX]=!1)}};function Pp(t,e,r){var a=t.createShader(e);if(t.shaderSource(a,r),t.compileShader(a),!t.getShaderParameter(a,t.COMPILE_STATUS))throw new Error(t.getShaderInfoLog(a));return a}function ZS(t,e,r){var a=Pp(t,t.VERTEX_SHADER,e),n=Pp(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 new Error("Could not initialize shaders");return i}function QS(t,e,r){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 Kv(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 JS(t){var e=t.pixelRatio,r=t.cy.zoom();return r*e}function jS(t,e,r,a,n){var i=a*r+e.x,o=n*r+e.y;return o=Math.round(t.canvasHeight-o),[i,o]}function eD(t,e){return e.picking?!0:t.pstyle("background-fill").value!=="solid"||t.pstyle("background-image").strValue!=="none"?!1:t.pstyle("border-width").value===0||t.pstyle("border-opacity").value===0?!0:t.pstyle("border-style").value==="solid"}function tD(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 Vr(t,e,r){var a=t[0]/255,n=t[1]/255,i=t[2]/255,o=e,s=r||new Array(4);return s[0]=a*o,s[1]=n*o,s[2]=i*o,s[3]=o,s}function ha(t,e){var r=e||new Array(4);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 rD(t){return t[0]+(t[1]<<8)+(t[2]<<16)+(t[3]<<24)}function aD(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 $w(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 Ww(t,e,r){switch(e){case t.FLOAT:return new Float32Array(r);case t.INT:return new Int32Array(r)}}function nD(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 iD(t,e,r,a){var n=$w(t,e),i=dt(n,2),o=i[0],s=i[1],u=Ww(t,s,a),l=t.createBuffer();return t.bindBuffer(t.ARRAY_BUFFER,l),t.bufferData(t.ARRAY_BUFFER,u,t.STATIC_DRAW),s===t.FLOAT?t.vertexAttribPointer(r,o,s,!1,0,0):s===t.INT&&t.vertexAttribIPointer(r,o,s,0,0),t.enableVertexAttribArray(r),t.bindBuffer(t.ARRAY_BUFFER,null),l}function tr(t,e,r,a){var n=$w(t,r),i=dt(n,3),o=i[0],s=i[1],u=i[2],l=Ww(t,s,e*o),f=o*u,h=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,h),t.bufferData(t.ARRAY_BUFFER,e*f,t.DYNAMIC_DRAW),t.enableVertexAttribArray(a),s===t.FLOAT?t.vertexAttribPointer(a,o,s,!1,f,0):s===t.INT&&t.vertexAttribIPointer(a,o,s,f,0),t.vertexAttribDivisor(a,1),t.bindBuffer(t.ARRAY_BUFFER,null);for(var v=new Array(e),c=0;c<e;c++)v[c]=nD(t,s,l,f,o,c);return h.dataArray=l,h.stride=f,h.size=o,h.getView=function(d){return v[d]},h.setPoint=function(d,g,p){var y=v[d];y[0]=g,y[1]=p},h.bufferSubData=function(d){t.bindBuffer(t.ARRAY_BUFFER,h),d?t.bufferSubData(t.ARRAY_BUFFER,0,l,0,d*o):t.bufferSubData(t.ARRAY_BUFFER,0,l)},h}function oD(t,e,r){for(var a=9,n=new Float32Array(e*a),i=new Array(e),o=0;o<e;o++){var s=o*a*4;i[o]=new Float32Array(n.buffer,s,a)}var u=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,u),t.bufferData(t.ARRAY_BUFFER,n.byteLength,t.DYNAMIC_DRAW);for(var l=0;l<3;l++){var f=r+l;t.enableVertexAttribArray(f),t.vertexAttribPointer(f,3,t.FLOAT,!1,36,l*12),t.vertexAttribDivisor(f,1)}return t.bindBuffer(t.ARRAY_BUFFER,null),u.getMatrixView=function(h){return i[h]},u.setData=function(h,v){i[v].set(h,0)},u.bufferSubData=function(){t.bindBuffer(t.ARRAY_BUFFER,u),t.bufferSubData(t.ARRAY_BUFFER,0,n)},u}function sD(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 Fp=typeof Float32Array<"u"?Float32Array:Array;Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});function Ps(){var t=new Fp(9);return Fp!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function _p(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 uD(t,e,r){var a=e[0],n=e[1],i=e[2],o=e[3],s=e[4],u=e[5],l=e[6],f=e[7],h=e[8],v=r[0],c=r[1],d=r[2],g=r[3],p=r[4],y=r[5],b=r[6],m=r[7],E=r[8];return t[0]=v*a+c*o+d*l,t[1]=v*n+c*s+d*f,t[2]=v*i+c*u+d*h,t[3]=g*a+p*o+y*l,t[4]=g*n+p*s+y*f,t[5]=g*i+p*u+y*h,t[6]=b*a+m*o+E*l,t[7]=b*n+m*s+E*f,t[8]=b*i+m*u+E*h,t}function ni(t,e,r){var a=e[0],n=e[1],i=e[2],o=e[3],s=e[4],u=e[5],l=e[6],f=e[7],h=e[8],v=r[0],c=r[1];return t[0]=a,t[1]=n,t[2]=i,t[3]=o,t[4]=s,t[5]=u,t[6]=v*a+c*o+l,t[7]=v*n+c*s+f,t[8]=v*i+c*u+h,t}function Bp(t,e,r){var a=e[0],n=e[1],i=e[2],o=e[3],s=e[4],u=e[5],l=e[6],f=e[7],h=e[8],v=Math.sin(r),c=Math.cos(r);return t[0]=c*a+v*o,t[1]=c*n+v*s,t[2]=c*i+v*u,t[3]=c*o-v*a,t[4]=c*s-v*n,t[5]=c*u-v*i,t[6]=l,t[7]=f,t[8]=h,t}function Ev(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 lD(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 fD=(function(){function t(e,r,a,n){Pr(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 Fr(t,[{key:"lock",value:function(){this.locked=!0}},{key:"getKeys",value:function(){return new Set(this.keyToLocation.keys())}},{key:"getScale",value:function(r){var a=r.w,n=r.h,i=this.texHeight,o=this.texSize,s=i/n,u=a*s,l=n*s;return u>o&&(s=o/a,u=a*s,l=n*s),{scale:s,texW:u,texH:l}}},{key:"draw",value:function(r,a,n){var i=this;if(this.locked)throw new Error("can't draw, atlas is locked");var o=this.texSize,s=this.texRows,u=this.texHeight,l=this.getScale(a),f=l.scale,h=l.texW,v=l.texH,c=function(m,E){if(n&&E){var T=E.context,L=m.x,w=m.row,C=L,A=u*w;T.save(),T.translate(C,A),T.scale(f,f),n(T,a),T.restore()}},d=[null,null],g=function(){c(i.freePointer,i.canvas),d[0]={x:i.freePointer.x,y:i.freePointer.row*u,w:h,h:v},d[1]={x:i.freePointer.x+h,y:i.freePointer.row*u,w:0,h:v},i.freePointer.x+=h,i.freePointer.x==o&&(i.freePointer.x=0,i.freePointer.row++)},p=function(){var m=i.scratch,E=i.canvas;m.clear(),c({x:0,row:0},m);var T=o-i.freePointer.x,L=h-T,w=u;{var C=i.freePointer.x,A=i.freePointer.row*u,R=T;E.context.drawImage(m,0,0,R,w,C,A,R,w),d[0]={x:C,y:A,w:R,h:v}}{var S=T,D=(i.freePointer.row+1)*u,P=L;E&&E.context.drawImage(m,S,0,P,w,0,D,P,w),d[1]={x:0,y:D,w:P,h:v}}i.freePointer.x=L,i.freePointer.row++},y=function(){i.freePointer.x=0,i.freePointer.row++};if(this.freePointer.x+h<=o)g();else{if(this.freePointer.row>=s-1)return!1;this.freePointer.x===o?(y(),g()):this.enableWrapping?p():(y(),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),o=i.texW;return this.freePointer.x+o>a?this.freePointer.row<n-1:!0}},{key:"bufferIfNeeded",value:function(r){this.texture||(this.texture=aD(r,this.debugID)),this.needsBuffer&&(this.texture.buffer(this.canvas),this.needsBuffer=!1,this.locked&&(this.canvas=null,this.scratch=null))}},{key:"dispose",value:function(){this.texture&&(this.texture.deleteTexture(),this.texture=null),this.canvas=null,this.scratch=null,this.locked=!0}}])})(),hD=(function(){function t(e,r,a,n){Pr(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 Fr(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 fD(r,a,n,i)}},{key:"_getScratchCanvas",value:function(){if(!this.scratch){var r=this.r,a=this.texSize,n=this.texRows,i=this.createTextureCanvas,o=Math.floor(a/n);this.scratch=i(r,a,o,"scratch")}return this.scratch}},{key:"draw",value:function(r,a,n){var i=this.styleKeyToAtlas.get(r);return i||(i=this.atlases[this.atlases.length-1],(!i||!i.canFit(a))&&(i&&i.lock(),i=this._createAtlas(),this.atlases.push(i)),i.draw(r,a,n),this.styleKeyToAtlas.set(r,i)),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,o=null,s=kt(this.atlases),u;try{var l=function(){var h=u.value,v=h.getKeys(),c=cD(a,v);if(c.size===0)return n.push(h),v.forEach(function(T){return i.set(T,h)}),1;o||(o=r._createAtlas(),n.push(o));var d=kt(v),g;try{for(d.s();!(g=d.n()).done;){var p=g.value;if(!c.has(p)){var y=h.getOffsets(p),b=dt(y,2),m=b[0],E=b[1];o.canFit({w:m.w+E.w,h:m.h})||(o.lock(),o=r._createAtlas(),n.push(o)),h.canvas&&(r._copyTextureToNewAtlas(p,h,o),i.set(p,o))}}}catch(T){d.e(T)}finally{d.f()}h.dispose()};for(s.s();!(u=s.n()).done;)l()}catch(f){s.e(f)}finally{s.f()}this.atlases=n,this.styleKeyToAtlas=i,this.markedKeys=new Set}},{key:"_copyTextureToNewAtlas",value:function(r,a,n){var i=a.getOffsets(r),o=dt(i,2),s=o[0],u=o[1];if(u.w===0)n.draw(r,s,function(v){v.drawImage(a.canvas,s.x,s.y,s.w,s.h,0,0,s.w,s.h)});else{var l=this._getScratchCanvas();l.clear(),l.context.drawImage(a.canvas,s.x,s.y,s.w,s.h,0,0,s.w,s.h),l.context.drawImage(a.canvas,u.x,u.y,u.w,u.h,s.w,0,u.w,u.h);var f=s.w+u.w,h=s.h;n.draw(r,{w:f,h},function(v){v.drawImage(l,0,0,f,h,0,0,f,h)})}}},{key:"getCounts",value:function(){return{keyCount:this.styleKeyToAtlas.size,atlasCount:new Set(this.styleKeyToAtlas.values()).size}}}])})();function cD(t,e){return t.intersection?t.intersection(e):new Set(ci(t).filter(function(r){return e.has(r)}))}var vD=(function(){function t(e,r){Pr(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 Fr(t,[{key:"getAtlasSize",value:function(){return this.atlasSize}},{key:"addAtlasCollection",value:function(r,a){var n=this.globalOptions,i=n.webglTexSize,o=n.createTextureCanvas,s=a.texRows,u=this._cacheScratchCanvas(o),l=new hD(this.r,i,s,u);this.collections.set(r,l)}},{key:"addRenderType",value:function(r,a){var n=a.collection;if(!this.collections.has(n))throw new Error("invalid atlas collection name '".concat(n,"'"));var i=this.collections.get(n),o=Be({type:r,atlasCollection:i},a);this.renderTypes.set(r,o)}},{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(o,s,u,l){return l?((!i||s!=a||u!=n)&&(a=s,n=u,i=r(o,s,u)),i):r(o,s,u)}}},{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,o=i===void 0?!1:i,s=n.filterEle,u=s===void 0?function(){return!0}:s,l=n.filterType,f=l===void 0?function(){return!0}:l,h=!1,v=!1,c=kt(r),d;try{for(c.s();!(d=c.n()).done;){var g=d.value;if(u(g)){var p=kt(this.renderTypes.values()),y;try{var b=function(){var E=y.value,T=E.type;if(f(T)){var L=a.collections.get(E.collection),w=E.getKey(g),C=Array.isArray(w)?w:[w];if(o)C.forEach(function(D){return L.markKeyForGC(D)}),v=!0;else{var A=E.getID?E.getID(g):g.id(),R=a._key(T,A),S=a.typeAndIdToKey.get(R);S!==void 0&&!tD(C,S)&&(h=!0,a.typeAndIdToKey.delete(R),S.forEach(function(D){return L.markKeyForGC(D)}))}}};for(p.s();!(y=p.n()).done;)b()}catch(m){p.e(m)}finally{p.f()}}}}catch(m){c.e(m)}finally{c.f()}return v&&(this.gc(),h=!1),h}},{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 o=this.renderTypes.get(a),s=this.collections.get(o.collection),u=!1,l=s.draw(i,n,function(v){o.drawClipped?(v.save(),v.beginPath(),v.rect(0,0,n.w,n.h),v.clip(),o.drawElement(v,r,n,!0,!0),v.restore()):o.drawElement(v,r,n,!0,!0),u=!0});if(u){var f=o.getID?o.getID(r):r.id(),h=this._key(a,f);this.typeAndIdToKey.has(h)?this.typeAndIdToKey.get(h).push(i):this.typeAndIdToKey.set(h,[i])}return l}},{key:"getAtlasInfo",value:function(r,a){var n=this,i=this.renderTypes.get(a),o=i.getKey(r),s=Array.isArray(o)?o:[o];return s.map(function(u){var l=i.getBoundingBox(r,u),f=n.getOrCreateAtlas(r,a,l,u),h=f.getOffsets(u),v=dt(h,2),c=v[0],d=v[1];return{atlas:f,tex:c,tex1:c,tex2:d,bb:l}})}},{key:"getDebugInfo",value:function(){var r=[],a=kt(this.collections),n;try{for(a.s();!(n=a.n()).done;){var i=dt(n.value,2),o=i[0],s=i[1],u=s.getCounts(),l=u.keyCount,f=u.atlasCount;r.push({type:o,keyCount:l,atlasCount:f})}}catch(h){a.e(h)}finally{a.f()}return r}}])})(),dD=(function(){function t(e){Pr(this,t),this.globalOptions=e,this.atlasSize=e.webglTexSize,this.maxAtlasesPerBatch=e.webglTexPerBatch,this.batchAtlases=[]}return Fr(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){return this.batchAtlases.length===this.maxAtlasesPerBatch?this.batchAtlases.includes(r):!0}},{key:"getAtlasIndexForBatch",value:function(r){var a=this.batchAtlases.indexOf(r);if(a<0){if(this.batchAtlases.length===this.maxAtlasesPerBatch)throw new Error("cannot add more atlases to batch");this.batchAtlases.push(r),a=this.batchAtlases.length-1}return a}}])})(),gD=`
18
+ float circleSD(vec2 p, float r) {
19
+ return distance(vec2(0), p) - r; // signed distance
20
+ }
21
+ `,pD=`
22
+ float rectangleSD(vec2 p, vec2 b) {
23
+ vec2 d = abs(p)-b;
24
+ return distance(vec2(0),max(d,0.0)) + min(max(d.x,d.y),0.0);
25
+ }
26
+ `,yD=`
27
+ float roundRectangleSD(vec2 p, vec2 b, vec4 cr) {
28
+ cr.xy = (p.x > 0.0) ? cr.xy : cr.zw;
29
+ cr.x = (p.y > 0.0) ? cr.x : cr.y;
30
+ vec2 q = abs(p) - b + cr.x;
31
+ return min(max(q.x, q.y), 0.0) + distance(vec2(0), max(q, 0.0)) - cr.x;
32
+ }
33
+ `,mD=`
34
+ float ellipseSD(vec2 p, vec2 ab) {
35
+ p = abs( p ); // symmetry
36
+
37
+ // find root with Newton solver
38
+ vec2 q = ab*(p-ab);
39
+ float w = (q.x<q.y)? 1.570796327 : 0.0;
40
+ for( int i=0; i<5; i++ ) {
41
+ vec2 cs = vec2(cos(w),sin(w));
42
+ vec2 u = ab*vec2( cs.x,cs.y);
43
+ vec2 v = ab*vec2(-cs.y,cs.x);
44
+ w = w + dot(p-u,v)/(dot(p-u,u)+dot(v,v));
45
+ }
46
+
47
+ // compute final point and distance
48
+ float d = length(p-ab*vec2(cos(w),sin(w)));
49
+
50
+ // return signed distance
51
+ return (dot(p/ab,p/ab)>1.0) ? d : -d;
52
+ }
53
+ `,rn={SCREEN:{name:"screen",screen:!0},PICKING:{name:"picking",picking:!0}},Ci={IGNORE:1,USE_BB:2},Fs=0,kp=1,qp=2,_s=3,ca=4,$n=5,Xa=6,$a=7,bD=(function(){function t(e,r,a){Pr(this,t),this.r=e,this.gl=r,this.maxInstances=a.webglBatchSize,this.atlasSize=a.webglTexSize,this.bgColor=a.bgColor,this.debug=a.webglDebug,this.batchDebugInfo=[],a.enableWrapping=!0,a.createTextureCanvas=QS,this.atlasManager=new vD(e,a),this.batchManager=new dD(a),this.simpleShapeOptions=new Map,this.program=this._createShaderProgram(rn.SCREEN),this.pickingProgram=this._createShaderProgram(rn.PICKING),this.vao=this._createVAO()}return Fr(t,[{key:"addAtlasCollection",value:function(r,a){this.atlasManager.addAtlasCollection(r,a)}},{key:"addTextureAtlasRenderType",value:function(r,a){this.atlasManager.addRenderType(r,a)}},{key:"addSimpleShapeRenderType",value:function(r,a){this.simpleShapeOptions.set(r,a)}},{key:"invalidate",value:function(r){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=a.type,i=this.atlasManager;return n?i.invalidate(r,{filterType:function(s){return s===n},forceRedraw:!0}):i.invalidate(r)}},{key:"gc",value:function(){this.atlasManager.gc()}},{key:"_createShaderProgram",value:function(r){var a=this.gl,n=`#version 300 es
54
+ precision highp float;
55
+
56
+ uniform mat3 uPanZoomMatrix;
57
+ uniform int uAtlasSize;
58
+
59
+ // instanced
60
+ in vec2 aPosition; // a vertex from the unit square
61
+
62
+ in mat3 aTransform; // used to transform verticies, eg into a bounding box
63
+ in int aVertType; // the type of thing we are rendering
64
+
65
+ // the z-index that is output when using picking mode
66
+ in vec4 aIndex;
67
+
68
+ // For textures
69
+ in int aAtlasId; // which shader unit/atlas to use
70
+ in vec4 aTex; // x/y/w/h of texture in atlas
71
+
72
+ // for edges
73
+ in vec4 aPointAPointB;
74
+ in vec4 aPointCPointD;
75
+ in vec2 aLineWidth; // also used for node border width
76
+
77
+ // simple shapes
78
+ in vec4 aCornerRadius; // for round-rectangle [top-right, bottom-right, top-left, bottom-left]
79
+ in vec4 aColor; // also used for edges
80
+ in vec4 aBorderColor; // aLineWidth is used for border width
81
+
82
+ // output values passed to the fragment shader
83
+ out vec2 vTexCoord;
84
+ out vec4 vColor;
85
+ out vec2 vPosition;
86
+ // flat values are not interpolated
87
+ flat out int vAtlasId;
88
+ flat out int vVertType;
89
+ flat out vec2 vTopRight;
90
+ flat out vec2 vBotLeft;
91
+ flat out vec4 vCornerRadius;
92
+ flat out vec4 vBorderColor;
93
+ flat out vec2 vBorderWidth;
94
+ flat out vec4 vIndex;
95
+
96
+ void main(void) {
97
+ int vid = gl_VertexID;
98
+ vec2 position = aPosition; // TODO make this a vec3, simplifies some code below
99
+
100
+ if(aVertType == `.concat(Fs,`) {
101
+ float texX = aTex.x; // texture coordinates
102
+ float texY = aTex.y;
103
+ float texW = aTex.z;
104
+ float texH = aTex.w;
105
+
106
+ if(vid == 1 || vid == 2 || vid == 4) {
107
+ texX += texW;
108
+ }
109
+ if(vid == 2 || vid == 4 || vid == 5) {
110
+ texY += texH;
111
+ }
112
+
113
+ float d = float(uAtlasSize);
114
+ vTexCoord = vec2(texX / d, texY / d); // tex coords must be between 0 and 1
115
+
116
+ gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0);
117
+ }
118
+ else if(aVertType == `).concat(ca," || aVertType == ").concat($a,`
119
+ || aVertType == `).concat($n," || aVertType == ").concat(Xa,`) { // simple shapes
120
+
121
+ // the bounding box is needed by the fragment shader
122
+ vBotLeft = (aTransform * vec3(0, 0, 1)).xy; // flat
123
+ vTopRight = (aTransform * vec3(1, 1, 1)).xy; // flat
124
+ vPosition = (aTransform * vec3(position, 1)).xy; // will be interpolated
125
+
126
+ // calculations are done in the fragment shader, just pass these along
127
+ vColor = aColor;
128
+ vCornerRadius = aCornerRadius;
129
+ vBorderColor = aBorderColor;
130
+ vBorderWidth = aLineWidth;
131
+
132
+ gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0);
133
+ }
134
+ else if(aVertType == `).concat(kp,`) {
135
+ vec2 source = aPointAPointB.xy;
136
+ vec2 target = aPointAPointB.zw;
137
+
138
+ // adjust the geometry so that the line is centered on the edge
139
+ position.y = position.y - 0.5;
140
+
141
+ // stretch the unit square into a long skinny rectangle
142
+ vec2 xBasis = target - source;
143
+ vec2 yBasis = normalize(vec2(-xBasis.y, xBasis.x));
144
+ vec2 point = source + xBasis * position.x + yBasis * aLineWidth[0] * position.y;
145
+
146
+ gl_Position = vec4(uPanZoomMatrix * vec3(point, 1.0), 1.0);
147
+ vColor = aColor;
148
+ }
149
+ else if(aVertType == `).concat(qp,`) {
150
+ vec2 pointA = aPointAPointB.xy;
151
+ vec2 pointB = aPointAPointB.zw;
152
+ vec2 pointC = aPointCPointD.xy;
153
+ vec2 pointD = aPointCPointD.zw;
154
+
155
+ // adjust the geometry so that the line is centered on the edge
156
+ position.y = position.y - 0.5;
157
+
158
+ vec2 p0, p1, p2, pos;
159
+ if(position.x == 0.0) { // The left side of the unit square
160
+ p0 = pointA;
161
+ p1 = pointB;
162
+ p2 = pointC;
163
+ pos = position;
164
+ } else { // The right side of the unit square, use same approach but flip the geometry upside down
165
+ p0 = pointD;
166
+ p1 = pointC;
167
+ p2 = pointB;
168
+ pos = vec2(0.0, -position.y);
169
+ }
170
+
171
+ vec2 p01 = p1 - p0;
172
+ vec2 p12 = p2 - p1;
173
+ vec2 p21 = p1 - p2;
174
+
175
+ // Find the normal vector.
176
+ vec2 tangent = normalize(normalize(p12) + normalize(p01));
177
+ vec2 normal = vec2(-tangent.y, tangent.x);
178
+
179
+ // Find the vector perpendicular to p0 -> p1.
180
+ vec2 p01Norm = normalize(vec2(-p01.y, p01.x));
181
+
182
+ // Determine the bend direction.
183
+ float sigma = sign(dot(p01 + p21, normal));
184
+ float width = aLineWidth[0];
185
+
186
+ if(sign(pos.y) == -sigma) {
187
+ // This is an intersecting vertex. Adjust the position so that there's no overlap.
188
+ vec2 point = 0.5 * width * normal * -sigma / dot(normal, p01Norm);
189
+ gl_Position = vec4(uPanZoomMatrix * vec3(p1 + point, 1.0), 1.0);
190
+ } else {
191
+ // This is a non-intersecting vertex. Treat it like a mitre join.
192
+ vec2 point = 0.5 * width * normal * sigma * dot(normal, p01Norm);
193
+ gl_Position = vec4(uPanZoomMatrix * vec3(p1 + point, 1.0), 1.0);
194
+ }
195
+
196
+ vColor = aColor;
197
+ }
198
+ else if(aVertType == `).concat(_s,` && vid < 3) {
199
+ // massage the first triangle into an edge arrow
200
+ if(vid == 0)
201
+ position = vec2(-0.15, -0.3);
202
+ if(vid == 1)
203
+ position = vec2( 0.0, 0.0);
204
+ if(vid == 2)
205
+ position = vec2( 0.15, -0.3);
206
+
207
+ gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0);
208
+ vColor = aColor;
209
+ }
210
+ else {
211
+ gl_Position = vec4(2.0, 0.0, 0.0, 1.0); // discard vertex by putting it outside webgl clip space
212
+ }
213
+
214
+ vAtlasId = aAtlasId;
215
+ vVertType = aVertType;
216
+ vIndex = aIndex;
217
+ }
218
+ `),i=this.batchManager.getIndexArray(),o=`#version 300 es
219
+ precision highp float;
220
+
221
+ // declare texture unit for each texture atlas in the batch
222
+ `.concat(i.map(function(l){return"uniform sampler2D uTexture".concat(l,";")}).join(`
223
+ `),`
224
+
225
+ uniform vec4 uBGColor;
226
+ uniform float uZoom;
227
+
228
+ in vec2 vTexCoord;
229
+ in vec4 vColor;
230
+ in vec2 vPosition; // model coordinates
231
+
232
+ flat in int vAtlasId;
233
+ flat in vec4 vIndex;
234
+ flat in int vVertType;
235
+ flat in vec2 vTopRight;
236
+ flat in vec2 vBotLeft;
237
+ flat in vec4 vCornerRadius;
238
+ flat in vec4 vBorderColor;
239
+ flat in vec2 vBorderWidth;
240
+
241
+ out vec4 outColor;
242
+
243
+ `).concat(gD,`
244
+ `).concat(pD,`
245
+ `).concat(yD,`
246
+ `).concat(mD,`
247
+
248
+ vec4 blend(vec4 top, vec4 bot) { // blend colors with premultiplied alpha
249
+ return vec4(
250
+ top.rgb + (bot.rgb * (1.0 - top.a)),
251
+ top.a + (bot.a * (1.0 - top.a))
252
+ );
253
+ }
254
+
255
+ vec4 distInterp(vec4 cA, vec4 cB, float d) { // interpolate color using Signed Distance
256
+ // scale to the zoom level so that borders don't look blurry when zoomed in
257
+ // note 1.5 is an aribitrary value chosen because it looks good
258
+ return mix(cA, cB, 1.0 - smoothstep(0.0, 1.5 / uZoom, abs(d)));
259
+ }
260
+
261
+ void main(void) {
262
+ if(vVertType == `).concat(Fs,`) {
263
+ // look up the texel from the texture unit
264
+ `).concat(i.map(function(l){return"if(vAtlasId == ".concat(l,") outColor = texture(uTexture").concat(l,", vTexCoord);")}).join(`
265
+ else `),`
266
+ }
267
+ else if(vVertType == `).concat(_s,`) {
268
+ // mimics how canvas renderer uses context.globalCompositeOperation = 'destination-out';
269
+ outColor = blend(vColor, uBGColor);
270
+ outColor.a = 1.0; // make opaque, masks out line under arrow
271
+ }
272
+ else if(vVertType == `).concat(ca,` && vBorderWidth == vec2(0.0)) { // simple rectangle with no border
273
+ outColor = vColor; // unit square is already transformed to the rectangle, nothing else needs to be done
274
+ }
275
+ else if(vVertType == `).concat(ca," || vVertType == ").concat($a,`
276
+ || vVertType == `).concat($n," || vVertType == ").concat(Xa,`) { // use SDF
277
+
278
+ float outerBorder = vBorderWidth[0];
279
+ float innerBorder = vBorderWidth[1];
280
+ float borderPadding = outerBorder * 2.0;
281
+ float w = vTopRight.x - vBotLeft.x - borderPadding;
282
+ float h = vTopRight.y - vBotLeft.y - borderPadding;
283
+ vec2 b = vec2(w/2.0, h/2.0); // half width, half height
284
+ vec2 p = vPosition - vec2(vTopRight.x - b[0] - outerBorder, vTopRight.y - b[1] - outerBorder); // translate to center
285
+
286
+ float d; // signed distance
287
+ if(vVertType == `).concat(ca,`) {
288
+ d = rectangleSD(p, b);
289
+ } else if(vVertType == `).concat($a,` && w == h) {
290
+ d = circleSD(p, b.x); // faster than ellipse
291
+ } else if(vVertType == `).concat($a,`) {
292
+ d = ellipseSD(p, b);
293
+ } else {
294
+ d = roundRectangleSD(p, b, vCornerRadius.wzyx);
295
+ }
296
+
297
+ // use the distance to interpolate a color to smooth the edges of the shape, doesn't need multisampling
298
+ // we must smooth colors inwards, because we can't change pixels outside the shape's bounding box
299
+ if(d > 0.0) {
300
+ if(d > outerBorder) {
301
+ discard;
302
+ } else {
303
+ outColor = distInterp(vBorderColor, vec4(0), d - outerBorder);
304
+ }
305
+ } else {
306
+ if(d > innerBorder) {
307
+ vec4 outerColor = outerBorder == 0.0 ? vec4(0) : vBorderColor;
308
+ vec4 innerBorderColor = blend(vBorderColor, vColor);
309
+ outColor = distInterp(innerBorderColor, outerColor, d);
310
+ }
311
+ else {
312
+ vec4 outerColor;
313
+ if(innerBorder == 0.0 && outerBorder == 0.0) {
314
+ outerColor = vec4(0);
315
+ } else if(innerBorder == 0.0) {
316
+ outerColor = vBorderColor;
317
+ } else {
318
+ outerColor = blend(vBorderColor, vColor);
319
+ }
320
+ outColor = distInterp(vColor, outerColor, d - innerBorder);
321
+ }
322
+ }
323
+ }
324
+ else {
325
+ outColor = vColor;
326
+ }
327
+
328
+ `).concat(r.picking?`if(outColor.a == 0.0) discard;
329
+ else outColor = vIndex;`:"",`
330
+ }
331
+ `),s=ZS(a,n,o);s.aPosition=a.getAttribLocation(s,"aPosition"),s.aIndex=a.getAttribLocation(s,"aIndex"),s.aVertType=a.getAttribLocation(s,"aVertType"),s.aTransform=a.getAttribLocation(s,"aTransform"),s.aAtlasId=a.getAttribLocation(s,"aAtlasId"),s.aTex=a.getAttribLocation(s,"aTex"),s.aPointAPointB=a.getAttribLocation(s,"aPointAPointB"),s.aPointCPointD=a.getAttribLocation(s,"aPointCPointD"),s.aLineWidth=a.getAttribLocation(s,"aLineWidth"),s.aColor=a.getAttribLocation(s,"aColor"),s.aCornerRadius=a.getAttribLocation(s,"aCornerRadius"),s.aBorderColor=a.getAttribLocation(s,"aBorderColor"),s.uPanZoomMatrix=a.getUniformLocation(s,"uPanZoomMatrix"),s.uAtlasSize=a.getUniformLocation(s,"uAtlasSize"),s.uBGColor=a.getUniformLocation(s,"uBGColor"),s.uZoom=a.getUniformLocation(s,"uZoom"),s.uTextures=[];for(var u=0;u<this.batchManager.getMaxAtlasesPerBatch();u++)s.uTextures.push(a.getUniformLocation(s,"uTexture".concat(u)));return s}},{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,o=n.createVertexArray();return n.bindVertexArray(o),iD(n,"vec2",i.aPosition,r),this.transformBuffer=oD(n,a,i.aTransform),this.indexBuffer=tr(n,a,"vec4",i.aIndex),this.vertTypeBuffer=tr(n,a,"int",i.aVertType),this.atlasIdBuffer=tr(n,a,"int",i.aAtlasId),this.texBuffer=tr(n,a,"vec4",i.aTex),this.pointAPointBBuffer=tr(n,a,"vec4",i.aPointAPointB),this.pointCPointDBuffer=tr(n,a,"vec4",i.aPointCPointD),this.lineWidthBuffer=tr(n,a,"vec2",i.aLineWidth),this.colorBuffer=tr(n,a,"vec4",i.aColor),this.cornerRadiusBuffer=tr(n,a,"vec4",i.aCornerRadius),this.borderColorBuffer=tr(n,a,"vec4",i.aBorderColor),n.bindVertexArray(null),o}},{key:"buffers",get:function(){var r=this;return this._buffers||(this._buffers=Object.keys(this).filter(function(a){return xr(a,"Buffer")}).map(function(a){return r[a]})),this._buffers}},{key:"startFrame",value:function(r){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:rn.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){return r.visible()?a&&a.isVisible?a.isVisible(r):!0:!1}},{key:"drawTexture",value:function(r,a,n){var i=this.atlasManager,o=this.batchManager,s=i.getRenderTypeOpts(n);if(this._isVisible(r,s)&&!(r.isEdge()&&!this._isValidEdge(r))){if(this.renderTarget.picking&&s.getTexPickingMode){var u=s.getTexPickingMode(r);if(u===Ci.IGNORE)return;if(u==Ci.USE_BB){this.drawPickingRectangle(r,a,n);return}}var l=i.getAtlasInfo(r,n),f=kt(l),h;try{for(f.s();!(h=f.n()).done;){var v=h.value,c=v.atlas,d=v.tex1,g=v.tex2;o.canAddToCurrentBatch(c)||this.endBatch();for(var p=o.getAtlasIndexForBatch(c),y=0,b=[[d,!0],[g,!1]];y<b.length;y++){var m=dt(b[y],2),E=m[0],T=m[1];if(E.w!=0){var L=this.instanceCount;this.vertTypeBuffer.getView(L)[0]=Fs;var w=this.indexBuffer.getView(L);ha(a,w);var C=this.atlasIdBuffer.getView(L);C[0]=p;var A=this.texBuffer.getView(L);A[0]=E.x,A[1]=E.y,A[2]=E.w,A[3]=E.h;var R=this.transformBuffer.getMatrixView(L);this.setTransformMatrix(r,R,s,v,T),this.instanceCount++,T||this.wrappedCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}catch(S){f.e(S)}finally{f.f()}}}},{key:"setTransformMatrix",value:function(r,a,n,i){var o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,s=0;if(n.shapeProps&&n.shapeProps.padding&&(s=r.pstyle(n.shapeProps.padding).pfValue),i){var u=i.bb,l=i.tex1,f=i.tex2,h=l.w/(l.w+f.w);o||(h=1-h);var v=this._getAdjustedBB(u,s,o,h);this._applyTransformMatrix(a,v,n,r)}else{var c=n.getBoundingBox(r),d=this._getAdjustedBB(c,s,!0,1);this._applyTransformMatrix(a,d,n,r)}}},{key:"_applyTransformMatrix",value:function(r,a,n,i){var o,s;_p(r);var u=n.getRotation?n.getRotation(i):0;if(u!==0){var l=n.getRotationPoint(i),f=l.x,h=l.y;ni(r,r,[f,h]),Bp(r,r,u);var v=n.getRotationOffset(i);o=v.x+(a.xOffset||0),s=v.y+(a.yOffset||0)}else o=a.x1,s=a.y1;ni(r,r,[o,s]),Ev(r,r,[a.w,a.h])}},{key:"_getAdjustedBB",value:function(r,a,n,i){var o=r.x1,s=r.y1,u=r.w,l=r.h,f=r.yOffset;a&&(o-=a,s-=a,u+=2*a,l+=2*a);var h=0,v=u*i;return n&&i<1?u=v:!n&&i<1&&(h=u-v,o+=h,u=v),{x1:o,y1:s,w:u,h:l,xOffset:h,yOffset:f}}},{key:"drawPickingRectangle",value:function(r,a,n){var i=this.atlasManager.getRenderTypeOpts(n),o=this.instanceCount;this.vertTypeBuffer.getView(o)[0]=ca;var s=this.indexBuffer.getView(o);ha(a,s);var u=this.colorBuffer.getView(o);Vr([0,0,0],1,u);var l=this.transformBuffer.getMatrixView(o);this.setTransformMatrix(r,l,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)){var o=i.shapeProps,s=this._getVertTypeForShape(r,o.shape);if(s===void 0||i.isSimple&&!i.isSimple(r,this.renderTarget)){this.drawTexture(r,a,n);return}var u=this.instanceCount;if(this.vertTypeBuffer.getView(u)[0]=s,s===$n||s===Xa){var l=i.getBoundingBox(r),f=this._getCornerRadius(r,o.radius,l),h=this.cornerRadiusBuffer.getView(u);h[0]=f,h[1]=f,h[2]=f,h[3]=f,s===Xa&&(h[0]=0,h[2]=0)}var v=this.indexBuffer.getView(u);ha(a,v);var c=this.renderTarget.picking?1:r.pstyle(o.opacity).value,d=r.pstyle(o.color).value,g=this.colorBuffer.getView(u);Vr(d,c,g);var p=this.lineWidthBuffer.getView(u);if(p[0]=0,p[1]=0,o.border){var y=r.pstyle("border-width").value;if(y>0){var b=r.pstyle("border-color").value,m=r.pstyle("border-opacity").value,E=this.borderColorBuffer.getView(u);Vr(b,m,E);var T=r.pstyle("border-position").value;if(T==="inside")p[0]=0,p[1]=-y;else if(T==="outside")p[0]=y,p[1]=0;else{var L=y/2;p[0]=L,p[1]=-L}}}var w=this.transformBuffer.getMatrixView(u);this.setTransformMatrix(r,w,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 ca;case"ellipse":return $a;case"roundrectangle":case"round-rectangle":return $n;case"bottom-round-rectangle":return Xa;default:return}}},{key:"_getCornerRadius",value:function(r,a,n){var i=n.w,o=n.h;if(r.pstyle(a).value==="auto")return Nr(i,o);var s=r.pstyle(a).pfValue,u=i/2,l=o/2;return Math.min(s,l,u)}},{key:"drawEdgeArrow",value:function(r,a,n){if(r.visible()){var i=r._private.rscratch,o,s,u;if(n==="source"?(o=i.arrowStartX,s=i.arrowStartY,u=i.srcArrowAngle):(o=i.arrowEndX,s=i.arrowEndY,u=i.tgtArrowAngle),!(isNaN(o)||o==null||isNaN(s)||s==null||isNaN(u)||u==null)){var l=r.pstyle(n+"-arrow-shape").value;if(l!=="none"){var f=r.pstyle(n+"-arrow-color").value,h=r.pstyle("opacity").value,v=r.pstyle("line-opacity").value,c=h*v,d=r.pstyle("width").pfValue,g=r.pstyle("arrow-scale").value,p=this.r.getArrowWidth(d,g),y=this.instanceCount,b=this.transformBuffer.getMatrixView(y);_p(b),ni(b,b,[o,s]),Ev(b,b,[p,p]),Bp(b,b,u),this.vertTypeBuffer.getView(y)[0]=_s;var m=this.indexBuffer.getView(y);ha(a,m);var E=this.colorBuffer.getView(y);Vr(f,c,E),this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}},{key:"drawEdgeLine",value:function(r,a){if(r.visible()){var n=this._getEdgePoints(r);if(n){var i=r.pstyle("opacity").value,o=r.pstyle("line-opacity").value,s=r.pstyle("width").pfValue,u=r.pstyle("line-color").value,l=i*o;if(n.length/2+this.instanceCount>this.maxInstances&&this.endBatch(),n.length==4){var f=this.instanceCount;this.vertTypeBuffer.getView(f)[0]=kp;var h=this.indexBuffer.getView(f);ha(a,h);var v=this.colorBuffer.getView(f);Vr(u,l,v);var c=this.lineWidthBuffer.getView(f);c[0]=s;var d=this.pointAPointBBuffer.getView(f);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 p=this.instanceCount;this.vertTypeBuffer.getView(p)[0]=qp;var y=this.indexBuffer.getView(p);ha(a,y);var b=this.colorBuffer.getView(p);Vr(u,l,b);var m=this.lineWidthBuffer.getView(p);m[0]=s;var E=n[g-2],T=n[g-1],L=n[g],w=n[g+1],C=n[g+2],A=n[g+3],R=n[g+4],S=n[g+5];g==0&&(E=2*L-C+.001,T=2*w-A+.001),g==n.length-4&&(R=2*C-L+.001,S=2*A-w+.001);var D=this.pointAPointBBuffer.getView(p);D[0]=E,D[1]=T,D[2]=L,D[3]=w;var P=this.pointCPointDBuffer.getView(p);P[0]=C,P[1]=A,P[2]=R,P[3]=S,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}},{key:"_isValidEdge",value:function(r){var a=r._private.rscratch;return!(a.badLine||a.allpts==null||isNaN(a.allpts[0]))}},{key:"_getEdgePoints",value:function(r){var a=r._private.rscratch;if(this._isValidEdge(r)){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;for(var n=Array((a+1)*2),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 o=i/a;this._setCurvePoint(r,o,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{for(var o=Array(r.length-2),s=0;s<o.length;s+=2){var u=(1-a)*r[s]+a*r[s+2],l=(1-a)*r[s+1]+a*r[s+3];o[s]=u,o[s+1]=l}return this._setCurvePoint(o,a,n,i)}}},{key:"endBatch",value:function(){var r=this.gl,a=this.vao,n=this.vertexCount,i=this.instanceCount;if(i!==0){var o=this.renderTarget.picking?this.pickingProgram:this.program;r.useProgram(o),r.bindVertexArray(a);var s=kt(this.buffers),u;try{for(s.s();!(u=s.n()).done;){var l=u.value;l.bufferSubData(i)}}catch(d){s.e(d)}finally{s.f()}for(var f=this.batchManager.getAtlases(),h=0;h<f.length;h++)f[h].bufferIfNeeded(r);for(var v=0;v<f.length;v++)r.activeTexture(r.TEXTURE0+v),r.bindTexture(r.TEXTURE_2D,f[v].texture),r.uniform1i(o.uTextures[v],v);r.uniform1f(o.uZoom,JS(this.r)),r.uniformMatrix3fv(o.uPanZoomMatrix,!1,this.panZoomMatrix),r.uniform1i(o.uAtlasSize,this.batchManager.getAtlasSize());var c=Vr(this.bgColor,1);r.uniform4fv(o.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(o,s){return o+s.atlasCount},0),n=this.batchDebugInfo,i=n.reduce(function(o,s){return o+s.count},0);return{atlasInfo:r,totalAtlases:a,wrappedCount:this.wrappedCount,simpleCount:this.simpleCount,batchCount:n.length,batchInfo:n,totalInstances:i}}}])})(),Kw={};Kw.initWebgl=function(t,e){var r=this,a=r.data.contexts[r.WEBGL];t.bgColor=ED(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=sD(a),r.pickingFrameBuffer.needsDraw=!0,r.drawing=new bD(r,a,t);var n=function(h){return function(v){return r.getTextAngle(v,h)}},i=function(h){return function(v){var c=v.pstyle(h);return c&&c.value}},o=function(h){return function(v){return v.pstyle("".concat(h,"-opacity")).value>0}},s=function(h){var v=h.pstyle("text-events").strValue==="yes";return v?Ci.USE_BB:Ci.IGNORE},u=function(h){var v=h.position(),c=v.x,d=v.y,g=h.outerWidth(),p=h.outerHeight();return{w:g,h:p,x1:c-g/2,y1:d-p/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:u,isSimple:eD,shapeProps:{shape:"shape",color:"background-color",opacity:"background-opacity",radius:"corner-radius",border:!0}}),r.drawing.addSimpleShapeRenderType("node-overlay",{getBoundingBox:u,isVisible:o("overlay"),shapeProps:{shape:"overlay-shape",color:"overlay-color",opacity:"overlay-opacity",padding:"overlay-padding",radius:"overlay-corner-radius"}}),r.drawing.addSimpleShapeRenderType("node-underlay",{getBoundingBox:u,isVisible:o("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:s,getKey:Bs(e.getLabelKey,null),getBoundingBox:ks(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:s,getKey:Bs(e.getSourceLabelKey,"source"),getBoundingBox:ks(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:s,getKey:Bs(e.getTargetLabelKey,"target"),getBoundingBox:ks(e.getTargetLabelBox,"target"),drawClipped:!0,drawElement:e.drawTargetLabel,getRotation:n("target"),getRotationPoint:e.getTargetLabelRotationPoint,getRotationOffset:e.getTargetLabelRotationOffset,isVisible:i("target-label")});var l=bn(function(){console.log("garbage collect flag set"),r.data.gc=!0},1e4);r.onUpdateEleCalcs(function(f,h){var v=!1;h&&h.length>0&&(v|=r.drawing.invalidate(h)),v&&l()}),wD(r)};function ED(t){var e=t.cy.container(),r=e&&e.style&&e.style.backgroundColor||"white";return xE(r)}function Zw(t,e){var r=t._private.rscratch;return _t(r,"labelWrapCachedLines",e)||[]}var Bs=function(e,r){return function(a){var n=e(a),i=Zw(a,r);return i.length>1?i.map(function(o,s){return"".concat(n,"_").concat(s)}):n}},ks=function(e,r){return function(a,n){var i=e(a);if(typeof n=="string"){var o=n.indexOf("_");if(o>0){var s=Number(n.substring(o+1)),u=Zw(a,r),l=i.h/u.length,f=l*s,h=i.y1+f;return{x1:i.x1,w:i.w,y1:h,h:l,yOffset:f}}}return i}};function wD(t){{var e=t.render;t.render=function(i){i=i||{};var o=t.cy;t.webgl&&(o.zoom()>zw?(TD(t),e.call(t,i)):(xD(t),Jw(t,i,rn.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,o,s,u){return DD(t,i,o)};{var a=t.invalidateCachedZSortedEles;t.invalidateCachedZSortedEles=function(){a.call(t),t.pickingFrameBuffer.needsDraw=!0}}{var n=t.notify;t.notify=function(i,o){n.call(t,i,o),i==="viewport"||i==="bounds"?t.pickingFrameBuffer.needsDraw=!0:i==="background"&&t.drawing.invalidate(o,{type:"node-body"})}}}function TD(t){var e=t.data.contexts[t.WEBGL];e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT)}function xD(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 CD(t){var e=t.canvasWidth,r=t.canvasHeight,a=Kv(t),n=a.pan,i=a.zoom,o=Ps();ni(o,o,[n.x,n.y]),Ev(o,o,[i,i]);var s=Ps();lD(s,e,r);var u=Ps();return uD(u,s,o),u}function Qw(t,e){var r=t.canvasWidth,a=t.canvasHeight,n=Kv(t),i=n.pan,o=n.zoom;e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,r,a),e.translate(i.x,i.y),e.scale(o,o)}function AD(t,e){t.drawSelectionRectangle(e,function(r){return Qw(t,r)})}function LD(t){var e=t.data.contexts[t.NODE];e.save(),Qw(t,e),e.strokeStyle="rgba(0, 0, 0, 0.3)",e.beginPath(),e.moveTo(-1e3,0),e.lineTo(1e3,0),e.stroke(),e.beginPath(),e.moveTo(0,-1e3),e.lineTo(0,1e3),e.stroke(),e.restore()}function RD(t){var e=function(n,i,o){for(var s=n.atlasManager.getAtlasCollection(i),u=t.data.contexts[t.NODE],l=s.atlases,f=0;f<l.length;f++){var h=l[f],v=h.canvas;if(v){var c=v.width,d=v.height,g=c*f,p=v.height*o,y=.4;u.save(),u.scale(y,y),u.drawImage(v,g,p),u.strokeStyle="black",u.rect(g,p,c,d),u.stroke(),u.restore()}}},r=0;e(t.drawing,"node",r++),e(t.drawing,"label",r++)}function SD(t,e,r,a,n){var i,o,s,u,l=Kv(t),f=l.pan,h=l.zoom;{var v=jS(t,f,h,e,r),c=dt(v,2),d=c[0],g=c[1],p=6;i=d-p/2,o=g-p/2,s=p,u=p}if(s===0||u===0)return[];var y=t.data.contexts[t.WEBGL];y.bindFramebuffer(y.FRAMEBUFFER,t.pickingFrameBuffer),t.pickingFrameBuffer.needsDraw&&(y.viewport(0,0,y.canvas.width,y.canvas.height),Jw(t,null,rn.PICKING),t.pickingFrameBuffer.needsDraw=!1);var b=s*u,m=new Uint8Array(b*4);y.readPixels(i,o,s,u,y.RGBA,y.UNSIGNED_BYTE,m),y.bindFramebuffer(y.FRAMEBUFFER,null);for(var E=new Set,T=0;T<b;T++){var L=m.slice(T*4,T*4+4),w=rD(L)-1;w>=0&&E.add(w)}return E}function DD(t,e,r){var a=SD(t,e,r),n=t.getCachedZSortedEles(),i,o,s=kt(a),u;try{for(s.s();!(u=s.n()).done;){var l=u.value,f=n[l];if(!i&&f.isNode()&&(i=f),!o&&f.isEdge()&&(o=f),i&&o)break}}catch(h){s.e(h)}finally{s.f()}return[i,o].filter(Boolean)}function qs(t,e,r){var a=t.drawing;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")):(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 Jw(t,e,r){var a;t.webglDebug&&(a=performance.now());var n=t.drawing,i=0;if(r.screen&&t.data.canvasNeedsRedraw[t.SELECT_BOX]&&AD(t,e),t.data.canvasNeedsRedraw[t.NODE]||r.picking){var o=t.data.contexts[t.WEBGL];r.screen?(o.clearColor(0,0,0,0),o.enable(o.BLEND),o.blendFunc(o.ONE,o.ONE_MINUS_SRC_ALPHA)):o.disable(o.BLEND),o.clear(o.COLOR_BUFFER_BIT|o.DEPTH_BUFFER_BIT),o.viewport(0,0,o.canvas.width,o.canvas.height);var s=CD(t),u=t.getCachedZSortedEles();if(i=u.length,n.startFrame(s,r),r.screen){for(var l=0;l<u.nondrag.length;l++)qs(t,l,u.nondrag[l]);for(var f=0;f<u.drag.length;f++)qs(t,f,u.drag[f])}else if(r.picking)for(var h=0;h<u.length;h++)qs(t,h,u[h]);n.endFrame(),r.screen&&t.webglDebugShowAtlases&&(LD(t),RD(t)),t.data.canvasNeedsRedraw[t.NODE]=!1,t.data.canvasNeedsRedraw[t.DRAG]=!1}if(t.webglDebug){var v=performance.now(),c=!1,d=Math.ceil(v-a),g=n.getDebugInfo(),p=["".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(p));else{console.log("WebGL (".concat(r.name,") - frame time ").concat(d,"ms")),console.log("Totals:"),console.log(" ".concat(p)),console.log("Texture Atlases Used:");var y=g.atlasInfo,b=kt(y),m;try{for(b.s();!(m=b.n()).done;){var E=m.value;console.log(" ".concat(E.type,": ").concat(E.keyCount," keys, ").concat(E.atlasCount," atlases"))}}catch(T){b.e(T)}finally{b.f()}console.log("")}}t.data.gc&&(console.log("Garbage Collect!"),t.data.gc=!1,n.gc())}var kr={};kr.drawPolygonPath=function(t,e,r,a,n,i){var o=a/2,s=n/2;t.beginPath&&t.beginPath(),t.moveTo(e+o*i[0],r+s*i[1]);for(var u=1;u<i.length/2;u++)t.lineTo(e+o*i[u*2],r+s*i[u*2+1]);t.closePath()};kr.drawRoundPolygonPath=function(t,e,r,a,n,i,o){o.forEach(function(s){return Iw(t,s)}),t.closePath()};kr.drawRoundRectanglePath=function(t,e,r,a,n,i){var o=a/2,s=n/2,u=i==="auto"?Nr(a,n):Math.min(i,s,o);t.beginPath&&t.beginPath(),t.moveTo(e,r-s),t.arcTo(e+o,r-s,e+o,r,u),t.arcTo(e+o,r+s,e,r+s,u),t.arcTo(e-o,r+s,e-o,r,u),t.arcTo(e-o,r-s,e,r-s,u),t.lineTo(e,r-s),t.closePath()};kr.drawBottomRoundRectanglePath=function(t,e,r,a,n,i){var o=a/2,s=n/2,u=i==="auto"?Nr(a,n):i;t.beginPath&&t.beginPath(),t.moveTo(e,r-s),t.lineTo(e+o,r-s),t.lineTo(e+o,r),t.arcTo(e+o,r+s,e,r+s,u),t.arcTo(e-o,r+s,e-o,r,u),t.lineTo(e-o,r-s),t.lineTo(e,r-s),t.closePath()};kr.drawCutRectanglePath=function(t,e,r,a,n,i,o){var s=a/2,u=n/2,l=o==="auto"?Fv():o;t.beginPath&&t.beginPath(),t.moveTo(e-s+l,r-u),t.lineTo(e+s-l,r-u),t.lineTo(e+s,r-u+l),t.lineTo(e+s,r+u-l),t.lineTo(e+s-l,r+u),t.lineTo(e-s+l,r+u),t.lineTo(e-s,r+u-l),t.lineTo(e-s,r-u+l),t.closePath()};kr.drawBarrelPath=function(t,e,r,a,n){var i=a/2,o=n/2,s=e-i,u=e+i,l=r-o,f=r+o,h=ov(a,n),v=h.widthOffset,c=h.heightOffset,d=h.ctrlPtOffsetPct*v;t.beginPath&&t.beginPath(),t.moveTo(s,l+c),t.lineTo(s,f-c),t.quadraticCurveTo(s+d,f,s+v,f),t.lineTo(u-v,f),t.quadraticCurveTo(u-d,f,u,f-c),t.lineTo(u,l+c),t.quadraticCurveTo(u-d,l,u-v,l),t.lineTo(s+v,l),t.quadraticCurveTo(s+d,l,s,l+c),t.closePath()};var Gp=Math.sin(0),Up=Math.cos(0),wv={},Tv={},jw=Math.PI/40;for(var va=0*Math.PI;va<2*Math.PI;va+=jw)wv[va]=Math.sin(va),Tv[va]=Math.cos(va);kr.drawEllipsePath=function(t,e,r,a,n){if(t.beginPath&&t.beginPath(),t.ellipse)t.ellipse(e,r,a/2,n/2,0,0,2*Math.PI);else for(var i,o,s=a/2,u=n/2,l=0*Math.PI;l<2*Math.PI;l+=jw)i=e-s*wv[l]*Gp+s*Tv[l]*Up,o=r+u*Tv[l]*Gp+u*wv[l]*Up,l===0?t.moveTo(i,o):t.lineTo(i,o);t.closePath()};var An={};An.createBuffer=function(t,e){var r=document.createElement("canvas");return r.width=t,r.height=e,[r,r.getContext("2d")]};An.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],o=t.full?Math.ceil(a.h):n[3],s=Te(t.maxWidth)||Te(t.maxHeight),u=this.getPixelRatio(),l=1;if(t.scale!==void 0)i*=t.scale,o*=t.scale,l=t.scale;else if(s){var f=1/0,h=1/0;Te(t.maxWidth)&&(f=l*t.maxWidth/i),Te(t.maxHeight)&&(h=l*t.maxHeight/o),l=Math.min(f,h),i*=l,o*=l}s||(i*=u,o*=u,l*=u);var v=document.createElement("canvas");v.width=i,v.height=o,v.style.width=i+"px",v.style.height=o+"px";var c=v.getContext("2d");if(i>0&&o>0){c.clearRect(0,0,i,o),c.globalCompositeOperation="source-over";var d=this.getCachedZSortedEles();if(t.full)c.translate(-a.x1*l,-a.y1*l),c.scale(l,l),this.drawElements(c,d),c.scale(1/l,1/l),c.translate(a.x1*l,a.y1*l);else{var g=e.pan(),p={x:g.x*l,y:g.y*l};l*=e.zoom(),c.translate(p.x,p.y),c.scale(l,l),this.drawElements(c,d),c.scale(1/l,1/l),c.translate(-p.x,-p.y)}t.bg&&(c.globalCompositeOperation="destination-over",c.fillStyle=t.bg,c.rect(0,0,i,o),c.fill())}return v};function ND(t,e){for(var r=atob(t),a=new ArrayBuffer(r.length),n=new Uint8Array(a),i=0;i<r.length;i++)n[i]=r.charCodeAt(i);return new Blob([a],{type:e})}function zp(t){var e=t.indexOf(",");return t.substr(e+1)}function eT(t,e,r){var a=function(){return e.toDataURL(r,t.quality)};switch(t.output){case"blob-promise":return new Ra(function(n,i){try{e.toBlob(function(o){o!=null?n(o):i(new Error("`canvas.toBlob()` sent a null value in its callback"))},r,t.quality)}catch(o){i(o)}});case"blob":return ND(zp(a()),r);case"base64":return zp(a());case"base64uri":default:return a()}}An.png=function(t){return eT(t,this.bufferCanvasImage(t),"image/png")};An.jpg=function(t){return eT(t,this.bufferCanvasImage(t),"image/jpeg")};var tT={};tT.nodeShapeImpl=function(t,e,r,a,n,i,o,s){switch(t){case"ellipse":return this.drawEllipsePath(e,r,a,n,i);case"polygon":return this.drawPolygonPath(e,r,a,n,i,o);case"round-polygon":return this.drawRoundPolygonPath(e,r,a,n,i,o,s);case"roundrectangle":case"round-rectangle":return this.drawRoundRectanglePath(e,r,a,n,i,s);case"cutrectangle":case"cut-rectangle":return this.drawCutRectanglePath(e,r,a,n,i,o,s);case"bottomroundrectangle":case"bottom-round-rectangle":return this.drawBottomRoundRectanglePath(e,r,a,n,i,s);case"barrel":return this.drawBarrelPath(e,r,a,n,i)}};var MD=rT,Ge=rT.prototype;Ge.CANVAS_LAYERS=3;Ge.SELECT_BOX=0;Ge.DRAG=1;Ge.NODE=2;Ge.WEBGL=3;Ge.CANVAS_TYPES=["2d","2d","2d","webgl2"];Ge.BUFFER_COUNT=3;Ge.TEXTURE_BUFFER=0;Ge.MOTIONBLUR_BUFFER_NODE=1;Ge.MOTIONBLUR_BUFFER_DRAG=2;function rT(t){var e=this,r=e.cy.window(),a=r.document;t.webgl&&(Ge.CANVAS_LAYERS=e.CANVAS_LAYERS=4,console.log("webgl rendering enabled")),e.data={canvases:new Array(Ge.CANVAS_LAYERS),contexts:new Array(Ge.CANVAS_LAYERS),canvasNeedsRedraw:new Array(Ge.CANVAS_LAYERS),bufferCanvases:new Array(Ge.BUFFER_COUNT),bufferContexts:new Array(Ge.CANVAS_LAYERS)};var n="-webkit-tap-highlight-color",i="rgba(0,0,0,0)";e.data.canvasContainer=a.createElement("div");var o=e.data.canvasContainer.style;e.data.canvasContainer.style[n]=i,o.position="relative",o.zIndex="0",o.overflow="hidden";var s=t.cy.container();s.appendChild(e.data.canvasContainer),s.style[n]=i;var u={"-webkit-user-select":"none","-moz-user-select":"-moz-none","user-select":"none","-webkit-tap-highlight-color":"rgba(0,0,0,0)","outline-style":"none"};Ax()&&(u["-ms-touch-action"]="none",u["touch-action"]="none");for(var l=0;l<Ge.CANVAS_LAYERS;l++){var f=e.data.canvases[l]=a.createElement("canvas"),h=Ge.CANVAS_TYPES[l];e.data.contexts[l]=f.getContext(h),e.data.contexts[l]||at("Could not create canvas of type "+h),Object.keys(u).forEach(function(H){f.style[H]=u[H]}),f.style.position="absolute",f.setAttribute("data-id","layer"+l),f.style.zIndex=String(Ge.CANVAS_LAYERS-l),e.data.canvasContainer.appendChild(f),e.data.canvasNeedsRedraw[l]=!1}e.data.topCanvas=e.data.canvases[0],e.data.canvases[Ge.NODE].setAttribute("data-id","layer"+Ge.NODE+"-node"),e.data.canvases[Ge.SELECT_BOX].setAttribute("data-id","layer"+Ge.SELECT_BOX+"-selectbox"),e.data.canvases[Ge.DRAG].setAttribute("data-id","layer"+Ge.DRAG+"-drag"),e.data.canvases[Ge.WEBGL]&&e.data.canvases[Ge.WEBGL].setAttribute("data-id","layer"+Ge.WEBGL+"-webgl");for(var l=0;l<Ge.BUFFER_COUNT;l++)e.data.bufferCanvases[l]=a.createElement("canvas"),e.data.bufferContexts[l]=e.data.bufferCanvases[l].getContext("2d"),e.data.bufferCanvases[l].style.position="absolute",e.data.bufferCanvases[l].setAttribute("data-id","buffer"+l),e.data.bufferCanvases[l].style.zIndex=String(-l-1),e.data.bufferCanvases[l].style.visibility="hidden";e.pathsEnabled=!0;var v=Pt(),c=function(V){return{x:(V.x1+V.x2)/2,y:(V.y1+V.y2)/2}},d=function(V){return{x:-V.w/2,y:-V.h/2}},g=function(V){var X=V[0]._private,Z=X.oldBackgroundTimestamp===X.backgroundTimestamp;return!Z},p=function(V){return V[0]._private.nodeKey},y=function(V){return V[0]._private.labelStyleKey},b=function(V){return V[0]._private.sourceLabelStyleKey},m=function(V){return V[0]._private.targetLabelStyleKey},E=function(V,X,Z,ee,re){return e.drawElement(V,X,Z,!1,!1,re)},T=function(V,X,Z,ee,re){return e.drawElementText(V,X,Z,ee,"main",re)},L=function(V,X,Z,ee,re){return e.drawElementText(V,X,Z,ee,"source",re)},w=function(V,X,Z,ee,re){return e.drawElementText(V,X,Z,ee,"target",re)},C=function(V){return V.boundingBox(),V[0]._private.bodyBounds},A=function(V){return V.boundingBox(),V[0]._private.labelBounds.main||v},R=function(V){return V.boundingBox(),V[0]._private.labelBounds.source||v},S=function(V){return V.boundingBox(),V[0]._private.labelBounds.target||v},D=function(V,X){return X},P=function(V){return c(C(V))},x=function(V,X,Z){var ee=V?V+"-":"";return{x:X.x+Z.pstyle(ee+"text-margin-x").pfValue,y:X.y+Z.pstyle(ee+"text-margin-y").pfValue}},N=function(V,X,Z){var ee=V[0]._private.rscratch;return{x:ee[X],y:ee[Z]}},M=function(V){return x("",N(V,"labelX","labelY"),V)},I=function(V){return x("source",N(V,"sourceLabelX","sourceLabelY"),V)},O=function(V){return x("target",N(V,"targetLabelX","targetLabelY"),V)},q=function(V){return d(C(V))},_=function(V){return d(R(V))},B=function(V){return d(S(V))},z=function(V){var X=A(V),Z=d(A(V));if(V.isNode()){switch(V.pstyle("text-halign").value){case"left":Z.x=-X.w-(X.leftPad||0);break;case"right":Z.x=-(X.rightPad||0);break}switch(V.pstyle("text-valign").value){case"top":Z.y=-X.h-(X.topPad||0);break;case"bottom":Z.y=-(X.botPad||0);break}}return Z},Y=e.data.eleTxrCache=new Za(e,{getKey:p,doesEleInvalidateKey:g,drawElement:E,getBoundingBox:C,getRotationPoint:P,getRotationOffset:q,allowEdgeTxrCaching:!1,allowParentTxrCaching:!1}),k=e.data.lblTxrCache=new Za(e,{getKey:y,drawElement:T,getBoundingBox:A,getRotationPoint:M,getRotationOffset:z,isVisible:D}),G=e.data.slbTxrCache=new Za(e,{getKey:b,drawElement:L,getBoundingBox:R,getRotationPoint:I,getRotationOffset:_,isVisible:D}),U=e.data.tlbTxrCache=new Za(e,{getKey:m,drawElement:w,getBoundingBox:S,getRotationPoint:O,getRotationOffset:B,isVisible:D}),W=e.data.lyrTxrCache=new Vw(e);e.onUpdateEleCalcs(function(V,X){Y.invalidateElements(X),k.invalidateElements(X),G.invalidateElements(X),U.invalidateElements(X),W.invalidateElements(X);for(var Z=0;Z<X.length;Z++){var ee=X[Z]._private;ee.oldBackgroundTimestamp=ee.backgroundTimestamp}});var j=function(V){for(var X=0;X<V.length;X++)W.enqueueElementRefinement(V[X].ele)};Y.onDequeue(j),k.onDequeue(j),G.onDequeue(j),U.onDequeue(j),t.webgl&&e.initWebgl(t,{getStyleKey:p,getLabelKey:y,getSourceLabelKey:b,getTargetLabelKey:m,drawElement:E,drawLabel:T,drawSourceLabel:L,drawTargetLabel:w,getElementBox:C,getLabelBox:A,getSourceLabelBox:R,getTargetLabelBox:S,getElementRotationPoint:P,getElementRotationOffset:q,getLabelRotationPoint:M,getSourceLabelRotationPoint:I,getTargetLabelRotationPoint:O,getLabelRotationOffset:z,getSourceLabelRotationOffset:_,getTargetLabelRotationOffset:B})}Ge.redrawHint=function(t,e){var r=this;switch(t){case"eles":r.data.canvasNeedsRedraw[Ge.NODE]=e;break;case"drag":r.data.canvasNeedsRedraw[Ge.DRAG]=e;break;case"select":r.data.canvasNeedsRedraw[Ge.SELECT_BOX]=e;break;case"gc":r.data.gc=!0;break}};var OD=typeof Path2D<"u";Ge.path2dEnabled=function(t){if(t===void 0)return this.pathsEnabled;this.pathsEnabled=!!t};Ge.usePaths=function(){return OD&&this.pathsEnabled};Ge.setImgSmoothing=function(t,e){t.imageSmoothingEnabled!=null?t.imageSmoothingEnabled=e:(t.webkitImageSmoothingEnabled=e,t.mozImageSmoothingEnabled=e,t.msImageSmoothingEnabled=e)};Ge.getImgSmoothing=function(t){return t.imageSmoothingEnabled!=null?t.imageSmoothingEnabled:t.webkitImageSmoothingEnabled||t.mozImageSmoothingEnabled||t.msImageSmoothingEnabled};Ge.makeOffscreenCanvas=function(t,e){var r;if((typeof OffscreenCanvas>"u"?"undefined":bt(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};[Yw,or,gr,Wv,ta,Br,Ft,Kw,kr,An,tT].forEach(function(t){Be(Ge,t)});var ID=[{name:"null",impl:Nw},{name:"base",impl:Gw},{name:"canvas",impl:MD}],PD=[{type:"layout",extensions:iS},{type:"renderer",extensions:ID}],aT={},nT={};function iT(t,e,r){var a=r,n=function(C){Ze("Can not register `"+e+"` for `"+t+"` since `"+C+"` already exists in the prototype and can not be overridden")};if(t==="core"){if(cn.prototype[e])return n(e);cn.prototype[e]=r}else if(t==="collection"){if(At.prototype[e])return n(e);At.prototype[e]=r}else if(t==="layout"){for(var i=function(C){this.options=C,r.call(this,C),Ye(this._private)||(this._private={}),this._private.cy=C.cy,this._private.listeners=[],this.createEmitter()},o=i.prototype=Object.create(r.prototype),s=[],u=0;u<s.length;u++){var l=s[u];o[l]=o[l]||function(){return this}}o.start&&!o.run?o.run=function(){return this.start(),this}:!o.start&&o.run&&(o.start=function(){return this.run(),this});var f=r.prototype.stop;o.stop=function(){var w=this.options;if(w&&w.animate){var C=this.animations;if(C)for(var A=0;A<C.length;A++)C[A].stop()}return f?f.call(this):this.emit("layoutstop"),this},o.destroy||(o.destroy=function(){return this}),o.cy=function(){return this._private.cy};var h=function(C){return C._private.cy},v={addEventFields:function(C,A){A.layout=C,A.cy=h(C),A.target=C},bubble:function(){return!0},parent:function(C){return h(C)}};Be(o,{createEmitter:function(){return this._private.emitter=new Bi(v,this),this},emitter:function(){return this._private.emitter},on:function(C,A){return this.emitter().on(C,A),this},one:function(C,A){return this.emitter().one(C,A),this},once:function(C,A){return this.emitter().one(C,A),this},removeListener:function(C,A){return this.emitter().removeListener(C,A),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},emit:function(C,A){return this.emitter().emit(C,A),this}}),Ke.eventAliasesOn(o),a=i}else if(t==="renderer"&&e!=="null"&&e!=="base"){var c=oT("renderer","base"),d=c.prototype,g=r,p=r.prototype,y=function(){c.apply(this,arguments),g.apply(this,arguments)},b=y.prototype;for(var m in d){var E=d[m],T=p[m]!=null;if(T)return n(m);b[m]=E}for(var L in p)b[L]=p[L];d.clientFunctions.forEach(function(w){b[w]=b[w]||function(){at("Renderer does not implement `renderer."+w+"()` on its prototype")}}),a=y}else if(t==="__proto__"||t==="constructor"||t==="prototype")return at(t+" is an illegal type to be registered, possibly lead to prototype pollutions");return CE({map:aT,keys:[t,e],value:a})}function oT(t,e){return AE({map:aT,keys:[t,e]})}function FD(t,e,r,a,n){return CE({map:nT,keys:[t,e,r,a],value:n})}function _D(t,e,r,a){return AE({map:nT,keys:[t,e,r,a]})}var xv=function(){if(arguments.length===2)return oT.apply(null,arguments);if(arguments.length===3)return iT.apply(null,arguments);if(arguments.length===4)return _D.apply(null,arguments);if(arguments.length===5)return FD.apply(null,arguments);at("Invalid extension access syntax")};cn.prototype.extension=xv;PD.forEach(function(t){t.extensions.forEach(function(e){iT(t.type,e.name,e.impl)})});var Ai=function(){if(!(this instanceof Ai))return new Ai;this.length=0},jr=Ai.prototype;jr.instanceString=function(){return"stylesheet"};jr.selector=function(t){var e=this.length++;return this[e]={selector:t,properties:[]},this};jr.css=function(t,e){var r=this.length-1;if(Me(t))this[r].properties.push({name:t,value:e});else if(Ye(t))for(var a=t,n=Object.keys(a),i=0;i<n.length;i++){var o=n[i],s=a[o];if(s!=null){var u=Tt.properties[o]||Tt.properties[Ri(o)];if(u!=null){var l=u.name,f=s;this[r].properties.push({name:l,value:f})}}}return this};jr.style=jr.css;jr.generateStyle=function(t){var e=new Tt(t);return this.appendToStyle(e)};jr.appendToStyle=function(t){for(var e=0;e<this.length;e++){var r=this[e],a=r.selector,n=r.properties;t.selector(a);for(var i=0;i<n.length;i++){var o=n[i];t.css(o.name,o.value)}}return t};var BD="3.33.2",Aa=function(e){if(e===void 0&&(e={}),Ye(e))return new cn(e);if(Me(e))return xv.apply(xv,arguments)};Aa.use=function(t){var e=Array.prototype.slice.call(arguments,1);return e.unshift(Aa),t.apply(null,e),this};Aa.warnings=function(t){return OE(t)};Aa.version=BD;Aa.stylesheet=Aa.Stylesheet=Ai;var ii={exports:{}};function Zv(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Gs,Vp;function kD(){if(Vp)return Gs;Vp=1;function t(){this.__data__=[],this.size=0}return Gs=t,Gs}var Us,Yp;function Oa(){if(Yp)return Us;Yp=1;function t(e,r){return e===r||e!==e&&r!==r}return Us=t,Us}var zs,Hp;function Hi(){if(Hp)return zs;Hp=1;var t=Oa();function e(r,a){for(var n=r.length;n--;)if(t(r[n][0],a))return n;return-1}return zs=e,zs}var Vs,Xp;function qD(){if(Xp)return Vs;Xp=1;var t=Hi(),e=Array.prototype,r=e.splice;function a(n){var i=this.__data__,o=t(i,n);if(o<0)return!1;var s=i.length-1;return o==s?i.pop():r.call(i,o,1),--this.size,!0}return Vs=a,Vs}var Ys,$p;function GD(){if($p)return Ys;$p=1;var t=Hi();function e(r){var a=this.__data__,n=t(a,r);return n<0?void 0:a[n][1]}return Ys=e,Ys}var Hs,Wp;function UD(){if(Wp)return Hs;Wp=1;var t=Hi();function e(r){return t(this.__data__,r)>-1}return Hs=e,Hs}var Xs,Kp;function zD(){if(Kp)return Xs;Kp=1;var t=Hi();function e(r,a){var n=this.__data__,i=t(n,r);return i<0?(++this.size,n.push([r,a])):n[i][1]=a,this}return Xs=e,Xs}var $s,Zp;function Xi(){if(Zp)return $s;Zp=1;var t=kD(),e=qD(),r=GD(),a=UD(),n=zD();function i(o){var s=-1,u=o==null?0:o.length;for(this.clear();++s<u;){var l=o[s];this.set(l[0],l[1])}}return i.prototype.clear=t,i.prototype.delete=e,i.prototype.get=r,i.prototype.has=a,i.prototype.set=n,$s=i,$s}var Ws,Qp;function VD(){if(Qp)return Ws;Qp=1;var t=Xi();function e(){this.__data__=new t,this.size=0}return Ws=e,Ws}var Ks,Jp;function YD(){if(Jp)return Ks;Jp=1;function t(e){var r=this.__data__,a=r.delete(e);return this.size=r.size,a}return Ks=t,Ks}var Zs,jp;function HD(){if(jp)return Zs;jp=1;function t(e){return this.__data__.get(e)}return Zs=t,Zs}var Qs,ey;function XD(){if(ey)return Qs;ey=1;function t(e){return this.__data__.has(e)}return Qs=t,Qs}var Js,ty;function sT(){if(ty)return Js;ty=1;var t=typeof Pn=="object"&&Pn&&Pn.Object===Object&&Pn;return Js=t,Js}var js,ry;function Jt(){if(ry)return js;ry=1;var t=sT(),e=typeof self=="object"&&self&&self.Object===Object&&self,r=t||e||Function("return this")();return js=r,js}var eu,ay;function Ia(){if(ay)return eu;ay=1;var t=Jt(),e=t.Symbol;return eu=e,eu}var tu,ny;function $D(){if(ny)return tu;ny=1;var t=Ia(),e=Object.prototype,r=e.hasOwnProperty,a=e.toString,n=t?t.toStringTag:void 0;function i(o){var s=r.call(o,n),u=o[n];try{o[n]=void 0;var l=!0}catch{}var f=a.call(o);return l&&(s?o[n]=u:delete o[n]),f}return tu=i,tu}var ru,iy;function WD(){if(iy)return ru;iy=1;var t=Object.prototype,e=t.toString;function r(a){return e.call(a)}return ru=r,ru}var au,oy;function ra(){if(oy)return au;oy=1;var t=Ia(),e=$D(),r=WD(),a="[object Null]",n="[object Undefined]",i=t?t.toStringTag:void 0;function o(s){return s==null?s===void 0?n:a:i&&i in Object(s)?e(s):r(s)}return au=o,au}var nu,sy;function Ht(){if(sy)return nu;sy=1;function t(e){var r=typeof e;return e!=null&&(r=="object"||r=="function")}return nu=t,nu}var iu,uy;function Ln(){if(uy)return iu;uy=1;var t=ra(),e=Ht(),r="[object AsyncFunction]",a="[object Function]",n="[object GeneratorFunction]",i="[object Proxy]";function o(s){if(!e(s))return!1;var u=t(s);return u==a||u==n||u==r||u==i}return iu=o,iu}var ou,ly;function KD(){if(ly)return ou;ly=1;var t=Jt(),e=t["__core-js_shared__"];return ou=e,ou}var su,fy;function ZD(){if(fy)return su;fy=1;var t=KD(),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 su=r,su}var uu,hy;function uT(){if(hy)return uu;hy=1;var t=Function.prototype,e=t.toString;function r(a){if(a!=null){try{return e.call(a)}catch{}try{return a+""}catch{}}return""}return uu=r,uu}var lu,cy;function QD(){if(cy)return lu;cy=1;var t=Ln(),e=ZD(),r=Ht(),a=uT(),n=/[\\^$.*+?()[\]{}|]/g,i=/^\[object .+?Constructor\]$/,o=Function.prototype,s=Object.prototype,u=o.toString,l=s.hasOwnProperty,f=RegExp("^"+u.call(l).replace(n,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function h(v){if(!r(v)||e(v))return!1;var c=t(v)?f:i;return c.test(a(v))}return lu=h,lu}var fu,vy;function JD(){if(vy)return fu;vy=1;function t(e,r){return e==null?void 0:e[r]}return fu=t,fu}var hu,dy;function aa(){if(dy)return hu;dy=1;var t=QD(),e=JD();function r(a,n){var i=e(a,n);return t(i)?i:void 0}return hu=r,hu}var cu,gy;function Qv(){if(gy)return cu;gy=1;var t=aa(),e=Jt(),r=t(e,"Map");return cu=r,cu}var vu,py;function $i(){if(py)return vu;py=1;var t=aa(),e=t(Object,"create");return vu=e,vu}var du,yy;function jD(){if(yy)return du;yy=1;var t=$i();function e(){this.__data__=t?t(null):{},this.size=0}return du=e,du}var gu,my;function eN(){if(my)return gu;my=1;function t(e){var r=this.has(e)&&delete this.__data__[e];return this.size-=r?1:0,r}return gu=t,gu}var pu,by;function tN(){if(by)return pu;by=1;var t=$i(),e="__lodash_hash_undefined__",r=Object.prototype,a=r.hasOwnProperty;function n(i){var o=this.__data__;if(t){var s=o[i];return s===e?void 0:s}return a.call(o,i)?o[i]:void 0}return pu=n,pu}var yu,Ey;function rN(){if(Ey)return yu;Ey=1;var t=$i(),e=Object.prototype,r=e.hasOwnProperty;function a(n){var i=this.__data__;return t?i[n]!==void 0:r.call(i,n)}return yu=a,yu}var mu,wy;function aN(){if(wy)return mu;wy=1;var t=$i(),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 mu=r,mu}var bu,Ty;function nN(){if(Ty)return bu;Ty=1;var t=jD(),e=eN(),r=tN(),a=rN(),n=aN();function i(o){var s=-1,u=o==null?0:o.length;for(this.clear();++s<u;){var l=o[s];this.set(l[0],l[1])}}return i.prototype.clear=t,i.prototype.delete=e,i.prototype.get=r,i.prototype.has=a,i.prototype.set=n,bu=i,bu}var Eu,xy;function iN(){if(xy)return Eu;xy=1;var t=nN(),e=Xi(),r=Qv();function a(){this.size=0,this.__data__={hash:new t,map:new(r||e),string:new t}}return Eu=a,Eu}var wu,Cy;function oN(){if(Cy)return wu;Cy=1;function t(e){var r=typeof e;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?e!=="__proto__":e===null}return wu=t,wu}var Tu,Ay;function Wi(){if(Ay)return Tu;Ay=1;var t=oN();function e(r,a){var n=r.__data__;return t(a)?n[typeof a=="string"?"string":"hash"]:n.map}return Tu=e,Tu}var xu,Ly;function sN(){if(Ly)return xu;Ly=1;var t=Wi();function e(r){var a=t(this,r).delete(r);return this.size-=a?1:0,a}return xu=e,xu}var Cu,Ry;function uN(){if(Ry)return Cu;Ry=1;var t=Wi();function e(r){return t(this,r).get(r)}return Cu=e,Cu}var Au,Sy;function lN(){if(Sy)return Au;Sy=1;var t=Wi();function e(r){return t(this,r).has(r)}return Au=e,Au}var Lu,Dy;function fN(){if(Dy)return Lu;Dy=1;var t=Wi();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 Lu=e,Lu}var Ru,Ny;function Jv(){if(Ny)return Ru;Ny=1;var t=iN(),e=sN(),r=uN(),a=lN(),n=fN();function i(o){var s=-1,u=o==null?0:o.length;for(this.clear();++s<u;){var l=o[s];this.set(l[0],l[1])}}return i.prototype.clear=t,i.prototype.delete=e,i.prototype.get=r,i.prototype.has=a,i.prototype.set=n,Ru=i,Ru}var Su,My;function hN(){if(My)return Su;My=1;var t=Xi(),e=Qv(),r=Jv(),a=200;function n(i,o){var s=this.__data__;if(s instanceof t){var u=s.__data__;if(!e||u.length<a-1)return u.push([i,o]),this.size=++s.size,this;s=this.__data__=new r(u)}return s.set(i,o),this.size=s.size,this}return Su=n,Su}var Du,Oy;function Ki(){if(Oy)return Du;Oy=1;var t=Xi(),e=VD(),r=YD(),a=HD(),n=XD(),i=hN();function o(s){var u=this.__data__=new t(s);this.size=u.size}return o.prototype.clear=e,o.prototype.delete=r,o.prototype.get=a,o.prototype.has=n,o.prototype.set=i,Du=o,Du}var Nu,Iy;function jv(){if(Iy)return Nu;Iy=1;function t(e,r){for(var a=-1,n=e==null?0:e.length;++a<n&&r(e[a],a,e)!==!1;);return e}return Nu=t,Nu}var Mu,Py;function lT(){if(Py)return Mu;Py=1;var t=aa(),e=(function(){try{var r=t(Object,"defineProperty");return r({},"",{}),r}catch{}})();return Mu=e,Mu}var Ou,Fy;function Zi(){if(Fy)return Ou;Fy=1;var t=lT();function e(r,a,n){a=="__proto__"&&t?t(r,a,{configurable:!0,enumerable:!0,value:n,writable:!0}):r[a]=n}return Ou=e,Ou}var Iu,_y;function Qi(){if(_y)return Iu;_y=1;var t=Zi(),e=Oa(),r=Object.prototype,a=r.hasOwnProperty;function n(i,o,s){var u=i[o];(!(a.call(i,o)&&e(u,s))||s===void 0&&!(o in i))&&t(i,o,s)}return Iu=n,Iu}var Pu,By;function Rn(){if(By)return Pu;By=1;var t=Qi(),e=Zi();function r(a,n,i,o){var s=!i;i||(i={});for(var u=-1,l=n.length;++u<l;){var f=n[u],h=o?o(i[f],a[f],f,i,a):void 0;h===void 0&&(h=a[f]),s?e(i,f,h):t(i,f,h)}return i}return Pu=r,Pu}var Fu,ky;function cN(){if(ky)return Fu;ky=1;function t(e,r){for(var a=-1,n=Array(e);++a<e;)n[a]=r(a);return n}return Fu=t,Fu}var _u,qy;function sr(){if(qy)return _u;qy=1;function t(e){return e!=null&&typeof e=="object"}return _u=t,_u}var Bu,Gy;function vN(){if(Gy)return Bu;Gy=1;var t=ra(),e=sr(),r="[object Arguments]";function a(n){return e(n)&&t(n)==r}return Bu=a,Bu}var ku,Uy;function Sn(){if(Uy)return ku;Uy=1;var t=vN(),e=sr(),r=Object.prototype,a=r.hasOwnProperty,n=r.propertyIsEnumerable,i=t((function(){return arguments})())?t:function(o){return e(o)&&a.call(o,"callee")&&!n.call(o,"callee")};return ku=i,ku}var qu,zy;function gt(){if(zy)return qu;zy=1;var t=Array.isArray;return qu=t,qu}var Qa={exports:{}},Gu,Vy;function dN(){if(Vy)return Gu;Vy=1;function t(){return!1}return Gu=t,Gu}Qa.exports;var Yy;function Pa(){return Yy||(Yy=1,(function(t,e){var r=Jt(),a=dN(),n=e&&!e.nodeType&&e,i=n&&!0&&t&&!t.nodeType&&t,o=i&&i.exports===n,s=o?r.Buffer:void 0,u=s?s.isBuffer:void 0,l=u||a;t.exports=l})(Qa,Qa.exports)),Qa.exports}var Uu,Hy;function Ji(){if(Hy)return Uu;Hy=1;var t=9007199254740991,e=/^(?:0|[1-9]\d*)$/;function r(a,n){var i=typeof a;return n=n??t,!!n&&(i=="number"||i!="symbol"&&e.test(a))&&a>-1&&a%1==0&&a<n}return Uu=r,Uu}var zu,Xy;function ed(){if(Xy)return zu;Xy=1;var t=9007199254740991;function e(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=t}return zu=e,zu}var Vu,$y;function gN(){if($y)return Vu;$y=1;var t=ra(),e=ed(),r=sr(),a="[object Arguments]",n="[object Array]",i="[object Boolean]",o="[object Date]",s="[object Error]",u="[object Function]",l="[object Map]",f="[object Number]",h="[object Object]",v="[object RegExp]",c="[object Set]",d="[object String]",g="[object WeakMap]",p="[object ArrayBuffer]",y="[object DataView]",b="[object Float32Array]",m="[object Float64Array]",E="[object Int8Array]",T="[object Int16Array]",L="[object Int32Array]",w="[object Uint8Array]",C="[object Uint8ClampedArray]",A="[object Uint16Array]",R="[object Uint32Array]",S={};S[b]=S[m]=S[E]=S[T]=S[L]=S[w]=S[C]=S[A]=S[R]=!0,S[a]=S[n]=S[p]=S[i]=S[y]=S[o]=S[s]=S[u]=S[l]=S[f]=S[h]=S[v]=S[c]=S[d]=S[g]=!1;function D(P){return r(P)&&e(P.length)&&!!S[t(P)]}return Vu=D,Vu}var Yu,Wy;function ji(){if(Wy)return Yu;Wy=1;function t(e){return function(r){return e(r)}}return Yu=t,Yu}var Ja={exports:{}};Ja.exports;var Ky;function td(){return Ky||(Ky=1,(function(t,e){var r=sT(),a=e&&!e.nodeType&&e,n=a&&!0&&t&&!t.nodeType&&t,i=n&&n.exports===a,o=i&&r.process,s=(function(){try{var u=n&&n.require&&n.require("util").types;return u||o&&o.binding&&o.binding("util")}catch{}})();t.exports=s})(Ja,Ja.exports)),Ja.exports}var Hu,Zy;function Dn(){if(Zy)return Hu;Zy=1;var t=gN(),e=ji(),r=td(),a=r&&r.isTypedArray,n=a?e(a):t;return Hu=n,Hu}var Xu,Qy;function fT(){if(Qy)return Xu;Qy=1;var t=cN(),e=Sn(),r=gt(),a=Pa(),n=Ji(),i=Dn(),o=Object.prototype,s=o.hasOwnProperty;function u(l,f){var h=r(l),v=!h&&e(l),c=!h&&!v&&a(l),d=!h&&!v&&!c&&i(l),g=h||v||c||d,p=g?t(l.length,String):[],y=p.length;for(var b in l)(f||s.call(l,b))&&!(g&&(b=="length"||c&&(b=="offset"||b=="parent")||d&&(b=="buffer"||b=="byteLength"||b=="byteOffset")||n(b,y)))&&p.push(b);return p}return Xu=u,Xu}var $u,Jy;function eo(){if(Jy)return $u;Jy=1;var t=Object.prototype;function e(r){var a=r&&r.constructor,n=typeof a=="function"&&a.prototype||t;return r===n}return $u=e,$u}var Wu,jy;function hT(){if(jy)return Wu;jy=1;function t(e,r){return function(a){return e(r(a))}}return Wu=t,Wu}var Ku,em;function pN(){if(em)return Ku;em=1;var t=hT(),e=t(Object.keys,Object);return Ku=e,Ku}var Zu,tm;function rd(){if(tm)return Zu;tm=1;var t=eo(),e=pN(),r=Object.prototype,a=r.hasOwnProperty;function n(i){if(!t(i))return e(i);var o=[];for(var s in Object(i))a.call(i,s)&&s!="constructor"&&o.push(s);return o}return Zu=n,Zu}var Qu,rm;function pr(){if(rm)return Qu;rm=1;var t=Ln(),e=ed();function r(a){return a!=null&&e(a.length)&&!t(a)}return Qu=r,Qu}var Ju,am;function qr(){if(am)return Ju;am=1;var t=fT(),e=rd(),r=pr();function a(n){return r(n)?t(n):e(n)}return Ju=a,Ju}var ju,nm;function yN(){if(nm)return ju;nm=1;var t=Rn(),e=qr();function r(a,n){return a&&t(n,e(n),a)}return ju=r,ju}var el,im;function mN(){if(im)return el;im=1;function t(e){var r=[];if(e!=null)for(var a in Object(e))r.push(a);return r}return el=t,el}var tl,om;function bN(){if(om)return tl;om=1;var t=Ht(),e=eo(),r=mN(),a=Object.prototype,n=a.hasOwnProperty;function i(o){if(!t(o))return r(o);var s=e(o),u=[];for(var l in o)l=="constructor"&&(s||!n.call(o,l))||u.push(l);return u}return tl=i,tl}var rl,sm;function na(){if(sm)return rl;sm=1;var t=fT(),e=bN(),r=pr();function a(n){return r(n)?t(n,!0):e(n)}return rl=a,rl}var al,um;function EN(){if(um)return al;um=1;var t=Rn(),e=na();function r(a,n){return a&&t(n,e(n),a)}return al=r,al}var ja={exports:{}};ja.exports;var lm;function cT(){return lm||(lm=1,(function(t,e){var r=Jt(),a=e&&!e.nodeType&&e,n=a&&!0&&t&&!t.nodeType&&t,i=n&&n.exports===a,o=i?r.Buffer:void 0,s=o?o.allocUnsafe:void 0;function u(l,f){if(f)return l.slice();var h=l.length,v=s?s(h):new l.constructor(h);return l.copy(v),v}t.exports=u})(ja,ja.exports)),ja.exports}var nl,fm;function vT(){if(fm)return nl;fm=1;function t(e,r){var a=-1,n=e.length;for(r||(r=Array(n));++a<n;)r[a]=e[a];return r}return nl=t,nl}var il,hm;function dT(){if(hm)return il;hm=1;function t(e,r){for(var a=-1,n=e==null?0:e.length,i=0,o=[];++a<n;){var s=e[a];r(s,a,e)&&(o[i++]=s)}return o}return il=t,il}var ol,cm;function gT(){if(cm)return ol;cm=1;function t(){return[]}return ol=t,ol}var sl,vm;function ad(){if(vm)return sl;vm=1;var t=dT(),e=gT(),r=Object.prototype,a=r.propertyIsEnumerable,n=Object.getOwnPropertySymbols,i=n?function(o){return o==null?[]:(o=Object(o),t(n(o),function(s){return a.call(o,s)}))}:e;return sl=i,sl}var ul,dm;function wN(){if(dm)return ul;dm=1;var t=Rn(),e=ad();function r(a,n){return t(a,e(a),n)}return ul=r,ul}var ll,gm;function nd(){if(gm)return ll;gm=1;function t(e,r){for(var a=-1,n=r.length,i=e.length;++a<n;)e[i+a]=r[a];return e}return ll=t,ll}var fl,pm;function to(){if(pm)return fl;pm=1;var t=hT(),e=t(Object.getPrototypeOf,Object);return fl=e,fl}var hl,ym;function pT(){if(ym)return hl;ym=1;var t=nd(),e=to(),r=ad(),a=gT(),n=Object.getOwnPropertySymbols,i=n?function(o){for(var s=[];o;)t(s,r(o)),o=e(o);return s}:a;return hl=i,hl}var cl,mm;function TN(){if(mm)return cl;mm=1;var t=Rn(),e=pT();function r(a,n){return t(a,e(a),n)}return cl=r,cl}var vl,bm;function yT(){if(bm)return vl;bm=1;var t=nd(),e=gt();function r(a,n,i){var o=n(a);return e(a)?o:t(o,i(a))}return vl=r,vl}var dl,Em;function mT(){if(Em)return dl;Em=1;var t=yT(),e=ad(),r=qr();function a(n){return t(n,r,e)}return dl=a,dl}var gl,wm;function xN(){if(wm)return gl;wm=1;var t=yT(),e=pT(),r=na();function a(n){return t(n,r,e)}return gl=a,gl}var pl,Tm;function CN(){if(Tm)return pl;Tm=1;var t=aa(),e=Jt(),r=t(e,"DataView");return pl=r,pl}var yl,xm;function AN(){if(xm)return yl;xm=1;var t=aa(),e=Jt(),r=t(e,"Promise");return yl=r,yl}var ml,Cm;function bT(){if(Cm)return ml;Cm=1;var t=aa(),e=Jt(),r=t(e,"Set");return ml=r,ml}var bl,Am;function LN(){if(Am)return bl;Am=1;var t=aa(),e=Jt(),r=t(e,"WeakMap");return bl=r,bl}var El,Lm;function Fa(){if(Lm)return El;Lm=1;var t=CN(),e=Qv(),r=AN(),a=bT(),n=LN(),i=ra(),o=uT(),s="[object Map]",u="[object Object]",l="[object Promise]",f="[object Set]",h="[object WeakMap]",v="[object DataView]",c=o(t),d=o(e),g=o(r),p=o(a),y=o(n),b=i;return(t&&b(new t(new ArrayBuffer(1)))!=v||e&&b(new e)!=s||r&&b(r.resolve())!=l||a&&b(new a)!=f||n&&b(new n)!=h)&&(b=function(m){var E=i(m),T=E==u?m.constructor:void 0,L=T?o(T):"";if(L)switch(L){case c:return v;case d:return s;case g:return l;case p:return f;case y:return h}return E}),El=b,El}var wl,Rm;function RN(){if(Rm)return wl;Rm=1;var t=Object.prototype,e=t.hasOwnProperty;function r(a){var n=a.length,i=new a.constructor(n);return n&&typeof a[0]=="string"&&e.call(a,"index")&&(i.index=a.index,i.input=a.input),i}return wl=r,wl}var Tl,Sm;function ET(){if(Sm)return Tl;Sm=1;var t=Jt(),e=t.Uint8Array;return Tl=e,Tl}var xl,Dm;function id(){if(Dm)return xl;Dm=1;var t=ET();function e(r){var a=new r.constructor(r.byteLength);return new t(a).set(new t(r)),a}return xl=e,xl}var Cl,Nm;function SN(){if(Nm)return Cl;Nm=1;var t=id();function e(r,a){var n=a?t(r.buffer):r.buffer;return new r.constructor(n,r.byteOffset,r.byteLength)}return Cl=e,Cl}var Al,Mm;function DN(){if(Mm)return Al;Mm=1;var t=/\w*$/;function e(r){var a=new r.constructor(r.source,t.exec(r));return a.lastIndex=r.lastIndex,a}return Al=e,Al}var Ll,Om;function NN(){if(Om)return Ll;Om=1;var t=Ia(),e=t?t.prototype:void 0,r=e?e.valueOf:void 0;function a(n){return r?Object(r.call(n)):{}}return Ll=a,Ll}var Rl,Im;function wT(){if(Im)return Rl;Im=1;var t=id();function e(r,a){var n=a?t(r.buffer):r.buffer;return new r.constructor(n,r.byteOffset,r.length)}return Rl=e,Rl}var Sl,Pm;function MN(){if(Pm)return Sl;Pm=1;var t=id(),e=SN(),r=DN(),a=NN(),n=wT(),i="[object Boolean]",o="[object Date]",s="[object Map]",u="[object Number]",l="[object RegExp]",f="[object Set]",h="[object String]",v="[object Symbol]",c="[object ArrayBuffer]",d="[object DataView]",g="[object Float32Array]",p="[object Float64Array]",y="[object Int8Array]",b="[object Int16Array]",m="[object Int32Array]",E="[object Uint8Array]",T="[object Uint8ClampedArray]",L="[object Uint16Array]",w="[object Uint32Array]";function C(A,R,S){var D=A.constructor;switch(R){case c:return t(A);case i:case o:return new D(+A);case d:return e(A,S);case g:case p:case y:case b:case m:case E:case T:case L:case w:return n(A,S);case s:return new D;case u:case h:return new D(A);case l:return r(A);case f:return new D;case v:return a(A)}}return Sl=C,Sl}var Dl,Fm;function TT(){if(Fm)return Dl;Fm=1;var t=Ht(),e=Object.create,r=(function(){function a(){}return function(n){if(!t(n))return{};if(e)return e(n);a.prototype=n;var i=new a;return a.prototype=void 0,i}})();return Dl=r,Dl}var Nl,_m;function xT(){if(_m)return Nl;_m=1;var t=TT(),e=to(),r=eo();function a(n){return typeof n.constructor=="function"&&!r(n)?t(e(n)):{}}return Nl=a,Nl}var Ml,Bm;function ON(){if(Bm)return Ml;Bm=1;var t=Fa(),e=sr(),r="[object Map]";function a(n){return e(n)&&t(n)==r}return Ml=a,Ml}var Ol,km;function IN(){if(km)return Ol;km=1;var t=ON(),e=ji(),r=td(),a=r&&r.isMap,n=a?e(a):t;return Ol=n,Ol}var Il,qm;function PN(){if(qm)return Il;qm=1;var t=Fa(),e=sr(),r="[object Set]";function a(n){return e(n)&&t(n)==r}return Il=a,Il}var Pl,Gm;function FN(){if(Gm)return Pl;Gm=1;var t=PN(),e=ji(),r=td(),a=r&&r.isSet,n=a?e(a):t;return Pl=n,Pl}var Fl,Um;function CT(){if(Um)return Fl;Um=1;var t=Ki(),e=jv(),r=Qi(),a=yN(),n=EN(),i=cT(),o=vT(),s=wN(),u=TN(),l=mT(),f=xN(),h=Fa(),v=RN(),c=MN(),d=xT(),g=gt(),p=Pa(),y=IN(),b=Ht(),m=FN(),E=qr(),T=na(),L=1,w=2,C=4,A="[object Arguments]",R="[object Array]",S="[object Boolean]",D="[object Date]",P="[object Error]",x="[object Function]",N="[object GeneratorFunction]",M="[object Map]",I="[object Number]",O="[object Object]",q="[object RegExp]",_="[object Set]",B="[object String]",z="[object Symbol]",Y="[object WeakMap]",k="[object ArrayBuffer]",G="[object DataView]",U="[object Float32Array]",W="[object Float64Array]",j="[object Int8Array]",H="[object Int16Array]",V="[object Int32Array]",X="[object Uint8Array]",Z="[object Uint8ClampedArray]",ee="[object Uint16Array]",re="[object Uint32Array]",ue={};ue[A]=ue[R]=ue[k]=ue[G]=ue[S]=ue[D]=ue[U]=ue[W]=ue[j]=ue[H]=ue[V]=ue[M]=ue[I]=ue[O]=ue[q]=ue[_]=ue[B]=ue[z]=ue[X]=ue[Z]=ue[ee]=ue[re]=!0,ue[P]=ue[x]=ue[Y]=!1;function xe(se,oe,he,le,de,pe){var ce,ye=oe&L,Le=oe&w,_e=oe&C;if(he&&(ce=de?he(se,le,de,pe):he(se)),ce!==void 0)return ce;if(!b(se))return se;var ke=g(se);if(ke){if(ce=v(se),!ye)return o(se,ce)}else{var Oe=h(se),Fe=Oe==x||Oe==N;if(p(se))return i(se,ye);if(Oe==O||Oe==A||Fe&&!de){if(ce=Le||Fe?{}:d(se),!ye)return Le?u(se,n(ce,se)):s(se,a(ce,se))}else{if(!ue[Oe])return de?se:{};ce=c(se,Oe,ye)}}pe||(pe=new t);var Re=pe.get(se);if(Re)return Re;pe.set(se,ce),m(se)?se.forEach(function(F){ce.add(xe(F,oe,he,F,se,pe))}):y(se)&&se.forEach(function(F,$){ce.set($,xe(F,oe,he,$,se,pe))});var we=_e?Le?f:l:Le?T:E,K=ke?void 0:we(se);return e(K||se,function(F,$){K&&($=F,F=se[$]),r(ce,$,xe(F,oe,he,$,se,pe))}),ce}return Fl=xe,Fl}var _l,zm;function _N(){if(zm)return _l;zm=1;var t=CT(),e=4;function r(a){return t(a,e)}return _l=r,_l}var Bl,Vm;function od(){if(Vm)return Bl;Vm=1;function t(e){return function(){return e}}return Bl=t,Bl}var kl,Ym;function BN(){if(Ym)return kl;Ym=1;function t(e){return function(r,a,n){for(var i=-1,o=Object(r),s=n(r),u=s.length;u--;){var l=s[e?u:++i];if(a(o[l],l,o)===!1)break}return r}}return kl=t,kl}var ql,Hm;function sd(){if(Hm)return ql;Hm=1;var t=BN(),e=t();return ql=e,ql}var Gl,Xm;function ud(){if(Xm)return Gl;Xm=1;var t=sd(),e=qr();function r(a,n){return a&&t(a,n,e)}return Gl=r,Gl}var Ul,$m;function kN(){if($m)return Ul;$m=1;var t=pr();function e(r,a){return function(n,i){if(n==null)return n;if(!t(n))return r(n,i);for(var o=n.length,s=a?o:-1,u=Object(n);(a?s--:++s<o)&&i(u[s],s,u)!==!1;);return n}}return Ul=e,Ul}var zl,Wm;function ro(){if(Wm)return zl;Wm=1;var t=ud(),e=kN(),r=e(t);return zl=r,zl}var Vl,Km;function ia(){if(Km)return Vl;Km=1;function t(e){return e}return Vl=t,Vl}var Yl,Zm;function AT(){if(Zm)return Yl;Zm=1;var t=ia();function e(r){return typeof r=="function"?r:t}return Yl=e,Yl}var Hl,Qm;function LT(){if(Qm)return Hl;Qm=1;var t=jv(),e=ro(),r=AT(),a=gt();function n(i,o){var s=a(i)?t:e;return s(i,r(o))}return Hl=n,Hl}var Xl,Jm;function RT(){return Jm||(Jm=1,Xl=LT()),Xl}var $l,jm;function qN(){if(jm)return $l;jm=1;var t=ro();function e(r,a){var n=[];return t(r,function(i,o,s){a(i,o,s)&&n.push(i)}),n}return $l=e,$l}var Wl,e0;function GN(){if(e0)return Wl;e0=1;var t="__lodash_hash_undefined__";function e(r){return this.__data__.set(r,t),this}return Wl=e,Wl}var Kl,t0;function UN(){if(t0)return Kl;t0=1;function t(e){return this.__data__.has(e)}return Kl=t,Kl}var Zl,r0;function ST(){if(r0)return Zl;r0=1;var t=Jv(),e=GN(),r=UN();function a(n){var i=-1,o=n==null?0:n.length;for(this.__data__=new t;++i<o;)this.add(n[i])}return a.prototype.add=a.prototype.push=e,a.prototype.has=r,Zl=a,Zl}var Ql,a0;function zN(){if(a0)return Ql;a0=1;function t(e,r){for(var a=-1,n=e==null?0:e.length;++a<n;)if(r(e[a],a,e))return!0;return!1}return Ql=t,Ql}var Jl,n0;function DT(){if(n0)return Jl;n0=1;function t(e,r){return e.has(r)}return Jl=t,Jl}var jl,i0;function NT(){if(i0)return jl;i0=1;var t=ST(),e=zN(),r=DT(),a=1,n=2;function i(o,s,u,l,f,h){var v=u&a,c=o.length,d=s.length;if(c!=d&&!(v&&d>c))return!1;var g=h.get(o),p=h.get(s);if(g&&p)return g==s&&p==o;var y=-1,b=!0,m=u&n?new t:void 0;for(h.set(o,s),h.set(s,o);++y<c;){var E=o[y],T=s[y];if(l)var L=v?l(T,E,y,s,o,h):l(E,T,y,o,s,h);if(L!==void 0){if(L)continue;b=!1;break}if(m){if(!e(s,function(w,C){if(!r(m,C)&&(E===w||f(E,w,u,l,h)))return m.push(C)})){b=!1;break}}else if(!(E===T||f(E,T,u,l,h))){b=!1;break}}return h.delete(o),h.delete(s),b}return jl=i,jl}var ef,o0;function VN(){if(o0)return ef;o0=1;function t(e){var r=-1,a=Array(e.size);return e.forEach(function(n,i){a[++r]=[i,n]}),a}return ef=t,ef}var tf,s0;function ld(){if(s0)return tf;s0=1;function t(e){var r=-1,a=Array(e.size);return e.forEach(function(n){a[++r]=n}),a}return tf=t,tf}var rf,u0;function YN(){if(u0)return rf;u0=1;var t=Ia(),e=ET(),r=Oa(),a=NT(),n=VN(),i=ld(),o=1,s=2,u="[object Boolean]",l="[object Date]",f="[object Error]",h="[object Map]",v="[object Number]",c="[object RegExp]",d="[object Set]",g="[object String]",p="[object Symbol]",y="[object ArrayBuffer]",b="[object DataView]",m=t?t.prototype:void 0,E=m?m.valueOf:void 0;function T(L,w,C,A,R,S,D){switch(C){case b:if(L.byteLength!=w.byteLength||L.byteOffset!=w.byteOffset)return!1;L=L.buffer,w=w.buffer;case y:return!(L.byteLength!=w.byteLength||!S(new e(L),new e(w)));case u:case l:case v:return r(+L,+w);case f:return L.name==w.name&&L.message==w.message;case c:case g:return L==w+"";case h:var P=n;case d:var x=A&o;if(P||(P=i),L.size!=w.size&&!x)return!1;var N=D.get(L);if(N)return N==w;A|=s,D.set(L,w);var M=a(P(L),P(w),A,R,S,D);return D.delete(L),M;case p:if(E)return E.call(L)==E.call(w)}return!1}return rf=T,rf}var af,l0;function HN(){if(l0)return af;l0=1;var t=mT(),e=1,r=Object.prototype,a=r.hasOwnProperty;function n(i,o,s,u,l,f){var h=s&e,v=t(i),c=v.length,d=t(o),g=d.length;if(c!=g&&!h)return!1;for(var p=c;p--;){var y=v[p];if(!(h?y in o:a.call(o,y)))return!1}var b=f.get(i),m=f.get(o);if(b&&m)return b==o&&m==i;var E=!0;f.set(i,o),f.set(o,i);for(var T=h;++p<c;){y=v[p];var L=i[y],w=o[y];if(u)var C=h?u(w,L,y,o,i,f):u(L,w,y,i,o,f);if(!(C===void 0?L===w||l(L,w,s,u,f):C)){E=!1;break}T||(T=y=="constructor")}if(E&&!T){var A=i.constructor,R=o.constructor;A!=R&&"constructor"in i&&"constructor"in o&&!(typeof A=="function"&&A instanceof A&&typeof R=="function"&&R instanceof R)&&(E=!1)}return f.delete(i),f.delete(o),E}return af=n,af}var nf,f0;function XN(){if(f0)return nf;f0=1;var t=Ki(),e=NT(),r=YN(),a=HN(),n=Fa(),i=gt(),o=Pa(),s=Dn(),u=1,l="[object Arguments]",f="[object Array]",h="[object Object]",v=Object.prototype,c=v.hasOwnProperty;function d(g,p,y,b,m,E){var T=i(g),L=i(p),w=T?f:n(g),C=L?f:n(p);w=w==l?h:w,C=C==l?h:C;var A=w==h,R=C==h,S=w==C;if(S&&o(g)){if(!o(p))return!1;T=!0,A=!1}if(S&&!A)return E||(E=new t),T||s(g)?e(g,p,y,b,m,E):r(g,p,w,y,b,m,E);if(!(y&u)){var D=A&&c.call(g,"__wrapped__"),P=R&&c.call(p,"__wrapped__");if(D||P){var x=D?g.value():g,N=P?p.value():p;return E||(E=new t),m(x,N,y,b,E)}}return S?(E||(E=new t),a(g,p,y,b,m,E)):!1}return nf=d,nf}var of,h0;function MT(){if(h0)return of;h0=1;var t=XN(),e=sr();function r(a,n,i,o,s){return a===n?!0:a==null||n==null||!e(a)&&!e(n)?a!==a&&n!==n:t(a,n,i,o,r,s)}return of=r,of}var sf,c0;function $N(){if(c0)return sf;c0=1;var t=Ki(),e=MT(),r=1,a=2;function n(i,o,s,u){var l=s.length,f=l,h=!u;if(i==null)return!f;for(i=Object(i);l--;){var v=s[l];if(h&&v[2]?v[1]!==i[v[0]]:!(v[0]in i))return!1}for(;++l<f;){v=s[l];var c=v[0],d=i[c],g=v[1];if(h&&v[2]){if(d===void 0&&!(c in i))return!1}else{var p=new t;if(u)var y=u(d,g,c,i,o,p);if(!(y===void 0?e(g,d,r|a,u,p):y))return!1}}return!0}return sf=n,sf}var uf,v0;function OT(){if(v0)return uf;v0=1;var t=Ht();function e(r){return r===r&&!t(r)}return uf=e,uf}var lf,d0;function WN(){if(d0)return lf;d0=1;var t=OT(),e=qr();function r(a){for(var n=e(a),i=n.length;i--;){var o=n[i],s=a[o];n[i]=[o,s,t(s)]}return n}return lf=r,lf}var ff,g0;function IT(){if(g0)return ff;g0=1;function t(e,r){return function(a){return a==null?!1:a[e]===r&&(r!==void 0||e in Object(a))}}return ff=t,ff}var hf,p0;function KN(){if(p0)return hf;p0=1;var t=$N(),e=WN(),r=IT();function a(n){var i=e(n);return i.length==1&&i[0][2]?r(i[0][0],i[0][1]):function(o){return o===n||t(o,n,i)}}return hf=a,hf}var cf,y0;function _a(){if(y0)return cf;y0=1;var t=ra(),e=sr(),r="[object Symbol]";function a(n){return typeof n=="symbol"||e(n)&&t(n)==r}return cf=a,cf}var vf,m0;function fd(){if(m0)return vf;m0=1;var t=gt(),e=_a(),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;function n(i,o){if(t(i))return!1;var s=typeof i;return s=="number"||s=="symbol"||s=="boolean"||i==null||e(i)?!0:a.test(i)||!r.test(i)||o!=null&&i in Object(o)}return vf=n,vf}var df,b0;function ZN(){if(b0)return df;b0=1;var t=Jv(),e="Expected a function";function r(a,n){if(typeof a!="function"||n!=null&&typeof n!="function")throw new TypeError(e);var i=function(){var o=arguments,s=n?n.apply(this,o):o[0],u=i.cache;if(u.has(s))return u.get(s);var l=a.apply(this,o);return i.cache=u.set(s,l)||u,l};return i.cache=new(r.Cache||t),i}return r.Cache=t,df=r,df}var gf,E0;function QN(){if(E0)return gf;E0=1;var t=ZN(),e=500;function r(a){var n=t(a,function(o){return i.size===e&&i.clear(),o}),i=n.cache;return n}return gf=r,gf}var pf,w0;function JN(){if(w0)return pf;w0=1;var t=QN(),e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,r=/\\(\\)?/g,a=t(function(n){var i=[];return n.charCodeAt(0)===46&&i.push(""),n.replace(e,function(o,s,u,l){i.push(u?l.replace(r,"$1"):s||o)}),i});return pf=a,pf}var yf,T0;function ao(){if(T0)return yf;T0=1;function t(e,r){for(var a=-1,n=e==null?0:e.length,i=Array(n);++a<n;)i[a]=r(e[a],a,e);return i}return yf=t,yf}var mf,x0;function jN(){if(x0)return mf;x0=1;var t=Ia(),e=ao(),r=gt(),a=_a(),n=t?t.prototype:void 0,i=n?n.toString:void 0;function o(s){if(typeof s=="string")return s;if(r(s))return e(s,o)+"";if(a(s))return i?i.call(s):"";var u=s+"";return u=="0"&&1/s==-1/0?"-0":u}return mf=o,mf}var bf,C0;function PT(){if(C0)return bf;C0=1;var t=jN();function e(r){return r==null?"":t(r)}return bf=e,bf}var Ef,A0;function no(){if(A0)return Ef;A0=1;var t=gt(),e=fd(),r=JN(),a=PT();function n(i,o){return t(i)?i:e(i,o)?[i]:r(a(i))}return Ef=n,Ef}var wf,L0;function Nn(){if(L0)return wf;L0=1;var t=_a();function e(r){if(typeof r=="string"||t(r))return r;var a=r+"";return a=="0"&&1/r==-1/0?"-0":a}return wf=e,wf}var Tf,R0;function io(){if(R0)return Tf;R0=1;var t=no(),e=Nn();function r(a,n){n=t(n,a);for(var i=0,o=n.length;a!=null&&i<o;)a=a[e(n[i++])];return i&&i==o?a:void 0}return Tf=r,Tf}var xf,S0;function eM(){if(S0)return xf;S0=1;var t=io();function e(r,a,n){var i=r==null?void 0:t(r,a);return i===void 0?n:i}return xf=e,xf}var Cf,D0;function tM(){if(D0)return Cf;D0=1;function t(e,r){return e!=null&&r in Object(e)}return Cf=t,Cf}var Af,N0;function FT(){if(N0)return Af;N0=1;var t=no(),e=Sn(),r=gt(),a=Ji(),n=ed(),i=Nn();function o(s,u,l){u=t(u,s);for(var f=-1,h=u.length,v=!1;++f<h;){var c=i(u[f]);if(!(v=s!=null&&l(s,c)))break;s=s[c]}return v||++f!=h?v:(h=s==null?0:s.length,!!h&&n(h)&&a(c,h)&&(r(s)||e(s)))}return Af=o,Af}var Lf,M0;function _T(){if(M0)return Lf;M0=1;var t=tM(),e=FT();function r(a,n){return a!=null&&e(a,n,t)}return Lf=r,Lf}var Rf,O0;function rM(){if(O0)return Rf;O0=1;var t=MT(),e=eM(),r=_T(),a=fd(),n=OT(),i=IT(),o=Nn(),s=1,u=2;function l(f,h){return a(f)&&n(h)?i(o(f),h):function(v){var c=e(v,f);return c===void 0&&c===h?r(v,f):t(h,c,s|u)}}return Rf=l,Rf}var Sf,I0;function BT(){if(I0)return Sf;I0=1;function t(e){return function(r){return r==null?void 0:r[e]}}return Sf=t,Sf}var Df,P0;function aM(){if(P0)return Df;P0=1;var t=io();function e(r){return function(a){return t(a,r)}}return Df=e,Df}var Nf,F0;function nM(){if(F0)return Nf;F0=1;var t=BT(),e=aM(),r=fd(),a=Nn();function n(i){return r(i)?t(a(i)):e(i)}return Nf=n,Nf}var Mf,_0;function yr(){if(_0)return Mf;_0=1;var t=KN(),e=rM(),r=ia(),a=gt(),n=nM();function i(o){return typeof o=="function"?o:o==null?r:typeof o=="object"?a(o)?e(o[0],o[1]):t(o):n(o)}return Mf=i,Mf}var Of,B0;function kT(){if(B0)return Of;B0=1;var t=dT(),e=qN(),r=yr(),a=gt();function n(i,o){var s=a(i)?t:e;return s(i,r(o,3))}return Of=n,Of}var If,k0;function iM(){if(k0)return If;k0=1;var t=Object.prototype,e=t.hasOwnProperty;function r(a,n){return a!=null&&e.call(a,n)}return If=r,If}var Pf,q0;function qT(){if(q0)return Pf;q0=1;var t=iM(),e=FT();function r(a,n){return a!=null&&e(a,n,t)}return Pf=r,Pf}var Ff,G0;function oM(){if(G0)return Ff;G0=1;var t=rd(),e=Fa(),r=Sn(),a=gt(),n=pr(),i=Pa(),o=eo(),s=Dn(),u="[object Map]",l="[object Set]",f=Object.prototype,h=f.hasOwnProperty;function v(c){if(c==null)return!0;if(n(c)&&(a(c)||typeof c=="string"||typeof c.splice=="function"||i(c)||s(c)||r(c)))return!c.length;var d=e(c);if(d==u||d==l)return!c.size;if(o(c))return!t(c).length;for(var g in c)if(h.call(c,g))return!1;return!0}return Ff=v,Ff}var _f,U0;function GT(){if(U0)return _f;U0=1;function t(e){return e===void 0}return _f=t,_f}var Bf,z0;function UT(){if(z0)return Bf;z0=1;var t=ro(),e=pr();function r(a,n){var i=-1,o=e(a)?Array(a.length):[];return t(a,function(s,u,l){o[++i]=n(s,u,l)}),o}return Bf=r,Bf}var kf,V0;function zT(){if(V0)return kf;V0=1;var t=ao(),e=yr(),r=UT(),a=gt();function n(i,o){var s=a(i)?t:r;return s(i,e(o,3))}return kf=n,kf}var qf,Y0;function sM(){if(Y0)return qf;Y0=1;function t(e,r,a,n){var i=-1,o=e==null?0:e.length;for(n&&o&&(a=e[++i]);++i<o;)a=r(a,e[i],i,e);return a}return qf=t,qf}var Gf,H0;function uM(){if(H0)return Gf;H0=1;function t(e,r,a,n,i){return i(e,function(o,s,u){a=n?(n=!1,o):r(a,o,s,u)}),a}return Gf=t,Gf}var Uf,X0;function VT(){if(X0)return Uf;X0=1;var t=sM(),e=ro(),r=yr(),a=uM(),n=gt();function i(o,s,u){var l=n(o)?t:a,f=arguments.length<3;return l(o,r(s,4),u,f,e)}return Uf=i,Uf}var zf,$0;function lM(){if($0)return zf;$0=1;var t=ra(),e=gt(),r=sr(),a="[object String]";function n(i){return typeof i=="string"||!e(i)&&r(i)&&t(i)==a}return zf=n,zf}var Vf,W0;function fM(){if(W0)return Vf;W0=1;var t=BT(),e=t("length");return Vf=e,Vf}var Yf,K0;function hM(){if(K0)return Yf;K0=1;var t="\\ud800-\\udfff",e="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",a="\\u20d0-\\u20ff",n=e+r+a,i="\\ufe0e\\ufe0f",o="\\u200d",s=RegExp("["+o+t+n+i+"]");function u(l){return s.test(l)}return Yf=u,Yf}var Hf,Z0;function cM(){if(Z0)return Hf;Z0=1;var t="\\ud800-\\udfff",e="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",a="\\u20d0-\\u20ff",n=e+r+a,i="\\ufe0e\\ufe0f",o="["+t+"]",s="["+n+"]",u="\\ud83c[\\udffb-\\udfff]",l="(?:"+s+"|"+u+")",f="[^"+t+"]",h="(?:\\ud83c[\\udde6-\\uddff]){2}",v="[\\ud800-\\udbff][\\udc00-\\udfff]",c="\\u200d",d=l+"?",g="["+i+"]?",p="(?:"+c+"(?:"+[f,h,v].join("|")+")"+g+d+")*",y=g+d+p,b="(?:"+[f+s+"?",s,h,v,o].join("|")+")",m=RegExp(u+"(?="+u+")|"+b+y,"g");function E(T){for(var L=m.lastIndex=0;m.test(T);)++L;return L}return Hf=E,Hf}var Xf,Q0;function vM(){if(Q0)return Xf;Q0=1;var t=fM(),e=hM(),r=cM();function a(n){return e(n)?r(n):t(n)}return Xf=a,Xf}var $f,J0;function dM(){if(J0)return $f;J0=1;var t=rd(),e=Fa(),r=pr(),a=lM(),n=vM(),i="[object Map]",o="[object Set]";function s(u){if(u==null)return 0;if(r(u))return a(u)?n(u):u.length;var l=e(u);return l==i||l==o?u.size:t(u).length}return $f=s,$f}var Wf,j0;function gM(){if(j0)return Wf;j0=1;var t=jv(),e=TT(),r=ud(),a=yr(),n=to(),i=gt(),o=Pa(),s=Ln(),u=Ht(),l=Dn();function f(h,v,c){var d=i(h),g=d||o(h)||l(h);if(v=a(v,4),c==null){var p=h&&h.constructor;g?c=d?new p:[]:u(h)?c=s(p)?e(n(h)):{}:c={}}return(g?t:r)(h,function(y,b,m){return v(c,y,b,m)}),c}return Wf=f,Wf}var Kf,eb;function pM(){if(eb)return Kf;eb=1;var t=Ia(),e=Sn(),r=gt(),a=t?t.isConcatSpreadable:void 0;function n(i){return r(i)||e(i)||!!(a&&i&&i[a])}return Kf=n,Kf}var Zf,tb;function hd(){if(tb)return Zf;tb=1;var t=nd(),e=pM();function r(a,n,i,o,s){var u=-1,l=a.length;for(i||(i=e),s||(s=[]);++u<l;){var f=a[u];n>0&&i(f)?n>1?r(f,n-1,i,o,s):t(s,f):o||(s[s.length]=f)}return s}return Zf=r,Zf}var Qf,rb;function yM(){if(rb)return Qf;rb=1;function t(e,r,a){switch(a.length){case 0:return e.call(r);case 1:return e.call(r,a[0]);case 2:return e.call(r,a[0],a[1]);case 3:return e.call(r,a[0],a[1],a[2])}return e.apply(r,a)}return Qf=t,Qf}var Jf,ab;function YT(){if(ab)return Jf;ab=1;var t=yM(),e=Math.max;function r(a,n,i){return n=e(n===void 0?a.length-1:n,0),function(){for(var o=arguments,s=-1,u=e(o.length-n,0),l=Array(u);++s<u;)l[s]=o[n+s];s=-1;for(var f=Array(n+1);++s<n;)f[s]=o[s];return f[n]=i(l),t(a,this,f)}}return Jf=r,Jf}var jf,nb;function mM(){if(nb)return jf;nb=1;var t=od(),e=lT(),r=ia(),a=e?function(n,i){return e(n,"toString",{configurable:!0,enumerable:!1,value:t(i),writable:!0})}:r;return jf=a,jf}var eh,ib;function bM(){if(ib)return eh;ib=1;var t=800,e=16,r=Date.now;function a(n){var i=0,o=0;return function(){var s=r(),u=e-(s-o);if(o=s,u>0){if(++i>=t)return arguments[0]}else i=0;return n.apply(void 0,arguments)}}return eh=a,eh}var th,ob;function HT(){if(ob)return th;ob=1;var t=mM(),e=bM(),r=e(t);return th=r,th}var rh,sb;function oo(){if(sb)return rh;sb=1;var t=ia(),e=YT(),r=HT();function a(n,i){return r(e(n,i,t),n+"")}return rh=a,rh}var ah,ub;function XT(){if(ub)return ah;ub=1;function t(e,r,a,n){for(var i=e.length,o=a+(n?1:-1);n?o--:++o<i;)if(r(e[o],o,e))return o;return-1}return ah=t,ah}var nh,lb;function EM(){if(lb)return nh;lb=1;function t(e){return e!==e}return nh=t,nh}var ih,fb;function wM(){if(fb)return ih;fb=1;function t(e,r,a){for(var n=a-1,i=e.length;++n<i;)if(e[n]===r)return n;return-1}return ih=t,ih}var oh,hb;function TM(){if(hb)return oh;hb=1;var t=XT(),e=EM(),r=wM();function a(n,i,o){return i===i?r(n,i,o):t(n,e,o)}return oh=a,oh}var sh,cb;function xM(){if(cb)return sh;cb=1;var t=TM();function e(r,a){var n=r==null?0:r.length;return!!n&&t(r,a,0)>-1}return sh=e,sh}var uh,vb;function CM(){if(vb)return uh;vb=1;function t(e,r,a){for(var n=-1,i=e==null?0:e.length;++n<i;)if(a(r,e[n]))return!0;return!1}return uh=t,uh}var lh,db;function AM(){if(db)return lh;db=1;function t(){}return lh=t,lh}var fh,gb;function LM(){if(gb)return fh;gb=1;var t=bT(),e=AM(),r=ld(),a=1/0,n=t&&1/r(new t([,-0]))[1]==a?function(i){return new t(i)}:e;return fh=n,fh}var hh,pb;function RM(){if(pb)return hh;pb=1;var t=ST(),e=xM(),r=CM(),a=DT(),n=LM(),i=ld(),o=200;function s(u,l,f){var h=-1,v=e,c=u.length,d=!0,g=[],p=g;if(f)d=!1,v=r;else if(c>=o){var y=l?null:n(u);if(y)return i(y);d=!1,v=a,p=new t}else p=l?[]:g;e:for(;++h<c;){var b=u[h],m=l?l(b):b;if(b=f||b!==0?b:0,d&&m===m){for(var E=p.length;E--;)if(p[E]===m)continue e;l&&p.push(m),g.push(b)}else v(p,m,f)||(p!==g&&p.push(m),g.push(b))}return g}return hh=s,hh}var ch,yb;function $T(){if(yb)return ch;yb=1;var t=pr(),e=sr();function r(a){return e(a)&&t(a)}return ch=r,ch}var vh,mb;function SM(){if(mb)return vh;mb=1;var t=hd(),e=oo(),r=RM(),a=$T(),n=e(function(i){return r(t(i,1,a,!0))});return vh=n,vh}var dh,bb;function DM(){if(bb)return dh;bb=1;var t=ao();function e(r,a){return t(a,function(n){return r[n]})}return dh=e,dh}var gh,Eb;function WT(){if(Eb)return gh;Eb=1;var t=DM(),e=qr();function r(a){return a==null?[]:t(a,e(a))}return gh=r,gh}var ph,wb;function Xt(){if(wb)return ph;wb=1;var t;if(typeof Zv=="function")try{t={clone:_N(),constant:od(),each:RT(),filter:kT(),has:qT(),isArray:gt(),isEmpty:oM(),isFunction:Ln(),isUndefined:GT(),keys:qr(),map:zT(),reduce:VT(),size:dM(),transform:gM(),union:SM(),values:WT()}}catch{}return t||(t=window._),ph=t,ph}var yh,Tb;function cd(){if(Tb)return yh;Tb=1;var t=Xt();yh=n;var e="\0",r="\0",a="";function n(f){this._isDirected=t.has(f,"directed")?f.directed:!0,this._isMultigraph=t.has(f,"multigraph")?f.multigraph:!1,this._isCompound=t.has(f,"compound")?f.compound:!1,this._label=void 0,this._defaultNodeLabelFn=t.constant(void 0),this._defaultEdgeLabelFn=t.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[r]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}n.prototype._nodeCount=0,n.prototype._edgeCount=0,n.prototype.isDirected=function(){return this._isDirected},n.prototype.isMultigraph=function(){return this._isMultigraph},n.prototype.isCompound=function(){return this._isCompound},n.prototype.setGraph=function(f){return this._label=f,this},n.prototype.graph=function(){return this._label},n.prototype.setDefaultNodeLabel=function(f){return t.isFunction(f)||(f=t.constant(f)),this._defaultNodeLabelFn=f,this},n.prototype.nodeCount=function(){return this._nodeCount},n.prototype.nodes=function(){return t.keys(this._nodes)},n.prototype.sources=function(){var f=this;return t.filter(this.nodes(),function(h){return t.isEmpty(f._in[h])})},n.prototype.sinks=function(){var f=this;return t.filter(this.nodes(),function(h){return t.isEmpty(f._out[h])})},n.prototype.setNodes=function(f,h){var v=arguments,c=this;return t.each(f,function(d){v.length>1?c.setNode(d,h):c.setNode(d)}),this},n.prototype.setNode=function(f,h){return t.has(this._nodes,f)?(arguments.length>1&&(this._nodes[f]=h),this):(this._nodes[f]=arguments.length>1?h:this._defaultNodeLabelFn(f),this._isCompound&&(this._parent[f]=r,this._children[f]={},this._children[r][f]=!0),this._in[f]={},this._preds[f]={},this._out[f]={},this._sucs[f]={},++this._nodeCount,this)},n.prototype.node=function(f){return this._nodes[f]},n.prototype.hasNode=function(f){return t.has(this._nodes,f)},n.prototype.removeNode=function(f){var h=this;if(t.has(this._nodes,f)){var v=function(c){h.removeEdge(h._edgeObjs[c])};delete this._nodes[f],this._isCompound&&(this._removeFromParentsChildList(f),delete this._parent[f],t.each(this.children(f),function(c){h.setParent(c)}),delete this._children[f]),t.each(t.keys(this._in[f]),v),delete this._in[f],delete this._preds[f],t.each(t.keys(this._out[f]),v),delete this._out[f],delete this._sucs[f],--this._nodeCount}return this},n.prototype.setParent=function(f,h){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(t.isUndefined(h))h=r;else{h+="";for(var v=h;!t.isUndefined(v);v=this.parent(v))if(v===f)throw new Error("Setting "+h+" as parent of "+f+" would create a cycle");this.setNode(h)}return this.setNode(f),this._removeFromParentsChildList(f),this._parent[f]=h,this._children[h][f]=!0,this},n.prototype._removeFromParentsChildList=function(f){delete this._children[this._parent[f]][f]},n.prototype.parent=function(f){if(this._isCompound){var h=this._parent[f];if(h!==r)return h}},n.prototype.children=function(f){if(t.isUndefined(f)&&(f=r),this._isCompound){var h=this._children[f];if(h)return t.keys(h)}else{if(f===r)return this.nodes();if(this.hasNode(f))return[]}},n.prototype.predecessors=function(f){var h=this._preds[f];if(h)return t.keys(h)},n.prototype.successors=function(f){var h=this._sucs[f];if(h)return t.keys(h)},n.prototype.neighbors=function(f){var h=this.predecessors(f);if(h)return t.union(h,this.successors(f))},n.prototype.isLeaf=function(f){var h;return this.isDirected()?h=this.successors(f):h=this.neighbors(f),h.length===0},n.prototype.filterNodes=function(f){var h=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});h.setGraph(this.graph());var v=this;t.each(this._nodes,function(g,p){f(p)&&h.setNode(p,g)}),t.each(this._edgeObjs,function(g){h.hasNode(g.v)&&h.hasNode(g.w)&&h.setEdge(g,v.edge(g))});var c={};function d(g){var p=v.parent(g);return p===void 0||h.hasNode(p)?(c[g]=p,p):p in c?c[p]:d(p)}return this._isCompound&&t.each(h.nodes(),function(g){h.setParent(g,d(g))}),h},n.prototype.setDefaultEdgeLabel=function(f){return t.isFunction(f)||(f=t.constant(f)),this._defaultEdgeLabelFn=f,this},n.prototype.edgeCount=function(){return this._edgeCount},n.prototype.edges=function(){return t.values(this._edgeObjs)},n.prototype.setPath=function(f,h){var v=this,c=arguments;return t.reduce(f,function(d,g){return c.length>1?v.setEdge(d,g,h):v.setEdge(d,g),g}),this},n.prototype.setEdge=function(){var f,h,v,c,d=!1,g=arguments[0];typeof g=="object"&&g!==null&&"v"in g?(f=g.v,h=g.w,v=g.name,arguments.length===2&&(c=arguments[1],d=!0)):(f=g,h=arguments[1],v=arguments[3],arguments.length>2&&(c=arguments[2],d=!0)),f=""+f,h=""+h,t.isUndefined(v)||(v=""+v);var p=s(this._isDirected,f,h,v);if(t.has(this._edgeLabels,p))return d&&(this._edgeLabels[p]=c),this;if(!t.isUndefined(v)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(f),this.setNode(h),this._edgeLabels[p]=d?c:this._defaultEdgeLabelFn(f,h,v);var y=u(this._isDirected,f,h,v);return f=y.v,h=y.w,Object.freeze(y),this._edgeObjs[p]=y,i(this._preds[h],f),i(this._sucs[f],h),this._in[h][p]=y,this._out[f][p]=y,this._edgeCount++,this},n.prototype.edge=function(f,h,v){var c=arguments.length===1?l(this._isDirected,arguments[0]):s(this._isDirected,f,h,v);return this._edgeLabels[c]},n.prototype.hasEdge=function(f,h,v){var c=arguments.length===1?l(this._isDirected,arguments[0]):s(this._isDirected,f,h,v);return t.has(this._edgeLabels,c)},n.prototype.removeEdge=function(f,h,v){var c=arguments.length===1?l(this._isDirected,arguments[0]):s(this._isDirected,f,h,v),d=this._edgeObjs[c];return d&&(f=d.v,h=d.w,delete this._edgeLabels[c],delete this._edgeObjs[c],o(this._preds[h],f),o(this._sucs[f],h),delete this._in[h][c],delete this._out[f][c],this._edgeCount--),this},n.prototype.inEdges=function(f,h){var v=this._in[f];if(v){var c=t.values(v);return h?t.filter(c,function(d){return d.v===h}):c}},n.prototype.outEdges=function(f,h){var v=this._out[f];if(v){var c=t.values(v);return h?t.filter(c,function(d){return d.w===h}):c}},n.prototype.nodeEdges=function(f,h){var v=this.inEdges(f,h);if(v)return v.concat(this.outEdges(f,h))};function i(f,h){f[h]?f[h]++:f[h]=1}function o(f,h){--f[h]||delete f[h]}function s(f,h,v,c){var d=""+h,g=""+v;if(!f&&d>g){var p=d;d=g,g=p}return d+a+g+a+(t.isUndefined(c)?e:c)}function u(f,h,v,c){var d=""+h,g=""+v;if(!f&&d>g){var p=d;d=g,g=p}var y={v:d,w:g};return c&&(y.name=c),y}function l(f,h){return s(f,h.v,h.w,h.name)}return yh}var mh,xb;function NM(){return xb||(xb=1,mh="2.1.8"),mh}var bh,Cb;function MM(){return Cb||(Cb=1,bh={Graph:cd(),version:NM()}),bh}var Eh,Ab;function OM(){if(Ab)return Eh;Ab=1;var t=Xt(),e=cd();Eh={write:r,read:i};function r(o){var s={options:{directed:o.isDirected(),multigraph:o.isMultigraph(),compound:o.isCompound()},nodes:a(o),edges:n(o)};return t.isUndefined(o.graph())||(s.value=t.clone(o.graph())),s}function a(o){return t.map(o.nodes(),function(s){var u=o.node(s),l=o.parent(s),f={v:s};return t.isUndefined(u)||(f.value=u),t.isUndefined(l)||(f.parent=l),f})}function n(o){return t.map(o.edges(),function(s){var u=o.edge(s),l={v:s.v,w:s.w};return t.isUndefined(s.name)||(l.name=s.name),t.isUndefined(u)||(l.value=u),l})}function i(o){var s=new e(o.options).setGraph(o.value);return t.each(o.nodes,function(u){s.setNode(u.v,u.value),u.parent&&s.setParent(u.v,u.parent)}),t.each(o.edges,function(u){s.setEdge({v:u.v,w:u.w,name:u.name},u.value)}),s}return Eh}var wh,Lb;function IM(){if(Lb)return wh;Lb=1;var t=Xt();wh=e;function e(r){var a={},n=[],i;function o(s){t.has(a,s)||(a[s]=!0,i.push(s),t.each(r.successors(s),o),t.each(r.predecessors(s),o))}return t.each(r.nodes(),function(s){i=[],o(s),i.length&&n.push(i)}),n}return wh}var Th,Rb;function KT(){if(Rb)return Th;Rb=1;var t=Xt();Th=e;function e(){this._arr=[],this._keyIndices={}}return e.prototype.size=function(){return this._arr.length},e.prototype.keys=function(){return this._arr.map(function(r){return r.key})},e.prototype.has=function(r){return t.has(this._keyIndices,r)},e.prototype.priority=function(r){var a=this._keyIndices[r];if(a!==void 0)return this._arr[a].priority},e.prototype.min=function(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key},e.prototype.add=function(r,a){var n=this._keyIndices;if(r=String(r),!t.has(n,r)){var i=this._arr,o=i.length;return n[r]=o,i.push({key:r,priority:a}),this._decrease(o),!0}return!1},e.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var r=this._arr.pop();return delete this._keyIndices[r.key],this._heapify(0),r.key},e.prototype.decrease=function(r,a){var n=this._keyIndices[r];if(a>this._arr[n].priority)throw new Error("New priority is greater than current priority. Key: "+r+" Old: "+this._arr[n].priority+" New: "+a);this._arr[n].priority=a,this._decrease(n)},e.prototype._heapify=function(r){var a=this._arr,n=2*r,i=n+1,o=r;n<a.length&&(o=a[n].priority<a[o].priority?n:o,i<a.length&&(o=a[i].priority<a[o].priority?i:o),o!==r&&(this._swap(r,o),this._heapify(o)))},e.prototype._decrease=function(r){for(var a=this._arr,n=a[r].priority,i;r!==0&&(i=r>>1,!(a[i].priority<n));)this._swap(r,i),r=i},e.prototype._swap=function(r,a){var n=this._arr,i=this._keyIndices,o=n[r],s=n[a];n[r]=s,n[a]=o,i[s.key]=r,i[o.key]=a},Th}var xh,Sb;function ZT(){if(Sb)return xh;Sb=1;var t=Xt(),e=KT();xh=a;var r=t.constant(1);function a(i,o,s,u){return n(i,String(o),s||r,u||function(l){return i.outEdges(l)})}function n(i,o,s,u){var l={},f=new e,h,v,c=function(d){var g=d.v!==h?d.v:d.w,p=l[g],y=s(d),b=v.distance+y;if(y<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+d+" Weight: "+y);b<p.distance&&(p.distance=b,p.predecessor=h,f.decrease(g,b))};for(i.nodes().forEach(function(d){var g=d===o?0:Number.POSITIVE_INFINITY;l[d]={distance:g},f.add(d,g)});f.size()>0&&(h=f.removeMin(),v=l[h],v.distance!==Number.POSITIVE_INFINITY);)u(h).forEach(c);return l}return xh}var Ch,Db;function PM(){if(Db)return Ch;Db=1;var t=ZT(),e=Xt();Ch=r;function r(a,n,i){return e.transform(a.nodes(),function(o,s){o[s]=t(a,s,n,i)},{})}return Ch}var Ah,Nb;function QT(){if(Nb)return Ah;Nb=1;var t=Xt();Ah=e;function e(r){var a=0,n=[],i={},o=[];function s(u){var l=i[u]={onStack:!0,lowlink:a,index:a++};if(n.push(u),r.successors(u).forEach(function(v){t.has(i,v)?i[v].onStack&&(l.lowlink=Math.min(l.lowlink,i[v].index)):(s(v),l.lowlink=Math.min(l.lowlink,i[v].lowlink))}),l.lowlink===l.index){var f=[],h;do h=n.pop(),i[h].onStack=!1,f.push(h);while(u!==h);o.push(f)}}return r.nodes().forEach(function(u){t.has(i,u)||s(u)}),o}return Ah}var Lh,Mb;function FM(){if(Mb)return Lh;Mb=1;var t=Xt(),e=QT();Lh=r;function r(a){return t.filter(e(a),function(n){return n.length>1||n.length===1&&a.hasEdge(n[0],n[0])})}return Lh}var Rh,Ob;function _M(){if(Ob)return Rh;Ob=1;var t=Xt();Rh=r;var e=t.constant(1);function r(n,i,o){return a(n,i||e,o||function(s){return n.outEdges(s)})}function a(n,i,o){var s={},u=n.nodes();return u.forEach(function(l){s[l]={},s[l][l]={distance:0},u.forEach(function(f){l!==f&&(s[l][f]={distance:Number.POSITIVE_INFINITY})}),o(l).forEach(function(f){var h=f.v===l?f.w:f.v,v=i(f);s[l][h]={distance:v,predecessor:l}})}),u.forEach(function(l){var f=s[l];u.forEach(function(h){var v=s[h];u.forEach(function(c){var d=v[l],g=f[c],p=v[c],y=d.distance+g.distance;y<p.distance&&(p.distance=y,p.predecessor=g.predecessor)})})}),s}return Rh}var Sh,Ib;function JT(){if(Ib)return Sh;Ib=1;var t=Xt();Sh=e,e.CycleException=r;function e(a){var n={},i={},o=[];function s(u){if(t.has(i,u))throw new r;t.has(n,u)||(i[u]=!0,n[u]=!0,t.each(a.predecessors(u),s),delete i[u],o.push(u))}if(t.each(a.sinks(),s),t.size(n)!==a.nodeCount())throw new r;return o}function r(){}return r.prototype=new Error,Sh}var Dh,Pb;function BM(){if(Pb)return Dh;Pb=1;var t=JT();Dh=e;function e(r){try{t(r)}catch(a){if(a instanceof t.CycleException)return!1;throw a}return!0}return Dh}var Nh,Fb;function jT(){if(Fb)return Nh;Fb=1;var t=Xt();Nh=e;function e(a,n,i){t.isArray(n)||(n=[n]);var o=(a.isDirected()?a.successors:a.neighbors).bind(a),s=[],u={};return t.each(n,function(l){if(!a.hasNode(l))throw new Error("Graph does not have node: "+l);r(a,l,i==="post",u,o,s)}),s}function r(a,n,i,o,s,u){t.has(o,n)||(o[n]=!0,i||u.push(n),t.each(s(n),function(l){r(a,l,i,o,s,u)}),i&&u.push(n))}return Nh}var Mh,_b;function kM(){if(_b)return Mh;_b=1;var t=jT();Mh=e;function e(r,a){return t(r,a,"post")}return Mh}var Oh,Bb;function qM(){if(Bb)return Oh;Bb=1;var t=jT();Oh=e;function e(r,a){return t(r,a,"pre")}return Oh}var Ih,kb;function GM(){if(kb)return Ih;kb=1;var t=Xt(),e=cd(),r=KT();Ih=a;function a(n,i){var o=new e,s={},u=new r,l;function f(v){var c=v.v===l?v.w:v.v,d=u.priority(c);if(d!==void 0){var g=i(v);g<d&&(s[c]=l,u.decrease(c,g))}}if(n.nodeCount()===0)return o;t.each(n.nodes(),function(v){u.add(v,Number.POSITIVE_INFINITY),o.setNode(v)}),u.decrease(n.nodes()[0],0);for(var h=!1;u.size()>0;){if(l=u.removeMin(),t.has(s,l))o.setEdge(l,s[l]);else{if(h)throw new Error("Input graph is not connected: "+n);h=!0}n.nodeEdges(l).forEach(f)}return o}return Ih}var Ph,qb;function UM(){return qb||(qb=1,Ph={components:IM(),dijkstra:ZT(),dijkstraAll:PM(),findCycles:FM(),floydWarshall:_M(),isAcyclic:BM(),postorder:kM(),preorder:qM(),prim:GM(),tarjan:QT(),topsort:JT()}),Ph}var Fh,Gb;function zM(){if(Gb)return Fh;Gb=1;var t=MM();return Fh={Graph:t.Graph,json:OM(),alg:UM(),version:t.version},Fh}var _h,Ub;function Qt(){if(Ub)return _h;Ub=1;var t;if(typeof Zv=="function")try{t=zM()}catch{}return t||(t=window.graphlib),_h=t,_h}var Bh,zb;function VM(){if(zb)return Bh;zb=1;var t=CT(),e=1,r=4;function a(n){return t(n,e|r)}return Bh=a,Bh}var kh,Vb;function so(){if(Vb)return kh;Vb=1;var t=Oa(),e=pr(),r=Ji(),a=Ht();function n(i,o,s){if(!a(s))return!1;var u=typeof o;return(u=="number"?e(s)&&r(o,s.length):u=="string"&&o in s)?t(s[o],i):!1}return kh=n,kh}var qh,Yb;function YM(){if(Yb)return qh;Yb=1;var t=oo(),e=Oa(),r=so(),a=na(),n=Object.prototype,i=n.hasOwnProperty,o=t(function(s,u){s=Object(s);var l=-1,f=u.length,h=f>2?u[2]:void 0;for(h&&r(u[0],u[1],h)&&(f=1);++l<f;)for(var v=u[l],c=a(v),d=-1,g=c.length;++d<g;){var p=c[d],y=s[p];(y===void 0||e(y,n[p])&&!i.call(s,p))&&(s[p]=v[p])}return s});return qh=o,qh}var Gh,Hb;function HM(){if(Hb)return Gh;Hb=1;var t=yr(),e=pr(),r=qr();function a(n){return function(i,o,s){var u=Object(i);if(!e(i)){var l=t(o,3);i=r(i),o=function(h){return l(u[h],h,u)}}var f=n(i,o,s);return f>-1?u[l?i[f]:f]:void 0}}return Gh=a,Gh}var Uh,Xb;function XM(){if(Xb)return Uh;Xb=1;var t=/\s/;function e(r){for(var a=r.length;a--&&t.test(r.charAt(a)););return a}return Uh=e,Uh}var zh,$b;function $M(){if($b)return zh;$b=1;var t=XM(),e=/^\s+/;function r(a){return a&&a.slice(0,t(a)+1).replace(e,"")}return zh=r,zh}var Vh,Wb;function WM(){if(Wb)return Vh;Wb=1;var t=$M(),e=Ht(),r=_a(),a=NaN,n=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,o=/^0o[0-7]+$/i,s=parseInt;function u(l){if(typeof l=="number")return l;if(r(l))return a;if(e(l)){var f=typeof l.valueOf=="function"?l.valueOf():l;l=e(f)?f+"":f}if(typeof l!="string")return l===0?l:+l;l=t(l);var h=i.test(l);return h||o.test(l)?s(l.slice(2),h?2:8):n.test(l)?a:+l}return Vh=u,Vh}var Yh,Kb;function ex(){if(Kb)return Yh;Kb=1;var t=WM(),e=1/0,r=17976931348623157e292;function a(n){if(!n)return n===0?n:0;if(n=t(n),n===e||n===-e){var i=n<0?-1:1;return i*r}return n===n?n:0}return Yh=a,Yh}var Hh,Zb;function KM(){if(Zb)return Hh;Zb=1;var t=ex();function e(r){var a=t(r),n=a%1;return a===a?n?a-n:a:0}return Hh=e,Hh}var Xh,Qb;function ZM(){if(Qb)return Xh;Qb=1;var t=XT(),e=yr(),r=KM(),a=Math.max;function n(i,o,s){var u=i==null?0:i.length;if(!u)return-1;var l=s==null?0:r(s);return l<0&&(l=a(u+l,0)),t(i,e(o,3),l)}return Xh=n,Xh}var $h,Jb;function QM(){if(Jb)return $h;Jb=1;var t=HM(),e=ZM(),r=t(e);return $h=r,$h}var Wh,jb;function tx(){if(jb)return Wh;jb=1;var t=hd();function e(r){var a=r==null?0:r.length;return a?t(r,1):[]}return Wh=e,Wh}var Kh,e1;function JM(){if(e1)return Kh;e1=1;var t=sd(),e=AT(),r=na();function a(n,i){return n==null?n:t(n,e(i),r)}return Kh=a,Kh}var Zh,t1;function jM(){if(t1)return Zh;t1=1;function t(e){var r=e==null?0:e.length;return r?e[r-1]:void 0}return Zh=t,Zh}var Qh,r1;function eO(){if(r1)return Qh;r1=1;var t=Zi(),e=ud(),r=yr();function a(n,i){var o={};return i=r(i,3),e(n,function(s,u,l){t(o,u,i(s,u,l))}),o}return Qh=a,Qh}var Jh,a1;function vd(){if(a1)return Jh;a1=1;var t=_a();function e(r,a,n){for(var i=-1,o=r.length;++i<o;){var s=r[i],u=a(s);if(u!=null&&(l===void 0?u===u&&!t(u):n(u,l)))var l=u,f=s}return f}return Jh=e,Jh}var jh,n1;function tO(){if(n1)return jh;n1=1;function t(e,r){return e>r}return jh=t,jh}var ec,i1;function rO(){if(i1)return ec;i1=1;var t=vd(),e=tO(),r=ia();function a(n){return n&&n.length?t(n,r,e):void 0}return ec=a,ec}var tc,o1;function rx(){if(o1)return tc;o1=1;var t=Zi(),e=Oa();function r(a,n,i){(i!==void 0&&!e(a[n],i)||i===void 0&&!(n in a))&&t(a,n,i)}return tc=r,tc}var rc,s1;function aO(){if(s1)return rc;s1=1;var t=ra(),e=to(),r=sr(),a="[object Object]",n=Function.prototype,i=Object.prototype,o=n.toString,s=i.hasOwnProperty,u=o.call(Object);function l(f){if(!r(f)||t(f)!=a)return!1;var h=e(f);if(h===null)return!0;var v=s.call(h,"constructor")&&h.constructor;return typeof v=="function"&&v instanceof v&&o.call(v)==u}return rc=l,rc}var ac,u1;function ax(){if(u1)return ac;u1=1;function t(e,r){if(!(r==="constructor"&&typeof e[r]=="function")&&r!="__proto__")return e[r]}return ac=t,ac}var nc,l1;function nO(){if(l1)return nc;l1=1;var t=Rn(),e=na();function r(a){return t(a,e(a))}return nc=r,nc}var ic,f1;function iO(){if(f1)return ic;f1=1;var t=rx(),e=cT(),r=wT(),a=vT(),n=xT(),i=Sn(),o=gt(),s=$T(),u=Pa(),l=Ln(),f=Ht(),h=aO(),v=Dn(),c=ax(),d=nO();function g(p,y,b,m,E,T,L){var w=c(p,b),C=c(y,b),A=L.get(C);if(A){t(p,b,A);return}var R=T?T(w,C,b+"",p,y,L):void 0,S=R===void 0;if(S){var D=o(C),P=!D&&u(C),x=!D&&!P&&v(C);R=C,D||P||x?o(w)?R=w:s(w)?R=a(w):P?(S=!1,R=e(C,!0)):x?(S=!1,R=r(C,!0)):R=[]:h(C)||i(C)?(R=w,i(w)?R=d(w):(!f(w)||l(w))&&(R=n(C))):S=!1}S&&(L.set(C,R),E(R,C,m,T,L),L.delete(C)),t(p,b,R)}return ic=g,ic}var oc,h1;function oO(){if(h1)return oc;h1=1;var t=Ki(),e=rx(),r=sd(),a=iO(),n=Ht(),i=na(),o=ax();function s(u,l,f,h,v){u!==l&&r(l,function(c,d){if(v||(v=new t),n(c))a(u,l,d,f,s,h,v);else{var g=h?h(o(u,d),c,d+"",u,l,v):void 0;g===void 0&&(g=c),e(u,d,g)}},i)}return oc=s,oc}var sc,c1;function sO(){if(c1)return sc;c1=1;var t=oo(),e=so();function r(a){return t(function(n,i){var o=-1,s=i.length,u=s>1?i[s-1]:void 0,l=s>2?i[2]:void 0;for(u=a.length>3&&typeof u=="function"?(s--,u):void 0,l&&e(i[0],i[1],l)&&(u=s<3?void 0:u,s=1),n=Object(n);++o<s;){var f=i[o];f&&a(n,f,o,u)}return n})}return sc=r,sc}var uc,v1;function uO(){if(v1)return uc;v1=1;var t=oO(),e=sO(),r=e(function(a,n,i){t(a,n,i)});return uc=r,uc}var lc,d1;function nx(){if(d1)return lc;d1=1;function t(e,r){return e<r}return lc=t,lc}var fc,g1;function lO(){if(g1)return fc;g1=1;var t=vd(),e=nx(),r=ia();function a(n){return n&&n.length?t(n,r,e):void 0}return fc=a,fc}var hc,p1;function fO(){if(p1)return hc;p1=1;var t=vd(),e=yr(),r=nx();function a(n,i){return n&&n.length?t(n,e(i,2),r):void 0}return hc=a,hc}var cc,y1;function hO(){if(y1)return cc;y1=1;var t=Jt(),e=function(){return t.Date.now()};return cc=e,cc}var vc,m1;function cO(){if(m1)return vc;m1=1;var t=Qi(),e=no(),r=Ji(),a=Ht(),n=Nn();function i(o,s,u,l){if(!a(o))return o;s=e(s,o);for(var f=-1,h=s.length,v=h-1,c=o;c!=null&&++f<h;){var d=n(s[f]),g=u;if(d==="__proto__"||d==="constructor"||d==="prototype")return o;if(f!=v){var p=c[d];g=l?l(p,d,c):void 0,g===void 0&&(g=a(p)?p:r(s[f+1])?[]:{})}t(c,d,g),c=c[d]}return o}return vc=i,vc}var dc,b1;function vO(){if(b1)return dc;b1=1;var t=io(),e=cO(),r=no();function a(n,i,o){for(var s=-1,u=i.length,l={};++s<u;){var f=i[s],h=t(n,f);o(h,f)&&e(l,r(f,n),h)}return l}return dc=a,dc}var gc,E1;function dO(){if(E1)return gc;E1=1;var t=vO(),e=_T();function r(a,n){return t(a,n,function(i,o){return e(a,o)})}return gc=r,gc}var pc,w1;function gO(){if(w1)return pc;w1=1;var t=tx(),e=YT(),r=HT();function a(n){return r(e(n,void 0,t),n+"")}return pc=a,pc}var yc,T1;function pO(){if(T1)return yc;T1=1;var t=dO(),e=gO(),r=e(function(a,n){return a==null?{}:t(a,n)});return yc=r,yc}var mc,x1;function yO(){if(x1)return mc;x1=1;var t=Math.ceil,e=Math.max;function r(a,n,i,o){for(var s=-1,u=e(t((n-a)/(i||1)),0),l=Array(u);u--;)l[o?u:++s]=a,a+=i;return l}return mc=r,mc}var bc,C1;function mO(){if(C1)return bc;C1=1;var t=yO(),e=so(),r=ex();function a(n){return function(i,o,s){return s&&typeof s!="number"&&e(i,o,s)&&(o=s=void 0),i=r(i),o===void 0?(o=i,i=0):o=r(o),s=s===void 0?i<o?1:-1:r(s),t(i,o,s,n)}}return bc=a,bc}var Ec,A1;function bO(){if(A1)return Ec;A1=1;var t=mO(),e=t();return Ec=e,Ec}var wc,L1;function EO(){if(L1)return wc;L1=1;function t(e,r){var a=e.length;for(e.sort(r);a--;)e[a]=e[a].value;return e}return wc=t,wc}var Tc,R1;function wO(){if(R1)return Tc;R1=1;var t=_a();function e(r,a){if(r!==a){var n=r!==void 0,i=r===null,o=r===r,s=t(r),u=a!==void 0,l=a===null,f=a===a,h=t(a);if(!l&&!h&&!s&&r>a||s&&u&&f&&!l&&!h||i&&u&&f||!n&&f||!o)return 1;if(!i&&!s&&!h&&r<a||h&&n&&o&&!i&&!s||l&&n&&o||!u&&o||!f)return-1}return 0}return Tc=e,Tc}var xc,S1;function TO(){if(S1)return xc;S1=1;var t=wO();function e(r,a,n){for(var i=-1,o=r.criteria,s=a.criteria,u=o.length,l=n.length;++i<u;){var f=t(o[i],s[i]);if(f){if(i>=l)return f;var h=n[i];return f*(h=="desc"?-1:1)}}return r.index-a.index}return xc=e,xc}var Cc,D1;function xO(){if(D1)return Cc;D1=1;var t=ao(),e=io(),r=yr(),a=UT(),n=EO(),i=ji(),o=TO(),s=ia(),u=gt();function l(f,h,v){h.length?h=t(h,function(g){return u(g)?function(p){return e(p,g.length===1?g[0]:g)}:g}):h=[s];var c=-1;h=t(h,i(r));var d=a(f,function(g,p,y){var b=t(h,function(m){return m(g)});return{criteria:b,index:++c,value:g}});return n(d,function(g,p){return o(g,p,v)})}return Cc=l,Cc}var Ac,N1;function CO(){if(N1)return Ac;N1=1;var t=hd(),e=xO(),r=oo(),a=so(),n=r(function(i,o){if(i==null)return[];var s=o.length;return s>1&&a(i,o[0],o[1])?o=[]:s>2&&a(o[0],o[1],o[2])&&(o=[o[0]]),e(i,t(o,1),[])});return Ac=n,Ac}var Lc,M1;function AO(){if(M1)return Lc;M1=1;var t=PT(),e=0;function r(a){var n=++e;return t(a)+n}return Lc=r,Lc}var Rc,O1;function LO(){if(O1)return Rc;O1=1;function t(e,r,a){for(var n=-1,i=e.length,o=r.length,s={};++n<i;){var u=n<o?r[n]:void 0;a(s,e[n],u)}return s}return Rc=t,Rc}var Sc,I1;function RO(){if(I1)return Sc;I1=1;var t=Qi(),e=LO();function r(a,n){return e(a||[],n||[],t)}return Sc=r,Sc}var Dc,P1;function nt(){if(P1)return Dc;P1=1;var t;if(typeof Zv=="function")try{t={cloneDeep:VM(),constant:od(),defaults:YM(),each:RT(),filter:kT(),find:QM(),flatten:tx(),forEach:LT(),forIn:JM(),has:qT(),isUndefined:GT(),last:jM(),map:zT(),mapValues:eO(),max:rO(),merge:uO(),min:lO(),minBy:fO(),now:hO(),pick:pO(),range:bO(),reduce:VT(),sortBy:CO(),uniqueId:AO(),values:WT(),zipObject:RO()}}catch{}return t||(t=window._),Dc=t,Dc}var Nc,F1;function SO(){if(F1)return Nc;F1=1,Nc=t;function t(){var a={};a._next=a._prev=a,this._sentinel=a}t.prototype.dequeue=function(){var a=this._sentinel,n=a._prev;if(n!==a)return e(n),n},t.prototype.enqueue=function(a){var n=this._sentinel;a._prev&&a._next&&e(a),a._next=n._next,n._next._prev=a,n._next=a,a._prev=n},t.prototype.toString=function(){for(var a=[],n=this._sentinel,i=n._prev;i!==n;)a.push(JSON.stringify(i,r)),i=i._prev;return"["+a.join(", ")+"]"};function e(a){a._prev._next=a._next,a._next._prev=a._prev,delete a._next,delete a._prev}function r(a,n){if(a!=="_next"&&a!=="_prev")return n}return Nc}var Mc,_1;function DO(){if(_1)return Mc;_1=1;var t=nt(),e=Qt().Graph,r=SO();Mc=n;var a=t.constant(1);function n(l,f){if(l.nodeCount()<=1)return[];var h=s(l,f||a),v=i(h.graph,h.buckets,h.zeroIdx);return t.flatten(t.map(v,function(c){return l.outEdges(c.v,c.w)}),!0)}function i(l,f,h){for(var v=[],c=f[f.length-1],d=f[0],g;l.nodeCount();){for(;g=d.dequeue();)o(l,f,h,g);for(;g=c.dequeue();)o(l,f,h,g);if(l.nodeCount()){for(var p=f.length-2;p>0;--p)if(g=f[p].dequeue(),g){v=v.concat(o(l,f,h,g,!0));break}}}return v}function o(l,f,h,v,c){var d=c?[]:void 0;return t.forEach(l.inEdges(v.v),function(g){var p=l.edge(g),y=l.node(g.v);c&&d.push({v:g.v,w:g.w}),y.out-=p,u(f,h,y)}),t.forEach(l.outEdges(v.v),function(g){var p=l.edge(g),y=g.w,b=l.node(y);b.in-=p,u(f,h,b)}),l.removeNode(v.v),d}function s(l,f){var h=new e,v=0,c=0;t.forEach(l.nodes(),function(p){h.setNode(p,{v:p,in:0,out:0})}),t.forEach(l.edges(),function(p){var y=h.edge(p.v,p.w)||0,b=f(p),m=y+b;h.setEdge(p.v,p.w,m),c=Math.max(c,h.node(p.v).out+=b),v=Math.max(v,h.node(p.w).in+=b)});var d=t.range(c+v+3).map(function(){return new r}),g=v+1;return t.forEach(h.nodes(),function(p){u(d,g,h.node(p))}),{graph:h,buckets:d,zeroIdx:g}}function u(l,f,h){h.out?h.in?l[h.out-h.in+f].enqueue(h):l[l.length-1].enqueue(h):l[0].enqueue(h)}return Mc}var Oc,B1;function NO(){if(B1)return Oc;B1=1;var t=nt(),e=DO();Oc={run:r,undo:n};function r(i){var o=i.graph().acyclicer==="greedy"?e(i,s(i)):a(i);t.forEach(o,function(u){var l=i.edge(u);i.removeEdge(u),l.forwardName=u.name,l.reversed=!0,i.setEdge(u.w,u.v,l,t.uniqueId("rev"))});function s(u){return function(l){return u.edge(l).weight}}}function a(i){var o=[],s={},u={};function l(f){t.has(u,f)||(u[f]=!0,s[f]=!0,t.forEach(i.outEdges(f),function(h){t.has(s,h.w)?o.push(h):l(h.w)}),delete s[f])}return t.forEach(i.nodes(),l),o}function n(i){t.forEach(i.edges(),function(o){var s=i.edge(o);if(s.reversed){i.removeEdge(o);var u=s.forwardName;delete s.reversed,delete s.forwardName,i.setEdge(o.w,o.v,s,u)}})}return Oc}var Ic,k1;function qt(){if(k1)return Ic;k1=1;var t=nt(),e=Qt().Graph;Ic={addDummyNode:r,simplify:a,asNonCompoundGraph:n,successorWeights:i,predecessorWeights:o,intersectRect:s,buildLayerMatrix:u,normalizeRanks:l,removeEmptyRanks:f,addBorderNode:h,maxRank:v,partition:c,time:d,notime:g};function r(p,y,b,m){var E;do E=t.uniqueId(m);while(p.hasNode(E));return b.dummy=y,p.setNode(E,b),E}function a(p){var y=new e().setGraph(p.graph());return t.forEach(p.nodes(),function(b){y.setNode(b,p.node(b))}),t.forEach(p.edges(),function(b){var m=y.edge(b.v,b.w)||{weight:0,minlen:1},E=p.edge(b);y.setEdge(b.v,b.w,{weight:m.weight+E.weight,minlen:Math.max(m.minlen,E.minlen)})}),y}function n(p){var y=new e({multigraph:p.isMultigraph()}).setGraph(p.graph());return t.forEach(p.nodes(),function(b){p.children(b).length||y.setNode(b,p.node(b))}),t.forEach(p.edges(),function(b){y.setEdge(b,p.edge(b))}),y}function i(p){var y=t.map(p.nodes(),function(b){var m={};return t.forEach(p.outEdges(b),function(E){m[E.w]=(m[E.w]||0)+p.edge(E).weight}),m});return t.zipObject(p.nodes(),y)}function o(p){var y=t.map(p.nodes(),function(b){var m={};return t.forEach(p.inEdges(b),function(E){m[E.v]=(m[E.v]||0)+p.edge(E).weight}),m});return t.zipObject(p.nodes(),y)}function s(p,y){var b=p.x,m=p.y,E=y.x-b,T=y.y-m,L=p.width/2,w=p.height/2;if(!E&&!T)throw new Error("Not possible to find intersection inside of the rectangle");var C,A;return Math.abs(T)*L>Math.abs(E)*w?(T<0&&(w=-w),C=w*E/T,A=w):(E<0&&(L=-L),C=L,A=L*T/E),{x:b+C,y:m+A}}function u(p){var y=t.map(t.range(v(p)+1),function(){return[]});return t.forEach(p.nodes(),function(b){var m=p.node(b),E=m.rank;t.isUndefined(E)||(y[E][m.order]=b)}),y}function l(p){var y=t.min(t.map(p.nodes(),function(b){return p.node(b).rank}));t.forEach(p.nodes(),function(b){var m=p.node(b);t.has(m,"rank")&&(m.rank-=y)})}function f(p){var y=t.min(t.map(p.nodes(),function(T){return p.node(T).rank})),b=[];t.forEach(p.nodes(),function(T){var L=p.node(T).rank-y;b[L]||(b[L]=[]),b[L].push(T)});var m=0,E=p.graph().nodeRankFactor;t.forEach(b,function(T,L){t.isUndefined(T)&&L%E!==0?--m:m&&t.forEach(T,function(w){p.node(w).rank+=m})})}function h(p,y,b,m){var E={width:0,height:0};return arguments.length>=4&&(E.rank=b,E.order=m),r(p,"border",E,y)}function v(p){return t.max(t.map(p.nodes(),function(y){var b=p.node(y).rank;if(!t.isUndefined(b))return b}))}function c(p,y){var b={lhs:[],rhs:[]};return t.forEach(p,function(m){y(m)?b.lhs.push(m):b.rhs.push(m)}),b}function d(p,y){var b=t.now();try{return y()}finally{console.log(p+" time: "+(t.now()-b)+"ms")}}function g(p,y){return y()}return Ic}var Pc,q1;function MO(){if(q1)return Pc;q1=1;var t=nt(),e=qt();Pc={run:r,undo:n};function r(i){i.graph().dummyChains=[],t.forEach(i.edges(),function(o){a(i,o)})}function a(i,o){var s=o.v,u=i.node(s).rank,l=o.w,f=i.node(l).rank,h=o.name,v=i.edge(o),c=v.labelRank;if(f!==u+1){i.removeEdge(o);var d,g,p;for(p=0,++u;u<f;++p,++u)v.points=[],g={width:0,height:0,edgeLabel:v,edgeObj:o,rank:u},d=e.addDummyNode(i,"edge",g,"_d"),u===c&&(g.width=v.width,g.height=v.height,g.dummy="edge-label",g.labelpos=v.labelpos),i.setEdge(s,d,{weight:v.weight},h),p===0&&i.graph().dummyChains.push(d),s=d;i.setEdge(s,l,{weight:v.weight},h)}}function n(i){t.forEach(i.graph().dummyChains,function(o){var s=i.node(o),u=s.edgeLabel,l;for(i.setEdge(s.edgeObj,u);s.dummy;)l=i.successors(o)[0],i.removeNode(o),u.points.push({x:s.x,y:s.y}),s.dummy==="edge-label"&&(u.x=s.x,u.y=s.y,u.width=s.width,u.height=s.height),o=l,s=i.node(o)})}return Pc}var Fc,G1;function Li(){if(G1)return Fc;G1=1;var t=nt();Fc={longestPath:e,slack:r};function e(a){var n={};function i(o){var s=a.node(o);if(t.has(n,o))return s.rank;n[o]=!0;var u=t.min(t.map(a.outEdges(o),function(l){return i(l.w)-a.edge(l).minlen}));return(u===Number.POSITIVE_INFINITY||u===void 0||u===null)&&(u=0),s.rank=u}t.forEach(a.sources(),i)}function r(a,n){return a.node(n.w).rank-a.node(n.v).rank-a.edge(n).minlen}return Fc}var _c,U1;function ix(){if(U1)return _c;U1=1;var t=nt(),e=Qt().Graph,r=Li().slack;_c=a;function a(s){var u=new e({directed:!1}),l=s.nodes()[0],f=s.nodeCount();u.setNode(l,{});for(var h,v;n(u,s)<f;)h=i(u,s),v=u.hasNode(h.v)?r(s,h):-r(s,h),o(u,s,v);return u}function n(s,u){function l(f){t.forEach(u.nodeEdges(f),function(h){var v=h.v,c=f===v?h.w:v;!s.hasNode(c)&&!r(u,h)&&(s.setNode(c,{}),s.setEdge(f,c,{}),l(c))})}return t.forEach(s.nodes(),l),s.nodeCount()}function i(s,u){return t.minBy(u.edges(),function(l){if(s.hasNode(l.v)!==s.hasNode(l.w))return r(u,l)})}function o(s,u,l){t.forEach(s.nodes(),function(f){u.node(f).rank+=l})}return _c}var Bc,z1;function OO(){if(z1)return Bc;z1=1;var t=nt(),e=ix(),r=Li().slack,a=Li().longestPath,n=Qt().alg.preorder,i=Qt().alg.postorder,o=qt().simplify;Bc=s,s.initLowLimValues=h,s.initCutValues=u,s.calcCutValue=f,s.leaveEdge=c,s.enterEdge=d,s.exchangeEdges=g;function s(m){m=o(m),a(m);var E=e(m);h(E),u(E,m);for(var T,L;T=c(E);)L=d(E,m,T),g(E,m,T,L)}function u(m,E){var T=i(m,m.nodes());T=T.slice(0,T.length-1),t.forEach(T,function(L){l(m,E,L)})}function l(m,E,T){var L=m.node(T),w=L.parent;m.edge(T,w).cutvalue=f(m,E,T)}function f(m,E,T){var L=m.node(T),w=L.parent,C=!0,A=E.edge(T,w),R=0;return A||(C=!1,A=E.edge(w,T)),R=A.weight,t.forEach(E.nodeEdges(T),function(S){var D=S.v===T,P=D?S.w:S.v;if(P!==w){var x=D===C,N=E.edge(S).weight;if(R+=x?N:-N,y(m,T,P)){var M=m.edge(T,P).cutvalue;R+=x?-M:M}}}),R}function h(m,E){arguments.length<2&&(E=m.nodes()[0]),v(m,{},1,E)}function v(m,E,T,L,w){var C=T,A=m.node(L);return E[L]=!0,t.forEach(m.neighbors(L),function(R){t.has(E,R)||(T=v(m,E,T,R,L))}),A.low=C,A.lim=T++,w?A.parent=w:delete A.parent,T}function c(m){return t.find(m.edges(),function(E){return m.edge(E).cutvalue<0})}function d(m,E,T){var L=T.v,w=T.w;E.hasEdge(L,w)||(L=T.w,w=T.v);var C=m.node(L),A=m.node(w),R=C,S=!1;C.lim>A.lim&&(R=A,S=!0);var D=t.filter(E.edges(),function(P){return S===b(m,m.node(P.v),R)&&S!==b(m,m.node(P.w),R)});return t.minBy(D,function(P){return r(E,P)})}function g(m,E,T,L){var w=T.v,C=T.w;m.removeEdge(w,C),m.setEdge(L.v,L.w,{}),h(m),u(m,E),p(m,E)}function p(m,E){var T=t.find(m.nodes(),function(w){return!E.node(w).parent}),L=n(m,T);L=L.slice(1),t.forEach(L,function(w){var C=m.node(w).parent,A=E.edge(w,C),R=!1;A||(A=E.edge(C,w),R=!0),E.node(w).rank=E.node(C).rank+(R?A.minlen:-A.minlen)})}function y(m,E,T){return m.hasEdge(E,T)}function b(m,E,T){return T.low<=E.lim&&E.lim<=T.lim}return Bc}var kc,V1;function IO(){if(V1)return kc;V1=1;var t=Li(),e=t.longestPath,r=ix(),a=OO();kc=n;function n(u){switch(u.graph().ranker){case"network-simplex":s(u);break;case"tight-tree":o(u);break;case"longest-path":i(u);break;default:s(u)}}var i=e;function o(u){e(u),r(u)}function s(u){a(u)}return kc}var qc,Y1;function PO(){if(Y1)return qc;Y1=1;var t=nt();qc=e;function e(n){var i=a(n);t.forEach(n.graph().dummyChains,function(o){for(var s=n.node(o),u=s.edgeObj,l=r(n,i,u.v,u.w),f=l.path,h=l.lca,v=0,c=f[v],d=!0;o!==u.w;){if(s=n.node(o),d){for(;(c=f[v])!==h&&n.node(c).maxRank<s.rank;)v++;c===h&&(d=!1)}if(!d){for(;v<f.length-1&&n.node(c=f[v+1]).minRank<=s.rank;)v++;c=f[v]}n.setParent(o,c),o=n.successors(o)[0]}})}function r(n,i,o,s){var u=[],l=[],f=Math.min(i[o].low,i[s].low),h=Math.max(i[o].lim,i[s].lim),v,c;v=o;do v=n.parent(v),u.push(v);while(v&&(i[v].low>f||h>i[v].lim));for(c=v,v=s;(v=n.parent(v))!==c;)l.push(v);return{path:u.concat(l.reverse()),lca:c}}function a(n){var i={},o=0;function s(u){var l=o;t.forEach(n.children(u),s),i[u]={low:l,lim:o++}}return t.forEach(n.children(),s),i}return qc}var Gc,H1;function FO(){if(H1)return Gc;H1=1;var t=nt(),e=qt();Gc={run:r,cleanup:o};function r(s){var u=e.addDummyNode(s,"root",{},"_root"),l=n(s),f=t.max(t.values(l))-1,h=2*f+1;s.graph().nestingRoot=u,t.forEach(s.edges(),function(c){s.edge(c).minlen*=h});var v=i(s)+1;t.forEach(s.children(),function(c){a(s,u,h,v,f,l,c)}),s.graph().nodeRankFactor=h}function a(s,u,l,f,h,v,c){var d=s.children(c);if(!d.length){c!==u&&s.setEdge(u,c,{weight:0,minlen:l});return}var g=e.addBorderNode(s,"_bt"),p=e.addBorderNode(s,"_bb"),y=s.node(c);s.setParent(g,c),y.borderTop=g,s.setParent(p,c),y.borderBottom=p,t.forEach(d,function(b){a(s,u,l,f,h,v,b);var m=s.node(b),E=m.borderTop?m.borderTop:b,T=m.borderBottom?m.borderBottom:b,L=m.borderTop?f:2*f,w=E!==T?1:h-v[c]+1;s.setEdge(g,E,{weight:L,minlen:w,nestingEdge:!0}),s.setEdge(T,p,{weight:L,minlen:w,nestingEdge:!0})}),s.parent(c)||s.setEdge(u,g,{weight:0,minlen:h+v[c]})}function n(s){var u={};function l(f,h){var v=s.children(f);v&&v.length&&t.forEach(v,function(c){l(c,h+1)}),u[f]=h}return t.forEach(s.children(),function(f){l(f,1)}),u}function i(s){return t.reduce(s.edges(),function(u,l){return u+s.edge(l).weight},0)}function o(s){var u=s.graph();s.removeNode(u.nestingRoot),delete u.nestingRoot,t.forEach(s.edges(),function(l){var f=s.edge(l);f.nestingEdge&&s.removeEdge(l)})}return Gc}var Uc,X1;function _O(){if(X1)return Uc;X1=1;var t=nt(),e=qt();Uc=r;function r(n){function i(o){var s=n.children(o),u=n.node(o);if(s.length&&t.forEach(s,i),t.has(u,"minRank")){u.borderLeft=[],u.borderRight=[];for(var l=u.minRank,f=u.maxRank+1;l<f;++l)a(n,"borderLeft","_bl",o,u,l),a(n,"borderRight","_br",o,u,l)}}t.forEach(n.children(),i)}function a(n,i,o,s,u,l){var f={width:0,height:0,rank:l,borderType:i},h=u[i][l-1],v=e.addDummyNode(n,"border",f,o);u[i][l]=v,n.setParent(v,s),h&&n.setEdge(h,v,{weight:1})}return Uc}var zc,$1;function BO(){if($1)return zc;$1=1;var t=nt();zc={adjust:e,undo:r};function e(l){var f=l.graph().rankdir.toLowerCase();(f==="lr"||f==="rl")&&a(l)}function r(l){var f=l.graph().rankdir.toLowerCase();(f==="bt"||f==="rl")&&i(l),(f==="lr"||f==="rl")&&(s(l),a(l))}function a(l){t.forEach(l.nodes(),function(f){n(l.node(f))}),t.forEach(l.edges(),function(f){n(l.edge(f))})}function n(l){var f=l.width;l.width=l.height,l.height=f}function i(l){t.forEach(l.nodes(),function(f){o(l.node(f))}),t.forEach(l.edges(),function(f){var h=l.edge(f);t.forEach(h.points,o),t.has(h,"y")&&o(h)})}function o(l){l.y=-l.y}function s(l){t.forEach(l.nodes(),function(f){u(l.node(f))}),t.forEach(l.edges(),function(f){var h=l.edge(f);t.forEach(h.points,u),t.has(h,"x")&&u(h)})}function u(l){var f=l.x;l.x=l.y,l.y=f}return zc}var Vc,W1;function kO(){if(W1)return Vc;W1=1;var t=nt();Vc=e;function e(r){var a={},n=t.filter(r.nodes(),function(l){return!r.children(l).length}),i=t.max(t.map(n,function(l){return r.node(l).rank})),o=t.map(t.range(i+1),function(){return[]});function s(l){if(!t.has(a,l)){a[l]=!0;var f=r.node(l);o[f.rank].push(l),t.forEach(r.successors(l),s)}}var u=t.sortBy(n,function(l){return r.node(l).rank});return t.forEach(u,s),o}return Vc}var Yc,K1;function qO(){if(K1)return Yc;K1=1;var t=nt();Yc=e;function e(a,n){for(var i=0,o=1;o<n.length;++o)i+=r(a,n[o-1],n[o]);return i}function r(a,n,i){for(var o=t.zipObject(i,t.map(i,function(v,c){return c})),s=t.flatten(t.map(n,function(v){return t.sortBy(t.map(a.outEdges(v),function(c){return{pos:o[c.w],weight:a.edge(c).weight}}),"pos")}),!0),u=1;u<i.length;)u<<=1;var l=2*u-1;u-=1;var f=t.map(new Array(l),function(){return 0}),h=0;return t.forEach(s.forEach(function(v){var c=v.pos+u;f[c]+=v.weight;for(var d=0;c>0;)c%2&&(d+=f[c+1]),c=c-1>>1,f[c]+=v.weight;h+=v.weight*d})),h}return Yc}var Hc,Z1;function GO(){if(Z1)return Hc;Z1=1;var t=nt();Hc=e;function e(r,a){return t.map(a,function(n){var i=r.inEdges(n);if(i.length){var o=t.reduce(i,function(s,u){var l=r.edge(u),f=r.node(u.v);return{sum:s.sum+l.weight*f.order,weight:s.weight+l.weight}},{sum:0,weight:0});return{v:n,barycenter:o.sum/o.weight,weight:o.weight}}else return{v:n}})}return Hc}var Xc,Q1;function UO(){if(Q1)return Xc;Q1=1;var t=nt();Xc=e;function e(n,i){var o={};t.forEach(n,function(u,l){var f=o[u.v]={indegree:0,in:[],out:[],vs:[u.v],i:l};t.isUndefined(u.barycenter)||(f.barycenter=u.barycenter,f.weight=u.weight)}),t.forEach(i.edges(),function(u){var l=o[u.v],f=o[u.w];!t.isUndefined(l)&&!t.isUndefined(f)&&(f.indegree++,l.out.push(o[u.w]))});var s=t.filter(o,function(u){return!u.indegree});return r(s)}function r(n){var i=[];function o(l){return function(f){f.merged||(t.isUndefined(f.barycenter)||t.isUndefined(l.barycenter)||f.barycenter>=l.barycenter)&&a(l,f)}}function s(l){return function(f){f.in.push(l),--f.indegree===0&&n.push(f)}}for(;n.length;){var u=n.pop();i.push(u),t.forEach(u.in.reverse(),o(u)),t.forEach(u.out,s(u))}return t.map(t.filter(i,function(l){return!l.merged}),function(l){return t.pick(l,["vs","i","barycenter","weight"])})}function a(n,i){var o=0,s=0;n.weight&&(o+=n.barycenter*n.weight,s+=n.weight),i.weight&&(o+=i.barycenter*i.weight,s+=i.weight),n.vs=i.vs.concat(n.vs),n.barycenter=o/s,n.weight=s,n.i=Math.min(i.i,n.i),i.merged=!0}return Xc}var $c,J1;function zO(){if(J1)return $c;J1=1;var t=nt(),e=qt();$c=r;function r(i,o){var s=e.partition(i,function(g){return t.has(g,"barycenter")}),u=s.lhs,l=t.sortBy(s.rhs,function(g){return-g.i}),f=[],h=0,v=0,c=0;u.sort(n(!!o)),c=a(f,l,c),t.forEach(u,function(g){c+=g.vs.length,f.push(g.vs),h+=g.barycenter*g.weight,v+=g.weight,c=a(f,l,c)});var d={vs:t.flatten(f,!0)};return v&&(d.barycenter=h/v,d.weight=v),d}function a(i,o,s){for(var u;o.length&&(u=t.last(o)).i<=s;)o.pop(),i.push(u.vs),s++;return s}function n(i){return function(o,s){return o.barycenter<s.barycenter?-1:o.barycenter>s.barycenter?1:i?s.i-o.i:o.i-s.i}}return $c}var Wc,j1;function VO(){if(j1)return Wc;j1=1;var t=nt(),e=GO(),r=UO(),a=zO();Wc=n;function n(s,u,l,f){var h=s.children(u),v=s.node(u),c=v?v.borderLeft:void 0,d=v?v.borderRight:void 0,g={};c&&(h=t.filter(h,function(T){return T!==c&&T!==d}));var p=e(s,h);t.forEach(p,function(T){if(s.children(T.v).length){var L=n(s,T.v,l,f);g[T.v]=L,t.has(L,"barycenter")&&o(T,L)}});var y=r(p,l);i(y,g);var b=a(y,f);if(c&&(b.vs=t.flatten([c,b.vs,d],!0),s.predecessors(c).length)){var m=s.node(s.predecessors(c)[0]),E=s.node(s.predecessors(d)[0]);t.has(b,"barycenter")||(b.barycenter=0,b.weight=0),b.barycenter=(b.barycenter*b.weight+m.order+E.order)/(b.weight+2),b.weight+=2}return b}function i(s,u){t.forEach(s,function(l){l.vs=t.flatten(l.vs.map(function(f){return u[f]?u[f].vs:f}),!0)})}function o(s,u){t.isUndefined(s.barycenter)?(s.barycenter=u.barycenter,s.weight=u.weight):(s.barycenter=(s.barycenter*s.weight+u.barycenter*u.weight)/(s.weight+u.weight),s.weight+=u.weight)}return Wc}var Kc,eE;function YO(){if(eE)return Kc;eE=1;var t=nt(),e=Qt().Graph;Kc=r;function r(n,i,o){var s=a(n),u=new e({compound:!0}).setGraph({root:s}).setDefaultNodeLabel(function(l){return n.node(l)});return t.forEach(n.nodes(),function(l){var f=n.node(l),h=n.parent(l);(f.rank===i||f.minRank<=i&&i<=f.maxRank)&&(u.setNode(l),u.setParent(l,h||s),t.forEach(n[o](l),function(v){var c=v.v===l?v.w:v.v,d=u.edge(c,l),g=t.isUndefined(d)?0:d.weight;u.setEdge(c,l,{weight:n.edge(v).weight+g})}),t.has(f,"minRank")&&u.setNode(l,{borderLeft:f.borderLeft[i],borderRight:f.borderRight[i]}))}),u}function a(n){for(var i;n.hasNode(i=t.uniqueId("_root")););return i}return Kc}var Zc,tE;function HO(){if(tE)return Zc;tE=1;var t=nt();Zc=e;function e(r,a,n){var i={},o;t.forEach(n,function(s){for(var u=r.parent(s),l,f;u;){if(l=r.parent(u),l?(f=i[l],i[l]=u):(f=o,o=u),f&&f!==u){a.setEdge(f,u);return}u=l}})}return Zc}var Qc,rE;function XO(){if(rE)return Qc;rE=1;var t=nt(),e=kO(),r=qO(),a=VO(),n=YO(),i=HO(),o=Qt().Graph,s=qt();Qc=u;function u(v){var c=s.maxRank(v),d=l(v,t.range(1,c+1),"inEdges"),g=l(v,t.range(c-1,-1,-1),"outEdges"),p=e(v);h(v,p);for(var y=Number.POSITIVE_INFINITY,b,m=0,E=0;E<4;++m,++E){f(m%2?d:g,m%4>=2),p=s.buildLayerMatrix(v);var T=r(v,p);T<y&&(E=0,b=t.cloneDeep(p),y=T)}h(v,b)}function l(v,c,d){return t.map(c,function(g){return n(v,g,d)})}function f(v,c){var d=new o;t.forEach(v,function(g){var p=g.graph().root,y=a(g,p,d,c);t.forEach(y.vs,function(b,m){g.node(b).order=m}),i(g,d,y.vs)})}function h(v,c){t.forEach(c,function(d){t.forEach(d,function(g,p){v.node(g).order=p})})}return Qc}var Jc,aE;function $O(){if(aE)return Jc;aE=1;var t=nt(),e=Qt().Graph,r=qt();Jc={positionX:d,findType1Conflicts:a,findType2Conflicts:n,addConflict:o,hasConflict:s,verticalAlignment:u,horizontalCompaction:l,alignCoordinates:v,findSmallestWidthAlignment:h,balance:c};function a(y,b){var m={};function E(T,L){var w=0,C=0,A=T.length,R=t.last(L);return t.forEach(L,function(S,D){var P=i(y,S),x=P?y.node(P).order:A;(P||S===R)&&(t.forEach(L.slice(C,D+1),function(N){t.forEach(y.predecessors(N),function(M){var I=y.node(M),O=I.order;(O<w||x<O)&&!(I.dummy&&y.node(N).dummy)&&o(m,M,N)})}),C=D+1,w=x)}),L}return t.reduce(b,E),m}function n(y,b){var m={};function E(L,w,C,A,R){var S;t.forEach(t.range(w,C),function(D){S=L[D],y.node(S).dummy&&t.forEach(y.predecessors(S),function(P){var x=y.node(P);x.dummy&&(x.order<A||x.order>R)&&o(m,P,S)})})}function T(L,w){var C=-1,A,R=0;return t.forEach(w,function(S,D){if(y.node(S).dummy==="border"){var P=y.predecessors(S);P.length&&(A=y.node(P[0]).order,E(w,R,D,C,A),R=D,C=A)}E(w,R,w.length,A,L.length)}),w}return t.reduce(b,T),m}function i(y,b){if(y.node(b).dummy)return t.find(y.predecessors(b),function(m){return y.node(m).dummy})}function o(y,b,m){if(b>m){var E=b;b=m,m=E}var T=y[b];T||(y[b]=T={}),T[m]=!0}function s(y,b,m){if(b>m){var E=b;b=m,m=E}return t.has(y[b],m)}function u(y,b,m,E){var T={},L={},w={};return t.forEach(b,function(C){t.forEach(C,function(A,R){T[A]=A,L[A]=A,w[A]=R})}),t.forEach(b,function(C){var A=-1;t.forEach(C,function(R){var S=E(R);if(S.length){S=t.sortBy(S,function(M){return w[M]});for(var D=(S.length-1)/2,P=Math.floor(D),x=Math.ceil(D);P<=x;++P){var N=S[P];L[R]===R&&A<w[N]&&!s(m,R,N)&&(L[N]=R,L[R]=T[R]=T[N],A=w[N])}}})}),{root:T,align:L}}function l(y,b,m,E,T){var L={},w=f(y,b,m,T),C=T?"borderLeft":"borderRight";function A(D,P){for(var x=w.nodes(),N=x.pop(),M={};N;)M[N]?D(N):(M[N]=!0,x.push(N),x=x.concat(P(N))),N=x.pop()}function R(D){L[D]=w.inEdges(D).reduce(function(P,x){return Math.max(P,L[x.v]+w.edge(x))},0)}function S(D){var P=w.outEdges(D).reduce(function(N,M){return Math.min(N,L[M.w]-w.edge(M))},Number.POSITIVE_INFINITY),x=y.node(D);P!==Number.POSITIVE_INFINITY&&x.borderType!==C&&(L[D]=Math.max(L[D],P))}return A(R,w.predecessors.bind(w)),A(S,w.successors.bind(w)),t.forEach(E,function(D){L[D]=L[m[D]]}),L}function f(y,b,m,E){var T=new e,L=y.graph(),w=g(L.nodesep,L.edgesep,E);return t.forEach(b,function(C){var A;t.forEach(C,function(R){var S=m[R];if(T.setNode(S),A){var D=m[A],P=T.edge(D,S);T.setEdge(D,S,Math.max(w(y,R,A),P||0))}A=R})}),T}function h(y,b){return t.minBy(t.values(b),function(m){var E=Number.NEGATIVE_INFINITY,T=Number.POSITIVE_INFINITY;return t.forIn(m,function(L,w){var C=p(y,w)/2;E=Math.max(L+C,E),T=Math.min(L-C,T)}),E-T})}function v(y,b){var m=t.values(b),E=t.min(m),T=t.max(m);t.forEach(["u","d"],function(L){t.forEach(["l","r"],function(w){var C=L+w,A=y[C],R;if(A!==b){var S=t.values(A);R=w==="l"?E-t.min(S):T-t.max(S),R&&(y[C]=t.mapValues(A,function(D){return D+R}))}})})}function c(y,b){return t.mapValues(y.ul,function(m,E){if(b)return y[b.toLowerCase()][E];var T=t.sortBy(t.map(y,E));return(T[1]+T[2])/2})}function d(y){var b=r.buildLayerMatrix(y),m=t.merge(a(y,b),n(y,b)),E={},T;t.forEach(["u","d"],function(w){T=w==="u"?b:t.values(b).reverse(),t.forEach(["l","r"],function(C){C==="r"&&(T=t.map(T,function(D){return t.values(D).reverse()}));var A=(w==="u"?y.predecessors:y.successors).bind(y),R=u(y,T,m,A),S=l(y,T,R.root,R.align,C==="r");C==="r"&&(S=t.mapValues(S,function(D){return-D})),E[w+C]=S})});var L=h(y,E);return v(E,L),c(E,y.graph().align)}function g(y,b,m){return function(E,T,L){var w=E.node(T),C=E.node(L),A=0,R;if(A+=w.width/2,t.has(w,"labelpos"))switch(w.labelpos.toLowerCase()){case"l":R=-w.width/2;break;case"r":R=w.width/2;break}if(R&&(A+=m?R:-R),R=0,A+=(w.dummy?b:y)/2,A+=(C.dummy?b:y)/2,A+=C.width/2,t.has(C,"labelpos"))switch(C.labelpos.toLowerCase()){case"l":R=C.width/2;break;case"r":R=-C.width/2;break}return R&&(A+=m?R:-R),R=0,A}}function p(y,b){return y.node(b).width}return Jc}var jc,nE;function WO(){if(nE)return jc;nE=1;var t=nt(),e=qt(),r=$O().positionX;jc=a;function a(i){i=e.asNonCompoundGraph(i),n(i),t.forEach(r(i),function(o,s){i.node(s).x=o})}function n(i){var o=e.buildLayerMatrix(i),s=i.graph().ranksep,u=0;t.forEach(o,function(l){var f=t.max(t.map(l,function(h){return i.node(h).height}));t.forEach(l,function(h){i.node(h).y=u+f/2}),u+=f+s})}return jc}var ev,iE;function KO(){if(iE)return ev;iE=1;var t=nt(),e=NO(),r=MO(),a=IO(),n=qt().normalizeRanks,i=PO(),o=qt().removeEmptyRanks,s=FO(),u=_O(),l=BO(),f=XO(),h=WO(),v=qt(),c=Qt().Graph;ev=d;function d(k,G){var U=G&&G.debugTiming?v.time:v.notime;U("layout",function(){var W=U(" buildLayoutGraph",function(){return A(k)});U(" runLayout",function(){g(W,U)}),U(" updateInputGraph",function(){p(k,W)})})}function g(k,G){G(" makeSpaceForEdgeLabels",function(){R(k)}),G(" removeSelfEdges",function(){q(k)}),G(" acyclic",function(){e.run(k)}),G(" nestingGraph.run",function(){s.run(k)}),G(" rank",function(){a(v.asNonCompoundGraph(k))}),G(" injectEdgeLabelProxies",function(){S(k)}),G(" removeEmptyRanks",function(){o(k)}),G(" nestingGraph.cleanup",function(){s.cleanup(k)}),G(" normalizeRanks",function(){n(k)}),G(" assignRankMinMax",function(){D(k)}),G(" removeEdgeLabelProxies",function(){P(k)}),G(" normalize.run",function(){r.run(k)}),G(" parentDummyChains",function(){i(k)}),G(" addBorderSegments",function(){u(k)}),G(" order",function(){f(k)}),G(" insertSelfEdges",function(){_(k)}),G(" adjustCoordinateSystem",function(){l.adjust(k)}),G(" position",function(){h(k)}),G(" positionSelfEdges",function(){B(k)}),G(" removeBorderNodes",function(){O(k)}),G(" normalize.undo",function(){r.undo(k)}),G(" fixupEdgeLabelCoords",function(){M(k)}),G(" undoCoordinateSystem",function(){l.undo(k)}),G(" translateGraph",function(){x(k)}),G(" assignNodeIntersects",function(){N(k)}),G(" reversePoints",function(){I(k)}),G(" acyclic.undo",function(){e.undo(k)})}function p(k,G){t.forEach(k.nodes(),function(U){var W=k.node(U),j=G.node(U);W&&(W.x=j.x,W.y=j.y,G.children(U).length&&(W.width=j.width,W.height=j.height))}),t.forEach(k.edges(),function(U){var W=k.edge(U),j=G.edge(U);W.points=j.points,t.has(j,"x")&&(W.x=j.x,W.y=j.y)}),k.graph().width=G.graph().width,k.graph().height=G.graph().height}var y=["nodesep","edgesep","ranksep","marginx","marginy"],b={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},m=["acyclicer","ranker","rankdir","align"],E=["width","height"],T={width:0,height:0},L=["minlen","weight","width","height","labeloffset"],w={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},C=["labelpos"];function A(k){var G=new c({multigraph:!0,compound:!0}),U=Y(k.graph());return G.setGraph(t.merge({},b,z(U,y),t.pick(U,m))),t.forEach(k.nodes(),function(W){var j=Y(k.node(W));G.setNode(W,t.defaults(z(j,E),T)),G.setParent(W,k.parent(W))}),t.forEach(k.edges(),function(W){var j=Y(k.edge(W));G.setEdge(W,t.merge({},w,z(j,L),t.pick(j,C)))}),G}function R(k){var G=k.graph();G.ranksep/=2,t.forEach(k.edges(),function(U){var W=k.edge(U);W.minlen*=2,W.labelpos.toLowerCase()!=="c"&&(G.rankdir==="TB"||G.rankdir==="BT"?W.width+=W.labeloffset:W.height+=W.labeloffset)})}function S(k){t.forEach(k.edges(),function(G){var U=k.edge(G);if(U.width&&U.height){var W=k.node(G.v),j=k.node(G.w),H={rank:(j.rank-W.rank)/2+W.rank,e:G};v.addDummyNode(k,"edge-proxy",H,"_ep")}})}function D(k){var G=0;t.forEach(k.nodes(),function(U){var W=k.node(U);W.borderTop&&(W.minRank=k.node(W.borderTop).rank,W.maxRank=k.node(W.borderBottom).rank,G=t.max(G,W.maxRank))}),k.graph().maxRank=G}function P(k){t.forEach(k.nodes(),function(G){var U=k.node(G);U.dummy==="edge-proxy"&&(k.edge(U.e).labelRank=U.rank,k.removeNode(G))})}function x(k){var G=Number.POSITIVE_INFINITY,U=0,W=Number.POSITIVE_INFINITY,j=0,H=k.graph(),V=H.marginx||0,X=H.marginy||0;function Z(ee){var re=ee.x,ue=ee.y,xe=ee.width,se=ee.height;G=Math.min(G,re-xe/2),U=Math.max(U,re+xe/2),W=Math.min(W,ue-se/2),j=Math.max(j,ue+se/2)}t.forEach(k.nodes(),function(ee){Z(k.node(ee))}),t.forEach(k.edges(),function(ee){var re=k.edge(ee);t.has(re,"x")&&Z(re)}),G-=V,W-=X,t.forEach(k.nodes(),function(ee){var re=k.node(ee);re.x-=G,re.y-=W}),t.forEach(k.edges(),function(ee){var re=k.edge(ee);t.forEach(re.points,function(ue){ue.x-=G,ue.y-=W}),t.has(re,"x")&&(re.x-=G),t.has(re,"y")&&(re.y-=W)}),H.width=U-G+V,H.height=j-W+X}function N(k){t.forEach(k.edges(),function(G){var U=k.edge(G),W=k.node(G.v),j=k.node(G.w),H,V;U.points?(H=U.points[0],V=U.points[U.points.length-1]):(U.points=[],H=j,V=W),U.points.unshift(v.intersectRect(W,H)),U.points.push(v.intersectRect(j,V))})}function M(k){t.forEach(k.edges(),function(G){var U=k.edge(G);if(t.has(U,"x"))switch((U.labelpos==="l"||U.labelpos==="r")&&(U.width-=U.labeloffset),U.labelpos){case"l":U.x-=U.width/2+U.labeloffset;break;case"r":U.x+=U.width/2+U.labeloffset;break}})}function I(k){t.forEach(k.edges(),function(G){var U=k.edge(G);U.reversed&&U.points.reverse()})}function O(k){t.forEach(k.nodes(),function(G){if(k.children(G).length){var U=k.node(G),W=k.node(U.borderTop),j=k.node(U.borderBottom),H=k.node(t.last(U.borderLeft)),V=k.node(t.last(U.borderRight));U.width=Math.abs(V.x-H.x),U.height=Math.abs(j.y-W.y),U.x=H.x+U.width/2,U.y=W.y+U.height/2}}),t.forEach(k.nodes(),function(G){k.node(G).dummy==="border"&&k.removeNode(G)})}function q(k){t.forEach(k.edges(),function(G){if(G.v===G.w){var U=k.node(G.v);U.selfEdges||(U.selfEdges=[]),U.selfEdges.push({e:G,label:k.edge(G)}),k.removeEdge(G)}})}function _(k){var G=v.buildLayerMatrix(k);t.forEach(G,function(U){var W=0;t.forEach(U,function(j,H){var V=k.node(j);V.order=H+W,t.forEach(V.selfEdges,function(X){v.addDummyNode(k,"selfedge",{width:X.label.width,height:X.label.height,rank:V.rank,order:H+ ++W,e:X.e,label:X.label},"_se")}),delete V.selfEdges})})}function B(k){t.forEach(k.nodes(),function(G){var U=k.node(G);if(U.dummy==="selfedge"){var W=k.node(U.e.v),j=W.x+W.width/2,H=W.y,V=U.x-j,X=W.height/2;k.setEdge(U.e,U.label),k.removeNode(G),U.label.points=[{x:j+2*V/3,y:H-X},{x:j+5*V/6,y:H-X},{x:j+V,y:H},{x:j+5*V/6,y:H+X},{x:j+2*V/3,y:H+X}],U.label.x=U.x,U.label.y=U.y}})}function z(k,G){return t.mapValues(t.pick(k,G),Number)}function Y(k){var G={};return t.forEach(k,function(U,W){G[W.toLowerCase()]=U}),G}return ev}var tv,oE;function ZO(){if(oE)return tv;oE=1;var t=nt(),e=qt(),r=Qt().Graph;tv={debugOrdering:a};function a(n){var i=e.buildLayerMatrix(n),o=new r({compound:!0,multigraph:!0}).setGraph({});return t.forEach(n.nodes(),function(s){o.setNode(s,{label:s}),o.setParent(s,"layer"+n.node(s).rank)}),t.forEach(n.edges(),function(s){o.setEdge(s.v,s.w,{},s.name)}),t.forEach(i,function(s,u){var l="layer"+u;o.setNode(l,{rank:"same"}),t.reduce(s,function(f,h){return o.setEdge(f,h,{style:"invis"}),h})}),o}return tv}var rv,sE;function QO(){return sE||(sE=1,rv="0.8.5"),rv}var av,uE;function JO(){return uE||(uE=1,av={graphlib:Qt(),layout:KO(),debug:ZO(),util:{time:qt().time,notime:qt().notime},version:QO()}),av}var jO=ii.exports,lE;function eI(){return lE||(lE=1,(function(t,e){(function(a,n){t.exports=n(JO())})(jO,function(r){return(function(a){var n={};function i(o){if(n[o])return n[o].exports;var s=n[o]={i:o,l:!1,exports:{}};return a[o].call(s.exports,s,s.exports,i),s.l=!0,s.exports}return i.m=a,i.c=n,i.d=function(o,s,u){i.o(o,s)||Object.defineProperty(o,s,{enumerable:!0,get:u})},i.r=function(o){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(o,"__esModule",{value:!0})},i.t=function(o,s){if(s&1&&(o=i(o)),s&8||s&4&&typeof o=="object"&&o&&o.__esModule)return o;var u=Object.create(null);if(i.r(u),Object.defineProperty(u,"default",{enumerable:!0,value:o}),s&2&&typeof o!="string")for(var l in o)i.d(u,l,(function(f){return o[f]}).bind(null,l));return u},i.n=function(o){var s=o&&o.__esModule?function(){return o.default}:function(){return o};return i.d(s,"a",s),s},i.o=function(o,s){return Object.prototype.hasOwnProperty.call(o,s)},i.p="",i(i.s=0)})([(function(a,n,i){var o=i(1),s=function(l){l&&l("layout","dagre",o)};typeof cytoscape<"u"&&s(cytoscape),a.exports=s}),(function(a,n,i){function o(v){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?o=function(d){return typeof d}:o=function(d){return d&&typeof Symbol=="function"&&d.constructor===Symbol&&d!==Symbol.prototype?"symbol":typeof d},o(v)}var s=function(c){return typeof c=="function"},u=i(2),l=i(3),f=i(4);function h(v){this.options=l({},u,v)}h.prototype.run=function(){var v=this.options,c=this,d=v.cy,g=v.eles,p=function(B,z){return s(z)?z.apply(B,[B]):z},y=v.boundingBox||{x1:0,y1:0,w:d.width(),h:d.height()};y.x2===void 0&&(y.x2=y.x1+y.w),y.w===void 0&&(y.w=y.x2-y.x1),y.y2===void 0&&(y.y2=y.y1+y.h),y.h===void 0&&(y.h=y.y2-y.y1);var b=new f.graphlib.Graph({multigraph:!0,compound:!0}),m={},E=function(B,z){z!=null&&(m[B]=z)};E("nodesep",v.nodeSep),E("edgesep",v.edgeSep),E("ranksep",v.rankSep),E("rankdir",v.rankDir),E("align",v.align),E("ranker",v.ranker),E("acyclicer",v.acyclicer),b.setGraph(m),b.setDefaultEdgeLabel(function(){return{}}),b.setDefaultNodeLabel(function(){return{}});var T=g.nodes();s(v.sort)&&(T=T.sort(v.sort));for(var L=0;L<T.length;L++){var w=T[L],C=w.layoutDimensions(v);b.setNode(w.id(),{width:C.w,height:C.h,name:w.id()})}for(var A=0;A<T.length;A++){var R=T[A];R.isChild()&&b.setParent(R.id(),R.parent().id())}var S=g.edges().stdFilter(function(_){return!_.source().isParent()&&!_.target().isParent()});s(v.sort)&&(S=S.sort(v.sort));for(var D=0;D<S.length;D++){var P=S[D];b.setEdge(P.source().id(),P.target().id(),{minlen:p(P,v.minLen),weight:p(P,v.edgeWeight),name:P.id()},P.id())}f.layout(b);for(var x=b.nodes(),N=0;N<x.length;N++){var M=x[N],I=b.node(M);d.getElementById(M).scratch().dagre=I}var O;v.boundingBox?(O={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0},T.forEach(function(_){var B=_.scratch().dagre;O.x1=Math.min(O.x1,B.x),O.x2=Math.max(O.x2,B.x),O.y1=Math.min(O.y1,B.y),O.y2=Math.max(O.y2,B.y)}),O.w=O.x2-O.x1,O.h=O.y2-O.y1):O=y;var q=function(B){if(v.boundingBox){var z=O.w===0?0:(B.x-O.x1)/O.w,Y=O.h===0?0:(B.y-O.y1)/O.h;return{x:y.x1+z*y.w,y:y.y1+Y*y.h}}else return B};return T.layoutPositions(c,v,function(_){_=o(_)==="object"?_:this;var B=_.scratch().dagre;return q({x:B.x,y:B.y})}),this},a.exports=h}),(function(a,n){var i={nodeSep:void 0,edgeSep:void 0,rankSep:void 0,rankDir:void 0,align:void 0,acyclicer:void 0,ranker:void 0,minLen:function(s){return 1},edgeWeight:function(s){return 1},fit:!0,padding:30,spacingFactor:void 0,nodeDimensionsIncludeLabels:!1,animate:!1,animateFilter:function(s,u){return!0},animationDuration:500,animationEasing:void 0,boundingBox:void 0,transform:function(s,u){return u},ready:function(){},sort:void 0,stop:function(){}};a.exports=i}),(function(a,n){a.exports=Object.assign!=null?Object.assign.bind(Object):function(i){for(var o=arguments.length,s=new Array(o>1?o-1:0),u=1;u<o;u++)s[u-1]=arguments[u];return s.forEach(function(l){Object.keys(l).forEach(function(f){return i[f]=l[f]})}),i}}),(function(a,n){a.exports=r})])})})(ii)),ii.exports}var tI=eI();const mI=Cv(tI);var oi={exports:{}},si={exports:{}},ui={exports:{}},rI=ui.exports,fE;function aI(){return fE||(fE=1,(function(t,e){(function(a,n){t.exports=n()})(rI,function(){return(function(r){var a={};function n(i){if(a[i])return a[i].exports;var o=a[i]={i,l:!1,exports:{}};return r[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=r,n.c=a,n.i=function(i){return i},n.d=function(i,o,s){n.o(i,o)||Object.defineProperty(i,o,{configurable:!1,enumerable:!0,get:s})},n.n=function(i){var o=i&&i.__esModule?function(){return i.default}:function(){return i};return n.d(o,"a",o),o},n.o=function(i,o){return Object.prototype.hasOwnProperty.call(i,o)},n.p="",n(n.s=28)})([(function(r,a,n){function i(){}i.QUALITY=1,i.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,i.DEFAULT_INCREMENTAL=!1,i.DEFAULT_ANIMATION_ON_LAYOUT=!0,i.DEFAULT_ANIMATION_DURING_LAYOUT=!1,i.DEFAULT_ANIMATION_PERIOD=50,i.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,i.DEFAULT_GRAPH_MARGIN=15,i.NODE_DIMENSIONS_INCLUDE_LABELS=!1,i.SIMPLE_NODE_SIZE=40,i.SIMPLE_NODE_HALF_SIZE=i.SIMPLE_NODE_SIZE/2,i.EMPTY_COMPOUND_NODE_SIZE=40,i.MIN_EDGE_LENGTH=1,i.WORLD_BOUNDARY=1e6,i.INITIAL_WORLD_BOUNDARY=i.WORLD_BOUNDARY/1e3,i.WORLD_CENTER_X=1200,i.WORLD_CENTER_Y=900,r.exports=i}),(function(r,a,n){var i=n(2),o=n(8),s=n(9);function u(f,h,v){i.call(this,v),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=v,this.bendpoints=[],this.source=f,this.target=h}u.prototype=Object.create(i.prototype);for(var l in i)u[l]=i[l];u.prototype.getSource=function(){return this.source},u.prototype.getTarget=function(){return this.target},u.prototype.isInterGraph=function(){return this.isInterGraph},u.prototype.getLength=function(){return this.length},u.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},u.prototype.getBendpoints=function(){return this.bendpoints},u.prototype.getLca=function(){return this.lca},u.prototype.getSourceInLca=function(){return this.sourceInLca},u.prototype.getTargetInLca=function(){return this.targetInLca},u.prototype.getOtherEnd=function(f){if(this.source===f)return this.target;if(this.target===f)return this.source;throw"Node is not incident with this edge"},u.prototype.getOtherEndInGraph=function(f,h){for(var v=this.getOtherEnd(f),c=h.getGraphManager().getRoot();;){if(v.getOwner()==h)return v;if(v.getOwner()==c)break;v=v.getOwner().getParent()}return null},u.prototype.updateLength=function(){var f=new Array(4);this.isOverlapingSourceAndTarget=o.getIntersection(this.target.getRect(),this.source.getRect(),f),this.isOverlapingSourceAndTarget||(this.lengthX=f[0]-f[2],this.lengthY=f[1]-f[3],Math.abs(this.lengthX)<1&&(this.lengthX=s.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=s.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},u.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=s.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=s.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},r.exports=u}),(function(r,a,n){function i(o){this.vGraphObject=o}r.exports=i}),(function(r,a,n){var i=n(2),o=n(10),s=n(13),u=n(0),l=n(16),f=n(5);function h(c,d,g,p){g==null&&p==null&&(p=d),i.call(this,p),c.graphManager!=null&&(c=c.graphManager),this.estimatedSize=o.MIN_VALUE,this.inclusionTreeDepth=o.MAX_VALUE,this.vGraphObject=p,this.edges=[],this.graphManager=c,g!=null&&d!=null?this.rect=new s(d.x,d.y,g.width,g.height):this.rect=new s}h.prototype=Object.create(i.prototype);for(var v in i)h[v]=i[v];h.prototype.getEdges=function(){return this.edges},h.prototype.getChild=function(){return this.child},h.prototype.getOwner=function(){return this.owner},h.prototype.getWidth=function(){return this.rect.width},h.prototype.setWidth=function(c){this.rect.width=c},h.prototype.getHeight=function(){return this.rect.height},h.prototype.setHeight=function(c){this.rect.height=c},h.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},h.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},h.prototype.getCenter=function(){return new f(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},h.prototype.getLocation=function(){return new f(this.rect.x,this.rect.y)},h.prototype.getRect=function(){return this.rect},h.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},h.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},h.prototype.setRect=function(c,d){this.rect.x=c.x,this.rect.y=c.y,this.rect.width=d.width,this.rect.height=d.height},h.prototype.setCenter=function(c,d){this.rect.x=c-this.rect.width/2,this.rect.y=d-this.rect.height/2},h.prototype.setLocation=function(c,d){this.rect.x=c,this.rect.y=d},h.prototype.moveBy=function(c,d){this.rect.x+=c,this.rect.y+=d},h.prototype.getEdgeListToNode=function(c){var d=[],g=this;return g.edges.forEach(function(p){if(p.target==c){if(p.source!=g)throw"Incorrect edge source!";d.push(p)}}),d},h.prototype.getEdgesBetween=function(c){var d=[],g=this;return g.edges.forEach(function(p){if(!(p.source==g||p.target==g))throw"Incorrect edge source and/or target";(p.target==c||p.source==c)&&d.push(p)}),d},h.prototype.getNeighborsList=function(){var c=new Set,d=this;return d.edges.forEach(function(g){if(g.source==d)c.add(g.target);else{if(g.target!=d)throw"Incorrect incidency!";c.add(g.source)}}),c},h.prototype.withChildren=function(){var c=new Set,d,g;if(c.add(this),this.child!=null)for(var p=this.child.getNodes(),y=0;y<p.length;y++)d=p[y],g=d.withChildren(),g.forEach(function(b){c.add(b)});return c},h.prototype.getNoOfChildren=function(){var c=0,d;if(this.child==null)c=1;else for(var g=this.child.getNodes(),p=0;p<g.length;p++)d=g[p],c+=d.getNoOfChildren();return c==0&&(c=1),c},h.prototype.getEstimatedSize=function(){if(this.estimatedSize==o.MIN_VALUE)throw"assert failed";return this.estimatedSize},h.prototype.calcEstimatedSize=function(){return this.child==null?this.estimatedSize=(this.rect.width+this.rect.height)/2:(this.estimatedSize=this.child.calcEstimatedSize(),this.rect.width=this.estimatedSize,this.rect.height=this.estimatedSize,this.estimatedSize)},h.prototype.scatter=function(){var c,d,g=-u.INITIAL_WORLD_BOUNDARY,p=u.INITIAL_WORLD_BOUNDARY;c=u.WORLD_CENTER_X+l.nextDouble()*(p-g)+g;var y=-u.INITIAL_WORLD_BOUNDARY,b=u.INITIAL_WORLD_BOUNDARY;d=u.WORLD_CENTER_Y+l.nextDouble()*(b-y)+y,this.rect.x=c,this.rect.y=d},h.prototype.updateBounds=function(){if(this.getChild()==null)throw"assert failed";if(this.getChild().getNodes().length!=0){var c=this.getChild();if(c.updateBounds(!0),this.rect.x=c.getLeft(),this.rect.y=c.getTop(),this.setWidth(c.getRight()-c.getLeft()),this.setHeight(c.getBottom()-c.getTop()),u.NODE_DIMENSIONS_INCLUDE_LABELS){var d=c.getRight()-c.getLeft(),g=c.getBottom()-c.getTop();this.labelWidth&&(this.labelPosHorizontal=="left"?(this.rect.x-=this.labelWidth,this.setWidth(d+this.labelWidth)):this.labelPosHorizontal=="center"&&this.labelWidth>d?(this.rect.x-=(this.labelWidth-d)/2,this.setWidth(this.labelWidth)):this.labelPosHorizontal=="right"&&this.setWidth(d+this.labelWidth)),this.labelHeight&&(this.labelPosVertical=="top"?(this.rect.y-=this.labelHeight,this.setHeight(g+this.labelHeight)):this.labelPosVertical=="center"&&this.labelHeight>g?(this.rect.y-=(this.labelHeight-g)/2,this.setHeight(this.labelHeight)):this.labelPosVertical=="bottom"&&this.setHeight(g+this.labelHeight))}}},h.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==o.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},h.prototype.transform=function(c){var d=this.rect.x;d>u.WORLD_BOUNDARY?d=u.WORLD_BOUNDARY:d<-u.WORLD_BOUNDARY&&(d=-u.WORLD_BOUNDARY);var g=this.rect.y;g>u.WORLD_BOUNDARY?g=u.WORLD_BOUNDARY:g<-u.WORLD_BOUNDARY&&(g=-u.WORLD_BOUNDARY);var p=new f(d,g),y=c.inverseTransformPoint(p);this.setLocation(y.x,y.y)},h.prototype.getLeft=function(){return this.rect.x},h.prototype.getRight=function(){return this.rect.x+this.rect.width},h.prototype.getTop=function(){return this.rect.y},h.prototype.getBottom=function(){return this.rect.y+this.rect.height},h.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},r.exports=h}),(function(r,a,n){var i=n(0);function o(){}for(var s in i)o[s]=i[s];o.MAX_ITERATIONS=2500,o.DEFAULT_EDGE_LENGTH=50,o.DEFAULT_SPRING_STRENGTH=.45,o.DEFAULT_REPULSION_STRENGTH=4500,o.DEFAULT_GRAVITY_STRENGTH=.4,o.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,o.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,o.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,o.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,o.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,o.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,o.COOLING_ADAPTATION_FACTOR=.33,o.ADAPTATION_LOWER_NODE_LIMIT=1e3,o.ADAPTATION_UPPER_NODE_LIMIT=5e3,o.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,o.MAX_NODE_DISPLACEMENT=o.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,o.MIN_REPULSION_DIST=o.DEFAULT_EDGE_LENGTH/10,o.CONVERGENCE_CHECK_PERIOD=100,o.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,o.MIN_EDGE_LENGTH=1,o.GRID_CALCULATION_CHECK_PERIOD=10,r.exports=o}),(function(r,a,n){function i(o,s){o==null&&s==null?(this.x=0,this.y=0):(this.x=o,this.y=s)}i.prototype.getX=function(){return this.x},i.prototype.getY=function(){return this.y},i.prototype.setX=function(o){this.x=o},i.prototype.setY=function(o){this.y=o},i.prototype.getDifference=function(o){return new DimensionD(this.x-o.x,this.y-o.y)},i.prototype.getCopy=function(){return new i(this.x,this.y)},i.prototype.translate=function(o){return this.x+=o.width,this.y+=o.height,this},r.exports=i}),(function(r,a,n){var i=n(2),o=n(10),s=n(0),u=n(7),l=n(3),f=n(1),h=n(13),v=n(12),c=n(11);function d(p,y,b){i.call(this,b),this.estimatedSize=o.MIN_VALUE,this.margin=s.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=p,y!=null&&y instanceof u?this.graphManager=y:y!=null&&y instanceof Layout&&(this.graphManager=y.graphManager)}d.prototype=Object.create(i.prototype);for(var g in i)d[g]=i[g];d.prototype.getNodes=function(){return this.nodes},d.prototype.getEdges=function(){return this.edges},d.prototype.getGraphManager=function(){return this.graphManager},d.prototype.getParent=function(){return this.parent},d.prototype.getLeft=function(){return this.left},d.prototype.getRight=function(){return this.right},d.prototype.getTop=function(){return this.top},d.prototype.getBottom=function(){return this.bottom},d.prototype.isConnected=function(){return this.isConnected},d.prototype.add=function(p,y,b){if(y==null&&b==null){var m=p;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(m)>-1)throw"Node already in graph!";return m.owner=this,this.getNodes().push(m),m}else{var E=p;if(!(this.getNodes().indexOf(y)>-1&&this.getNodes().indexOf(b)>-1))throw"Source or target not in graph!";if(!(y.owner==b.owner&&y.owner==this))throw"Both owners must be this graph!";return y.owner!=b.owner?null:(E.source=y,E.target=b,E.isInterGraph=!1,this.getEdges().push(E),y.edges.push(E),b!=y&&b.edges.push(E),E)}},d.prototype.remove=function(p){var y=p;if(p instanceof l){if(y==null)throw"Node is null!";if(!(y.owner!=null&&y.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var b=y.edges.slice(),m,E=b.length,T=0;T<E;T++)m=b[T],m.isInterGraph?this.graphManager.remove(m):m.source.owner.remove(m);var L=this.nodes.indexOf(y);if(L==-1)throw"Node not in owner node list!";this.nodes.splice(L,1)}else if(p instanceof f){var m=p;if(m==null)throw"Edge is null!";if(!(m.source!=null&&m.target!=null))throw"Source and/or target is null!";if(!(m.source.owner!=null&&m.target.owner!=null&&m.source.owner==this&&m.target.owner==this))throw"Source and/or target owner is invalid!";var w=m.source.edges.indexOf(m),C=m.target.edges.indexOf(m);if(!(w>-1&&C>-1))throw"Source and/or target doesn't know this edge!";m.source.edges.splice(w,1),m.target!=m.source&&m.target.edges.splice(C,1);var L=m.source.owner.getEdges().indexOf(m);if(L==-1)throw"Not in owner's edge list!";m.source.owner.getEdges().splice(L,1)}},d.prototype.updateLeftTop=function(){for(var p=o.MAX_VALUE,y=o.MAX_VALUE,b,m,E,T=this.getNodes(),L=T.length,w=0;w<L;w++){var C=T[w];b=C.getTop(),m=C.getLeft(),p>b&&(p=b),y>m&&(y=m)}return p==o.MAX_VALUE?null:(T[0].getParent().paddingLeft!=null?E=T[0].getParent().paddingLeft:E=this.margin,this.left=y-E,this.top=p-E,new v(this.left,this.top))},d.prototype.updateBounds=function(p){for(var y=o.MAX_VALUE,b=-o.MAX_VALUE,m=o.MAX_VALUE,E=-o.MAX_VALUE,T,L,w,C,A,R=this.nodes,S=R.length,D=0;D<S;D++){var P=R[D];p&&P.child!=null&&P.updateBounds(),T=P.getLeft(),L=P.getRight(),w=P.getTop(),C=P.getBottom(),y>T&&(y=T),b<L&&(b=L),m>w&&(m=w),E<C&&(E=C)}var x=new h(y,m,b-y,E-m);y==o.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),R[0].getParent().paddingLeft!=null?A=R[0].getParent().paddingLeft:A=this.margin,this.left=x.x-A,this.right=x.x+x.width+A,this.top=x.y-A,this.bottom=x.y+x.height+A},d.calculateBounds=function(p){for(var y=o.MAX_VALUE,b=-o.MAX_VALUE,m=o.MAX_VALUE,E=-o.MAX_VALUE,T,L,w,C,A=p.length,R=0;R<A;R++){var S=p[R];T=S.getLeft(),L=S.getRight(),w=S.getTop(),C=S.getBottom(),y>T&&(y=T),b<L&&(b=L),m>w&&(m=w),E<C&&(E=C)}var D=new h(y,m,b-y,E-m);return D},d.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},d.prototype.getEstimatedSize=function(){if(this.estimatedSize==o.MIN_VALUE)throw"assert failed";return this.estimatedSize},d.prototype.calcEstimatedSize=function(){for(var p=0,y=this.nodes,b=y.length,m=0;m<b;m++){var E=y[m];p+=E.calcEstimatedSize()}return p==0?this.estimatedSize=s.EMPTY_COMPOUND_NODE_SIZE:this.estimatedSize=p/Math.sqrt(this.nodes.length),this.estimatedSize},d.prototype.updateConnected=function(){var p=this;if(this.nodes.length==0){this.isConnected=!0;return}var y=new c,b=new Set,m=this.nodes[0],E,T,L=m.withChildren();for(L.forEach(function(D){y.push(D),b.add(D)});y.length!==0;){m=y.shift(),E=m.getEdges();for(var w=E.length,C=0;C<w;C++){var A=E[C];if(T=A.getOtherEndInGraph(m,this),T!=null&&!b.has(T)){var R=T.withChildren();R.forEach(function(D){y.push(D),b.add(D)})}}}if(this.isConnected=!1,b.size>=this.nodes.length){var S=0;b.forEach(function(D){D.owner==p&&S++}),S==this.nodes.length&&(this.isConnected=!0)}},r.exports=d}),(function(r,a,n){var i,o=n(1);function s(u){i=n(6),this.layout=u,this.graphs=[],this.edges=[]}s.prototype.addRoot=function(){var u=this.layout.newGraph(),l=this.layout.newNode(null),f=this.add(u,l);return this.setRootGraph(f),this.rootGraph},s.prototype.add=function(u,l,f,h,v){if(f==null&&h==null&&v==null){if(u==null)throw"Graph is null!";if(l==null)throw"Parent node is null!";if(this.graphs.indexOf(u)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(u),u.parent!=null)throw"Already has a parent!";if(l.child!=null)throw"Already has a child!";return u.parent=l,l.child=u,u}else{v=f,h=l,f=u;var c=h.getOwner(),d=v.getOwner();if(!(c!=null&&c.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(d!=null&&d.getGraphManager()==this))throw"Target not in this graph mgr!";if(c==d)return f.isInterGraph=!1,c.add(f,h,v);if(f.isInterGraph=!0,f.source=h,f.target=v,this.edges.indexOf(f)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(f),!(f.source!=null&&f.target!=null))throw"Edge source and/or target is null!";if(!(f.source.edges.indexOf(f)==-1&&f.target.edges.indexOf(f)==-1))throw"Edge already in source and/or target incidency list!";return f.source.edges.push(f),f.target.edges.push(f),f}},s.prototype.remove=function(u){if(u instanceof i){var l=u;if(l.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(l==this.rootGraph||l.parent!=null&&l.parent.graphManager==this))throw"Invalid parent node!";var f=[];f=f.concat(l.getEdges());for(var h,v=f.length,c=0;c<v;c++)h=f[c],l.remove(h);var d=[];d=d.concat(l.getNodes());var g;v=d.length;for(var c=0;c<v;c++)g=d[c],l.remove(g);l==this.rootGraph&&this.setRootGraph(null);var p=this.graphs.indexOf(l);this.graphs.splice(p,1),l.parent=null}else if(u instanceof o){if(h=u,h==null)throw"Edge is null!";if(!h.isInterGraph)throw"Not an inter-graph edge!";if(!(h.source!=null&&h.target!=null))throw"Source and/or target is null!";if(!(h.source.edges.indexOf(h)!=-1&&h.target.edges.indexOf(h)!=-1))throw"Source and/or target doesn't know this edge!";var p=h.source.edges.indexOf(h);if(h.source.edges.splice(p,1),p=h.target.edges.indexOf(h),h.target.edges.splice(p,1),!(h.source.owner!=null&&h.source.owner.getGraphManager()!=null))throw"Edge owner graph or owner graph manager is null!";if(h.source.owner.getGraphManager().edges.indexOf(h)==-1)throw"Not in owner graph manager's edge list!";var p=h.source.owner.getGraphManager().edges.indexOf(h);h.source.owner.getGraphManager().edges.splice(p,1)}},s.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},s.prototype.getGraphs=function(){return this.graphs},s.prototype.getAllNodes=function(){if(this.allNodes==null){for(var u=[],l=this.getGraphs(),f=l.length,h=0;h<f;h++)u=u.concat(l[h].getNodes());this.allNodes=u}return this.allNodes},s.prototype.resetAllNodes=function(){this.allNodes=null},s.prototype.resetAllEdges=function(){this.allEdges=null},s.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},s.prototype.getAllEdges=function(){if(this.allEdges==null){var u=[],l=this.getGraphs();l.length;for(var f=0;f<l.length;f++)u=u.concat(l[f].getEdges());u=u.concat(this.edges),this.allEdges=u}return this.allEdges},s.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},s.prototype.setAllNodesToApplyGravitation=function(u){if(this.allNodesToApplyGravitation!=null)throw"assert failed";this.allNodesToApplyGravitation=u},s.prototype.getRoot=function(){return this.rootGraph},s.prototype.setRootGraph=function(u){if(u.getGraphManager()!=this)throw"Root not in this graph mgr!";this.rootGraph=u,u.parent==null&&(u.parent=this.layout.newNode("Root node"))},s.prototype.getLayout=function(){return this.layout},s.prototype.isOneAncestorOfOther=function(u,l){if(!(u!=null&&l!=null))throw"assert failed";if(u==l)return!0;var f=u.getOwner(),h;do{if(h=f.getParent(),h==null)break;if(h==l)return!0;if(f=h.getOwner(),f==null)break}while(!0);f=l.getOwner();do{if(h=f.getParent(),h==null)break;if(h==u)return!0;if(f=h.getOwner(),f==null)break}while(!0);return!1},s.prototype.calcLowestCommonAncestors=function(){for(var u,l,f,h,v,c=this.getAllEdges(),d=c.length,g=0;g<d;g++){if(u=c[g],l=u.source,f=u.target,u.lca=null,u.sourceInLca=l,u.targetInLca=f,l==f){u.lca=l.getOwner();continue}for(h=l.getOwner();u.lca==null;){for(u.targetInLca=f,v=f.getOwner();u.lca==null;){if(v==h){u.lca=v;break}if(v==this.rootGraph)break;if(u.lca!=null)throw"assert failed";u.targetInLca=v.getParent(),v=u.targetInLca.getOwner()}if(h==this.rootGraph)break;u.lca==null&&(u.sourceInLca=h.getParent(),h=u.sourceInLca.getOwner())}if(u.lca==null)throw"assert failed"}},s.prototype.calcLowestCommonAncestor=function(u,l){if(u==l)return u.getOwner();var f=u.getOwner();do{if(f==null)break;var h=l.getOwner();do{if(h==null)break;if(h==f)return h;h=h.getParent().getOwner()}while(!0);f=f.getParent().getOwner()}while(!0);return f},s.prototype.calcInclusionTreeDepths=function(u,l){u==null&&l==null&&(u=this.rootGraph,l=1);for(var f,h=u.getNodes(),v=h.length,c=0;c<v;c++)f=h[c],f.inclusionTreeDepth=l,f.child!=null&&this.calcInclusionTreeDepths(f.child,l+1)},s.prototype.includesInvalidEdge=function(){for(var u,l=[],f=this.edges.length,h=0;h<f;h++)u=this.edges[h],this.isOneAncestorOfOther(u.source,u.target)&&l.push(u);for(var h=0;h<l.length;h++)this.remove(l[h]);return!1},r.exports=s}),(function(r,a,n){var i=n(12);function o(){}o.calcSeparationAmount=function(s,u,l,f){if(!s.intersects(u))throw"assert failed";var h=new Array(2);this.decideDirectionsForOverlappingNodes(s,u,h),l[0]=Math.min(s.getRight(),u.getRight())-Math.max(s.x,u.x),l[1]=Math.min(s.getBottom(),u.getBottom())-Math.max(s.y,u.y),s.getX()<=u.getX()&&s.getRight()>=u.getRight()?l[0]+=Math.min(u.getX()-s.getX(),s.getRight()-u.getRight()):u.getX()<=s.getX()&&u.getRight()>=s.getRight()&&(l[0]+=Math.min(s.getX()-u.getX(),u.getRight()-s.getRight())),s.getY()<=u.getY()&&s.getBottom()>=u.getBottom()?l[1]+=Math.min(u.getY()-s.getY(),s.getBottom()-u.getBottom()):u.getY()<=s.getY()&&u.getBottom()>=s.getBottom()&&(l[1]+=Math.min(s.getY()-u.getY(),u.getBottom()-s.getBottom()));var v=Math.abs((u.getCenterY()-s.getCenterY())/(u.getCenterX()-s.getCenterX()));u.getCenterY()===s.getCenterY()&&u.getCenterX()===s.getCenterX()&&(v=1);var c=v*l[0],d=l[1]/v;l[0]<d?d=l[0]:c=l[1],l[0]=-1*h[0]*(d/2+f),l[1]=-1*h[1]*(c/2+f)},o.decideDirectionsForOverlappingNodes=function(s,u,l){s.getCenterX()<u.getCenterX()?l[0]=-1:l[0]=1,s.getCenterY()<u.getCenterY()?l[1]=-1:l[1]=1},o.getIntersection2=function(s,u,l){var f=s.getCenterX(),h=s.getCenterY(),v=u.getCenterX(),c=u.getCenterY();if(s.intersects(u))return l[0]=f,l[1]=h,l[2]=v,l[3]=c,!0;var d=s.getX(),g=s.getY(),p=s.getRight(),y=s.getX(),b=s.getBottom(),m=s.getRight(),E=s.getWidthHalf(),T=s.getHeightHalf(),L=u.getX(),w=u.getY(),C=u.getRight(),A=u.getX(),R=u.getBottom(),S=u.getRight(),D=u.getWidthHalf(),P=u.getHeightHalf(),x=!1,N=!1;if(f===v){if(h>c)return l[0]=f,l[1]=g,l[2]=v,l[3]=R,!1;if(h<c)return l[0]=f,l[1]=b,l[2]=v,l[3]=w,!1}else if(h===c){if(f>v)return l[0]=d,l[1]=h,l[2]=C,l[3]=c,!1;if(f<v)return l[0]=p,l[1]=h,l[2]=L,l[3]=c,!1}else{var M=s.height/s.width,I=u.height/u.width,O=(c-h)/(v-f),q=void 0,_=void 0,B=void 0,z=void 0,Y=void 0,k=void 0;if(-M===O?f>v?(l[0]=y,l[1]=b,x=!0):(l[0]=p,l[1]=g,x=!0):M===O&&(f>v?(l[0]=d,l[1]=g,x=!0):(l[0]=m,l[1]=b,x=!0)),-I===O?v>f?(l[2]=A,l[3]=R,N=!0):(l[2]=C,l[3]=w,N=!0):I===O&&(v>f?(l[2]=L,l[3]=w,N=!0):(l[2]=S,l[3]=R,N=!0)),x&&N)return!1;if(f>v?h>c?(q=this.getCardinalDirection(M,O,4),_=this.getCardinalDirection(I,O,2)):(q=this.getCardinalDirection(-M,O,3),_=this.getCardinalDirection(-I,O,1)):h>c?(q=this.getCardinalDirection(-M,O,1),_=this.getCardinalDirection(-I,O,3)):(q=this.getCardinalDirection(M,O,2),_=this.getCardinalDirection(I,O,4)),!x)switch(q){case 1:z=g,B=f+-T/O,l[0]=B,l[1]=z;break;case 2:B=m,z=h+E*O,l[0]=B,l[1]=z;break;case 3:z=b,B=f+T/O,l[0]=B,l[1]=z;break;case 4:B=y,z=h+-E*O,l[0]=B,l[1]=z;break}if(!N)switch(_){case 1:k=w,Y=v+-P/O,l[2]=Y,l[3]=k;break;case 2:Y=S,k=c+D*O,l[2]=Y,l[3]=k;break;case 3:k=R,Y=v+P/O,l[2]=Y,l[3]=k;break;case 4:Y=A,k=c+-D*O,l[2]=Y,l[3]=k;break}}return!1},o.getCardinalDirection=function(s,u,l){return s>u?l:1+l%4},o.getIntersection=function(s,u,l,f){if(f==null)return this.getIntersection2(s,u,l);var h=s.x,v=s.y,c=u.x,d=u.y,g=l.x,p=l.y,y=f.x,b=f.y,m=void 0,E=void 0,T=void 0,L=void 0,w=void 0,C=void 0,A=void 0,R=void 0,S=void 0;return T=d-v,w=h-c,A=c*v-h*d,L=b-p,C=g-y,R=y*p-g*b,S=T*C-L*w,S===0?null:(m=(w*R-C*A)/S,E=(L*A-T*R)/S,new i(m,E))},o.angleOfVector=function(s,u,l,f){var h=void 0;return s!==l?(h=Math.atan((f-u)/(l-s)),l<s?h+=Math.PI:f<u&&(h+=this.TWO_PI)):f<u?h=this.ONE_AND_HALF_PI:h=this.HALF_PI,h},o.doIntersect=function(s,u,l,f){var h=s.x,v=s.y,c=u.x,d=u.y,g=l.x,p=l.y,y=f.x,b=f.y,m=(c-h)*(b-p)-(y-g)*(d-v);if(m===0)return!1;var E=((b-p)*(y-h)+(g-y)*(b-v))/m,T=((v-d)*(y-h)+(c-h)*(b-v))/m;return 0<E&&E<1&&0<T&&T<1},o.findCircleLineIntersections=function(s,u,l,f,h,v,c){var d=(l-s)*(l-s)+(f-u)*(f-u),g=2*((s-h)*(l-s)+(u-v)*(f-u)),p=(s-h)*(s-h)+(u-v)*(u-v)-c*c,y=g*g-4*d*p;if(y>=0){var b=(-g+Math.sqrt(g*g-4*d*p))/(2*d),m=(-g-Math.sqrt(g*g-4*d*p))/(2*d),E=null;return b>=0&&b<=1?[b]:m>=0&&m<=1?[m]:E}else return null},o.HALF_PI=.5*Math.PI,o.ONE_AND_HALF_PI=1.5*Math.PI,o.TWO_PI=2*Math.PI,o.THREE_PI=3*Math.PI,r.exports=o}),(function(r,a,n){function i(){}i.sign=function(o){return o>0?1:o<0?-1:0},i.floor=function(o){return o<0?Math.ceil(o):Math.floor(o)},i.ceil=function(o){return o<0?Math.floor(o):Math.ceil(o)},r.exports=i}),(function(r,a,n){function i(){}i.MAX_VALUE=2147483647,i.MIN_VALUE=-2147483648,r.exports=i}),(function(r,a,n){var i=(function(){function h(v,c){for(var d=0;d<c.length;d++){var g=c[d];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(v,g.key,g)}}return function(v,c,d){return c&&h(v.prototype,c),d&&h(v,d),v}})();function o(h,v){if(!(h instanceof v))throw new TypeError("Cannot call a class as a function")}var s=function(v){return{value:v,next:null,prev:null}},u=function(v,c,d,g){return v!==null?v.next=c:g.head=c,d!==null?d.prev=c:g.tail=c,c.prev=v,c.next=d,g.length++,c},l=function(v,c){var d=v.prev,g=v.next;return d!==null?d.next=g:c.head=g,g!==null?g.prev=d:c.tail=d,v.prev=v.next=null,c.length--,v},f=(function(){function h(v){var c=this;o(this,h),this.length=0,this.head=null,this.tail=null,v!=null&&v.forEach(function(d){return c.push(d)})}return i(h,[{key:"size",value:function(){return this.length}},{key:"insertBefore",value:function(c,d){return u(d.prev,s(c),d,this)}},{key:"insertAfter",value:function(c,d){return u(d,s(c),d.next,this)}},{key:"insertNodeBefore",value:function(c,d){return u(d.prev,c,d,this)}},{key:"insertNodeAfter",value:function(c,d){return u(d,c,d.next,this)}},{key:"push",value:function(c){return u(this.tail,s(c),null,this)}},{key:"unshift",value:function(c){return u(null,s(c),this.head,this)}},{key:"remove",value:function(c){return l(c,this)}},{key:"pop",value:function(){return l(this.tail,this).value}},{key:"popNode",value:function(){return l(this.tail,this)}},{key:"shift",value:function(){return l(this.head,this).value}},{key:"shiftNode",value:function(){return l(this.head,this)}},{key:"get_object_at",value:function(c){if(c<=this.length()){for(var d=1,g=this.head;d<c;)g=g.next,d++;return g.value}}},{key:"set_object_at",value:function(c,d){if(c<=this.length()){for(var g=1,p=this.head;g<c;)p=p.next,g++;p.value=d}}}]),h})();r.exports=f}),(function(r,a,n){function i(o,s,u){this.x=null,this.y=null,o==null&&s==null&&u==null?(this.x=0,this.y=0):typeof o=="number"&&typeof s=="number"&&u==null?(this.x=o,this.y=s):o.constructor.name=="Point"&&s==null&&u==null&&(u=o,this.x=u.x,this.y=u.y)}i.prototype.getX=function(){return this.x},i.prototype.getY=function(){return this.y},i.prototype.getLocation=function(){return new i(this.x,this.y)},i.prototype.setLocation=function(o,s,u){o.constructor.name=="Point"&&s==null&&u==null?(u=o,this.setLocation(u.x,u.y)):typeof o=="number"&&typeof s=="number"&&u==null&&(parseInt(o)==o&&parseInt(s)==s?this.move(o,s):(this.x=Math.floor(o+.5),this.y=Math.floor(s+.5)))},i.prototype.move=function(o,s){this.x=o,this.y=s},i.prototype.translate=function(o,s){this.x+=o,this.y+=s},i.prototype.equals=function(o){if(o.constructor.name=="Point"){var s=o;return this.x==s.x&&this.y==s.y}return this==o},i.prototype.toString=function(){return new i().constructor.name+"[x="+this.x+",y="+this.y+"]"},r.exports=i}),(function(r,a,n){function i(o,s,u,l){this.x=0,this.y=0,this.width=0,this.height=0,o!=null&&s!=null&&u!=null&&l!=null&&(this.x=o,this.y=s,this.width=u,this.height=l)}i.prototype.getX=function(){return this.x},i.prototype.setX=function(o){this.x=o},i.prototype.getY=function(){return this.y},i.prototype.setY=function(o){this.y=o},i.prototype.getWidth=function(){return this.width},i.prototype.setWidth=function(o){this.width=o},i.prototype.getHeight=function(){return this.height},i.prototype.setHeight=function(o){this.height=o},i.prototype.getRight=function(){return this.x+this.width},i.prototype.getBottom=function(){return this.y+this.height},i.prototype.intersects=function(o){return!(this.getRight()<o.x||this.getBottom()<o.y||o.getRight()<this.x||o.getBottom()<this.y)},i.prototype.getCenterX=function(){return this.x+this.width/2},i.prototype.getMinX=function(){return this.getX()},i.prototype.getMaxX=function(){return this.getX()+this.width},i.prototype.getCenterY=function(){return this.y+this.height/2},i.prototype.getMinY=function(){return this.getY()},i.prototype.getMaxY=function(){return this.getY()+this.height},i.prototype.getWidthHalf=function(){return this.width/2},i.prototype.getHeightHalf=function(){return this.height/2},r.exports=i}),(function(r,a,n){var i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(s){return typeof s}:function(s){return s&&typeof Symbol=="function"&&s.constructor===Symbol&&s!==Symbol.prototype?"symbol":typeof s};function o(){}o.lastID=0,o.createID=function(s){return o.isPrimitive(s)?s:(s.uniqueID!=null||(s.uniqueID=o.getString(),o.lastID++),s.uniqueID)},o.getString=function(s){return s==null&&(s=o.lastID),"Object#"+s},o.isPrimitive=function(s){var u=typeof s>"u"?"undefined":i(s);return s==null||u!="object"&&u!="function"},r.exports=o}),(function(r,a,n){function i(g){if(Array.isArray(g)){for(var p=0,y=Array(g.length);p<g.length;p++)y[p]=g[p];return y}else return Array.from(g)}var o=n(0),s=n(7),u=n(3),l=n(1),f=n(6),h=n(5),v=n(17),c=n(29);function d(g){c.call(this),this.layoutQuality=o.QUALITY,this.createBendsAsNeeded=o.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=o.DEFAULT_INCREMENTAL,this.animationOnLayout=o.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=o.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=o.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=o.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new s(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,g!=null&&(this.isRemoteUse=g)}d.RANDOM_SEED=1,d.prototype=Object.create(c.prototype),d.prototype.getGraphManager=function(){return this.graphManager},d.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},d.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},d.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},d.prototype.newGraphManager=function(){var g=new s(this);return this.graphManager=g,g},d.prototype.newGraph=function(g){return new f(null,this.graphManager,g)},d.prototype.newNode=function(g){return new u(this.graphManager,g)},d.prototype.newEdge=function(g){return new l(null,null,g)},d.prototype.checkLayoutSuccess=function(){return this.graphManager.getRoot()==null||this.graphManager.getRoot().getNodes().length==0||this.graphManager.includesInvalidEdge()},d.prototype.runLayout=function(){this.isLayoutFinished=!1,this.tilingPreLayout&&this.tilingPreLayout(),this.initParameters();var g;return this.checkLayoutSuccess()?g=!1:g=this.layout(),o.ANIMATE==="during"?!1:(g&&(this.isSubLayout||this.doPostLayout()),this.tilingPostLayout&&this.tilingPostLayout(),this.isLayoutFinished=!0,g)},d.prototype.doPostLayout=function(){this.incremental||this.transform(),this.update()},d.prototype.update2=function(){if(this.createBendsAsNeeded&&(this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges()),!this.isRemoteUse){for(var g=this.graphManager.getAllEdges(),p=0;p<g.length;p++)g[p];for(var y=this.graphManager.getRoot().getNodes(),p=0;p<y.length;p++)y[p];this.update(this.graphManager.getRoot())}},d.prototype.update=function(g){if(g==null)this.update2();else if(g instanceof u){var p=g;if(p.getChild()!=null)for(var y=p.getChild().getNodes(),b=0;b<y.length;b++)update(y[b]);if(p.vGraphObject!=null){var m=p.vGraphObject;m.update(p)}}else if(g instanceof l){var E=g;if(E.vGraphObject!=null){var T=E.vGraphObject;T.update(E)}}else if(g instanceof f){var L=g;if(L.vGraphObject!=null){var w=L.vGraphObject;w.update(L)}}},d.prototype.initParameters=function(){this.isSubLayout||(this.layoutQuality=o.QUALITY,this.animationDuringLayout=o.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=o.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=o.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=o.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=o.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=o.DEFAULT_UNIFORM_LEAF_NODE_SIZES),this.animationDuringLayout&&(this.animationOnLayout=!1)},d.prototype.transform=function(g){if(g==null)this.transform(new h(0,0));else{var p=new v,y=this.graphManager.getRoot().updateLeftTop();if(y!=null){p.setWorldOrgX(g.x),p.setWorldOrgY(g.y),p.setDeviceOrgX(y.x),p.setDeviceOrgY(y.y);for(var b=this.getAllNodes(),m,E=0;E<b.length;E++)m=b[E],m.transform(p)}}},d.prototype.positionNodesRandomly=function(g){if(g==null)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else for(var p,y,b=g.getNodes(),m=0;m<b.length;m++)p=b[m],y=p.getChild(),y==null||y.getNodes().length==0?p.scatter():(this.positionNodesRandomly(y),p.updateBounds())},d.prototype.getFlatForest=function(){for(var g=[],p=!0,y=this.graphManager.getRoot().getNodes(),b=!0,m=0;m<y.length;m++)y[m].getChild()!=null&&(b=!1);if(!b)return g;var E=new Set,T=[],L=new Map,w=[];for(w=w.concat(y);w.length>0&&p;){for(T.push(w[0]);T.length>0&&p;){var C=T[0];T.splice(0,1),E.add(C);for(var A=C.getEdges(),m=0;m<A.length;m++){var R=A[m].getOtherEnd(C);if(L.get(C)!=R)if(!E.has(R))T.push(R),L.set(R,C);else{p=!1;break}}}if(!p)g=[];else{var S=[].concat(i(E));g.push(S);for(var m=0;m<S.length;m++){var D=S[m],P=w.indexOf(D);P>-1&&w.splice(P,1)}E=new Set,L=new Map}}return g},d.prototype.createDummyNodesForBendpoints=function(g){for(var p=[],y=g.source,b=this.graphManager.calcLowestCommonAncestor(g.source,g.target),m=0;m<g.bendpoints.length;m++){var E=this.newNode(null);E.setRect(new Point(0,0),new Dimension(1,1)),b.add(E);var T=this.newEdge(null);this.graphManager.add(T,y,E),p.add(E),y=E}var T=this.newEdge(null);return this.graphManager.add(T,y,g.target),this.edgeToDummyNodes.set(g,p),g.isInterGraph()?this.graphManager.remove(g):b.remove(g),p},d.prototype.createBendpointsFromDummyNodes=function(){var g=[];g=g.concat(this.graphManager.getAllEdges()),g=[].concat(i(this.edgeToDummyNodes.keys())).concat(g);for(var p=0;p<g.length;p++){var y=g[p];if(y.bendpoints.length>0){for(var b=this.edgeToDummyNodes.get(y),m=0;m<b.length;m++){var E=b[m],T=new h(E.getCenterX(),E.getCenterY()),L=y.bendpoints.get(m);L.x=T.x,L.y=T.y,E.getOwner().remove(E)}this.graphManager.add(y,y.source,y.target)}}},d.transform=function(g,p,y,b){if(y!=null&&b!=null){var m=p;if(g<=50){var E=p/y;m-=(p-E)/50*(50-g)}else{var T=p*b;m+=(T-p)/50*(g-50)}return m}else{var L,w;return g<=50?(L=9*p/500,w=p/10):(L=9*p/50,w=-8*p),L*g+w}},d.findCenterOfTree=function(g){var p=[];p=p.concat(g);var y=[],b=new Map,m=!1,E=null;(p.length==1||p.length==2)&&(m=!0,E=p[0]);for(var T=0;T<p.length;T++){var L=p[T],w=L.getNeighborsList().size;b.set(L,L.getNeighborsList().size),w==1&&y.push(L)}var C=[];for(C=C.concat(y);!m;){var A=[];A=A.concat(C),C=[];for(var T=0;T<p.length;T++){var L=p[T],R=p.indexOf(L);R>=0&&p.splice(R,1);var S=L.getNeighborsList();S.forEach(function(x){if(y.indexOf(x)<0){var N=b.get(x),M=N-1;M==1&&C.push(x),b.set(x,M)}})}y=y.concat(C),(p.length==1||p.length==2)&&(m=!0,E=p[0])}return E},d.prototype.setGraphManager=function(g){this.graphManager=g},r.exports=d}),(function(r,a,n){function i(){}i.seed=1,i.x=0,i.nextDouble=function(){return i.x=Math.sin(i.seed++)*1e4,i.x-Math.floor(i.x)},r.exports=i}),(function(r,a,n){var i=n(5);function o(s,u){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}o.prototype.getWorldOrgX=function(){return this.lworldOrgX},o.prototype.setWorldOrgX=function(s){this.lworldOrgX=s},o.prototype.getWorldOrgY=function(){return this.lworldOrgY},o.prototype.setWorldOrgY=function(s){this.lworldOrgY=s},o.prototype.getWorldExtX=function(){return this.lworldExtX},o.prototype.setWorldExtX=function(s){this.lworldExtX=s},o.prototype.getWorldExtY=function(){return this.lworldExtY},o.prototype.setWorldExtY=function(s){this.lworldExtY=s},o.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},o.prototype.setDeviceOrgX=function(s){this.ldeviceOrgX=s},o.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},o.prototype.setDeviceOrgY=function(s){this.ldeviceOrgY=s},o.prototype.getDeviceExtX=function(){return this.ldeviceExtX},o.prototype.setDeviceExtX=function(s){this.ldeviceExtX=s},o.prototype.getDeviceExtY=function(){return this.ldeviceExtY},o.prototype.setDeviceExtY=function(s){this.ldeviceExtY=s},o.prototype.transformX=function(s){var u=0,l=this.lworldExtX;return l!=0&&(u=this.ldeviceOrgX+(s-this.lworldOrgX)*this.ldeviceExtX/l),u},o.prototype.transformY=function(s){var u=0,l=this.lworldExtY;return l!=0&&(u=this.ldeviceOrgY+(s-this.lworldOrgY)*this.ldeviceExtY/l),u},o.prototype.inverseTransformX=function(s){var u=0,l=this.ldeviceExtX;return l!=0&&(u=this.lworldOrgX+(s-this.ldeviceOrgX)*this.lworldExtX/l),u},o.prototype.inverseTransformY=function(s){var u=0,l=this.ldeviceExtY;return l!=0&&(u=this.lworldOrgY+(s-this.ldeviceOrgY)*this.lworldExtY/l),u},o.prototype.inverseTransformPoint=function(s){var u=new i(this.inverseTransformX(s.x),this.inverseTransformY(s.y));return u},r.exports=o}),(function(r,a,n){function i(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 o=n(15),s=n(4),u=n(0),l=n(8),f=n(9);function h(){o.call(this),this.useSmartIdealEdgeLengthCalculation=s.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=s.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=s.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=s.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=s.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*s.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=s.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=s.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=s.MAX_ITERATIONS}h.prototype=Object.create(o.prototype);for(var v in o)h[v]=o[v];h.prototype.initParameters=function(){o.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=s.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},h.prototype.calcIdealEdgeLengths=function(){for(var c,d,g,p,y,b,m,E=this.getGraphManager().getAllEdges(),T=0;T<E.length;T++)c=E[T],d=c.idealLength,c.isInterGraph&&(p=c.getSource(),y=c.getTarget(),b=c.getSourceInLca().getEstimatedSize(),m=c.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation&&(c.idealLength+=b+m-2*u.SIMPLE_NODE_SIZE),g=c.getLca().getInclusionTreeDepth(),c.idealLength+=d*s.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(p.getInclusionTreeDepth()+y.getInclusionTreeDepth()-2*g))},h.prototype.initSpringEmbedder=function(){var c=this.getAllNodes().length;this.incremental?(c>s.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*s.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(c-s.ADAPTATION_LOWER_NODE_LIMIT)/(s.ADAPTATION_UPPER_NODE_LIMIT-s.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-s.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=s.MAX_NODE_DISPLACEMENT_INCREMENTAL):(c>s.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(s.COOLING_ADAPTATION_FACTOR,1-(c-s.ADAPTATION_LOWER_NODE_LIMIT)/(s.ADAPTATION_UPPER_NODE_LIMIT-s.ADAPTATION_LOWER_NODE_LIMIT)*(1-s.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=s.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*s.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},h.prototype.calcSpringForces=function(){for(var c=this.getAllEdges(),d,g=0;g<c.length;g++)d=c[g],this.calcSpringForce(d,d.idealLength)},h.prototype.calcRepulsionForces=function(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,g,p,y,b,m=this.getAllNodes(),E;if(this.useFRGridVariant)for(this.totalIterations%s.GRID_CALCULATION_CHECK_PERIOD==1&&c&&this.updateGrid(),E=new Set,g=0;g<m.length;g++)y=m[g],this.calculateRepulsionForceOfANode(y,E,c,d),E.add(y);else for(g=0;g<m.length;g++)for(y=m[g],p=g+1;p<m.length;p++)b=m[p],y.getOwner()==b.getOwner()&&this.calcRepulsionForce(y,b)},h.prototype.calcGravitationalForces=function(){for(var c,d=this.getAllNodesToApplyGravitation(),g=0;g<d.length;g++)c=d[g],this.calcGravitationalForce(c)},h.prototype.moveNodes=function(){for(var c=this.getAllNodes(),d,g=0;g<c.length;g++)d=c[g],d.move()},h.prototype.calcSpringForce=function(c,d){var g=c.getSource(),p=c.getTarget(),y,b,m,E;if(this.uniformLeafNodeSizes&&g.getChild()==null&&p.getChild()==null)c.updateLengthSimple();else if(c.updateLength(),c.isOverlapingSourceAndTarget)return;y=c.getLength(),y!=0&&(b=c.edgeElasticity*(y-d),m=b*(c.lengthX/y),E=b*(c.lengthY/y),g.springForceX+=m,g.springForceY+=E,p.springForceX-=m,p.springForceY-=E)},h.prototype.calcRepulsionForce=function(c,d){var g=c.getRect(),p=d.getRect(),y=new Array(2),b=new Array(4),m,E,T,L,w,C,A;if(g.intersects(p)){l.calcSeparationAmount(g,p,y,s.DEFAULT_EDGE_LENGTH/2),C=2*y[0],A=2*y[1];var R=c.noOfChildren*d.noOfChildren/(c.noOfChildren+d.noOfChildren);c.repulsionForceX-=R*C,c.repulsionForceY-=R*A,d.repulsionForceX+=R*C,d.repulsionForceY+=R*A}else this.uniformLeafNodeSizes&&c.getChild()==null&&d.getChild()==null?(m=p.getCenterX()-g.getCenterX(),E=p.getCenterY()-g.getCenterY()):(l.getIntersection(g,p,b),m=b[2]-b[0],E=b[3]-b[1]),Math.abs(m)<s.MIN_REPULSION_DIST&&(m=f.sign(m)*s.MIN_REPULSION_DIST),Math.abs(E)<s.MIN_REPULSION_DIST&&(E=f.sign(E)*s.MIN_REPULSION_DIST),T=m*m+E*E,L=Math.sqrt(T),w=(c.nodeRepulsion/2+d.nodeRepulsion/2)*c.noOfChildren*d.noOfChildren/T,C=w*m/L,A=w*E/L,c.repulsionForceX-=C,c.repulsionForceY-=A,d.repulsionForceX+=C,d.repulsionForceY+=A},h.prototype.calcGravitationalForce=function(c){var d,g,p,y,b,m,E,T;d=c.getOwner(),g=(d.getRight()+d.getLeft())/2,p=(d.getTop()+d.getBottom())/2,y=c.getCenterX()-g,b=c.getCenterY()-p,m=Math.abs(y)+c.getWidth()/2,E=Math.abs(b)+c.getHeight()/2,c.getOwner()==this.graphManager.getRoot()?(T=d.getEstimatedSize()*this.gravityRangeFactor,(m>T||E>T)&&(c.gravitationForceX=-this.gravityConstant*y,c.gravitationForceY=-this.gravityConstant*b)):(T=d.getEstimatedSize()*this.compoundGravityRangeFactor,(m>T||E>T)&&(c.gravitationForceX=-this.gravityConstant*y*this.compoundGravityConstant,c.gravitationForceY=-this.gravityConstant*b*this.compoundGravityConstant))},h.prototype.isConverged=function(){var c,d=!1;return this.totalIterations>this.maxIterations/3&&(d=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),c=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,c||d},h.prototype.animate=function(){this.animationDuringLayout&&!this.isSubLayout&&(this.notAnimatedIterations==this.animationPeriod?(this.update(),this.notAnimatedIterations=0):this.notAnimatedIterations++)},h.prototype.calcNoOfChildrenForAllNodes=function(){for(var c,d=this.graphManager.getAllNodes(),g=0;g<d.length;g++)c=d[g],c.noOfChildren=c.getNoOfChildren()},h.prototype.calcGrid=function(c){var d=0,g=0;d=parseInt(Math.ceil((c.getRight()-c.getLeft())/this.repulsionRange)),g=parseInt(Math.ceil((c.getBottom()-c.getTop())/this.repulsionRange));for(var p=new Array(d),y=0;y<d;y++)p[y]=new Array(g);for(var y=0;y<d;y++)for(var b=0;b<g;b++)p[y][b]=new Array;return p},h.prototype.addNodeToGrid=function(c,d,g){var p=0,y=0,b=0,m=0;p=parseInt(Math.floor((c.getRect().x-d)/this.repulsionRange)),y=parseInt(Math.floor((c.getRect().width+c.getRect().x-d)/this.repulsionRange)),b=parseInt(Math.floor((c.getRect().y-g)/this.repulsionRange)),m=parseInt(Math.floor((c.getRect().height+c.getRect().y-g)/this.repulsionRange));for(var E=p;E<=y;E++)for(var T=b;T<=m;T++)this.grid[E][T].push(c),c.setGridCoordinates(p,y,b,m)},h.prototype.updateGrid=function(){var c,d,g=this.getAllNodes();for(this.grid=this.calcGrid(this.graphManager.getRoot()),c=0;c<g.length;c++)d=g[c],this.addNodeToGrid(d,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},h.prototype.calculateRepulsionForceOfANode=function(c,d,g,p){if(this.totalIterations%s.GRID_CALCULATION_CHECK_PERIOD==1&&g||p){var y=new Set;c.surrounding=new Array;for(var b,m=this.grid,E=c.startX-1;E<c.finishX+2;E++)for(var T=c.startY-1;T<c.finishY+2;T++)if(!(E<0||T<0||E>=m.length||T>=m[0].length)){for(var L=0;L<m[E][T].length;L++)if(b=m[E][T][L],!(c.getOwner()!=b.getOwner()||c==b)&&!d.has(b)&&!y.has(b)){var w=Math.abs(c.getCenterX()-b.getCenterX())-(c.getWidth()/2+b.getWidth()/2),C=Math.abs(c.getCenterY()-b.getCenterY())-(c.getHeight()/2+b.getHeight()/2);w<=this.repulsionRange&&C<=this.repulsionRange&&y.add(b)}}c.surrounding=[].concat(i(y))}for(E=0;E<c.surrounding.length;E++)this.calcRepulsionForce(c,c.surrounding[E])},h.prototype.calcRepulsionRange=function(){return 0},r.exports=h}),(function(r,a,n){var i=n(1),o=n(4);function s(l,f,h){i.call(this,l,f,h),this.idealLength=o.DEFAULT_EDGE_LENGTH,this.edgeElasticity=o.DEFAULT_SPRING_STRENGTH}s.prototype=Object.create(i.prototype);for(var u in i)s[u]=i[u];r.exports=s}),(function(r,a,n){var i=n(3),o=n(4);function s(l,f,h,v){i.call(this,l,f,h,v),this.nodeRepulsion=o.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=[]}s.prototype=Object.create(i.prototype);for(var u in i)s[u]=i[u];s.prototype.setGridCoordinates=function(l,f,h,v){this.startX=l,this.finishX=f,this.startY=h,this.finishY=v},r.exports=s}),(function(r,a,n){function i(o,s){this.width=0,this.height=0,o!==null&&s!==null&&(this.height=s,this.width=o)}i.prototype.getWidth=function(){return this.width},i.prototype.setWidth=function(o){this.width=o},i.prototype.getHeight=function(){return this.height},i.prototype.setHeight=function(o){this.height=o},r.exports=i}),(function(r,a,n){var i=n(14);function o(){this.map={},this.keys=[]}o.prototype.put=function(s,u){var l=i.createID(s);this.contains(l)||(this.map[l]=u,this.keys.push(s))},o.prototype.contains=function(s){return i.createID(s),this.map[s]!=null},o.prototype.get=function(s){var u=i.createID(s);return this.map[u]},o.prototype.keySet=function(){return this.keys},r.exports=o}),(function(r,a,n){var i=n(14);function o(){this.set={}}o.prototype.add=function(s){var u=i.createID(s);this.contains(u)||(this.set[u]=s)},o.prototype.remove=function(s){delete this.set[i.createID(s)]},o.prototype.clear=function(){this.set={}},o.prototype.contains=function(s){return this.set[i.createID(s)]==s},o.prototype.isEmpty=function(){return this.size()===0},o.prototype.size=function(){return Object.keys(this.set).length},o.prototype.addAllTo=function(s){for(var u=Object.keys(this.set),l=u.length,f=0;f<l;f++)s.push(this.set[u[f]])},o.prototype.size=function(){return Object.keys(this.set).length},o.prototype.addAll=function(s){for(var u=s.length,l=0;l<u;l++){var f=s[l];this.add(f)}},r.exports=o}),(function(r,a,n){function i(){}i.multMat=function(o,s){for(var u=[],l=0;l<o.length;l++){u[l]=[];for(var f=0;f<s[0].length;f++){u[l][f]=0;for(var h=0;h<o[0].length;h++)u[l][f]+=o[l][h]*s[h][f]}}return u},i.transpose=function(o){for(var s=[],u=0;u<o[0].length;u++){s[u]=[];for(var l=0;l<o.length;l++)s[u][l]=o[l][u]}return s},i.multCons=function(o,s){for(var u=[],l=0;l<o.length;l++)u[l]=o[l]*s;return u},i.minusOp=function(o,s){for(var u=[],l=0;l<o.length;l++)u[l]=o[l]-s[l];return u},i.dotProduct=function(o,s){for(var u=0,l=0;l<o.length;l++)u+=o[l]*s[l];return u},i.mag=function(o){return Math.sqrt(this.dotProduct(o,o))},i.normalize=function(o){for(var s=[],u=this.mag(o),l=0;l<o.length;l++)s[l]=o[l]/u;return s},i.multGamma=function(o){for(var s=[],u=0,l=0;l<o.length;l++)u+=o[l];u*=-1/o.length;for(var f=0;f<o.length;f++)s[f]=u+o[f];return s},i.multL=function(o,s,u){for(var l=[],f=[],h=[],v=0;v<s[0].length;v++){for(var c=0,d=0;d<s.length;d++)c+=-.5*s[d][v]*o[d];f[v]=c}for(var g=0;g<u.length;g++){for(var p=0,y=0;y<u.length;y++)p+=u[g][y]*f[y];h[g]=p}for(var b=0;b<s.length;b++){for(var m=0,E=0;E<s[0].length;E++)m+=s[b][E]*h[E];l[b]=m}return l},r.exports=i}),(function(r,a,n){var i=(function(){function l(f,h){for(var v=0;v<h.length;v++){var c=h[v];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(f,c.key,c)}}return function(f,h,v){return h&&l(f.prototype,h),v&&l(f,v),f}})();function o(l,f){if(!(l instanceof f))throw new TypeError("Cannot call a class as a function")}var s=n(11),u=(function(){function l(f,h){o(this,l),(h!==null||h!==void 0)&&(this.compareFunction=this._defaultCompareFunction);var v=void 0;f instanceof s?v=f.size():v=f.length,this._quicksort(f,0,v-1)}return i(l,[{key:"_quicksort",value:function(h,v,c){if(v<c){var d=this._partition(h,v,c);this._quicksort(h,v,d),this._quicksort(h,d+1,c)}}},{key:"_partition",value:function(h,v,c){for(var d=this._get(h,v),g=v,p=c;;){for(;this.compareFunction(d,this._get(h,p));)p--;for(;this.compareFunction(this._get(h,g),d);)g++;if(g<p)this._swap(h,g,p),g++,p--;else return p}}},{key:"_get",value:function(h,v){return h instanceof s?h.get_object_at(v):h[v]}},{key:"_set",value:function(h,v,c){h instanceof s?h.set_object_at(v,c):h[v]=c}},{key:"_swap",value:function(h,v,c){var d=this._get(h,v);this._set(h,v,this._get(h,c)),this._set(h,c,d)}},{key:"_defaultCompareFunction",value:function(h,v){return v>h}}]),l})();r.exports=u}),(function(r,a,n){function i(){}i.svd=function(o){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=o.length,this.n=o[0].length;var s=Math.min(this.m,this.n);this.s=(function(Ne){for(var Pe=[];Ne-- >0;)Pe.push(0);return Pe})(Math.min(this.m+1,this.n)),this.U=(function(Ne){var Pe=function We(Je){if(Je.length==0)return 0;for(var ze=[],Xe=0;Xe<Je[0];Xe++)ze.push(We(Je.slice(1)));return ze};return Pe(Ne)})([this.m,s]),this.V=(function(Ne){var Pe=function We(Je){if(Je.length==0)return 0;for(var ze=[],Xe=0;Xe<Je[0];Xe++)ze.push(We(Je.slice(1)));return ze};return Pe(Ne)})([this.n,this.n]);for(var u=(function(Ne){for(var Pe=[];Ne-- >0;)Pe.push(0);return Pe})(this.n),l=(function(Ne){for(var Pe=[];Ne-- >0;)Pe.push(0);return Pe})(this.m),f=!0,h=Math.min(this.m-1,this.n),v=Math.max(0,Math.min(this.n-2,this.m)),c=0;c<Math.max(h,v);c++){if(c<h){this.s[c]=0;for(var d=c;d<this.m;d++)this.s[c]=i.hypot(this.s[c],o[d][c]);if(this.s[c]!==0){o[c][c]<0&&(this.s[c]=-this.s[c]);for(var g=c;g<this.m;g++)o[g][c]/=this.s[c];o[c][c]+=1}this.s[c]=-this.s[c]}for(var p=c+1;p<this.n;p++){if((function(Ne,Pe){return Ne&&Pe})(c<h,this.s[c]!==0)){for(var y=0,b=c;b<this.m;b++)y+=o[b][c]*o[b][p];y=-y/o[c][c];for(var m=c;m<this.m;m++)o[m][p]+=y*o[m][c]}u[p]=o[c][p]}if((function(Ne,Pe){return Pe})(f,c<h))for(var E=c;E<this.m;E++)this.U[E][c]=o[E][c];if(c<v){u[c]=0;for(var T=c+1;T<this.n;T++)u[c]=i.hypot(u[c],u[T]);if(u[c]!==0){u[c+1]<0&&(u[c]=-u[c]);for(var L=c+1;L<this.n;L++)u[L]/=u[c];u[c+1]+=1}if(u[c]=-u[c],(function(Ne,Pe){return Ne&&Pe})(c+1<this.m,u[c]!==0)){for(var w=c+1;w<this.m;w++)l[w]=0;for(var C=c+1;C<this.n;C++)for(var A=c+1;A<this.m;A++)l[A]+=u[C]*o[A][C];for(var R=c+1;R<this.n;R++)for(var S=-u[R]/u[c+1],D=c+1;D<this.m;D++)o[D][R]+=S*l[D]}for(var P=c+1;P<this.n;P++)this.V[P][c]=u[P]}}var x=Math.min(this.n,this.m+1);h<this.n&&(this.s[h]=o[h][h]),this.m<x&&(this.s[x-1]=0),v+1<x&&(u[v]=o[v][x-1]),u[x-1]=0;{for(var N=h;N<s;N++){for(var M=0;M<this.m;M++)this.U[M][N]=0;this.U[N][N]=1}for(var I=h-1;I>=0;I--)if(this.s[I]!==0){for(var O=I+1;O<s;O++){for(var q=0,_=I;_<this.m;_++)q+=this.U[_][I]*this.U[_][O];q=-q/this.U[I][I];for(var B=I;B<this.m;B++)this.U[B][O]+=q*this.U[B][I]}for(var z=I;z<this.m;z++)this.U[z][I]=-this.U[z][I];this.U[I][I]=1+this.U[I][I];for(var Y=0;Y<I-1;Y++)this.U[Y][I]=0}else{for(var k=0;k<this.m;k++)this.U[k][I]=0;this.U[I][I]=1}}for(var G=this.n-1;G>=0;G--){if((function(Ne,Pe){return Ne&&Pe})(G<v,u[G]!==0))for(var U=G+1;U<s;U++){for(var W=0,j=G+1;j<this.n;j++)W+=this.V[j][G]*this.V[j][U];W=-W/this.V[G+1][G];for(var H=G+1;H<this.n;H++)this.V[H][U]+=W*this.V[H][G]}for(var V=0;V<this.n;V++)this.V[V][G]=0;this.V[G][G]=1}for(var X=x-1,Z=Math.pow(2,-52),ee=Math.pow(2,-966);x>0;){var re=void 0,ue=void 0;for(re=x-2;re>=-1&&re!==-1;re--)if(Math.abs(u[re])<=ee+Z*(Math.abs(this.s[re])+Math.abs(this.s[re+1]))){u[re]=0;break}if(re===x-2)ue=4;else{var xe=void 0;for(xe=x-1;xe>=re&&xe!==re;xe--){var se=(xe!==x?Math.abs(u[xe]):0)+(xe!==re+1?Math.abs(u[xe-1]):0);if(Math.abs(this.s[xe])<=ee+Z*se){this.s[xe]=0;break}}xe===re?ue=3:xe===x-1?ue=1:(ue=2,re=xe)}switch(re++,ue){case 1:{var oe=u[x-2];u[x-2]=0;for(var he=x-2;he>=re;he--){var le=i.hypot(this.s[he],oe),de=this.s[he]/le,pe=oe/le;this.s[he]=le,he!==re&&(oe=-pe*u[he-1],u[he-1]=de*u[he-1]);for(var ce=0;ce<this.n;ce++)le=de*this.V[ce][he]+pe*this.V[ce][x-1],this.V[ce][x-1]=-pe*this.V[ce][he]+de*this.V[ce][x-1],this.V[ce][he]=le}}break;case 2:{var ye=u[re-1];u[re-1]=0;for(var Le=re;Le<x;Le++){var _e=i.hypot(this.s[Le],ye),ke=this.s[Le]/_e,Oe=ye/_e;this.s[Le]=_e,ye=-Oe*u[Le],u[Le]=ke*u[Le];for(var Fe=0;Fe<this.m;Fe++)_e=ke*this.U[Fe][Le]+Oe*this.U[Fe][re-1],this.U[Fe][re-1]=-Oe*this.U[Fe][Le]+ke*this.U[Fe][re-1],this.U[Fe][Le]=_e}}break;case 3:{var Re=Math.max(Math.max(Math.max(Math.max(Math.abs(this.s[x-1]),Math.abs(this.s[x-2])),Math.abs(u[x-2])),Math.abs(this.s[re])),Math.abs(u[re])),we=this.s[x-1]/Re,K=this.s[x-2]/Re,F=u[x-2]/Re,$=this.s[re]/Re,J=u[re]/Re,Q=((K+we)*(K-we)+F*F)/2,te=we*F*(we*F),fe=0;(function(Ne,Pe){return Ne||Pe})(Q!==0,te!==0)&&(fe=Math.sqrt(Q*Q+te),Q<0&&(fe=-fe),fe=te/(Q+fe));for(var ae=($+we)*($-we)+fe,ie=$*J,ne=re;ne<x-1;ne++){var ve=i.hypot(ae,ie),Ce=ae/ve,Ee=ie/ve;ne!==re&&(u[ne-1]=ve),ae=Ce*this.s[ne]+Ee*u[ne],u[ne]=Ce*u[ne]-Ee*this.s[ne],ie=Ee*this.s[ne+1],this.s[ne+1]=Ce*this.s[ne+1];for(var be=0;be<this.n;be++)ve=Ce*this.V[be][ne]+Ee*this.V[be][ne+1],this.V[be][ne+1]=-Ee*this.V[be][ne]+Ce*this.V[be][ne+1],this.V[be][ne]=ve;if(ve=i.hypot(ae,ie),Ce=ae/ve,Ee=ie/ve,this.s[ne]=ve,ae=Ce*u[ne]+Ee*this.s[ne+1],this.s[ne+1]=-Ee*u[ne]+Ce*this.s[ne+1],ie=Ee*u[ne+1],u[ne+1]=Ce*u[ne+1],ne<this.m-1)for(var me=0;me<this.m;me++)ve=Ce*this.U[me][ne]+Ee*this.U[me][ne+1],this.U[me][ne+1]=-Ee*this.U[me][ne]+Ce*this.U[me][ne+1],this.U[me][ne]=ve}u[x-2]=ae}break;case 4:{if(this.s[re]<=0){this.s[re]=this.s[re]<0?-this.s[re]:0;for(var ge=0;ge<=X;ge++)this.V[ge][re]=-this.V[ge][re]}for(;re<X&&!(this.s[re]>=this.s[re+1]);){var Ie=this.s[re];if(this.s[re]=this.s[re+1],this.s[re+1]=Ie,re<this.n-1)for(var Ae=0;Ae<this.n;Ae++)Ie=this.V[Ae][re+1],this.V[Ae][re+1]=this.V[Ae][re],this.V[Ae][re]=Ie;if(re<this.m-1)for(var Se=0;Se<this.m;Se++)Ie=this.U[Se][re+1],this.U[Se][re+1]=this.U[Se][re],this.U[Se][re]=Ie;re++}x--}break}}var Ue={U:this.U,V:this.V,S:this.s};return Ue},i.hypot=function(o,s){var u=void 0;return Math.abs(o)>Math.abs(s)?(u=s/o,u=Math.abs(o)*Math.sqrt(1+u*u)):s!=0?(u=o/s,u=Math.abs(s)*Math.sqrt(1+u*u)):u=0,u},r.exports=i}),(function(r,a,n){var i=(function(){function u(l,f){for(var h=0;h<f.length;h++){var v=f[h];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(l,v.key,v)}}return function(l,f,h){return f&&u(l.prototype,f),h&&u(l,h),l}})();function o(u,l){if(!(u instanceof l))throw new TypeError("Cannot call a class as a function")}var s=(function(){function u(l,f){var h=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,v=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,c=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;o(this,u),this.sequence1=l,this.sequence2=f,this.match_score=h,this.mismatch_penalty=v,this.gap_penalty=c,this.iMax=l.length+1,this.jMax=f.length+1,this.grid=new Array(this.iMax);for(var d=0;d<this.iMax;d++){this.grid[d]=new Array(this.jMax);for(var g=0;g<this.jMax;g++)this.grid[d][g]=0}this.tracebackGrid=new Array(this.iMax);for(var p=0;p<this.iMax;p++){this.tracebackGrid[p]=new Array(this.jMax);for(var y=0;y<this.jMax;y++)this.tracebackGrid[p][y]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return i(u,[{key:"getScore",value:function(){return this.score}},{key:"getAlignments",value:function(){return this.alignments}},{key:"computeGrids",value:function(){for(var f=1;f<this.jMax;f++)this.grid[0][f]=this.grid[0][f-1]+this.gap_penalty,this.tracebackGrid[0][f]=[!1,!1,!0];for(var h=1;h<this.iMax;h++)this.grid[h][0]=this.grid[h-1][0]+this.gap_penalty,this.tracebackGrid[h][0]=[!1,!0,!1];for(var v=1;v<this.iMax;v++)for(var c=1;c<this.jMax;c++){var d=void 0;this.sequence1[v-1]===this.sequence2[c-1]?d=this.grid[v-1][c-1]+this.match_score:d=this.grid[v-1][c-1]+this.mismatch_penalty;var g=this.grid[v-1][c]+this.gap_penalty,p=this.grid[v][c-1]+this.gap_penalty,y=[d,g,p],b=this.arrayAllMaxIndexes(y);this.grid[v][c]=y[b[0]],this.tracebackGrid[v][c]=[b.includes(0),b.includes(1),b.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]}},{key:"alignmentTraceback",value:function(){var f=[];for(f.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});f[0];){var h=f[0],v=this.tracebackGrid[h.pos[0]][h.pos[1]];v[0]&&f.push({pos:[h.pos[0]-1,h.pos[1]-1],seq1:this.sequence1[h.pos[0]-1]+h.seq1,seq2:this.sequence2[h.pos[1]-1]+h.seq2}),v[1]&&f.push({pos:[h.pos[0]-1,h.pos[1]],seq1:this.sequence1[h.pos[0]-1]+h.seq1,seq2:"-"+h.seq2}),v[2]&&f.push({pos:[h.pos[0],h.pos[1]-1],seq1:"-"+h.seq1,seq2:this.sequence2[h.pos[1]-1]+h.seq2}),h.pos[0]===0&&h.pos[1]===0&&this.alignments.push({sequence1:h.seq1,sequence2:h.seq2}),f.shift()}return this.alignments}},{key:"getAllIndexes",value:function(f,h){for(var v=[],c=-1;(c=f.indexOf(h,c+1))!==-1;)v.push(c);return v}},{key:"arrayAllMaxIndexes",value:function(f){return this.getAllIndexes(f,Math.max.apply(null,f))}}]),u})();r.exports=s}),(function(r,a,n){var i=function(){};i.FDLayout=n(18),i.FDLayoutConstants=n(4),i.FDLayoutEdge=n(19),i.FDLayoutNode=n(20),i.DimensionD=n(21),i.HashMap=n(22),i.HashSet=n(23),i.IGeometry=n(8),i.IMath=n(9),i.Integer=n(10),i.Point=n(12),i.PointD=n(5),i.RandomSeed=n(16),i.RectangleD=n(13),i.Transform=n(17),i.UniqueIDGeneretor=n(14),i.Quicksort=n(25),i.LinkedList=n(11),i.LGraphObject=n(2),i.LGraph=n(6),i.LEdge=n(1),i.LGraphManager=n(7),i.LNode=n(3),i.Layout=n(15),i.LayoutConstants=n(0),i.NeedlemanWunsch=n(27),i.Matrix=n(24),i.SVD=n(26),r.exports=i}),(function(r,a,n){function i(){this.listeners=[]}var o=i.prototype;o.addListener=function(s,u){this.listeners.push({event:s,callback:u})},o.removeListener=function(s,u){for(var l=this.listeners.length;l>=0;l--){var f=this.listeners[l];f.event===s&&f.callback===u&&this.listeners.splice(l,1)}},o.emit=function(s,u){for(var l=0;l<this.listeners.length;l++){var f=this.listeners[l];s===f.event&&f.callback(u)}},r.exports=i})])})})(ui)),ui.exports}var nI=si.exports,hE;function iI(){return hE||(hE=1,(function(t,e){(function(a,n){t.exports=n(aI())})(nI,function(r){return(()=>{var a={45:((s,u,l)=>{var f={};f.layoutBase=l(551),f.CoSEConstants=l(806),f.CoSEEdge=l(767),f.CoSEGraph=l(880),f.CoSEGraphManager=l(578),f.CoSELayout=l(765),f.CoSENode=l(991),f.ConstraintHandler=l(902),s.exports=f}),806:((s,u,l)=>{var f=l(551).FDLayoutConstants;function h(){}for(var v in f)h[v]=f[v];h.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,h.DEFAULT_RADIAL_SEPARATION=f.DEFAULT_EDGE_LENGTH,h.DEFAULT_COMPONENT_SEPERATION=60,h.TILE=!0,h.TILING_PADDING_VERTICAL=10,h.TILING_PADDING_HORIZONTAL=10,h.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,h.ENFORCE_CONSTRAINTS=!0,h.APPLY_LAYOUT=!0,h.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,h.TREE_REDUCTION_ON_INCREMENTAL=!0,h.PURE_INCREMENTAL=h.DEFAULT_INCREMENTAL,s.exports=h}),767:((s,u,l)=>{var f=l(551).FDLayoutEdge;function h(c,d,g){f.call(this,c,d,g)}h.prototype=Object.create(f.prototype);for(var v in f)h[v]=f[v];s.exports=h}),880:((s,u,l)=>{var f=l(551).LGraph;function h(c,d,g){f.call(this,c,d,g)}h.prototype=Object.create(f.prototype);for(var v in f)h[v]=f[v];s.exports=h}),578:((s,u,l)=>{var f=l(551).LGraphManager;function h(c){f.call(this,c)}h.prototype=Object.create(f.prototype);for(var v in f)h[v]=f[v];s.exports=h}),765:((s,u,l)=>{var f=l(551).FDLayout,h=l(578),v=l(880),c=l(991),d=l(767),g=l(806),p=l(902),y=l(551).FDLayoutConstants,b=l(551).LayoutConstants,m=l(551).Point,E=l(551).PointD,T=l(551).DimensionD,L=l(551).Layout,w=l(551).Integer,C=l(551).IGeometry,A=l(551).LGraph,R=l(551).Transform,S=l(551).LinkedList;function D(){f.call(this),this.toBeTiled={},this.constraints={}}D.prototype=Object.create(f.prototype);for(var P in f)D[P]=f[P];D.prototype.newGraphManager=function(){var x=new h(this);return this.graphManager=x,x},D.prototype.newGraph=function(x){return new v(null,this.graphManager,x)},D.prototype.newNode=function(x){return new c(this.graphManager,x)},D.prototype.newEdge=function(x){return new d(null,null,x)},D.prototype.initParameters=function(){f.prototype.initParameters.call(this,arguments),this.isSubLayout||(g.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=g.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=g.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=y.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=y.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=y.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=y.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},D.prototype.initSpringEmbedder=function(){f.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/y.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},D.prototype.layout=function(){var x=b.DEFAULT_CREATE_BENDS_AS_NEEDED;return x&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},D.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental){if(g.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var N=new Set(this.getAllNodes()),M=this.nodesWithGravity.filter(function(q){return N.has(q)});this.graphManager.setAllNodesToApplyGravitation(M)}}else{var x=this.getFlatForest();if(x.length>0)this.positionNodesRadially(x);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var N=new Set(this.getAllNodes()),M=this.nodesWithGravity.filter(function(I){return N.has(I)});this.graphManager.setAllNodesToApplyGravitation(M),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(p.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),g.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},D.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%y.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var x=new Set(this.getAllNodes()),N=this.nodesWithGravity.filter(function(O){return x.has(O)});this.graphManager.setAllNodesToApplyGravitation(N),this.graphManager.updateBounds(),this.updateGrid(),g.PURE_INCREMENTAL?this.coolingFactor=y.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=y.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),g.PURE_INCREMENTAL?this.coolingFactor=y.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=y.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var M=!this.isTreeGrowing&&!this.isGrowthFinished,I=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(M,I),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},D.prototype.getPositionsData=function(){for(var x=this.graphManager.getAllNodes(),N={},M=0;M<x.length;M++){var I=x[M].rect,O=x[M].id;N[O]={id:O,x:I.getCenterX(),y:I.getCenterY(),w:I.width,h:I.height}}return N},D.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var x=!1;if(y.ANIMATE==="during")this.emit("layoutstarted");else{for(;!x;)x=this.tick();this.graphManager.updateBounds()}},D.prototype.moveNodes=function(){for(var x=this.getAllNodes(),N,M=0;M<x.length;M++)N=x[M],N.calculateDisplacement();Object.keys(this.constraints).length>0&&this.updateDisplacements();for(var M=0;M<x.length;M++)N=x[M],N.move()},D.prototype.initConstraintVariables=function(){var x=this;this.idToNodeMap=new Map,this.fixedNodeSet=new Set;for(var N=this.graphManager.getAllNodes(),M=0;M<N.length;M++){var I=N[M];this.idToNodeMap.set(I.id,I)}var O=function H(V){for(var X=V.getChild().getNodes(),Z,ee=0,re=0;re<X.length;re++)Z=X[re],Z.getChild()==null?x.fixedNodeSet.has(Z.id)&&(ee+=100):ee+=H(Z);return ee};if(this.constraints.fixedNodeConstraint){this.constraints.fixedNodeConstraint.forEach(function(X){x.fixedNodeSet.add(X.nodeId)});for(var N=this.graphManager.getAllNodes(),I,M=0;M<N.length;M++)if(I=N[M],I.getChild()!=null){var q=O(I);q>0&&(I.fixedNodeWeight=q)}}if(this.constraints.relativePlacementConstraint){var _=new Map,B=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(H){x.fixedNodesOnHorizontal.add(H),x.fixedNodesOnVertical.add(H)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var z=this.constraints.alignmentConstraint.vertical,M=0;M<z.length;M++)this.dummyToNodeForVerticalAlignment.set("dummy"+M,[]),z[M].forEach(function(V){_.set(V,"dummy"+M),x.dummyToNodeForVerticalAlignment.get("dummy"+M).push(V),x.fixedNodeSet.has(V)&&x.fixedNodesOnHorizontal.add("dummy"+M)});if(this.constraints.alignmentConstraint.horizontal)for(var Y=this.constraints.alignmentConstraint.horizontal,M=0;M<Y.length;M++)this.dummyToNodeForHorizontalAlignment.set("dummy"+M,[]),Y[M].forEach(function(V){B.set(V,"dummy"+M),x.dummyToNodeForHorizontalAlignment.get("dummy"+M).push(V),x.fixedNodeSet.has(V)&&x.fixedNodesOnVertical.add("dummy"+M)})}if(g.RELAX_MOVEMENT_ON_CONSTRAINTS)this.shuffle=function(H){var V,X,Z;for(Z=H.length-1;Z>=2*H.length/3;Z--)V=Math.floor(Math.random()*(Z+1)),X=H[Z],H[Z]=H[V],H[V]=X;return H},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(H){if(H.left){var V=_.has(H.left)?_.get(H.left):H.left,X=_.has(H.right)?_.get(H.right):H.right;x.nodesInRelativeHorizontal.includes(V)||(x.nodesInRelativeHorizontal.push(V),x.nodeToRelativeConstraintMapHorizontal.set(V,[]),x.dummyToNodeForVerticalAlignment.has(V)?x.nodeToTempPositionMapHorizontal.set(V,x.idToNodeMap.get(x.dummyToNodeForVerticalAlignment.get(V)[0]).getCenterX()):x.nodeToTempPositionMapHorizontal.set(V,x.idToNodeMap.get(V).getCenterX())),x.nodesInRelativeHorizontal.includes(X)||(x.nodesInRelativeHorizontal.push(X),x.nodeToRelativeConstraintMapHorizontal.set(X,[]),x.dummyToNodeForVerticalAlignment.has(X)?x.nodeToTempPositionMapHorizontal.set(X,x.idToNodeMap.get(x.dummyToNodeForVerticalAlignment.get(X)[0]).getCenterX()):x.nodeToTempPositionMapHorizontal.set(X,x.idToNodeMap.get(X).getCenterX())),x.nodeToRelativeConstraintMapHorizontal.get(V).push({right:X,gap:H.gap}),x.nodeToRelativeConstraintMapHorizontal.get(X).push({left:V,gap:H.gap})}else{var Z=B.has(H.top)?B.get(H.top):H.top,ee=B.has(H.bottom)?B.get(H.bottom):H.bottom;x.nodesInRelativeVertical.includes(Z)||(x.nodesInRelativeVertical.push(Z),x.nodeToRelativeConstraintMapVertical.set(Z,[]),x.dummyToNodeForHorizontalAlignment.has(Z)?x.nodeToTempPositionMapVertical.set(Z,x.idToNodeMap.get(x.dummyToNodeForHorizontalAlignment.get(Z)[0]).getCenterY()):x.nodeToTempPositionMapVertical.set(Z,x.idToNodeMap.get(Z).getCenterY())),x.nodesInRelativeVertical.includes(ee)||(x.nodesInRelativeVertical.push(ee),x.nodeToRelativeConstraintMapVertical.set(ee,[]),x.dummyToNodeForHorizontalAlignment.has(ee)?x.nodeToTempPositionMapVertical.set(ee,x.idToNodeMap.get(x.dummyToNodeForHorizontalAlignment.get(ee)[0]).getCenterY()):x.nodeToTempPositionMapVertical.set(ee,x.idToNodeMap.get(ee).getCenterY())),x.nodeToRelativeConstraintMapVertical.get(Z).push({bottom:ee,gap:H.gap}),x.nodeToRelativeConstraintMapVertical.get(ee).push({top:Z,gap:H.gap})}});else{var k=new Map,G=new Map;this.constraints.relativePlacementConstraint.forEach(function(H){if(H.left){var V=_.has(H.left)?_.get(H.left):H.left,X=_.has(H.right)?_.get(H.right):H.right;k.has(V)?k.get(V).push(X):k.set(V,[X]),k.has(X)?k.get(X).push(V):k.set(X,[V])}else{var Z=B.has(H.top)?B.get(H.top):H.top,ee=B.has(H.bottom)?B.get(H.bottom):H.bottom;G.has(Z)?G.get(Z).push(ee):G.set(Z,[ee]),G.has(ee)?G.get(ee).push(Z):G.set(ee,[Z])}});var U=function(V,X){var Z=[],ee=[],re=new S,ue=new Set,xe=0;return V.forEach(function(se,oe){if(!ue.has(oe)){Z[xe]=[],ee[xe]=!1;var he=oe;for(re.push(he),ue.add(he),Z[xe].push(he);re.length!=0;){he=re.shift(),X.has(he)&&(ee[xe]=!0);var le=V.get(he);le.forEach(function(de){ue.has(de)||(re.push(de),ue.add(de),Z[xe].push(de))})}xe++}}),{components:Z,isFixed:ee}},W=U(k,x.fixedNodesOnHorizontal);this.componentsOnHorizontal=W.components,this.fixedComponentsOnHorizontal=W.isFixed;var j=U(G,x.fixedNodesOnVertical);this.componentsOnVertical=j.components,this.fixedComponentsOnVertical=j.isFixed}}},D.prototype.updateDisplacements=function(){var x=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function(j){var H=x.idToNodeMap.get(j.nodeId);H.displacementX=0,H.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var N=this.constraints.alignmentConstraint.vertical,M=0;M<N.length;M++){for(var I=0,O=0;O<N[M].length;O++){if(this.fixedNodeSet.has(N[M][O])){I=0;break}I+=this.idToNodeMap.get(N[M][O]).displacementX}for(var q=I/N[M].length,O=0;O<N[M].length;O++)this.idToNodeMap.get(N[M][O]).displacementX=q}if(this.constraints.alignmentConstraint.horizontal)for(var _=this.constraints.alignmentConstraint.horizontal,M=0;M<_.length;M++){for(var B=0,O=0;O<_[M].length;O++){if(this.fixedNodeSet.has(_[M][O])){B=0;break}B+=this.idToNodeMap.get(_[M][O]).displacementY}for(var z=B/_[M].length,O=0;O<_[M].length;O++)this.idToNodeMap.get(_[M][O]).displacementY=z}}if(this.constraints.relativePlacementConstraint)if(g.RELAX_MOVEMENT_ON_CONSTRAINTS)this.totalIterations%10==0&&(this.shuffle(this.nodesInRelativeHorizontal),this.shuffle(this.nodesInRelativeVertical)),this.nodesInRelativeHorizontal.forEach(function(j){if(!x.fixedNodesOnHorizontal.has(j)){var H=0;x.dummyToNodeForVerticalAlignment.has(j)?H=x.idToNodeMap.get(x.dummyToNodeForVerticalAlignment.get(j)[0]).displacementX:H=x.idToNodeMap.get(j).displacementX,x.nodeToRelativeConstraintMapHorizontal.get(j).forEach(function(V){if(V.right){var X=x.nodeToTempPositionMapHorizontal.get(V.right)-x.nodeToTempPositionMapHorizontal.get(j)-H;X<V.gap&&(H-=V.gap-X)}else{var X=x.nodeToTempPositionMapHorizontal.get(j)-x.nodeToTempPositionMapHorizontal.get(V.left)+H;X<V.gap&&(H+=V.gap-X)}}),x.nodeToTempPositionMapHorizontal.set(j,x.nodeToTempPositionMapHorizontal.get(j)+H),x.dummyToNodeForVerticalAlignment.has(j)?x.dummyToNodeForVerticalAlignment.get(j).forEach(function(V){x.idToNodeMap.get(V).displacementX=H}):x.idToNodeMap.get(j).displacementX=H}}),this.nodesInRelativeVertical.forEach(function(j){if(!x.fixedNodesOnHorizontal.has(j)){var H=0;x.dummyToNodeForHorizontalAlignment.has(j)?H=x.idToNodeMap.get(x.dummyToNodeForHorizontalAlignment.get(j)[0]).displacementY:H=x.idToNodeMap.get(j).displacementY,x.nodeToRelativeConstraintMapVertical.get(j).forEach(function(V){if(V.bottom){var X=x.nodeToTempPositionMapVertical.get(V.bottom)-x.nodeToTempPositionMapVertical.get(j)-H;X<V.gap&&(H-=V.gap-X)}else{var X=x.nodeToTempPositionMapVertical.get(j)-x.nodeToTempPositionMapVertical.get(V.top)+H;X<V.gap&&(H+=V.gap-X)}}),x.nodeToTempPositionMapVertical.set(j,x.nodeToTempPositionMapVertical.get(j)+H),x.dummyToNodeForHorizontalAlignment.has(j)?x.dummyToNodeForHorizontalAlignment.get(j).forEach(function(V){x.idToNodeMap.get(V).displacementY=H}):x.idToNodeMap.get(j).displacementY=H}});else{for(var M=0;M<this.componentsOnHorizontal.length;M++){var Y=this.componentsOnHorizontal[M];if(this.fixedComponentsOnHorizontal[M])for(var O=0;O<Y.length;O++)this.dummyToNodeForVerticalAlignment.has(Y[O])?this.dummyToNodeForVerticalAlignment.get(Y[O]).forEach(function(V){x.idToNodeMap.get(V).displacementX=0}):this.idToNodeMap.get(Y[O]).displacementX=0;else{for(var k=0,G=0,O=0;O<Y.length;O++)if(this.dummyToNodeForVerticalAlignment.has(Y[O])){var U=this.dummyToNodeForVerticalAlignment.get(Y[O]);k+=U.length*this.idToNodeMap.get(U[0]).displacementX,G+=U.length}else k+=this.idToNodeMap.get(Y[O]).displacementX,G++;for(var W=k/G,O=0;O<Y.length;O++)this.dummyToNodeForVerticalAlignment.has(Y[O])?this.dummyToNodeForVerticalAlignment.get(Y[O]).forEach(function(V){x.idToNodeMap.get(V).displacementX=W}):this.idToNodeMap.get(Y[O]).displacementX=W}}for(var M=0;M<this.componentsOnVertical.length;M++){var Y=this.componentsOnVertical[M];if(this.fixedComponentsOnVertical[M])for(var O=0;O<Y.length;O++)this.dummyToNodeForHorizontalAlignment.has(Y[O])?this.dummyToNodeForHorizontalAlignment.get(Y[O]).forEach(function(X){x.idToNodeMap.get(X).displacementY=0}):this.idToNodeMap.get(Y[O]).displacementY=0;else{for(var k=0,G=0,O=0;O<Y.length;O++)if(this.dummyToNodeForHorizontalAlignment.has(Y[O])){var U=this.dummyToNodeForHorizontalAlignment.get(Y[O]);k+=U.length*this.idToNodeMap.get(U[0]).displacementY,G+=U.length}else k+=this.idToNodeMap.get(Y[O]).displacementY,G++;for(var W=k/G,O=0;O<Y.length;O++)this.dummyToNodeForHorizontalAlignment.has(Y[O])?this.dummyToNodeForHorizontalAlignment.get(Y[O]).forEach(function(re){x.idToNodeMap.get(re).displacementY=W}):this.idToNodeMap.get(Y[O]).displacementY=W}}}},D.prototype.calculateNodesToApplyGravitationTo=function(){var x=[],N,M=this.graphManager.getGraphs(),I=M.length,O;for(O=0;O<I;O++)N=M[O],N.updateConnected(),N.isConnected||(x=x.concat(N.getNodes()));return x},D.prototype.createBendpoints=function(){var x=[];x=x.concat(this.graphManager.getAllEdges());var N=new Set,M;for(M=0;M<x.length;M++){var I=x[M];if(!N.has(I)){var O=I.getSource(),q=I.getTarget();if(O==q)I.getBendpoints().push(new E),I.getBendpoints().push(new E),this.createDummyNodesForBendpoints(I),N.add(I);else{var _=[];if(_=_.concat(O.getEdgeListToNode(q)),_=_.concat(q.getEdgeListToNode(O)),!N.has(_[0])){if(_.length>1){var B;for(B=0;B<_.length;B++){var z=_[B];z.getBendpoints().push(new E),this.createDummyNodesForBendpoints(z)}}_.forEach(function(Y){N.add(Y)})}}}if(N.size==x.length)break}},D.prototype.positionNodesRadially=function(x){for(var N=new m(0,0),M=Math.ceil(Math.sqrt(x.length)),I=0,O=0,q=0,_=new E(0,0),B=0;B<x.length;B++){B%M==0&&(q=0,O=I,B!=0&&(O+=g.DEFAULT_COMPONENT_SEPERATION),I=0);var z=x[B],Y=L.findCenterOfTree(z);N.x=q,N.y=O,_=D.radialLayout(z,Y,N),_.y>I&&(I=Math.floor(_.y)),q=Math.floor(_.x+g.DEFAULT_COMPONENT_SEPERATION)}this.transform(new E(b.WORLD_CENTER_X-_.x/2,b.WORLD_CENTER_Y-_.y/2))},D.radialLayout=function(x,N,M){var I=Math.max(this.maxDiagonalInTree(x),g.DEFAULT_RADIAL_SEPARATION);D.branchRadialLayout(N,null,0,359,0,I);var O=A.calculateBounds(x),q=new R;q.setDeviceOrgX(O.getMinX()),q.setDeviceOrgY(O.getMinY()),q.setWorldOrgX(M.x),q.setWorldOrgY(M.y);for(var _=0;_<x.length;_++){var B=x[_];B.transform(q)}var z=new E(O.getMaxX(),O.getMaxY());return q.inverseTransformPoint(z)},D.branchRadialLayout=function(x,N,M,I,O,q){var _=(I-M+1)/2;_<0&&(_+=180);var B=(_+M)%360,z=B*C.TWO_PI/360,Y=O*Math.cos(z),k=O*Math.sin(z);x.setCenter(Y,k);var G=[];G=G.concat(x.getEdges());var U=G.length;N!=null&&U--;for(var W=0,j=G.length,H,V=x.getEdgesBetween(N);V.length>1;){var X=V[0];V.splice(0,1);var Z=G.indexOf(X);Z>=0&&G.splice(Z,1),j--,U--}N!=null?H=(G.indexOf(V[0])+1)%j:H=0;for(var ee=Math.abs(I-M)/U,re=H;W!=U;re=++re%j){var ue=G[re].getOtherEnd(x);if(ue!=N){var xe=(M+W*ee)%360,se=(xe+ee)%360;D.branchRadialLayout(ue,x,xe,se,O+q,q),W++}}},D.maxDiagonalInTree=function(x){for(var N=w.MIN_VALUE,M=0;M<x.length;M++){var I=x[M],O=I.getDiagonal();O>N&&(N=O)}return N},D.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},D.prototype.groupZeroDegreeMembers=function(){var x=this,N={};this.memberGroups={},this.idToDummyNode={};for(var M=[],I=this.graphManager.getAllNodes(),O=0;O<I.length;O++){var q=I[O],_=q.getParent();this.getNodeDegreeWithChildren(q)===0&&(_.id==null||!this.getToBeTiled(_))&&M.push(q)}for(var O=0;O<M.length;O++){var q=M[O],B=q.getParent().id;typeof N[B]>"u"&&(N[B]=[]),N[B]=N[B].concat(q)}Object.keys(N).forEach(function(z){if(N[z].length>1){var Y="DummyCompound_"+z;x.memberGroups[Y]=N[z];var k=N[z][0].getParent(),G=new c(x.graphManager);G.id=Y,G.paddingLeft=k.paddingLeft||0,G.paddingRight=k.paddingRight||0,G.paddingBottom=k.paddingBottom||0,G.paddingTop=k.paddingTop||0,x.idToDummyNode[Y]=G;var U=x.getGraphManager().add(x.newGraph(),G),W=k.getChild();W.add(G);for(var j=0;j<N[z].length;j++){var H=N[z][j];W.remove(H),U.add(H)}}})},D.prototype.clearCompounds=function(){var x={},N={};this.performDFSOnCompounds();for(var M=0;M<this.compoundOrder.length;M++)N[this.compoundOrder[M].id]=this.compoundOrder[M],x[this.compoundOrder[M].id]=[].concat(this.compoundOrder[M].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[M].getChild()),this.compoundOrder[M].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(x,N)},D.prototype.clearZeroDegreeMembers=function(){var x=this,N=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(M){var I=x.idToDummyNode[M];if(N[M]=x.tileNodes(x.memberGroups[M],I.paddingLeft+I.paddingRight),I.rect.width=N[M].width,I.rect.height=N[M].height,I.setCenter(N[M].centerX,N[M].centerY),I.labelMarginLeft=0,I.labelMarginTop=0,g.NODE_DIMENSIONS_INCLUDE_LABELS){var O=I.rect.width,q=I.rect.height;I.labelWidth&&(I.labelPosHorizontal=="left"?(I.rect.x-=I.labelWidth,I.setWidth(O+I.labelWidth),I.labelMarginLeft=I.labelWidth):I.labelPosHorizontal=="center"&&I.labelWidth>O?(I.rect.x-=(I.labelWidth-O)/2,I.setWidth(I.labelWidth),I.labelMarginLeft=(I.labelWidth-O)/2):I.labelPosHorizontal=="right"&&I.setWidth(O+I.labelWidth)),I.labelHeight&&(I.labelPosVertical=="top"?(I.rect.y-=I.labelHeight,I.setHeight(q+I.labelHeight),I.labelMarginTop=I.labelHeight):I.labelPosVertical=="center"&&I.labelHeight>q?(I.rect.y-=(I.labelHeight-q)/2,I.setHeight(I.labelHeight),I.labelMarginTop=(I.labelHeight-q)/2):I.labelPosVertical=="bottom"&&I.setHeight(q+I.labelHeight))}})},D.prototype.repopulateCompounds=function(){for(var x=this.compoundOrder.length-1;x>=0;x--){var N=this.compoundOrder[x],M=N.id,I=N.paddingLeft,O=N.paddingTop,q=N.labelMarginLeft,_=N.labelMarginTop;this.adjustLocations(this.tiledMemberPack[M],N.rect.x,N.rect.y,I,O,q,_)}},D.prototype.repopulateZeroDegreeMembers=function(){var x=this,N=this.tiledZeroDegreePack;Object.keys(N).forEach(function(M){var I=x.idToDummyNode[M],O=I.paddingLeft,q=I.paddingTop,_=I.labelMarginLeft,B=I.labelMarginTop;x.adjustLocations(N[M],I.rect.x,I.rect.y,O,q,_,B)})},D.prototype.getToBeTiled=function(x){var N=x.id;if(this.toBeTiled[N]!=null)return this.toBeTiled[N];var M=x.getChild();if(M==null)return this.toBeTiled[N]=!1,!1;for(var I=M.getNodes(),O=0;O<I.length;O++){var q=I[O];if(this.getNodeDegree(q)>0)return this.toBeTiled[N]=!1,!1;if(q.getChild()==null){this.toBeTiled[q.id]=!1;continue}if(!this.getToBeTiled(q))return this.toBeTiled[N]=!1,!1}return this.toBeTiled[N]=!0,!0},D.prototype.getNodeDegree=function(x){x.id;for(var N=x.getEdges(),M=0,I=0;I<N.length;I++){var O=N[I];O.getSource().id!==O.getTarget().id&&(M=M+1)}return M},D.prototype.getNodeDegreeWithChildren=function(x){var N=this.getNodeDegree(x);if(x.getChild()==null)return N;for(var M=x.getChild().getNodes(),I=0;I<M.length;I++){var O=M[I];N+=this.getNodeDegreeWithChildren(O)}return N},D.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},D.prototype.fillCompexOrderByDFS=function(x){for(var N=0;N<x.length;N++){var M=x[N];M.getChild()!=null&&this.fillCompexOrderByDFS(M.getChild().getNodes()),this.getToBeTiled(M)&&this.compoundOrder.push(M)}},D.prototype.adjustLocations=function(x,N,M,I,O,q,_){N+=I+q,M+=O+_;for(var B=N,z=0;z<x.rows.length;z++){var Y=x.rows[z];N=B;for(var k=0,G=0;G<Y.length;G++){var U=Y[G];U.rect.x=N,U.rect.y=M,N+=U.rect.width+x.horizontalPadding,U.rect.height>k&&(k=U.rect.height)}M+=k+x.verticalPadding}},D.prototype.tileCompoundMembers=function(x,N){var M=this;this.tiledMemberPack=[],Object.keys(x).forEach(function(I){var O=N[I];if(M.tiledMemberPack[I]=M.tileNodes(x[I],O.paddingLeft+O.paddingRight),O.rect.width=M.tiledMemberPack[I].width,O.rect.height=M.tiledMemberPack[I].height,O.setCenter(M.tiledMemberPack[I].centerX,M.tiledMemberPack[I].centerY),O.labelMarginLeft=0,O.labelMarginTop=0,g.NODE_DIMENSIONS_INCLUDE_LABELS){var q=O.rect.width,_=O.rect.height;O.labelWidth&&(O.labelPosHorizontal=="left"?(O.rect.x-=O.labelWidth,O.setWidth(q+O.labelWidth),O.labelMarginLeft=O.labelWidth):O.labelPosHorizontal=="center"&&O.labelWidth>q?(O.rect.x-=(O.labelWidth-q)/2,O.setWidth(O.labelWidth),O.labelMarginLeft=(O.labelWidth-q)/2):O.labelPosHorizontal=="right"&&O.setWidth(q+O.labelWidth)),O.labelHeight&&(O.labelPosVertical=="top"?(O.rect.y-=O.labelHeight,O.setHeight(_+O.labelHeight),O.labelMarginTop=O.labelHeight):O.labelPosVertical=="center"&&O.labelHeight>_?(O.rect.y-=(O.labelHeight-_)/2,O.setHeight(O.labelHeight),O.labelMarginTop=(O.labelHeight-_)/2):O.labelPosVertical=="bottom"&&O.setHeight(_+O.labelHeight))}})},D.prototype.tileNodes=function(x,N){var M=this.tileNodesByFavoringDim(x,N,!0),I=this.tileNodesByFavoringDim(x,N,!1),O=this.getOrgRatio(M),q=this.getOrgRatio(I),_;return q<O?_=I:_=M,_},D.prototype.getOrgRatio=function(x){var N=x.width,M=x.height,I=N/M;return I<1&&(I=1/I),I},D.prototype.calcIdealRowWidth=function(x,N){var M=g.TILING_PADDING_VERTICAL,I=g.TILING_PADDING_HORIZONTAL,O=x.length,q=0,_=0,B=0;x.forEach(function(j){q+=j.getWidth(),_+=j.getHeight(),j.getWidth()>B&&(B=j.getWidth())});var z=q/O,Y=_/O,k=Math.pow(M-I,2)+4*(z+I)*(Y+M)*O,G=(I-M+Math.sqrt(k))/(2*(z+I)),U;N?(U=Math.ceil(G),U==G&&U++):U=Math.floor(G);var W=U*(z+I)-I;return B>W&&(W=B),W+=I*2,W},D.prototype.tileNodesByFavoringDim=function(x,N,M){var I=g.TILING_PADDING_VERTICAL,O=g.TILING_PADDING_HORIZONTAL,q=g.TILING_COMPARE_BY,_={rows:[],rowWidth:[],rowHeight:[],width:0,height:N,verticalPadding:I,horizontalPadding:O,centerX:0,centerY:0};q&&(_.idealRowWidth=this.calcIdealRowWidth(x,M));var B=function(H){return H.rect.width*H.rect.height},z=function(H,V){return B(V)-B(H)};x.sort(function(j,H){var V=z;return _.idealRowWidth?(V=q,V(j.id,H.id)):V(j,H)});for(var Y=0,k=0,G=0;G<x.length;G++){var U=x[G];Y+=U.getCenterX(),k+=U.getCenterY()}_.centerX=Y/x.length,_.centerY=k/x.length;for(var G=0;G<x.length;G++){var U=x[G];if(_.rows.length==0)this.insertNodeToRow(_,U,0,N);else if(this.canAddHorizontal(_,U.rect.width,U.rect.height)){var W=_.rows.length-1;_.idealRowWidth||(W=this.getShortestRowIndex(_)),this.insertNodeToRow(_,U,W,N)}else this.insertNodeToRow(_,U,_.rows.length,N);this.shiftToLastRow(_)}return _},D.prototype.insertNodeToRow=function(x,N,M,I){var O=I;if(M==x.rows.length){var q=[];x.rows.push(q),x.rowWidth.push(O),x.rowHeight.push(0)}var _=x.rowWidth[M]+N.rect.width;x.rows[M].length>0&&(_+=x.horizontalPadding),x.rowWidth[M]=_,x.width<_&&(x.width=_);var B=N.rect.height;M>0&&(B+=x.verticalPadding);var z=0;B>x.rowHeight[M]&&(z=x.rowHeight[M],x.rowHeight[M]=B,z=x.rowHeight[M]-z),x.height+=z,x.rows[M].push(N)},D.prototype.getShortestRowIndex=function(x){for(var N=-1,M=Number.MAX_VALUE,I=0;I<x.rows.length;I++)x.rowWidth[I]<M&&(N=I,M=x.rowWidth[I]);return N},D.prototype.getLongestRowIndex=function(x){for(var N=-1,M=Number.MIN_VALUE,I=0;I<x.rows.length;I++)x.rowWidth[I]>M&&(N=I,M=x.rowWidth[I]);return N},D.prototype.canAddHorizontal=function(x,N,M){if(x.idealRowWidth){var I=x.rows.length-1,O=x.rowWidth[I];return O+N+x.horizontalPadding<=x.idealRowWidth}var q=this.getShortestRowIndex(x);if(q<0)return!0;var _=x.rowWidth[q];if(_+x.horizontalPadding+N<=x.width)return!0;var B=0;x.rowHeight[q]<M&&q>0&&(B=M+x.verticalPadding-x.rowHeight[q]);var z;x.width-_>=N+x.horizontalPadding?z=(x.height+B)/(_+N+x.horizontalPadding):z=(x.height+B)/x.width,B=M+x.verticalPadding;var Y;return x.width<N?Y=(x.height+B)/N:Y=(x.height+B)/x.width,Y<1&&(Y=1/Y),z<1&&(z=1/z),z<Y},D.prototype.shiftToLastRow=function(x){var N=this.getLongestRowIndex(x),M=x.rowWidth.length-1,I=x.rows[N],O=I[I.length-1],q=O.width+x.horizontalPadding;if(x.width-x.rowWidth[M]>q&&N!=M){I.splice(-1,1),x.rows[M].push(O),x.rowWidth[N]=x.rowWidth[N]-q,x.rowWidth[M]=x.rowWidth[M]+q,x.width=x.rowWidth[instance.getLongestRowIndex(x)];for(var _=Number.MIN_VALUE,B=0;B<I.length;B++)I[B].height>_&&(_=I[B].height);N>0&&(_+=x.verticalPadding);var z=x.rowHeight[N]+x.rowHeight[M];x.rowHeight[N]=_,x.rowHeight[M]<O.height+x.verticalPadding&&(x.rowHeight[M]=O.height+x.verticalPadding);var Y=x.rowHeight[N]+x.rowHeight[M];x.height+=Y-z,this.shiftToLastRow(x)}},D.prototype.tilingPreLayout=function(){g.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},D.prototype.tilingPostLayout=function(){g.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},D.prototype.reduceTrees=function(){for(var x=[],N=!0,M;N;){var I=this.graphManager.getAllNodes(),O=[];N=!1;for(var q=0;q<I.length;q++)if(M=I[q],M.getEdges().length==1&&!M.getEdges()[0].isInterGraph&&M.getChild()==null){if(g.PURE_INCREMENTAL){var _=M.getEdges()[0].getOtherEnd(M),B=new T(M.getCenterX()-_.getCenterX(),M.getCenterY()-_.getCenterY());O.push([M,M.getEdges()[0],M.getOwner(),B])}else O.push([M,M.getEdges()[0],M.getOwner()]);N=!0}if(N==!0){for(var z=[],Y=0;Y<O.length;Y++)O[Y][0].getEdges().length==1&&(z.push(O[Y]),O[Y][0].getOwner().remove(O[Y][0]));x.push(z),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=x},D.prototype.growTree=function(x){for(var N=x.length,M=x[N-1],I,O=0;O<M.length;O++)I=M[O],this.findPlaceforPrunedNode(I),I[2].add(I[0]),I[2].add(I[1],I[1].source,I[1].target);x.splice(x.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},D.prototype.findPlaceforPrunedNode=function(x){var N,M,I=x[0];if(I==x[1].source?M=x[1].target:M=x[1].source,g.PURE_INCREMENTAL)I.setCenter(M.getCenterX()+x[3].getWidth(),M.getCenterY()+x[3].getHeight());else{var O=M.startX,q=M.finishX,_=M.startY,B=M.finishY,z=0,Y=0,k=0,G=0,U=[z,k,Y,G];if(_>0)for(var W=O;W<=q;W++)U[0]+=this.grid[W][_-1].length+this.grid[W][_].length-1;if(q<this.grid.length-1)for(var W=_;W<=B;W++)U[1]+=this.grid[q+1][W].length+this.grid[q][W].length-1;if(B<this.grid[0].length-1)for(var W=O;W<=q;W++)U[2]+=this.grid[W][B+1].length+this.grid[W][B].length-1;if(O>0)for(var W=_;W<=B;W++)U[3]+=this.grid[O-1][W].length+this.grid[O][W].length-1;for(var j=w.MAX_VALUE,H,V,X=0;X<U.length;X++)U[X]<j?(j=U[X],H=1,V=X):U[X]==j&&H++;if(H==3&&j==0)U[0]==0&&U[1]==0&&U[2]==0?N=1:U[0]==0&&U[1]==0&&U[3]==0?N=0:U[0]==0&&U[2]==0&&U[3]==0?N=3:U[1]==0&&U[2]==0&&U[3]==0&&(N=2);else if(H==2&&j==0){var Z=Math.floor(Math.random()*2);U[0]==0&&U[1]==0?Z==0?N=0:N=1:U[0]==0&&U[2]==0?Z==0?N=0:N=2:U[0]==0&&U[3]==0?Z==0?N=0:N=3:U[1]==0&&U[2]==0?Z==0?N=1:N=2:U[1]==0&&U[3]==0?Z==0?N=1:N=3:Z==0?N=2:N=3}else if(H==4&&j==0){var Z=Math.floor(Math.random()*4);N=Z}else N=V;N==0?I.setCenter(M.getCenterX(),M.getCenterY()-M.getHeight()/2-y.DEFAULT_EDGE_LENGTH-I.getHeight()/2):N==1?I.setCenter(M.getCenterX()+M.getWidth()/2+y.DEFAULT_EDGE_LENGTH+I.getWidth()/2,M.getCenterY()):N==2?I.setCenter(M.getCenterX(),M.getCenterY()+M.getHeight()/2+y.DEFAULT_EDGE_LENGTH+I.getHeight()/2):I.setCenter(M.getCenterX()-M.getWidth()/2-y.DEFAULT_EDGE_LENGTH-I.getWidth()/2,M.getCenterY())}},s.exports=D}),991:((s,u,l)=>{var f=l(551).FDLayoutNode,h=l(551).IMath;function v(d,g,p,y){f.call(this,d,g,p,y)}v.prototype=Object.create(f.prototype);for(var c in f)v[c]=f[c];v.prototype.calculateDisplacement=function(){var d=this.graphManager.getLayout();this.getChild()!=null&&this.fixedNodeWeight?(this.displacementX+=d.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=d.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=d.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=d.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>d.coolingFactor*d.maxNodeDisplacement&&(this.displacementX=d.coolingFactor*d.maxNodeDisplacement*h.sign(this.displacementX)),Math.abs(this.displacementY)>d.coolingFactor*d.maxNodeDisplacement&&(this.displacementY=d.coolingFactor*d.maxNodeDisplacement*h.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},v.prototype.propogateDisplacementToChildren=function(d,g){for(var p=this.getChild().getNodes(),y,b=0;b<p.length;b++)y=p[b],y.getChild()==null?(y.displacementX+=d,y.displacementY+=g):y.propogateDisplacementToChildren(d,g)},v.prototype.move=function(){var d=this.graphManager.getLayout();(this.child==null||this.child.getNodes().length==0)&&(this.moveBy(this.displacementX,this.displacementY),d.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},v.prototype.setPred1=function(d){this.pred1=d},v.prototype.getPred1=function(){return pred1},v.prototype.getPred2=function(){return pred2},v.prototype.setNext=function(d){this.next=d},v.prototype.getNext=function(){return next},v.prototype.setProcessed=function(d){this.processed=d},v.prototype.isProcessed=function(){return processed},s.exports=v}),902:((s,u,l)=>{function f(p){if(Array.isArray(p)){for(var y=0,b=Array(p.length);y<p.length;y++)b[y]=p[y];return b}else return Array.from(p)}var h=l(806),v=l(551).LinkedList,c=l(551).Matrix,d=l(551).SVD;function g(){}g.handleConstraints=function(p){var y={};y.fixedNodeConstraint=p.constraints.fixedNodeConstraint,y.alignmentConstraint=p.constraints.alignmentConstraint,y.relativePlacementConstraint=p.constraints.relativePlacementConstraint;for(var b=new Map,m=new Map,E=[],T=[],L=p.getAllNodes(),w=0,C=0;C<L.length;C++){var A=L[C];A.getChild()==null&&(m.set(A.id,w++),E.push(A.getCenterX()),T.push(A.getCenterY()),b.set(A.id,A))}y.relativePlacementConstraint&&y.relativePlacementConstraint.forEach(function(K){!K.gap&&K.gap!=0&&(K.left?K.gap=h.DEFAULT_EDGE_LENGTH+b.get(K.left).getWidth()/2+b.get(K.right).getWidth()/2:K.gap=h.DEFAULT_EDGE_LENGTH+b.get(K.top).getHeight()/2+b.get(K.bottom).getHeight()/2)});var R=function(F,$){return{x:F.x-$.x,y:F.y-$.y}},S=function(F){var $=0,J=0;return F.forEach(function(Q){$+=E[m.get(Q)],J+=T[m.get(Q)]}),{x:$/F.size,y:J/F.size}},D=function(F,$,J,Q,te){function fe(me,ge){var Ie=new Set(me),Ae=!0,Se=!1,Ue=void 0;try{for(var Ne=ge[Symbol.iterator](),Pe;!(Ae=(Pe=Ne.next()).done);Ae=!0){var We=Pe.value;Ie.add(We)}}catch(Je){Se=!0,Ue=Je}finally{try{!Ae&&Ne.return&&Ne.return()}finally{if(Se)throw Ue}}return Ie}var ae=new Map;F.forEach(function(me,ge){ae.set(ge,0)}),F.forEach(function(me,ge){me.forEach(function(Ie){ae.set(Ie.id,ae.get(Ie.id)+1)})});var ie=new Map,ne=new Map,ve=new v;ae.forEach(function(me,ge){me==0?(ve.push(ge),J||($=="horizontal"?ie.set(ge,m.has(ge)?E[m.get(ge)]:Q.get(ge)):ie.set(ge,m.has(ge)?T[m.get(ge)]:Q.get(ge)))):ie.set(ge,Number.NEGATIVE_INFINITY),J&&ne.set(ge,new Set([ge]))}),J&&te.forEach(function(me){var ge=[];if(me.forEach(function(Se){J.has(Se)&&ge.push(Se)}),ge.length>0){var Ie=0;ge.forEach(function(Se){$=="horizontal"?(ie.set(Se,m.has(Se)?E[m.get(Se)]:Q.get(Se)),Ie+=ie.get(Se)):(ie.set(Se,m.has(Se)?T[m.get(Se)]:Q.get(Se)),Ie+=ie.get(Se))}),Ie=Ie/ge.length,me.forEach(function(Se){J.has(Se)||ie.set(Se,Ie)})}else{var Ae=0;me.forEach(function(Se){$=="horizontal"?Ae+=m.has(Se)?E[m.get(Se)]:Q.get(Se):Ae+=m.has(Se)?T[m.get(Se)]:Q.get(Se)}),Ae=Ae/me.length,me.forEach(function(Se){ie.set(Se,Ae)})}});for(var Ce=function(){var ge=ve.shift(),Ie=F.get(ge);Ie.forEach(function(Ae){if(ie.get(Ae.id)<ie.get(ge)+Ae.gap)if(J&&J.has(Ae.id)){var Se=void 0;if($=="horizontal"?Se=m.has(Ae.id)?E[m.get(Ae.id)]:Q.get(Ae.id):Se=m.has(Ae.id)?T[m.get(Ae.id)]:Q.get(Ae.id),ie.set(Ae.id,Se),Se<ie.get(ge)+Ae.gap){var Ue=ie.get(ge)+Ae.gap-Se;ne.get(ge).forEach(function(Ne){ie.set(Ne,ie.get(Ne)-Ue)})}}else ie.set(Ae.id,ie.get(ge)+Ae.gap);ae.set(Ae.id,ae.get(Ae.id)-1),ae.get(Ae.id)==0&&ve.push(Ae.id),J&&ne.set(Ae.id,fe(ne.get(ge),ne.get(Ae.id)))})};ve.length!=0;)Ce();if(J){var Ee=new Set;F.forEach(function(me,ge){me.length==0&&Ee.add(ge)});var be=[];ne.forEach(function(me,ge){if(Ee.has(ge)){var Ie=!1,Ae=!0,Se=!1,Ue=void 0;try{for(var Ne=me[Symbol.iterator](),Pe;!(Ae=(Pe=Ne.next()).done);Ae=!0){var We=Pe.value;J.has(We)&&(Ie=!0)}}catch(Xe){Se=!0,Ue=Xe}finally{try{!Ae&&Ne.return&&Ne.return()}finally{if(Se)throw Ue}}if(!Ie){var Je=!1,ze=void 0;be.forEach(function(Xe,ft){Xe.has([].concat(f(me))[0])&&(Je=!0,ze=ft)}),Je?me.forEach(function(Xe){be[ze].add(Xe)}):be.push(new Set(me))}}}),be.forEach(function(me,ge){var Ie=Number.POSITIVE_INFINITY,Ae=Number.POSITIVE_INFINITY,Se=Number.NEGATIVE_INFINITY,Ue=Number.NEGATIVE_INFINITY,Ne=!0,Pe=!1,We=void 0;try{for(var Je=me[Symbol.iterator](),ze;!(Ne=(ze=Je.next()).done);Ne=!0){var Xe=ze.value,ft=void 0;$=="horizontal"?ft=m.has(Xe)?E[m.get(Xe)]:Q.get(Xe):ft=m.has(Xe)?T[m.get(Xe)]:Q.get(Xe);var Gt=ie.get(Xe);ft<Ie&&(Ie=ft),ft>Se&&(Se=ft),Gt<Ae&&(Ae=Gt),Gt>Ue&&(Ue=Gt)}}catch(ur){Pe=!0,We=ur}finally{try{!Ne&&Je.return&&Je.return()}finally{if(Pe)throw We}}var mr=(Ie+Se)/2-(Ae+Ue)/2,Ot=!0,lt=!1,it=void 0;try{for(var st=me[Symbol.iterator](),jt;!(Ot=(jt=st.next()).done);Ot=!0){var pt=jt.value;ie.set(pt,ie.get(pt)+mr)}}catch(ur){lt=!0,it=ur}finally{try{!Ot&&st.return&&st.return()}finally{if(lt)throw it}}})}return ie},P=function(F){var $=0,J=0,Q=0,te=0;if(F.forEach(function(ne){ne.left?E[m.get(ne.left)]-E[m.get(ne.right)]>=0?$++:J++:T[m.get(ne.top)]-T[m.get(ne.bottom)]>=0?Q++:te++}),$>J&&Q>te)for(var fe=0;fe<m.size;fe++)E[fe]=-1*E[fe],T[fe]=-1*T[fe];else if($>J)for(var ae=0;ae<m.size;ae++)E[ae]=-1*E[ae];else if(Q>te)for(var ie=0;ie<m.size;ie++)T[ie]=-1*T[ie]},x=function(F){var $=[],J=new v,Q=new Set,te=0;return F.forEach(function(fe,ae){if(!Q.has(ae)){$[te]=[];var ie=ae;for(J.push(ie),Q.add(ie),$[te].push(ie);J.length!=0;){ie=J.shift();var ne=F.get(ie);ne.forEach(function(ve){Q.has(ve.id)||(J.push(ve.id),Q.add(ve.id),$[te].push(ve.id))})}te++}}),$},N=function(F){var $=new Map;return F.forEach(function(J,Q){$.set(Q,[])}),F.forEach(function(J,Q){J.forEach(function(te){$.get(Q).push(te),$.get(te.id).push({id:Q,gap:te.gap,direction:te.direction})})}),$},M=function(F){var $=new Map;return F.forEach(function(J,Q){$.set(Q,[])}),F.forEach(function(J,Q){J.forEach(function(te){$.get(te.id).push({id:Q,gap:te.gap,direction:te.direction})})}),$},I=[],O=[],q=!1,_=!1,B=new Set,z=new Map,Y=new Map,k=[];if(y.fixedNodeConstraint&&y.fixedNodeConstraint.forEach(function(K){B.add(K.nodeId)}),y.relativePlacementConstraint&&(y.relativePlacementConstraint.forEach(function(K){K.left?(z.has(K.left)?z.get(K.left).push({id:K.right,gap:K.gap,direction:"horizontal"}):z.set(K.left,[{id:K.right,gap:K.gap,direction:"horizontal"}]),z.has(K.right)||z.set(K.right,[])):(z.has(K.top)?z.get(K.top).push({id:K.bottom,gap:K.gap,direction:"vertical"}):z.set(K.top,[{id:K.bottom,gap:K.gap,direction:"vertical"}]),z.has(K.bottom)||z.set(K.bottom,[]))}),Y=N(z),k=x(Y)),h.TRANSFORM_ON_CONSTRAINT_HANDLING){if(y.fixedNodeConstraint&&y.fixedNodeConstraint.length>1)y.fixedNodeConstraint.forEach(function(K,F){I[F]=[K.position.x,K.position.y],O[F]=[E[m.get(K.nodeId)],T[m.get(K.nodeId)]]}),q=!0;else if(y.alignmentConstraint)(function(){var K=0;if(y.alignmentConstraint.vertical){for(var F=y.alignmentConstraint.vertical,$=function(ie){var ne=new Set;F[ie].forEach(function(Ee){ne.add(Ee)});var ve=new Set([].concat(f(ne)).filter(function(Ee){return B.has(Ee)})),Ce=void 0;ve.size>0?Ce=E[m.get(ve.values().next().value)]:Ce=S(ne).x,F[ie].forEach(function(Ee){I[K]=[Ce,T[m.get(Ee)]],O[K]=[E[m.get(Ee)],T[m.get(Ee)]],K++})},J=0;J<F.length;J++)$(J);q=!0}if(y.alignmentConstraint.horizontal){for(var Q=y.alignmentConstraint.horizontal,te=function(ie){var ne=new Set;Q[ie].forEach(function(Ee){ne.add(Ee)});var ve=new Set([].concat(f(ne)).filter(function(Ee){return B.has(Ee)})),Ce=void 0;ve.size>0?Ce=E[m.get(ve.values().next().value)]:Ce=S(ne).y,Q[ie].forEach(function(Ee){I[K]=[E[m.get(Ee)],Ce],O[K]=[E[m.get(Ee)],T[m.get(Ee)]],K++})},fe=0;fe<Q.length;fe++)te(fe);q=!0}y.relativePlacementConstraint&&(_=!0)})();else if(y.relativePlacementConstraint){for(var G=0,U=0,W=0;W<k.length;W++)k[W].length>G&&(G=k[W].length,U=W);if(G<Y.size/2)P(y.relativePlacementConstraint),q=!1,_=!1;else{var j=new Map,H=new Map,V=[];k[U].forEach(function(K){z.get(K).forEach(function(F){F.direction=="horizontal"?(j.has(K)?j.get(K).push(F):j.set(K,[F]),j.has(F.id)||j.set(F.id,[]),V.push({left:K,right:F.id})):(H.has(K)?H.get(K).push(F):H.set(K,[F]),H.has(F.id)||H.set(F.id,[]),V.push({top:K,bottom:F.id}))})}),P(V),_=!1;var X=D(j,"horizontal"),Z=D(H,"vertical");k[U].forEach(function(K,F){O[F]=[E[m.get(K)],T[m.get(K)]],I[F]=[],X.has(K)?I[F][0]=X.get(K):I[F][0]=E[m.get(K)],Z.has(K)?I[F][1]=Z.get(K):I[F][1]=T[m.get(K)]}),q=!0}}if(q){for(var ee=void 0,re=c.transpose(I),ue=c.transpose(O),xe=0;xe<re.length;xe++)re[xe]=c.multGamma(re[xe]),ue[xe]=c.multGamma(ue[xe]);var se=c.multMat(re,c.transpose(ue)),oe=d.svd(se);ee=c.multMat(oe.V,c.transpose(oe.U));for(var he=0;he<m.size;he++){var le=[E[he],T[he]],de=[ee[0][0],ee[1][0]],pe=[ee[0][1],ee[1][1]];E[he]=c.dotProduct(le,de),T[he]=c.dotProduct(le,pe)}_&&P(y.relativePlacementConstraint)}}if(h.ENFORCE_CONSTRAINTS){if(y.fixedNodeConstraint&&y.fixedNodeConstraint.length>0){var ce={x:0,y:0};y.fixedNodeConstraint.forEach(function(K,F){var $={x:E[m.get(K.nodeId)],y:T[m.get(K.nodeId)]},J=K.position,Q=R(J,$);ce.x+=Q.x,ce.y+=Q.y}),ce.x/=y.fixedNodeConstraint.length,ce.y/=y.fixedNodeConstraint.length,E.forEach(function(K,F){E[F]+=ce.x}),T.forEach(function(K,F){T[F]+=ce.y}),y.fixedNodeConstraint.forEach(function(K){E[m.get(K.nodeId)]=K.position.x,T[m.get(K.nodeId)]=K.position.y})}if(y.alignmentConstraint){if(y.alignmentConstraint.vertical)for(var ye=y.alignmentConstraint.vertical,Le=function(F){var $=new Set;ye[F].forEach(function(te){$.add(te)});var J=new Set([].concat(f($)).filter(function(te){return B.has(te)})),Q=void 0;J.size>0?Q=E[m.get(J.values().next().value)]:Q=S($).x,$.forEach(function(te){B.has(te)||(E[m.get(te)]=Q)})},_e=0;_e<ye.length;_e++)Le(_e);if(y.alignmentConstraint.horizontal)for(var ke=y.alignmentConstraint.horizontal,Oe=function(F){var $=new Set;ke[F].forEach(function(te){$.add(te)});var J=new Set([].concat(f($)).filter(function(te){return B.has(te)})),Q=void 0;J.size>0?Q=T[m.get(J.values().next().value)]:Q=S($).y,$.forEach(function(te){B.has(te)||(T[m.get(te)]=Q)})},Fe=0;Fe<ke.length;Fe++)Oe(Fe)}y.relativePlacementConstraint&&(function(){var K=new Map,F=new Map,$=new Map,J=new Map,Q=new Map,te=new Map,fe=new Set,ae=new Set;if(B.forEach(function(ht){fe.add(ht),ae.add(ht)}),y.alignmentConstraint){if(y.alignmentConstraint.vertical)for(var ie=y.alignmentConstraint.vertical,ne=function(qe){$.set("dummy"+qe,[]),ie[qe].forEach(function($e){K.set($e,"dummy"+qe),$.get("dummy"+qe).push($e),B.has($e)&&fe.add("dummy"+qe)}),Q.set("dummy"+qe,E[m.get(ie[qe][0])])},ve=0;ve<ie.length;ve++)ne(ve);if(y.alignmentConstraint.horizontal)for(var Ce=y.alignmentConstraint.horizontal,Ee=function(qe){J.set("dummy"+qe,[]),Ce[qe].forEach(function($e){F.set($e,"dummy"+qe),J.get("dummy"+qe).push($e),B.has($e)&&ae.add("dummy"+qe)}),te.set("dummy"+qe,T[m.get(Ce[qe][0])])},be=0;be<Ce.length;be++)Ee(be)}var me=new Map,ge=new Map,Ie=function(qe){z.get(qe).forEach(function($e){var ct=void 0,St=void 0;$e.direction=="horizontal"?(ct=K.get(qe)?K.get(qe):qe,K.get($e.id)?St={id:K.get($e.id),gap:$e.gap,direction:$e.direction}:St=$e,me.has(ct)?me.get(ct).push(St):me.set(ct,[St]),me.has(St.id)||me.set(St.id,[])):(ct=F.get(qe)?F.get(qe):qe,F.get($e.id)?St={id:F.get($e.id),gap:$e.gap,direction:$e.direction}:St=$e,ge.has(ct)?ge.get(ct).push(St):ge.set(ct,[St]),ge.has(St.id)||ge.set(St.id,[]))})},Ae=!0,Se=!1,Ue=void 0;try{for(var Ne=z.keys()[Symbol.iterator](),Pe;!(Ae=(Pe=Ne.next()).done);Ae=!0){var We=Pe.value;Ie(We)}}catch(ht){Se=!0,Ue=ht}finally{try{!Ae&&Ne.return&&Ne.return()}finally{if(Se)throw Ue}}var Je=N(me),ze=N(ge),Xe=x(Je),ft=x(ze),Gt=M(me),mr=M(ge),Ot=[],lt=[];Xe.forEach(function(ht,qe){Ot[qe]=[],ht.forEach(function($e){Gt.get($e).length==0&&Ot[qe].push($e)})}),ft.forEach(function(ht,qe){lt[qe]=[],ht.forEach(function($e){mr.get($e).length==0&&lt[qe].push($e)})});var it=D(me,"horizontal",fe,Q,Ot),st=D(ge,"vertical",ae,te,lt),jt=function(qe){$.get(qe)?$.get(qe).forEach(function($e){E[m.get($e)]=it.get(qe)}):E[m.get(qe)]=it.get(qe)},pt=!0,ur=!1,Mn=void 0;try{for(var Ba=it.keys()[Symbol.iterator](),On;!(pt=(On=Ba.next()).done);pt=!0){var ka=On.value;jt(ka)}}catch(ht){ur=!0,Mn=ht}finally{try{!pt&&Ba.return&&Ba.return()}finally{if(ur)throw Mn}}var uo=function(qe){J.get(qe)?J.get(qe).forEach(function($e){T[m.get($e)]=st.get(qe)}):T[m.get(qe)]=st.get(qe)},qa=!0,In=!1,br=void 0;try{for(var Gr=st.keys()[Symbol.iterator](),Ur;!(qa=(Ur=Gr.next()).done);qa=!0){var ka=Ur.value;uo(ka)}}catch(ht){In=!0,br=ht}finally{try{!qa&&Gr.return&&Gr.return()}finally{if(In)throw br}}})()}for(var Re=0;Re<L.length;Re++){var we=L[Re];we.getChild()==null&&we.setCenter(E[m.get(we.id)],T[m.get(we.id)])}},s.exports=g}),551:(s=>{s.exports=r})},n={};function i(s){var u=n[s];if(u!==void 0)return u.exports;var l=n[s]={exports:{}};return a[s](l,l.exports,i),l.exports}var o=i(45);return o})()})})(si)),si.exports}var oI=oi.exports,cE;function sI(){return cE||(cE=1,(function(t,e){(function(a,n){t.exports=n(iI())})(oI,function(r){return(()=>{var a={658:(s=>{s.exports=Object.assign!=null?Object.assign.bind(Object):function(u){for(var l=arguments.length,f=Array(l>1?l-1:0),h=1;h<l;h++)f[h-1]=arguments[h];return f.forEach(function(v){Object.keys(v).forEach(function(c){return u[c]=v[c]})}),u}}),548:((s,u,l)=>{var f=(function(){function c(d,g){var p=[],y=!0,b=!1,m=void 0;try{for(var E=d[Symbol.iterator](),T;!(y=(T=E.next()).done)&&(p.push(T.value),!(g&&p.length===g));y=!0);}catch(L){b=!0,m=L}finally{try{!y&&E.return&&E.return()}finally{if(b)throw m}}return p}return function(d,g){if(Array.isArray(d))return d;if(Symbol.iterator in Object(d))return c(d,g);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),h=l(140).layoutBase.LinkedList,v={};v.getTopMostNodes=function(c){for(var d={},g=0;g<c.length;g++)d[c[g].id()]=!0;var p=c.filter(function(y,b){typeof y=="number"&&(y=b);for(var m=y.parent()[0];m!=null;){if(d[m.id()])return!1;m=m.parent()[0]}return!0});return p},v.connectComponents=function(c,d,g,p){var y=new h,b=new Set,m=[],E=void 0,T=void 0,L=void 0,w=!1,C=1,A=[],R=[],S=function(){var P=c.collection();R.push(P);var x=g[0],N=c.collection();N.merge(x).merge(x.descendants().intersection(d)),m.push(x),N.forEach(function(O){y.push(O),b.add(O),P.merge(O)});for(var M=function(){x=y.shift();var q=c.collection();x.neighborhood().nodes().forEach(function(Y){d.intersection(x.edgesWith(Y)).length>0&&q.merge(Y)});for(var _=0;_<q.length;_++){var B=q[_];if(E=g.intersection(B.union(B.ancestors())),E!=null&&!b.has(E[0])){var z=E.union(E.descendants());z.forEach(function(Y){y.push(Y),b.add(Y),P.merge(Y),g.has(Y)&&m.push(Y)})}}};y.length!=0;)M();if(P.forEach(function(O){d.intersection(O.connectedEdges()).forEach(function(q){P.has(q.source())&&P.has(q.target())&&P.merge(q)})}),m.length==g.length&&(w=!0),!w||w&&C>1){T=m[0],L=T.connectedEdges().length,m.forEach(function(O){O.connectedEdges().length<L&&(L=O.connectedEdges().length,T=O)}),A.push(T.id());var I=c.collection();I.merge(m[0]),m.forEach(function(O){I.merge(O)}),m=[],g=g.difference(I),C++}};do S();while(!w);return p&&A.length>0&&p.set("dummy"+(p.size+1),A),R},v.relocateComponent=function(c,d,g){if(!g.fixedNodeConstraint){var p=Number.POSITIVE_INFINITY,y=Number.NEGATIVE_INFINITY,b=Number.POSITIVE_INFINITY,m=Number.NEGATIVE_INFINITY;if(g.quality=="draft"){var E=!0,T=!1,L=void 0;try{for(var w=d.nodeIndexes[Symbol.iterator](),C;!(E=(C=w.next()).done);E=!0){var A=C.value,R=f(A,2),S=R[0],D=R[1],P=g.cy.getElementById(S);if(P){var x=P.boundingBox(),N=d.xCoords[D]-x.w/2,M=d.xCoords[D]+x.w/2,I=d.yCoords[D]-x.h/2,O=d.yCoords[D]+x.h/2;N<p&&(p=N),M>y&&(y=M),I<b&&(b=I),O>m&&(m=O)}}}catch(Y){T=!0,L=Y}finally{try{!E&&w.return&&w.return()}finally{if(T)throw L}}var q=c.x-(y+p)/2,_=c.y-(m+b)/2;d.xCoords=d.xCoords.map(function(Y){return Y+q}),d.yCoords=d.yCoords.map(function(Y){return Y+_})}else{Object.keys(d).forEach(function(Y){var k=d[Y],G=k.getRect().x,U=k.getRect().x+k.getRect().width,W=k.getRect().y,j=k.getRect().y+k.getRect().height;G<p&&(p=G),U>y&&(y=U),W<b&&(b=W),j>m&&(m=j)});var B=c.x-(y+p)/2,z=c.y-(m+b)/2;Object.keys(d).forEach(function(Y){var k=d[Y];k.setCenter(k.getCenterX()+B,k.getCenterY()+z)})}}},v.calcBoundingBox=function(c,d,g,p){for(var y=Number.MAX_SAFE_INTEGER,b=Number.MIN_SAFE_INTEGER,m=Number.MAX_SAFE_INTEGER,E=Number.MIN_SAFE_INTEGER,T=void 0,L=void 0,w=void 0,C=void 0,A=c.descendants().not(":parent"),R=A.length,S=0;S<R;S++){var D=A[S];T=d[p.get(D.id())]-D.width()/2,L=d[p.get(D.id())]+D.width()/2,w=g[p.get(D.id())]-D.height()/2,C=g[p.get(D.id())]+D.height()/2,y>T&&(y=T),b<L&&(b=L),m>w&&(m=w),E<C&&(E=C)}var P={};return P.topLeftX=y,P.topLeftY=m,P.width=b-y,P.height=E-m,P},v.calcParentsWithoutChildren=function(c,d){var g=c.collection();return d.nodes(":parent").forEach(function(p){var y=!1;p.children().forEach(function(b){b.css("display")!="none"&&(y=!0)}),y||g.merge(p)}),g},s.exports=v}),816:((s,u,l)=>{var f=l(548),h=l(140).CoSELayout,v=l(140).CoSENode,c=l(140).layoutBase.PointD,d=l(140).layoutBase.DimensionD,g=l(140).layoutBase.LayoutConstants,p=l(140).layoutBase.FDLayoutConstants,y=l(140).CoSEConstants,b=function(E,T){var L=E.cy,w=E.eles,C=w.nodes(),A=w.edges(),R=void 0,S=void 0,D=void 0,P={};E.randomize&&(R=T.nodeIndexes,S=T.xCoords,D=T.yCoords);var x=function(Y){return typeof Y=="function"},N=function(Y,k){return x(Y)?Y(k):Y},M=f.calcParentsWithoutChildren(L,w),I=function z(Y,k,G,U){for(var W=k.length,j=0;j<W;j++){var H=k[j],V=null;H.intersection(M).length==0&&(V=H.children());var X=void 0,Z=H.layoutDimensions({nodeDimensionsIncludeLabels:U.nodeDimensionsIncludeLabels});if(H.outerWidth()!=null&&H.outerHeight()!=null)if(U.randomize)if(!H.isParent())X=Y.add(new v(G.graphManager,new c(S[R.get(H.id())]-Z.w/2,D[R.get(H.id())]-Z.h/2),new d(parseFloat(Z.w),parseFloat(Z.h))));else{var ee=f.calcBoundingBox(H,S,D,R);H.intersection(M).length==0?X=Y.add(new v(G.graphManager,new c(ee.topLeftX,ee.topLeftY),new d(ee.width,ee.height))):X=Y.add(new v(G.graphManager,new c(ee.topLeftX,ee.topLeftY),new d(parseFloat(Z.w),parseFloat(Z.h))))}else X=Y.add(new v(G.graphManager,new c(H.position("x")-Z.w/2,H.position("y")-Z.h/2),new d(parseFloat(Z.w),parseFloat(Z.h))));else X=Y.add(new v(this.graphManager));if(X.id=H.data("id"),X.nodeRepulsion=N(U.nodeRepulsion,H),X.paddingLeft=parseInt(H.css("padding")),X.paddingTop=parseInt(H.css("padding")),X.paddingRight=parseInt(H.css("padding")),X.paddingBottom=parseInt(H.css("padding")),U.nodeDimensionsIncludeLabels&&(X.labelWidth=H.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).w,X.labelHeight=H.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).h,X.labelPosVertical=H.css("text-valign"),X.labelPosHorizontal=H.css("text-halign")),P[H.data("id")]=X,isNaN(X.rect.x)&&(X.rect.x=0),isNaN(X.rect.y)&&(X.rect.y=0),V!=null&&V.length>0){var re=void 0;re=G.getGraphManager().add(G.newGraph(),X),z(re,V,G,U)}}},O=function(Y,k,G){for(var U=0,W=0,j=0;j<G.length;j++){var H=G[j],V=P[H.data("source")],X=P[H.data("target")];if(V&&X&&V!==X&&V.getEdgesBetween(X).length==0){var Z=k.add(Y.newEdge(),V,X);Z.id=H.id(),Z.idealLength=N(E.idealEdgeLength,H),Z.edgeElasticity=N(E.edgeElasticity,H),U+=Z.idealLength,W++}}E.idealEdgeLength!=null&&(W>0?y.DEFAULT_EDGE_LENGTH=p.DEFAULT_EDGE_LENGTH=U/W:x(E.idealEdgeLength)?y.DEFAULT_EDGE_LENGTH=p.DEFAULT_EDGE_LENGTH=50:y.DEFAULT_EDGE_LENGTH=p.DEFAULT_EDGE_LENGTH=E.idealEdgeLength,y.MIN_REPULSION_DIST=p.MIN_REPULSION_DIST=p.DEFAULT_EDGE_LENGTH/10,y.DEFAULT_RADIAL_SEPARATION=p.DEFAULT_EDGE_LENGTH)},q=function(Y,k){k.fixedNodeConstraint&&(Y.constraints.fixedNodeConstraint=k.fixedNodeConstraint),k.alignmentConstraint&&(Y.constraints.alignmentConstraint=k.alignmentConstraint),k.relativePlacementConstraint&&(Y.constraints.relativePlacementConstraint=k.relativePlacementConstraint)};E.nestingFactor!=null&&(y.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=p.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=E.nestingFactor),E.gravity!=null&&(y.DEFAULT_GRAVITY_STRENGTH=p.DEFAULT_GRAVITY_STRENGTH=E.gravity),E.numIter!=null&&(y.MAX_ITERATIONS=p.MAX_ITERATIONS=E.numIter),E.gravityRange!=null&&(y.DEFAULT_GRAVITY_RANGE_FACTOR=p.DEFAULT_GRAVITY_RANGE_FACTOR=E.gravityRange),E.gravityCompound!=null&&(y.DEFAULT_COMPOUND_GRAVITY_STRENGTH=p.DEFAULT_COMPOUND_GRAVITY_STRENGTH=E.gravityCompound),E.gravityRangeCompound!=null&&(y.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=p.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=E.gravityRangeCompound),E.initialEnergyOnIncremental!=null&&(y.DEFAULT_COOLING_FACTOR_INCREMENTAL=p.DEFAULT_COOLING_FACTOR_INCREMENTAL=E.initialEnergyOnIncremental),E.tilingCompareBy!=null&&(y.TILING_COMPARE_BY=E.tilingCompareBy),E.quality=="proof"?g.QUALITY=2:g.QUALITY=0,y.NODE_DIMENSIONS_INCLUDE_LABELS=p.NODE_DIMENSIONS_INCLUDE_LABELS=g.NODE_DIMENSIONS_INCLUDE_LABELS=E.nodeDimensionsIncludeLabels,y.DEFAULT_INCREMENTAL=p.DEFAULT_INCREMENTAL=g.DEFAULT_INCREMENTAL=!E.randomize,y.ANIMATE=p.ANIMATE=g.ANIMATE=E.animate,y.TILE=E.tile,y.TILING_PADDING_VERTICAL=typeof E.tilingPaddingVertical=="function"?E.tilingPaddingVertical.call():E.tilingPaddingVertical,y.TILING_PADDING_HORIZONTAL=typeof E.tilingPaddingHorizontal=="function"?E.tilingPaddingHorizontal.call():E.tilingPaddingHorizontal,y.DEFAULT_INCREMENTAL=p.DEFAULT_INCREMENTAL=g.DEFAULT_INCREMENTAL=!0,y.PURE_INCREMENTAL=!E.randomize,g.DEFAULT_UNIFORM_LEAF_NODE_SIZES=E.uniformNodeDimensions,E.step=="transformed"&&(y.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,y.ENFORCE_CONSTRAINTS=!1,y.APPLY_LAYOUT=!1),E.step=="enforced"&&(y.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,y.ENFORCE_CONSTRAINTS=!0,y.APPLY_LAYOUT=!1),E.step=="cose"&&(y.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,y.ENFORCE_CONSTRAINTS=!1,y.APPLY_LAYOUT=!0),E.step=="all"&&(E.randomize?y.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:y.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,y.ENFORCE_CONSTRAINTS=!0,y.APPLY_LAYOUT=!0),E.fixedNodeConstraint||E.alignmentConstraint||E.relativePlacementConstraint?y.TREE_REDUCTION_ON_INCREMENTAL=!1:y.TREE_REDUCTION_ON_INCREMENTAL=!0;var _=new h,B=_.newGraphManager();return I(B.addRoot(),f.getTopMostNodes(C),_,E),O(_,B,A),q(_,E),_.runLayout(),P};s.exports={coseLayout:b}}),212:((s,u,l)=>{var f=(function(){function E(T,L){for(var w=0;w<L.length;w++){var C=L[w];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(T,C.key,C)}}return function(T,L,w){return L&&E(T.prototype,L),w&&E(T,w),T}})();function h(E,T){if(!(E instanceof T))throw new TypeError("Cannot call a class as a function")}var v=l(658),c=l(548),d=l(657),g=d.spectralLayout,p=l(816),y=p.coseLayout,b=Object.freeze({quality:"default",randomize:!0,animate:!0,animationDuration:1e3,animationEasing:void 0,fit:!0,padding:30,nodeDimensionsIncludeLabels:!1,uniformNodeDimensions:!1,packComponents:!0,step:"all",samplingType:!0,sampleSize:25,nodeSeparation:75,piTol:1e-7,nodeRepulsion:function(T){return 4500},idealEdgeLength:function(T){return 50},edgeElasticity:function(T){return .45},nestingFactor:.1,gravity:.25,numIter:2500,tile:!0,tilingCompareBy:void 0,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:.3,fixedNodeConstraint:void 0,alignmentConstraint:void 0,relativePlacementConstraint:void 0,ready:function(){},stop:function(){}}),m=(function(){function E(T){h(this,E),this.options=v({},b,T)}return f(E,[{key:"run",value:function(){var L=this,w=this.options,C=w.cy,A=w.eles,R=[],S=[],D=void 0,P=[];w.fixedNodeConstraint&&(!Array.isArray(w.fixedNodeConstraint)||w.fixedNodeConstraint.length==0)&&(w.fixedNodeConstraint=void 0),w.alignmentConstraint&&(w.alignmentConstraint.vertical&&(!Array.isArray(w.alignmentConstraint.vertical)||w.alignmentConstraint.vertical.length==0)&&(w.alignmentConstraint.vertical=void 0),w.alignmentConstraint.horizontal&&(!Array.isArray(w.alignmentConstraint.horizontal)||w.alignmentConstraint.horizontal.length==0)&&(w.alignmentConstraint.horizontal=void 0)),w.relativePlacementConstraint&&(!Array.isArray(w.relativePlacementConstraint)||w.relativePlacementConstraint.length==0)&&(w.relativePlacementConstraint=void 0);var x=w.fixedNodeConstraint||w.alignmentConstraint||w.relativePlacementConstraint;x&&(w.tile=!1,w.packComponents=!1);var N=void 0,M=!1;if(C.layoutUtilities&&w.packComponents&&(N=C.layoutUtilities("get"),N||(N=C.layoutUtilities()),M=!0),A.nodes().length>0)if(M){var q=c.getTopMostNodes(w.eles.nodes());if(D=c.connectComponents(C,w.eles,q),D.forEach(function(se){var oe=se.boundingBox();P.push({x:oe.x1+oe.w/2,y:oe.y1+oe.h/2})}),w.randomize&&D.forEach(function(se){w.eles=se,R.push(g(w))}),w.quality=="default"||w.quality=="proof"){var _=C.collection();if(w.tile){var B=new Map,z=[],Y=[],k=0,G={nodeIndexes:B,xCoords:z,yCoords:Y},U=[];if(D.forEach(function(se,oe){se.edges().length==0&&(se.nodes().forEach(function(he,le){_.merge(se.nodes()[le]),he.isParent()||(G.nodeIndexes.set(se.nodes()[le].id(),k++),G.xCoords.push(se.nodes()[0].position().x),G.yCoords.push(se.nodes()[0].position().y))}),U.push(oe))}),_.length>1){var W=_.boundingBox();P.push({x:W.x1+W.w/2,y:W.y1+W.h/2}),D.push(_),R.push(G);for(var j=U.length-1;j>=0;j--)D.splice(U[j],1),R.splice(U[j],1),P.splice(U[j],1)}}D.forEach(function(se,oe){w.eles=se,S.push(y(w,R[oe])),c.relocateComponent(P[oe],S[oe],w)})}else D.forEach(function(se,oe){c.relocateComponent(P[oe],R[oe],w)});var H=new Set;if(D.length>1){var V=[],X=A.filter(function(se){return se.css("display")=="none"});D.forEach(function(se,oe){var he=void 0;if(w.quality=="draft"&&(he=R[oe].nodeIndexes),se.nodes().not(X).length>0){var le={};le.edges=[],le.nodes=[];var de=void 0;se.nodes().not(X).forEach(function(pe){if(w.quality=="draft")if(!pe.isParent())de=he.get(pe.id()),le.nodes.push({x:R[oe].xCoords[de]-pe.boundingbox().w/2,y:R[oe].yCoords[de]-pe.boundingbox().h/2,width:pe.boundingbox().w,height:pe.boundingbox().h});else{var ce=c.calcBoundingBox(pe,R[oe].xCoords,R[oe].yCoords,he);le.nodes.push({x:ce.topLeftX,y:ce.topLeftY,width:ce.width,height:ce.height})}else S[oe][pe.id()]&&le.nodes.push({x:S[oe][pe.id()].getLeft(),y:S[oe][pe.id()].getTop(),width:S[oe][pe.id()].getWidth(),height:S[oe][pe.id()].getHeight()})}),se.edges().forEach(function(pe){var ce=pe.source(),ye=pe.target();if(ce.css("display")!="none"&&ye.css("display")!="none")if(w.quality=="draft"){var Le=he.get(ce.id()),_e=he.get(ye.id()),ke=[],Oe=[];if(ce.isParent()){var Fe=c.calcBoundingBox(ce,R[oe].xCoords,R[oe].yCoords,he);ke.push(Fe.topLeftX+Fe.width/2),ke.push(Fe.topLeftY+Fe.height/2)}else ke.push(R[oe].xCoords[Le]),ke.push(R[oe].yCoords[Le]);if(ye.isParent()){var Re=c.calcBoundingBox(ye,R[oe].xCoords,R[oe].yCoords,he);Oe.push(Re.topLeftX+Re.width/2),Oe.push(Re.topLeftY+Re.height/2)}else Oe.push(R[oe].xCoords[_e]),Oe.push(R[oe].yCoords[_e]);le.edges.push({startX:ke[0],startY:ke[1],endX:Oe[0],endY:Oe[1]})}else S[oe][ce.id()]&&S[oe][ye.id()]&&le.edges.push({startX:S[oe][ce.id()].getCenterX(),startY:S[oe][ce.id()].getCenterY(),endX:S[oe][ye.id()].getCenterX(),endY:S[oe][ye.id()].getCenterY()})}),le.nodes.length>0&&(V.push(le),H.add(oe))}});var Z=N.packComponents(V,w.randomize).shifts;if(w.quality=="draft")R.forEach(function(se,oe){var he=se.xCoords.map(function(de){return de+Z[oe].dx}),le=se.yCoords.map(function(de){return de+Z[oe].dy});se.xCoords=he,se.yCoords=le});else{var ee=0;H.forEach(function(se){Object.keys(S[se]).forEach(function(oe){var he=S[se][oe];he.setCenter(he.getCenterX()+Z[ee].dx,he.getCenterY()+Z[ee].dy)}),ee++})}}}else{var I=w.eles.boundingBox();if(P.push({x:I.x1+I.w/2,y:I.y1+I.h/2}),w.randomize){var O=g(w);R.push(O)}w.quality=="default"||w.quality=="proof"?(S.push(y(w,R[0])),c.relocateComponent(P[0],S[0],w)):c.relocateComponent(P[0],R[0],w)}var re=function(oe,he){if(w.quality=="default"||w.quality=="proof"){typeof oe=="number"&&(oe=he);var le=void 0,de=void 0,pe=oe.data("id");return S.forEach(function(ye){pe in ye&&(le={x:ye[pe].getRect().getCenterX(),y:ye[pe].getRect().getCenterY()},de=ye[pe])}),w.nodeDimensionsIncludeLabels&&(de.labelWidth&&(de.labelPosHorizontal=="left"?le.x+=de.labelWidth/2:de.labelPosHorizontal=="right"&&(le.x-=de.labelWidth/2)),de.labelHeight&&(de.labelPosVertical=="top"?le.y+=de.labelHeight/2:de.labelPosVertical=="bottom"&&(le.y-=de.labelHeight/2))),le==null&&(le={x:oe.position("x"),y:oe.position("y")}),{x:le.x,y:le.y}}else{var ce=void 0;return R.forEach(function(ye){var Le=ye.nodeIndexes.get(oe.id());Le!=null&&(ce={x:ye.xCoords[Le],y:ye.yCoords[Le]})}),ce==null&&(ce={x:oe.position("x"),y:oe.position("y")}),{x:ce.x,y:ce.y}}};if(w.quality=="default"||w.quality=="proof"||w.randomize){var ue=c.calcParentsWithoutChildren(C,A),xe=A.filter(function(se){return se.css("display")=="none"});w.eles=A.not(xe),A.nodes().not(":parent").not(xe).layoutPositions(L,w,re),ue.length>0&&ue.forEach(function(se){se.position(re(se))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),E})();s.exports=m}),657:((s,u,l)=>{var f=l(548),h=l(140).layoutBase.Matrix,v=l(140).layoutBase.SVD,c=function(g){var p=g.cy,y=g.eles,b=y.nodes(),m=y.nodes(":parent"),E=new Map,T=new Map,L=new Map,w=[],C=[],A=[],R=[],S=[],D=[],P=[],x=[],N=void 0,M=1e8,I=1e-9,O=g.piTol,q=g.samplingType,_=g.nodeSeparation,B=void 0,z=function(){for(var F=0,$=0,J=!1;$<B;){F=Math.floor(Math.random()*N),J=!1;for(var Q=0;Q<$;Q++)if(R[Q]==F){J=!0;break}if(!J)R[$]=F,$++;else continue}},Y=function(F,$,J){for(var Q=[],te=0,fe=0,ae=0,ie=void 0,ne=[],ve=0,Ce=1,Ee=0;Ee<N;Ee++)ne[Ee]=M;for(Q[fe]=F,ne[F]=0;fe>=te;){ae=Q[te++];for(var be=w[ae],me=0;me<be.length;me++)ie=T.get(be[me]),ne[ie]==M&&(ne[ie]=ne[ae]+1,Q[++fe]=ie);D[ae][$]=ne[ae]*_}if(J){for(var ge=0;ge<N;ge++)D[ge][$]<S[ge]&&(S[ge]=D[ge][$]);for(var Ie=0;Ie<N;Ie++)S[Ie]>ve&&(ve=S[Ie],Ce=Ie)}return Ce},k=function(F){var $=void 0;if(F){$=Math.floor(Math.random()*N);for(var Q=0;Q<N;Q++)S[Q]=M;for(var te=0;te<B;te++)R[te]=$,$=Y($,te,F)}else{z();for(var J=0;J<B;J++)Y(R[J],J,F)}for(var fe=0;fe<N;fe++)for(var ae=0;ae<B;ae++)D[fe][ae]*=D[fe][ae];for(var ie=0;ie<B;ie++)P[ie]=[];for(var ne=0;ne<B;ne++)for(var ve=0;ve<B;ve++)P[ne][ve]=D[R[ve]][ne]},G=function(){for(var F=v.svd(P),$=F.S,J=F.U,Q=F.V,te=$[0]*$[0]*$[0],fe=[],ae=0;ae<B;ae++){fe[ae]=[];for(var ie=0;ie<B;ie++)fe[ae][ie]=0,ae==ie&&(fe[ae][ie]=$[ae]/($[ae]*$[ae]+te/($[ae]*$[ae])))}x=h.multMat(h.multMat(Q,fe),h.transpose(J))},U=function(){for(var F=void 0,$=void 0,J=[],Q=[],te=[],fe=[],ae=0;ae<N;ae++)J[ae]=Math.random(),Q[ae]=Math.random();J=h.normalize(J),Q=h.normalize(Q);for(var ie=I,ne=I,ve=void 0;;){for(var Ce=0;Ce<N;Ce++)te[Ce]=J[Ce];if(J=h.multGamma(h.multL(h.multGamma(te),D,x)),F=h.dotProduct(te,J),J=h.normalize(J),ie=h.dotProduct(te,J),ve=Math.abs(ie/ne),ve<=1+O&&ve>=1)break;ne=ie}for(var Ee=0;Ee<N;Ee++)te[Ee]=J[Ee];for(ne=I;;){for(var be=0;be<N;be++)fe[be]=Q[be];if(fe=h.minusOp(fe,h.multCons(te,h.dotProduct(te,fe))),Q=h.multGamma(h.multL(h.multGamma(fe),D,x)),$=h.dotProduct(fe,Q),Q=h.normalize(Q),ie=h.dotProduct(fe,Q),ve=Math.abs(ie/ne),ve<=1+O&&ve>=1)break;ne=ie}for(var me=0;me<N;me++)fe[me]=Q[me];C=h.multCons(te,Math.sqrt(Math.abs(F))),A=h.multCons(fe,Math.sqrt(Math.abs($)))};f.connectComponents(p,y,f.getTopMostNodes(b),E),m.forEach(function(K){f.connectComponents(p,y,f.getTopMostNodes(K.descendants().intersection(y)),E)});for(var W=0,j=0;j<b.length;j++)b[j].isParent()||T.set(b[j].id(),W++);var H=!0,V=!1,X=void 0;try{for(var Z=E.keys()[Symbol.iterator](),ee;!(H=(ee=Z.next()).done);H=!0){var re=ee.value;T.set(re,W++)}}catch(K){V=!0,X=K}finally{try{!H&&Z.return&&Z.return()}finally{if(V)throw X}}for(var ue=0;ue<T.size;ue++)w[ue]=[];m.forEach(function(K){for(var F=K.children().intersection(y);F.nodes(":childless").length==0;)F=F.nodes()[0].children().intersection(y);var $=0,J=F.nodes(":childless")[0].connectedEdges().length;F.nodes(":childless").forEach(function(Q,te){Q.connectedEdges().length<J&&(J=Q.connectedEdges().length,$=te)}),L.set(K.id(),F.nodes(":childless")[$].id())}),b.forEach(function(K){var F=void 0;K.isParent()?F=T.get(L.get(K.id())):F=T.get(K.id()),K.neighborhood().nodes().forEach(function($){y.intersection(K.edgesWith($)).length>0&&($.isParent()?w[F].push(L.get($.id())):w[F].push($.id()))})});var xe=function(F){var $=T.get(F),J=void 0;E.get(F).forEach(function(Q){p.getElementById(Q).isParent()?J=L.get(Q):J=Q,w[$].push(J),w[T.get(J)].push(F)})},se=!0,oe=!1,he=void 0;try{for(var le=E.keys()[Symbol.iterator](),de;!(se=(de=le.next()).done);se=!0){var pe=de.value;xe(pe)}}catch(K){oe=!0,he=K}finally{try{!se&&le.return&&le.return()}finally{if(oe)throw he}}N=T.size;var ce=void 0;if(N>2){B=N<g.sampleSize?N:g.sampleSize;for(var ye=0;ye<N;ye++)D[ye]=[];for(var Le=0;Le<B;Le++)x[Le]=[];return g.quality=="draft"||g.step=="all"?(k(q),G(),U(),ce={nodeIndexes:T,xCoords:C,yCoords:A}):(T.forEach(function(K,F){C.push(p.getElementById(F).position("x")),A.push(p.getElementById(F).position("y"))}),ce={nodeIndexes:T,xCoords:C,yCoords:A}),ce}else{var _e=T.keys(),ke=p.getElementById(_e.next().value),Oe=ke.position(),Fe=ke.outerWidth();if(C.push(Oe.x),A.push(Oe.y),N==2){var Re=p.getElementById(_e.next().value),we=Re.outerWidth();C.push(Oe.x+Fe/2+we/2+g.idealEdgeLength),A.push(Oe.y)}return ce={nodeIndexes:T,xCoords:C,yCoords:A},ce}};s.exports={spectralLayout:c}}),579:((s,u,l)=>{var f=l(212),h=function(c){c&&c("layout","fcose",f)};typeof cytoscape<"u"&&h(cytoscape),s.exports=h}),140:(s=>{s.exports=r})},n={};function i(s){var u=n[s];if(u!==void 0)return u.exports;var l=n[s]={exports:{}};return a[s](l,l.exports,i),l.exports}var o=i(579);return o})()})})(oi)),oi.exports}var uI=sI();const bI=Cv(uI);var li={exports:{}},fi={exports:{}},hi={exports:{}},lI=hi.exports,vE;function fI(){return vE||(vE=1,(function(t,e){(function(a,n){t.exports=n()})(lI,function(){return(function(r){var a={};function n(i){if(a[i])return a[i].exports;var o=a[i]={i,l:!1,exports:{}};return r[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=r,n.c=a,n.i=function(i){return i},n.d=function(i,o,s){n.o(i,o)||Object.defineProperty(i,o,{configurable:!1,enumerable:!0,get:s})},n.n=function(i){var o=i&&i.__esModule?function(){return i.default}:function(){return i};return n.d(o,"a",o),o},n.o=function(i,o){return Object.prototype.hasOwnProperty.call(i,o)},n.p="",n(n.s=26)})([(function(r,a,n){function i(){}i.QUALITY=1,i.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,i.DEFAULT_INCREMENTAL=!1,i.DEFAULT_ANIMATION_ON_LAYOUT=!0,i.DEFAULT_ANIMATION_DURING_LAYOUT=!1,i.DEFAULT_ANIMATION_PERIOD=50,i.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,i.DEFAULT_GRAPH_MARGIN=15,i.NODE_DIMENSIONS_INCLUDE_LABELS=!1,i.SIMPLE_NODE_SIZE=40,i.SIMPLE_NODE_HALF_SIZE=i.SIMPLE_NODE_SIZE/2,i.EMPTY_COMPOUND_NODE_SIZE=40,i.MIN_EDGE_LENGTH=1,i.WORLD_BOUNDARY=1e6,i.INITIAL_WORLD_BOUNDARY=i.WORLD_BOUNDARY/1e3,i.WORLD_CENTER_X=1200,i.WORLD_CENTER_Y=900,r.exports=i}),(function(r,a,n){var i=n(2),o=n(8),s=n(9);function u(f,h,v){i.call(this,v),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=v,this.bendpoints=[],this.source=f,this.target=h}u.prototype=Object.create(i.prototype);for(var l in i)u[l]=i[l];u.prototype.getSource=function(){return this.source},u.prototype.getTarget=function(){return this.target},u.prototype.isInterGraph=function(){return this.isInterGraph},u.prototype.getLength=function(){return this.length},u.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},u.prototype.getBendpoints=function(){return this.bendpoints},u.prototype.getLca=function(){return this.lca},u.prototype.getSourceInLca=function(){return this.sourceInLca},u.prototype.getTargetInLca=function(){return this.targetInLca},u.prototype.getOtherEnd=function(f){if(this.source===f)return this.target;if(this.target===f)return this.source;throw"Node is not incident with this edge"},u.prototype.getOtherEndInGraph=function(f,h){for(var v=this.getOtherEnd(f),c=h.getGraphManager().getRoot();;){if(v.getOwner()==h)return v;if(v.getOwner()==c)break;v=v.getOwner().getParent()}return null},u.prototype.updateLength=function(){var f=new Array(4);this.isOverlapingSourceAndTarget=o.getIntersection(this.target.getRect(),this.source.getRect(),f),this.isOverlapingSourceAndTarget||(this.lengthX=f[0]-f[2],this.lengthY=f[1]-f[3],Math.abs(this.lengthX)<1&&(this.lengthX=s.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=s.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},u.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=s.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=s.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},r.exports=u}),(function(r,a,n){function i(o){this.vGraphObject=o}r.exports=i}),(function(r,a,n){var i=n(2),o=n(10),s=n(13),u=n(0),l=n(16),f=n(4);function h(c,d,g,p){g==null&&p==null&&(p=d),i.call(this,p),c.graphManager!=null&&(c=c.graphManager),this.estimatedSize=o.MIN_VALUE,this.inclusionTreeDepth=o.MAX_VALUE,this.vGraphObject=p,this.edges=[],this.graphManager=c,g!=null&&d!=null?this.rect=new s(d.x,d.y,g.width,g.height):this.rect=new s}h.prototype=Object.create(i.prototype);for(var v in i)h[v]=i[v];h.prototype.getEdges=function(){return this.edges},h.prototype.getChild=function(){return this.child},h.prototype.getOwner=function(){return this.owner},h.prototype.getWidth=function(){return this.rect.width},h.prototype.setWidth=function(c){this.rect.width=c},h.prototype.getHeight=function(){return this.rect.height},h.prototype.setHeight=function(c){this.rect.height=c},h.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},h.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},h.prototype.getCenter=function(){return new f(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},h.prototype.getLocation=function(){return new f(this.rect.x,this.rect.y)},h.prototype.getRect=function(){return this.rect},h.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},h.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},h.prototype.setRect=function(c,d){this.rect.x=c.x,this.rect.y=c.y,this.rect.width=d.width,this.rect.height=d.height},h.prototype.setCenter=function(c,d){this.rect.x=c-this.rect.width/2,this.rect.y=d-this.rect.height/2},h.prototype.setLocation=function(c,d){this.rect.x=c,this.rect.y=d},h.prototype.moveBy=function(c,d){this.rect.x+=c,this.rect.y+=d},h.prototype.getEdgeListToNode=function(c){var d=[],g=this;return g.edges.forEach(function(p){if(p.target==c){if(p.source!=g)throw"Incorrect edge source!";d.push(p)}}),d},h.prototype.getEdgesBetween=function(c){var d=[],g=this;return g.edges.forEach(function(p){if(!(p.source==g||p.target==g))throw"Incorrect edge source and/or target";(p.target==c||p.source==c)&&d.push(p)}),d},h.prototype.getNeighborsList=function(){var c=new Set,d=this;return d.edges.forEach(function(g){if(g.source==d)c.add(g.target);else{if(g.target!=d)throw"Incorrect incidency!";c.add(g.source)}}),c},h.prototype.withChildren=function(){var c=new Set,d,g;if(c.add(this),this.child!=null)for(var p=this.child.getNodes(),y=0;y<p.length;y++)d=p[y],g=d.withChildren(),g.forEach(function(b){c.add(b)});return c},h.prototype.getNoOfChildren=function(){var c=0,d;if(this.child==null)c=1;else for(var g=this.child.getNodes(),p=0;p<g.length;p++)d=g[p],c+=d.getNoOfChildren();return c==0&&(c=1),c},h.prototype.getEstimatedSize=function(){if(this.estimatedSize==o.MIN_VALUE)throw"assert failed";return this.estimatedSize},h.prototype.calcEstimatedSize=function(){return this.child==null?this.estimatedSize=(this.rect.width+this.rect.height)/2:(this.estimatedSize=this.child.calcEstimatedSize(),this.rect.width=this.estimatedSize,this.rect.height=this.estimatedSize,this.estimatedSize)},h.prototype.scatter=function(){var c,d,g=-u.INITIAL_WORLD_BOUNDARY,p=u.INITIAL_WORLD_BOUNDARY;c=u.WORLD_CENTER_X+l.nextDouble()*(p-g)+g;var y=-u.INITIAL_WORLD_BOUNDARY,b=u.INITIAL_WORLD_BOUNDARY;d=u.WORLD_CENTER_Y+l.nextDouble()*(b-y)+y,this.rect.x=c,this.rect.y=d},h.prototype.updateBounds=function(){if(this.getChild()==null)throw"assert failed";if(this.getChild().getNodes().length!=0){var c=this.getChild();if(c.updateBounds(!0),this.rect.x=c.getLeft(),this.rect.y=c.getTop(),this.setWidth(c.getRight()-c.getLeft()),this.setHeight(c.getBottom()-c.getTop()),u.NODE_DIMENSIONS_INCLUDE_LABELS){var d=c.getRight()-c.getLeft(),g=c.getBottom()-c.getTop();this.labelWidth>d&&(this.rect.x-=(this.labelWidth-d)/2,this.setWidth(this.labelWidth)),this.labelHeight>g&&(this.labelPos=="center"?this.rect.y-=(this.labelHeight-g)/2:this.labelPos=="top"&&(this.rect.y-=this.labelHeight-g),this.setHeight(this.labelHeight))}}},h.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==o.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},h.prototype.transform=function(c){var d=this.rect.x;d>u.WORLD_BOUNDARY?d=u.WORLD_BOUNDARY:d<-u.WORLD_BOUNDARY&&(d=-u.WORLD_BOUNDARY);var g=this.rect.y;g>u.WORLD_BOUNDARY?g=u.WORLD_BOUNDARY:g<-u.WORLD_BOUNDARY&&(g=-u.WORLD_BOUNDARY);var p=new f(d,g),y=c.inverseTransformPoint(p);this.setLocation(y.x,y.y)},h.prototype.getLeft=function(){return this.rect.x},h.prototype.getRight=function(){return this.rect.x+this.rect.width},h.prototype.getTop=function(){return this.rect.y},h.prototype.getBottom=function(){return this.rect.y+this.rect.height},h.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},r.exports=h}),(function(r,a,n){function i(o,s){o==null&&s==null?(this.x=0,this.y=0):(this.x=o,this.y=s)}i.prototype.getX=function(){return this.x},i.prototype.getY=function(){return this.y},i.prototype.setX=function(o){this.x=o},i.prototype.setY=function(o){this.y=o},i.prototype.getDifference=function(o){return new DimensionD(this.x-o.x,this.y-o.y)},i.prototype.getCopy=function(){return new i(this.x,this.y)},i.prototype.translate=function(o){return this.x+=o.width,this.y+=o.height,this},r.exports=i}),(function(r,a,n){var i=n(2),o=n(10),s=n(0),u=n(6),l=n(3),f=n(1),h=n(13),v=n(12),c=n(11);function d(p,y,b){i.call(this,b),this.estimatedSize=o.MIN_VALUE,this.margin=s.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=p,y!=null&&y instanceof u?this.graphManager=y:y!=null&&y instanceof Layout&&(this.graphManager=y.graphManager)}d.prototype=Object.create(i.prototype);for(var g in i)d[g]=i[g];d.prototype.getNodes=function(){return this.nodes},d.prototype.getEdges=function(){return this.edges},d.prototype.getGraphManager=function(){return this.graphManager},d.prototype.getParent=function(){return this.parent},d.prototype.getLeft=function(){return this.left},d.prototype.getRight=function(){return this.right},d.prototype.getTop=function(){return this.top},d.prototype.getBottom=function(){return this.bottom},d.prototype.isConnected=function(){return this.isConnected},d.prototype.add=function(p,y,b){if(y==null&&b==null){var m=p;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(m)>-1)throw"Node already in graph!";return m.owner=this,this.getNodes().push(m),m}else{var E=p;if(!(this.getNodes().indexOf(y)>-1&&this.getNodes().indexOf(b)>-1))throw"Source or target not in graph!";if(!(y.owner==b.owner&&y.owner==this))throw"Both owners must be this graph!";return y.owner!=b.owner?null:(E.source=y,E.target=b,E.isInterGraph=!1,this.getEdges().push(E),y.edges.push(E),b!=y&&b.edges.push(E),E)}},d.prototype.remove=function(p){var y=p;if(p instanceof l){if(y==null)throw"Node is null!";if(!(y.owner!=null&&y.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var b=y.edges.slice(),m,E=b.length,T=0;T<E;T++)m=b[T],m.isInterGraph?this.graphManager.remove(m):m.source.owner.remove(m);var L=this.nodes.indexOf(y);if(L==-1)throw"Node not in owner node list!";this.nodes.splice(L,1)}else if(p instanceof f){var m=p;if(m==null)throw"Edge is null!";if(!(m.source!=null&&m.target!=null))throw"Source and/or target is null!";if(!(m.source.owner!=null&&m.target.owner!=null&&m.source.owner==this&&m.target.owner==this))throw"Source and/or target owner is invalid!";var w=m.source.edges.indexOf(m),C=m.target.edges.indexOf(m);if(!(w>-1&&C>-1))throw"Source and/or target doesn't know this edge!";m.source.edges.splice(w,1),m.target!=m.source&&m.target.edges.splice(C,1);var L=m.source.owner.getEdges().indexOf(m);if(L==-1)throw"Not in owner's edge list!";m.source.owner.getEdges().splice(L,1)}},d.prototype.updateLeftTop=function(){for(var p=o.MAX_VALUE,y=o.MAX_VALUE,b,m,E,T=this.getNodes(),L=T.length,w=0;w<L;w++){var C=T[w];b=C.getTop(),m=C.getLeft(),p>b&&(p=b),y>m&&(y=m)}return p==o.MAX_VALUE?null:(T[0].getParent().paddingLeft!=null?E=T[0].getParent().paddingLeft:E=this.margin,this.left=y-E,this.top=p-E,new v(this.left,this.top))},d.prototype.updateBounds=function(p){for(var y=o.MAX_VALUE,b=-o.MAX_VALUE,m=o.MAX_VALUE,E=-o.MAX_VALUE,T,L,w,C,A,R=this.nodes,S=R.length,D=0;D<S;D++){var P=R[D];p&&P.child!=null&&P.updateBounds(),T=P.getLeft(),L=P.getRight(),w=P.getTop(),C=P.getBottom(),y>T&&(y=T),b<L&&(b=L),m>w&&(m=w),E<C&&(E=C)}var x=new h(y,m,b-y,E-m);y==o.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),R[0].getParent().paddingLeft!=null?A=R[0].getParent().paddingLeft:A=this.margin,this.left=x.x-A,this.right=x.x+x.width+A,this.top=x.y-A,this.bottom=x.y+x.height+A},d.calculateBounds=function(p){for(var y=o.MAX_VALUE,b=-o.MAX_VALUE,m=o.MAX_VALUE,E=-o.MAX_VALUE,T,L,w,C,A=p.length,R=0;R<A;R++){var S=p[R];T=S.getLeft(),L=S.getRight(),w=S.getTop(),C=S.getBottom(),y>T&&(y=T),b<L&&(b=L),m>w&&(m=w),E<C&&(E=C)}var D=new h(y,m,b-y,E-m);return D},d.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},d.prototype.getEstimatedSize=function(){if(this.estimatedSize==o.MIN_VALUE)throw"assert failed";return this.estimatedSize},d.prototype.calcEstimatedSize=function(){for(var p=0,y=this.nodes,b=y.length,m=0;m<b;m++){var E=y[m];p+=E.calcEstimatedSize()}return p==0?this.estimatedSize=s.EMPTY_COMPOUND_NODE_SIZE:this.estimatedSize=p/Math.sqrt(this.nodes.length),this.estimatedSize},d.prototype.updateConnected=function(){var p=this;if(this.nodes.length==0){this.isConnected=!0;return}var y=new c,b=new Set,m=this.nodes[0],E,T,L=m.withChildren();for(L.forEach(function(D){y.push(D),b.add(D)});y.length!==0;){m=y.shift(),E=m.getEdges();for(var w=E.length,C=0;C<w;C++){var A=E[C];if(T=A.getOtherEndInGraph(m,this),T!=null&&!b.has(T)){var R=T.withChildren();R.forEach(function(D){y.push(D),b.add(D)})}}}if(this.isConnected=!1,b.size>=this.nodes.length){var S=0;b.forEach(function(D){D.owner==p&&S++}),S==this.nodes.length&&(this.isConnected=!0)}},r.exports=d}),(function(r,a,n){var i,o=n(1);function s(u){i=n(5),this.layout=u,this.graphs=[],this.edges=[]}s.prototype.addRoot=function(){var u=this.layout.newGraph(),l=this.layout.newNode(null),f=this.add(u,l);return this.setRootGraph(f),this.rootGraph},s.prototype.add=function(u,l,f,h,v){if(f==null&&h==null&&v==null){if(u==null)throw"Graph is null!";if(l==null)throw"Parent node is null!";if(this.graphs.indexOf(u)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(u),u.parent!=null)throw"Already has a parent!";if(l.child!=null)throw"Already has a child!";return u.parent=l,l.child=u,u}else{v=f,h=l,f=u;var c=h.getOwner(),d=v.getOwner();if(!(c!=null&&c.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(d!=null&&d.getGraphManager()==this))throw"Target not in this graph mgr!";if(c==d)return f.isInterGraph=!1,c.add(f,h,v);if(f.isInterGraph=!0,f.source=h,f.target=v,this.edges.indexOf(f)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(f),!(f.source!=null&&f.target!=null))throw"Edge source and/or target is null!";if(!(f.source.edges.indexOf(f)==-1&&f.target.edges.indexOf(f)==-1))throw"Edge already in source and/or target incidency list!";return f.source.edges.push(f),f.target.edges.push(f),f}},s.prototype.remove=function(u){if(u instanceof i){var l=u;if(l.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(l==this.rootGraph||l.parent!=null&&l.parent.graphManager==this))throw"Invalid parent node!";var f=[];f=f.concat(l.getEdges());for(var h,v=f.length,c=0;c<v;c++)h=f[c],l.remove(h);var d=[];d=d.concat(l.getNodes());var g;v=d.length;for(var c=0;c<v;c++)g=d[c],l.remove(g);l==this.rootGraph&&this.setRootGraph(null);var p=this.graphs.indexOf(l);this.graphs.splice(p,1),l.parent=null}else if(u instanceof o){if(h=u,h==null)throw"Edge is null!";if(!h.isInterGraph)throw"Not an inter-graph edge!";if(!(h.source!=null&&h.target!=null))throw"Source and/or target is null!";if(!(h.source.edges.indexOf(h)!=-1&&h.target.edges.indexOf(h)!=-1))throw"Source and/or target doesn't know this edge!";var p=h.source.edges.indexOf(h);if(h.source.edges.splice(p,1),p=h.target.edges.indexOf(h),h.target.edges.splice(p,1),!(h.source.owner!=null&&h.source.owner.getGraphManager()!=null))throw"Edge owner graph or owner graph manager is null!";if(h.source.owner.getGraphManager().edges.indexOf(h)==-1)throw"Not in owner graph manager's edge list!";var p=h.source.owner.getGraphManager().edges.indexOf(h);h.source.owner.getGraphManager().edges.splice(p,1)}},s.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},s.prototype.getGraphs=function(){return this.graphs},s.prototype.getAllNodes=function(){if(this.allNodes==null){for(var u=[],l=this.getGraphs(),f=l.length,h=0;h<f;h++)u=u.concat(l[h].getNodes());this.allNodes=u}return this.allNodes},s.prototype.resetAllNodes=function(){this.allNodes=null},s.prototype.resetAllEdges=function(){this.allEdges=null},s.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},s.prototype.getAllEdges=function(){if(this.allEdges==null){var u=[],l=this.getGraphs();l.length;for(var f=0;f<l.length;f++)u=u.concat(l[f].getEdges());u=u.concat(this.edges),this.allEdges=u}return this.allEdges},s.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},s.prototype.setAllNodesToApplyGravitation=function(u){if(this.allNodesToApplyGravitation!=null)throw"assert failed";this.allNodesToApplyGravitation=u},s.prototype.getRoot=function(){return this.rootGraph},s.prototype.setRootGraph=function(u){if(u.getGraphManager()!=this)throw"Root not in this graph mgr!";this.rootGraph=u,u.parent==null&&(u.parent=this.layout.newNode("Root node"))},s.prototype.getLayout=function(){return this.layout},s.prototype.isOneAncestorOfOther=function(u,l){if(!(u!=null&&l!=null))throw"assert failed";if(u==l)return!0;var f=u.getOwner(),h;do{if(h=f.getParent(),h==null)break;if(h==l)return!0;if(f=h.getOwner(),f==null)break}while(!0);f=l.getOwner();do{if(h=f.getParent(),h==null)break;if(h==u)return!0;if(f=h.getOwner(),f==null)break}while(!0);return!1},s.prototype.calcLowestCommonAncestors=function(){for(var u,l,f,h,v,c=this.getAllEdges(),d=c.length,g=0;g<d;g++){if(u=c[g],l=u.source,f=u.target,u.lca=null,u.sourceInLca=l,u.targetInLca=f,l==f){u.lca=l.getOwner();continue}for(h=l.getOwner();u.lca==null;){for(u.targetInLca=f,v=f.getOwner();u.lca==null;){if(v==h){u.lca=v;break}if(v==this.rootGraph)break;if(u.lca!=null)throw"assert failed";u.targetInLca=v.getParent(),v=u.targetInLca.getOwner()}if(h==this.rootGraph)break;u.lca==null&&(u.sourceInLca=h.getParent(),h=u.sourceInLca.getOwner())}if(u.lca==null)throw"assert failed"}},s.prototype.calcLowestCommonAncestor=function(u,l){if(u==l)return u.getOwner();var f=u.getOwner();do{if(f==null)break;var h=l.getOwner();do{if(h==null)break;if(h==f)return h;h=h.getParent().getOwner()}while(!0);f=f.getParent().getOwner()}while(!0);return f},s.prototype.calcInclusionTreeDepths=function(u,l){u==null&&l==null&&(u=this.rootGraph,l=1);for(var f,h=u.getNodes(),v=h.length,c=0;c<v;c++)f=h[c],f.inclusionTreeDepth=l,f.child!=null&&this.calcInclusionTreeDepths(f.child,l+1)},s.prototype.includesInvalidEdge=function(){for(var u,l=this.edges.length,f=0;f<l;f++)if(u=this.edges[f],this.isOneAncestorOfOther(u.source,u.target))return!0;return!1},r.exports=s}),(function(r,a,n){var i=n(0);function o(){}for(var s in i)o[s]=i[s];o.MAX_ITERATIONS=2500,o.DEFAULT_EDGE_LENGTH=50,o.DEFAULT_SPRING_STRENGTH=.45,o.DEFAULT_REPULSION_STRENGTH=4500,o.DEFAULT_GRAVITY_STRENGTH=.4,o.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,o.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,o.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,o.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,o.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,o.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,o.COOLING_ADAPTATION_FACTOR=.33,o.ADAPTATION_LOWER_NODE_LIMIT=1e3,o.ADAPTATION_UPPER_NODE_LIMIT=5e3,o.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,o.MAX_NODE_DISPLACEMENT=o.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,o.MIN_REPULSION_DIST=o.DEFAULT_EDGE_LENGTH/10,o.CONVERGENCE_CHECK_PERIOD=100,o.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,o.MIN_EDGE_LENGTH=1,o.GRID_CALCULATION_CHECK_PERIOD=10,r.exports=o}),(function(r,a,n){var i=n(12);function o(){}o.calcSeparationAmount=function(s,u,l,f){if(!s.intersects(u))throw"assert failed";var h=new Array(2);this.decideDirectionsForOverlappingNodes(s,u,h),l[0]=Math.min(s.getRight(),u.getRight())-Math.max(s.x,u.x),l[1]=Math.min(s.getBottom(),u.getBottom())-Math.max(s.y,u.y),s.getX()<=u.getX()&&s.getRight()>=u.getRight()?l[0]+=Math.min(u.getX()-s.getX(),s.getRight()-u.getRight()):u.getX()<=s.getX()&&u.getRight()>=s.getRight()&&(l[0]+=Math.min(s.getX()-u.getX(),u.getRight()-s.getRight())),s.getY()<=u.getY()&&s.getBottom()>=u.getBottom()?l[1]+=Math.min(u.getY()-s.getY(),s.getBottom()-u.getBottom()):u.getY()<=s.getY()&&u.getBottom()>=s.getBottom()&&(l[1]+=Math.min(s.getY()-u.getY(),u.getBottom()-s.getBottom()));var v=Math.abs((u.getCenterY()-s.getCenterY())/(u.getCenterX()-s.getCenterX()));u.getCenterY()===s.getCenterY()&&u.getCenterX()===s.getCenterX()&&(v=1);var c=v*l[0],d=l[1]/v;l[0]<d?d=l[0]:c=l[1],l[0]=-1*h[0]*(d/2+f),l[1]=-1*h[1]*(c/2+f)},o.decideDirectionsForOverlappingNodes=function(s,u,l){s.getCenterX()<u.getCenterX()?l[0]=-1:l[0]=1,s.getCenterY()<u.getCenterY()?l[1]=-1:l[1]=1},o.getIntersection2=function(s,u,l){var f=s.getCenterX(),h=s.getCenterY(),v=u.getCenterX(),c=u.getCenterY();if(s.intersects(u))return l[0]=f,l[1]=h,l[2]=v,l[3]=c,!0;var d=s.getX(),g=s.getY(),p=s.getRight(),y=s.getX(),b=s.getBottom(),m=s.getRight(),E=s.getWidthHalf(),T=s.getHeightHalf(),L=u.getX(),w=u.getY(),C=u.getRight(),A=u.getX(),R=u.getBottom(),S=u.getRight(),D=u.getWidthHalf(),P=u.getHeightHalf(),x=!1,N=!1;if(f===v){if(h>c)return l[0]=f,l[1]=g,l[2]=v,l[3]=R,!1;if(h<c)return l[0]=f,l[1]=b,l[2]=v,l[3]=w,!1}else if(h===c){if(f>v)return l[0]=d,l[1]=h,l[2]=C,l[3]=c,!1;if(f<v)return l[0]=p,l[1]=h,l[2]=L,l[3]=c,!1}else{var M=s.height/s.width,I=u.height/u.width,O=(c-h)/(v-f),q=void 0,_=void 0,B=void 0,z=void 0,Y=void 0,k=void 0;if(-M===O?f>v?(l[0]=y,l[1]=b,x=!0):(l[0]=p,l[1]=g,x=!0):M===O&&(f>v?(l[0]=d,l[1]=g,x=!0):(l[0]=m,l[1]=b,x=!0)),-I===O?v>f?(l[2]=A,l[3]=R,N=!0):(l[2]=C,l[3]=w,N=!0):I===O&&(v>f?(l[2]=L,l[3]=w,N=!0):(l[2]=S,l[3]=R,N=!0)),x&&N)return!1;if(f>v?h>c?(q=this.getCardinalDirection(M,O,4),_=this.getCardinalDirection(I,O,2)):(q=this.getCardinalDirection(-M,O,3),_=this.getCardinalDirection(-I,O,1)):h>c?(q=this.getCardinalDirection(-M,O,1),_=this.getCardinalDirection(-I,O,3)):(q=this.getCardinalDirection(M,O,2),_=this.getCardinalDirection(I,O,4)),!x)switch(q){case 1:z=g,B=f+-T/O,l[0]=B,l[1]=z;break;case 2:B=m,z=h+E*O,l[0]=B,l[1]=z;break;case 3:z=b,B=f+T/O,l[0]=B,l[1]=z;break;case 4:B=y,z=h+-E*O,l[0]=B,l[1]=z;break}if(!N)switch(_){case 1:k=w,Y=v+-P/O,l[2]=Y,l[3]=k;break;case 2:Y=S,k=c+D*O,l[2]=Y,l[3]=k;break;case 3:k=R,Y=v+P/O,l[2]=Y,l[3]=k;break;case 4:Y=A,k=c+-D*O,l[2]=Y,l[3]=k;break}}return!1},o.getCardinalDirection=function(s,u,l){return s>u?l:1+l%4},o.getIntersection=function(s,u,l,f){if(f==null)return this.getIntersection2(s,u,l);var h=s.x,v=s.y,c=u.x,d=u.y,g=l.x,p=l.y,y=f.x,b=f.y,m=void 0,E=void 0,T=void 0,L=void 0,w=void 0,C=void 0,A=void 0,R=void 0,S=void 0;return T=d-v,w=h-c,A=c*v-h*d,L=b-p,C=g-y,R=y*p-g*b,S=T*C-L*w,S===0?null:(m=(w*R-C*A)/S,E=(L*A-T*R)/S,new i(m,E))},o.angleOfVector=function(s,u,l,f){var h=void 0;return s!==l?(h=Math.atan((f-u)/(l-s)),l<s?h+=Math.PI:f<u&&(h+=this.TWO_PI)):f<u?h=this.ONE_AND_HALF_PI:h=this.HALF_PI,h},o.doIntersect=function(s,u,l,f){var h=s.x,v=s.y,c=u.x,d=u.y,g=l.x,p=l.y,y=f.x,b=f.y,m=(c-h)*(b-p)-(y-g)*(d-v);if(m===0)return!1;var E=((b-p)*(y-h)+(g-y)*(b-v))/m,T=((v-d)*(y-h)+(c-h)*(b-v))/m;return 0<E&&E<1&&0<T&&T<1},o.HALF_PI=.5*Math.PI,o.ONE_AND_HALF_PI=1.5*Math.PI,o.TWO_PI=2*Math.PI,o.THREE_PI=3*Math.PI,r.exports=o}),(function(r,a,n){function i(){}i.sign=function(o){return o>0?1:o<0?-1:0},i.floor=function(o){return o<0?Math.ceil(o):Math.floor(o)},i.ceil=function(o){return o<0?Math.floor(o):Math.ceil(o)},r.exports=i}),(function(r,a,n){function i(){}i.MAX_VALUE=2147483647,i.MIN_VALUE=-2147483648,r.exports=i}),(function(r,a,n){var i=(function(){function h(v,c){for(var d=0;d<c.length;d++){var g=c[d];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(v,g.key,g)}}return function(v,c,d){return c&&h(v.prototype,c),d&&h(v,d),v}})();function o(h,v){if(!(h instanceof v))throw new TypeError("Cannot call a class as a function")}var s=function(v){return{value:v,next:null,prev:null}},u=function(v,c,d,g){return v!==null?v.next=c:g.head=c,d!==null?d.prev=c:g.tail=c,c.prev=v,c.next=d,g.length++,c},l=function(v,c){var d=v.prev,g=v.next;return d!==null?d.next=g:c.head=g,g!==null?g.prev=d:c.tail=d,v.prev=v.next=null,c.length--,v},f=(function(){function h(v){var c=this;o(this,h),this.length=0,this.head=null,this.tail=null,v!=null&&v.forEach(function(d){return c.push(d)})}return i(h,[{key:"size",value:function(){return this.length}},{key:"insertBefore",value:function(c,d){return u(d.prev,s(c),d,this)}},{key:"insertAfter",value:function(c,d){return u(d,s(c),d.next,this)}},{key:"insertNodeBefore",value:function(c,d){return u(d.prev,c,d,this)}},{key:"insertNodeAfter",value:function(c,d){return u(d,c,d.next,this)}},{key:"push",value:function(c){return u(this.tail,s(c),null,this)}},{key:"unshift",value:function(c){return u(null,s(c),this.head,this)}},{key:"remove",value:function(c){return l(c,this)}},{key:"pop",value:function(){return l(this.tail,this).value}},{key:"popNode",value:function(){return l(this.tail,this)}},{key:"shift",value:function(){return l(this.head,this).value}},{key:"shiftNode",value:function(){return l(this.head,this)}},{key:"get_object_at",value:function(c){if(c<=this.length()){for(var d=1,g=this.head;d<c;)g=g.next,d++;return g.value}}},{key:"set_object_at",value:function(c,d){if(c<=this.length()){for(var g=1,p=this.head;g<c;)p=p.next,g++;p.value=d}}}]),h})();r.exports=f}),(function(r,a,n){function i(o,s,u){this.x=null,this.y=null,o==null&&s==null&&u==null?(this.x=0,this.y=0):typeof o=="number"&&typeof s=="number"&&u==null?(this.x=o,this.y=s):o.constructor.name=="Point"&&s==null&&u==null&&(u=o,this.x=u.x,this.y=u.y)}i.prototype.getX=function(){return this.x},i.prototype.getY=function(){return this.y},i.prototype.getLocation=function(){return new i(this.x,this.y)},i.prototype.setLocation=function(o,s,u){o.constructor.name=="Point"&&s==null&&u==null?(u=o,this.setLocation(u.x,u.y)):typeof o=="number"&&typeof s=="number"&&u==null&&(parseInt(o)==o&&parseInt(s)==s?this.move(o,s):(this.x=Math.floor(o+.5),this.y=Math.floor(s+.5)))},i.prototype.move=function(o,s){this.x=o,this.y=s},i.prototype.translate=function(o,s){this.x+=o,this.y+=s},i.prototype.equals=function(o){if(o.constructor.name=="Point"){var s=o;return this.x==s.x&&this.y==s.y}return this==o},i.prototype.toString=function(){return new i().constructor.name+"[x="+this.x+",y="+this.y+"]"},r.exports=i}),(function(r,a,n){function i(o,s,u,l){this.x=0,this.y=0,this.width=0,this.height=0,o!=null&&s!=null&&u!=null&&l!=null&&(this.x=o,this.y=s,this.width=u,this.height=l)}i.prototype.getX=function(){return this.x},i.prototype.setX=function(o){this.x=o},i.prototype.getY=function(){return this.y},i.prototype.setY=function(o){this.y=o},i.prototype.getWidth=function(){return this.width},i.prototype.setWidth=function(o){this.width=o},i.prototype.getHeight=function(){return this.height},i.prototype.setHeight=function(o){this.height=o},i.prototype.getRight=function(){return this.x+this.width},i.prototype.getBottom=function(){return this.y+this.height},i.prototype.intersects=function(o){return!(this.getRight()<o.x||this.getBottom()<o.y||o.getRight()<this.x||o.getBottom()<this.y)},i.prototype.getCenterX=function(){return this.x+this.width/2},i.prototype.getMinX=function(){return this.getX()},i.prototype.getMaxX=function(){return this.getX()+this.width},i.prototype.getCenterY=function(){return this.y+this.height/2},i.prototype.getMinY=function(){return this.getY()},i.prototype.getMaxY=function(){return this.getY()+this.height},i.prototype.getWidthHalf=function(){return this.width/2},i.prototype.getHeightHalf=function(){return this.height/2},r.exports=i}),(function(r,a,n){var i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(s){return typeof s}:function(s){return s&&typeof Symbol=="function"&&s.constructor===Symbol&&s!==Symbol.prototype?"symbol":typeof s};function o(){}o.lastID=0,o.createID=function(s){return o.isPrimitive(s)?s:(s.uniqueID!=null||(s.uniqueID=o.getString(),o.lastID++),s.uniqueID)},o.getString=function(s){return s==null&&(s=o.lastID),"Object#"+s},o.isPrimitive=function(s){var u=typeof s>"u"?"undefined":i(s);return s==null||u!="object"&&u!="function"},r.exports=o}),(function(r,a,n){function i(g){if(Array.isArray(g)){for(var p=0,y=Array(g.length);p<g.length;p++)y[p]=g[p];return y}else return Array.from(g)}var o=n(0),s=n(6),u=n(3),l=n(1),f=n(5),h=n(4),v=n(17),c=n(27);function d(g){c.call(this),this.layoutQuality=o.QUALITY,this.createBendsAsNeeded=o.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=o.DEFAULT_INCREMENTAL,this.animationOnLayout=o.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=o.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=o.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=o.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new s(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,g!=null&&(this.isRemoteUse=g)}d.RANDOM_SEED=1,d.prototype=Object.create(c.prototype),d.prototype.getGraphManager=function(){return this.graphManager},d.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},d.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},d.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},d.prototype.newGraphManager=function(){var g=new s(this);return this.graphManager=g,g},d.prototype.newGraph=function(g){return new f(null,this.graphManager,g)},d.prototype.newNode=function(g){return new u(this.graphManager,g)},d.prototype.newEdge=function(g){return new l(null,null,g)},d.prototype.checkLayoutSuccess=function(){return this.graphManager.getRoot()==null||this.graphManager.getRoot().getNodes().length==0||this.graphManager.includesInvalidEdge()},d.prototype.runLayout=function(){this.isLayoutFinished=!1,this.tilingPreLayout&&this.tilingPreLayout(),this.initParameters();var g;return this.checkLayoutSuccess()?g=!1:g=this.layout(),o.ANIMATE==="during"?!1:(g&&(this.isSubLayout||this.doPostLayout()),this.tilingPostLayout&&this.tilingPostLayout(),this.isLayoutFinished=!0,g)},d.prototype.doPostLayout=function(){this.incremental||this.transform(),this.update()},d.prototype.update2=function(){if(this.createBendsAsNeeded&&(this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges()),!this.isRemoteUse){for(var g=this.graphManager.getAllEdges(),p=0;p<g.length;p++)g[p];for(var y=this.graphManager.getRoot().getNodes(),p=0;p<y.length;p++)y[p];this.update(this.graphManager.getRoot())}},d.prototype.update=function(g){if(g==null)this.update2();else if(g instanceof u){var p=g;if(p.getChild()!=null)for(var y=p.getChild().getNodes(),b=0;b<y.length;b++)update(y[b]);if(p.vGraphObject!=null){var m=p.vGraphObject;m.update(p)}}else if(g instanceof l){var E=g;if(E.vGraphObject!=null){var T=E.vGraphObject;T.update(E)}}else if(g instanceof f){var L=g;if(L.vGraphObject!=null){var w=L.vGraphObject;w.update(L)}}},d.prototype.initParameters=function(){this.isSubLayout||(this.layoutQuality=o.QUALITY,this.animationDuringLayout=o.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=o.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=o.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=o.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=o.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=o.DEFAULT_UNIFORM_LEAF_NODE_SIZES),this.animationDuringLayout&&(this.animationOnLayout=!1)},d.prototype.transform=function(g){if(g==null)this.transform(new h(0,0));else{var p=new v,y=this.graphManager.getRoot().updateLeftTop();if(y!=null){p.setWorldOrgX(g.x),p.setWorldOrgY(g.y),p.setDeviceOrgX(y.x),p.setDeviceOrgY(y.y);for(var b=this.getAllNodes(),m,E=0;E<b.length;E++)m=b[E],m.transform(p)}}},d.prototype.positionNodesRandomly=function(g){if(g==null)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else for(var p,y,b=g.getNodes(),m=0;m<b.length;m++)p=b[m],y=p.getChild(),y==null||y.getNodes().length==0?p.scatter():(this.positionNodesRandomly(y),p.updateBounds())},d.prototype.getFlatForest=function(){for(var g=[],p=!0,y=this.graphManager.getRoot().getNodes(),b=!0,m=0;m<y.length;m++)y[m].getChild()!=null&&(b=!1);if(!b)return g;var E=new Set,T=[],L=new Map,w=[];for(w=w.concat(y);w.length>0&&p;){for(T.push(w[0]);T.length>0&&p;){var C=T[0];T.splice(0,1),E.add(C);for(var A=C.getEdges(),m=0;m<A.length;m++){var R=A[m].getOtherEnd(C);if(L.get(C)!=R)if(!E.has(R))T.push(R),L.set(R,C);else{p=!1;break}}}if(!p)g=[];else{var S=[].concat(i(E));g.push(S);for(var m=0;m<S.length;m++){var D=S[m],P=w.indexOf(D);P>-1&&w.splice(P,1)}E=new Set,L=new Map}}return g},d.prototype.createDummyNodesForBendpoints=function(g){for(var p=[],y=g.source,b=this.graphManager.calcLowestCommonAncestor(g.source,g.target),m=0;m<g.bendpoints.length;m++){var E=this.newNode(null);E.setRect(new Point(0,0),new Dimension(1,1)),b.add(E);var T=this.newEdge(null);this.graphManager.add(T,y,E),p.add(E),y=E}var T=this.newEdge(null);return this.graphManager.add(T,y,g.target),this.edgeToDummyNodes.set(g,p),g.isInterGraph()?this.graphManager.remove(g):b.remove(g),p},d.prototype.createBendpointsFromDummyNodes=function(){var g=[];g=g.concat(this.graphManager.getAllEdges()),g=[].concat(i(this.edgeToDummyNodes.keys())).concat(g);for(var p=0;p<g.length;p++){var y=g[p];if(y.bendpoints.length>0){for(var b=this.edgeToDummyNodes.get(y),m=0;m<b.length;m++){var E=b[m],T=new h(E.getCenterX(),E.getCenterY()),L=y.bendpoints.get(m);L.x=T.x,L.y=T.y,E.getOwner().remove(E)}this.graphManager.add(y,y.source,y.target)}}},d.transform=function(g,p,y,b){if(y!=null&&b!=null){var m=p;if(g<=50){var E=p/y;m-=(p-E)/50*(50-g)}else{var T=p*b;m+=(T-p)/50*(g-50)}return m}else{var L,w;return g<=50?(L=9*p/500,w=p/10):(L=9*p/50,w=-8*p),L*g+w}},d.findCenterOfTree=function(g){var p=[];p=p.concat(g);var y=[],b=new Map,m=!1,E=null;(p.length==1||p.length==2)&&(m=!0,E=p[0]);for(var T=0;T<p.length;T++){var L=p[T],w=L.getNeighborsList().size;b.set(L,L.getNeighborsList().size),w==1&&y.push(L)}var C=[];for(C=C.concat(y);!m;){var A=[];A=A.concat(C),C=[];for(var T=0;T<p.length;T++){var L=p[T],R=p.indexOf(L);R>=0&&p.splice(R,1);var S=L.getNeighborsList();S.forEach(function(x){if(y.indexOf(x)<0){var N=b.get(x),M=N-1;M==1&&C.push(x),b.set(x,M)}})}y=y.concat(C),(p.length==1||p.length==2)&&(m=!0,E=p[0])}return E},d.prototype.setGraphManager=function(g){this.graphManager=g},r.exports=d}),(function(r,a,n){function i(){}i.seed=1,i.x=0,i.nextDouble=function(){return i.x=Math.sin(i.seed++)*1e4,i.x-Math.floor(i.x)},r.exports=i}),(function(r,a,n){var i=n(4);function o(s,u){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}o.prototype.getWorldOrgX=function(){return this.lworldOrgX},o.prototype.setWorldOrgX=function(s){this.lworldOrgX=s},o.prototype.getWorldOrgY=function(){return this.lworldOrgY},o.prototype.setWorldOrgY=function(s){this.lworldOrgY=s},o.prototype.getWorldExtX=function(){return this.lworldExtX},o.prototype.setWorldExtX=function(s){this.lworldExtX=s},o.prototype.getWorldExtY=function(){return this.lworldExtY},o.prototype.setWorldExtY=function(s){this.lworldExtY=s},o.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},o.prototype.setDeviceOrgX=function(s){this.ldeviceOrgX=s},o.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},o.prototype.setDeviceOrgY=function(s){this.ldeviceOrgY=s},o.prototype.getDeviceExtX=function(){return this.ldeviceExtX},o.prototype.setDeviceExtX=function(s){this.ldeviceExtX=s},o.prototype.getDeviceExtY=function(){return this.ldeviceExtY},o.prototype.setDeviceExtY=function(s){this.ldeviceExtY=s},o.prototype.transformX=function(s){var u=0,l=this.lworldExtX;return l!=0&&(u=this.ldeviceOrgX+(s-this.lworldOrgX)*this.ldeviceExtX/l),u},o.prototype.transformY=function(s){var u=0,l=this.lworldExtY;return l!=0&&(u=this.ldeviceOrgY+(s-this.lworldOrgY)*this.ldeviceExtY/l),u},o.prototype.inverseTransformX=function(s){var u=0,l=this.ldeviceExtX;return l!=0&&(u=this.lworldOrgX+(s-this.ldeviceOrgX)*this.lworldExtX/l),u},o.prototype.inverseTransformY=function(s){var u=0,l=this.ldeviceExtY;return l!=0&&(u=this.lworldOrgY+(s-this.ldeviceOrgY)*this.lworldExtY/l),u},o.prototype.inverseTransformPoint=function(s){var u=new i(this.inverseTransformX(s.x),this.inverseTransformY(s.y));return u},r.exports=o}),(function(r,a,n){function i(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 o=n(15),s=n(7),u=n(0),l=n(8),f=n(9);function h(){o.call(this),this.useSmartIdealEdgeLengthCalculation=s.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.idealEdgeLength=s.DEFAULT_EDGE_LENGTH,this.springConstant=s.DEFAULT_SPRING_STRENGTH,this.repulsionConstant=s.DEFAULT_REPULSION_STRENGTH,this.gravityConstant=s.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=s.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=s.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=s.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*s.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=s.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=s.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=s.MAX_ITERATIONS}h.prototype=Object.create(o.prototype);for(var v in o)h[v]=o[v];h.prototype.initParameters=function(){o.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=s.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},h.prototype.calcIdealEdgeLengths=function(){for(var c,d,g,p,y,b,m=this.getGraphManager().getAllEdges(),E=0;E<m.length;E++)c=m[E],c.idealLength=this.idealEdgeLength,c.isInterGraph&&(g=c.getSource(),p=c.getTarget(),y=c.getSourceInLca().getEstimatedSize(),b=c.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation&&(c.idealLength+=y+b-2*u.SIMPLE_NODE_SIZE),d=c.getLca().getInclusionTreeDepth(),c.idealLength+=s.DEFAULT_EDGE_LENGTH*s.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(g.getInclusionTreeDepth()+p.getInclusionTreeDepth()-2*d))},h.prototype.initSpringEmbedder=function(){var c=this.getAllNodes().length;this.incremental?(c>s.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*s.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(c-s.ADAPTATION_LOWER_NODE_LIMIT)/(s.ADAPTATION_UPPER_NODE_LIMIT-s.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-s.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=s.MAX_NODE_DISPLACEMENT_INCREMENTAL):(c>s.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(s.COOLING_ADAPTATION_FACTOR,1-(c-s.ADAPTATION_LOWER_NODE_LIMIT)/(s.ADAPTATION_UPPER_NODE_LIMIT-s.ADAPTATION_LOWER_NODE_LIMIT)*(1-s.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=s.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},h.prototype.calcSpringForces=function(){for(var c=this.getAllEdges(),d,g=0;g<c.length;g++)d=c[g],this.calcSpringForce(d,d.idealLength)},h.prototype.calcRepulsionForces=function(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,g,p,y,b,m=this.getAllNodes(),E;if(this.useFRGridVariant)for(this.totalIterations%s.GRID_CALCULATION_CHECK_PERIOD==1&&c&&this.updateGrid(),E=new Set,g=0;g<m.length;g++)y=m[g],this.calculateRepulsionForceOfANode(y,E,c,d),E.add(y);else for(g=0;g<m.length;g++)for(y=m[g],p=g+1;p<m.length;p++)b=m[p],y.getOwner()==b.getOwner()&&this.calcRepulsionForce(y,b)},h.prototype.calcGravitationalForces=function(){for(var c,d=this.getAllNodesToApplyGravitation(),g=0;g<d.length;g++)c=d[g],this.calcGravitationalForce(c)},h.prototype.moveNodes=function(){for(var c=this.getAllNodes(),d,g=0;g<c.length;g++)d=c[g],d.move()},h.prototype.calcSpringForce=function(c,d){var g=c.getSource(),p=c.getTarget(),y,b,m,E;if(this.uniformLeafNodeSizes&&g.getChild()==null&&p.getChild()==null)c.updateLengthSimple();else if(c.updateLength(),c.isOverlapingSourceAndTarget)return;y=c.getLength(),y!=0&&(b=this.springConstant*(y-d),m=b*(c.lengthX/y),E=b*(c.lengthY/y),g.springForceX+=m,g.springForceY+=E,p.springForceX-=m,p.springForceY-=E)},h.prototype.calcRepulsionForce=function(c,d){var g=c.getRect(),p=d.getRect(),y=new Array(2),b=new Array(4),m,E,T,L,w,C,A;if(g.intersects(p)){l.calcSeparationAmount(g,p,y,s.DEFAULT_EDGE_LENGTH/2),C=2*y[0],A=2*y[1];var R=c.noOfChildren*d.noOfChildren/(c.noOfChildren+d.noOfChildren);c.repulsionForceX-=R*C,c.repulsionForceY-=R*A,d.repulsionForceX+=R*C,d.repulsionForceY+=R*A}else this.uniformLeafNodeSizes&&c.getChild()==null&&d.getChild()==null?(m=p.getCenterX()-g.getCenterX(),E=p.getCenterY()-g.getCenterY()):(l.getIntersection(g,p,b),m=b[2]-b[0],E=b[3]-b[1]),Math.abs(m)<s.MIN_REPULSION_DIST&&(m=f.sign(m)*s.MIN_REPULSION_DIST),Math.abs(E)<s.MIN_REPULSION_DIST&&(E=f.sign(E)*s.MIN_REPULSION_DIST),T=m*m+E*E,L=Math.sqrt(T),w=this.repulsionConstant*c.noOfChildren*d.noOfChildren/T,C=w*m/L,A=w*E/L,c.repulsionForceX-=C,c.repulsionForceY-=A,d.repulsionForceX+=C,d.repulsionForceY+=A},h.prototype.calcGravitationalForce=function(c){var d,g,p,y,b,m,E,T;d=c.getOwner(),g=(d.getRight()+d.getLeft())/2,p=(d.getTop()+d.getBottom())/2,y=c.getCenterX()-g,b=c.getCenterY()-p,m=Math.abs(y)+c.getWidth()/2,E=Math.abs(b)+c.getHeight()/2,c.getOwner()==this.graphManager.getRoot()?(T=d.getEstimatedSize()*this.gravityRangeFactor,(m>T||E>T)&&(c.gravitationForceX=-this.gravityConstant*y,c.gravitationForceY=-this.gravityConstant*b)):(T=d.getEstimatedSize()*this.compoundGravityRangeFactor,(m>T||E>T)&&(c.gravitationForceX=-this.gravityConstant*y*this.compoundGravityConstant,c.gravitationForceY=-this.gravityConstant*b*this.compoundGravityConstant))},h.prototype.isConverged=function(){var c,d=!1;return this.totalIterations>this.maxIterations/3&&(d=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),c=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,c||d},h.prototype.animate=function(){this.animationDuringLayout&&!this.isSubLayout&&(this.notAnimatedIterations==this.animationPeriod?(this.update(),this.notAnimatedIterations=0):this.notAnimatedIterations++)},h.prototype.calcNoOfChildrenForAllNodes=function(){for(var c,d=this.graphManager.getAllNodes(),g=0;g<d.length;g++)c=d[g],c.noOfChildren=c.getNoOfChildren()},h.prototype.calcGrid=function(c){var d=0,g=0;d=parseInt(Math.ceil((c.getRight()-c.getLeft())/this.repulsionRange)),g=parseInt(Math.ceil((c.getBottom()-c.getTop())/this.repulsionRange));for(var p=new Array(d),y=0;y<d;y++)p[y]=new Array(g);for(var y=0;y<d;y++)for(var b=0;b<g;b++)p[y][b]=new Array;return p},h.prototype.addNodeToGrid=function(c,d,g){var p=0,y=0,b=0,m=0;p=parseInt(Math.floor((c.getRect().x-d)/this.repulsionRange)),y=parseInt(Math.floor((c.getRect().width+c.getRect().x-d)/this.repulsionRange)),b=parseInt(Math.floor((c.getRect().y-g)/this.repulsionRange)),m=parseInt(Math.floor((c.getRect().height+c.getRect().y-g)/this.repulsionRange));for(var E=p;E<=y;E++)for(var T=b;T<=m;T++)this.grid[E][T].push(c),c.setGridCoordinates(p,y,b,m)},h.prototype.updateGrid=function(){var c,d,g=this.getAllNodes();for(this.grid=this.calcGrid(this.graphManager.getRoot()),c=0;c<g.length;c++)d=g[c],this.addNodeToGrid(d,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},h.prototype.calculateRepulsionForceOfANode=function(c,d,g,p){if(this.totalIterations%s.GRID_CALCULATION_CHECK_PERIOD==1&&g||p){var y=new Set;c.surrounding=new Array;for(var b,m=this.grid,E=c.startX-1;E<c.finishX+2;E++)for(var T=c.startY-1;T<c.finishY+2;T++)if(!(E<0||T<0||E>=m.length||T>=m[0].length)){for(var L=0;L<m[E][T].length;L++)if(b=m[E][T][L],!(c.getOwner()!=b.getOwner()||c==b)&&!d.has(b)&&!y.has(b)){var w=Math.abs(c.getCenterX()-b.getCenterX())-(c.getWidth()/2+b.getWidth()/2),C=Math.abs(c.getCenterY()-b.getCenterY())-(c.getHeight()/2+b.getHeight()/2);w<=this.repulsionRange&&C<=this.repulsionRange&&y.add(b)}}c.surrounding=[].concat(i(y))}for(E=0;E<c.surrounding.length;E++)this.calcRepulsionForce(c,c.surrounding[E])},h.prototype.calcRepulsionRange=function(){return 0},r.exports=h}),(function(r,a,n){var i=n(1),o=n(7);function s(l,f,h){i.call(this,l,f,h),this.idealLength=o.DEFAULT_EDGE_LENGTH}s.prototype=Object.create(i.prototype);for(var u in i)s[u]=i[u];r.exports=s}),(function(r,a,n){var i=n(3);function o(u,l,f,h){i.call(this,u,l,f,h),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=[]}o.prototype=Object.create(i.prototype);for(var s in i)o[s]=i[s];o.prototype.setGridCoordinates=function(u,l,f,h){this.startX=u,this.finishX=l,this.startY=f,this.finishY=h},r.exports=o}),(function(r,a,n){function i(o,s){this.width=0,this.height=0,o!==null&&s!==null&&(this.height=s,this.width=o)}i.prototype.getWidth=function(){return this.width},i.prototype.setWidth=function(o){this.width=o},i.prototype.getHeight=function(){return this.height},i.prototype.setHeight=function(o){this.height=o},r.exports=i}),(function(r,a,n){var i=n(14);function o(){this.map={},this.keys=[]}o.prototype.put=function(s,u){var l=i.createID(s);this.contains(l)||(this.map[l]=u,this.keys.push(s))},o.prototype.contains=function(s){return i.createID(s),this.map[s]!=null},o.prototype.get=function(s){var u=i.createID(s);return this.map[u]},o.prototype.keySet=function(){return this.keys},r.exports=o}),(function(r,a,n){var i=n(14);function o(){this.set={}}o.prototype.add=function(s){var u=i.createID(s);this.contains(u)||(this.set[u]=s)},o.prototype.remove=function(s){delete this.set[i.createID(s)]},o.prototype.clear=function(){this.set={}},o.prototype.contains=function(s){return this.set[i.createID(s)]==s},o.prototype.isEmpty=function(){return this.size()===0},o.prototype.size=function(){return Object.keys(this.set).length},o.prototype.addAllTo=function(s){for(var u=Object.keys(this.set),l=u.length,f=0;f<l;f++)s.push(this.set[u[f]])},o.prototype.size=function(){return Object.keys(this.set).length},o.prototype.addAll=function(s){for(var u=s.length,l=0;l<u;l++){var f=s[l];this.add(f)}},r.exports=o}),(function(r,a,n){var i=(function(){function l(f,h){for(var v=0;v<h.length;v++){var c=h[v];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(f,c.key,c)}}return function(f,h,v){return h&&l(f.prototype,h),v&&l(f,v),f}})();function o(l,f){if(!(l instanceof f))throw new TypeError("Cannot call a class as a function")}var s=n(11),u=(function(){function l(f,h){o(this,l),(h!==null||h!==void 0)&&(this.compareFunction=this._defaultCompareFunction);var v=void 0;f instanceof s?v=f.size():v=f.length,this._quicksort(f,0,v-1)}return i(l,[{key:"_quicksort",value:function(h,v,c){if(v<c){var d=this._partition(h,v,c);this._quicksort(h,v,d),this._quicksort(h,d+1,c)}}},{key:"_partition",value:function(h,v,c){for(var d=this._get(h,v),g=v,p=c;;){for(;this.compareFunction(d,this._get(h,p));)p--;for(;this.compareFunction(this._get(h,g),d);)g++;if(g<p)this._swap(h,g,p),g++,p--;else return p}}},{key:"_get",value:function(h,v){return h instanceof s?h.get_object_at(v):h[v]}},{key:"_set",value:function(h,v,c){h instanceof s?h.set_object_at(v,c):h[v]=c}},{key:"_swap",value:function(h,v,c){var d=this._get(h,v);this._set(h,v,this._get(h,c)),this._set(h,c,d)}},{key:"_defaultCompareFunction",value:function(h,v){return v>h}}]),l})();r.exports=u}),(function(r,a,n){var i=(function(){function u(l,f){for(var h=0;h<f.length;h++){var v=f[h];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(l,v.key,v)}}return function(l,f,h){return f&&u(l.prototype,f),h&&u(l,h),l}})();function o(u,l){if(!(u instanceof l))throw new TypeError("Cannot call a class as a function")}var s=(function(){function u(l,f){var h=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,v=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,c=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;o(this,u),this.sequence1=l,this.sequence2=f,this.match_score=h,this.mismatch_penalty=v,this.gap_penalty=c,this.iMax=l.length+1,this.jMax=f.length+1,this.grid=new Array(this.iMax);for(var d=0;d<this.iMax;d++){this.grid[d]=new Array(this.jMax);for(var g=0;g<this.jMax;g++)this.grid[d][g]=0}this.tracebackGrid=new Array(this.iMax);for(var p=0;p<this.iMax;p++){this.tracebackGrid[p]=new Array(this.jMax);for(var y=0;y<this.jMax;y++)this.tracebackGrid[p][y]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return i(u,[{key:"getScore",value:function(){return this.score}},{key:"getAlignments",value:function(){return this.alignments}},{key:"computeGrids",value:function(){for(var f=1;f<this.jMax;f++)this.grid[0][f]=this.grid[0][f-1]+this.gap_penalty,this.tracebackGrid[0][f]=[!1,!1,!0];for(var h=1;h<this.iMax;h++)this.grid[h][0]=this.grid[h-1][0]+this.gap_penalty,this.tracebackGrid[h][0]=[!1,!0,!1];for(var v=1;v<this.iMax;v++)for(var c=1;c<this.jMax;c++){var d=void 0;this.sequence1[v-1]===this.sequence2[c-1]?d=this.grid[v-1][c-1]+this.match_score:d=this.grid[v-1][c-1]+this.mismatch_penalty;var g=this.grid[v-1][c]+this.gap_penalty,p=this.grid[v][c-1]+this.gap_penalty,y=[d,g,p],b=this.arrayAllMaxIndexes(y);this.grid[v][c]=y[b[0]],this.tracebackGrid[v][c]=[b.includes(0),b.includes(1),b.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]}},{key:"alignmentTraceback",value:function(){var f=[];for(f.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});f[0];){var h=f[0],v=this.tracebackGrid[h.pos[0]][h.pos[1]];v[0]&&f.push({pos:[h.pos[0]-1,h.pos[1]-1],seq1:this.sequence1[h.pos[0]-1]+h.seq1,seq2:this.sequence2[h.pos[1]-1]+h.seq2}),v[1]&&f.push({pos:[h.pos[0]-1,h.pos[1]],seq1:this.sequence1[h.pos[0]-1]+h.seq1,seq2:"-"+h.seq2}),v[2]&&f.push({pos:[h.pos[0],h.pos[1]-1],seq1:"-"+h.seq1,seq2:this.sequence2[h.pos[1]-1]+h.seq2}),h.pos[0]===0&&h.pos[1]===0&&this.alignments.push({sequence1:h.seq1,sequence2:h.seq2}),f.shift()}return this.alignments}},{key:"getAllIndexes",value:function(f,h){for(var v=[],c=-1;(c=f.indexOf(h,c+1))!==-1;)v.push(c);return v}},{key:"arrayAllMaxIndexes",value:function(f){return this.getAllIndexes(f,Math.max.apply(null,f))}}]),u})();r.exports=s}),(function(r,a,n){var i=function(){};i.FDLayout=n(18),i.FDLayoutConstants=n(7),i.FDLayoutEdge=n(19),i.FDLayoutNode=n(20),i.DimensionD=n(21),i.HashMap=n(22),i.HashSet=n(23),i.IGeometry=n(8),i.IMath=n(9),i.Integer=n(10),i.Point=n(12),i.PointD=n(4),i.RandomSeed=n(16),i.RectangleD=n(13),i.Transform=n(17),i.UniqueIDGeneretor=n(14),i.Quicksort=n(24),i.LinkedList=n(11),i.LGraphObject=n(2),i.LGraph=n(5),i.LEdge=n(1),i.LGraphManager=n(6),i.LNode=n(3),i.Layout=n(15),i.LayoutConstants=n(0),i.NeedlemanWunsch=n(25),r.exports=i}),(function(r,a,n){function i(){this.listeners=[]}var o=i.prototype;o.addListener=function(s,u){this.listeners.push({event:s,callback:u})},o.removeListener=function(s,u){for(var l=this.listeners.length;l>=0;l--){var f=this.listeners[l];f.event===s&&f.callback===u&&this.listeners.splice(l,1)}},o.emit=function(s,u){for(var l=0;l<this.listeners.length;l++){var f=this.listeners[l];s===f.event&&f.callback(u)}},r.exports=i})])})})(hi)),hi.exports}var hI=fi.exports,dE;function cI(){return dE||(dE=1,(function(t,e){(function(a,n){t.exports=n(fI())})(hI,function(r){return(function(a){var n={};function i(o){if(n[o])return n[o].exports;var s=n[o]={i:o,l:!1,exports:{}};return a[o].call(s.exports,s,s.exports,i),s.l=!0,s.exports}return i.m=a,i.c=n,i.i=function(o){return o},i.d=function(o,s,u){i.o(o,s)||Object.defineProperty(o,s,{configurable:!1,enumerable:!0,get:u})},i.n=function(o){var s=o&&o.__esModule?function(){return o.default}:function(){return o};return i.d(s,"a",s),s},i.o=function(o,s){return Object.prototype.hasOwnProperty.call(o,s)},i.p="",i(i.s=7)})([(function(a,n){a.exports=r}),(function(a,n,i){var o=i(0).FDLayoutConstants;function s(){}for(var u in o)s[u]=o[u];s.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,s.DEFAULT_RADIAL_SEPARATION=o.DEFAULT_EDGE_LENGTH,s.DEFAULT_COMPONENT_SEPERATION=60,s.TILE=!0,s.TILING_PADDING_VERTICAL=10,s.TILING_PADDING_HORIZONTAL=10,s.TREE_REDUCTION_ON_INCREMENTAL=!1,a.exports=s}),(function(a,n,i){var o=i(0).FDLayoutEdge;function s(l,f,h){o.call(this,l,f,h)}s.prototype=Object.create(o.prototype);for(var u in o)s[u]=o[u];a.exports=s}),(function(a,n,i){var o=i(0).LGraph;function s(l,f,h){o.call(this,l,f,h)}s.prototype=Object.create(o.prototype);for(var u in o)s[u]=o[u];a.exports=s}),(function(a,n,i){var o=i(0).LGraphManager;function s(l){o.call(this,l)}s.prototype=Object.create(o.prototype);for(var u in o)s[u]=o[u];a.exports=s}),(function(a,n,i){var o=i(0).FDLayoutNode,s=i(0).IMath;function u(f,h,v,c){o.call(this,f,h,v,c)}u.prototype=Object.create(o.prototype);for(var l in o)u[l]=o[l];u.prototype.move=function(){var f=this.graphManager.getLayout();this.displacementX=f.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY=f.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren,Math.abs(this.displacementX)>f.coolingFactor*f.maxNodeDisplacement&&(this.displacementX=f.coolingFactor*f.maxNodeDisplacement*s.sign(this.displacementX)),Math.abs(this.displacementY)>f.coolingFactor*f.maxNodeDisplacement&&(this.displacementY=f.coolingFactor*f.maxNodeDisplacement*s.sign(this.displacementY)),this.child==null?this.moveBy(this.displacementX,this.displacementY):this.child.getNodes().length==0?this.moveBy(this.displacementX,this.displacementY):this.propogateDisplacementToChildren(this.displacementX,this.displacementY),f.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},u.prototype.propogateDisplacementToChildren=function(f,h){for(var v=this.getChild().getNodes(),c,d=0;d<v.length;d++)c=v[d],c.getChild()==null?(c.moveBy(f,h),c.displacementX+=f,c.displacementY+=h):c.propogateDisplacementToChildren(f,h)},u.prototype.setPred1=function(f){this.pred1=f},u.prototype.getPred1=function(){return pred1},u.prototype.getPred2=function(){return pred2},u.prototype.setNext=function(f){this.next=f},u.prototype.getNext=function(){return next},u.prototype.setProcessed=function(f){this.processed=f},u.prototype.isProcessed=function(){return processed},a.exports=u}),(function(a,n,i){var o=i(0).FDLayout,s=i(4),u=i(3),l=i(5),f=i(2),h=i(1),v=i(0).FDLayoutConstants,c=i(0).LayoutConstants,d=i(0).Point,g=i(0).PointD,p=i(0).Layout,y=i(0).Integer,b=i(0).IGeometry,m=i(0).LGraph,E=i(0).Transform;function T(){o.call(this),this.toBeTiled={}}T.prototype=Object.create(o.prototype);for(var L in o)T[L]=o[L];T.prototype.newGraphManager=function(){var w=new s(this);return this.graphManager=w,w},T.prototype.newGraph=function(w){return new u(null,this.graphManager,w)},T.prototype.newNode=function(w){return new l(this.graphManager,w)},T.prototype.newEdge=function(w){return new f(null,null,w)},T.prototype.initParameters=function(){o.prototype.initParameters.call(this,arguments),this.isSubLayout||(h.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=h.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=h.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.springConstant=v.DEFAULT_SPRING_STRENGTH,this.repulsionConstant=v.DEFAULT_REPULSION_STRENGTH,this.gravityConstant=v.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=v.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=v.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=v.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1,this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/v.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=v.CONVERGENCE_CHECK_PERIOD/this.maxIterations,this.coolingAdjuster=1)},T.prototype.layout=function(){var w=c.DEFAULT_CREATE_BENDS_AS_NEEDED;return w&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},T.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental){if(h.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var C=new Set(this.getAllNodes()),A=this.nodesWithGravity.filter(function(D){return C.has(D)});this.graphManager.setAllNodesToApplyGravitation(A)}}else{var w=this.getFlatForest();if(w.length>0)this.positionNodesRadially(w);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var C=new Set(this.getAllNodes()),A=this.nodesWithGravity.filter(function(R){return C.has(R)});this.graphManager.setAllNodesToApplyGravitation(A),this.positionNodesRandomly()}}return this.initSpringEmbedder(),this.runSpringEmbedder(),!0},T.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%v.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var w=new Set(this.getAllNodes()),C=this.nodesWithGravity.filter(function(S){return w.has(S)});this.graphManager.setAllNodesToApplyGravitation(C),this.graphManager.updateBounds(),this.updateGrid(),this.coolingFactor=v.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),this.coolingFactor=v.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var A=!this.isTreeGrowing&&!this.isGrowthFinished,R=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(A,R),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},T.prototype.getPositionsData=function(){for(var w=this.graphManager.getAllNodes(),C={},A=0;A<w.length;A++){var R=w[A].rect,S=w[A].id;C[S]={id:S,x:R.getCenterX(),y:R.getCenterY(),w:R.width,h:R.height}}return C},T.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var w=!1;if(v.ANIMATE==="during")this.emit("layoutstarted");else{for(;!w;)w=this.tick();this.graphManager.updateBounds()}},T.prototype.calculateNodesToApplyGravitationTo=function(){var w=[],C,A=this.graphManager.getGraphs(),R=A.length,S;for(S=0;S<R;S++)C=A[S],C.updateConnected(),C.isConnected||(w=w.concat(C.getNodes()));return w},T.prototype.createBendpoints=function(){var w=[];w=w.concat(this.graphManager.getAllEdges());var C=new Set,A;for(A=0;A<w.length;A++){var R=w[A];if(!C.has(R)){var S=R.getSource(),D=R.getTarget();if(S==D)R.getBendpoints().push(new g),R.getBendpoints().push(new g),this.createDummyNodesForBendpoints(R),C.add(R);else{var P=[];if(P=P.concat(S.getEdgeListToNode(D)),P=P.concat(D.getEdgeListToNode(S)),!C.has(P[0])){if(P.length>1){var x;for(x=0;x<P.length;x++){var N=P[x];N.getBendpoints().push(new g),this.createDummyNodesForBendpoints(N)}}P.forEach(function(M){C.add(M)})}}}if(C.size==w.length)break}},T.prototype.positionNodesRadially=function(w){for(var C=new d(0,0),A=Math.ceil(Math.sqrt(w.length)),R=0,S=0,D=0,P=new g(0,0),x=0;x<w.length;x++){x%A==0&&(D=0,S=R,x!=0&&(S+=h.DEFAULT_COMPONENT_SEPERATION),R=0);var N=w[x],M=p.findCenterOfTree(N);C.x=D,C.y=S,P=T.radialLayout(N,M,C),P.y>R&&(R=Math.floor(P.y)),D=Math.floor(P.x+h.DEFAULT_COMPONENT_SEPERATION)}this.transform(new g(c.WORLD_CENTER_X-P.x/2,c.WORLD_CENTER_Y-P.y/2))},T.radialLayout=function(w,C,A){var R=Math.max(this.maxDiagonalInTree(w),h.DEFAULT_RADIAL_SEPARATION);T.branchRadialLayout(C,null,0,359,0,R);var S=m.calculateBounds(w),D=new E;D.setDeviceOrgX(S.getMinX()),D.setDeviceOrgY(S.getMinY()),D.setWorldOrgX(A.x),D.setWorldOrgY(A.y);for(var P=0;P<w.length;P++){var x=w[P];x.transform(D)}var N=new g(S.getMaxX(),S.getMaxY());return D.inverseTransformPoint(N)},T.branchRadialLayout=function(w,C,A,R,S,D){var P=(R-A+1)/2;P<0&&(P+=180);var x=(P+A)%360,N=x*b.TWO_PI/360,M=S*Math.cos(N),I=S*Math.sin(N);w.setCenter(M,I);var O=[];O=O.concat(w.getEdges());var q=O.length;C!=null&&q--;for(var _=0,B=O.length,z,Y=w.getEdgesBetween(C);Y.length>1;){var k=Y[0];Y.splice(0,1);var G=O.indexOf(k);G>=0&&O.splice(G,1),B--,q--}C!=null?z=(O.indexOf(Y[0])+1)%B:z=0;for(var U=Math.abs(R-A)/q,W=z;_!=q;W=++W%B){var j=O[W].getOtherEnd(w);if(j!=C){var H=(A+_*U)%360,V=(H+U)%360;T.branchRadialLayout(j,w,H,V,S+D,D),_++}}},T.maxDiagonalInTree=function(w){for(var C=y.MIN_VALUE,A=0;A<w.length;A++){var R=w[A],S=R.getDiagonal();S>C&&(C=S)}return C},T.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},T.prototype.groupZeroDegreeMembers=function(){var w=this,C={};this.memberGroups={},this.idToDummyNode={};for(var A=[],R=this.graphManager.getAllNodes(),S=0;S<R.length;S++){var D=R[S],P=D.getParent();this.getNodeDegreeWithChildren(D)===0&&(P.id==null||!this.getToBeTiled(P))&&A.push(D)}for(var S=0;S<A.length;S++){var D=A[S],x=D.getParent().id;typeof C[x]>"u"&&(C[x]=[]),C[x]=C[x].concat(D)}Object.keys(C).forEach(function(N){if(C[N].length>1){var M="DummyCompound_"+N;w.memberGroups[M]=C[N];var I=C[N][0].getParent(),O=new l(w.graphManager);O.id=M,O.paddingLeft=I.paddingLeft||0,O.paddingRight=I.paddingRight||0,O.paddingBottom=I.paddingBottom||0,O.paddingTop=I.paddingTop||0,w.idToDummyNode[M]=O;var q=w.getGraphManager().add(w.newGraph(),O),_=I.getChild();_.add(O);for(var B=0;B<C[N].length;B++){var z=C[N][B];_.remove(z),q.add(z)}}})},T.prototype.clearCompounds=function(){var w={},C={};this.performDFSOnCompounds();for(var A=0;A<this.compoundOrder.length;A++)C[this.compoundOrder[A].id]=this.compoundOrder[A],w[this.compoundOrder[A].id]=[].concat(this.compoundOrder[A].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[A].getChild()),this.compoundOrder[A].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(w,C)},T.prototype.clearZeroDegreeMembers=function(){var w=this,C=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(A){var R=w.idToDummyNode[A];C[A]=w.tileNodes(w.memberGroups[A],R.paddingLeft+R.paddingRight),R.rect.width=C[A].width,R.rect.height=C[A].height})},T.prototype.repopulateCompounds=function(){for(var w=this.compoundOrder.length-1;w>=0;w--){var C=this.compoundOrder[w],A=C.id,R=C.paddingLeft,S=C.paddingTop;this.adjustLocations(this.tiledMemberPack[A],C.rect.x,C.rect.y,R,S)}},T.prototype.repopulateZeroDegreeMembers=function(){var w=this,C=this.tiledZeroDegreePack;Object.keys(C).forEach(function(A){var R=w.idToDummyNode[A],S=R.paddingLeft,D=R.paddingTop;w.adjustLocations(C[A],R.rect.x,R.rect.y,S,D)})},T.prototype.getToBeTiled=function(w){var C=w.id;if(this.toBeTiled[C]!=null)return this.toBeTiled[C];var A=w.getChild();if(A==null)return this.toBeTiled[C]=!1,!1;for(var R=A.getNodes(),S=0;S<R.length;S++){var D=R[S];if(this.getNodeDegree(D)>0)return this.toBeTiled[C]=!1,!1;if(D.getChild()==null){this.toBeTiled[D.id]=!1;continue}if(!this.getToBeTiled(D))return this.toBeTiled[C]=!1,!1}return this.toBeTiled[C]=!0,!0},T.prototype.getNodeDegree=function(w){w.id;for(var C=w.getEdges(),A=0,R=0;R<C.length;R++){var S=C[R];S.getSource().id!==S.getTarget().id&&(A=A+1)}return A},T.prototype.getNodeDegreeWithChildren=function(w){var C=this.getNodeDegree(w);if(w.getChild()==null)return C;for(var A=w.getChild().getNodes(),R=0;R<A.length;R++){var S=A[R];C+=this.getNodeDegreeWithChildren(S)}return C},T.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},T.prototype.fillCompexOrderByDFS=function(w){for(var C=0;C<w.length;C++){var A=w[C];A.getChild()!=null&&this.fillCompexOrderByDFS(A.getChild().getNodes()),this.getToBeTiled(A)&&this.compoundOrder.push(A)}},T.prototype.adjustLocations=function(w,C,A,R,S){C+=R,A+=S;for(var D=C,P=0;P<w.rows.length;P++){var x=w.rows[P];C=D;for(var N=0,M=0;M<x.length;M++){var I=x[M];I.rect.x=C,I.rect.y=A,C+=I.rect.width+w.horizontalPadding,I.rect.height>N&&(N=I.rect.height)}A+=N+w.verticalPadding}},T.prototype.tileCompoundMembers=function(w,C){var A=this;this.tiledMemberPack=[],Object.keys(w).forEach(function(R){var S=C[R];A.tiledMemberPack[R]=A.tileNodes(w[R],S.paddingLeft+S.paddingRight),S.rect.width=A.tiledMemberPack[R].width,S.rect.height=A.tiledMemberPack[R].height})},T.prototype.tileNodes=function(w,C){var A=h.TILING_PADDING_VERTICAL,R=h.TILING_PADDING_HORIZONTAL,S={rows:[],rowWidth:[],rowHeight:[],width:0,height:C,verticalPadding:A,horizontalPadding:R};w.sort(function(x,N){return x.rect.width*x.rect.height>N.rect.width*N.rect.height?-1:x.rect.width*x.rect.height<N.rect.width*N.rect.height?1:0});for(var D=0;D<w.length;D++){var P=w[D];S.rows.length==0?this.insertNodeToRow(S,P,0,C):this.canAddHorizontal(S,P.rect.width,P.rect.height)?this.insertNodeToRow(S,P,this.getShortestRowIndex(S),C):this.insertNodeToRow(S,P,S.rows.length,C),this.shiftToLastRow(S)}return S},T.prototype.insertNodeToRow=function(w,C,A,R){var S=R;if(A==w.rows.length){var D=[];w.rows.push(D),w.rowWidth.push(S),w.rowHeight.push(0)}var P=w.rowWidth[A]+C.rect.width;w.rows[A].length>0&&(P+=w.horizontalPadding),w.rowWidth[A]=P,w.width<P&&(w.width=P);var x=C.rect.height;A>0&&(x+=w.verticalPadding);var N=0;x>w.rowHeight[A]&&(N=w.rowHeight[A],w.rowHeight[A]=x,N=w.rowHeight[A]-N),w.height+=N,w.rows[A].push(C)},T.prototype.getShortestRowIndex=function(w){for(var C=-1,A=Number.MAX_VALUE,R=0;R<w.rows.length;R++)w.rowWidth[R]<A&&(C=R,A=w.rowWidth[R]);return C},T.prototype.getLongestRowIndex=function(w){for(var C=-1,A=Number.MIN_VALUE,R=0;R<w.rows.length;R++)w.rowWidth[R]>A&&(C=R,A=w.rowWidth[R]);return C},T.prototype.canAddHorizontal=function(w,C,A){var R=this.getShortestRowIndex(w);if(R<0)return!0;var S=w.rowWidth[R];if(S+w.horizontalPadding+C<=w.width)return!0;var D=0;w.rowHeight[R]<A&&R>0&&(D=A+w.verticalPadding-w.rowHeight[R]);var P;w.width-S>=C+w.horizontalPadding?P=(w.height+D)/(S+C+w.horizontalPadding):P=(w.height+D)/w.width,D=A+w.verticalPadding;var x;return w.width<C?x=(w.height+D)/C:x=(w.height+D)/w.width,x<1&&(x=1/x),P<1&&(P=1/P),P<x},T.prototype.shiftToLastRow=function(w){var C=this.getLongestRowIndex(w),A=w.rowWidth.length-1,R=w.rows[C],S=R[R.length-1],D=S.width+w.horizontalPadding;if(w.width-w.rowWidth[A]>D&&C!=A){R.splice(-1,1),w.rows[A].push(S),w.rowWidth[C]=w.rowWidth[C]-D,w.rowWidth[A]=w.rowWidth[A]+D,w.width=w.rowWidth[instance.getLongestRowIndex(w)];for(var P=Number.MIN_VALUE,x=0;x<R.length;x++)R[x].height>P&&(P=R[x].height);C>0&&(P+=w.verticalPadding);var N=w.rowHeight[C]+w.rowHeight[A];w.rowHeight[C]=P,w.rowHeight[A]<S.height+w.verticalPadding&&(w.rowHeight[A]=S.height+w.verticalPadding);var M=w.rowHeight[C]+w.rowHeight[A];w.height+=M-N,this.shiftToLastRow(w)}},T.prototype.tilingPreLayout=function(){h.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},T.prototype.tilingPostLayout=function(){h.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},T.prototype.reduceTrees=function(){for(var w=[],C=!0,A;C;){var R=this.graphManager.getAllNodes(),S=[];C=!1;for(var D=0;D<R.length;D++)A=R[D],A.getEdges().length==1&&!A.getEdges()[0].isInterGraph&&A.getChild()==null&&(S.push([A,A.getEdges()[0],A.getOwner()]),C=!0);if(C==!0){for(var P=[],x=0;x<S.length;x++)S[x][0].getEdges().length==1&&(P.push(S[x]),S[x][0].getOwner().remove(S[x][0]));w.push(P),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=w},T.prototype.growTree=function(w){for(var C=w.length,A=w[C-1],R,S=0;S<A.length;S++)R=A[S],this.findPlaceforPrunedNode(R),R[2].add(R[0]),R[2].add(R[1],R[1].source,R[1].target);w.splice(w.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},T.prototype.findPlaceforPrunedNode=function(w){var C,A,R=w[0];R==w[1].source?A=w[1].target:A=w[1].source;var S=A.startX,D=A.finishX,P=A.startY,x=A.finishY,N=0,M=0,I=0,O=0,q=[N,I,M,O];if(P>0)for(var _=S;_<=D;_++)q[0]+=this.grid[_][P-1].length+this.grid[_][P].length-1;if(D<this.grid.length-1)for(var _=P;_<=x;_++)q[1]+=this.grid[D+1][_].length+this.grid[D][_].length-1;if(x<this.grid[0].length-1)for(var _=S;_<=D;_++)q[2]+=this.grid[_][x+1].length+this.grid[_][x].length-1;if(S>0)for(var _=P;_<=x;_++)q[3]+=this.grid[S-1][_].length+this.grid[S][_].length-1;for(var B=y.MAX_VALUE,z,Y,k=0;k<q.length;k++)q[k]<B?(B=q[k],z=1,Y=k):q[k]==B&&z++;if(z==3&&B==0)q[0]==0&&q[1]==0&&q[2]==0?C=1:q[0]==0&&q[1]==0&&q[3]==0?C=0:q[0]==0&&q[2]==0&&q[3]==0?C=3:q[1]==0&&q[2]==0&&q[3]==0&&(C=2);else if(z==2&&B==0){var G=Math.floor(Math.random()*2);q[0]==0&&q[1]==0?G==0?C=0:C=1:q[0]==0&&q[2]==0?G==0?C=0:C=2:q[0]==0&&q[3]==0?G==0?C=0:C=3:q[1]==0&&q[2]==0?G==0?C=1:C=2:q[1]==0&&q[3]==0?G==0?C=1:C=3:G==0?C=2:C=3}else if(z==4&&B==0){var G=Math.floor(Math.random()*4);C=G}else C=Y;C==0?R.setCenter(A.getCenterX(),A.getCenterY()-A.getHeight()/2-v.DEFAULT_EDGE_LENGTH-R.getHeight()/2):C==1?R.setCenter(A.getCenterX()+A.getWidth()/2+v.DEFAULT_EDGE_LENGTH+R.getWidth()/2,A.getCenterY()):C==2?R.setCenter(A.getCenterX(),A.getCenterY()+A.getHeight()/2+v.DEFAULT_EDGE_LENGTH+R.getHeight()/2):R.setCenter(A.getCenterX()-A.getWidth()/2-v.DEFAULT_EDGE_LENGTH-R.getWidth()/2,A.getCenterY())},a.exports=T}),(function(a,n,i){var o={};o.layoutBase=i(0),o.CoSEConstants=i(1),o.CoSEEdge=i(2),o.CoSEGraph=i(3),o.CoSEGraphManager=i(4),o.CoSELayout=i(6),o.CoSENode=i(5),a.exports=o})])})})(fi)),fi.exports}var vI=li.exports,gE;function dI(){return gE||(gE=1,(function(t,e){(function(a,n){t.exports=n(cI())})(vI,function(r){return(function(a){var n={};function i(o){if(n[o])return n[o].exports;var s=n[o]={i:o,l:!1,exports:{}};return a[o].call(s.exports,s,s.exports,i),s.l=!0,s.exports}return i.m=a,i.c=n,i.i=function(o){return o},i.d=function(o,s,u){i.o(o,s)||Object.defineProperty(o,s,{configurable:!1,enumerable:!0,get:u})},i.n=function(o){var s=o&&o.__esModule?function(){return o.default}:function(){return o};return i.d(s,"a",s),s},i.o=function(o,s){return Object.prototype.hasOwnProperty.call(o,s)},i.p="",i(i.s=1)})([(function(a,n){a.exports=r}),(function(a,n,i){var o=i(0).layoutBase.LayoutConstants,s=i(0).layoutBase.FDLayoutConstants,u=i(0).CoSEConstants,l=i(0).CoSELayout,f=i(0).CoSENode,h=i(0).layoutBase.PointD,v=i(0).layoutBase.DimensionD,c={ready:function(){},stop:function(){},quality:"default",nodeDimensionsIncludeLabels:!1,refresh:30,fit:!0,padding:10,randomize:!0,nodeRepulsion:4500,idealEdgeLength:50,edgeElasticity:.45,nestingFactor:.1,gravity:.25,numIter:2500,tile:!0,animate:"end",animationDuration:500,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:.5};function d(b,m){var E={};for(var T in b)E[T]=b[T];for(var T in m)E[T]=m[T];return E}function g(b){this.options=d(c,b),p(this.options)}var p=function(m){m.nodeRepulsion!=null&&(u.DEFAULT_REPULSION_STRENGTH=s.DEFAULT_REPULSION_STRENGTH=m.nodeRepulsion),m.idealEdgeLength!=null&&(u.DEFAULT_EDGE_LENGTH=s.DEFAULT_EDGE_LENGTH=m.idealEdgeLength),m.edgeElasticity!=null&&(u.DEFAULT_SPRING_STRENGTH=s.DEFAULT_SPRING_STRENGTH=m.edgeElasticity),m.nestingFactor!=null&&(u.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=s.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=m.nestingFactor),m.gravity!=null&&(u.DEFAULT_GRAVITY_STRENGTH=s.DEFAULT_GRAVITY_STRENGTH=m.gravity),m.numIter!=null&&(u.MAX_ITERATIONS=s.MAX_ITERATIONS=m.numIter),m.gravityRange!=null&&(u.DEFAULT_GRAVITY_RANGE_FACTOR=s.DEFAULT_GRAVITY_RANGE_FACTOR=m.gravityRange),m.gravityCompound!=null&&(u.DEFAULT_COMPOUND_GRAVITY_STRENGTH=s.DEFAULT_COMPOUND_GRAVITY_STRENGTH=m.gravityCompound),m.gravityRangeCompound!=null&&(u.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=s.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=m.gravityRangeCompound),m.initialEnergyOnIncremental!=null&&(u.DEFAULT_COOLING_FACTOR_INCREMENTAL=s.DEFAULT_COOLING_FACTOR_INCREMENTAL=m.initialEnergyOnIncremental),m.quality=="draft"?o.QUALITY=0:m.quality=="proof"?o.QUALITY=2:o.QUALITY=1,u.NODE_DIMENSIONS_INCLUDE_LABELS=s.NODE_DIMENSIONS_INCLUDE_LABELS=o.NODE_DIMENSIONS_INCLUDE_LABELS=m.nodeDimensionsIncludeLabels,u.DEFAULT_INCREMENTAL=s.DEFAULT_INCREMENTAL=o.DEFAULT_INCREMENTAL=!m.randomize,u.ANIMATE=s.ANIMATE=o.ANIMATE=m.animate,u.TILE=m.tile,u.TILING_PADDING_VERTICAL=typeof m.tilingPaddingVertical=="function"?m.tilingPaddingVertical.call():m.tilingPaddingVertical,u.TILING_PADDING_HORIZONTAL=typeof m.tilingPaddingHorizontal=="function"?m.tilingPaddingHorizontal.call():m.tilingPaddingHorizontal};g.prototype.run=function(){var b,m,E=this.options;this.idToLNode={};var T=this.layout=new l,L=this;L.stopped=!1,this.cy=this.options.cy,this.cy.trigger({type:"layoutstart",layout:this});var w=T.newGraphManager();this.gm=w;var C=this.options.eles.nodes(),A=this.options.eles.edges();this.root=w.addRoot(),this.processChildrenList(this.root,this.getTopMostNodes(C),T);for(var R=0;R<A.length;R++){var S=A[R],D=this.idToLNode[S.data("source")],P=this.idToLNode[S.data("target")];if(D!==P&&D.getEdgesBetween(P).length==0){var x=w.add(T.newEdge(),D,P);x.id=S.id()}}var N=function(O,q){typeof O=="number"&&(O=q);var _=O.data("id"),B=L.idToLNode[_];return{x:B.getRect().getCenterX(),y:B.getRect().getCenterY()}},M=function I(){for(var O=function(){E.fit&&E.cy.fit(E.eles,E.padding),b||(b=!0,L.cy.one("layoutready",E.ready),L.cy.trigger({type:"layoutready",layout:L}))},q=L.options.refresh,_,B=0;B<q&&!_;B++)_=L.stopped||L.layout.tick();if(_){T.checkLayoutSuccess()&&!T.isSubLayout&&T.doPostLayout(),T.tilingPostLayout&&T.tilingPostLayout(),T.isLayoutFinished=!0,L.options.eles.nodes().positions(N),O(),L.cy.one("layoutstop",L.options.stop),L.cy.trigger({type:"layoutstop",layout:L}),m&&cancelAnimationFrame(m),b=!1;return}var z=L.layout.getPositionsData();E.eles.nodes().positions(function(Y,k){if(typeof Y=="number"&&(Y=k),!Y.isParent()){for(var G=Y.id(),U=z[G],W=Y;U==null&&(U=z[W.data("parent")]||z["DummyCompound_"+W.data("parent")],z[G]=U,W=W.parent()[0],W!=null););return U!=null?{x:U.x,y:U.y}:{x:Y.position("x"),y:Y.position("y")}}}),O(),m=requestAnimationFrame(I)};return T.addListener("layoutstarted",function(){L.options.animate==="during"&&(m=requestAnimationFrame(M))}),T.runLayout(),this.options.animate!=="during"&&(L.options.eles.nodes().not(":parent").layoutPositions(L,L.options,N),b=!1),this},g.prototype.getTopMostNodes=function(b){for(var m={},E=0;E<b.length;E++)m[b[E].id()]=!0;var T=b.filter(function(L,w){typeof L=="number"&&(L=w);for(var C=L.parent()[0];C!=null;){if(m[C.id()])return!1;C=C.parent()[0]}return!0});return T},g.prototype.processChildrenList=function(b,m,E){for(var T=m.length,L=0;L<T;L++){var w=m[L],C=w.children(),A,R=w.layoutDimensions({nodeDimensionsIncludeLabels:this.options.nodeDimensionsIncludeLabels});if(w.outerWidth()!=null&&w.outerHeight()!=null?A=b.add(new f(E.graphManager,new h(w.position("x")-R.w/2,w.position("y")-R.h/2),new v(parseFloat(R.w),parseFloat(R.h)))):A=b.add(new f(this.graphManager)),A.id=w.data("id"),A.paddingLeft=parseInt(w.css("padding")),A.paddingTop=parseInt(w.css("padding")),A.paddingRight=parseInt(w.css("padding")),A.paddingBottom=parseInt(w.css("padding")),this.options.nodeDimensionsIncludeLabels&&w.isParent()){var S=w.boundingBox({includeLabels:!0,includeNodes:!1}).w,D=w.boundingBox({includeLabels:!0,includeNodes:!1}).h,P=w.css("text-halign");A.labelWidth=S,A.labelHeight=D,A.labelPos=P}if(this.idToLNode[w.data("id")]=A,isNaN(A.rect.x)&&(A.rect.x=0),isNaN(A.rect.y)&&(A.rect.y=0),C!=null&&C.length>0){var x;x=E.getGraphManager().add(E.newGraph(),A),this.processChildrenList(x,C,E)}}},g.prototype.stop=function(){return this.stopped=!0,this};var y=function(m){m("layout","cose-bilkent",g)};typeof cytoscape<"u"&&y(cytoscape),a.exports=y})])})})(li)),li.exports}var gI=dI();const EI=Cv(gI);export{EI as a,mI as b,Aa as c,bI as f};