@smartmemory/compose 0.2.6-beta → 0.2.7-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 (63) hide show
  1. package/bin/compose.js +7 -0
  2. package/bin/git-hooks/pre-push.template +41 -13
  3. package/dist/assets/{App-j8fWZcGr.js → App-D3ehVPvi.js} +4 -4
  4. package/dist/assets/{arc-BFqOo_jJ.js → arc-Dmf69iHG.js} +1 -1
  5. package/dist/assets/{architectureDiagram-3BPJPVTR-D722w0RE.js → architectureDiagram-3BPJPVTR-xYo993Yw.js} +1 -1
  6. package/dist/assets/{blockDiagram-GPEHLZMM-B4w0mOAJ.js → blockDiagram-GPEHLZMM-UX4EF98O.js} +1 -1
  7. package/dist/assets/{c4Diagram-AAUBKEIU-D6LE8-j8.js → c4Diagram-AAUBKEIU-DaP9CGWb.js} +1 -1
  8. package/dist/assets/channel-D_RXsFFT.js +1 -0
  9. package/dist/assets/{chunk-2J33WTMH-CrazA7xu.js → chunk-2J33WTMH-CKk_RN3A.js} +1 -1
  10. package/dist/assets/{chunk-4BX2VUAB-Cp90GiCM.js → chunk-4BX2VUAB-DboAwYKw.js} +1 -1
  11. package/dist/assets/{chunk-55IACEB6-Bnais1SK.js → chunk-55IACEB6-Dsy9RYvI.js} +1 -1
  12. package/dist/assets/{chunk-727SXJPM-kD07Sqp5.js → chunk-727SXJPM-fAH0QO9v.js} +1 -1
  13. package/dist/assets/{chunk-AQP2D5EJ-DmIxhJc8.js → chunk-AQP2D5EJ-DyZYerFP.js} +1 -1
  14. package/dist/assets/{chunk-FMBD7UC4-Jti_und8.js → chunk-FMBD7UC4-BnboGO5t.js} +1 -1
  15. package/dist/assets/{chunk-ND2GUHAM-Ipx3noKz.js → chunk-ND2GUHAM-Di9tYXme.js} +1 -1
  16. package/dist/assets/{chunk-QZHKN3VN-CeblRnPF.js → chunk-QZHKN3VN-zRPRlAIL.js} +1 -1
  17. package/dist/assets/classDiagram-4FO5ZUOK-K6wdB4ic.js +1 -0
  18. package/dist/assets/classDiagram-v2-Q7XG4LA2-K6wdB4ic.js +1 -0
  19. package/dist/assets/{cose-bilkent-S5V4N54A-fNQlSmHt.js → cose-bilkent-S5V4N54A-C7Hqukaf.js} +1 -1
  20. package/dist/assets/{dagre-BM42HDAG-D27D6YAL.js → dagre-BM42HDAG-B-cR-BjI.js} +1 -1
  21. package/dist/assets/{diagram-2AECGRRQ-CtXeohzN.js → diagram-2AECGRRQ-B6-5onDk.js} +1 -1
  22. package/dist/assets/{diagram-5GNKFQAL-C_BqZkx0.js → diagram-5GNKFQAL-DoZZgFAM.js} +1 -1
  23. package/dist/assets/{diagram-KO2AKTUF-B29ynQz4.js → diagram-KO2AKTUF-77jEGlJh.js} +1 -1
  24. package/dist/assets/{diagram-LMA3HP47-DAYJMc2I.js → diagram-LMA3HP47-D3S7XDRD.js} +1 -1
  25. package/dist/assets/{diagram-OG6HWLK6-CBJMis3l.js → diagram-OG6HWLK6-KbYL9aCY.js} +1 -1
  26. package/dist/assets/{erDiagram-TEJ5UH35-nd3GWiPn.js → erDiagram-TEJ5UH35-DezFbJP-.js} +1 -1
  27. package/dist/assets/{flowDiagram-I6XJVG4X-HFUno_nV.js → flowDiagram-I6XJVG4X-4x31cK9j.js} +1 -1
  28. package/dist/assets/{ganttDiagram-6RSMTGT7-CPPAAjwR.js → ganttDiagram-6RSMTGT7-FopfSTyZ.js} +1 -1
  29. package/dist/assets/{gitGraphDiagram-PVQCEYII-NBq1F6K2.js → gitGraphDiagram-PVQCEYII-DSiQGKbN.js} +1 -1
  30. package/dist/assets/graph-Cs_vqCR0.js +331 -0
  31. package/dist/assets/{index-uHKnp74B.js → index-ClX6LVAf.js} +2 -2
  32. package/dist/assets/{infoDiagram-5YYISTIA-D-TOBtCq.js → infoDiagram-5YYISTIA-DE6BqzK_.js} +1 -1
  33. package/dist/assets/{ishikawaDiagram-YF4QCWOH-nXOztZiZ.js → ishikawaDiagram-YF4QCWOH-Dml8NwQI.js} +1 -1
  34. package/dist/assets/{journeyDiagram-JHISSGLW-Bko3tTdh.js → journeyDiagram-JHISSGLW-CwWeJgjE.js} +1 -1
  35. package/dist/assets/{kanban-definition-UN3LZRKU-1e-7i8st.js → kanban-definition-UN3LZRKU-DnG956Wh.js} +1 -1
  36. package/dist/assets/{linear-Dx5ZJB7F.js → linear-CA3N7Rpi.js} +1 -1
  37. package/dist/assets/{mindmap-definition-RKZ34NQL-CNwNkDqN.js → mindmap-definition-RKZ34NQL-CxfIOjLX.js} +1 -1
  38. package/dist/assets/{pieDiagram-4H26LBE5-C5fvCej-.js → pieDiagram-4H26LBE5-O7aIwy1x.js} +1 -1
  39. package/dist/assets/{quadrantDiagram-W4KKPZXB-4NoQsF61.js → quadrantDiagram-W4KKPZXB-CPQ2qq7c.js} +1 -1
  40. package/dist/assets/{requirementDiagram-4Y6WPE33-q5WxB9LO.js → requirementDiagram-4Y6WPE33-C23horL4.js} +1 -1
  41. package/dist/assets/{sankeyDiagram-5OEKKPKP-DlQNB367.js → sankeyDiagram-5OEKKPKP-DPY04kOW.js} +1 -1
  42. package/dist/assets/{sequenceDiagram-3UESZ5HK-BzHclOKt.js → sequenceDiagram-3UESZ5HK-BKaTfIvo.js} +1 -1
  43. package/dist/assets/{stateDiagram-AJRCARHV-BvWRI9zK.js → stateDiagram-AJRCARHV-B9na_6mY.js} +1 -1
  44. package/dist/assets/stateDiagram-v2-BHNVJYJU-Cf84VDiH.js +1 -0
  45. package/dist/assets/{timeline-definition-PNZ67QCA-j2wKjAti.js → timeline-definition-PNZ67QCA-BBWPqd7X.js} +1 -1
  46. package/dist/assets/{vennDiagram-CIIHVFJN-B77g7htC.js → vennDiagram-CIIHVFJN-tWqiHsOZ.js} +1 -1
  47. package/dist/assets/{wardley-L42UT6IY-83Im2mo2.js → wardley-L42UT6IY-DorxG6os.js} +1 -1
  48. package/dist/assets/{wardleyDiagram-YWT4CUSO-CK-XB-bO.js → wardleyDiagram-YWT4CUSO-B49f8GzW.js} +1 -1
  49. package/dist/assets/{xychartDiagram-2RQKCTM6-D42FcVOY.js → xychartDiagram-2RQKCTM6-BgKSj8Qb.js} +1 -1
  50. package/dist/index.html +1 -1
  51. package/lib/build.js +4 -1
  52. package/lib/result-normalizer.js +5 -1
  53. package/package.json +2 -2
  54. package/server/agent-spawn.js +7 -1
  55. package/server/compose-mcp-tools.js +103 -1
  56. package/server/compose-mcp.js +34 -4
  57. package/server/design-routes.js +4 -1
  58. package/server/mcp-tool-policy.js +112 -0
  59. package/dist/assets/channel-BD-5_hPW.js +0 -1
  60. package/dist/assets/classDiagram-4FO5ZUOK-mSW5R7DY.js +0 -1
  61. package/dist/assets/classDiagram-v2-Q7XG4LA2-mSW5R7DY.js +0 -1
  62. package/dist/assets/graph-CJVNlri5.js +0 -331
  63. package/dist/assets/stateDiagram-v2-BHNVJYJU-CDlF0VA8.js +0 -1
@@ -0,0 +1,331 @@
1
+ import{c as Fn,g as Av}from"./mobile-CG5tLa2S.js";function iv(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 lx(t){if(Array.isArray(t))return t}function fx(t){if(Array.isArray(t))return iv(t)}function Ir(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function hx(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 Pr(t,e,r){return e&&hx(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function Bt(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=Lv(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 cx(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function vx(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 dx(){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 gx(){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 ht(t,e){return lx(t)||vx(t,e)||Lv(t,e)||dx()}function vi(t){return fx(t)||cx(t)||Lv(t)||gx()}function px(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=px(t,"string");return typeof e=="symbol"?e:e+""}function pt(t){"@babel/helpers - typeof";return pt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},pt(t)}function Lv(t,e){if(t){if(typeof t=="string")return iv(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)?iv(t,e):void 0}}var dt=typeof window>"u"?null:window,gd=dt?dt.navigator:null;dt&&dt.document;var yx=pt(""),mE=pt({}),mx=pt(function(){}),bx=typeof HTMLElement>"u"?"undefined":pt(HTMLElement),pn=function(e){return e&&e.instanceString&&ot(e.instanceString)?e.instanceString():null},Oe=function(e){return e!=null&&pt(e)==yx},ot=function(e){return e!=null&&pt(e)===mx},Je=function(e){return!qt(e)&&(Array.isArray?Array.isArray(e):e!=null&&e instanceof Array)},He=function(e){return e!=null&&pt(e)===mE&&!Je(e)&&e.constructor===Object},Ex=function(e){return e!=null&&pt(e)===mE},we=function(e){return e!=null&&pt(e)===pt(1)&&!isNaN(e)},wx=function(e){return we(e)&&Math.floor(e)===e},di=function(e){if(bx!=="undefined")return e!=null&&e instanceof HTMLElement},qt=function(e){return yn(e)||bE(e)},yn=function(e){return pn(e)==="collection"&&e._private.single},bE=function(e){return pn(e)==="collection"&&!e._private.single},Rv=function(e){return pn(e)==="core"},EE=function(e){return pn(e)==="stylesheet"},Tx=function(e){return pn(e)==="event"},Rr=function(e){return e==null?!0:!!(e===""||e.match(/^\s+$/))},xx=function(e){return typeof HTMLElement>"u"?!1:e instanceof HTMLElement},Cx=function(e){return He(e)&&we(e.x1)&&we(e.x2)&&we(e.y1)&&we(e.y2)},Ax=function(e){return Ex(e)&&ot(e.then)},Lx=function(){return gd&&gd.userAgent.match(/msie|trident|edge/i)},xa=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},Sv=xa(function(t){return t.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()})}),Si=xa(function(t){return t.replace(/(-\w)/g,function(e){return e[1].toUpperCase()})}),wE=xa(function(t,e){return t+e[0].toUpperCase()+e.substring(1)},function(t,e){return t+"$"+e}),pd=function(e){return Rr(e)?e:e.charAt(0).toUpperCase()+e.substring(1)},Tr=function(e,r){return e.slice(-1*r.length)===r},gt="(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))",Rx="rgb[a]?\\(("+gt+"[%]?)\\s*,\\s*("+gt+"[%]?)\\s*,\\s*("+gt+"[%]?)(?:\\s*,\\s*("+gt+"))?\\)",Sx="rgb[a]?\\((?:"+gt+"[%]?)\\s*,\\s*(?:"+gt+"[%]?)\\s*,\\s*(?:"+gt+"[%]?)(?:\\s*,\\s*(?:"+gt+"))?\\)",Dx="hsl[a]?\\(("+gt+")\\s*,\\s*("+gt+"[%])\\s*,\\s*("+gt+"[%])(?:\\s*,\\s*("+gt+"))?\\)",Nx="hsl[a]?\\((?:"+gt+")\\s*,\\s*(?:"+gt+"[%])\\s*,\\s*(?:"+gt+"[%])(?:\\s*,\\s*(?:"+gt+"))?\\)",Mx="\\#[0-9a-fA-F]{3}",Ox="\\#[0-9a-fA-F]{6}",TE=function(e,r){return e<r?-1:e>r?1:0},Ix=function(e,r){return-1*TE(e,r)},_e=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},Px=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]}},Fx=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("^"+Dx+"$").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},_x=function(e){var r,a=new RegExp("^"+Rx+"$").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},Bx=function(e){return kx[e.toLowerCase()]},xE=function(e){return(Je(e)?e:null)||Bx(e)||Px(e)||_x(e)||Fx(e)},kx={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(He(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(He(o))throw Error("Tried to get map with object key");if(r=r[o],r==null)return r}return r},_n=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function mn(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var fo,yd;function bn(){if(yd)return fo;yd=1;function t(e){var r=typeof e;return e!=null&&(r=="object"||r=="function")}return fo=t,fo}var ho,md;function qx(){if(md)return ho;md=1;var t=typeof _n=="object"&&_n&&_n.Object===Object&&_n;return ho=t,ho}var co,bd;function Di(){if(bd)return co;bd=1;var t=qx(),e=typeof self=="object"&&self&&self.Object===Object&&self,r=t||e||Function("return this")();return co=r,co}var vo,Ed;function Gx(){if(Ed)return vo;Ed=1;var t=Di(),e=function(){return t.Date.now()};return vo=e,vo}var go,wd;function Ux(){if(wd)return go;wd=1;var t=/\s/;function e(r){for(var a=r.length;a--&&t.test(r.charAt(a)););return a}return go=e,go}var po,Td;function zx(){if(Td)return po;Td=1;var t=Ux(),e=/^\s+/;function r(a){return a&&a.slice(0,t(a)+1).replace(e,"")}return po=r,po}var yo,xd;function Dv(){if(xd)return yo;xd=1;var t=Di(),e=t.Symbol;return yo=e,yo}var mo,Cd;function Vx(){if(Cd)return mo;Cd=1;var t=Dv(),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 mo=i,mo}var bo,Ad;function Yx(){if(Ad)return bo;Ad=1;var t=Object.prototype,e=t.toString;function r(a){return e.call(a)}return bo=r,bo}var Eo,Ld;function LE(){if(Ld)return Eo;Ld=1;var t=Dv(),e=Vx(),r=Yx(),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 Eo=o,Eo}var wo,Rd;function Hx(){if(Rd)return wo;Rd=1;function t(e){return e!=null&&typeof e=="object"}return wo=t,wo}var To,Sd;function En(){if(Sd)return To;Sd=1;var t=LE(),e=Hx(),r="[object Symbol]";function a(n){return typeof n=="symbol"||e(n)&&t(n)==r}return To=a,To}var xo,Dd;function Xx(){if(Dd)return xo;Dd=1;var t=zx(),e=bn(),r=En(),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 xo=u,xo}var Co,Nd;function Wx(){if(Nd)return Co;Nd=1;var t=bn(),e=Gx(),r=Xx(),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 Co=o,Co}var $x=Wx(),wn=mn($x),Ao=dt?dt.performance:null,RE=Ao&&Ao.now?function(){return Ao.now()}:function(){return Date.now()},Kx=(function(){if(dt){if(dt.requestAnimationFrame)return function(t){dt.requestAnimationFrame(t)};if(dt.mozRequestAnimationFrame)return function(t){dt.mozRequestAnimationFrame(t)};if(dt.webkitRequestAnimationFrame)return function(t){dt.webkitRequestAnimationFrame(t)};if(dt.msRequestAnimationFrame)return function(t){dt.msRequestAnimationFrame(t)}}return function(t){t&&setTimeout(function(){t(RE())},1e3/60)}})(),gi=function(e){return Kx(e)},hr=RE,Hr=9261,SE=65599,ga=5381,DE=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Hr,a=r,n;n=e.next(),!n.done;)a=a*SE+n.value|0;return a},on=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Hr;return r*SE+e|0},sn=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ga;return(r<<5)+r+e|0},Zx=function(e,r){return e*2097152+r},br=function(e){return e[0]*2097152+e[1]},Bn=function(e,r){return[on(e[0],r[0]),sn(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)},$r=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 Qx(arguments)},Qx=function(e){for(var r,a=0;a<e.length;a++){var n=e[a];a===0?r=$r(n):r=$r(n,r)}return r};function Jx(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 eC(t,e,r){if(r===0)return t;var a=(e.x1+e.x2)/2,n=(e.y1+e.y2)/2,i=e.w/e.h,o=1/i,s=Jx(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,tC=console.warn!=null,rC=console.trace!=null,Nv=Number.MAX_SAFE_INTEGER||9007199254740991,ME=function(){return!0},pi=function(){return!1},Id=function(){return 0},Mv=function(){},nt=function(e){throw new Error(e)},OE=function(e){if(e!==void 0)Od=!!e;else return Od},Ke=function(e){OE()&&(tC?console.warn(e):(console.log(e),rC&&console.trace()))},aC=function(e){return _e({},e)},ar=function(e){return e==null?e:Je(e)?e.slice():He(e)?aC(e):e},nC=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},iC={},PE=function(){return iC},At=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}},Sr=function(e,r,a){for(var n=e.length-1;n>=0;n--)e[n]===r&&e.splice(n,1)},Ov=function(e){e.splice(0,e.length)},oC=function(e,r){for(var a=0;a<r.length;a++){var n=r[a];e.push(n)}},Ot=function(e,r,a){return a&&(r=wE(a,r)),e[r]},rr=function(e,r,a,n){a&&(r=wE(a,r)),e[r]=n},sC=(function(){function t(){Ir(this,t),this._obj={}}return Pr(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]}}])})(),fr=typeof Map<"u"?Map:sC,uC="undefined",lC=(function(){function t(e){if(Ir(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 Pr(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)}}])})(),Da=(typeof Set>"u"?"undefined":pt(Set))!==uC?Set:lC,Ni=function(e,r){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0||r===void 0||!Rv(e)){nt("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"){nt("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 Da,animation:{current:[],queue:[]},rscratch:{},scratch:r.scratch||{},edges:[],children:[],parent:r.parent&&r.parent.isNode()?r.parent:null,traversalCache:{},backgrounding:!1,bbCache:null,bbCacheShift:{x:0,y:0},bodyBounds:null,overlayBounds:null,labelBounds:{all:null,source:null,target:null,main:null},arrowBounds:{source:null,target:null,"mid-source":null,"mid-target":null}};if(i.position.x==null&&(i.position.x=0),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:Oe(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&&(Ke("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;He(a)&&!qt(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=Oe(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,k=M==null?void 0:P.same(I)?O[0]:I[0],F;if(F=n(P,M,k,d++,N),F===!0)return g=P,1;if(F===!1)return 1;for(var _=P.connectedEdges().filter(function(U){return(!i||U.source().same(P))&&b.has(U)}),z=0;z<_.length;z++){var X=_[z],q=X.connectedNodes().filter(function(U){return!U.same(P)&&y.has(U)}),G=q.id();q.length!==0&&!c[G]&&(q=q[0],l.push(q),e.bfs&&(c[G]=!0,f.push(q)),h[G]=X,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)}}},un={breadthFirstSearch:Pd({bfs:!0}),depthFirstSearch:Pd({dfs:!0})};un.bfs=un.breadthFirstSearch;un.dfs=un.depthFirstSearch;var Kn={exports:{}},fC=Kn.exports,Fd;function hC(){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(fC)})(Kn)),Kn.exports}var Lo,_d;function cC(){return _d||(_d=1,Lo=hC()),Lo}var vC=cC(),Tn=mn(vC),dC=At({root:null,weight:function(e){return 1},directed:!1}),gC={dijkstra:function(e){if(!He(e)){var r=arguments;e={root:r[0],weight:r[1],directed:r[2]}}var a=dC(e),n=a.root,i=a.weight,o=a.directed,s=this,u=i,l=Oe(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 Tn(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),k=1/0,F,_=0;_<O.length;_++){var z=O[_],X=u(z);(X<k||!F)&&(k=X,F=z)}return{edge:F,dist:k}};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=Oe(M)?d.filter(M)[0]:M[0];return v[I.id()]},pathTo:function(M){var I=Oe(M)?d.filter(M)[0]:M[0],O=[],k=I,F=k.id();if(I.length>0)for(O.unshift(I);h[F];){var _=h[F];O.unshift(_.edge),O.unshift(_.node),k=_.node,F=k.id()}return s.spawn(O)}}}},pC={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}},yC=At({root:null,goal:null,weight:function(e){return 1},heuristic:function(e){return 0},directed:!1}),mC={aStar:function(e){var r=this.cy(),a=yC(e),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 Tn(function(F,_){return v[F.id()]-v[_.id()]}),g=new Da,p={},y={},b=function(_,z){d.push(_),g.add(z)},m,E,T=function(){m=d.pop(),E=m.id(),g.delete(E)},L=function(_){return g.has(_)};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 k=h[E]+u(x);if(!L(O)){h[O]=k,v[O]=k+o(I),b(I,O),p[O]=m,y[O]=x;continue}k<h[O]&&(h[O]=k,v[O]=k+o(I),p[O]=m,y[O]=x)}}}}return{found:!1,distance:void 0,path:void 0,steps:w}}},bC=At({weight:function(e){return 1},directed:!1}),EC={floydWarshall:function(e){for(var r=this.cy(),a=bC(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(X){return u.indexOf(X)},c=function(X){return u[X]},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 k=function(X){return(Oe(X)?r.filter(X):X)[0]},F=function(X){return v(k(X))},_={distance:function(X,q){var G=F(X),U=F(q);return d[G*f+U]},path:function(X,q){var G=F(X),U=F(q),K=c(G);if(G===U)return K.collection();if(b[G*f+U]==null)return r.collection();var J=r.collection(),Y=G,H;for(J.merge(K);G!==U;)Y=G,G=b[G*f+U],H=m[Y*f+G],J.merge(H),J.merge(c(G));return J}};return _}},wC=At({weight:function(e){return 1},directed:!1,root:null}),TC={bellmanFord:function(e){var r=this,a=wC(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 fr,g=!1,p=[];o=l.collection(o)[0],h.unmergeBy(function(fe){return fe.isLoop()});for(var y=h.length,b=function(se){var ve=d.get(se.id());return ve||(ve={},d.set(se.id(),ve)),ve},m=function(se){return(Oe(se)?l.$(se):se)[0]},E=function(se){return b(m(se)).dist},T=function(se){for(var ve=arguments.length>1&&arguments[1]!==void 0?arguments[1]:o,ce=m(se),ye=[],ge=ce;;){if(ge==null)return r.spawn();var de=b(ge),be=de.edge,Re=de.pred;if(ye.unshift(ge[0]),ge.same(ve)&&ye.length>0)break;be!=null&&ye.unshift(be),ge=Re}return u.spawn(ye)},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(se,ve,ce,ye,ge,de){var be=ye.dist+de;be<ge.dist&&!ce.same(ye.edge)&&(ge.dist=be,ge.pred=se,ge.edge=ce,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 k=[],F=0;F<y;F++){var _=h[F],z=_.source(),X=_.target(),q=s(_),G=b(z).dist,U=b(X).dist;if(G+q<U||!i&&U+q<G)if(g||(Ke("Graph contains a negative weight cycle for Bellman-Ford"),g=!0),e.findNegativeWeightCycles!==!1){var K=[];G+q<U&&K.push(z),!i&&U+q<G&&K.push(X);for(var J=K.length,Y=0;Y<J;Y++){var H=K[Y],$=[H];$.push(b(H).edge);for(var Q=b(H).pred;$.indexOf(Q)===-1;)$.push(Q),$.push(b(Q).edge),Q=b(Q).pred;$=$.slice($.indexOf(Q));for(var ee=$[0].id(),te=0,le=2;le<$.length;le+=2)$[le].id()<ee&&(ee=$[le].id(),te=le);$=$.slice(te).concat($.slice(0,te)),$.push($[0]);var Ee=$.map(function(fe){return fe.id()}).join(",");k.indexOf(Ee)===-1&&(p.push(u.spawn($)),k.push(Ee))}}else break}return{distanceTo:E,pathTo:T,hasNegativeWeightCycle:g,negativeWeightCycles:p}}},xC=Math.sqrt(2),CC=function(e,r,a){a.length===0&&nt("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},Ro=function(e,r,a,n){for(;a>n;){var i=Math.floor(Math.random()*r.length);r=CC(i,e,r),a--}return r},AC={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/xC);if(i<2){nt("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(k,F){for(var _=0;_<i;_++)F[_]=k[_]},b=0;b<=s;b++){for(var m=0;m<i;m++)g[m]=m;var E=Ro(g,l.slice(),i,u),T=E.slice();y(g,p);var L=Ro(g,E,u,2),w=Ro(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(k){var F=e.spawn();return k.forEach(function(_){F.merge(_),_.connectedEdges().forEach(function(z){e.contains(z)&&!C.contains(z)&&F.merge(z)})}),F},M=[N(A),N(R)],I={cut:C,components:M,partition1:A,partition2:R};return I}},So,LC=function(e){return{x:e.x,y:e.y}},Mi=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}},pa=function(e){return{x:e[0],y:e[1]}},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.min(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=-1/0,i=r;i<a;i++){var o=e[i];isFinite(o)&&(n=Math.max(o,n))}return n},DC=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},NC=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},MC=function(e){return Math.PI*e/180},kn=function(e,r){return Math.atan2(r,e)-Math.PI/2},Iv=Math.log2||function(t){return Math.log(t)/Math.log(2)},Pv=function(e){return e>0?1:e<0?-1:0},Kr=function(e,r){return Math.sqrt(Vr(e,r))},Vr=function(e,r){var a=r.x-e.x,n=r.y-e.y;return a*a+n*n},OC=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},Et=function(e,r,a,n){return(1-n)*(1-n)*e+2*(1-n)*n*r+n*n*a},ba=function(e,r,a,n){return{x:Et(e.x,r.x,a.x,n),y:Et(e.y,r.y,a.y,n)}},IC=function(e,r,a,n){var i={x:r.x-e.x,y:r.y-e.y},o=Kr(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}},ln=function(e,r,a){return Math.max(e,Math.min(a,r))},It=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}}},PC=function(e){return{x1:e.x1,x2:e.x2,w:e.w,y1:e.y1,y2:e.y2,h:e.h}},FC=function(e){e.x1=1/0,e.y1=1/0,e.x2=-1/0,e.y2=-1/0,e.w=0,e.h=0},_C=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},Zn=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},Qn=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=ht(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},Fv=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)},xr=function(e,r,a){return e.x1<=r&&r<=e.x2&&e.y1<=a&&a<=e.y2},kd=function(e,r){return xr(e,r.x,r.y)},BE=function(e,r){return xr(e,r.x1,r.y1)&&xr(e,r.x2,r.y2)},BC=(So=Math.hypot)!==null&&So!==void 0?So:function(t,e){return Math.sqrt(t*t+e*e)};function kC(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=BC(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 qC(t,e,r,a,n,i){var o=$C(t,e,r,a,n),s=kC(o,i),u=It();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"?Dr(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=Cr(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=Cr(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=Cr(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=Cr(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=Za(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,k=n-h+l;if(N=Za(e,r,a,n,O,k,l+s),N.length>0&&N[0]>=O&&N[1]<=k)return[N[0],N[1]]}{var F=a+f-l,_=n+h-l;if(N=Za(e,r,a,n,F,_,l+s),N.length>0&&N[0]>=F&&N[1]>=_)return[N[0],N[1]]}{var z=a-f+l,X=n+h-l;if(N=Za(e,r,a,n,z,X,l+s),N.length>0&&N[0]<=z&&N[1]>=X)return[N[0],N[1]]}return[]},GC=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},UC=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)},zC=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]},VC=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)},YC=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=[];VC(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},HC=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},_t=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},cr=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=mi(f,-l);g=yi(p)}else g=f;return _t(e,r,g)},XC=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 _t(e,r,l)},yi=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=Cr(a,n,i,o,s,u,l,f,!0);r[h*2]=v[0],r[h*2+1]=v[1]}return r},mi=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},WC=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},Za=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]},Do=function(e,r,a){return r<=e&&e<=a||a<=e&&e<=r?e:e<=r&&r<=a||a<=r&&r<=e?r:a},Cr=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?Do(e,a,s)===s?[s,u]:Do(e,a,i)===i?[i,o]:Do(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},fn=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=mi(h,-u);c=yi(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=Cr(e,r,n,i,p,y,b,m),f.length!==0&&l.push(f[0],f[1]);return l},KC=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=Za(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=Cr(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},qn=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]]},Mt=function(e,r){var a=ov(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},ov=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},Dr=function(e,r){return Math.min(e/4,r/4,8)},GE=function(e,r){return Math.min(e/10,r/10,8)},_v=function(){return 8},ZC=function(e,r,a){return[e-2*r+a,2*(r-e),e]},sv=function(e,r){return{heightOffset:Math.min(15,.05*r),widthOffset:Math.min(100,.25*e),ctrlPtOffsetPct:.05}};function No(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=Bt(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(vi(r(t)),vi(r(e))),o=Bt(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 QC=At({dampingFactor:.8,precision:1e-6,iterations:200,weight:function(e){return 1}}),JC={pageRank:function(e){for(var r=QC(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),k=new Array(h),F,_=0;_<h;_++)O[_]=1;for(var z=0;z<i;z++){for(var X=0;X<h;X++)k[X]=0;for(var q=0;q<h;q++)for(var G=0;G<h;G++){var U=q*h+G;k[q]+=d[U]*O[G]}OC(k),F=O,O=k,k=F;for(var K=0,J=0;J<h;J++){var Y=F[J]-O[J];K+=Y*Y}if(K<n)break}var H={rank:function(Q){return Q=s.collection(Q)[0],O[l.indexOf(Q)]}};return H}},qd=At({root:null,weight:function(e){return 1},directed:!1,alpha:0}),Ea={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:(Oe(m)&&(m=r.filter(m)),f[m.id()]/v)},outdegree:function(m){return c===0?0:(Oe(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:(Oe(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)}}}};Ea.dc=Ea.degreeCentrality;Ea.dcn=Ea.degreeCentralityNormalised=Ea.degreeCentralityNormalized;var Gd=At({harmonic:!0,weight:function(){return 1},directed:!1,root:null}),wa={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:(Oe(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}};wa.cc=wa.closenessCentrality;wa.ccn=wa.closenessCentralityNormalised=wa.closenessCentralityNormalized;var jC=At({weight:null,directed:!1}),uv={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 Tn(function(q,G){return w[q]-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 k={},F=0;F<s.length;F++)k[s[F].id()]=0;for(;E.length>0;){for(var _=E.pop(),z=0;z<T[_].length;z++){var X=T[_][z];k[X]=k[X]+L[X]/L[_]*(1+k[_])}_!=s[p].id()&&h.set(_,h.get(_)+k[_])}},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}};uv.bc=uv.betweennessCentrality;var eA=At({expandFactor:2,inflateFactor:2,multFactor:1,maxIterations:20,attributes:[function(t){return 1}]}),tA=function(e){return eA(e)},rA=function(e,r){for(var a=0,n=0;n<r.length;n++)a+=r[n](e);return a},aA=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}},nA=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},iA=function(e,r,a){for(var n=e.slice(0),i=1;i<a;i++)e=nA(e,n,r);return e},oA=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},sA=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},uA=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},lA=function(e,r){for(var a=0;a<e.length;a++)if(!r[a]||e[a].id()!==r[a].id())return!1;return!0},fA=function(e){for(var r=0;r<e.length;r++)for(var a=0;a<e.length;a++)r!=a&&lA(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=tA(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=rA(d,i.attributes);f[g*u+p]+=y,f[p*u+g]+=y}aA(f,u,i.multFactor),UE(f,u);for(var b=!0,m=0;b&&m<i.maxIterations;)b=!1,h=iA(f,u,i.expandFactor),f=oA(h,u,i.inflateFactor),sA(f,h,l,4)||(b=!0),m++;var E=uA(f,u,r,n);return E=fA(E),E},hA={markovClustering:Ud,mcl:Ud},cA=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)},vA=function(e){return Math.sqrt(e)},dA=function(e,r,a){return Math.max(e,zE(r,a))},Va=function(e,r,a,n,i){for(var o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:cA,s=n,u,l,f=0;f<e;f++)u=r(f),l=a(f),s=i(s,u,l);return o(s)},Ca={euclidean:function(e,r,a){return e>=2?Va(e,r,a,0,Vd,vA):Va(e,r,a,0,zd)},squaredEuclidean:function(e,r,a){return Va(e,r,a,0,Vd)},manhattan:function(e,r,a){return Va(e,r,a,0,zd)},max:function(e,r,a){return Va(e,r,a,-1/0,dA)}};Ca["squared-euclidean"]=Ca.squaredEuclidean;Ca.squaredeuclidean=Ca.squaredEuclidean;function Oi(t,e,r,a,n,i){var o;return ot(t)?o=t:o=Ca[t]||Ca.euclidean,e===0&&ot(t)?o(n,i):o(e,r,a,n,i)}var gA=At({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),Bv=function(e){return gA(e)},bi=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 Oi(e,n.length,s,u,l,f)},Mo=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=bi(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},pA=function(e,r,a){return Math.abs(r-e)<=a},yA=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},mA=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)];mA(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+=bi("manhattan",r[i],e,a,"kMedoids");return n},bA=function(e){var r=this.cy(),a=this.nodes(),n=null,i=Bv(e),o=new Array(i.k),s={},u;i.testMode?typeof i.testCentroids=="number"?(i.testCentroids,u=Mo(a,i.k,i.attributes)):pt(i.testCentroids)==="object"?u=i.testCentroids:u=Mo(a,i.k,i.attributes):u=Mo(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,pA(p[b],g[b],i.sensitivityThreshold)||(l=!0)}u[v]=p,o[v]=r.collection(c)}}f++}return o},EA=function(e){var r=this.cy(),a=this.nodes(),n=null,i=Bv(e),o=new Array(i.k),s,u={},l,f=new Array(i.k);i.testMode?typeof i.testCentroids=="number"||(pt(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},wA=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}},TA=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=bi(i.distance,n[v],a[h],i.attributes,"cmeans"),l=bi(i.distance,n[v],a[c],i.attributes,"cmeans"),s+=Math.pow(u/l,f);e[v][h]=1/s}},xA=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=Bv(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,wA(o,a,s,l,n),TA(s,u,o,a,n),yA(s,u,n.sensitivityThreshold)||(b=!0),m++;return i=xA(a,s,n,r),{clusters:i,degreeOfMembership:s}},CA={kMeans:bA,kMedoids:EA,fuzzyCMeans:Xd,fcm:Xd},AA=At({distance:"euclidean",linkage:"min",mode:"threshold",threshold:1/0,addDendrogram:!1,dendrogramDepth:0,attributes:[]}),LA={single:"min",complete:"max"},RA=function(e){var r=AA(e),a=LA[r.linkage];return a!=null&&(r.linkage=a),r},Wd=function(e,r,a,n,i){for(var o=0,s=1/0,u,l=i.attributes,f=function(A,R){return Oi(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},ya=function(e,r,a){e&&(e.value?r.push(e.value):(e.left&&ya(e.left,r),e.right&&ya(e.right,r)))},lv=function(e,r){if(!e)return"";if(e.left&&e.right){var a=lv(e.left,r),n=lv(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()},fv=function(e,r,a){if(!e)return[];var n=[],i=[],o=[];return r===0?(e.left&&ya(e.left,n),e.right&&ya(e.right,i),o=n.concat(i),[a.collection(o)]):r===1?e.value?[a.collection(e.value)]:(e.left&&ya(e.left,n),e.right&&ya(e.right,i),[a.collection(n),a.collection(i)]):e.value?[a.collection(e.value)]:(e.left&&(n=fv(e.left,r-1,a)),e.right&&(i=fv(e.right,r-1,a)),n.concat(i))},$d=function(e){for(var r=this.cy(),a=this.nodes(),n=RA(e),i=n.attributes,o=function(m,E){return Oi(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=Wd(s,f,u,l,n);p;)p=Wd(s,f,u,l,n);var y;return n.mode==="dendrogram"?(y=fv(s[0],n.dendrogramDepth,r),n.addDendrogram&&lv(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},SA={hierarchicalClustering:$d,hca:$d},DA=At({distance:"euclidean",preference:"median",damping:.8,maxIterations:1e3,minIterations:100,attributes:[]}),NA=function(e){var r=e.damping,a=e.preference;.5<=r&&r<1||nt("Damping must range on [0.5, 1). Got: ".concat(r));var n=["median","mean","min","max"];return n.some(function(i){return i===a})||we(a)||nt("Preference must be one of [".concat(n.map(function(i){return"'".concat(i,"'")}).join(", "),"] or a number. Got: ").concat(a)),DA(e)},MA=function(e,r,a,n){var i=function(s,u){return n[u](s)};return-Oi(e,n.length,function(o){return i(r,o)},function(o){return i(a,o)},r,a)},OA=function(e,r){var a=null;return r==="median"?a=NC(e):r==="mean"?a=DC(e):r==="min"?a=RC(e):r==="max"?a=SC(e):a=r,a},IA=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},PA=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=NA(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]=MA(n.distance,a[d],a[g],n.attributes));f=OA(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,k=0;k<s;k++)m[k]=v[k*s+I],E[k]=Math.max(0,h[k*s+I]),O+=E[k];O-=E[I],E[I]=h[I*s+I],O+=E[I];for(var F=0;F<s;F++)v[F*s+I]=(1-n.damping)*Math.min(0,O-E[F])+n.damping*m[F];v[I*s+I]=(1-n.damping)*(O-E[I])+n.damping*m[I]}for(var _=0,z=0;z<s;z++){var X=v[z*s+z]+h[z*s+z]>0?1:0;w[A%n.minIterations*s+z]=X,_+=X}if(_>0&&(A>=n.minIterations-1||A==n.maxIterations-1)){for(var q=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)&&q++}if(q===s)break}}for(var K=IA(s,h,v),J=PA(s,l,K),Y={},H=0;H<K.length;H++)Y[K[H]]=[];for(var $=0;$<a.length;$++){var Q=i[a[$].id()],ee=J[Q];ee!=null&&Y[ee].push(a[$])}for(var te=new Array(K.length),le=0;le<K.length;le++)te[le]=r.collection(Y[K[le]]);return te},FA={affinityPropagation:Zd,ap:Zd},_A=At({root:void 0,directed:!1}),BA={hierholzer:function(e){if(!He(e)){var r=arguments;e={root:r[0],directed:r[1]}}var a=_A(e),n=a.root,i=a.directed,o=this,s=!1,u,l,f;n&&(f=Oe(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}},Gn=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}},kA={hopcroftTarjanBiconnected:Gn,htbc:Gn,htb:Gn,hopcroftTarjanBiconnectedComponents:Gn},Un=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}},qA={tarjanStronglyConnected:Un,tsc:Un,tscc:Un,tarjanStronglyConnectedComponents:Un},HE={};[un,gC,pC,mC,EC,TC,AC,JC,Ea,wa,uv,hA,CA,SA,FA,BA,kA,qA].forEach(function(t){_e(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,WE=1,$E=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,WE,"fulfillValue",e)},reject:function(e){return Qd(this,$E,"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===WE?Jd(e,"onFulfilled",e.fulfillValue):e.state===$E&&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(pt(r)==="object"&&r!==null||typeof r=="function")try{a=r.then}catch(i){e.reject(i);return}if(typeof a=="function"){var n=!1;try{a.call(r,function(i){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 Na=typeof Promise<"u"?Promise:Zt,hv=function(e,r,a){var n=Rv(e),i=!n,o=this._private=_e({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},Zr=hv.prototype;_e(Zr,{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),qt(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 Na(function(n,i){a.push(function(){n()})})}});Zr.complete=Zr.completed;Zr.run=Zr.play;Zr.running=Zr.playing;var GA={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=_e({},r,a);var h=Object.keys(r).length===0;if(h)return new hv(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&&He(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 hv(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=_e({},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}}},Oo,eg;function Ii(){if(eg)return Oo;eg=1;var t=Array.isArray;return Oo=t,Oo}var Io,tg;function UA(){if(tg)return Io;tg=1;var t=Ii(),e=En(),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 Io=n,Io}var Po,rg;function zA(){if(rg)return Po;rg=1;var t=LE(),e=bn(),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 Po=o,Po}var Fo,ag;function VA(){if(ag)return Fo;ag=1;var t=Di(),e=t["__core-js_shared__"];return Fo=e,Fo}var _o,ng;function YA(){if(ng)return _o;ng=1;var t=VA(),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 _o=r,_o}var Bo,ig;function HA(){if(ig)return Bo;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 Bo=r,Bo}var ko,og;function XA(){if(og)return ko;og=1;var t=zA(),e=YA(),r=bn(),a=HA(),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 ko=h,ko}var qo,sg;function WA(){if(sg)return qo;sg=1;function t(e,r){return e==null?void 0:e[r]}return qo=t,qo}var Go,ug;function kv(){if(ug)return Go;ug=1;var t=XA(),e=WA();function r(a,n){var i=e(a,n);return t(i)?i:void 0}return Go=r,Go}var Uo,lg;function Pi(){if(lg)return Uo;lg=1;var t=kv(),e=t(Object,"create");return Uo=e,Uo}var zo,fg;function $A(){if(fg)return zo;fg=1;var t=Pi();function e(){this.__data__=t?t(null):{},this.size=0}return zo=e,zo}var Vo,hg;function KA(){if(hg)return Vo;hg=1;function t(e){var r=this.has(e)&&delete this.__data__[e];return this.size-=r?1:0,r}return Vo=t,Vo}var Yo,cg;function ZA(){if(cg)return Yo;cg=1;var t=Pi(),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 Yo=n,Yo}var Ho,vg;function QA(){if(vg)return Ho;vg=1;var t=Pi(),e=Object.prototype,r=e.hasOwnProperty;function a(n){var i=this.__data__;return t?i[n]!==void 0:r.call(i,n)}return Ho=a,Ho}var Xo,dg;function JA(){if(dg)return Xo;dg=1;var t=Pi(),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 Xo=r,Xo}var Wo,gg;function jA(){if(gg)return Wo;gg=1;var t=$A(),e=KA(),r=ZA(),a=QA(),n=JA();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,Wo=i,Wo}var $o,pg;function eL(){if(pg)return $o;pg=1;function t(){this.__data__=[],this.size=0}return $o=t,$o}var Ko,yg;function QE(){if(yg)return Ko;yg=1;function t(e,r){return e===r||e!==e&&r!==r}return Ko=t,Ko}var Zo,mg;function Fi(){if(mg)return Zo;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 Zo=e,Zo}var Qo,bg;function tL(){if(bg)return Qo;bg=1;var t=Fi(),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 Qo=a,Qo}var Jo,Eg;function rL(){if(Eg)return Jo;Eg=1;var t=Fi();function e(r){var a=this.__data__,n=t(a,r);return n<0?void 0:a[n][1]}return Jo=e,Jo}var jo,wg;function aL(){if(wg)return jo;wg=1;var t=Fi();function e(r){return t(this.__data__,r)>-1}return jo=e,jo}var es,Tg;function nL(){if(Tg)return es;Tg=1;var t=Fi();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 es=e,es}var ts,xg;function iL(){if(xg)return ts;xg=1;var t=eL(),e=tL(),r=rL(),a=aL(),n=nL();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,ts=i,ts}var rs,Cg;function oL(){if(Cg)return rs;Cg=1;var t=kv(),e=Di(),r=t(e,"Map");return rs=r,rs}var as,Ag;function sL(){if(Ag)return as;Ag=1;var t=jA(),e=iL(),r=oL();function a(){this.size=0,this.__data__={hash:new t,map:new(r||e),string:new t}}return as=a,as}var ns,Lg;function uL(){if(Lg)return ns;Lg=1;function t(e){var r=typeof e;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?e!=="__proto__":e===null}return ns=t,ns}var is,Rg;function _i(){if(Rg)return is;Rg=1;var t=uL();function e(r,a){var n=r.__data__;return t(a)?n[typeof a=="string"?"string":"hash"]:n.map}return is=e,is}var os,Sg;function lL(){if(Sg)return os;Sg=1;var t=_i();function e(r){var a=t(this,r).delete(r);return this.size-=a?1:0,a}return os=e,os}var ss,Dg;function fL(){if(Dg)return ss;Dg=1;var t=_i();function e(r){return t(this,r).get(r)}return ss=e,ss}var us,Ng;function hL(){if(Ng)return us;Ng=1;var t=_i();function e(r){return t(this,r).has(r)}return us=e,us}var ls,Mg;function cL(){if(Mg)return ls;Mg=1;var t=_i();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 ls=e,ls}var fs,Og;function vL(){if(Og)return fs;Og=1;var t=sL(),e=lL(),r=fL(),a=hL(),n=cL();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,fs=i,fs}var hs,Ig;function dL(){if(Ig)return hs;Ig=1;var t=vL(),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,hs=r,hs}var cs,Pg;function gL(){if(Pg)return cs;Pg=1;var t=dL(),e=500;function r(a){var n=t(a,function(o){return i.size===e&&i.clear(),o}),i=n.cache;return n}return cs=r,cs}var vs,Fg;function JE(){if(Fg)return vs;Fg=1;var t=gL(),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 vs=a,vs}var ds,_g;function jE(){if(_g)return ds;_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 ds=t,ds}var gs,Bg;function pL(){if(Bg)return gs;Bg=1;var t=Dv(),e=jE(),r=Ii(),a=En(),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 gs=o,gs}var ps,kg;function ew(){if(kg)return ps;kg=1;var t=pL();function e(r){return r==null?"":t(r)}return ps=e,ps}var ys,qg;function tw(){if(qg)return ys;qg=1;var t=Ii(),e=UA(),r=JE(),a=ew();function n(i,o){return t(i)?i:e(i,o)?[i]:r(a(i))}return ys=n,ys}var ms,Gg;function qv(){if(Gg)return ms;Gg=1;var t=En();function e(r){if(typeof r=="string"||t(r))return r;var a=r+"";return a=="0"&&1/r==-1/0?"-0":a}return ms=e,ms}var bs,Ug;function yL(){if(Ug)return bs;Ug=1;var t=tw(),e=qv();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 bs=r,bs}var Es,zg;function mL(){if(zg)return Es;zg=1;var t=yL();function e(r,a,n){var i=r==null?void 0:t(r,a);return i===void 0?n:i}return Es=e,Es}var bL=mL(),EL=mn(bL),ws,Vg;function wL(){if(Vg)return ws;Vg=1;var t=kv(),e=(function(){try{var r=t(Object,"defineProperty");return r({},"",{}),r}catch{}})();return ws=e,ws}var Ts,Yg;function TL(){if(Yg)return Ts;Yg=1;var t=wL();function e(r,a,n){a=="__proto__"&&t?t(r,a,{configurable:!0,enumerable:!0,value:n,writable:!0}):r[a]=n}return Ts=e,Ts}var xs,Hg;function xL(){if(Hg)return xs;Hg=1;var t=TL(),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 xs=n,xs}var Cs,Xg;function CL(){if(Xg)return Cs;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 Cs=r,Cs}var As,Wg;function AL(){if(Wg)return As;Wg=1;var t=xL(),e=tw(),r=CL(),a=bn(),n=qv();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 As=i,As}var Ls,$g;function LL(){if($g)return Ls;$g=1;var t=AL();function e(r,a,n){return r==null?r:t(r,a,n)}return Ls=e,Ls}var RL=LL(),SL=mn(RL),Rs,Kg;function DL(){if(Kg)return Rs;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 Rs=t,Rs}var Ss,Zg;function NL(){if(Zg)return Ss;Zg=1;var t=jE(),e=DL(),r=Ii(),a=En(),n=JE(),i=qv(),o=ew();function s(u){return r(u)?t(u,i):a(u)?[u]:e(n(o(u)))}return Ss=s,Ss}var ML=NL(),OL=mn(ML),IL={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=_e({},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(Oe(n)){var h=n.indexOf(".")!==-1,v=h&&OL(n);if(o.allowGetting&&i===void 0){var c;return f&&(o.beforeGet(f),v&&f._private[o.field][n]===void 0?c=EL(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?SL(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&&He(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=_e({},r,e),function(n){var i=e,o=this,s=o.length!==void 0,u=s?o:[o];if(Oe(n)){for(var l=n.split(/\s+/),f=l.length,h=0;h<f;h++){var v=l[h];if(!Rr(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}}},PL={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 Na(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)})}}},$e={};[GA,IL,PL].forEach(function(t){_e($e,t)});var FL={animate:$e.animate(),animation:$e.animation(),animated:$e.animated(),clearQueue:$e.clearQueue(),delay:$e.delay(),delayAnimation:$e.delayAnimation(),stop:$e.stop()},Jn={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 Da(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}};Jn.className=Jn.classNames=Jn.classes;var Ye={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:`"(?:\\\\"|[^"])*"|'(?:\\\\'|[^'])*'`,number:gt,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};Ye.variable="(?:[\\w-.]|(?:\\\\"+Ye.metaChar+"))+";Ye.className="(?:[\\w-]|(?:\\\\"+Ye.metaChar+"))+";Ye.value=Ye.string+"|"+Ye.number;Ye.id=Ye.variable;(function(){var t,e,r;for(t=Ye.comparatorOp.split("|"),r=0;r<t.length;r++)e=t[r],Ye.comparatorOp+="|@"+e;for(t=Ye.comparatorOp.split("|"),r=0;r<t.length;r++)e=t[r],!(e.indexOf("!")>=0)&&e!=="="&&(Ye.comparatorOp+="|\\!"+e)})();var Qe=function(){return{checks:[]}},Se={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},cv=[{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 Ix(t.selector,e.selector)}),_L=(function(){for(var t={},e,r=0;r<cv.length;r++)e=cv[r],t[e.selector]=e.matches;return t})(),BL=function(e,r){return _L[e](r)},kL="("+cv.map(function(t){return t.selector}).join("|")+")",sa=function(e){return e.replace(new RegExp("\\\\("+Ye.metaChar+")","g"),function(r,a){return a})},Er=function(e,r,a){e[e.length-1]=a},vv=[{name:"group",query:!0,regex:"("+Ye.group+")",populate:function(e,r,a){var n=ht(a,1),i=n[0];r.checks.push({type:Se.GROUP,value:i==="*"?i:i+"s"})}},{name:"state",query:!0,regex:kL,populate:function(e,r,a){var n=ht(a,1),i=n[0];r.checks.push({type:Se.STATE,value:i})}},{name:"id",query:!0,regex:"\\#("+Ye.id+")",populate:function(e,r,a){var n=ht(a,1),i=n[0];r.checks.push({type:Se.ID,value:sa(i)})}},{name:"className",query:!0,regex:"\\.("+Ye.className+")",populate:function(e,r,a){var n=ht(a,1),i=n[0];r.checks.push({type:Se.CLASS,value:sa(i)})}},{name:"dataExists",query:!0,regex:"\\[\\s*("+Ye.variable+")\\s*\\]",populate:function(e,r,a){var n=ht(a,1),i=n[0];r.checks.push({type:Se.DATA_EXIST,field:sa(i)})}},{name:"dataCompare",query:!0,regex:"\\[\\s*("+Ye.variable+")\\s*("+Ye.comparatorOp+")\\s*("+Ye.value+")\\s*\\]",populate:function(e,r,a){var n=ht(a,3),i=n[0],o=n[1],s=n[2],u=new RegExp("^"+Ye.string+"$").exec(s)!=null;u?s=s.substring(1,s.length-1):s=parseFloat(s),r.checks.push({type:Se.DATA_COMPARE,field:sa(i),operator:o,value:s})}},{name:"dataBool",query:!0,regex:"\\[\\s*("+Ye.boolOp+")\\s*("+Ye.variable+")\\s*\\]",populate:function(e,r,a){var n=ht(a,2),i=n[0],o=n[1];r.checks.push({type:Se.DATA_BOOL,field:sa(o),operator:i})}},{name:"metaCompare",query:!0,regex:"\\[\\[\\s*("+Ye.meta+")\\s*("+Ye.comparatorOp+")\\s*("+Ye.number+")\\s*\\]\\]",populate:function(e,r,a){var n=ht(a,3),i=n[0],o=n[1],s=n[2];r.checks.push({type:Se.META_COMPARE,field:sa(i),operator:o,value:parseFloat(s)})}},{name:"nextQuery",separator:!0,regex:Ye.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:Ye.directedEdge,populate:function(e,r){if(e.currentSubject==null){var a=Qe(),n=r,i=Qe();return a.checks.push({type:Se.DIRECTED_EDGE,source:n,target:i}),Er(e,r,a),e.edgeCount++,i}else{var o=Qe(),s=r,u=Qe();return o.checks.push({type:Se.NODE_SOURCE,source:s,target:u}),Er(e,r,o),e.edgeCount++,u}}},{name:"undirectedEdge",separator:!0,regex:Ye.undirectedEdge,populate:function(e,r){if(e.currentSubject==null){var a=Qe(),n=r,i=Qe();return a.checks.push({type:Se.UNDIRECTED_EDGE,nodes:[n,i]}),Er(e,r,a),e.edgeCount++,i}else{var o=Qe(),s=r,u=Qe();return o.checks.push({type:Se.NODE_NEIGHBOR,node:s,neighbor:u}),Er(e,r,o),u}}},{name:"child",separator:!0,regex:Ye.child,populate:function(e,r){if(e.currentSubject==null){var a=Qe(),n=Qe(),i=e[e.length-1];return a.checks.push({type:Se.CHILD,parent:i,child:n}),Er(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:Se.COMPOUND_SPLIT,left:s,right:u,subject:l}),l.checks=r.checks,r.checks=[{type:Se.TRUE}],h.checks.push({type:Se.TRUE}),u.checks.push({type:Se.PARENT,parent:h,child:f}),Er(e,s,o),e.currentSubject=l,e.compoundCount++,f}else{var v=Qe(),c=Qe(),d=[{type:Se.PARENT,parent:v,child:c}];return v.checks=r.checks,r.checks=d,e.compoundCount++,c}}},{name:"descendant",separator:!0,regex:Ye.descendant,populate:function(e,r){if(e.currentSubject==null){var a=Qe(),n=Qe(),i=e[e.length-1];return a.checks.push({type:Se.DESCENDANT,ancestor:i,descendant:n}),Er(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:Se.COMPOUND_SPLIT,left:s,right:u,subject:l}),l.checks=r.checks,r.checks=[{type:Se.TRUE}],h.checks.push({type:Se.TRUE}),u.checks.push({type:Se.ANCESTOR,ancestor:h,descendant:f}),Er(e,s,o),e.currentSubject=l,e.compoundCount++,f}else{var v=Qe(),c=Qe(),d=[{type:Se.ANCESTOR,ancestor:v,descendant:c}];return v.checks=r.checks,r.checks=d,e.compoundCount++,c}}},{name:"subject",modifier:!0,regex:Ye.subject,populate:function(e,r){if(e.currentSubject!=null&&e.currentSubject!==r)return Ke("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===Se.DIRECTED_EDGE?n.type=Se.NODE_TARGET:i===Se.UNDIRECTED_EDGE&&(n.type=Se.NODE_NEIGHBOR,n.node=n.nodes[1],n.neighbor=n.nodes[0],n.nodes=null)}}];vv.forEach(function(t){return t.regexObj=new RegExp("^"+t.regex)});var qL=function(e){for(var r,a,n,i=0;i<vv.length;i++){var o=vv[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}},GL=function(e){var r=e.match(/^\s+/);if(r){var a=r[0];e=e.substring(a.length)}return e},UL=function(e){var r=this,a=r.inputText=e,n=r[0]=Qe();for(r.length=1,a=GL(a);;){var i=qL(a);if(i.expr==null)return Ke("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 Ke("The selector `"+e+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(f.edgeCount>1)return Ke("The selector `"+e+"` is invalid because it uses multiple edge selectors"),!1;f.edgeCount===1&&Ke("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},zL=function(){if(this.toStringCache!=null)return this.toStringCache;for(var e=function(f){return f??""},r=function(f){return Oe(f)?'"'+f+'"':e(f)},a=function(f){return" "+f+" "},n=function(f,h){var v=f.type,c=f.value;switch(v){case Se.GROUP:{var d=e(c);return d.substring(0,d.length-1)}case Se.DATA_COMPARE:{var g=f.field,p=f.operator;return"["+g+a(e(p))+r(c)+"]"}case Se.DATA_BOOL:{var y=f.operator,b=f.field;return"["+e(y)+b+"]"}case Se.DATA_EXIST:{var m=f.field;return"["+m+"]"}case Se.META_COMPARE:{var E=f.operator,T=f.field;return"[["+T+a(e(E))+r(c)+"]]"}case Se.STATE:return c;case Se.ID:return"#"+c;case Se.CLASS:return"."+c;case Se.PARENT:case Se.CHILD:return i(f.parent,h)+a(">")+i(f.child,h);case Se.ANCESTOR:case Se.DESCENDANT:return i(f.ancestor,h)+" "+i(f.descendant,h);case Se.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 Se.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},VL={parse:UL,toString:zL},rw=function(e,r,a){var n,i=Oe(e),o=we(e),s=Oe(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},YL=function(e,r){switch(r){case"?":return!!e;case"!":return!e;case"^":return e===void 0}},HL=function(e){return e!==void 0},Gv=function(e,r){return e.data(r)},XL=function(e,r){return e[r]()},st=[],rt=function(e,r){return e.checks.every(function(a){return st[a.type](a,r)})};st[Se.GROUP]=function(t,e){var r=t.value;return r==="*"||r===e.group()};st[Se.STATE]=function(t,e){var r=t.value;return BL(r,e)};st[Se.ID]=function(t,e){var r=t.value;return e.id()===r};st[Se.CLASS]=function(t,e){var r=t.value;return e.hasClass(r)};st[Se.META_COMPARE]=function(t,e){var r=t.field,a=t.operator,n=t.value;return rw(XL(e,r),a,n)};st[Se.DATA_COMPARE]=function(t,e){var r=t.field,a=t.operator,n=t.value;return rw(Gv(e,r),a,n)};st[Se.DATA_BOOL]=function(t,e){var r=t.field,a=t.operator;return YL(Gv(e,r),a)};st[Se.DATA_EXIST]=function(t,e){var r=t.field;return t.operator,HL(Gv(e,r))};st[Se.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)};st[Se.NODE_NEIGHBOR]=function(t,e){return rt(t.node,e)&&e.neighborhood().some(function(r){return r.isNode()&&rt(t.neighbor,r)})};st[Se.DIRECTED_EDGE]=function(t,e){return rt(t.source,e.source())&&rt(t.target,e.target())};st[Se.NODE_SOURCE]=function(t,e){return rt(t.source,e)&&e.outgoers().some(function(r){return r.isNode()&&rt(t.target,r)})};st[Se.NODE_TARGET]=function(t,e){return rt(t.target,e)&&e.incomers().some(function(r){return r.isNode()&&rt(t.source,r)})};st[Se.CHILD]=function(t,e){return rt(t.child,e)&&rt(t.parent,e.parent())};st[Se.PARENT]=function(t,e){return rt(t.parent,e)&&e.children().some(function(r){return rt(t.child,r)})};st[Se.DESCENDANT]=function(t,e){return rt(t.descendant,e)&&e.ancestors().some(function(r){return rt(t.ancestor,r)})};st[Se.ANCESTOR]=function(t,e){return rt(t.ancestor,e)&&e.descendants().some(function(r){return rt(t.descendant,r)})};st[Se.COMPOUND_SPLIT]=function(t,e){return rt(t.subject,e)&&rt(t.left,e)&&rt(t.right,e)};st[Se.TRUE]=function(){return!0};st[Se.COLLECTION]=function(t,e){var r=t.value;return r.has(e)};st[Se.FILTER]=function(t,e){var r=t.value;return r(e)};var WL=function(e){var r=this;if(r.length===1&&r[0].checks.length===1&&r[0].checks[0].type===Se.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},KL={matches:$L,filter:WL},Nr=function(e){this.inputText=e,this.currentSubject=null,this.compoundCount=0,this.edgeCount=0,this.length=0,e==null||Oe(e)&&e.match(/^\s*$/)||(qt(e)?this.addQuery({checks:[{type:Se.COLLECTION,value:e.collection()}]}):ot(e)?this.addQuery({checks:[{type:Se.FILTER,value:e}]}):Oe(e)?this.parse(e)||(this.invalid=!0):nt("A selector must be created from a string; found "))},Mr=Nr.prototype;[VL,KL].forEach(function(t){return _e(Mr,t)});Mr.text=function(){return this.inputText};Mr.size=function(){return this.length};Mr.eq=function(t){return this[t]};Mr.sameText=function(t){return!this.invalid&&!t.invalid&&this.text()===t.text()};Mr.addQuery=function(t){this[this.length++]=t};Mr.selector=Mr.toString;var Ar={allAre:function(e){var r=new Nr(e);return this.every(function(a){return r.matches(a)})},is:function(e){var r=new Nr(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())})}};Ar.allAreNeighbours=Ar.allAreNeighbors;Ar.has=Ar.contains;Ar.equal=Ar.equals=Ar.same;var Vt=function(e,r){return function(n,i,o,s){var u=n,l=this,f;if(u==null?f="":qt(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=$r(f),g=c[d];return g||(c[d]=e.call(l,n,i,o,s))}else return e.call(l,n,i,o,s)}},Aa={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:Vt(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 Uv(t,e,r,a){for(var n=[],i=new Da,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)}}Aa.forEachDown=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return Uv(this,t,e,aw)};function nw(t,e,r){if(r.isChild()){var a=r._private.parent;e.has(a.id())||t.push(a)}}Aa.forEachUp=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return Uv(this,t,e,nw)};function ZL(t,e,r){nw(t,e,r),aw(t,e,r)}Aa.forEachUpAndDown=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return Uv(this,t,e,ZL)};Aa.ancestors=Aa.parents;var hn,iw;hn=iw={data:$e.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:$e.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:$e.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:$e.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:$e.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:$e.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}};hn.attr=hn.data;hn.removeAttr=hn.removeData;var QL=iw,Bi={};function Ds(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}}_e(Bi,{degree:Ds(function(t,e){return e.source().same(e.target())?2:1}),indegree:Ds(function(t,e){return e.target().same(t)?1:0}),outdegree:Ds(function(t,e){return e.source().same(t)?1:0})});function ua(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}}_e(Bi,{minDegree:ua("degree",function(t,e){return t<e}),maxDegree:ua("degree",function(t,e){return t>e}),minIndegree:ua("indegree",function(t,e){return t<e}),maxIndegree:ua("indegree",function(t,e){return t>e}),minOutdegree:ua("outdegree",function(t,e){return t<e}),maxOutdegree:ua("outdegree",function(t,e){return t>e})});_e(Bi,{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:$e.data(Qg),silentPosition:$e.data(_e({},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(He(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(He(e)?(n={x:we(e.x)?e.x:0,y:we(e.y)?e.y:0},a=r):Oe(e)&&we(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 He(e)?this.shift(e,!0):Oe(e)&&we(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=He(e)?e:void 0,u=s!==void 0||r!==void 0&&Oe(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=Mi(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=He(e)?e:void 0,o=i!==void 0||r!==void 0&&Oe(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 JL=ow,La=function(e){switch(e){case"left":case"right-inside":return"left";case"right":case"left-inside":return"right";default:return"center"}},Ra=function(e){switch(e){case"top":case"bottom-inside":return"top";case"bottom":case"top-inside":return"bottom";default:return"center"}},jL=function(e){switch(e){case"left":return"right";case"right":return"left";case"left-inside":return"left";case"right-inside":return"right";default:return"center"}},Ta,Fr;Ta=Fr={};Fr.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}};Fr.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)};Fr.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 zt=function(e){return e===1/0||e===-1/0?0:e},$t=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)},wr=function(e,r){return r==null?e:$t(e,r.x1,r.y1,r.x2,r.y2)},Ya=function(e,r,a){return Ot(e,r,a)},zn=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,Zn(h,1),$t(e,h.x1,h.y1,h.x2,h.y2)}}},Ns=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=Ya(o,"labelWidth",a),h=Ya(o,"labelHeight",a),v=Ya(o,"labelX",a),c=Ya(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(La(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(Ra(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 k=a||"main",F=i.labelBounds,_=F[k]=F[k]||{};_.x1=S,_.y1=P,_.x2=D,_.y2=x,_.w=D-S,_.h=x-P,_.leftPad=N,_.rightPad=M,_.topPad=I,_.botPad=O;var z=p&&y.strValue==="autorotate",X=y.pfValue!=null&&y.pfValue!==0;if(z||X){var q=z?Ya(i.rstyle,"labelAngle",a):y.pfValue,G=Math.cos(q),U=Math.sin(q),K=(S+D)/2,J=(P+x)/2;if(!p){switch(La(u.value)){case"left":K=D;break;case"right":K=S;break}switch(Ra(l.value)){case"top":J=x;break;case"bottom":J=P;break}}var Y=function(fe,se){return fe=fe-K,se=se-J,{x:fe*G-se*U+K,y:fe*U+se*G+J}},H=Y(S,P),$=Y(S,x),Q=Y(D,P),ee=Y(D,x);S=Math.min(H.x,$.x,Q.x,ee.x),D=Math.max(H.x,$.x,Q.x,ee.x),P=Math.min(H.y,$.y,Q.y,ee.y),x=Math.max(H.y,$.y,Q.y,ee.y)}var te=k+"Rot",le=F[te]=F[te]||{};le.x1=S,le.y1=P,le.x2=D,le.y2=x,le.w=D-S,le.h=x-P,$t(e,S,P,D,x),$t(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);wr(e,g)}else o!=null&&o>0&&Qn(e,[o,o,o,o])}}},eR=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)}},tR=function(e,r){var a=e._private.cy,n=a.styleEnabled(),i=a.headless(),o=It(),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(Ee){return Ee.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,$t(o,f,v,h,c),n&&Jg(o,e),n&&r.includeOutlines&&!i&&Jg(o,e),n&&eR(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,$t(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 k=v;v=c,c=k}$t(o,f-R,v-R,h+R,c+R)}}else if(M==="bezier"||M==="unbundled-bezier"||Tr(M,"segments")||Tr(M,"taxi")){var F;switch(M){case"bezier":case"unbundled-bezier":F=p.bezierPts;break;case"segments":case"taxi":case"round-segments":case"round-taxi":F=p.linePts;break}if(F!=null)for(var _=0;_<F.length;_++){var z=F[_];f=z.x-R,h=z.x+R,v=z.y-R,c=z.y+R,$t(o,f,v,h,c)}}}else{var X=e.source(),q=X.position(),G=e.target(),U=G.position();if(f=q.x,h=U.x,v=q.y,c=U.y,f>h){var K=f;f=h,h=K}if(v>c){var J=v;v=c,c=J}f-=R,h+=R,v-=R,c+=R,$t(o,f,v,h,c)}if(n&&r.includeEdges&&l&&(zn(o,e,"mid-source"),zn(o,e,"mid-target"),zn(o,e,"source"),zn(o,e,"target")),n){var Y=e.pstyle("ghost").value==="yes";if(Y){var H=e.pstyle("ghost-offset-x").pfValue,$=e.pstyle("ghost-offset-y").pfValue;$t(o,o.x1+H,o.y1+$,o.x2+H,o.y2+$)}}var Q=s.bodyBounds=s.bodyBounds||{};Bd(Q,o),Qn(Q,y),Zn(Q,1),n&&(f=o.x1,h=o.x2,v=o.y1,c=o.y2,$t(o,f-C,v-C,h+C,c+C));var ee=s.overlayBounds=s.overlayBounds||{};Bd(ee,o),Qn(ee,y),Zn(ee,1);var te=s.labelBounds=s.labelBounds||{};te.all!=null?FC(te.all):te.all=It(),n&&r.includeLabels&&(r.includeMainLabels&&Ns(o,e,null),l&&(r.includeSourceLabels&&Ns(o,e,"source"),r.includeTargetLabels&&Ns(o,e,"target")))}return o.x1=zt(o.x1),o.y1=zt(o.y1),o.x2=zt(o.x2),o.y2=zt(o.y2),o.w=zt(o.x2-o.x1),o.h=zt(o.y2-o.y1),o.w>0&&o.h>0&&m&&(Qn(o,y),Zn(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=tR(e,cn),a.bbCache=n,a.bbCachePosKey=fw(e)):n=a.bbCache,!s){var u=e.isNode();n=It(),(r.includeNodes&&u||r.includeEdges&&!u)&&(r.includeOverlays?wr(n,a.overlayBounds):wr(n,a.bodyBounds)),r.includeLabels&&(r.includeMainLabels&&(!i||r.includeSourceLabels&&r.includeTargetLabels)?wr(n,a.labelBounds.all):(r.includeMainLabels&&wr(n,a.labelBounds.mainRot),r.includeSourceLabels&&wr(n,a.labelBounds.sourceRot),r.includeTargetLabels&&wr(n,a.labelBounds.targetRot))),n.w=n.x2-n.x1,n.h=n.y2-n.y1}return n},cn={includeNodes:!0,includeEdges:!0,includeLabels:!0,includeMainLabels:!0,includeSourceLabels:!0,includeTargetLabels:!0,includeOverlays:!0,includeUnderlays:!0,includeOutlines:!0,useCache:!0},ep=lw(cn),tp=At(cn);Fr.boundingBox=function(t){var e,r=t===void 0||t.useCache===void 0||t.useCache===!0,a=xa(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=cn:t=tp(t),e=jg(this[0],t);else{e=It(),t=t||cn;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(),wr(e,jg(l,n))}}return e.x1=zt(e.x1),e.y1=zt(e.y1),e.x2=zt(e.x2),e.y2=zt(e.y2),e.w=zt(e.x2-e.x1),e.h=zt(e.y2-e.y1),e};Fr.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};Fr.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)),He(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=PC(this.boundingBox({useCache:!1}));return e.silentPositions(s),a&&(n.dirtyCompoundBoundsCache(),n.dirtyBoundingBoxCache(),n.updateCompoundBounds(!0)),r.endBatch(),u};Ta.boundingbox=Ta.bb=Ta.boundingBox;Ta.renderedBoundingbox=Ta.renderedBoundingBox;var rR=Fr,Qa,xn;Qa=xn={};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),Qa[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},Qa["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},Qa["rendered"+e.uppercaseName]=function(){var a=this[0];if(a){var n=a[e.name]();return n*this.cy().zoom()}},Qa["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"});xn.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};xn.paddedHeight=function(){var t=this[0];return t.height()+2*t.padding()};xn.paddedWidth=function(){var t=this[0];return t.width()+2*t.padding()};var aR=xn,nR=function(e,r){if(e.isEdge()&&e.takesUpSpace())return r(e)},iR=function(e,r){if(e.isEdge()&&e.takesUpSpace()){var a=e.cy();return Mi(r(e),a.zoom(),a.pan())}},oR=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 Mi(o,i,n)})}},sR=function(e){return e.renderer().getControlPoints(e)},uR=function(e){return e.renderer().getSegmentPoints(e)},lR=function(e){return e.renderer().getSourceEndpoint(e)},fR=function(e){return e.renderer().getTargetEndpoint(e)},hR=function(e){return e.renderer().getEdgeMidpoint(e)},rp={controlPoints:{get:sR,mult:!0},segmentPoints:{get:uR,mult:!0},sourceEndpoint:{get:lR},targetEndpoint:{get:fR},midpoint:{get:hR}},cR=function(e){return"rendered"+e[0].toUpperCase()+e.substr(1)},vR=Object.keys(rp).reduce(function(t,e){var r=rp[e],a=cR(e);return t[e]=function(){return nR(this,r.get)},r.mult?t[a]=function(){return oR(this,r.get)}:t[a]=function(){return iR(this,r.get)},t},{}),dR=_e({},JL,rR,aR,vR);/*!
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 Ha(){return!1}function Vn(){return!0}cw.prototype={instanceString:function(){return"event"},recycle:function(e,r){if(this.isImmediatePropagationStopped=this.isPropagationStopped=this.isDefaultPrevented=Ha,e!=null&&e.preventDefault?(this.type=e.type,this.isDefaultPrevented=e.defaultPrevented?Vn:Ha):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=Vn;var e=this.originalEvent;e&&e.preventDefault&&e.preventDefault()},stopPropagation:function(){this.isPropagationStopped=Vn;var e=this.originalEvent;e&&e.stopPropagation&&e.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=Vn,this.stopPropagation()},isDefaultPrevented:Ha,isPropagationStopped:Ha,isImmediatePropagationStopped:Ha};var vw=/^([^.]+)(\.(?:[^.]+))?$/,gR=".*",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),pR={};function ki(){for(var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:pR,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 Or=ki.prototype,gw=function(e,r,a,n,i,o,s){ot(n)&&(i=n,n=null),s&&(o==null?o=s:o=_e({},o,s));for(var u=Je(a)?a:a.split(/\s+/),l=0;l<u.length;l++){var f=u[l];if(!Rr(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)},yR=function(e,r,a){if(Tx(a)){r(e,a);return}else if(He(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(!Rr(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)}}}};Or.on=Or.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};Or.one=function(t,e,r,a){return this.on(t,e,r,a,{one:!0})};Or.removeListener=Or.off=function(t,e,r,a){var n=this;this.emitting!==0&&(this.listeners=nC(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};Or.removeAllListeners=function(){return this.removeListener("*")};Or.emit=Or.trigger=function(t,e,r){var a=this.listeners,n=a.length;return this.emitting++,Je(e)||(e=[e]),yR(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===gR)&&i.eventMatches(i.context,f,o)){var h=[o];e!=null&&oC(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 mR={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&&yn(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()}},Yn=function(e){return Oe(e)?new Nr(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 ki(mR,r))}return this},emitter:function(){return this._private.emitter},on:function(e,r,a){for(var n=Yn(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=Yn(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=Yn(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=Yn(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}};$e.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(Oe(e)||qt(e))return new Nr(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){Oe(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(Oe(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;Oe(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;Oe(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(Oe(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&&Oe(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&&Oe(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}}},Xe=yw;Xe.u=Xe["|"]=Xe["+"]=Xe.union=Xe.or=Xe.add;Xe["\\"]=Xe["!"]=Xe["-"]=Xe.difference=Xe.relativeComplement=Xe.subtract=Xe.not;Xe.n=Xe["&"]=Xe["."]=Xe.and=Xe.intersection=Xe.intersect;Xe["^"]=Xe["(+)"]=Xe["(-)"]=Xe.symmetricDifference=Xe.symdiff=Xe.xor;Xe.fnFilter=Xe.filterFn=Xe.stdFilter=Xe.filter;Xe.complement=Xe.abscomp=Xe.absoluteComplement;var bR={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"?Nv: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()},Ei={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:Nv-1}else{var i=r.source,o=r.target,s=i.zDepth(),u=o.zDepth();return Math.max(s,u,0)}}}};Ei.each=Ei.forEach;var ER=function(){var e="undefined",r=(typeof Symbol>"u"?"undefined":pt(Symbol))!=e&&pt(Symbol.iterator)!=e;r&&(Ei[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})})};ER();var wR=At({nodeDimensionsIncludeLabels:!1}),jn={layoutDimensions:function(e){e=wR(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=xa(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=It(),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=xa(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}),Na.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(_e({},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 qi(t,e){return t=$r(t),function(a){return bw(t,e,a)}}function Gi(t,e){t=$r(t);var r=function(n){return e.call(n)};return function(){var n=this[0];if(n)return bw(t,r,n)}}var xt={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(He(e)){var o=e;i.applyBypass(this,o,n),this.emitAndNotify("style")}else if(Oe(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 Ms(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 zv(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||Ms(i,a);var u=s.source,l=s.target;return r(u)&&(!o||Ms(u,r))&&(u===l||r(l)&&(!o||Ms(l,r)))}}}var Ma=qi("eleTakesUpSpace",function(t){return t.pstyle("display").value==="element"&&t.width()!==0&&(t.isNode()?t.height()!==0:!0)});xt.takesUpSpace=Gi("takesUpSpace",zv({ok:Ma}));var TR=qi("eleInteractive",function(t){return t.pstyle("events").value==="yes"&&t.pstyle("visibility").value==="visible"&&Ma(t)}),xR=qi("parentInteractive",function(t){return t.pstyle("visibility").value==="visible"&&Ma(t)});xt.interactive=Gi("interactive",zv({ok:TR,parentOk:xR,edgeOkViaNode:Ma}));xt.noninteractive=function(){var t=this[0];if(t)return!t.interactive()};var CR=qi("eleVisible",function(t){return t.pstyle("visibility").value==="visible"&&t.pstyle("opacity").pfValue!==0&&Ma(t)}),AR=Ma;xt.visible=Gi("visible",zv({ok:CR,edgeOkViaNode:AR}));xt.hidden=function(){var t=this[0];if(t)return!t.visible()};xt.isBundledBezier=Gi("isBundledBezier",function(){return this.cy().styleEnabled()?!this.removed()&&this.pstyle("curve-style").value==="bezier"&&this.takesUpSpace():!1});xt.bypass=xt.css=xt.style;xt.renderedCss=xt.renderedStyle;xt.removeBypass=xt.removeCss=xt.removeStyle;xt.pstyle=xt.parsedStyle;var Lr={};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 Oa(t){Lr[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]}},Lr[t.on]=ip({event:t.on,field:t.field,ableField:t.ableField,overrideAble:t.overrideAble,value:!0}),Lr[t.off]=ip({event:t.off,field:t.field,ableField:t.ableField,overrideAble:t.overrideAble,value:!1})}Oa({field:"locked",overrideField:function(e){return e.cy().autolock()?!0:void 0},on:"lock",off:"unlock"});Oa({field:"grabbable",overrideField:function(e){return e.cy().autoungrabify()||e.pannable()?!1:void 0},on:"grabify",off:"ungrabify"});Oa({field:"selected",ableField:"selectable",overrideAble:function(e){return e.cy().autounselectify()?!1:void 0},on:"select",off:"unselect"});Oa({field:"selectable",overrideField:function(e){return e.cy().autounselectify()?!1:void 0},on:"selectify",off:"unselectify"});Lr.deselect=Lr.unselect;Lr.grabbed=function(){var t=this[0];if(t)return t._private.grabbed};Oa({field:"active",on:"activate",off:"unactivate"});Oa({field:"pannable",on:"panify",off:"unpanify"});Lr.inactive=function(){var t=this[0];if(t)return!t._private.active};var Rt={},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)}};Rt.clearTraversalCache=function(){for(var t=0;t<this.length;t++)this[t]._private.traversalCache=null};_e(Rt,{roots:op({noIncomingEdges:!0}),leaves:op({noOutgoingEdges:!0}),outgoers:Vt(sp({outgoing:!0}),"outgoers"),successors:up({outgoing:!0}),incomers:Vt(sp({incoming:!0}),"incomers"),predecessors:up({})});_e(Rt,{neighborhood:Vt(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)}});Rt.neighbourhood=Rt.neighborhood;Rt.closedNeighbourhood=Rt.closedNeighborhood;Rt.openNeighbourhood=Rt.openNeighborhood;_e(Rt,{source:Vt(function(e){var r=this[0],a;return r&&(a=r._private.source||r.cy().collection()),a&&e?a.filter(e):a},"source"),target:Vt(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)}}_e(Rt,{edgesWith:Vt(fp(),"edgesWith"),edgesTo:Vt(fp({thisIsSrc:!0}),"edgesTo")});function fp(t){return function(r){var a=[],n=this._private.cy,i=t||{};Oe(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)}}_e(Rt,{connectedEdges:Vt(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:Vt(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:Vt(hp(),"parallelEdges"),codirectedEdges:Vt(hp({codirected:!0}),"codirectedEdges")});function hp(t){var e={codirected:!1};return t=_e({},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)}}_e(Rt,{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]}});Rt.componentsOf=Rt.components;var Ct=function(e,r){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(e===void 0){nt("A collection must have a reference to the core");return}var i=new fr,o=!1;if(!r)r=[];else if(r.length>0&&He(r[0])&&!yn(r[0])){o=!0;for(var s=[],u=new Da,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 Ni(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 fr,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()},et=Ni.prototype=Ct.prototype=Object.create(Array.prototype);et.instanceString=function(){return"collection"};et.spawn=function(t,e){return new Ct(this.cy(),t,e)};et.spawnSelf=function(){return this.spawn(this)};et.cy=function(){return this._private.cy};et.renderer=function(){return this._private.cy.renderer()};et.element=function(){return this[0]};et.collection=function(){return bE(this)?this:new Ct(this._private.cy,[this])};et.unique=function(){return new Ct(this._private.cy,this,!0)};et.hasElementWithId=function(t){return t=""+t,this._private.map.has(t)};et.getElementById=function(t){t=""+t;var e=this._private.cy,r=this._private.map.get(t);return r?r.ele:new Ct(e)};et.$id=et.getElementById;et.poolIndex=function(){var t=this._private.cy,e=t._private.elements,r=this[0]._private.data.id;return e._private.map.get(r).index};et.indexOf=function(t){var e=t[0]._private.data.id;return this._private.map.get(e).index};et.indexOfId=function(t){return t=""+t,this._private.map.get(t).index};et.json=function(t){var e=this.element(),r=this.cy();if(e==null&&t)return this;if(e!=null){var a=e._private;if(He(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}}};et.jsons=function(){for(var t=[],e=0;e<this.length;e++){var r=this[e],a=r.json();t.push(a)}return t};et.clone=function(){for(var t=this.cy(),e=[],r=0;r<this.length;r++){var a=this[r],n=a.json(),i=new Ni(t,n,!1);e.push(i)}return new Ct(t,e)};et.copy=et.clone;et.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(we(g.id))g.id=""+g.id;else if(Rr(g.id)||!Oe(g.id)){nt("Can not create element with invalid string ID `"+g.id+"`"),v();continue}else if(a.hasElementWithId(g.id)){nt("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];we(C)&&(C=g[w]=""+g[w]),C==null||C===""?(nt("Can not create edge `"+p+"` with unspecified "+w),T=!0):a.hasElementWithId(C)||(nt("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 fr,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;we(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())Ke("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 k=s.length===r.length?r:new Ct(a,s),F=0;F<k.length;F++){var _=k[F];_.isNode()||(_.parallelEdges().clearTraversalCache(),_.source().clearTraversalCache(),_.target().clearTraversalCache())}var z;n.hasCompoundNodes?z=a.collection().merge(k).merge(k.connectedNodes()).merge(k.parent()):z=k,z.dirtyCompoundBoundsCache().dirtyBoundingBoxCache().updateStyle(t),t?k.emitAndNotify("add"):e&&k.emit("add")}return r};et.removed=function(){var t=this[0];return t&&t._private.removed};et.inside=function(){var t=this[0];return t&&!t._private.removed};et.remove=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=this,a=[],n={},i=r._private.cy;function 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;Sr(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();Sr(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 Ct(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};et.move=function(t){var e=this._private.cy,r=this,a=!1,n=!1,i=function(d){return d==null?d:""+d};if(t.source!==void 0||t.target!==void 0){var 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,FL,Jn,Ar,Aa,QL,Bi,dR,pw,yw,bR,Ei,jn,xt,Lr,Rt].forEach(function(t){_e(et,t)});var LR={add:function(e){var r,a=this;if(qt(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 Ct(a,i)}}else if(Je(e)){var u=e;r=new Ct(a,u)}else if(He(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=_e({group:d},g[p]);f.push(b)}}r=new Ct(a,f)}else{var m=e;r=new Ni(a,m).collection()}return r},remove:function(e){if(!qt(e)){if(Oe(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 RR(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 SR=(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}})(),je=function(e,r,a,n){var i=RR(e,r,a,n);return function(o,s,u){return o+(s-o)*i(u)}},ei={linear:function(e,r,a){return e+(r-e)*a},ease:je(.25,.1,.25,1),"ease-in":je(.42,0,1,1),"ease-out":je(0,0,.58,1),"ease-in-out":je(.42,0,.58,1),"ease-in-sine":je(.47,0,.745,.715),"ease-out-sine":je(.39,.575,.565,1),"ease-in-out-sine":je(.445,.05,.55,.95),"ease-in-quad":je(.55,.085,.68,.53),"ease-out-quad":je(.25,.46,.45,.94),"ease-in-out-quad":je(.455,.03,.515,.955),"ease-in-cubic":je(.55,.055,.675,.19),"ease-out-cubic":je(.215,.61,.355,1),"ease-in-out-cubic":je(.645,.045,.355,1),"ease-in-quart":je(.895,.03,.685,.22),"ease-out-quart":je(.165,.84,.44,1),"ease-in-out-quart":je(.77,0,.175,1),"ease-in-quint":je(.755,.05,.855,.06),"ease-out-quint":je(.23,1,.32,1),"ease-in-out-quint":je(.86,0,.07,1),"ease-in-expo":je(.95,.05,.795,.035),"ease-out-expo":je(.19,1,.22,1),"ease-in-out-expo":je(1,0,0,1),"ease-in-circ":je(.6,.04,.98,.335),"ease-out-circ":je(.075,.82,.165,1),"ease-in-out-circ":je(.785,.135,.15,.86),spring:function(e,r,a){if(a===0)return ei.linear;var n=SR(e,r,a);return function(i,o,s){return i+(o-i)*n(s)}},"cubic-bezier":je};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 la(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(we(o)&&we(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 DR(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=ei.linear;else{var h;if(Oe(s)){var v=f.parse("transition-timing-function",s);h=v.value}else h=s;var c,d;Oe(h)?(c=h,d=[]):(c=h[1],d=h.slice(2).map(function(k){return+k})),d.length>0?(c==="spring"&&d.push(o.duration),o.easingImpl=ei[c].apply(null,d)):o.easingImpl=ei[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={};Xa(y.x,b.x)&&(m.x=la(y.x,b.x,p,g)),Xa(y.y,b.y)&&(m.y=la(y.y,b.y,p,g)),t.position(m)}var E=o.startPan,T=o.pan,L=i.pan,w=T!=null&&a;w&&(Xa(E.x,T.x)&&(L.x=la(E.x,T.x,p,g)),Xa(E.y,T.y)&&(L.y=la(E.y,T.y,p,g)),t.emit("pan"));var C=o.startZoom,A=o.zoom,R=A!=null&&a;R&&(Xa(C,A)&&(i.zoom=ln(i.minZoom,la(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=la(M,N,p,g,I);f.overrideBypass(t,x,O)}t.emit("style")}}return o.progress=p,p}function Xa(t,e){return t==null||e==null?!1:we(t)&&we(e)?!0:!!(t&&e)}function NR(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||NR(f,m,t),DR(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 MR={animate:$e.animate(),animation:$e.animation(),animated:$e.animated(),clearQueue:$e.clearQueue(),delay:$e.delay(),delayAnimation:$e.delayAnimation(),stop:$e.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&&gi(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()}},OR={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&&yn(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}},Hn=function(e){return Oe(e)?new Nr(e):e},Ew={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new ki(OR,this)),this},emitter:function(){return this._private.emitter},on:function(e,r,a){return this.emitter().on(e,Hn(r),a),this},removeListener:function(e,r,a){return this.emitter().removeListener(e,Hn(r),a),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,r,a){return this.emitter().one(e,Hn(r),a),this},once:function(e,r,a){return this.emitter().one(e,Hn(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}};$e.eventAliasesOn(Ew);var dv={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)}};dv.jpeg=dv.jpg;var ti={layout:function(e){var r=this;if(e==null){nt("Layout options must be specified to make a layout");return}if(e.name==null){nt("A `name` must be specified to make a layout");return}var a=e.name,n=r.extension("layout",a);if(n==null){nt("No such layout `"+a+"` found. Did you forget to import it and `cytoscape.use()` it?");return}var i;Oe(e.eles)?i=r.$(e.eles):i=e.eles!=null?e.eles:r.$();var o=new n(_e({},e,{cy:r,eles:i}));return o}};ti.createLayout=ti.makeLayout=ti.layout;var IR={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)}})}},PR=At({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]}),gv={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){nt("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&&Ke("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=PR(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)}};gv.invalidateDimensions=gv.resize;var ri={collection:function(e,r){return Oe(e)?this.$(e):qt(e)?e.collection():Je(e)?(r||(r={}),new Ct(this,e,r.unique,r.removed)):new Ct(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}};ri.elements=ri.filter=ri.$;var Tt={},rn="t",FR="f";Tt.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};Tt.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]===rn,h=e[u]===rn,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]===rn;if(T&&(b=E.properties[p.name]!=null,b))break}!s[y]&&!b&&(s[y]=!0,o.push(y))}}}return a[n]=o,o};Tt.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+=rn:r+=FR}return a=e.getPropertiesDiff(n,r),t._private.styleCxtKey=r,{key:r,diffPropNames:a,empty:a.length===0}};Tt.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]===rn;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};Tt.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}};Tt.updateStyleHints=function(t){var e=t._private,r=this,a=r.propertyGroupNames,n=r.propertyGroupKeys,i=function(Q,ee,te){return r.getPropertiesHash(Q,ee,te)},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]=[Hr,ga]}for(var h=function(Q,ee){return e.styleKeys[ee][0]=on(Q,e.styleKeys[ee][0])},v=function(Q,ee){return e.styleKeys[ee][1]=sn(Q,e.styleKeys[ee][1])},c=function(Q,ee){h(Q,ee),v(Q,ee)},d=function(Q,ee){for(var te=0;te<Q.length;te++){var le=Q.charCodeAt(te);h(le,ee),v(le,ee)}},g=2e9,p=function(Q){return-128<Q&&Q<128&&Math.floor(Q)!==Q?g-(Q*1024|0):Q},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=[Hr,ga],N=0;N<n.length;N++){var M=n[N],I=e.styleKeys[M];x[0]=on(I[0],x[0]),x[1]=sn(I[1],x[1])}e.styleKey=Zx(x[0],x[1]);var O=e.styleKeys;e.labelDimsKey=br(O.labelDimensions);var k=i(t,["label"],O.labelDimensions);if(e.labelKey=br(k),e.labelStyleKey=br(Bn(O.commonLabel,k)),!s){var F=i(t,["source-label"],O.labelDimensions);e.sourceLabelKey=br(F),e.sourceLabelStyleKey=br(Bn(O.commonLabel,F));var _=i(t,["target-label"],O.labelDimensions);e.targetLabelKey=br(_),e.targetLabelStyleKey=br(Bn(O.commonLabel,_))}if(s){var z=e.styleKeys,X=z.nodeBody,q=z.nodeBorder,G=z.nodeOutline,U=z.backgroundImage,K=z.compound,J=z.pie,Y=z.stripe,H=[X,q,G,U,K,J,Y].filter(function($){return $!=null}).reduce(Bn,[Hr,ga]);e.nodeKey=br(H),e.hasPie=J!=null&&J[0]!==Hr&&J[1]!==ga,e.hasStripe=Y!=null&&Y[0]!==Hr&&Y[1]!==ga}return o!==e.styleKey};Tt.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};Tt.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(X){return X==null?null:X.pfValue!=null?X.pfValue:X.value},d=function(){var X=c(l),q=c(a);r.checkTriggers(t,a.name,X,q)};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(){Ke("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(we(y)){var T=a.fieldMax-a.fieldMin;T===0?E=0:E=(y-a.fieldMin)/T}else return Ke("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 k=M[O];I=I[k]}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 F=a.value,_=a.fnValue!=null?a.fnValue:F(t);if(a.prevFnValue=_,_==null)return Ke("Custom function mappers may not return null (i.e. `"+a.name+"` for ele `"+t.id()+"` is null)"),!1;if(i=this.parse(a.name,_,a.bypass,v),!i)return Ke("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};Tt.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)}}};Tt.update=function(){var t=this._private.cy,e=t.mutableElements();e.updateStyle()};Tt.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&&(we(d.pfValue)&&we(g.pfValue)?(p=g.pfValue-d.pfValue,y=d.pfValue+b*p):we(d.value)&&we(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 Na(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)};Tt.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)};Tt.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)})};Tt.checkBoundsTrigger=function(t,e,r,a){this.checkTrigger(t,e,r,a,function(n){return n.triggersBounds},function(n){t.dirtyCompoundBoundsCache(),t.dirtyBoundingBoxCache()})};Tt.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()})})};Tt.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()})})};Tt.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 Cn={};Cn.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(Oe(e)){var h=this.parse(e,r,!0);h&&i.push(h)}else if(He(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[Si(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};Cn.overrideBypass=function(t,e,r){e=Sv(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)}};Cn.removeAllBypasses=function(t,e){return this.removeBypasses(t,this.propertyNames,e)};Cn.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 Vv={};Vv.getEmSizeInPixels=function(){var t=this.containerCss("font-size");return t!=null?parseFloat(t):1};Vv.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[Si(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&&we(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 Oe(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&&(He(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[Sv(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]=on(s,a[0]),a[1]=sn(s,a[1]);else for(o=i.strValue,l=0;l<o.length;l++)s=o.charCodeAt(l),a[0]=on(s,a[0]),a[1]=sn(s,a[1]);return a};nr.getPropertiesHash=nr.getNonDefaultPropertiesHash;var Ui={};Ui.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};Ui.fromJson=function(t){var e=this;return e.resetToDefault(),e.appendFromJson(t),e};Ui.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 Yv={};Yv.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){Ke("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 Nr(h);if(v.invalid){Ke("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){Ke("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){Ke("Skipping property: Invalid property name in: "+o),u();continue}var T=r.parse(b,m);if(!T){Ke("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};Yv.fromString=function(t){var e=this;return e.resetToDefault(),e.appendFromString(t),e};var ft={};(function(){var t=gt,e=Sx,r=Nx,a=Mx,n=Ox,i=function($){return"^"+$+"\\s*\\(\\s*([\\w\\.]+)\\s*\\)$"},o=function($){var Q=t+"|\\w+|"+e+"|"+r+"|"+a+"|"+n;return"^"+$+"\\s*\\(([\\w\\.]+)\\s*\\,\\s*("+t+")\\s*\\,\\s*("+t+")\\s*,\\s*("+Q+")\\s*\\,\\s*("+Q+")\\)$"},s=[`^url\\s*\\(\\s*['"]?(.+?)['"]?\\s*\\)$`,"^(none)$","^(.+)$"];ft.types={time:{number:!0,min:0,units:"s|ms",implicitUnits:"ms"},percent:{number:!0,min:0,max:100,units:"%",implicitUnits:"%"},percentages:{number:!0,min:0,max:100,units:"%",implicitUnits:"%",multiple:!0},zeroOneNumber:{number:!0,min:0,max:1,unitless:!0},zeroOneNumbers:{number:!0,min:0,max:1,unitless:!0,multiple:!0},nOneOneNumber:{number:!0,min:-1,max:1,unitless:!0},nonNegativeInt:{number:!0,min:0,integer:!0,unitless:!0},nonNegativeNumber:{number:!0,min:0,unitless:!0},position:{enums:["parent","origin"]},nodeSize:{number:!0,min:0,enums:["label"]},number:{number:!0,unitless:!0},numbers:{number:!0,unitless:!0,multiple:!0},positiveNumber:{number:!0,unitless:!0,min:0,strictMin:!0},size:{number:!0,min:0},bidirectionalSize:{number:!0},bidirectionalSizeMaybePercent:{number:!0,allowPercent:!0},bidirectionalSizes:{number:!0,multiple:!0},sizeMaybePercent:{number:!0,min:0,allowPercent:!0},axisDirection:{enums:["horizontal","leftward","rightward","vertical","upward","downward","auto"]},axisDirectionExplicit:{enums:["leftward","rightward","upward","downward"]},axisDirectionPrimary:{enums:["horizontal","vertical"]},paddingRelativeTo:{enums:["width","height","average","min","max"]},bgWH:{number:!0,min:0,allowPercent:!0,enums:["auto"],multiple:!0},bgPos:{number:!0,allowPercent:!0,multiple:!0},bgRelativeTo:{enums:["inner","include-padding"],multiple:!0},bgRepeat:{enums:["repeat","repeat-x","repeat-y","no-repeat"],multiple:!0},bgFit:{enums:["none","contain","cover"],multiple:!0},bgCrossOrigin:{enums:["anonymous","use-credentials","null"],multiple:!0},bgClip:{enums:["none","node"],multiple:!0},bgContainment:{enums:["inside","over"],multiple:!0},boxSelection:{enums:["contain","overlap","none"]},color:{color:!0},colors:{color:!0,multiple:!0},fill:{enums:["solid","linear-gradient","radial-gradient"]},bool:{enums:["yes","no"]},bools:{enums:["yes","no"],multiple:!0},lineStyle:{enums:["solid","dotted","dashed"]},lineCap:{enums:["butt","round","square"]},linePosition:{enums:["center","inside","outside"]},lineJoin:{enums:["round","bevel","miter"]},borderStyle:{enums:["solid","dotted","dashed","double"]},curveStyle:{enums:["bezier","unbundled-bezier","haystack","segments","straight","straight-triangle","taxi","round-segments","round-taxi"]},radiusType:{enums:["arc-radius","influence-radius"],multiple:!0},fontFamily:{regex:'^([\\w- \\"]+(?:\\s*,\\s*[\\w- \\"]+)*)$'},fontStyle:{enums:["italic","normal","oblique"]},fontWeight:{enums:["normal","bold","bolder","lighter","100","200","300","400","500","600","800","900",100,200,300,400,500,600,700,800,900]},textDecoration:{enums:["none","underline","overline","line-through"]},textTransform:{enums:["none","uppercase","lowercase"]},textWrap:{enums:["none","wrap","ellipsis"]},textOverflowWrap:{enums:["whitespace","anywhere"]},textBackgroundShape:{enums:["rectangle","roundrectangle","round-rectangle","circle"]},nodeShape:{enums:["rectangle","roundrectangle","round-rectangle","cutrectangle","cut-rectangle","bottomroundrectangle","bottom-round-rectangle","barrel","ellipse","triangle","round-triangle","square","pentagon","round-pentagon","hexagon","round-hexagon","concavehexagon","concave-hexagon","heptagon","round-heptagon","octagon","round-octagon","tag","round-tag","star","diamond","round-diamond","vee","rhomboid","right-rhomboid","polygon"]},overlayShape:{enums:["roundrectangle","round-rectangle","ellipse"]},cornerRadius:{number:!0,min:0,units:"px|em",implicitUnits:"px",enums:["auto"]},compoundIncludeLabels:{enums:["include","exclude"]},arrowShape:{enums:["tee","triangle","triangle-tee","circle-triangle","triangle-cross","triangle-backcurve","vee","square","circle","diamond","chevron","none"]},arrowFill:{enums:["filled","hollow"]},arrowWidth:{number:!0,units:"%|px|em",implicitUnits:"px",enums:["match-line"]},display:{enums:["element","none"]},visibility:{enums:["hidden","visible"]},zCompoundDepth:{enums:["bottom","orphan","auto","top"]},zIndexCompare:{enums:["auto","manual"]},valign:{enums:["top","top-inside","center","bottom","bottom-inside"]},halign:{enums:["left","left-inside","center","right","right-inside"]},justification:{enums:["left","center","right","auto"]},textMetrics:{enums:["font","glyph"]},text:{string:!0},data:{mapping:!0,regex:i("data")},layoutData:{mapping:!0,regex:i("layoutData")},scratch:{mapping:!0,regex:i("scratch")},mapData:{mapping:!0,regex: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($,Q){switch($.length){case 2:return Q[0]!=="deg"&&Q[0]!=="rad"&&Q[1]!=="deg"&&Q[1]!=="rad";case 1:return Oe($[0])||Q[0]==="deg"||Q[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($){var Q=$.length;return Q===1||Q===2||Q===4}}};var u={zeroNonZero:function($,Q){return($==null||Q==null)&&$!==Q||$==0&&Q!=0?!0:$!=0&&Q==0},any:function($,Q){return $!=Q},emptyNonEmpty:function($,Q){var ee=Rr($),te=Rr(Q);return ee&&!te||!ee&&te}},l=ft.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:"text-metrics",type:l.textMetrics},{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($,Q,ee){return $===Q?!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($,Q){return Q.value==="label"?-$.poolIndex():Q.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($,Q){return $===Q?!1:$==="bezier"||Q==="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=[];ft.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<=ft.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=[];ft.stripeBackgroundN=16,N.push({name:"stripe-size",type:l.sizeMaybePercent}),N.push({name:"stripe-direction",type:l.axisDirectionPrimary});for(var M=1;M<=ft.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=ft.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(H){O.forEach(function($){var Q=$+"-"+H.name,ee=H.type,te=H.triggersBounds;I.push({name:Q,type:ee,triggersBounds:te})})},{});var k=ft.properties=[].concat(g,m,p,y,b,S,d,c,f,h,v,T,L,w,C,P,N,A,R,I,D),F=ft.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},_=ft.propertyGroupNames={},z=ft.propertyGroupKeys=Object.keys(F);z.forEach(function(H){_[H]=F[H].map(function($){return $.name}),F[H].forEach(function($){return $.groupKey=H})});var X=ft.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"}];ft.propertyNames=k.map(function(H){return H.name});for(var q=0;q<k.length;q++){var G=k[q];k[G.name]=G}for(var U=0;U<X.length;U++){var K=X[U],J=k[K.pointsTo],Y={name:K.name,alias:!0,pointsTo:J};k.push(Y),k[K.name]=Y}})();ft.getDefaultProperty=function(t){return this.getDefaultProperties()[t]};ft.getDefaultProperties=function(){var t=this._private;if(t.defaultProperties!=null)return t.defaultProperties;for(var e=_e({"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","text-metrics":"font","transition-property":"none","transition-duration":0,"transition-delay":0,"transition-timing-function":"linear","box-select-labels":"no","background-blacken":0,"background-color":"#999","background-fill":"solid","background-opacity":1,"background-image":"none","background-image-crossorigin":"anonymous","background-image-opacity":1,"background-image-containment":"inside","background-image-smoothing":"yes","background-position-x":"50%","background-position-y":"50%","background-offset-x":0,"background-offset-y":0,"background-width-relative-to":"include-padding","background-height-relative-to":"include-padding","background-repeat":"no-repeat","background-fit":"none","background-clip":"node","background-width":"auto","background-height":"auto","border-color":"#000","border-opacity":1,"border-width":0,"border-style":"solid","border-dash-pattern":[4,2],"border-dash-offset":0,"border-cap":"butt","border-join":"miter","border-position":"center","outline-color":"#999","outline-opacity":1,"outline-width":0,"outline-offset":0,"outline-style":"solid",height:30,width:30,shape:"ellipse","shape-polygon-points":"-1, -1, 1, -1, 1, 1, -1, 1","corner-radius":"auto","bounds-expansion":0,"background-gradient-direction":"to-bottom","background-gradient-stop-colors":"#999","background-gradient-stop-positions":"0%",ghost:"no","ghost-offset-y":0,"ghost-offset-x":0,"ghost-opacity":0,padding:0,"padding-relative-to":"width",position:"origin","compound-sizing-wrt-labels":"include","min-width":0,"min-width-bias-left":0,"min-width-bias-right":0,"min-height":0,"min-height-bias-top":0,"min-height-bias-bottom":0},{"pie-size":"100%","pie-hole":0,"pie-start-angle":"0deg"},[{name:"pie-{{i}}-background-color",value:"black"},{name:"pie-{{i}}-background-size",value:"0%"},{name:"pie-{{i}}-background-opacity",value:1}].reduce(function(u,l){for(var f=1;f<=ft.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<=ft.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 ft.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};ft.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 zi={};zi.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};zi.parseImplWarn=function(t,e,r,a){var n=this.parseImpl(t,e,r,a);return!n&&e!=null&&Ke("The style property `".concat(t,": ").concat(e,"` is invalid")),n&&(n.name==="width"||n.name==="height")&&e==="label"&&Ke("The style value of `label` is deprecated for `"+n.name+"`"),n};zi.parseImpl=function(t,e,r,a){var n=this;t=Sv(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=Oe(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 Ke("`"+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||Oe(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&&Oe(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 Y=0;Y<l.enums.length;Y++){var H=l.enums[Y];if(H===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("^("+gt+")("+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&&!wx(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:MC(e)),D==="%"&&(M.pfValue=e/100),M}else if(l.propList){var I=[],O=""+e;if(O!=="none"){for(var k=O.split(/\s*,\s*|\s+/),F=0;F<k.length;F++){var _=k[F].trim();n.properties[_]?I.push(_):Ke("`"+_+"` 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 X=S();if(X)return X}for(var q=l.regexes?l.regexes:[l.regex],G=0;G<q.length;G++){var U=new RegExp(q[G]),K=U.exec(e);if(K)return{name:t,value:l.singleRegexMatchValue?K[1]:K,strValue:""+e,bypass:r}}return null}else return l.string?{name:t,value:""+e,strValue:""+e,bypass:r}:l.enums?S():null};var wt=function(e){if(!(this instanceof wt))return new wt(e);if(!Rv(e)){nt("A style must have a core reference");return}this._private={cy:e,coreStyle:{}},this.length=0,this.resetToDefault()},St=wt.prototype;St.instanceString=function(){return"style"};St.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};St.resetToDefault=function(){return this.clear(),this.addDefaultStylesheet(),this};St.core=function(t){return this._private.coreStyle[t]||this.getDefaultProperty(t)};St.selector=function(t){var e=t==="core"?null:new Nr(t),r=this.length++;return this[r]={selector:e,properties:[],mappedProperties:[],index:r},this};St.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[Si(n.name)]),i!==void 0&&this.cssRule(n.name,i)}else e.length===2&&this.cssRule(e[0],e[1]);return this};St.style=St.css;St.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};St.append=function(t){return EE(t)?t.appendToStyle(this):Je(t)?this.appendFromJson(t):Oe(t)&&this.appendFromString(t),this};wt.fromJson=function(t,e){var r=new wt(t);return r.fromJson(e),r};wt.fromString=function(t,e){return new wt(t).fromString(e)};[Tt,Cn,Vv,nr,Ui,Yv,ft,zi].forEach(function(t){_e(St,t)});wt.types=St.types;wt.properties=St.properties;wt.propertyGroups=St.propertyGroups;wt.propertyGroupNames=St.propertyGroupNames;wt.propertyGroupKeys=St.propertyGroupKeys;var _R={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=wt.fromJson(this,e):Oe(e)?r.style=wt.fromString(this,e):r.style=wt(this),r.style},updateStyle:function(){this.mutableElements().updateStyle()}},BR="single",Qr={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=BR),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(Oe(e[0]))return a=e[0],r[a];if(He(e[0])){if(!this._private.panningEnabled)return this;i=e[0],o=i.x,s=i.y,we(o)&&(r.x=o),we(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")&&we(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:He(e)&&(s=a[0],u=s.x,l=s.y,we(u)&&(n.x+=u),we(l)&&(n.y+=l),this.emit("pan viewport"));break;case 2:i=e,o=r,(i==="x"||i==="y")&&we(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(we(e)&&r===void 0&&(r=e,e=void 0),!(!this._private.panningEnabled||!this._private.zoomingEnabled)){var a;if(Oe(e)){var n=e;e=this.$(n)}else if(Cx(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 qt(e)||(e=this.mutableElements());if(!(qt(e)&&e.empty())){a=a||e.boundingBox();var o=this.width(),s=this.height(),u;if(r=we(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 we(e)&&we(r)&&e<=r?(a.minZoom=e,a.maxZoom=r):we(e)&&r===void 0&&e<=a.maxZoom?a.minZoom=e:we(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),we(e)?o=e:He(e)&&(o=e.level,e.position!=null?i=Mi(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||!we(o)||o===n||i!=null&&(!we(i.x)||!we(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(we(e.zoom)||(a=!1),He(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;we(l.x)&&(r.pan.x=l.x,s=!1),we(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(Oe(e)){var a=e;e=this.mutableElements().filter(a)}else qt(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}};Qr.centre=Qr.center;Qr.autolockNodes=Qr.autolock;Qr.autoungrabifyNodes=Qr.autoungrabify;var vn={data:$e.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:$e.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:$e.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:$e.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};vn.attr=vn.data;vn.removeAttr=vn.removeData;var dn=function(e){var r=this;e=_e({},e);var a=e.container;a&&!di(a)&&di(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=dt!==void 0&&a!==void 0&&!e.headless,s=e;s.layout=_e({name:o?"grid":"null"},s.layout),s.renderer=_e({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 Ct(this),listeners:[],aniEles:new Ct(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:we(s.zoom)?s.zoom:1,pan:{x:He(s.pan)&&we(s.pan.x)?s.pan.x:0,y:He(s.pan)&&we(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(Ax);if(p)return Na.all(d).then(g);g(d)};l.styleEnabled&&r.setStyle([]);var h=_e({},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&&(He(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=_e({},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)})},wi=dn.prototype;_e(wi,{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 dt;var r=this._private.container.ownerDocument;return r===void 0||r==null?dt:r.defaultView||dt},mount:function(e){if(e!=null){var r=this,a=r._private,n=a.options;return!di(e)&&di(e[0])&&(e=e[0]),r.stopAnimationLoop(),r.destroyRenderer(),a.container=e,a.styleEnabled=!0,r.invalidateSize(),r.initRenderer(_e({},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(He(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){Ke("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}}});wi.$id=wi.getElementById;[LR,MR,Ew,dv,ti,IR,gv,ri,_R,Qr,vn].forEach(function(t){_e(wi,t)});var kR={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}},qR={maximal:!1,acyclic:!1},fa=function(e){return e.scratch("breadthfirst")},gp=function(e,r){return e.scratch("breadthfirst",r)};function ww(t){this.options=_e({},kR,qR,t)}ww.prototype.run=function(){var t=this.options,e=t.cy,r=t.eles,a=r.nodes().filter(function(ve){return ve.isChildless()}),n=r,i=t.directed,o=t.acyclic||t.maximal||t.maximalAdjustments>0,s=!!t.boundingBox,u=It(s?t.boundingBox:structuredClone(e.extent())),l;if(qt(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(Oe(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 ce=d[p],ye=ce.maxDegree(!1),ge=ce.filter(function(de){return de.degree(!1)===ye});l=l.add(ge)},p=0;p<d.length;p++)g()}var y=[],b={},m=function(ce,ye){y[ye]==null&&(y[ye]=[]);var ge=y[ye].length;y[ye].push(ce),gp(ce,{index:ge,depth:ye})},E=function(ce,ye){var ge=fa(ce),de=ge.depth,be=ge.index;y[de][be]=null,ce.isChildless()&&m(ce,ye)};n.bfs({roots:l,directed:t.directed,visit:function(ce,ye,ge,de,be){var Re=ce[0],Pe=Re.id();Re.isChildless()&&m(Re,be),b[Pe]=!0}});for(var T=[],L=0;L<a.length;L++){var w=a[L];b[w.id()]||T.push(w)}var C=function(ce){for(var ye=y[ce],ge=0;ge<ye.length;ge++){var de=ye[ge];if(de==null){ye.splice(ge,1),ge--;continue}gp(de,{depth:ce,index:ge})}},A=function(ce,ye){for(var ge=fa(ce),de=ce.incomers().filter(function(ne){return ne.isNode()&&r.has(ne)}),be=-1,Re=ce.id(),Pe=0;Pe<de.length;Pe++){var Be=de[Pe],Ne=fa(Be);be=Math.max(be,Ne.depth)}if(ge.depth<=be){if(!t.acyclic&&ye[Re])return null;var Me=be+1;return E(ce,Me),ye[Re]=Me,!0}return!1};if(i&&o){var R=[],S={},D=function(ce){return R.push(ce)},P=function(){return R.shift()};for(a.forEach(function(ve){return R.push(ve)});R.length>0;){var x=P(),N=A(x,S);if(N)x.outgoers().filter(function(ve){return ve.isNode()&&r.has(ve)}).forEach(D);else if(N===null){Ke("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],k=O.layoutDimensions(t),F=k.w,_=k.h;M=Math.max(M,F,_)}var z={},X=function(ce){if(z[ce.id()])return z[ce.id()];for(var ye=fa(ce).depth,ge=ce.neighborhood(),de=0,be=0,Re=0;Re<ge.length;Re++){var Pe=ge[Re];if(!(Pe.isEdge()||Pe.isParent()||!a.has(Pe))){var Be=fa(Pe);if(Be!=null){var Ne=Be.index,Me=Be.depth;if(!(Ne==null||Me==null)){var ne=y[Me].length;Me<ye&&(de+=Ne/ne,be++)}}}}return be=Math.max(1,be),de=de/be,be===0&&(de=0),z[ce.id()]=de,de},q=function(ce,ye){var ge=X(ce),de=X(ye),be=ge-de;return be===0?TE(ce.id(),ye.id()):be};t.depthSort!==void 0&&(q=t.depthSort);for(var G=y.length,U=0;U<G;U++)y[U].sort(q),C(U);for(var K=[],J=0;J<T.length;J++)K.push(T[J]);var Y=function(){for(var ce=0;ce<G;ce++)C(ce)};K.length&&(y.unshift(K),G=y.length,Y());for(var H=0,$=0;$<G;$++)H=Math.max(y[$].length,H);var Q={x:u.x1+u.w/2,y:u.y1+u.h/2},ee=a.reduce(function(ve,ce){return(function(ye){return{w:ve.w===-1?ye.w:(ve.w+ye.w)/2,h:ve.h===-1?ye.h:(ve.h+ye.h)/2}})(ce.boundingBox({includeLabels:t.nodeDimensionsIncludeLabels}))},{w:-1,h:-1}),te=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),le=y.reduce(function(ve,ce){return Math.max(ve,ce.length)},0),Ee=function(ce){var ye=fa(ce),ge=ye.depth,de=ye.index;if(t.circle){var be=Math.min(u.w/2/G,u.h/2/G);be=Math.max(be,M);var Re=be*ge+be-(G>0&&y[0].length<=3?be/2:0),Pe=2*Math.PI/y[ge].length*de;return ge===0&&y[0].length===1&&(Re=1),{x:Q.x+Re*Math.cos(Pe),y:Q.y+Re*Math.sin(Pe)}}else{var Be=y[ge].length,Ne=Math.max(Be===1?0:s?(u.w-t.padding*2-ee.w)/((t.grid?le:Be)-1):(u.w-t.padding*2-ee.w)/((t.grid?le:Be)+1),M),Me={x:Q.x+(de+1-(Be+1)/2)*Ne,y:Q.y+(ge+1-(G+1)/2)*te};return Me}},fe={downward:0,leftward:90,upward:180,rightward:-90};Object.keys(fe).indexOf(t.direction)===-1&&nt("Invalid direction '".concat(t.direction,"' specified for breadthfirst layout. Valid values are: ").concat(Object.keys(fe).join(", ")));var se=function(ce){return eC(Ee(ce),u,fe[t.direction])};return r.nodes().layoutPositions(this,t,se),this};var GR={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=_e({},GR,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=It(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(we(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 UR={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=_e({},UR,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=It(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(te,le){return le.value-te.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,k=0,F=0;F<y.length;F++){var _=y[F],z=_.r-k;O=Math.max(O,z)}k=0;for(var X=0;X<y.length;X++){var q=y[X];X===0&&(k=q.r),q.r=k,k+=O}}for(var G={},U=0;U<y.length;U++)for(var K=y[U],J=K.dTheta,Y=K.r,H=0;H<K.length;H++){var $=K[H],Q=e.startAngle+(r?1:-1)*J*H,ee={x:s.x+Y*Math.cos(Q),y:s.y+Y*Math.sin(Q)};G[$.node.id()]=ee}return n.nodes().layoutPositions(this,e,function(te){var le=te.id();return G[le]}),this};var Os,zR={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 Vi(t){this.options=_e({},zR,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)}Vi.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?Os=!0:Os=!1;var a=VR(e,r,t);Os&&HR(a),t.randomize&&XR(a);var n=hr(),i=function(){WR(a,e,t),t.fit===!0&&e.fit(t.padding)},o=function(v){return!(r.stopped||v>=t.numIter||($R(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=hr();c-n>=t.animationThreshold&&i(),gi(f)}};f()}else{for(;l;)l=o(u),u++;yp(a,t),s()}return this};Vi.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this};Vi.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var VR=function(e,r,a){for(var n=a.eles.edges(),i=a.eles.nodes(),o=It(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 k=YR(D.sourceId,D.targetId,s),F=s.graphSet[k],_=0,p=s.layoutNodes[N];F.indexOf(p.id)===-1;)p=s.layoutNodes[s.idToIndex[p.parentId]],_++;for(p=s.layoutNodes[M];F.indexOf(p.id)===-1;)p=s.layoutNodes[s.idToIndex[p.parentId]],_++;P*=_*a.nestingFactor}D.idealLength=P,D.elasticity=x,s.layoutEdges.push(D)}return s},YR=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}},HR,XR=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}}},WR=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}))},$R=function(e,r,a){KR(e,r),JR(e),jR(e,r),eS(e),tS(e)},KR=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]]];ZR(s,l,e,r)}},pp=function(e){return-e+2*e*Math.random()},ZR=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=QR(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=Ti(e,s,u),p=Ti(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)}},QR=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},Ti=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)},JR=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=Ti(o,l,f),v=Ti(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)}}},jR=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}}}}},eS=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}}},tS=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=rS(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)}},rS=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)}}},aS={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=_e({},aS,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=It(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(X){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(q){if(q==null)return Math.min(u,l);var G=Math.min(u,l);G==u?u=q:l=q},h=function(q){if(q==null)return Math.max(u,l);var G=Math.max(u,l);G==u?u=q:l=q},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(q,G){return!!S["c-"+q+"-"+G]},P=function(q,G){S["c-"+q+"-"+G]=!0},x=0,N=0,M=function(){N++,N>=l&&(N=0,x++)},I={},O=0;O<n.length;O++){var k=n[O],F=e.position(k);if(F&&(F.row!==void 0||F.col!==void 0)){var _={row:F.row,col:F.col};if(_.col===void 0)for(_.col=0;D(_.row,_.col);)_.col++;else if(_.row===void 0)for(_.row=0;D(_.row,_.col);)_.row++;I[k.id()]=_,P(_.row,_.col)}}var z=function(q,G){var U,K;if(q.locked()||q.isParent())return!1;var J=I[q.id()];if(J)U=J.col*b+b/2+i.x1,K=J.row*m+m/2+i.y1;else{for(;D(x,N);)M();U=N*b+b/2+i.x1,K=x*m+m/2+i.y1,P(x,N),M()}return{x:U,y:K}};n.layoutPositions(this,e,z)}return this};var nS={ready:function(){},stop:function(){}};function Hv(t){this.options=_e({},nS,t)}Hv.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};Hv.prototype.stop=function(){return this};var iS={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=_e({},iS,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 LC(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 oS={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=_e({},oS,t)}Dw.prototype.run=function(){var t=this.options,e=t.cy,r=t.eles,a=It(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 sS=[{name:"breadthfirst",impl:ww},{name:"circle",impl:Tw},{name:"concentric",impl:xw},{name:"cose",impl:Vi},{name:"grid",impl:Rw},{name:"null",impl:Hv},{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 Xv={};Xv.arrowShapeWidth=.3;Xv.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){Oe(f)&&(f=t[f]),t[l]=_e({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=_t(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:pi,roughCollide:pi,draw:Mv,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=_t(l,f,p)||_t(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 _t(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=_t(l,f,p)||_t(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 jr={};jr.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]};jr.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]};jr.invalidateContainerClientCoordsCache=function(){this.containerBB=null};jr.findNearestElement=function(t,e,r,a){return this.findNearestElements(t,e,r,a)[0]};jr.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,k=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(GC(t,e,M[I],M[I+1],M[I+2],M[I+3],x)&&P>(N=HC(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(UC(t,e,M[I],M[I+1],M[I+2],M[I+3],M[I+4],M[I+5],x)&&P>(N=YC(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,k=k||C.target,F=n.getArrowWidth(R,S),_=[{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<_.length;I++){var z=_[I],X=i.arrowShapes[w.pstyle(z.name+"-arrow-shape").value],q=w.pstyle("width").pfValue;if(X.roughCollide(t,e,F,z.angle,{x:z.x,y:z.y},q,f)&&X.collide(t,e,F,z.angle,{x:z.x,y:z.y},q,f))return p(w),!0}l&&s.length>0&&(y(O),y(k))}function m(w,C,A){return Ot(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,k=w.pstyle(S+"text-margin-y").pfValue,F=D.x1-R-O,_=D.x2+R-O,z=D.y1-R-k,X=D.y2+R-k;if(I){var q=Math.cos(I),G=Math.sin(I),U=function(ee,te){return ee=ee-N,te=te-M,{x:ee*q-te*G+N,y:ee*G+te*q+M}},K=U(F,z),J=U(F,X),Y=U(_,z),H=U(_,X),$=[K.x+O,K.y+k,Y.x+O,Y.y+k,H.x+O,H.y+k,J.x+O,J.y+k];if(_t(t,e,$))return p(w),!0}else if(xr(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};jr.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=It({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,te,le){return Ot(ee,te,le)}function p(ee,te){var le=ee._private,Ee=o,fe="";ee.boundingBox();var se=le.labelBounds.main;if(!se)return null;var ve=g(le.rscratch,"labelX",te),ce=g(le.rscratch,"labelY",te),ye=g(le.rscratch,"labelAngle",te),ge=ee.pstyle(fe+"text-margin-x").pfValue,de=ee.pstyle(fe+"text-margin-y").pfValue,be=se.x1-Ee-ge,Re=se.x2+Ee-ge,Pe=se.y1-Ee-de,Be=se.y2+Ee-de;if(ye){var Ne=Math.cos(ye),Me=Math.sin(ye),ne=function(V,W){return V=V-ve,W=W-ce,{x:V*Ne-W*Me+ve,y:V*Me+W*Ne+ce}};return[ne(be,Pe),ne(Re,Pe),ne(Re,Be),ne(be,Be)]}else return[{x:be,y:Pe},{x:Re,y:Pe},{x:Re,y:Be},{x:be,y:Be}]}function y(ee,te,le,Ee){function fe(se,ve,ce){return(ce.y-se.y)*(ve.x-se.x)>(ve.y-se.y)*(ce.x-se.x)}return fe(ee,le,Ee)!==fe(te,le,Ee)&&fe(ee,te,le)!==fe(ee,te,Ee)}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&&No(S,c)&&(s.push(E),R=!0)}!R&&BE(v,A)&&s.push(E)}else if(L==="overlap"&&Fv(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(No(P,c))s.push(E);else{var x=p(E);x&&No(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&&!xr(v,I.startX,I.startY)||I.endX!=null&&I.endY!=null&&!xr(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 k=M.rstyle.bezierPts||M.rstyle.linePts||M.rstyle.haystackPts,F=!0,_=0;_<k.length;_++)if(!kd(v,k[_])){F=!1;break}F&&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&&(xr(v,I.startX,I.startY)||xr(v,I.endX,I.endY)))s.push(N),z=!0;else if(!z&&I.edgeType==="haystack"){for(var X=M.rstyle.haystackPts,q=0;q<X.length;q++)if(kd(v,X[q])){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 K=G[U],J=G[U+1],Y=0;Y<d.length;Y++){var H=ht(d[Y],2),$=H[0],Q=H[1];if(y(K,J,$,Q)){s.push(N),z=!0;break}}if(z)break}}}}}return s};var xi={};xi.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=Et(d[0],d[2],d[4],.1),p=Et(d[1],d[3],d[5],.1);u=f-g,l=h-p}else u=f-y,l=h-b;e.srcArrowAngle=kn(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=Et(d[R],d[S],d[D],0),w=Et(d[R+1],d[S+1],d[D+1],0),C=Et(d[R],d[S],d[D],1e-4),A=Et(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=Et(d[R],d[S],d[D],.4999),w=Et(d[R+1],d[S+1],d[D+1],.4999),C=Et(d[R],d[S],d[D],.5),A=Et(d[R+1],d[S+1],d[D+1],.5)}u=C-L,l=A-w}if(e.midtgtArrowAngle=kn(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=kn(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=Et(d[x-6],d[x-4],d[x-2],.9),p=Et(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=kn(u,l)};xi.getArrowWidth=xi.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 pv,yv,tr={},Ut={},Ep,wp,Xr,ai,lr,Ur,Yr,jt,ha,Xn,Mw,Ow,mv,bv,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)},uS=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},lS=function(e,r,a,n,i){if(e!==Tp?xp(r,e,tr):uS(Ut,tr),xp(r,a,Ut),Ep=tr.nx*Ut.ny-tr.ny*Ut.nx,wp=tr.nx*Ut.nx-tr.ny*-Ut.ny,lr=Math.asin(Math.max(-1,Math.min(1,Ep))),Math.abs(lr)<1e-6){pv=r.x,yv=r.y,Yr=ha=0;return}Xr=1,ai=!1,wp<0?lr<0?lr=Math.PI+lr:(lr=Math.PI-lr,Xr=-1,ai=!0):lr>0&&(Xr=-1,ai=!0),r.radius!==void 0?ha=r.radius:ha=n,Ur=lr/2,Xn=Math.min(tr.len/2,Ut.len/2),i?(jt=Math.abs(Math.cos(Ur)*ha/Math.sin(Ur)),jt>Xn?(jt=Xn,Yr=Math.abs(jt*Math.sin(Ur)/Math.cos(Ur))):Yr=ha):(jt=Math.min(Xn,ha),Yr=Math.abs(jt*Math.sin(Ur)/Math.cos(Ur))),mv=r.x+Ut.nx*jt,bv=r.y+Ut.ny*jt,pv=mv-Ut.ny*Yr*Xr,yv=bv+Ut.nx*Yr*Xr,Mw=r.x+tr.nx*jt,Ow=r.y+tr.ny*jt,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 Wv(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}:(lS(t,e,r,a,n),{cx:pv,cy:yv,radius:Yr,startX:Mw,startY:Ow,stopX:mv,stopY:bv,startAngle:tr.ang+Math.PI/2*Xr,endAngle:Ut.ang-Math.PI/2*Xr,counterClockwise:ai})}var gn=.01,fS=Math.sqrt(2*gn),Dt={};Dt.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=ht(h,2),c=v[0],d=v[1],g=this.manualEndptToPx(t.target()[0],s),p=ht(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 Ke("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}};Dt.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)}};Dt.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")}};Dt.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)]};Dt.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*gn)),L=Math.max(E,Math.log(l*gn));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]};Dt.findStraightEdgePoints=function(t){t._private.rscratch.edgeType="straight"};Dt.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=Pv(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)}};Dt.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(W,Z){return W>0?Math.max(W-Z,0):Math.min(W+Z,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,k=Pv(O),F=!1;!(N&&(E||L))&&(b===s&&O<0||b===u&&O>0||b===i&&O>0||b===o&&O<0)&&(k*=-1,I=k*Math.abs(I),F=!0);var _;if(E){var z=T<0?1+T:T;_=z*I}else{var X=T<0?I:0;_=X+T*k}var q=function(W){return Math.abs(W)<w||Math.abs(W)>=Math.abs(I)},G=q(_),U=q(Math.abs(I)-Math.abs(_)),K=G||U;if(K&&!F)if(M){var J=Math.abs(O)<=v/2,Y=Math.abs(R)<=c/2;if(J){var H=(f.x1+f.x2)/2,$=f.y1,Q=f.y2;r.segpts=[H,$,H,Q]}else if(Y){var ee=(f.y1+f.y2)/2,te=f.x1,le=f.x2;r.segpts=[te,ee,le,ee]}else r.segpts=[f.x1,f.y2]}else{var Ee=Math.abs(O)<=h/2,fe=Math.abs(S)<=d/2;if(Ee){var se=(f.y1+f.y2)/2,ve=f.x1,ce=f.x2;r.segpts=[ve,se,ce,se]}else if(fe){var ye=(f.x1+f.x2)/2,ge=f.y1,de=f.y2;r.segpts=[ye,ge,ye,de]}else r.segpts=[f.x2,f.y1]}else if(M){var be=f.y1+_+(p?v/2*k:0),Re=f.x1,Pe=f.x2;r.segpts=[Re,be,Pe,be]}else{var Be=f.x1+_+(p?h/2*k:0),Ne=f.y1,Me=f.y2;r.segpts=[Be,Ne,Be,Me]}if(r.isRound){var ne=t.pstyle("taxi-radius").value,B=t.pstyle("radius-type").value[0]==="arc-radius";r.radii=new Array(r.segpts.length/2).fill(ne),r.isArcRadius=new Array(r.segpts.length/2).fill(B)}};Dt.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=!we(r.startX)||!we(r.startY),p=!we(r.arrowStartX)||!we(r.arrowStartY),y=!we(r.endX)||!we(r.endY),b=!we(r.arrowEndX)||!we(r.arrowEndY),m=3,E=this.getArrowWidth(t.pstyle("width").pfValue,t.pstyle("arrow-scale").value)*this.arrowShapeWidth,T=m*E,L=Kr({x:r.ctrlpts[0],y:r.ctrlpts[1]},{x:r.startX,y:r.startY}),w=L<T,C=Kr({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),k={x:I.x/O,y:I.y/O},F=Math.max(i,o),_={x:r.ctrlpts[0]+k.x*2*F,y:r.ctrlpts[1]+k.y*2*F},z=f.intersectLine(n.x,n.y,s,u,_.x,_.y,0,v,d);A?(r.ctrlpts[0]=r.ctrlpts[0]+k.x*(T-C),r.ctrlpts[1]=r.ctrlpts[1]+k.y*(T-C)):(r.ctrlpts[0]=z[0]+k.x*T,r.ctrlpts[1]=z[1]+k.y*T)}R&&this.findEndpoints(t)}};Dt.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=Et(e.allpts[a],e.allpts[a+2],e.allpts[a+4],n),e.midY=Et(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(Wv({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}}}}};Dt.checkForInvalidEdgeWarning=function(t){var e=t[0]._private.rscratch;e.nodesOverlap||we(e.startX)&&we(e.startY)&&we(e.endX)&&we(e.endY)?e.loggedErr=!1:e.loggedErr||(e.loggedErr=!0,Ke("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."))};Dt.findEdgeControlPoints=function(t){var e=this;if(!(!t||t.length===0)){for(var r=this,a=r.cy,n=a.hasCompoundNodes(),i=new fr,o=function(A,R){return[].concat(vi(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"||Tr(v,"segments")||v==="straight"||v==="straight-triangle"||Tr(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(B){return B.isBundledBezier()});Ov(P.eles),N.forEach(function(B){return P.eles.push(B)}),P.eles.sort(function(B,V){return B.poolIndex()-V.poolIndex()})}var M=P.eles[0],I=M.source(),O=M.target();if(I.poolIndex()>O.poolIndex()){var k=I;I=O,O=k}var F=P.srcPos=I.position(),_=P.tgtPos=O.position(),z=P.srcW=I.outerWidth(),X=P.srcH=I.outerHeight(),q=P.tgtW=O.outerWidth(),G=P.tgtH=O.outerHeight(),U=P.srcShape=r.nodeShapes[e.getNodeShape(I)],K=P.tgtShape=r.nodeShapes[e.getNodeShape(O)],J=P.srcCornerRadius=I.pstyle("corner-radius").value==="auto"?"auto":I.pstyle("corner-radius").pfValue,Y=P.tgtCornerRadius=O.pstyle("corner-radius").value==="auto"?"auto":O.pstyle("corner-radius").pfValue,H=P.tgtRs=O._private.rscratch,$=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 Q=0;Q<P.eles.length;Q++){var ee=P.eles[Q],te=ee[0]._private.rscratch,le=ee.pstyle("curve-style").value,Ee=le==="unbundled-bezier"||Tr(le,"segments")||Tr(le,"taxi"),fe=!I.same(ee.source());if(!P.calculatedIntersection&&I!==O&&(P.hasBezier||P.hasUnbundled)){P.calculatedIntersection=!0;var se=U.intersectLine(F.x,F.y,z,X,_.x,_.y,0,J,$),ve=P.srcIntn=se,ce=K.intersectLine(_.x,_.y,q,G,F.x,F.y,0,Y,H),ye=P.tgtIntn=ce,ge=P.intersectionPts={x1:se[0],x2:ce[0],y1:se[1],y2:ce[1]},de=P.posPts={x1:F.x,x2:_.x,y1:F.y,y2:_.y},be=ce[1]-se[1],Re=ce[0]-se[0],Pe=Math.sqrt(Re*Re+be*be);we(Pe)&&Pe>=fS||(Pe=Math.sqrt(Math.max(Re*Re,gn)+Math.max(be*be,gn)));var Be=P.vector={x:Re,y:be},Ne=P.vectorNorm={x:Be.x/Pe,y:Be.y/Pe},Me={x:-Ne.y,y:Ne.x};P.nodesOverlap=!we(Pe)||K.checkPoint(se[0],se[1],0,q,G,_.x,_.y,Y,H)||U.checkPoint(ce[0],ce[1],0,z,X,F.x,F.y,J,$),P.vectorNormInverse=Me,x={nodesOverlap:P.nodesOverlap,dirCounts:P.dirCounts,calculatedIntersection:!0,hasBezier:P.hasBezier,hasUnbundled:P.hasUnbundled,eles:P.eles,srcPos:_,srcRs:H,tgtPos:F,tgtRs:$,srcW:q,srcH:G,tgtW:z,tgtH:X,srcIntn:ye,tgtIntn:ve,srcShape:K,tgtShape:U,posPts:{x1:de.x2,y1:de.y2,x2:de.x1,y2:de.y1},intersectionPts:{x1:ge.x2,y1:ge.y2,x2:ge.x1,y2:ge.y1},vector:{x:-Be.x,y:-Be.y},vectorNorm:{x:-Ne.x,y:-Ne.y},vectorNormInverse:{x:-Me.x,y:-Me.y}}}var ne=fe?x:P;te.nodesOverlap=ne.nodesOverlap,te.srcIntn=ne.srcIntn,te.tgtIntn=ne.tgtIntn,te.isRound=le.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,ne,Q,Ee):I===O?e.findLoopPoints(ee,ne,Q,Ee):le.endsWith("segments")?e.findSegmentsPoints(ee,ne):le.endsWith("taxi")?e.findTaxiPoints(ee,ne):le==="straight"||!Ee&&P.eles.length%2===1&&Q===Math.floor(P.eles.length/2)?e.findStraightEdgePoints(ee):e.findBezierPoints(ee,ne,Q,Ee,fe),e.findEndpoints(ee),e.tryToCorrectInvalidPoints(ee,ne),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}}Dt.getSegmentPoints=function(t){var e=t[0]._private.rscratch;this.recalculateRenderedStyle(t);var r=e.edgeType;if(r==="segments")return Pw(e.segpts)};Dt.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)};Dt.getEdgeMidpoint=function(t){var e=t[0]._private.rscratch;return this.recalculateRenderedStyle(t),{x:e.midX,y:e.midY}};var An={};An.manualEndptToPx=function(t,e){var r=this,a=t.position(),n=t.outerWidth(),i=t.outerHeight(),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)}};An.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=Tr(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,k,F,_,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],X=(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 q=[b.ctrlpts[0],b.ctrlpts[1]],G=w?[b.ctrlpts[b.ctrlpts.length-2],b.ctrlpts[b.ctrlpts.length-1]]:q;O=G,k=q}else if(C){var U=A?b.segpts.slice(0,2):[f.x+z[0],f.y+z[1]],K=A?b.segpts.slice(b.segpts.length-2):[l.x+X[0],l.y+X[1]];O=K,k=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"?F=O:(M==="outside-to-line"||M==="outside-to-line-or-label")&&(F=[l.x,l.y]),o=i.nodeShapes[this.getNodeShape(u)].intersectLine(f.x,f.y,u.outerWidth(),u.outerHeight(),F[0],F[1],0,I,p),M==="outside-to-node-or-label"||M==="outside-to-line-or-label"){var J=u._private.rscratch,Y=J.labelWidth,H=J.labelHeight,$=J.labelX,Q=J.labelY,ee=Y/2,te=H/2,le=u.pstyle("text-valign").value;le=Ra(le),le==="top"?Q-=te:le==="bottom"&&(Q+=te);var Ee=u.pstyle("text-halign").value;Ee=La(Ee),Ee==="left"?$-=ee:Ee==="right"&&($+=ee);var fe=fn(F[0],F[1],[$-ee,Q-te,$+ee,Q-te,$+ee,Q+te,$-ee,Q+te],f.x,f.y);if(fe.length>0){var se=l,ve=Vr(se,pa(o)),ce=Vr(se,pa(fe)),ye=ve;if(ce<ve&&(o=fe,ye=ce),fe.length>2){var ge=Vr(se,{x:fe[2],y:fe[3]});ge<ye&&(o=[fe[2],fe[3]])}}}var de=qn(o,O,i.arrowShapes[h].spacing(t)+c),be=qn(o,O,i.arrowShapes[h].gap(t)+c);if(b.endX=be[0],b.endY=be[1],b.arrowEndX=de[0],b.arrowEndY=de[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"?_=k:(P==="outside-to-line"||P==="outside-to-line-or-label")&&(_=[f.x,f.y]),o=i.nodeShapes[this.getNodeShape(s)].intersectLine(l.x,l.y,s.outerWidth(),s.outerHeight(),_[0],_[1],0,x,g),P==="outside-to-node-or-label"||P==="outside-to-line-or-label"){var Re=s._private.rscratch,Pe=Re.labelWidth,Be=Re.labelHeight,Ne=Re.labelX,Me=Re.labelY,ne=Pe/2,B=Be/2,V=s.pstyle("text-valign").value;V=Ra(V),V==="top"?Me-=B:V==="bottom"&&(Me+=B);var W=s.pstyle("text-halign").value;W=La(W),W==="left"?Ne-=ne:W==="right"&&(Ne+=ne);var Z=fn(_[0],_[1],[Ne-ne,Me-B,Ne+ne,Me-B,Ne+ne,Me+B,Ne-ne,Me+B],l.x,l.y);if(Z.length>0){var j=f,ae=Vr(j,pa(o)),re=Vr(j,pa(Z)),ie=ae;if(re<ae&&(o=[Z[0],Z[1]],ie=re),Z.length>2){var ue=Vr(j,{x:Z[2],y:Z[3]});ue<ie&&(o=[Z[2],Z[3]])}}}var oe=qn(o,k,i.arrowShapes[v].spacing(t)+d),he=qn(o,k,i.arrowShapes[v].gap(t)+d);b.startX=he[0],b.startY=he[1],b.arrowStartX=oe[0],b.arrowStartY=oe[1],R&&(!we(b.startX)||!we(b.startY)||!we(b.endX)||!we(b.endY)?b.badLine=!0:b.badLine=!1)};An.getSourceEndpoint=function(t){var e=t[0]._private.rscratch;switch(this.recalculateRenderedStyle(t),e.edgeType){case"haystack":return{x:e.haystackPts[0],y:e.haystackPts[1]};default:return{x:e.arrowStartX,y:e.arrowStartY}}};An.getTargetEndpoint=function(t){var e=t[0]._private.rscratch;switch(this.recalculateRenderedStyle(t),e.edgeType){case"haystack":return{x:e.haystackPts[2],y:e.haystackPts[3]};default:return{x:e.arrowEndX,y:e.arrowEndY}}};var $v={};function hS(t,e,r){for(var a=function(l,f,h,v){return Et(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)hS(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(!Rr(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"left-inside":r=u.x-i/2+s;break;case"right":r=u.x+i/2+s;break;case"right-inside":r=u.x+i/2-s;break;default:r=u.x}switch(f){case"top":a=u.y-o/2-s;break;case"top-inside":a=u.y-o/2+s;break;case"bottom":a=u.y+o/2+s;break;case"bottom-inside":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)},cS=function(e,r,a,n){var i=ln(0,n-.001,1),o=ln(0,n+.001,1),s=ba(e,r,a,i),u=ba(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){rr(r.rscratch,h,v,c),rr(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=Kr(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=ln(0,D,1),e=ba(C.p0,C.p1,C.p2,D),v=cS(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,k=0;k+3<O&&(c?(M={x:a.allpts[k],y:a.allpts[k+1]},I={x:a.allpts[k+2],y:a.allpts[k+3]}):(M={x:a.allpts[O-2-k],y:a.allpts[O-1-k]},I={x:a.allpts[O-4-k],y:a.allpts[O-3-k]}),x=Kr(M,I),N=P,P+=x,!(P>=d));k+=2);var F=d-N,_=F/x;_=ln(0,_,1),e=IC(M,I,_),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=$r(a,t._private.labelDimsKey);if(Ot(r.rscratch,"prefixedLabelDimsKey",e)!==n){rr(r.rscratch,"prefixedLabelDimsKey",e,n);var i=this.calculateLabelDimensions(t,a),o=t.pstyle("line-height").pfValue,s=t.pstyle("font-size").pfValue,u=t.pstyle("text-wrap").strValue,l=Ot(r.rscratch,"labelWrapCachedLines",e)||[],f=u!=="wrap"?1:Math.max(l.length,1),h=s*o,v=i.width,c=i.height+(f-1)*(o-1)*s;rr(r.rstyle,"labelWidth",e,v),rr(r.rscratch,"labelWidth",e,v),rr(r.rstyle,"labelHeight",e,c),rr(r.rscratch,"labelHeight",e,c),rr(r.rscratch,"labelLineHeight",e,h),rr(r.rscratch,"labelActualDescent",e,i.labelActualDescent)}};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(X,q){return q?(rr(r.rscratch,X,e,q),q):Ot(r.rscratch,X,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=Bt(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="…",k=!1;if(this.calculateLabelDimensions(t,n).width<M)return n;for(var F=0;F<n.length;F++){var _=this.calculateLabelDimensions(t,I+n[F]+O).width;if(_>M)break;I+=n[F],F===n.length-1&&(k=!0)}return k||(I+=O),I}return n};ir.getLabelJustification=function(t){var e=t.pstyle("text-justification").strValue,r=t.pstyle("text-halign").strValue;return e==="auto"?t.isNode()?jL(r):"center":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=t.pstyle("text-metrics").strValue||"font",h=this.labelCalcCanvas,v=this.labelCalcCanvasContext;if(!h){h=this.labelCalcCanvas=n.createElement("canvas"),v=this.labelCalcCanvasContext=h.getContext("2d");var c=h.style;c.position="absolute",c.left="-9999px",c.top="-9999px",c.zIndex="-1",c.visibility="hidden",c.pointerEvents="none"}v.font="".concat(o," ").concat(l," ").concat(s,"px ").concat(u);for(var d=0,g=0,p=e.split(`
17
+ `),y=p.length,b=0,m=0,E=0;E<y;E++){var T=p[E],L=v.measureText(T),w=Math.ceil(L.width),C=s;f==="glyph"&&(E===0&&(m=L.actualBoundingBoxAscent),E===y-1&&(b=L.actualBoundingBoxDescent)),d=Math.max(w,d),g+=C}return f==="glyph"&&(g-=s-m-b),d+=i,g+=i,{width:d,height:g,labelActualAscent:m,labelActualDescent:b}};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||(Ke("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 Yi={};Yi.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)};Yi.onUpdateEleCalcs=function(t){var e=this.onUpdateEleCalcsFns=this.onUpdateEleCalcsFns||[];e.push(t)};Yi.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 Hi={};Hi.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)}}};Hi.invalidateCachedZSortedEles=function(){this.cachedZSortedEles=null};Hi.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={};[jr,xi,Dt,An,$v,ir,Bw,Yi,Hi].forEach(function(t){_e(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 Gw=function(e,r){var a=e[0];!a||a._private.grabbed===r||(a._private.grabbed=r,e.updateStyle(!1))},vS=function(e){Gw(e,!0)},dS=function(e){Gw(e,!1)},Ia={};Ia.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)};Ia.binder=function(t){var e=this,r=e.cy.window(),a=t===r||t===r.document||t===r.document.body||xx(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}};Ia.nodeIsDraggable=function(t){return t&&t.isNode()&&!t.locked()&&t.grabbable()};Ia.nodeIsGrabbable=function(t){return this.nodeIsDraggable(t)&&t.interactive()};Ia.load=function(){var t=this,e=t.cy.window(),r=function(B){return B.selected()},a=function(B){var V=B.getRootNode();if(V&&V.nodeType===11&&V.host!==void 0)return V},n=function(B,V,W,Z){B==null&&(B=t.cy);for(var j=0;j<V.length;j++){var ae=V[j];B.emit({originalEvent:W,type:ae,position:Z})}},i=function(B){return B.shiftKey||B.metaKey||B.ctrlKey},o=function(B,V){var W=!0;if(t.cy.hasCompoundNodes()&&B&&B.pannable())for(var Z=0;V&&Z<V.length;Z++){var B=V[Z];if(B.isNode()&&B.isParent()&&!B.pannable()){W=!1;break}}else W=!0;return W},s=function(B){B[0]._private.rscratch.inDragLayer=!0},u=function(B){B[0]._private.rscratch.inDragLayer=!1},l=function(B){B[0]._private.rscratch.isGrabTarget=!0},f=function(B){B[0]._private.rscratch.isGrabTarget=!1},h=function(B,V){var W=V.addToList,Z=W.has(B);!Z&&B.grabbable()&&!B.locked()&&(W.merge(B),vS(B))},v=function(B,V){if(B.cy().hasCompoundNodes()&&!(V.inDragLayer==null&&V.addToList==null)){var W=B.descendants();V.inDragLayer&&(W.forEach(s),W.connectedEdges().forEach(s)),V.addToList&&h(W,V)}},c=function(B,V){V=V||{};var W=B.cy().hasCompoundNodes();V.inDragLayer&&(B.forEach(s),B.neighborhood().stdFilter(function(Z){return!W||Z.isEdge()}).forEach(s)),V.addToList&&B.forEach(function(Z){h(Z,V)}),v(B,V),p(B,{inDragLayer:V.inDragLayer}),t.updateCachedGrabbedEles()},d=c,g=function(B){B&&(t.getCachedZSortedEles().forEach(function(V){dS(V),u(V),f(V)}),t.updateCachedGrabbedEles())},p=function(B,V){if(!(V.inDragLayer==null&&V.addToList==null)&&B.cy().hasCompoundNodes()){var W=B.ancestors().orphans();if(!W.same(B)){var Z=W.descendants().spawnSelf().merge(W).unmerge(B).unmerge(B.descendants()),j=Z.connectedEdges();V.inDragLayer&&(j.forEach(s),Z.forEach(s)),V.addToList&&Z.forEach(function(ae){h(ae,V)})}}},y=function(){document.activeElement!=null&&document.activeElement.blur!=null&&document.activeElement.blur()},b=typeof MutationObserver<"u",m=typeof ResizeObserver<"u";b?(t.removeObserver=new MutationObserver(function(ne){for(var B=0;B<ne.length;B++){var V=ne[B],W=V.removedNodes;if(W)for(var Z=0;Z<W.length;Z++){var j=W[Z];if(j===t.container){t.destroy();break}}}}),t.container.parentNode&&t.removeObserver.observe(t.container.parentNode,{childList:!0})):t.registerBinding(t.container,"DOMNodeRemoved",function(ne){t.destroy()});var E=wn(function(){t.cy.resize()},100);b&&(t.styleObserver=new MutationObserver(E),t.styleObserver.observe(t.container,{attributes:!0})),t.registerBinding(e,"resize",E),m&&(t.resizeObserver=new ResizeObserver(E),t.resizeObserver.observe(t.container));var T=function(B,V){for(;B!=null;)V(B),B=B.parentNode},L=function(){t.invalidateContainerClientCoordsCache()};T(t.container,function(ne){t.registerBinding(ne,"transitionend",L),t.registerBinding(ne,"animationend",L),t.registerBinding(ne,"scroll",L)}),t.registerBinding(t.container,"contextmenu",function(ne){ne.preventDefault()});var w=function(){return t.selection[4]!==0},C=function(B){for(var V=t.findContainerClientCoords(),W=V[0],Z=V[1],j=V[2],ae=V[3],re=B.touches?B.touches:[B],ie=!1,ue=0;ue<re.length;ue++){var oe=re[ue];if(W<=oe.clientX&&oe.clientX<=W+j&&Z<=oe.clientY&&oe.clientY<=Z+ae){ie=!0;break}}if(!ie)return!1;for(var he=t.container,me=B.target,pe=me.parentNode,Te=!1;pe;){if(pe===he){Te=!0;break}pe=pe.parentNode}return!!Te};t.registerBinding(t.container,"mousedown",function(B){if(C(B)&&!(t.hoverData.which===1&&B.which!==1)){B.preventDefault(),y(),t.hoverData.capture=!0,t.hoverData.which=B.which;var V=t.cy,W=[B.clientX,B.clientY],Z=t.projectIntoViewport(W[0],W[1]),j=t.selection,ae=t.findNearestElements(Z[0],Z[1],!0,!1),re=ae[0],ie=t.dragData.possibleDragElements;t.hoverData.mdownPos=Z,t.hoverData.mdownGPos=W;var ue=function(De){return{originalEvent:B,type:De,position:{x:Z[0],y:Z[1]}}},oe=function(){t.hoverData.tapholdCancelled=!1,clearTimeout(t.hoverData.tapholdTimeout),t.hoverData.tapholdTimeout=setTimeout(function(){if(!t.hoverData.tapholdCancelled){var De=t.hoverData.down;De?De.emit(ue("taphold")):V.emit(ue("taphold"))}},t.tapholdDuration)};if(B.which==3){t.hoverData.cxtStarted=!0;var he={originalEvent:B,type:"cxttapstart",position:{x:Z[0],y:Z[1]}};re?(re.activate(),re.emit(he),t.hoverData.down=re):V.emit(he),t.hoverData.downTime=new Date().getTime(),t.hoverData.cxtDragged=!1}else if(B.which==1){re&&re.activate();{if(re!=null&&t.nodeIsGrabbable(re)){var me=function(De){De.emit(ue("grab"))};if(l(re),!re.selected())ie=t.dragData.possibleDragElements=V.collection(),d(re,{addToList:ie}),re.emit(ue("grabon")).emit(ue("grab"));else{ie=t.dragData.possibleDragElements=V.collection();var pe=V.$(function(Te){return Te.isNode()&&Te.selected()&&t.nodeIsGrabbable(Te)});c(pe,{addToList:ie}),re.emit(ue("grabon")),pe.forEach(me)}t.redrawHint("eles",!0),t.redrawHint("drag",!0)}t.hoverData.down=re,t.hoverData.downs=ae,t.hoverData.downTime=new Date().getTime()}n(re,["mousedown","tapstart","vmousedown"],B,{x:Z[0],y:Z[1]}),re==null?(j[4]=1,t.data.bgActivePosistion={x:Z[0],y:Z[1]},t.redrawHint("select",!0),t.redraw()):re.pannable()&&(j[4]=1),oe()}j[0]=j[2]=Z[0],j[1]=j[3]=Z[1]}},!1);var A=a(t.container);t.registerBinding([e,A],"mousemove",function(B){var V=t.hoverData.capture;if(!(!V&&!C(B))){var W=!1,Z=t.cy,j=Z.zoom(),ae=[B.clientX,B.clientY],re=t.projectIntoViewport(ae[0],ae[1]),ie=t.hoverData.mdownPos,ue=t.hoverData.mdownGPos,oe=t.selection,he=null;!t.hoverData.draggingEles&&!t.hoverData.dragging&&!t.hoverData.selecting&&(he=t.findNearestElement(re[0],re[1],!0,!1));var me=t.hoverData.last,pe=t.hoverData.down,Te=[re[0]-oe[2],re[1]-oe[3]],De=t.dragData.possibleDragElements,Le;if(ue){var xe=ae[0]-ue[0],ke=xe*xe,Ce=ae[1]-ue[1],Ae=Ce*Ce,Ue=ke+Ae;t.hoverData.isOverThresholdDrag=Le=Ue>=t.desktopTapThreshold2}var Ie=i(B);Le&&(t.hoverData.tapholdCancelled=!0);var qe=function(){var lt=t.hoverData.dragDelta=t.hoverData.dragDelta||[];lt.length===0?(lt.push(Te[0]),lt.push(Te[1])):(lt[0]+=Te[0],lt[1]+=Te[1])};W=!0,n(he,["mousemove","vmousemove","tapdrag"],B,{x:re[0],y:re[1]});var ze=function(lt){return{originalEvent:B,type:lt,position:{x:re[0],y:re[1]}}},Ze=function(){t.data.bgActivePosistion=void 0,t.hoverData.selecting||Z.emit(ze("boxstart")),oe[4]=1,t.hoverData.selecting=!0,t.redrawHint("select",!0),t.redraw()};if(t.hoverData.which===3){if(Le){var tt=ze("cxtdrag");pe?pe.emit(tt):Z.emit(tt),t.hoverData.cxtDragged=!0,(!t.hoverData.cxtOver||he!==t.hoverData.cxtOver)&&(t.hoverData.cxtOver&&t.hoverData.cxtOver.emit(ze("cxtdragout")),t.hoverData.cxtOver=he,he&&he.emit(ze("cxtdragover")))}}else if(t.hoverData.dragging){if(W=!0,Z.panningEnabled()&&Z.userPanningEnabled()){var We;if(t.hoverData.justStartedPan){var Nt=t.hoverData.mdownPos;We={x:(re[0]-Nt[0])*j,y:(re[1]-Nt[1])*j},t.hoverData.justStartedPan=!1}else We={x:Te[0]*j,y:Te[1]*j};Z.panBy(We),Z.emit(ze("dragpan")),t.hoverData.dragged=!0}re=t.projectIntoViewport(B.clientX,B.clientY)}else if(oe[4]==1&&(pe==null||pe.pannable())){if(Le){if(!t.hoverData.dragging&&Z.boxSelectionEnabled()&&(Ie||!Z.panningEnabled()||!Z.userPanningEnabled()))Ze();else if(!t.hoverData.selecting&&Z.panningEnabled()&&Z.userPanningEnabled()){var Ft=o(pe,t.hoverData.downs);Ft&&(t.hoverData.dragging=!0,t.hoverData.justStartedPan=!0,oe[4]=0,t.data.bgActivePosistion=pa(ie),t.redrawHint("select",!0),t.redraw())}pe&&pe.pannable()&&pe.active()&&pe.unactivate()}}else{if(pe&&pe.pannable()&&pe.active()&&pe.unactivate(),(!pe||!pe.grabbed())&&he!=me&&(me&&n(me,["mouseout","tapdragout"],B,{x:re[0],y:re[1]}),he&&n(he,["mouseover","tapdragover"],B,{x:re[0],y:re[1]}),t.hoverData.last=he),pe)if(Le){if(Z.boxSelectionEnabled()&&Ie)pe&&pe.grabbed()&&(g(De),pe.emit(ze("freeon")),De.emit(ze("free")),t.dragData.didDrag&&(pe.emit(ze("dragfreeon")),De.emit(ze("dragfree")))),Ze();else if(pe&&pe.grabbed()&&t.nodeIsDraggable(pe)){var mt=!t.dragData.didDrag;mt&&t.redrawHint("eles",!0),t.dragData.didDrag=!0,t.hoverData.draggingEles||c(De,{inDragLayer:!0});var at={x:0,y:0};if(we(Te[0])&&we(Te[1])&&(at.x+=Te[0],at.y+=Te[1],mt)){var ut=t.hoverData.dragDelta;ut&&we(ut[0])&&we(ut[1])&&(at.x+=ut[0],at.y+=ut[1])}t.hoverData.draggingEles=!0,De.silentShift(at).emit(ze("position")).emit(ze("drag")),t.redrawHint("drag",!0),t.redraw()}}else qe();W=!0}if(oe[2]=re[0],oe[3]=re[1],W)return B.stopPropagation&&B.stopPropagation(),B.preventDefault&&B.preventDefault(),!1}},!1);var R,S,D;t.registerBinding(e,"mouseup",function(B){if(!(t.hoverData.which===1&&B.which!==1&&t.hoverData.capture)){var V=t.hoverData.capture;if(V){t.hoverData.capture=!1;var W=t.cy,Z=t.projectIntoViewport(B.clientX,B.clientY),j=t.selection,ae=t.findNearestElement(Z[0],Z[1],!0,!1),re=t.dragData.possibleDragElements,ie=t.hoverData.down,ue=i(B);t.data.bgActivePosistion&&(t.redrawHint("select",!0),t.redraw()),t.hoverData.tapholdCancelled=!0,t.data.bgActivePosistion=void 0,ie&&ie.unactivate();var oe=function(xe){return{originalEvent:B,type:xe,position:{x:Z[0],y:Z[1]}}};if(t.hoverData.which===3){var he=oe("cxttapend");if(ie?ie.emit(he):W.emit(he),!t.hoverData.cxtDragged){var me=oe("cxttap");ie?ie.emit(me):W.emit(me)}t.hoverData.cxtDragged=!1,t.hoverData.which=null}else if(t.hoverData.which===1){if(n(ae,["mouseup","tapend","vmouseup"],B,{x:Z[0],y:Z[1]}),!t.dragData.didDrag&&!t.hoverData.dragged&&!t.hoverData.selecting&&!t.hoverData.isOverThresholdDrag&&(n(ie,["click","tap","vclick"],B,{x:Z[0],y:Z[1]}),S=!1,B.timeStamp-D<=W.multiClickDebounceTime()?(R&&clearTimeout(R),S=!0,D=null,n(ie,["dblclick","dbltap","vdblclick"],B,{x:Z[0],y:Z[1]})):(R=setTimeout(function(){S||n(ie,["oneclick","onetap","voneclick"],B,{x:Z[0],y:Z[1]})},W.multiClickDebounceTime()),D=B.timeStamp)),ie==null&&!t.dragData.didDrag&&!t.hoverData.selecting&&!t.hoverData.dragged&&!i(B)&&(W.$(r).unselect(["tapunselect"]),re.length>0&&t.redrawHint("eles",!0),t.dragData.possibleDragElements=re=W.collection()),ae==ie&&!t.dragData.didDrag&&!t.hoverData.selecting&&ae!=null&&ae._private.selectable&&(t.hoverData.dragging||(W.selectionType()==="additive"||ue?ae.selected()?ae.unselect(["tapunselect"]):ae.select(["tapselect"]):ue||(W.$(r).unmerge(ae).unselect(["tapunselect"]),ae.select(["tapselect"]))),t.redrawHint("eles",!0)),t.hoverData.selecting){var pe=W.collection(t.getAllInBox(j[0],j[1],j[2],j[3]));t.redrawHint("select",!0),pe.length>0&&t.redrawHint("eles",!0),W.emit(oe("boxend"));var Te=function(xe){return xe.selectable()&&!xe.selected()};W.selectionType()==="additive"||ue||W.$(r).unmerge(pe).unselect(),pe.emit(oe("box")).stdFilter(Te).select().emit(oe("boxselect")),t.redraw()}if(t.hoverData.dragging&&(t.hoverData.dragging=!1,t.redrawHint("select",!0),t.redrawHint("eles",!0),t.redraw()),!j[4]){t.redrawHint("drag",!0),t.redrawHint("eles",!0);var De=ie&&ie.grabbed();g(re),De&&(ie.emit(oe("freeon")),re.emit(oe("free")),t.dragData.didDrag&&(ie.emit(oe("dragfreeon")),re.emit(oe("dragfree"))))}}j[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 P=[],x=4,N,M=1e5,I=function(B,V){for(var W=0;W<B.length;W++)if(B[W]%V!==0)return!1;return!0},O=function(B){for(var V=Math.abs(B[0]),W=1;W<B.length;W++)if(Math.abs(B[W])!==V)return!1;return!0},k=function(B){var V=!1,W=B.deltaY;if(W==null&&(B.wheelDeltaY!=null?W=B.wheelDeltaY/4:B.wheelDelta!=null&&(W=B.wheelDelta/4)),W!==0){if(N==null)if(P.length>=x){var Z=P;if(N=I(Z,5),!N){var j=Math.abs(Z[0]);N=O(Z)&&j>5}if(N)for(var ae=0;ae<Z.length;ae++)M=Math.min(Math.abs(Z[ae]),M)}else P.push(W),V=!0;else N&&(M=Math.min(Math.abs(W),M));if(!t.scrollingPage){var re=t.cy,ie=re.zoom(),ue=re.pan(),oe=t.projectIntoViewport(B.clientX,B.clientY),he=[oe[0]*ie+ue.x,oe[1]*ie+ue.y];if(t.hoverData.draggingEles||t.hoverData.dragging||t.hoverData.cxtStarted||w()){B.preventDefault();return}if(re.panningEnabled()&&re.userPanningEnabled()&&re.zoomingEnabled()&&re.userZoomingEnabled()){B.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 me;V&&Math.abs(W)>5&&(W=Pv(W)*5),me=W/-250,N&&(me/=M,me*=3),me=me*t.wheelSensitivity;var pe=B.deltaMode===1;pe&&(me*=33);var Te=re.zoom()*Math.pow(10,me);B.type==="gesturechange"&&(Te=t.gestureStartZoom*B.scale),re.zoom({level:Te,renderedPosition:{x:he[0],y:he[1]}}),re.emit({type:B.type==="gesturechange"?"pinchzoom":"scrollzoom",originalEvent:B,position:{x:oe[0],y:oe[1]}})}}}};t.registerBinding(t.container,"wheel",k,!0),t.registerBinding(e,"scroll",function(B){t.scrollingPage=!0,clearTimeout(t.scrollingPageTimeout),t.scrollingPageTimeout=setTimeout(function(){t.scrollingPage=!1},250)},!0),t.registerBinding(t.container,"gesturestart",function(B){t.gestureStartZoom=t.cy.zoom(),t.hasTouchStarted||B.preventDefault()},!0),t.registerBinding(t.container,"gesturechange",function(ne){t.hasTouchStarted||k(ne)},!0),t.registerBinding(t.container,"mouseout",function(B){var V=t.projectIntoViewport(B.clientX,B.clientY);t.cy.emit({originalEvent:B,type:"mouseout",position:{x:V[0],y:V[1]}})},!1),t.registerBinding(t.container,"mouseover",function(B){var V=t.projectIntoViewport(B.clientX,B.clientY);t.cy.emit({originalEvent:B,type:"mouseover",position:{x:V[0],y:V[1]}})},!1);var F,_,z,X,q,G,U,K,J,Y,H,$,Q,ee=function(B,V,W,Z){return Math.sqrt((W-B)*(W-B)+(Z-V)*(Z-V))},te=function(B,V,W,Z){return(W-B)*(W-B)+(Z-V)*(Z-V)},le;t.registerBinding(t.container,"touchstart",le=function(B){if(t.hasTouchStarted=!0,!!C(B)){y(),t.touchData.capture=!0,t.data.bgActivePosistion=void 0;var V=t.cy,W=t.touchData.now,Z=t.touchData.earlier;if(B.touches[0]){var j=t.projectIntoViewport(B.touches[0].clientX,B.touches[0].clientY);W[0]=j[0],W[1]=j[1]}if(B.touches[1]){var j=t.projectIntoViewport(B.touches[1].clientX,B.touches[1].clientY);W[2]=j[0],W[3]=j[1]}if(B.touches[2]){var j=t.projectIntoViewport(B.touches[2].clientX,B.touches[2].clientY);W[4]=j[0],W[5]=j[1]}var ae=function(Ie){return{originalEvent:B,type:Ie,position:{x:W[0],y:W[1]}}};if(B.touches[1]){t.touchData.singleTouchMoved=!0,g(t.dragData.touchDragEles);var re=t.findContainerClientCoords();J=re[0],Y=re[1],H=re[2],$=re[3],F=B.touches[0].clientX-J,_=B.touches[0].clientY-Y,z=B.touches[1].clientX-J,X=B.touches[1].clientY-Y,Q=0<=F&&F<=H&&0<=z&&z<=H&&0<=_&&_<=$&&0<=X&&X<=$;var ie=V.pan(),ue=V.zoom();q=ee(F,_,z,X),G=te(F,_,z,X),U=[(F+z)/2,(_+X)/2],K=[(U[0]-ie.x)/ue,(U[1]-ie.y)/ue];var oe=200,he=oe*oe;if(G<he&&!B.touches[2]){var me=t.findNearestElement(W[0],W[1],!0,!0),pe=t.findNearestElement(W[2],W[3],!0,!0);me&&me.isNode()?(me.activate().emit(ae("cxttapstart")),t.touchData.start=me):pe&&pe.isNode()?(pe.activate().emit(ae("cxttapstart")),t.touchData.start=pe):V.emit(ae("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(B.touches[2])V.boxSelectionEnabled()&&B.preventDefault();else if(!B.touches[1]){if(B.touches[0]){var Te=t.findNearestElements(W[0],W[1],!0,!0),De=Te[0];if(De!=null&&(De.activate(),t.touchData.start=De,t.touchData.starts=Te,t.nodeIsGrabbable(De))){var Le=t.dragData.touchDragEles=V.collection(),xe=null;t.redrawHint("eles",!0),t.redrawHint("drag",!0),De.selected()?(xe=V.$(function(Ue){return Ue.selected()&&t.nodeIsGrabbable(Ue)}),c(xe,{addToList:Le})):d(De,{addToList:Le}),l(De),De.emit(ae("grabon")),xe?xe.forEach(function(Ue){Ue.emit(ae("grab"))}):De.emit(ae("grab"))}n(De,["touchstart","tapstart","vmousedown"],B,{x:W[0],y:W[1]}),De==null&&(t.data.bgActivePosistion={x:j[0],y:j[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"],B,{x:W[0],y:W[1]})},t.tapholdDuration)}}if(B.touches.length>=1){for(var ke=t.touchData.startPosition=[null,null,null,null,null,null],Ce=0;Ce<W.length;Ce++)ke[Ce]=Z[Ce]=W[Ce];var Ae=B.touches[0];t.touchData.startGPosition=[Ae.clientX,Ae.clientY]}}},!1);var Ee;t.registerBinding(e,"touchmove",Ee=function(B){var V=t.touchData.capture;if(!(!V&&!C(B))){var W=t.selection,Z=t.cy,j=t.touchData.now,ae=t.touchData.earlier,re=Z.zoom();if(B.touches[0]){var ie=t.projectIntoViewport(B.touches[0].clientX,B.touches[0].clientY);j[0]=ie[0],j[1]=ie[1]}if(B.touches[1]){var ie=t.projectIntoViewport(B.touches[1].clientX,B.touches[1].clientY);j[2]=ie[0],j[3]=ie[1]}if(B.touches[2]){var ie=t.projectIntoViewport(B.touches[2].clientX,B.touches[2].clientY);j[4]=ie[0],j[5]=ie[1]}var ue=function(ux){return{originalEvent:B,type:ux,position:{x:j[0],y:j[1]}}},oe=t.touchData.startGPosition,he;if(V&&B.touches[0]&&oe){for(var me=[],pe=0;pe<j.length;pe++)me[pe]=j[pe]-ae[pe];var Te=B.touches[0].clientX-oe[0],De=Te*Te,Le=B.touches[0].clientY-oe[1],xe=Le*Le,ke=De+xe;he=ke>=t.touchTapThreshold2}if(V&&t.touchData.cxt){B.preventDefault();var Ce=B.touches[0].clientX-J,Ae=B.touches[0].clientY-Y,Ue=B.touches[1].clientX-J,Ie=B.touches[1].clientY-Y,qe=te(Ce,Ae,Ue,Ie),ze=qe/G,Ze=150,tt=Ze*Ze,We=1.5,Nt=We*We;if(ze>=Nt||qe>=tt){t.touchData.cxt=!1,t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var Ft=ue("cxttapend");t.touchData.start?(t.touchData.start.unactivate().emit(Ft),t.touchData.start=null):Z.emit(Ft)}}if(V&&t.touchData.cxt){var Ft=ue("cxtdrag");t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.touchData.start?t.touchData.start.emit(Ft):Z.emit(Ft),t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxtDragged=!0;var mt=t.findNearestElement(j[0],j[1],!0,!0);(!t.touchData.cxtOver||mt!==t.touchData.cxtOver)&&(t.touchData.cxtOver&&t.touchData.cxtOver.emit(ue("cxtdragout")),t.touchData.cxtOver=mt,mt&&mt.emit(ue("cxtdragover")))}else if(V&&B.touches[2]&&Z.boxSelectionEnabled())B.preventDefault(),t.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,t.touchData.selecting||Z.emit(ue("boxstart")),t.touchData.selecting=!0,t.touchData.didSelect=!0,W[4]=1,!W||W.length===0||W[0]===void 0?(W[0]=(j[0]+j[2]+j[4])/3,W[1]=(j[1]+j[3]+j[5])/3,W[2]=(j[0]+j[2]+j[4])/3+1,W[3]=(j[1]+j[3]+j[5])/3+1):(W[2]=(j[0]+j[2]+j[4])/3,W[3]=(j[1]+j[3]+j[5])/3),t.redrawHint("select",!0),t.redraw();else if(V&&B.touches[1]&&!t.touchData.didSelect&&Z.zoomingEnabled()&&Z.panningEnabled()&&Z.userZoomingEnabled()&&Z.userPanningEnabled()){B.preventDefault(),t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var at=t.dragData.touchDragEles;if(at){t.redrawHint("drag",!0);for(var ut=0;ut<at.length;ut++){var Gt=at[ut]._private;Gt.grabbed=!1,Gt.rscratch.inDragLayer=!1}}var lt=t.touchData.start,Ce=B.touches[0].clientX-J,Ae=B.touches[0].clientY-Y,Ue=B.touches[1].clientX-J,Ie=B.touches[1].clientY-Y,qr=ee(Ce,Ae,Ue,Ie),yr=qr/q;if(Q){var mr=Ce-F,In=Ae-_,Ga=Ue-z,Pn=Ie-X,Ua=(mr+Ga)/2,lo=(In+Pn)/2,ur=Z.zoom(),ia=ur*yr,Gr=Z.pan(),oa=K[0]*ur+Gr.x,za=K[1]*ur+Gr.y,vt={x:-ia/ur*(oa-Gr.x-Ua)+oa,y:-ia/ur*(za-Gr.y-lo)+za};if(lt&&lt.active()){var at=t.dragData.touchDragEles;g(at),t.redrawHint("drag",!0),t.redrawHint("eles",!0),lt.unactivate().emit(ue("freeon")),at.emit(ue("free")),t.dragData.didDrag&&(lt.emit(ue("dragfreeon")),at.emit(ue("dragfree")))}Z.viewport({zoom:ia,pan:vt,cancelOnFailedZoom:!0}),Z.emit(ue("pinchzoom")),q=qr,F=Ce,_=Ae,z=Ue,X=Ie,t.pinching=!0}if(B.touches[0]){var ie=t.projectIntoViewport(B.touches[0].clientX,B.touches[0].clientY);j[0]=ie[0],j[1]=ie[1]}if(B.touches[1]){var ie=t.projectIntoViewport(B.touches[1].clientX,B.touches[1].clientY);j[2]=ie[0],j[3]=ie[1]}if(B.touches[2]){var ie=t.projectIntoViewport(B.touches[2].clientX,B.touches[2].clientY);j[4]=ie[0],j[5]=ie[1]}}else if(B.touches[0]&&!t.touchData.didSelect){var Fe=t.touchData.start,Ve=t.touchData.last,mt;if(!t.hoverData.draggingEles&&!t.swipePanning&&(mt=t.findNearestElement(j[0],j[1],!0,!0)),V&&Fe!=null&&B.preventDefault(),V&&Fe!=null&&t.nodeIsDraggable(Fe))if(he){var at=t.dragData.touchDragEles,Xt=!t.dragData.didDrag;Xt&&c(at,{inDragLayer:!0}),t.dragData.didDrag=!0;var bt={x:0,y:0};if(we(me[0])&&we(me[1])&&(bt.x+=me[0],bt.y+=me[1],Xt)){t.redrawHint("eles",!0);var Wt=t.touchData.dragDelta;Wt&&we(Wt[0])&&we(Wt[1])&&(bt.x+=Wt[0],bt.y+=Wt[1])}t.hoverData.draggingEles=!0,at.silentShift(bt).emit(ue("position")).emit(ue("drag")),t.redrawHint("drag",!0),t.touchData.startPosition[0]==ae[0]&&t.touchData.startPosition[1]==ae[1]&&t.redrawHint("eles",!0),t.redraw()}else{var Wt=t.touchData.dragDelta=t.touchData.dragDelta||[];Wt.length===0?(Wt.push(me[0]),Wt.push(me[1])):(Wt[0]+=me[0],Wt[1]+=me[1])}if(n(Fe||mt,["touchmove","tapdrag","vmousemove"],B,{x:j[0],y:j[1]}),(!Fe||!Fe.grabbed())&&mt!=Ve&&(Ve&&Ve.emit(ue("tapdragout")),mt&&mt.emit(ue("tapdragover"))),t.touchData.last=mt,V)for(var ut=0;ut<j.length;ut++)j[ut]&&t.touchData.startPosition[ut]&&he&&(t.touchData.singleTouchMoved=!0);if(V&&(Fe==null||Fe.pannable())&&Z.panningEnabled()&&Z.userPanningEnabled()){var sx=o(Fe,t.touchData.starts);sx&&(B.preventDefault(),t.data.bgActivePosistion||(t.data.bgActivePosistion=pa(t.touchData.startPosition)),t.swipePanning?(Z.panBy({x:me[0]*re,y:me[1]*re}),Z.emit(ue("dragpan"))):he&&(t.swipePanning=!0,Z.panBy({x:Te*re,y:Le*re}),Z.emit(ue("dragpan")),Fe&&(Fe.unactivate(),t.redrawHint("select",!0),t.touchData.start=null)));var ie=t.projectIntoViewport(B.touches[0].clientX,B.touches[0].clientY);j[0]=ie[0],j[1]=ie[1]}}for(var pe=0;pe<j.length;pe++)ae[pe]=j[pe];V&&B.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 fe;t.registerBinding(e,"touchcancel",fe=function(B){var V=t.touchData.start;t.touchData.capture=!1,V&&V.unactivate()});var se,ve,ce,ye;if(t.registerBinding(e,"touchend",se=function(B){var V=t.touchData.start,W=t.touchData.capture;if(W)B.touches.length===0&&(t.touchData.capture=!1),B.preventDefault();else return;var Z=t.selection;t.swipePanning=!1,t.hoverData.draggingEles=!1;var j=t.cy,ae=j.zoom(),re=t.touchData.now,ie=t.touchData.earlier;if(B.touches[0]){var ue=t.projectIntoViewport(B.touches[0].clientX,B.touches[0].clientY);re[0]=ue[0],re[1]=ue[1]}if(B.touches[1]){var ue=t.projectIntoViewport(B.touches[1].clientX,B.touches[1].clientY);re[2]=ue[0],re[3]=ue[1]}if(B.touches[2]){var ue=t.projectIntoViewport(B.touches[2].clientX,B.touches[2].clientY);re[4]=ue[0],re[5]=ue[1]}var oe=function(tt){return{originalEvent:B,type:tt,position:{x:re[0],y:re[1]}}};V&&V.unactivate();var he;if(t.touchData.cxt){if(he=oe("cxttapend"),V?V.emit(he):j.emit(he),!t.touchData.cxtDragged){var me=oe("cxttap");V?V.emit(me):j.emit(me)}t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxt=!1,t.touchData.start=null,t.redraw();return}if(!B.touches[2]&&j.boxSelectionEnabled()&&t.touchData.selecting){t.touchData.selecting=!1;var pe=j.collection(t.getAllInBox(Z[0],Z[1],Z[2],Z[3]));Z[0]=void 0,Z[1]=void 0,Z[2]=void 0,Z[3]=void 0,Z[4]=0,t.redrawHint("select",!0),j.emit(oe("boxend"));var Te=function(tt){return tt.selectable()&&!tt.selected()};pe.emit(oe("box")).stdFilter(Te).select().emit(oe("boxselect")),pe.nonempty()&&t.redrawHint("eles",!0),t.redraw()}if(V!=null&&V.unactivate(),B.touches[2])t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);else if(!B.touches[1]){if(!B.touches[0]){if(!B.touches[0]){t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var De=t.dragData.touchDragEles;if(V!=null){var Le=V._private.grabbed;g(De),t.redrawHint("drag",!0),t.redrawHint("eles",!0),Le&&(V.emit(oe("freeon")),De.emit(oe("free")),t.dragData.didDrag&&(V.emit(oe("dragfreeon")),De.emit(oe("dragfree")))),n(V,["touchend","tapend","vmouseup","tapdragout"],B,{x:re[0],y:re[1]}),V.unactivate(),t.touchData.start=null}else{var xe=t.findNearestElement(re[0],re[1],!0,!0);n(xe,["touchend","tapend","vmouseup","tapdragout"],B,{x:re[0],y:re[1]})}var ke=t.touchData.startPosition[0]-re[0],Ce=ke*ke,Ae=t.touchData.startPosition[1]-re[1],Ue=Ae*Ae,Ie=Ce+Ue,qe=Ie*ae*ae;t.touchData.singleTouchMoved||(V||j.$(":selected").unselect(["tapunselect"]),n(V,["tap","vclick"],B,{x:re[0],y:re[1]}),ve=!1,B.timeStamp-ye<=j.multiClickDebounceTime()?(ce&&clearTimeout(ce),ve=!0,ye=null,n(V,["dbltap","vdblclick"],B,{x:re[0],y:re[1]})):(ce=setTimeout(function(){ve||n(V,["onetap","voneclick"],B,{x:re[0],y:re[1]})},j.multiClickDebounceTime()),ye=B.timeStamp)),V!=null&&!t.dragData.didDrag&&V._private.selectable&&qe<t.touchTapThreshold2&&!t.pinching&&(j.selectionType()==="single"?(j.$(r).unmerge(V).unselect(["tapunselect"]),V.select(["tapselect"])):V.selected()?V.unselect(["tapunselect"]):V.select(["tapselect"]),t.redrawHint("eles",!0)),t.touchData.singleTouchMoved=!0}}}for(var ze=0;ze<re.length;ze++)ie[ze]=re[ze];t.dragData.didDrag=!1,B.touches.length===0&&(t.touchData.dragDelta=[],t.touchData.startPosition=[null,null,null,null,null,null],t.touchData.startGPosition=null,t.touchData.didSelect=!1),B.touches.length<2&&(B.touches.length===1&&(t.touchData.startGPosition=[B.touches[0].clientX,B.touches[0].clientY]),t.pinching=!1,t.redrawHint("eles",!0),t.redraw())},!1),typeof TouchEvent>"u"){var ge=[],de=function(B){return{clientX:B.clientX,clientY:B.clientY,force:1,identifier:B.pointerId,pageX:B.pageX,pageY:B.pageY,radiusX:B.width/2,radiusY:B.height/2,screenX:B.screenX,screenY:B.screenY,target:B.target}},be=function(B){return{event:B,touch:de(B)}},Re=function(B){ge.push(be(B))},Pe=function(B){for(var V=0;V<ge.length;V++){var W=ge[V];if(W.event.pointerId===B.pointerId){ge.splice(V,1);return}}},Be=function(B){var V=ge.filter(function(W){return W.event.pointerId===B.pointerId})[0];V.event=B,V.touch=de(B)},Ne=function(B){B.touches=ge.map(function(V){return V.touch})},Me=function(B){return B.pointerType==="mouse"||B.pointerType===4};t.registerBinding(t.container,"pointerdown",function(ne){Me(ne)||(ne.preventDefault(),Re(ne),Ne(ne),le(ne))}),t.registerBinding(t.container,"pointerup",function(ne){Me(ne)||(Pe(ne),Ne(ne),se(ne))}),t.registerBinding(t.container,"pointercancel",function(ne){Me(ne)||(Pe(ne),Ne(ne),fe(ne))}),t.registerBinding(t.container,"pointermove",function(ne){Me(ne)||(ne.preventDefault(),Be(ne),Ne(ne),Ee(ne))})}};var vr={};vr.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 fn(s,u,this.points,a,n,i/2,o/2,l)},checkPoint:function(a,n,i,o,s,u,l,f){return cr(a,n,this.points,u,l,o,s,[0,-1],i)},hasMiterBounds:t!=="rectangle",miterBounds:function(a,n,i,o,s,u){return qC(this.points,a,n,i,o,s)}}};vr.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 WC(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)}}};vr.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]=Wv(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 KC(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 XC(a,n,this.points,u,l,o,s,this.getOrCreateCorners(u,l,o,s,f,h,"corners"))}}};vr.generateRoundRectangle=function(){return this.nodeShapes["round-rectangle"]=this.nodeShapes.roundrectangle={renderer:this,name:"round-rectangle",points:Mt(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"?Dr(n,i):u,u=Math.min(l,f,u);var h=u*2;return!!(cr(e,r,this.points,o,s,n,i-h,[0,-1],a)||cr(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))}}};vr.generateCutRectangle=function(){return this.nodeShapes["cut-rectangle"]=this.nodeShapes.cutrectangle={renderer:this,name:"cut-rectangle",cornerLength:_v(),points:Mt(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 fn(i,o,f,e,r)},checkPoint:function(e,r,a,n,i,o,s,u){var l=u==="auto"?this.cornerLength:u;if(cr(e,r,this.points,o,s,n,i-2*l,[0,-1],a)||cr(e,r,this.points,o,s,n-2*l,i,[0,-1],a))return!0;var f=this.generateCutTrianglePts(n,i,o,s);return _t(e,r,f.topLeft)||_t(e,r,f.topRight)||_t(e,r,f.bottomRight)||_t(e,r,f.bottomLeft)}}};vr.generateBarrel=function(){return this.nodeShapes.barrel={renderer:this,name:"barrel",points:Mt(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=ba({x:p[0],y:p[1]},{x:p[2],y:p[3]},{x:p[4],y:p[5]},l),b=ba({x:p[0],y:p[1]},{x:p[2],y:p[3]},{x:p[4],y:p[5]},f),m=ba({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 fn(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=sv(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=sv(n,i),f=l.heightOffset,h=l.widthOffset;if(cr(e,r,this.points,o,s,n,i-2*f,[0,-1],a)||cr(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),k=Math.max(x,N);if(M<=C&&C<=I&&O<=A&&A<=k){var F=ZC(S,D,P),_=zC(F[0],F[1],F[2],C),z=_.filter(function(X){return 0<=X&&X<=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=Et(m,E,T,b);if(y.isTop&&L<=r||y.isBottom&&r<=L)return!0}}return!1}}};vr.generateBottomRoundrectangle=function(){return this.nodeShapes["bottom-round-rectangle"]=this.nodeShapes.bottomroundrectangle={renderer:this,name:"bottom-round-rectangle",points:Mt(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=Cr(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"?Dr(n,i):u;var l=2*u;if(cr(e,r,this.points,o,s,n,i-l,[0,-1],a)||cr(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!!(_t(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))}}};vr.registerNodeShapes=function(){var t=this.nodeShapes={},e=this;this.generateEllipse(),this.generatePolygon("triangle",Mt(3,0)),this.generateRoundPolygon("round-triangle",Mt(3,0)),this.generatePolygon("rectangle",Mt(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",Mt(5,0)),this.generateRoundPolygon("round-pentagon",Mt(5,0)),this.generatePolygon("hexagon",Mt(6,0)),this.generateRoundPolygon("round-hexagon",Mt(6,0)),this.generatePolygon("heptagon",Mt(7,0)),this.generateRoundPolygon("round-heptagon",Mt(7,0)),this.generatePolygon("octagon",Mt(8,0)),this.generateRoundPolygon("round-octagon",Mt(8,0));var a=new Array(20);{var n=ov(5,0),i=ov(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 Ln={};Ln.timeToRender=function(){return this.redrawTotalTime/this.redrawCount};Ln.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};Ln.beforeRender=function(t,e){if(!this.destroyed){e==null&&nt("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)};Ln.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=hr();t.render(t.renderOptions);var o=t.lastDrawTime=hr();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,gi(r)}};gi(r)}};var gS=function(e){this.init(e)},Uw=gS,Pa=Uw.prototype;Pa.clientFunctions=["redrawHint","render","renderTo","matchCanvasSize","nodeShapeImpl","arrowShapeImpl"];Pa.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"&&Ke("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=we(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()};Pa.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()}};Pa.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{}};Pa.isHeadless=function(){return!1};[Xv,kw,qw,Ia,vr,Ln].forEach(function(t){_e(Pa,t)});var Is=1e3/60,zw={setupDequeueing:function(e){return function(){var a=this,n=this.renderer;if(!a.dequeueingSetup){a.dequeueingSetup=!0;var i=wn(function(){n.redrawHint("eles",!0),n.redrawHint("drag",!0),n.redraw()},e.deqRedrawThreshold),o=function(l,f){var h=hr(),v=n.averageRedrawTime,c=n.lastRedrawTime,d=[],g=n.cy.extent(),p=n.getPixelRatio();for(l||n.flushRenderedStyleQueue();;){var y=hr(),b=y-h,m=y-f;if(c<Is){var E=Is-(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*Is)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||Mv;n.beforeRender(o,s(a))}}}},pS=(function(){function t(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:pi;Ir(this,t),this.idsByKey=new fr,this.keyForId=new fr,this.cachesByLvl=new fr,this.lvls=[],this.getKey=e,this.doesEleInvalidateKey=r}return Pr(t,[{key:"getIdsFor",value:function(r){r==null&&nt("Can not get id list for null key");var a=this.idsByKey,n=this.idsByKey.get(r);return n||(n=new Da,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 fr,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,Wn=50,ni=-4,Ev=3,Vw=7.99,yS=8,mS=1024,bS=1024,ES=1024,wS=.2,TS=.8,xS=10,CS=.15,AS=.1,LS=.9,RS=.9,SS=100,DS=1,ma={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},NS=At({getKey:null,doesEleInvalidateKey:pi,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:ME,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),Ja=function(e,r){var a=this;a.renderer=e,a.onDequeues=[];var n=NS(r);_e(a,n),a.lookup=new pS(n.getKey,n.doesEleInvalidateKey),a.setupDequeueing()},yt=Ja.prototype;yt.reasons=ma;yt.getTextureQueue=function(t){var e=this;return e.eleImgCaches=e.eleImgCaches||{},e.eleImgCaches[t]=e.eleImgCaches[t]||[]};yt.getRetiredTextureQueue=function(t){var e=this,r=e.eleImgCaches.retired=e.eleImgCaches.retired||{},a=r[t]=r[t]||[];return a};yt.getElementQueue=function(){var t=this,e=t.eleCacheQueue=t.eleCacheQueue||new Tn(function(r,a){return a.reqs-r.reqs});return e};yt.getElementKeyToQueue=function(){var t=this,e=t.eleKeyToCacheQueue=t.eleKeyToCacheQueue||{};return e};yt.getElement=function(t,e,r,a,n){var i=this,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(Iv(s*r))),a<ni)a=ni;else if(s>=Vw||a>Ev)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<=Wn?d=Wn:d=Math.ceil(f/Wn)*Wn,f>ES||h>bS)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===ma.dequeue,E=n&&n===ma.highQuality,T=n&&n===ma.downscale,L,w=a+1;w<=Ev;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,ma.downscale);R()}else return i.queueElement(t,L.level-1),L;else{var D;if(!m&&!E&&!T)for(var P=a-1;P>=ni;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+yS),p.eleCaches.push(c),u.set(t,a,c),i.checkTextureFullness(p),c};yt.invalidateElements=function(t){for(var e=0;e<t.length;e++)this.invalidateElement(t[e])};yt.invalidateElement=function(t){var e=this,r=e.lookup,a=[],n=r.isInvalid(t);if(n){for(var i=ni;i<=Ev;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)}};yt.checkTextureUtility=function(t){t.invalidatedWidth>=wS*t.width&&this.retireTexture(t)};yt.checkTextureFullness=function(t){var e=this,r=e.getTextureQueue(t.height);t.usedWidth/t.width>TS&&t.fullnessChecks>=xS?Sr(r,t):t.fullnessChecks++};yt.retireTexture=function(t){var e=this,r=t.height,a=e.getTextureQueue(r),n=this.lookup;Sr(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)}Ov(i);var u=e.getRetiredTextureQueue(r);u.push(t)};yt.addTexture=function(t,e){var r=this,a=r.getTextureQueue(t),n={};return a.push(n),n.eleCaches=[],n.height=t,n.width=Math.max(mS,e),n.usedWidth=0,n.invalidatedWidth=0,n.fullnessChecks=0,n.canvas=r.renderer.makeOffscreenCanvas(n.width,n.height),n.context=n.canvas.getContext("2d"),n};yt.recycleTexture=function(t,e){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,Ov(o.eleCaches),o.context.setTransform(1,0,0,1,0,0),o.context.clearRect(0,0,o.width,o.height),Sr(n,o),a.push(o),o}};yt.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}};yt.dequeue=function(t){for(var e=this,r=e.getElementQueue(),a=e.getElementKeyToQueue(),n=[],i=e.lookup,o=0;o<DS&&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,ma.dequeue)}return n};yt.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=Nv,r.updateItem(i),r.pop(),a[n]=null):i.eles.unmerge(t))};yt.onDequeue=function(t){this.onDequeues.push(t)};yt.offDequeue=function(t){Sr(this.onDequeues,t)};yt.setupDequeueing=zw.setupDequeueing({deqRedrawThreshold:SS,deqCost:CS,deqAvgCost:AS,deqNoDrawCost:LS,deqFastCost:RS,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(Fv(u,n))return!0}return!1},priority:function(e){return e.renderer.beforeRenderPriorities.eleTxrDeq}});var MS=1,an=-4,Ci=2,OS=3.99,IS=50,PS=50,FS=.15,_S=.1,BS=.9,kS=.9,qS=1,Sp=250,GS=4e3*4e3,Dp=32767,US=!0,Yw=function(e){var r=this,a=r.renderer=e,n=a.cy;r.layersByLevel={},r.firstGet=!0,r.lastInvalidationTime=hr()-2*Sp,r.skipping=!1,r.eleTxrDeqs=n.collection(),r.scheduleElementRefinement=wn(function(){r.refineElementTextures(r.eleTxrDeqs),r.eleTxrDeqs.unmerge(r.eleTxrDeqs)},PS),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 Tn(i),r.setupDequeueing()},Lt=Yw.prototype,Np=0,zS=Math.pow(2,53)-1;Lt.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%zS,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};Lt.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(Iv(o*e)),r<an)r=an;else if(o>=OS||r>Ci)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;an<=M&&M<=Ci&&!R(M);M+=N);};S(1),S(-1);for(var D=f.length-1;D>=0;D--){var P=f[D];P.invalid&&Sr(f,P)}};if(!v)d();else return f;var g=function(){if(!h){h=It();for(var R=0;R<t.length;R++)_C(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>GS)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/MS,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)};Lt.getEleLevelForLayerLevel=function(t,e){return t};Lt.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,US),i.setImgSmoothing(o,!0))};Lt.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};Lt.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}}};Lt.updateElementsInLayers=function(t,e){for(var r=this,a=yn(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=an;l<=Ci;l++){var f=u[l];f&&(i&&r.getEleLevelForLayerLevel(f.level)!==i.level||e(f,o,i))}};Lt.haveLayers=function(){for(var t=this,e=!1,r=an;r<=Ci;r++){var a=t.layersByLevel[r];if(a&&a.length>0){e=!0;break}}return e};Lt.invalidateElements=function(t){var e=this;t.length!==0&&(e.lastInvalidationTime=hr(),!(t.length===0||!e.haveLayers())&&e.updateElementsInLayers(t,function(a,n,i){e.invalidateLayer(a)}))};Lt.invalidateLayer=function(t){if(this.lastInvalidationTime=hr(),!t.invalid){var e=t.level,r=t.eles,a=this.layersByLevel[e];Sr(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)}}};Lt.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])})};Lt.enqueueElementRefinement=function(t){this.eleTxrDeqs.merge(t),this.scheduleElementRefinement()};Lt.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))}};Lt.dequeue=function(t){for(var e=this,r=e.layersQueue,a=[],n=0;n<qS&&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};Lt.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()}};Lt.requestRedraw=wn(function(){var t=this.renderer;t.redrawHint("eles",!0),t.redrawHint("drag",!0),t.redraw()},100);Lt.setupDequeueing=zw.setupDequeueing({deqRedrawThreshold:IS,deqCost:FS,deqAvgCost:_S,deqNoDrawCost:BS,deqFastCost:kS,deq:function(e,r){return e.dequeue(r)},onDeqd:Mv,shouldRedraw:ME,priority:function(e){return e.renderer.beforeRenderPriorities.lyrTxrDeq}});var Hw={},Mp;function VS(t,e){for(var r=0;r<e.length;r++){var a=e[r];t.lineTo(a.x,a.y)}}function YS(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 HS(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 XS(t,e,r,a){t.arc(e,r,a,0,Math.PI*2,!1)}Hw.arrowShapeImpl=function(t){return(Mp||(Mp={polygon:VS,"triangle-backcurve":YS,"triangle-tee":Op,"circle-triangle":HS,"triangle-cross":Op,circle:XS}))[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 WS=function(){return 0},$S=function(e,r){return e.getTextAngle(r,null)},KS=function(e,r){return e.getTextAngle(r,"source")},ZS=function(e,r){return e.getTextAngle(r,"target")},QS=function(e,r){return r.effectiveOpacity()},Ps=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||Fv(v,a))){var d=e.isEdge(),g=e.element()._private.rscratch.badLine;o.drawElementUnderlay(t,e),o.drawCachedElementPortion(t,e,u,r,n,c,WS,QS),(!d||!g)&&o.drawCachedElementPortion(t,e,l,r,n,c,$S,Ps),d&&!g&&(o.drawCachedElementPortion(t,e,f,r,n,c,KS,Ps),o.drawCachedElementPortion(t,e,h,r,n,c,ZS,Ps)),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 dr={};dr.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 Xw=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")}}}};dr.drawEdgeOverlay=Xw("overlay");dr.drawEdgeUnderlay=Xw("underlay");dr.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=Bt(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([])};dr.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()}};dr.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)};dr.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)}}};dr.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=$r(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 Kv={};Kv.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){Ke(f)}};Kv.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,k=f(r,"background-position-y","units",a),F=f(r,"background-position-y","pfValue",a);k==="%"?O+=(y-S)*F:O+=F;var _=f(r,"background-offset-y","units",a),z=f(r,"background-offset-y","pfValue",a);_==="%"?O+=(y-S)*z:O+=z,b.pathCache&&(P-=s,O-=u,s=0,u=0);var X=t.globalAlpha;t.globalAlpha=T;var q=i.getImgSmoothing(t),G=!1;if(L==="no"&&q?(i.setImgSmoothing(t,!1),G=!0):L==="yes"&&!q&&(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=X,G&&i.setImgSmoothing(t,q)}};var ea={};ea.eleTextBiggerThanMin=function(t,e){if(!e){var r=t.cy().zoom(),a=this.getPixelRatio(),n=Math.ceil(Iv(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)};ea.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),l=e.pstyle("text-metrics").strValue==="glyph";t.textAlign=u,t.textBaseline=l?"alphabetic":"bottom"}else{var f=e.element()._private.rscratch.badLine,h=e.pstyle("label"),v=e.pstyle("source-label"),c=e.pstyle("target-label");if(f||(!h||!h.value)&&(!v||!v.value)&&(!c||!c.value))return;t.textAlign="center",t.textBaseline="bottom"}var d=!r,g;r&&(g=r,t.translate(-g.x1,-g.y1)),n==null?(o.drawText(t,e,null,d,i),e.isEdge()&&(o.drawText(t,e,"source",d,i),o.drawText(t,e,"target",d,i))):o.drawText(t,e,n,d,i),r&&t.translate(g.x1,g.y1)};ea.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};ea.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 JS(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()}ea.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=Ot(n,"labelAngle",e);r=t.isEdge()?s:0}else o.strValue==="none"?r=0:r=o.pfValue;return r};ea.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=Ot(o,"labelX",r),l=Ot(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=Ot(o,"labelWidth",r),g=Ot(o,"labelHeight",r),p=Ot(o,"labelActualDescent",r),y=e.pstyle(c+"text-margin-x").pfValue,b=e.pstyle(c+"text-margin-y").pfValue,m=e.isEdge(),E=e.pstyle("text-halign").value,T=e.pstyle("text-valign").value;m&&(E="center",T="center"),u+=y,l+=b;var L;a?L=this.getTextAngle(e,r):L=0,L!==0&&(f=u,h=l,t.translate(f,h),t.rotate(L),u=0,l=0);var w=La(E),C=Ra(T);switch(C){case"top":break;case"center":l+=g/2;break;case"bottom":l+=g;break}var A=e.pstyle("text-background-opacity").value,R=e.pstyle("text-border-opacity").value,S=e.pstyle("text-border-width").pfValue,D=e.pstyle("text-background-padding").pfValue,P=e.pstyle("text-background-shape").strValue,x=P==="round-rectangle"||P==="roundrectangle",N=P==="circle",M=2;if(A>0||S>0&&R>0){var I=t.fillStyle,O=t.strokeStyle,k=t.lineWidth,F=e.pstyle("text-background-color").value,_=e.pstyle("text-border-color").value,z=e.pstyle("text-border-style").value,X=A>0,q=S>0&&R>0,G=u-D;switch(w){case"left":G-=d;break;case"center":G-=d/2;break}var U=l-g-D,K=d+2*D,J=g+2*D;if(X&&(t.fillStyle="rgba(".concat(F[0],",").concat(F[1],",").concat(F[2],",").concat(A*s,")")),q&&(t.strokeStyle="rgba(".concat(_[0],",").concat(_[1],",").concat(_[2],",").concat(R*s,")"),t.lineWidth=S,t.setLineDash))switch(z){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"double":t.lineWidth=S/4,t.setLineDash([]);break;case"solid":default:t.setLineDash([]);break}if(x?(t.beginPath(),Ip(t,G,U,K,J,M)):N?(t.beginPath(),JS(t,G,U,K,J)):(t.beginPath(),t.rect(G,U,K,J)),X&&t.fill(),q&&t.stroke(),q&&z==="double"){var Y=S/2;t.beginPath(),x?Ip(t,G+Y,U+Y,K-2*Y,J-2*Y,M):t.rect(G+Y,U+Y,K-2*Y,J-2*Y),t.stroke()}t.fillStyle=I,t.strokeStyle=O,t.lineWidth=k,t.setLineDash&&t.setLineDash([])}var H=2*e.pstyle("text-outline-width").pfValue;if(H>0&&(t.lineWidth=H),l-=p,e.pstyle("text-wrap").value==="wrap"){var $=Ot(o,"labelWrapCachedLines",r),Q=Ot(o,"labelLineHeight",r),ee=d/2,te=this.getLabelJustification(e);switch(te==="auto"||(w==="left"?te==="left"?u+=-d:te==="center"&&(u+=-ee):w==="center"?te==="left"?u+=-ee:te==="right"&&(u+=ee):w==="right"&&(te==="center"?u+=ee:te==="right"&&(u+=d))),C){case"top":l-=($.length-1)*Q;break;case"center":case"bottom":l-=($.length-1)*Q;break}for(var le=0;le<$.length;le++)H>0&&t.strokeText($[le],u,l),t.fillText($[le],u,l),l+=Q}else H>0&&t.strokeText(v,u,l),t.fillText(v,u,l);L!==0&&(t.rotate(-L),t.translate(-f,-h))}}};var _r={};_r.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(!(!we(h.x)||!we(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,k=e.pstyle("border-dash-pattern").pfValue,F=e.pstyle("border-dash-offset").pfValue,_=e.pstyle("border-opacity").value*v,z=e.pstyle("outline-width").pfValue,X=e.pstyle("outline-color").value,q=e.pstyle("outline-style").value,G=e.pstyle("outline-opacity").value*v,U=e.pstyle("outline-offset").value,K=e.pstyle("corner-radius").value;K!=="auto"&&(K=e.pstyle("corner-radius").pfValue);var J=function(){var B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:P;o.eleFillStyle(t,e,B)},Y=function(){var B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:_;o.colorStrokeStyle(t,x[0],x[1],x[2],B)},H=function(){var B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:G;o.colorStrokeStyle(t,X[0],X[1],X[2],B)},$=function(B,V,W,Z){var j=o.nodePathCache=o.nodePathCache||[],ae=NE(W==="polygon"?W+","+Z.join(","):W,""+V,""+B,""+K),re=j[ae],ie,ue=!1;return re!=null?(ie=re,ue=!0,f.pathCache=ie):(ie=new Path2D,j[ae]=f.pathCache=ie),{path:ie,cacheHit:ue}},Q=e.pstyle("shape").strValue,ee=e.pstyle("shape-polygon-points").pfValue;if(c){t.translate(h.x,h.y);var te=$(s,u,Q,ee);d=te.path,g=te.cacheHit}var le=function(){if(!g){var B=h;c&&(B={x:0,y:0}),o.nodeShapes[o.getNodeShape(e)].draw(d||t,B.x,B.y,s,u,K,f)}c?t.fill(d):t.fill()},Ee=function(){for(var B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:v,V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,W=l.backgrounding,Z=0,j=0;j<T.length;j++){var ae=e.cy().style().getIndexedStyle(e,"background-image-containment","value",j);if(V&&ae==="over"||!V&&ae==="inside"){Z++;continue}E[j]&&T[j].complete&&!T[j].error&&(Z++,o.drawInscribedImage(t,T[j],e,j,B))}l.backgrounding=Z!==L,W!==l.backgrounding&&e.updateStyle(!1)},fe=function(){var B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:v;o.hasPie(e)&&(o.drawPie(t,e,V),B&&(c||o.nodeShapes[o.getNodeShape(e)].draw(t,h.x,h.y,s,u,K,f)))},se=function(){var B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,V=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,K,f),t.clip()),o.drawStripe(t,e,V),t.restore(),B&&(c||o.nodeShapes[o.getNodeShape(e)].draw(t,h.x,h.y,s,u,K,f)))},ve=function(){var B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:v,V=(S>0?S:-S)*B,W=S>0?0:255;S!==0&&(o.colorFillStyle(t,W,W,W,V),c?t.fill(d):t.fill())},ce=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(k),t.lineDashOffset=F;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 B=new Path2D;B.rect(-s/2-D,-u/2-D,s+2*D,u+2*D),B.addPath(d),t.clip(B,"evenodd")}c?t.stroke(d):t.stroke(),t.restore()}else c?t.stroke(d):t.stroke();if(N==="double"){t.lineWidth=D/3;var V=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",c?t.stroke(d):t.stroke(),t.globalCompositeOperation=V}t.setLineDash&&t.setLineDash([])}},ye=function(){if(z>0){if(t.lineWidth=z,t.lineCap="butt",t.setLineDash)switch(q){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"solid":case"double":t.setLineDash([]);break}var B=h;c&&(B={x:0,y:0});var V=o.getNodeShape(e),W=D;O==="inside"&&(W=0),O==="outside"&&(W*=2);var Z=(s+W+(z+U))/s,j=(u+W+(z+U))/u,ae=s*Z,re=u*j,ie=o.nodeShapes[V].points,ue;if(c){var oe=$(ae,re,V,ie);ue=oe.path}if(V==="ellipse")o.drawEllipsePath(ue||t,B.x,B.y,ae,re);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(V)){var he=0,me=0,pe=0;V==="round-diamond"?he=(W+U+z)*1.4:V==="round-heptagon"?(he=(W+U+z)*1.075,pe=-(W/2+U+z)/35):V==="round-hexagon"?he=(W+U+z)*1.12:V==="round-pentagon"?(he=(W+U+z)*1.13,pe=-(W/2+U+z)/15):V==="round-tag"?(he=(W+U+z)*1.12,me=(W/2+z+U)*.07):V==="round-triangle"&&(he=(W+U+z)*(Math.PI/2),pe=-(W+U/2+z)/Math.PI),he!==0&&(Z=(s+he)/s,ae=s*Z,["round-hexagon","round-tag"].includes(V)||(j=(u+he)/u,re=u*j)),K=K==="auto"?GE(ae,re):K;for(var Te=ae/2,De=re/2,Le=K+(W+z+U)/2,xe=new Array(ie.length/2),ke=new Array(ie.length/2),Ce=0;Ce<ie.length/2;Ce++)xe[Ce]={x:B.x+me+Te*ie[Ce*2],y:B.y+pe+De*ie[Ce*2+1]};var Ae,Ue,Ie,qe,ze=xe.length;for(Ue=xe[ze-1],Ae=0;Ae<ze;Ae++)Ie=xe[Ae%ze],qe=xe[(Ae+1)%ze],ke[Ae]=Wv(Ue,Ie,qe,Le),Ue=Ie,Ie=qe;o.drawRoundPolygonPath(ue||t,B.x+me,B.y+pe,s*Z,u*j,ie,ke)}else if(["roundrectangle","round-rectangle"].includes(V))K=K==="auto"?Dr(ae,re):K,o.drawRoundRectanglePath(ue||t,B.x,B.y,ae,re,K+(W+z+U)/2);else if(["cutrectangle","cut-rectangle"].includes(V))K=K==="auto"?_v():K,o.drawCutRectanglePath(ue||t,B.x,B.y,ae,re,null,K+(W+z+U)/4);else if(["bottomroundrectangle","bottom-round-rectangle"].includes(V))K=K==="auto"?Dr(ae,re):K,o.drawBottomRoundRectanglePath(ue||t,B.x,B.y,ae,re,K+(W+z+U)/2);else if(V==="barrel")o.drawBarrelPath(ue||t,B.x,B.y,ae,re);else if(V.startsWith("polygon")||["rhomboid","right-rhomboid","round-tag","tag","vee"].includes(V)){var Ze=(W+z+U)/s;ie=yi(mi(ie,Ze)),o.drawPolygonPath(ue||t,B.x,B.y,s,u,ie)}else{var tt=(W+z+U)/s;ie=yi(mi(ie,-tt)),o.drawPolygonPath(ue||t,B.x,B.y,s,u,ie)}if(c?t.stroke(ue):t.stroke(),q==="double"){t.lineWidth=W/3;var We=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",c?t.stroke(ue):t.stroke(),t.globalCompositeOperation=We}t.setLineDash&&t.setLineDash([])}},ge=function(){n&&o.drawNodeOverlay(t,e,h,s,u)},de=function(){n&&o.drawNodeUnderlay(t,e,h,s,u)},be=function(){o.drawElementText(t,e,null,a)},Re=e.pstyle("ghost").value==="yes";if(Re){var Pe=e.pstyle("ghost-offset-x").pfValue,Be=e.pstyle("ghost-offset-y").pfValue,Ne=e.pstyle("ghost-opacity").value,Me=Ne*v;t.translate(Pe,Be),H(),ye(),J(Ne*P),le(),Ee(Me,!0),Y(Ne*_),ce(),fe(S!==0||D!==0),se(S!==0||D!==0),Ee(Me,!1),ve(Me),t.translate(-Pe,-Be)}c&&t.translate(-h.x,-h.y),de(),c&&t.translate(h.x,h.y),H(),ye(),J(),le(),Ee(v,!0),Y(),ce(),fe(S!==0||D!==0),se(S!==0||D!==0),Ee(v,!1),ve(),c&&t.translate(-h.x,-h.y),be(),ge(),r&&t.translate(y.x1,y.y1)}};var Ww=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()}}}};_r.drawNodeOverlay=Ww("overlay");_r.drawNodeUnderlay=Ww("underlay");_r.hasPie=function(t){return t=t[0],t._private.hasPie};_r.hasStripe=function(t){return t=t[0],t._private.hasStripe};_r.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)}};_r.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 Pt={},jS=100;Pt.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};Pt.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};Pt.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=Kr(l,h),c=Kr(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};Pt.gradientFillStyle=function(t,e,r,a){var n=this.createGradientStyleFor(t,"background",e,r,a);if(!n)return null;t.fillStyle=n};Pt.colorFillStyle=function(t,e,r,a,n){t.fillStyle="rgba("+e+","+r+","+a+","+n+")"};Pt.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)}};Pt.gradientStrokeStyle=function(t,e,r,a){var n=this.createGradientStyleFor(t,"line",e,r,a);if(!n)return null;t.strokeStyle=n};Pt.colorStrokeStyle=function(t,e,r,a,n){t.strokeStyle="rgba("+e+","+r+","+a+","+n+")"};Pt.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)}};Pt.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}};Pt.renderTo=function(t,e,r,a){this.render({forcedContext:t,forcedZoom:e,forcedPan:r,drawAllLayers:!0,forcedPxRatio:a})};Pt.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])};Pt.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(Y,H,$,Q,ee){var te=Y.globalCompositeOperation;Y.globalCompositeOperation="destination-out",e.colorFillStyle(Y,255,255,255,e.motionBlurTransparency),Y.fillRect(H,$,Q,ee),Y.globalCompositeOperation=te}function D(Y,H){var $,Q,ee,te;!e.clearingMotionBlur&&(Y===l.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]||Y===l.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG])?($={x:T.x*c,y:T.y*c},Q=m*c,ee=e.canvasWidth*c,te=e.canvasHeight*c):($=L,Q=E,ee=e.canvasWidth,te=e.canvasHeight),Y.setTransform(1,0,0,1,0,0),H==="motionBlur"?S(Y,0,0,ee,te):!a&&(H===void 0||H)&&Y.clearRect(0,0,ee,te),n||(Y.translate($.x,$.y),Y.scale(Q,Q)),s&&Y.translate(s.x,s.y),o&&Y.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(),k=e.pinching||e.hoverData.dragging||e.swipePanning||e.data.wheelZooming||e.hoverData.draggingEles||e.cy.animated(),F=e.hideEdgesOnViewport&&k,_=[];if(_[e.NODE]=!f[e.NODE]&&v&&!e.clearedForMotionBlur[e.NODE]||e.clearingMotionBlur,_[e.NODE]&&(e.clearedForMotionBlur[e.NODE]=!0),_[e.DRAG]=!f[e.DRAG]&&v&&!e.clearedForMotionBlur[e.DRAG]||e.clearingMotionBlur,_[e.DRAG]&&(e.clearedForMotionBlur[e.DRAG]=!0),f[e.NODE]||n||i||_[e.NODE]){var z=v&&!_[e.NODE]&&c!==1,x=a||(z?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]:l.contexts[e.NODE]),X=v&&!z?"motionBlur":void 0;D(x,X),F?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||_[e.DRAG])){var z=v&&!_[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),F?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 q=l.contexts[e.NODE],G=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE],U=l.contexts[e.DRAG],K=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG],J=function(H,$,Q){H.setTransform(1,0,0,1,0,0),Q||!y?H.clearRect(0,0,e.canvasWidth,e.canvasHeight):S(H,0,0,e.canvasWidth,e.canvasHeight);var ee=c;H.drawImage($,0,0,e.canvasWidth*ee,e.canvasHeight*ee,0,0,e.canvasWidth,e.canvasHeight)};(f[e.NODE]||_[e.NODE])&&(J(q,G,_[e.NODE]),f[e.NODE]=!1),(f[e.DRAG]||_[e.DRAG])&&(J(U,K,_[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()},jS)),a||r.emit("render")};var Wa;Pt.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",!Wa){var y=f.measureText(p);Wa=y.actualBoundingBoxAscent}f.fillText(p,0,Wa);var b=60;f.strokeRect(0,Wa+10,250,20),f.fillRect(0,Wa+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 eD(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 tD(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 Zv(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 rD(t){var e=t.pixelRatio,r=t.cy.zoom();return r*e}function aD(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 nD(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 iD(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 zr(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 ca(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 oD(t){return t[0]+(t[1]<<8)+(t[2]<<16)+(t[3]<<24)}function sD(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 Kw(t,e,r){switch(e){case t.FLOAT:return new Float32Array(r);case t.INT:return new Int32Array(r)}}function uD(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 lD(t,e,r,a){var n=$w(t,e),i=ht(n,2),o=i[0],s=i[1],u=Kw(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 er(t,e,r,a){var n=$w(t,r),i=ht(n,3),o=i[0],s=i[1],u=i[2],l=Kw(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]=uD(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 fD(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 hD(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 Fs(){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 cD(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 ii(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 wv(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 vD(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 dD=(function(){function t(e,r,a,n){Ir(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 Pr(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=sD(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}}])})(),gD=(function(){function t(e,r,a,n){Ir(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 Pr(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 dD(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=Bt(this.atlases),u;try{var l=function(){var h=u.value,v=h.getKeys(),c=pD(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=Bt(v),g;try{for(d.s();!(g=d.n()).done;){var p=g.value;if(!c.has(p)){var y=h.getOffsets(p),b=ht(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=ht(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 pD(t,e){return t.intersection?t.intersection(e):new Set(vi(t).filter(function(r){return e.has(r)}))}var yD=(function(){function t(e,r){Ir(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 Pr(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 gD(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=_e({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=Bt(r),d;try{for(c.s();!(d=c.n()).done;){var g=d.value;if(u(g)){var p=Bt(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&&!iD(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=Bt(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=ht(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=Bt(this.collections),n;try{for(a.s();!(n=a.n()).done;){var i=ht(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}}])})(),mD=(function(){function t(e){Ir(this,t),this.globalOptions=e,this.atlasSize=e.webglTexSize,this.maxAtlasesPerBatch=e.webglTexPerBatch,this.batchAtlases=[]}return Pr(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}}])})(),bD=`
18
+ float circleSD(vec2 p, float r) {
19
+ return distance(vec2(0), p) - r; // signed distance
20
+ }
21
+ `,ED=`
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
+ `,wD=`
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
+ `,TD=`
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
+ `,nn={SCREEN:{name:"screen",screen:!0},PICKING:{name:"picking",picking:!0}},Ai={IGNORE:1,USE_BB:2},_s=0,kp=1,qp=2,Bs=3,va=4,$n=5,$a=6,Ka=7,xD=(function(){function t(e,r,a){Ir(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=tD,this.atlasManager=new yD(e,a),this.batchManager=new mD(a),this.simpleShapeOptions=new Map,this.program=this._createShaderProgram(nn.SCREEN),this.pickingProgram=this._createShaderProgram(nn.PICKING),this.vao=this._createVAO()}return Pr(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(_s,`) {
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(va," || aVertType == ").concat(Ka,`
119
+ || aVertType == `).concat($n," || aVertType == ").concat($a,`) { // 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(Bs,` && 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(bD,`
244
+ `).concat(ED,`
245
+ `).concat(wD,`
246
+ `).concat(TD,`
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(_s,`) {
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(Bs,`) {
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(va,` && 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(va," || vVertType == ").concat(Ka,`
276
+ || vVertType == `).concat($n," || vVertType == ").concat($a,`) { // 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(va,`) {
288
+ d = rectangleSD(p, b);
289
+ } else if(vVertType == `).concat(Ka,` && w == h) {
290
+ d = circleSD(p, b.x); // faster than ellipse
291
+ } else if(vVertType == `).concat(Ka,`) {
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=eD(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),lD(n,"vec2",i.aPosition,r),this.transformBuffer=fD(n,a,i.aTransform),this.indexBuffer=er(n,a,"vec4",i.aIndex),this.vertTypeBuffer=er(n,a,"int",i.aVertType),this.atlasIdBuffer=er(n,a,"int",i.aAtlasId),this.texBuffer=er(n,a,"vec4",i.aTex),this.pointAPointBBuffer=er(n,a,"vec4",i.aPointAPointB),this.pointCPointDBuffer=er(n,a,"vec4",i.aPointCPointD),this.lineWidthBuffer=er(n,a,"vec2",i.aLineWidth),this.colorBuffer=er(n,a,"vec4",i.aColor),this.cornerRadiusBuffer=er(n,a,"vec4",i.aCornerRadius),this.borderColorBuffer=er(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 Tr(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]:nn.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===Ai.IGNORE)return;if(u==Ai.USE_BB){this.drawPickingRectangle(r,a,n);return}}var l=i.getAtlasInfo(r,n),f=Bt(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=ht(b[y],2),E=m[0],T=m[1];if(E.w!=0){var L=this.instanceCount;this.vertTypeBuffer.getView(L)[0]=_s;var w=this.indexBuffer.getView(L);ca(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;ii(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;ii(r,r,[o,s]),wv(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]=va;var s=this.indexBuffer.getView(o);ca(a,s);var u=this.colorBuffer.getView(o);zr([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===$a){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===$a&&(h[0]=0,h[2]=0)}var v=this.indexBuffer.getView(u);ca(a,v);var c=this.renderTarget.picking?1:n==="node-body"?r.effectiveOpacity():1,d=this.renderTarget.picking?1:r.pstyle(o.opacity).value*c,g=r.pstyle(o.color).value,p=this.colorBuffer.getView(u);zr(g,d,p);var y=this.lineWidthBuffer.getView(u);if(y[0]=0,y[1]=0,o.border){var b=r.pstyle("border-width").value;if(b>0){var m=r.pstyle("border-color").value,E=c*r.pstyle("border-opacity").value,T=this.borderColorBuffer.getView(u);zr(m,E,T);var L=r.pstyle("border-position").value;if(L==="inside")y[0]=0,y[1]=-b;else if(L==="outside")y[0]=b,y[1]=0;else{var w=b/2;y[0]=w,y[1]=-w}}}var C=this.transformBuffer.getMatrixView(u);this.setTransformMatrix(r,C,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 va;case"ellipse":return Ka;case"roundrectangle":case"round-rectangle":return $n;case"bottom-round-rectangle":return $a;default:return}}},{key:"_getCornerRadius",value:function(r,a,n){var i=n.w,o=n.h;if(r.pstyle(a).value==="auto")return Dr(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),ii(b,b,[o,s]),wv(b,b,[p,p]),Bp(b,b,u),this.vertTypeBuffer.getView(y)[0]=Bs;var m=this.indexBuffer.getView(y);ca(a,m);var E=this.colorBuffer.getView(y);zr(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);ca(a,h);var v=this.colorBuffer.getView(f);zr(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);ca(a,y);var b=this.colorBuffer.getView(p);zr(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=Bt(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,rD(this.r)),r.uniformMatrix3fv(o.uPanZoomMatrix,!1,this.panZoomMatrix),r.uniform1i(o.uAtlasSize,this.batchManager.getAtlasSize());var c=zr(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}}}])})(),Zw={};Zw.initWebgl=function(t,e){var r=this,a=r.data.contexts[r.WEBGL];t.bgColor=CD(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=hD(a),r.pickingFrameBuffer.needsDraw=!0,r.drawing=new xD(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?Ai.USE_BB:Ai.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:nD,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:ks(e.getLabelKey,null),getBoundingBox:qs(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:ks(e.getSourceLabelKey,"source"),getBoundingBox:qs(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:ks(e.getTargetLabelKey,"target"),getBoundingBox:qs(e.getTargetLabelBox,"target"),drawClipped:!0,drawElement:e.drawTargetLabel,getRotation:n("target"),getRotationPoint:e.getTargetLabelRotationPoint,getRotationOffset:e.getTargetLabelRotationOffset,isVisible:i("target-label")});var l=wn(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()}),AD(r)};function CD(t){var e=t.cy.container(),r=e&&e.style&&e.style.backgroundColor||"white";return xE(r)}function Qw(t,e){var r=t._private.rscratch;return Ot(r,"labelWrapCachedLines",e)||[]}var ks=function(e,r){return function(a){var n=e(a),i=Qw(a,r);return i.length>1?i.map(function(o,s){return"".concat(n,"_").concat(s)}):n}},qs=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=Qw(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 AD(t){{var e=t.render;t.render=function(i){i=i||{};var o=t.cy;t.webgl&&(o.zoom()>Vw?(LD(t),e.call(t,i)):(RD(t),jw(t,i,nn.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 ID(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 LD(t){var e=t.data.contexts[t.WEBGL];e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT)}function RD(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 SD(t){var e=t.canvasWidth,r=t.canvasHeight,a=Zv(t),n=a.pan,i=a.zoom,o=Fs();ii(o,o,[n.x,n.y]),wv(o,o,[i,i]);var s=Fs();vD(s,e,r);var u=Fs();return cD(u,s,o),u}function Jw(t,e){var r=t.canvasWidth,a=t.canvasHeight,n=Zv(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 DD(t,e){t.drawSelectionRectangle(e,function(r){return Jw(t,r)})}function ND(t){var e=t.data.contexts[t.NODE];e.save(),Jw(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 MD(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 OD(t,e,r,a,n){var i,o,s,u,l=Zv(t),f=l.pan,h=l.zoom;{var v=aD(t,f,h,e,r),c=ht(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,nn.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=oD(L)-1;w>=0&&E.add(w)}return E}function ID(t,e,r){var a=OD(t,e,r),n=t.getCachedZSortedEles(),i,o,s=Bt(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 Gs(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]&&DD(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=SD(t),u=t.getCachedZSortedEles();if(i=u.length,n.startFrame(s,r),r.screen){for(var l=0;l<u.nondrag.length;l++)Gs(t,l,u.nondrag[l]);for(var f=0;f<u.drag.length;f++)Gs(t,f,u.drag[f])}else if(r.picking)for(var h=0;h<u.length;h++)Gs(t,h,u[h]);n.endFrame(),r.screen&&t.webglDebugShowAtlases&&(ND(t),MD(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=Bt(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 Br={};Br.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()};Br.drawRoundPolygonPath=function(t,e,r,a,n,i,o){o.forEach(function(s){return Iw(t,s)}),t.closePath()};Br.drawRoundRectanglePath=function(t,e,r,a,n,i){var o=a/2,s=n/2,u=i==="auto"?Dr(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()};Br.drawBottomRoundRectanglePath=function(t,e,r,a,n,i){var o=a/2,s=n/2,u=i==="auto"?Dr(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()};Br.drawCutRectanglePath=function(t,e,r,a,n,i,o){var s=a/2,u=n/2,l=o==="auto"?_v():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()};Br.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=sv(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),Tv={},xv={},eT=Math.PI/40;for(var da=0*Math.PI;da<2*Math.PI;da+=eT)Tv[da]=Math.sin(da),xv[da]=Math.cos(da);Br.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+=eT)i=e-s*Tv[l]*Gp+s*xv[l]*Up,o=r+u*xv[l]*Gp+u*Tv[l]*Up,l===0?t.moveTo(i,o):t.lineTo(i,o);t.closePath()};var Rn={};Rn.createBuffer=function(t,e){var r=document.createElement("canvas");return r.width=t,r.height=e,[r,r.getContext("2d")]};Rn.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=we(t.maxWidth)||we(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;we(t.maxWidth)&&(f=l*t.maxWidth/i),we(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 PD(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 tT(t,e,r){var a=function(){return e.toDataURL(r,t.quality)};switch(t.output){case"blob-promise":return new Na(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 PD(zp(a()),r);case"base64":return zp(a());case"base64uri":default:return a()}}Rn.png=function(t){return tT(t,this.bufferCanvasImage(t),"image/png")};Rn.jpg=function(t){return tT(t,this.bufferCanvasImage(t),"image/jpeg")};var rT={};rT.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 FD=aT,Ge=aT.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 aT(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"};Lx()&&(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]||nt("Could not create canvas of type "+h),Object.keys(u).forEach(function(Y){f.style[Y]=u[Y]}),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=It(),c=function(H){return{x:(H.x1+H.x2)/2,y:(H.y1+H.y2)/2}},d=function(H){return{x:-H.w/2,y:-H.h/2}},g=function(H){var $=H[0]._private,Q=$.oldBackgroundTimestamp===$.backgroundTimestamp;return!Q},p=function(H){return H[0]._private.nodeKey},y=function(H){return H[0]._private.labelStyleKey},b=function(H){return H[0]._private.sourceLabelStyleKey},m=function(H){return H[0]._private.targetLabelStyleKey},E=function(H,$,Q,ee,te){return e.drawElement(H,$,Q,!1,!1,te)},T=function(H,$,Q,ee,te){return e.drawElementText(H,$,Q,ee,"main",te)},L=function(H,$,Q,ee,te){return e.drawElementText(H,$,Q,ee,"source",te)},w=function(H,$,Q,ee,te){return e.drawElementText(H,$,Q,ee,"target",te)},C=function(H){return H.boundingBox(),H[0]._private.bodyBounds},A=function(H){return H.boundingBox(),H[0]._private.labelBounds.main||v},R=function(H){return H.boundingBox(),H[0]._private.labelBounds.source||v},S=function(H){return H.boundingBox(),H[0]._private.labelBounds.target||v},D=function(H,$){return $},P=function(H){return c(C(H))},x=function(H,$,Q){var ee=H?H+"-":"";return{x:$.x+Q.pstyle(ee+"text-margin-x").pfValue,y:$.y+Q.pstyle(ee+"text-margin-y").pfValue}},N=function(H,$,Q){var ee=H[0]._private.rscratch;return{x:ee[$],y:ee[Q]}},M=function(H){return x("",N(H,"labelX","labelY"),H)},I=function(H){return x("source",N(H,"sourceLabelX","sourceLabelY"),H)},O=function(H){return x("target",N(H,"targetLabelX","targetLabelY"),H)},k=function(H){return d(C(H))},F=function(H){return d(R(H))},_=function(H){return d(S(H))},z=function(H){var $=A(H),Q=d(A(H));if(H.isNode()){switch(La(H.pstyle("text-halign").value)){case"left":Q.x=-$.w-($.leftPad||0);break;case"right":Q.x=-($.rightPad||0);break}switch(Ra(H.pstyle("text-valign").value)){case"top":Q.y=-$.h-($.topPad||0);break;case"bottom":Q.y=-($.botPad||0);break}}return Q},X=e.data.eleTxrCache=new Ja(e,{getKey:p,doesEleInvalidateKey:g,drawElement:E,getBoundingBox:C,getRotationPoint:P,getRotationOffset:k,allowEdgeTxrCaching:!1,allowParentTxrCaching:!1}),q=e.data.lblTxrCache=new Ja(e,{getKey:y,drawElement:T,getBoundingBox:A,getRotationPoint:M,getRotationOffset:z,isVisible:D}),G=e.data.slbTxrCache=new Ja(e,{getKey:b,drawElement:L,getBoundingBox:R,getRotationPoint:I,getRotationOffset:F,isVisible:D}),U=e.data.tlbTxrCache=new Ja(e,{getKey:m,drawElement:w,getBoundingBox:S,getRotationPoint:O,getRotationOffset:_,isVisible:D}),K=e.data.lyrTxrCache=new Yw(e);e.onUpdateEleCalcs(function(H,$){X.invalidateElements($),q.invalidateElements($),G.invalidateElements($),U.invalidateElements($),K.invalidateElements($);for(var Q=0;Q<$.length;Q++){var ee=$[Q]._private;ee.oldBackgroundTimestamp=ee.backgroundTimestamp}});var J=function(H){for(var $=0;$<H.length;$++)K.enqueueElementRefinement(H[$].ele)};X.onDequeue(J),q.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:k,getLabelRotationPoint:M,getSourceLabelRotationPoint:I,getTargetLabelRotationPoint:O,getLabelRotationOffset:z,getSourceLabelRotationOffset:F,getTargetLabelRotationOffset:_})}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 _D=typeof Path2D<"u";Ge.path2dEnabled=function(t){if(t===void 0)return this.pathsEnabled;this.pathsEnabled=!!t};Ge.usePaths=function(){return _D&&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":pt(OffscreenCanvas))!=="undefined")r=new OffscreenCanvas(t,e);else{var a=this.cy.window(),n=a.document;r=n.createElement("canvas"),r.width=t,r.height=e}return r};[Hw,or,dr,Kv,ea,_r,Pt,Zw,Br,Rn,rT].forEach(function(t){_e(Ge,t)});var BD=[{name:"null",impl:Nw},{name:"base",impl:Uw},{name:"canvas",impl:FD}],kD=[{type:"layout",extensions:sS},{type:"renderer",extensions:BD}],nT={},iT={};function oT(t,e,r){var a=r,n=function(C){Ke("Can not register `"+e+"` for `"+t+"` since `"+C+"` already exists in the prototype and can not be overridden")};if(t==="core"){if(dn.prototype[e])return n(e);dn.prototype[e]=r}else if(t==="collection"){if(Ct.prototype[e])return n(e);Ct.prototype[e]=r}else if(t==="layout"){for(var i=function(C){this.options=C,r.call(this,C),He(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)}};_e(o,{createEmitter:function(){return this._private.emitter=new ki(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}}),$e.eventAliasesOn(o),a=i}else if(t==="renderer"&&e!=="null"&&e!=="base"){var c=sT("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(){nt("Renderer does not implement `renderer."+w+"()` on its prototype")}}),a=y}else if(t==="__proto__"||t==="constructor"||t==="prototype")return nt(t+" is an illegal type to be registered, possibly lead to prototype pollutions");return CE({map:nT,keys:[t,e],value:a})}function sT(t,e){return AE({map:nT,keys:[t,e]})}function qD(t,e,r,a,n){return CE({map:iT,keys:[t,e,r,a],value:n})}function GD(t,e,r,a){return AE({map:iT,keys:[t,e,r,a]})}var Cv=function(){if(arguments.length===2)return sT.apply(null,arguments);if(arguments.length===3)return oT.apply(null,arguments);if(arguments.length===4)return GD.apply(null,arguments);if(arguments.length===5)return qD.apply(null,arguments);nt("Invalid extension access syntax")};dn.prototype.extension=Cv;kD.forEach(function(t){t.extensions.forEach(function(e){oT(t.type,e.name,e.impl)})});var Li=function(){if(!(this instanceof Li))return new Li;this.length=0},Jr=Li.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(Oe(t))this[r].properties.push({name:t,value:e});else if(He(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=wt.properties[o]||wt.properties[Si(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 wt(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 UD="3.34.0",Sa=function(e){if(e===void 0&&(e={}),He(e))return new dn(e);if(Oe(e))return Cv.apply(Cv,arguments)};Sa.use=function(t){var e=Array.prototype.slice.call(arguments,1);return e.unshift(Sa),t.apply(null,e),this};Sa.warnings=function(t){return OE(t)};Sa.version=UD;Sa.stylesheet=Sa.Stylesheet=Li;var oi={exports:{}};function Qv(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 Us,Vp;function zD(){if(Vp)return Us;Vp=1;function t(){this.__data__=[],this.size=0}return Us=t,Us}var zs,Yp;function Fa(){if(Yp)return zs;Yp=1;function t(e,r){return e===r||e!==e&&r!==r}return zs=t,zs}var Vs,Hp;function Xi(){if(Hp)return Vs;Hp=1;var t=Fa();function e(r,a){for(var n=r.length;n--;)if(t(r[n][0],a))return n;return-1}return Vs=e,Vs}var Ys,Xp;function VD(){if(Xp)return Ys;Xp=1;var t=Xi(),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 Ys=a,Ys}var Hs,Wp;function YD(){if(Wp)return Hs;Wp=1;var t=Xi();function e(r){var a=this.__data__,n=t(a,r);return n<0?void 0:a[n][1]}return Hs=e,Hs}var Xs,$p;function HD(){if($p)return Xs;$p=1;var t=Xi();function e(r){return t(this.__data__,r)>-1}return Xs=e,Xs}var Ws,Kp;function XD(){if(Kp)return Ws;Kp=1;var t=Xi();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 Ws=e,Ws}var $s,Zp;function Wi(){if(Zp)return $s;Zp=1;var t=zD(),e=VD(),r=YD(),a=HD(),n=XD();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 Ks,Qp;function WD(){if(Qp)return Ks;Qp=1;var t=Wi();function e(){this.__data__=new t,this.size=0}return Ks=e,Ks}var Zs,Jp;function $D(){if(Jp)return Zs;Jp=1;function t(e){var r=this.__data__,a=r.delete(e);return this.size=r.size,a}return Zs=t,Zs}var Qs,jp;function KD(){if(jp)return Qs;jp=1;function t(e){return this.__data__.get(e)}return Qs=t,Qs}var Js,ey;function ZD(){if(ey)return Js;ey=1;function t(e){return this.__data__.has(e)}return Js=t,Js}var js,ty;function uT(){if(ty)return js;ty=1;var t=typeof Fn=="object"&&Fn&&Fn.Object===Object&&Fn;return js=t,js}var eu,ry;function Jt(){if(ry)return eu;ry=1;var t=uT(),e=typeof self=="object"&&self&&self.Object===Object&&self,r=t||e||Function("return this")();return eu=r,eu}var tu,ay;function _a(){if(ay)return tu;ay=1;var t=Jt(),e=t.Symbol;return tu=e,tu}var ru,ny;function QD(){if(ny)return ru;ny=1;var t=_a(),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 ru=i,ru}var au,iy;function JD(){if(iy)return au;iy=1;var t=Object.prototype,e=t.toString;function r(a){return e.call(a)}return au=r,au}var nu,oy;function ta(){if(oy)return nu;oy=1;var t=_a(),e=QD(),r=JD(),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 nu=o,nu}var iu,sy;function Yt(){if(sy)return iu;sy=1;function t(e){var r=typeof e;return e!=null&&(r=="object"||r=="function")}return iu=t,iu}var ou,uy;function Sn(){if(uy)return ou;uy=1;var t=ta(),e=Yt(),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 ou=o,ou}var su,ly;function jD(){if(ly)return su;ly=1;var t=Jt(),e=t["__core-js_shared__"];return su=e,su}var uu,fy;function eN(){if(fy)return uu;fy=1;var t=jD(),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 uu=r,uu}var lu,hy;function lT(){if(hy)return lu;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 lu=r,lu}var fu,cy;function tN(){if(cy)return fu;cy=1;var t=Sn(),e=eN(),r=Yt(),a=lT(),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 fu=h,fu}var hu,vy;function rN(){if(vy)return hu;vy=1;function t(e,r){return e==null?void 0:e[r]}return hu=t,hu}var cu,dy;function ra(){if(dy)return cu;dy=1;var t=tN(),e=rN();function r(a,n){var i=e(a,n);return t(i)?i:void 0}return cu=r,cu}var vu,gy;function Jv(){if(gy)return vu;gy=1;var t=ra(),e=Jt(),r=t(e,"Map");return vu=r,vu}var du,py;function $i(){if(py)return du;py=1;var t=ra(),e=t(Object,"create");return du=e,du}var gu,yy;function aN(){if(yy)return gu;yy=1;var t=$i();function e(){this.__data__=t?t(null):{},this.size=0}return gu=e,gu}var pu,my;function nN(){if(my)return pu;my=1;function t(e){var r=this.has(e)&&delete this.__data__[e];return this.size-=r?1:0,r}return pu=t,pu}var yu,by;function iN(){if(by)return yu;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 yu=n,yu}var mu,Ey;function oN(){if(Ey)return mu;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 mu=a,mu}var bu,wy;function sN(){if(wy)return bu;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 bu=r,bu}var Eu,Ty;function uN(){if(Ty)return Eu;Ty=1;var t=aN(),e=nN(),r=iN(),a=oN(),n=sN();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,Eu=i,Eu}var wu,xy;function lN(){if(xy)return wu;xy=1;var t=uN(),e=Wi(),r=Jv();function a(){this.size=0,this.__data__={hash:new t,map:new(r||e),string:new t}}return wu=a,wu}var Tu,Cy;function fN(){if(Cy)return Tu;Cy=1;function t(e){var r=typeof e;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?e!=="__proto__":e===null}return Tu=t,Tu}var xu,Ay;function Ki(){if(Ay)return xu;Ay=1;var t=fN();function e(r,a){var n=r.__data__;return t(a)?n[typeof a=="string"?"string":"hash"]:n.map}return xu=e,xu}var Cu,Ly;function hN(){if(Ly)return Cu;Ly=1;var t=Ki();function e(r){var a=t(this,r).delete(r);return this.size-=a?1:0,a}return Cu=e,Cu}var Au,Ry;function cN(){if(Ry)return Au;Ry=1;var t=Ki();function e(r){return t(this,r).get(r)}return Au=e,Au}var Lu,Sy;function vN(){if(Sy)return Lu;Sy=1;var t=Ki();function e(r){return t(this,r).has(r)}return Lu=e,Lu}var Ru,Dy;function dN(){if(Dy)return Ru;Dy=1;var t=Ki();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 Ru=e,Ru}var Su,Ny;function jv(){if(Ny)return Su;Ny=1;var t=lN(),e=hN(),r=cN(),a=vN(),n=dN();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,Su=i,Su}var Du,My;function gN(){if(My)return Du;My=1;var t=Wi(),e=Jv(),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 Du=n,Du}var Nu,Oy;function Zi(){if(Oy)return Nu;Oy=1;var t=Wi(),e=WD(),r=$D(),a=KD(),n=ZD(),i=gN();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,Nu=o,Nu}var Mu,Iy;function ed(){if(Iy)return Mu;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 Mu=t,Mu}var Ou,Py;function fT(){if(Py)return Ou;Py=1;var t=ra(),e=(function(){try{var r=t(Object,"defineProperty");return r({},"",{}),r}catch{}})();return Ou=e,Ou}var Iu,Fy;function Qi(){if(Fy)return Iu;Fy=1;var t=fT();function e(r,a,n){a=="__proto__"&&t?t(r,a,{configurable:!0,enumerable:!0,value:n,writable:!0}):r[a]=n}return Iu=e,Iu}var Pu,_y;function Ji(){if(_y)return Pu;_y=1;var t=Qi(),e=Fa(),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 Pu=n,Pu}var Fu,By;function Dn(){if(By)return Fu;By=1;var t=Ji(),e=Qi();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 Fu=r,Fu}var _u,ky;function pN(){if(ky)return _u;ky=1;function t(e,r){for(var a=-1,n=Array(e);++a<e;)n[a]=r(a);return n}return _u=t,_u}var Bu,qy;function sr(){if(qy)return Bu;qy=1;function t(e){return e!=null&&typeof e=="object"}return Bu=t,Bu}var ku,Gy;function yN(){if(Gy)return ku;Gy=1;var t=ta(),e=sr(),r="[object Arguments]";function a(n){return e(n)&&t(n)==r}return ku=a,ku}var qu,Uy;function Nn(){if(Uy)return qu;Uy=1;var t=yN(),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 qu=i,qu}var Gu,zy;function ct(){if(zy)return Gu;zy=1;var t=Array.isArray;return Gu=t,Gu}var ja={exports:{}},Uu,Vy;function mN(){if(Vy)return Uu;Vy=1;function t(){return!1}return Uu=t,Uu}ja.exports;var Yy;function Ba(){return Yy||(Yy=1,(function(t,e){var r=Jt(),a=mN(),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})(ja,ja.exports)),ja.exports}var zu,Hy;function ji(){if(Hy)return zu;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 zu=r,zu}var Vu,Xy;function td(){if(Xy)return Vu;Xy=1;var t=9007199254740991;function e(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=t}return Vu=e,Vu}var Yu,Wy;function bN(){if(Wy)return Yu;Wy=1;var t=ta(),e=td(),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 Yu=D,Yu}var Hu,$y;function eo(){if($y)return Hu;$y=1;function t(e){return function(r){return e(r)}}return Hu=t,Hu}var en={exports:{}};en.exports;var Ky;function rd(){return Ky||(Ky=1,(function(t,e){var r=uT(),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})(en,en.exports)),en.exports}var Xu,Zy;function Mn(){if(Zy)return Xu;Zy=1;var t=bN(),e=eo(),r=rd(),a=r&&r.isTypedArray,n=a?e(a):t;return Xu=n,Xu}var Wu,Qy;function hT(){if(Qy)return Wu;Qy=1;var t=pN(),e=Nn(),r=ct(),a=Ba(),n=ji(),i=Mn(),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 Wu=u,Wu}var $u,Jy;function to(){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 Ku,jy;function cT(){if(jy)return Ku;jy=1;function t(e,r){return function(a){return e(r(a))}}return Ku=t,Ku}var Zu,em;function EN(){if(em)return Zu;em=1;var t=cT(),e=t(Object.keys,Object);return Zu=e,Zu}var Qu,tm;function ad(){if(tm)return Qu;tm=1;var t=to(),e=EN(),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 Qu=n,Qu}var Ju,rm;function gr(){if(rm)return Ju;rm=1;var t=Sn(),e=td();function r(a){return a!=null&&e(a.length)&&!t(a)}return Ju=r,Ju}var ju,am;function kr(){if(am)return ju;am=1;var t=hT(),e=ad(),r=gr();function a(n){return r(n)?t(n):e(n)}return ju=a,ju}var el,nm;function wN(){if(nm)return el;nm=1;var t=Dn(),e=kr();function r(a,n){return a&&t(n,e(n),a)}return el=r,el}var tl,im;function TN(){if(im)return tl;im=1;function t(e){var r=[];if(e!=null)for(var a in Object(e))r.push(a);return r}return tl=t,tl}var rl,om;function xN(){if(om)return rl;om=1;var t=Yt(),e=to(),r=TN(),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 rl=i,rl}var al,sm;function aa(){if(sm)return al;sm=1;var t=hT(),e=xN(),r=gr();function a(n){return r(n)?t(n,!0):e(n)}return al=a,al}var nl,um;function CN(){if(um)return nl;um=1;var t=Dn(),e=aa();function r(a,n){return a&&t(n,e(n),a)}return nl=r,nl}var tn={exports:{}};tn.exports;var lm;function vT(){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})(tn,tn.exports)),tn.exports}var il,fm;function dT(){if(fm)return il;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 il=t,il}var ol,hm;function gT(){if(hm)return ol;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 ol=t,ol}var sl,cm;function pT(){if(cm)return sl;cm=1;function t(){return[]}return sl=t,sl}var ul,vm;function nd(){if(vm)return ul;vm=1;var t=gT(),e=pT(),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 ul=i,ul}var ll,dm;function AN(){if(dm)return ll;dm=1;var t=Dn(),e=nd();function r(a,n){return t(a,e(a),n)}return ll=r,ll}var fl,gm;function id(){if(gm)return fl;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 fl=t,fl}var hl,pm;function ro(){if(pm)return hl;pm=1;var t=cT(),e=t(Object.getPrototypeOf,Object);return hl=e,hl}var cl,ym;function yT(){if(ym)return cl;ym=1;var t=id(),e=ro(),r=nd(),a=pT(),n=Object.getOwnPropertySymbols,i=n?function(o){for(var s=[];o;)t(s,r(o)),o=e(o);return s}:a;return cl=i,cl}var vl,mm;function LN(){if(mm)return vl;mm=1;var t=Dn(),e=yT();function r(a,n){return t(a,e(a),n)}return vl=r,vl}var dl,bm;function mT(){if(bm)return dl;bm=1;var t=id(),e=ct();function r(a,n,i){var o=n(a);return e(a)?o:t(o,i(a))}return dl=r,dl}var gl,Em;function bT(){if(Em)return gl;Em=1;var t=mT(),e=nd(),r=kr();function a(n){return t(n,r,e)}return gl=a,gl}var pl,wm;function RN(){if(wm)return pl;wm=1;var t=mT(),e=yT(),r=aa();function a(n){return t(n,r,e)}return pl=a,pl}var yl,Tm;function SN(){if(Tm)return yl;Tm=1;var t=ra(),e=Jt(),r=t(e,"DataView");return yl=r,yl}var ml,xm;function DN(){if(xm)return ml;xm=1;var t=ra(),e=Jt(),r=t(e,"Promise");return ml=r,ml}var bl,Cm;function ET(){if(Cm)return bl;Cm=1;var t=ra(),e=Jt(),r=t(e,"Set");return bl=r,bl}var El,Am;function NN(){if(Am)return El;Am=1;var t=ra(),e=Jt(),r=t(e,"WeakMap");return El=r,El}var wl,Lm;function ka(){if(Lm)return wl;Lm=1;var t=SN(),e=Jv(),r=DN(),a=ET(),n=NN(),i=ta(),o=lT(),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}),wl=b,wl}var Tl,Rm;function MN(){if(Rm)return Tl;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 Tl=r,Tl}var xl,Sm;function wT(){if(Sm)return xl;Sm=1;var t=Jt(),e=t.Uint8Array;return xl=e,xl}var Cl,Dm;function od(){if(Dm)return Cl;Dm=1;var t=wT();function e(r){var a=new r.constructor(r.byteLength);return new t(a).set(new t(r)),a}return Cl=e,Cl}var Al,Nm;function ON(){if(Nm)return Al;Nm=1;var t=od();function e(r,a){var n=a?t(r.buffer):r.buffer;return new r.constructor(n,r.byteOffset,r.byteLength)}return Al=e,Al}var Ll,Mm;function IN(){if(Mm)return Ll;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 Ll=e,Ll}var Rl,Om;function PN(){if(Om)return Rl;Om=1;var t=_a(),e=t?t.prototype:void 0,r=e?e.valueOf:void 0;function a(n){return r?Object(r.call(n)):{}}return Rl=a,Rl}var Sl,Im;function TT(){if(Im)return Sl;Im=1;var t=od();function e(r,a){var n=a?t(r.buffer):r.buffer;return new r.constructor(n,r.byteOffset,r.length)}return Sl=e,Sl}var Dl,Pm;function FN(){if(Pm)return Dl;Pm=1;var t=od(),e=ON(),r=IN(),a=PN(),n=TT(),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 Dl=C,Dl}var Nl,Fm;function xT(){if(Fm)return Nl;Fm=1;var t=Yt(),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 Nl=r,Nl}var Ml,_m;function CT(){if(_m)return Ml;_m=1;var t=xT(),e=ro(),r=to();function a(n){return typeof n.constructor=="function"&&!r(n)?t(e(n)):{}}return Ml=a,Ml}var Ol,Bm;function _N(){if(Bm)return Ol;Bm=1;var t=ka(),e=sr(),r="[object Map]";function a(n){return e(n)&&t(n)==r}return Ol=a,Ol}var Il,km;function BN(){if(km)return Il;km=1;var t=_N(),e=eo(),r=rd(),a=r&&r.isMap,n=a?e(a):t;return Il=n,Il}var Pl,qm;function kN(){if(qm)return Pl;qm=1;var t=ka(),e=sr(),r="[object Set]";function a(n){return e(n)&&t(n)==r}return Pl=a,Pl}var Fl,Gm;function qN(){if(Gm)return Fl;Gm=1;var t=kN(),e=eo(),r=rd(),a=r&&r.isSet,n=a?e(a):t;return Fl=n,Fl}var _l,Um;function AT(){if(Um)return _l;Um=1;var t=Zi(),e=ed(),r=Ji(),a=wN(),n=CN(),i=vT(),o=dT(),s=AN(),u=LN(),l=bT(),f=RN(),h=ka(),v=MN(),c=FN(),d=CT(),g=ct(),p=Ba(),y=BN(),b=Yt(),m=qN(),E=kr(),T=aa(),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]",k="[object RegExp]",F="[object Set]",_="[object String]",z="[object Symbol]",X="[object WeakMap]",q="[object ArrayBuffer]",G="[object DataView]",U="[object Float32Array]",K="[object Float64Array]",J="[object Int8Array]",Y="[object Int16Array]",H="[object Int32Array]",$="[object Uint8Array]",Q="[object Uint8ClampedArray]",ee="[object Uint16Array]",te="[object Uint32Array]",le={};le[A]=le[R]=le[q]=le[G]=le[S]=le[D]=le[U]=le[K]=le[J]=le[Y]=le[H]=le[M]=le[I]=le[O]=le[k]=le[F]=le[_]=le[z]=le[$]=le[Q]=le[ee]=le[te]=!0,le[P]=le[x]=le[X]=!1;function Ee(fe,se,ve,ce,ye,ge){var de,be=se&L,Re=se&w,Pe=se&C;if(ve&&(de=ye?ve(fe,ce,ye,ge):ve(fe)),de!==void 0)return de;if(!b(fe))return fe;var Be=g(fe);if(Be){if(de=v(fe),!be)return o(fe,de)}else{var Ne=h(fe),Me=Ne==x||Ne==N;if(p(fe))return i(fe,be);if(Ne==O||Ne==A||Me&&!ye){if(de=Re||Me?{}:d(fe),!be)return Re?u(fe,n(de,fe)):s(fe,a(de,fe))}else{if(!le[Ne])return ye?fe:{};de=c(fe,Ne,be)}}ge||(ge=new t);var ne=ge.get(fe);if(ne)return ne;ge.set(fe,de),m(fe)?fe.forEach(function(W){de.add(Ee(W,se,ve,W,fe,ge))}):y(fe)&&fe.forEach(function(W,Z){de.set(Z,Ee(W,se,ve,Z,fe,ge))});var B=Pe?Re?f:l:Re?T:E,V=Be?void 0:B(fe);return e(V||fe,function(W,Z){V&&(Z=W,W=fe[Z]),r(de,Z,Ee(W,se,ve,Z,fe,ge))}),de}return _l=Ee,_l}var Bl,zm;function GN(){if(zm)return Bl;zm=1;var t=AT(),e=4;function r(a){return t(a,e)}return Bl=r,Bl}var kl,Vm;function sd(){if(Vm)return kl;Vm=1;function t(e){return function(){return e}}return kl=t,kl}var ql,Ym;function UN(){if(Ym)return ql;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 ql=t,ql}var Gl,Hm;function ud(){if(Hm)return Gl;Hm=1;var t=UN(),e=t();return Gl=e,Gl}var Ul,Xm;function ld(){if(Xm)return Ul;Xm=1;var t=ud(),e=kr();function r(a,n){return a&&t(a,n,e)}return Ul=r,Ul}var zl,Wm;function zN(){if(Wm)return zl;Wm=1;var t=gr();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 zl=e,zl}var Vl,$m;function ao(){if($m)return Vl;$m=1;var t=ld(),e=zN(),r=e(t);return Vl=r,Vl}var Yl,Km;function na(){if(Km)return Yl;Km=1;function t(e){return e}return Yl=t,Yl}var Hl,Zm;function LT(){if(Zm)return Hl;Zm=1;var t=na();function e(r){return typeof r=="function"?r:t}return Hl=e,Hl}var Xl,Qm;function RT(){if(Qm)return Xl;Qm=1;var t=ed(),e=ao(),r=LT(),a=ct();function n(i,o){var s=a(i)?t:e;return s(i,r(o))}return Xl=n,Xl}var Wl,Jm;function ST(){return Jm||(Jm=1,Wl=RT()),Wl}var $l,jm;function VN(){if(jm)return $l;jm=1;var t=ao();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 Kl,e0;function YN(){if(e0)return Kl;e0=1;var t="__lodash_hash_undefined__";function e(r){return this.__data__.set(r,t),this}return Kl=e,Kl}var Zl,t0;function HN(){if(t0)return Zl;t0=1;function t(e){return this.__data__.has(e)}return Zl=t,Zl}var Ql,r0;function DT(){if(r0)return Ql;r0=1;var t=jv(),e=YN(),r=HN();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,Ql=a,Ql}var Jl,a0;function XN(){if(a0)return Jl;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 Jl=t,Jl}var jl,n0;function NT(){if(n0)return jl;n0=1;function t(e,r){return e.has(r)}return jl=t,jl}var ef,i0;function MT(){if(i0)return ef;i0=1;var t=DT(),e=XN(),r=NT(),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 ef=i,ef}var tf,o0;function WN(){if(o0)return tf;o0=1;function t(e){var r=-1,a=Array(e.size);return e.forEach(function(n,i){a[++r]=[i,n]}),a}return tf=t,tf}var rf,s0;function fd(){if(s0)return rf;s0=1;function t(e){var r=-1,a=Array(e.size);return e.forEach(function(n){a[++r]=n}),a}return rf=t,rf}var af,u0;function $N(){if(u0)return af;u0=1;var t=_a(),e=wT(),r=Fa(),a=MT(),n=WN(),i=fd(),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 af=T,af}var nf,l0;function KN(){if(l0)return nf;l0=1;var t=bT(),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 nf=n,nf}var of,f0;function ZN(){if(f0)return of;f0=1;var t=Zi(),e=MT(),r=$N(),a=KN(),n=ka(),i=ct(),o=Ba(),s=Mn(),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 of=d,of}var sf,h0;function OT(){if(h0)return sf;h0=1;var t=ZN(),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 sf=r,sf}var uf,c0;function QN(){if(c0)return uf;c0=1;var t=Zi(),e=OT(),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 uf=n,uf}var lf,v0;function IT(){if(v0)return lf;v0=1;var t=Yt();function e(r){return r===r&&!t(r)}return lf=e,lf}var ff,d0;function JN(){if(d0)return ff;d0=1;var t=IT(),e=kr();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 ff=r,ff}var hf,g0;function PT(){if(g0)return hf;g0=1;function t(e,r){return function(a){return a==null?!1:a[e]===r&&(r!==void 0||e in Object(a))}}return hf=t,hf}var cf,p0;function jN(){if(p0)return cf;p0=1;var t=QN(),e=JN(),r=PT();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 cf=a,cf}var vf,y0;function qa(){if(y0)return vf;y0=1;var t=ta(),e=sr(),r="[object Symbol]";function a(n){return typeof n=="symbol"||e(n)&&t(n)==r}return vf=a,vf}var df,m0;function hd(){if(m0)return df;m0=1;var t=ct(),e=qa(),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 df=n,df}var gf,b0;function eM(){if(b0)return gf;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,gf=r,gf}var pf,E0;function tM(){if(E0)return pf;E0=1;var t=eM(),e=500;function r(a){var n=t(a,function(o){return i.size===e&&i.clear(),o}),i=n.cache;return n}return pf=r,pf}var yf,w0;function rM(){if(w0)return yf;w0=1;var t=tM(),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 yf=a,yf}var mf,T0;function no(){if(T0)return mf;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 mf=t,mf}var bf,x0;function aM(){if(x0)return bf;x0=1;var t=_a(),e=no(),r=ct(),a=qa(),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 bf=o,bf}var Ef,C0;function FT(){if(C0)return Ef;C0=1;var t=aM();function e(r){return r==null?"":t(r)}return Ef=e,Ef}var wf,A0;function io(){if(A0)return wf;A0=1;var t=ct(),e=hd(),r=rM(),a=FT();function n(i,o){return t(i)?i:e(i,o)?[i]:r(a(i))}return wf=n,wf}var Tf,L0;function On(){if(L0)return Tf;L0=1;var t=qa();function e(r){if(typeof r=="string"||t(r))return r;var a=r+"";return a=="0"&&1/r==-1/0?"-0":a}return Tf=e,Tf}var xf,R0;function oo(){if(R0)return xf;R0=1;var t=io(),e=On();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 xf=r,xf}var Cf,S0;function nM(){if(S0)return Cf;S0=1;var t=oo();function e(r,a,n){var i=r==null?void 0:t(r,a);return i===void 0?n:i}return Cf=e,Cf}var Af,D0;function iM(){if(D0)return Af;D0=1;function t(e,r){return e!=null&&r in Object(e)}return Af=t,Af}var Lf,N0;function _T(){if(N0)return Lf;N0=1;var t=io(),e=Nn(),r=ct(),a=ji(),n=td(),i=On();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 Lf=o,Lf}var Rf,M0;function BT(){if(M0)return Rf;M0=1;var t=iM(),e=_T();function r(a,n){return a!=null&&e(a,n,t)}return Rf=r,Rf}var Sf,O0;function oM(){if(O0)return Sf;O0=1;var t=OT(),e=nM(),r=BT(),a=hd(),n=IT(),i=PT(),o=On(),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 Sf=l,Sf}var Df,I0;function kT(){if(I0)return Df;I0=1;function t(e){return function(r){return r==null?void 0:r[e]}}return Df=t,Df}var Nf,P0;function sM(){if(P0)return Nf;P0=1;var t=oo();function e(r){return function(a){return t(a,r)}}return Nf=e,Nf}var Mf,F0;function uM(){if(F0)return Mf;F0=1;var t=kT(),e=sM(),r=hd(),a=On();function n(i){return r(i)?t(a(i)):e(i)}return Mf=n,Mf}var Of,_0;function pr(){if(_0)return Of;_0=1;var t=jN(),e=oM(),r=na(),a=ct(),n=uM();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 Of=i,Of}var If,B0;function qT(){if(B0)return If;B0=1;var t=gT(),e=VN(),r=pr(),a=ct();function n(i,o){var s=a(i)?t:e;return s(i,r(o,3))}return If=n,If}var Pf,k0;function lM(){if(k0)return Pf;k0=1;var t=Object.prototype,e=t.hasOwnProperty;function r(a,n){return a!=null&&e.call(a,n)}return Pf=r,Pf}var Ff,q0;function GT(){if(q0)return Ff;q0=1;var t=lM(),e=_T();function r(a,n){return a!=null&&e(a,n,t)}return Ff=r,Ff}var _f,G0;function fM(){if(G0)return _f;G0=1;var t=ad(),e=ka(),r=Nn(),a=ct(),n=gr(),i=Ba(),o=to(),s=Mn(),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 _f=v,_f}var Bf,U0;function UT(){if(U0)return Bf;U0=1;function t(e){return e===void 0}return Bf=t,Bf}var kf,z0;function zT(){if(z0)return kf;z0=1;var t=ao(),e=gr();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 kf=r,kf}var qf,V0;function VT(){if(V0)return qf;V0=1;var t=no(),e=pr(),r=zT(),a=ct();function n(i,o){var s=a(i)?t:r;return s(i,e(o,3))}return qf=n,qf}var Gf,Y0;function hM(){if(Y0)return Gf;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 Gf=t,Gf}var Uf,H0;function cM(){if(H0)return Uf;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 Uf=t,Uf}var zf,X0;function YT(){if(X0)return zf;X0=1;var t=hM(),e=ao(),r=pr(),a=cM(),n=ct();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 zf=i,zf}var Vf,W0;function vM(){if(W0)return Vf;W0=1;var t=ta(),e=ct(),r=sr(),a="[object String]";function n(i){return typeof i=="string"||!e(i)&&r(i)&&t(i)==a}return Vf=n,Vf}var Yf,$0;function dM(){if($0)return Yf;$0=1;var t=kT(),e=t("length");return Yf=e,Yf}var Hf,K0;function gM(){if(K0)return Hf;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 Hf=u,Hf}var Xf,Z0;function pM(){if(Z0)return Xf;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 Xf=E,Xf}var Wf,Q0;function yM(){if(Q0)return Wf;Q0=1;var t=dM(),e=gM(),r=pM();function a(n){return e(n)?r(n):t(n)}return Wf=a,Wf}var $f,J0;function mM(){if(J0)return $f;J0=1;var t=ad(),e=ka(),r=gr(),a=vM(),n=yM(),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 Kf,j0;function bM(){if(j0)return Kf;j0=1;var t=ed(),e=xT(),r=ld(),a=pr(),n=ro(),i=ct(),o=Ba(),s=Sn(),u=Yt(),l=Mn();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 Kf=f,Kf}var Zf,eb;function EM(){if(eb)return Zf;eb=1;var t=_a(),e=Nn(),r=ct(),a=t?t.isConcatSpreadable:void 0;function n(i){return r(i)||e(i)||!!(a&&i&&i[a])}return Zf=n,Zf}var Qf,tb;function cd(){if(tb)return Qf;tb=1;var t=id(),e=EM();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 Qf=r,Qf}var Jf,rb;function wM(){if(rb)return Jf;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 Jf=t,Jf}var jf,ab;function HT(){if(ab)return jf;ab=1;var t=wM(),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 eh,nb;function TM(){if(nb)return eh;nb=1;var t=sd(),e=fT(),r=na(),a=e?function(n,i){return e(n,"toString",{configurable:!0,enumerable:!1,value:t(i),writable:!0})}:r;return eh=a,eh}var th,ib;function xM(){if(ib)return th;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 th=a,th}var rh,ob;function XT(){if(ob)return rh;ob=1;var t=TM(),e=xM(),r=e(t);return rh=r,rh}var ah,sb;function so(){if(sb)return ah;sb=1;var t=na(),e=HT(),r=XT();function a(n,i){return r(e(n,i,t),n+"")}return ah=a,ah}var nh,ub;function WT(){if(ub)return nh;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 nh=t,nh}var ih,lb;function CM(){if(lb)return ih;lb=1;function t(e){return e!==e}return ih=t,ih}var oh,fb;function AM(){if(fb)return oh;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 oh=t,oh}var sh,hb;function LM(){if(hb)return sh;hb=1;var t=WT(),e=CM(),r=AM();function a(n,i,o){return i===i?r(n,i,o):t(n,e,o)}return sh=a,sh}var uh,cb;function RM(){if(cb)return uh;cb=1;var t=LM();function e(r,a){var n=r==null?0:r.length;return!!n&&t(r,a,0)>-1}return uh=e,uh}var lh,vb;function SM(){if(vb)return lh;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 lh=t,lh}var fh,db;function DM(){if(db)return fh;db=1;function t(){}return fh=t,fh}var hh,gb;function NM(){if(gb)return hh;gb=1;var t=ET(),e=DM(),r=fd(),a=1/0,n=t&&1/r(new t([,-0]))[1]==a?function(i){return new t(i)}:e;return hh=n,hh}var ch,pb;function MM(){if(pb)return ch;pb=1;var t=DT(),e=RM(),r=SM(),a=NT(),n=NM(),i=fd(),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 ch=s,ch}var vh,yb;function $T(){if(yb)return vh;yb=1;var t=gr(),e=sr();function r(a){return e(a)&&t(a)}return vh=r,vh}var dh,mb;function OM(){if(mb)return dh;mb=1;var t=cd(),e=so(),r=MM(),a=$T(),n=e(function(i){return r(t(i,1,a,!0))});return dh=n,dh}var gh,bb;function IM(){if(bb)return gh;bb=1;var t=no();function e(r,a){return t(a,function(n){return r[n]})}return gh=e,gh}var ph,Eb;function KT(){if(Eb)return ph;Eb=1;var t=IM(),e=kr();function r(a){return a==null?[]:t(a,e(a))}return ph=r,ph}var yh,wb;function Ht(){if(wb)return yh;wb=1;var t;if(typeof Qv=="function")try{t={clone:GN(),constant:sd(),each:ST(),filter:qT(),has:GT(),isArray:ct(),isEmpty:fM(),isFunction:Sn(),isUndefined:UT(),keys:kr(),map:VT(),reduce:YT(),size:mM(),transform:bM(),union:OM(),values:KT()}}catch{}return t||(t=window._),yh=t,yh}var mh,Tb;function vd(){if(Tb)return mh;Tb=1;var t=Ht();mh=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 mh}var bh,xb;function PM(){return xb||(xb=1,bh="2.1.8"),bh}var Eh,Cb;function FM(){return Cb||(Cb=1,Eh={Graph:vd(),version:PM()}),Eh}var wh,Ab;function _M(){if(Ab)return wh;Ab=1;var t=Ht(),e=vd();wh={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 wh}var Th,Lb;function BM(){if(Lb)return Th;Lb=1;var t=Ht();Th=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 Th}var xh,Rb;function ZT(){if(Rb)return xh;Rb=1;var t=Ht();xh=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},xh}var Ch,Sb;function QT(){if(Sb)return Ch;Sb=1;var t=Ht(),e=ZT();Ch=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 Ch}var Ah,Db;function kM(){if(Db)return Ah;Db=1;var t=QT(),e=Ht();Ah=r;function r(a,n,i){return e.transform(a.nodes(),function(o,s){o[s]=t(a,s,n,i)},{})}return Ah}var Lh,Nb;function JT(){if(Nb)return Lh;Nb=1;var t=Ht();Lh=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 Lh}var Rh,Mb;function qM(){if(Mb)return Rh;Mb=1;var t=Ht(),e=JT();Rh=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 Rh}var Sh,Ob;function GM(){if(Ob)return Sh;Ob=1;var t=Ht();Sh=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 Sh}var Dh,Ib;function jT(){if(Ib)return Dh;Ib=1;var t=Ht();Dh=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,Dh}var Nh,Pb;function UM(){if(Pb)return Nh;Pb=1;var t=jT();Nh=e;function e(r){try{t(r)}catch(a){if(a instanceof t.CycleException)return!1;throw a}return!0}return Nh}var Mh,Fb;function ex(){if(Fb)return Mh;Fb=1;var t=Ht();Mh=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 Mh}var Oh,_b;function zM(){if(_b)return Oh;_b=1;var t=ex();Oh=e;function e(r,a){return t(r,a,"post")}return Oh}var Ih,Bb;function VM(){if(Bb)return Ih;Bb=1;var t=ex();Ih=e;function e(r,a){return t(r,a,"pre")}return Ih}var Ph,kb;function YM(){if(kb)return Ph;kb=1;var t=Ht(),e=vd(),r=ZT();Ph=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 Ph}var Fh,qb;function HM(){return qb||(qb=1,Fh={components:BM(),dijkstra:QT(),dijkstraAll:kM(),findCycles:qM(),floydWarshall:GM(),isAcyclic:UM(),postorder:zM(),preorder:VM(),prim:YM(),tarjan:JT(),topsort:jT()}),Fh}var _h,Gb;function XM(){if(Gb)return _h;Gb=1;var t=FM();return _h={Graph:t.Graph,json:_M(),alg:HM(),version:t.version},_h}var Bh,Ub;function Qt(){if(Ub)return Bh;Ub=1;var t;if(typeof Qv=="function")try{t=XM()}catch{}return t||(t=window.graphlib),Bh=t,Bh}var kh,zb;function WM(){if(zb)return kh;zb=1;var t=AT(),e=1,r=4;function a(n){return t(n,e|r)}return kh=a,kh}var qh,Vb;function uo(){if(Vb)return qh;Vb=1;var t=Fa(),e=gr(),r=ji(),a=Yt();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 qh=n,qh}var Gh,Yb;function $M(){if(Yb)return Gh;Yb=1;var t=so(),e=Fa(),r=uo(),a=aa(),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 Gh=o,Gh}var Uh,Hb;function KM(){if(Hb)return Uh;Hb=1;var t=pr(),e=gr(),r=kr();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 Uh=a,Uh}var zh,Xb;function ZM(){if(Xb)return zh;Xb=1;var t=/\s/;function e(r){for(var a=r.length;a--&&t.test(r.charAt(a)););return a}return zh=e,zh}var Vh,Wb;function QM(){if(Wb)return Vh;Wb=1;var t=ZM(),e=/^\s+/;function r(a){return a&&a.slice(0,t(a)+1).replace(e,"")}return Vh=r,Vh}var Yh,$b;function JM(){if($b)return Yh;$b=1;var t=QM(),e=Yt(),r=qa(),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 Yh=u,Yh}var Hh,Kb;function tx(){if(Kb)return Hh;Kb=1;var t=JM(),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 Hh=a,Hh}var Xh,Zb;function jM(){if(Zb)return Xh;Zb=1;var t=tx();function e(r){var a=t(r),n=a%1;return a===a?n?a-n:a:0}return Xh=e,Xh}var Wh,Qb;function eO(){if(Qb)return Wh;Qb=1;var t=WT(),e=pr(),r=jM(),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 Wh=n,Wh}var $h,Jb;function tO(){if(Jb)return $h;Jb=1;var t=KM(),e=eO(),r=t(e);return $h=r,$h}var Kh,jb;function rx(){if(jb)return Kh;jb=1;var t=cd();function e(r){var a=r==null?0:r.length;return a?t(r,1):[]}return Kh=e,Kh}var Zh,e1;function rO(){if(e1)return Zh;e1=1;var t=ud(),e=LT(),r=aa();function a(n,i){return n==null?n:t(n,e(i),r)}return Zh=a,Zh}var Qh,t1;function aO(){if(t1)return Qh;t1=1;function t(e){var r=e==null?0:e.length;return r?e[r-1]:void 0}return Qh=t,Qh}var Jh,r1;function nO(){if(r1)return Jh;r1=1;var t=Qi(),e=ld(),r=pr();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 Jh=a,Jh}var jh,a1;function dd(){if(a1)return jh;a1=1;var t=qa();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 ec,n1;function iO(){if(n1)return ec;n1=1;function t(e,r){return e>r}return ec=t,ec}var tc,i1;function oO(){if(i1)return tc;i1=1;var t=dd(),e=iO(),r=na();function a(n){return n&&n.length?t(n,r,e):void 0}return tc=a,tc}var rc,o1;function ax(){if(o1)return rc;o1=1;var t=Qi(),e=Fa();function r(a,n,i){(i!==void 0&&!e(a[n],i)||i===void 0&&!(n in a))&&t(a,n,i)}return rc=r,rc}var ac,s1;function sO(){if(s1)return ac;s1=1;var t=ta(),e=ro(),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 ac=l,ac}var nc,u1;function nx(){if(u1)return nc;u1=1;function t(e,r){if(!(r==="constructor"&&typeof e[r]=="function")&&r!="__proto__")return e[r]}return nc=t,nc}var ic,l1;function uO(){if(l1)return ic;l1=1;var t=Dn(),e=aa();function r(a){return t(a,e(a))}return ic=r,ic}var oc,f1;function lO(){if(f1)return oc;f1=1;var t=ax(),e=vT(),r=TT(),a=dT(),n=CT(),i=Nn(),o=ct(),s=$T(),u=Ba(),l=Sn(),f=Yt(),h=sO(),v=Mn(),c=nx(),d=uO();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 oc=g,oc}var sc,h1;function fO(){if(h1)return sc;h1=1;var t=Zi(),e=ax(),r=ud(),a=lO(),n=Yt(),i=aa(),o=nx();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 sc=s,sc}var uc,c1;function hO(){if(c1)return uc;c1=1;var t=so(),e=uo();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 uc=r,uc}var lc,v1;function cO(){if(v1)return lc;v1=1;var t=fO(),e=hO(),r=e(function(a,n,i){t(a,n,i)});return lc=r,lc}var fc,d1;function ix(){if(d1)return fc;d1=1;function t(e,r){return e<r}return fc=t,fc}var hc,g1;function vO(){if(g1)return hc;g1=1;var t=dd(),e=ix(),r=na();function a(n){return n&&n.length?t(n,r,e):void 0}return hc=a,hc}var cc,p1;function dO(){if(p1)return cc;p1=1;var t=dd(),e=pr(),r=ix();function a(n,i){return n&&n.length?t(n,e(i,2),r):void 0}return cc=a,cc}var vc,y1;function gO(){if(y1)return vc;y1=1;var t=Jt(),e=function(){return t.Date.now()};return vc=e,vc}var dc,m1;function pO(){if(m1)return dc;m1=1;var t=Ji(),e=io(),r=ji(),a=Yt(),n=On();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 dc=i,dc}var gc,b1;function yO(){if(b1)return gc;b1=1;var t=oo(),e=pO(),r=io();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 gc=a,gc}var pc,E1;function mO(){if(E1)return pc;E1=1;var t=yO(),e=BT();function r(a,n){return t(a,n,function(i,o){return e(a,o)})}return pc=r,pc}var yc,w1;function bO(){if(w1)return yc;w1=1;var t=rx(),e=HT(),r=XT();function a(n){return r(e(n,void 0,t),n+"")}return yc=a,yc}var mc,T1;function EO(){if(T1)return mc;T1=1;var t=mO(),e=bO(),r=e(function(a,n){return a==null?{}:t(a,n)});return mc=r,mc}var bc,x1;function wO(){if(x1)return bc;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 bc=r,bc}var Ec,C1;function TO(){if(C1)return Ec;C1=1;var t=wO(),e=uo(),r=tx();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 Ec=a,Ec}var wc,A1;function xO(){if(A1)return wc;A1=1;var t=TO(),e=t();return wc=e,wc}var Tc,L1;function CO(){if(L1)return Tc;L1=1;function t(e,r){var a=e.length;for(e.sort(r);a--;)e[a]=e[a].value;return e}return Tc=t,Tc}var xc,R1;function AO(){if(R1)return xc;R1=1;var t=qa();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 xc=e,xc}var Cc,S1;function LO(){if(S1)return Cc;S1=1;var t=AO();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 Cc=e,Cc}var Ac,D1;function RO(){if(D1)return Ac;D1=1;var t=no(),e=oo(),r=pr(),a=zT(),n=CO(),i=eo(),o=LO(),s=na(),u=ct();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 Ac=l,Ac}var Lc,N1;function SO(){if(N1)return Lc;N1=1;var t=cd(),e=RO(),r=so(),a=uo(),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 Lc=n,Lc}var Rc,M1;function DO(){if(M1)return Rc;M1=1;var t=FT(),e=0;function r(a){var n=++e;return t(a)+n}return Rc=r,Rc}var Sc,O1;function NO(){if(O1)return Sc;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 Sc=t,Sc}var Dc,I1;function MO(){if(I1)return Dc;I1=1;var t=Ji(),e=NO();function r(a,n){return e(a||[],n||[],t)}return Dc=r,Dc}var Nc,P1;function it(){if(P1)return Nc;P1=1;var t;if(typeof Qv=="function")try{t={cloneDeep:WM(),constant:sd(),defaults:$M(),each:ST(),filter:qT(),find:tO(),flatten:rx(),forEach:RT(),forIn:rO(),has:GT(),isUndefined:UT(),last:aO(),map:VT(),mapValues:nO(),max:oO(),merge:cO(),min:vO(),minBy:dO(),now:gO(),pick:EO(),range:xO(),reduce:YT(),sortBy:SO(),uniqueId:DO(),values:KT(),zipObject:MO()}}catch{}return t||(t=window._),Nc=t,Nc}var Mc,F1;function OO(){if(F1)return Mc;F1=1,Mc=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 Mc}var Oc,_1;function IO(){if(_1)return Oc;_1=1;var t=it(),e=Qt().Graph,r=OO();Oc=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 Oc}var Ic,B1;function PO(){if(B1)return Ic;B1=1;var t=it(),e=IO();Ic={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 Ic}var Pc,k1;function kt(){if(k1)return Pc;k1=1;var t=it(),e=Qt().Graph;Pc={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 Pc}var Fc,q1;function FO(){if(q1)return Fc;q1=1;var t=it(),e=kt();Fc={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 Fc}var _c,G1;function Ri(){if(G1)return _c;G1=1;var t=it();_c={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 _c}var Bc,U1;function ox(){if(U1)return Bc;U1=1;var t=it(),e=Qt().Graph,r=Ri().slack;Bc=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 Bc}var kc,z1;function _O(){if(z1)return kc;z1=1;var t=it(),e=ox(),r=Ri().slack,a=Ri().longestPath,n=Qt().alg.preorder,i=Qt().alg.postorder,o=kt().simplify;kc=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 kc}var qc,V1;function BO(){if(V1)return qc;V1=1;var t=Ri(),e=t.longestPath,r=ox(),a=_O();qc=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 qc}var Gc,Y1;function kO(){if(Y1)return Gc;Y1=1;var t=it();Gc=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 Gc}var Uc,H1;function qO(){if(H1)return Uc;H1=1;var t=it(),e=kt();Uc={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 Uc}var zc,X1;function GO(){if(X1)return zc;X1=1;var t=it(),e=kt();zc=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 zc}var Vc,W1;function UO(){if(W1)return Vc;W1=1;var t=it();Vc={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 Vc}var Yc,$1;function zO(){if($1)return Yc;$1=1;var t=it();Yc=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 Yc}var Hc,K1;function VO(){if(K1)return Hc;K1=1;var t=it();Hc=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 Hc}var Xc,Z1;function YO(){if(Z1)return Xc;Z1=1;var t=it();Xc=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 Xc}var Wc,Q1;function HO(){if(Q1)return Wc;Q1=1;var t=it();Wc=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 Wc}var $c,J1;function XO(){if(J1)return $c;J1=1;var t=it(),e=kt();$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 Kc,j1;function WO(){if(j1)return Kc;j1=1;var t=it(),e=YO(),r=HO(),a=XO();Kc=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 Kc}var Zc,eE;function $O(){if(eE)return Zc;eE=1;var t=it(),e=Qt().Graph;Zc=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 Zc}var Qc,tE;function KO(){if(tE)return Qc;tE=1;var t=it();Qc=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 Qc}var Jc,rE;function ZO(){if(rE)return Jc;rE=1;var t=it(),e=zO(),r=VO(),a=WO(),n=$O(),i=KO(),o=Qt().Graph,s=kt();Jc=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 Jc}var jc,aE;function QO(){if(aE)return jc;aE=1;var t=it(),e=Qt().Graph,r=kt();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 ev,nE;function JO(){if(nE)return ev;nE=1;var t=it(),e=kt(),r=QO().positionX;ev=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 ev}var tv,iE;function jO(){if(iE)return tv;iE=1;var t=it(),e=PO(),r=FO(),a=BO(),n=kt().normalizeRanks,i=kO(),o=kt().removeEmptyRanks,s=qO(),u=GO(),l=UO(),f=ZO(),h=JO(),v=kt(),c=Qt().Graph;tv=d;function d(q,G){var U=G&&G.debugTiming?v.time:v.notime;U("layout",function(){var K=U(" buildLayoutGraph",function(){return A(q)});U(" runLayout",function(){g(K,U)}),U(" updateInputGraph",function(){p(q,K)})})}function g(q,G){G(" makeSpaceForEdgeLabels",function(){R(q)}),G(" removeSelfEdges",function(){k(q)}),G(" acyclic",function(){e.run(q)}),G(" nestingGraph.run",function(){s.run(q)}),G(" rank",function(){a(v.asNonCompoundGraph(q))}),G(" injectEdgeLabelProxies",function(){S(q)}),G(" removeEmptyRanks",function(){o(q)}),G(" nestingGraph.cleanup",function(){s.cleanup(q)}),G(" normalizeRanks",function(){n(q)}),G(" assignRankMinMax",function(){D(q)}),G(" removeEdgeLabelProxies",function(){P(q)}),G(" normalize.run",function(){r.run(q)}),G(" parentDummyChains",function(){i(q)}),G(" addBorderSegments",function(){u(q)}),G(" order",function(){f(q)}),G(" insertSelfEdges",function(){F(q)}),G(" adjustCoordinateSystem",function(){l.adjust(q)}),G(" position",function(){h(q)}),G(" positionSelfEdges",function(){_(q)}),G(" removeBorderNodes",function(){O(q)}),G(" normalize.undo",function(){r.undo(q)}),G(" fixupEdgeLabelCoords",function(){M(q)}),G(" undoCoordinateSystem",function(){l.undo(q)}),G(" translateGraph",function(){x(q)}),G(" assignNodeIntersects",function(){N(q)}),G(" reversePoints",function(){I(q)}),G(" acyclic.undo",function(){e.undo(q)})}function p(q,G){t.forEach(q.nodes(),function(U){var K=q.node(U),J=G.node(U);K&&(K.x=J.x,K.y=J.y,G.children(U).length&&(K.width=J.width,K.height=J.height))}),t.forEach(q.edges(),function(U){var K=q.edge(U),J=G.edge(U);K.points=J.points,t.has(J,"x")&&(K.x=J.x,K.y=J.y)}),q.graph().width=G.graph().width,q.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(q){var G=new c({multigraph:!0,compound:!0}),U=X(q.graph());return G.setGraph(t.merge({},b,z(U,y),t.pick(U,m))),t.forEach(q.nodes(),function(K){var J=X(q.node(K));G.setNode(K,t.defaults(z(J,E),T)),G.setParent(K,q.parent(K))}),t.forEach(q.edges(),function(K){var J=X(q.edge(K));G.setEdge(K,t.merge({},w,z(J,L),t.pick(J,C)))}),G}function R(q){var G=q.graph();G.ranksep/=2,t.forEach(q.edges(),function(U){var K=q.edge(U);K.minlen*=2,K.labelpos.toLowerCase()!=="c"&&(G.rankdir==="TB"||G.rankdir==="BT"?K.width+=K.labeloffset:K.height+=K.labeloffset)})}function S(q){t.forEach(q.edges(),function(G){var U=q.edge(G);if(U.width&&U.height){var K=q.node(G.v),J=q.node(G.w),Y={rank:(J.rank-K.rank)/2+K.rank,e:G};v.addDummyNode(q,"edge-proxy",Y,"_ep")}})}function D(q){var G=0;t.forEach(q.nodes(),function(U){var K=q.node(U);K.borderTop&&(K.minRank=q.node(K.borderTop).rank,K.maxRank=q.node(K.borderBottom).rank,G=t.max(G,K.maxRank))}),q.graph().maxRank=G}function P(q){t.forEach(q.nodes(),function(G){var U=q.node(G);U.dummy==="edge-proxy"&&(q.edge(U.e).labelRank=U.rank,q.removeNode(G))})}function x(q){var G=Number.POSITIVE_INFINITY,U=0,K=Number.POSITIVE_INFINITY,J=0,Y=q.graph(),H=Y.marginx||0,$=Y.marginy||0;function Q(ee){var te=ee.x,le=ee.y,Ee=ee.width,fe=ee.height;G=Math.min(G,te-Ee/2),U=Math.max(U,te+Ee/2),K=Math.min(K,le-fe/2),J=Math.max(J,le+fe/2)}t.forEach(q.nodes(),function(ee){Q(q.node(ee))}),t.forEach(q.edges(),function(ee){var te=q.edge(ee);t.has(te,"x")&&Q(te)}),G-=H,K-=$,t.forEach(q.nodes(),function(ee){var te=q.node(ee);te.x-=G,te.y-=K}),t.forEach(q.edges(),function(ee){var te=q.edge(ee);t.forEach(te.points,function(le){le.x-=G,le.y-=K}),t.has(te,"x")&&(te.x-=G),t.has(te,"y")&&(te.y-=K)}),Y.width=U-G+H,Y.height=J-K+$}function N(q){t.forEach(q.edges(),function(G){var U=q.edge(G),K=q.node(G.v),J=q.node(G.w),Y,H;U.points?(Y=U.points[0],H=U.points[U.points.length-1]):(U.points=[],Y=J,H=K),U.points.unshift(v.intersectRect(K,Y)),U.points.push(v.intersectRect(J,H))})}function M(q){t.forEach(q.edges(),function(G){var U=q.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(q){t.forEach(q.edges(),function(G){var U=q.edge(G);U.reversed&&U.points.reverse()})}function O(q){t.forEach(q.nodes(),function(G){if(q.children(G).length){var U=q.node(G),K=q.node(U.borderTop),J=q.node(U.borderBottom),Y=q.node(t.last(U.borderLeft)),H=q.node(t.last(U.borderRight));U.width=Math.abs(H.x-Y.x),U.height=Math.abs(J.y-K.y),U.x=Y.x+U.width/2,U.y=K.y+U.height/2}}),t.forEach(q.nodes(),function(G){q.node(G).dummy==="border"&&q.removeNode(G)})}function k(q){t.forEach(q.edges(),function(G){if(G.v===G.w){var U=q.node(G.v);U.selfEdges||(U.selfEdges=[]),U.selfEdges.push({e:G,label:q.edge(G)}),q.removeEdge(G)}})}function F(q){var G=v.buildLayerMatrix(q);t.forEach(G,function(U){var K=0;t.forEach(U,function(J,Y){var H=q.node(J);H.order=Y+K,t.forEach(H.selfEdges,function($){v.addDummyNode(q,"selfedge",{width:$.label.width,height:$.label.height,rank:H.rank,order:Y+ ++K,e:$.e,label:$.label},"_se")}),delete H.selfEdges})})}function _(q){t.forEach(q.nodes(),function(G){var U=q.node(G);if(U.dummy==="selfedge"){var K=q.node(U.e.v),J=K.x+K.width/2,Y=K.y,H=U.x-J,$=K.height/2;q.setEdge(U.e,U.label),q.removeNode(G),U.label.points=[{x:J+2*H/3,y:Y-$},{x:J+5*H/6,y:Y-$},{x:J+H,y:Y},{x:J+5*H/6,y:Y+$},{x:J+2*H/3,y:Y+$}],U.label.x=U.x,U.label.y=U.y}})}function z(q,G){return t.mapValues(t.pick(q,G),Number)}function X(q){var G={};return t.forEach(q,function(U,K){G[K.toLowerCase()]=U}),G}return tv}var rv,oE;function eI(){if(oE)return rv;oE=1;var t=it(),e=kt(),r=Qt().Graph;rv={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 rv}var av,sE;function tI(){return sE||(sE=1,av="0.8.5"),av}var nv,uE;function rI(){return uE||(uE=1,nv={graphlib:Qt(),layout:jO(),debug:eI(),util:{time:kt().time,notime:kt().notime},version:tI()}),nv}var aI=oi.exports,lE;function nI(){return lE||(lE=1,(function(t,e){(function(a,n){t.exports=n(rI())})(aI,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(_,z){return s(z)?z.apply(_,[_]):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(_,z){z!=null&&(m[_]=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(F){return!F.source().isParent()&&!F.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(F){var _=F.scratch().dagre;O.x1=Math.min(O.x1,_.x),O.x2=Math.max(O.x2,_.x),O.y1=Math.min(O.y1,_.y),O.y2=Math.max(O.y2,_.y)}),O.w=O.x2-O.x1,O.h=O.y2-O.y1):O=y;var k=function(_){if(v.boundingBox){var z=O.w===0?0:(_.x-O.x1)/O.w,X=O.h===0?0:(_.y-O.y1)/O.h;return{x:y.x1+z*y.w,y:y.y1+X*y.h}}else return _};return T.layoutPositions(c,v,function(F){F=o(F)==="object"?F:this;var _=F.scratch().dagre;return k({x:_.x,y:_.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})])})})(oi)),oi.exports}var iI=nI();const TI=Av(iI);var si={exports:{}},ui={exports:{}},li={exports:{}},oI=li.exports,fE;function sI(){return fE||(fE=1,(function(t,e){(function(a,n){t.exports=n()})(oI,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),k=void 0,F=void 0,_=void 0,z=void 0,X=void 0,q=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?(k=this.getCardinalDirection(M,O,4),F=this.getCardinalDirection(I,O,2)):(k=this.getCardinalDirection(-M,O,3),F=this.getCardinalDirection(-I,O,1)):h>c?(k=this.getCardinalDirection(-M,O,1),F=this.getCardinalDirection(-I,O,3)):(k=this.getCardinalDirection(M,O,2),F=this.getCardinalDirection(I,O,4)),!x)switch(k){case 1:z=g,_=f+-T/O,l[0]=_,l[1]=z;break;case 2:_=m,z=h+E*O,l[0]=_,l[1]=z;break;case 3:z=b,_=f+T/O,l[0]=_,l[1]=z;break;case 4:_=y,z=h+-E*O,l[0]=_,l[1]=z;break}if(!N)switch(F){case 1:q=w,X=v+-P/O,l[2]=X,l[3]=q;break;case 2:X=S,q=c+D*O,l[2]=X,l[3]=q;break;case 3:q=R,X=v+P/O,l[2]=X,l[3]=q;break;case 4:X=A,q=c+-D*O,l[2]=X,l[3]=q;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(Ie){for(var qe=[];Ie-- >0;)qe.push(0);return qe})(Math.min(this.m+1,this.n)),this.U=(function(Ie){var qe=function ze(Ze){if(Ze.length==0)return 0;for(var tt=[],We=0;We<Ze[0];We++)tt.push(ze(Ze.slice(1)));return tt};return qe(Ie)})([this.m,s]),this.V=(function(Ie){var qe=function ze(Ze){if(Ze.length==0)return 0;for(var tt=[],We=0;We<Ze[0];We++)tt.push(ze(Ze.slice(1)));return tt};return qe(Ie)})([this.n,this.n]);for(var u=(function(Ie){for(var qe=[];Ie-- >0;)qe.push(0);return qe})(this.n),l=(function(Ie){for(var qe=[];Ie-- >0;)qe.push(0);return qe})(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(Ie,qe){return Ie&&qe})(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(Ie,qe){return qe})(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(Ie,qe){return Ie&&qe})(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 k=0,F=I;F<this.m;F++)k+=this.U[F][I]*this.U[F][O];k=-k/this.U[I][I];for(var _=I;_<this.m;_++)this.U[_][O]+=k*this.U[_][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 X=0;X<I-1;X++)this.U[X][I]=0}else{for(var q=0;q<this.m;q++)this.U[q][I]=0;this.U[I][I]=1}}for(var G=this.n-1;G>=0;G--){if((function(Ie,qe){return Ie&&qe})(G<v,u[G]!==0))for(var U=G+1;U<s;U++){for(var K=0,J=G+1;J<this.n;J++)K+=this.V[J][G]*this.V[J][U];K=-K/this.V[G+1][G];for(var Y=G+1;Y<this.n;Y++)this.V[Y][U]+=K*this.V[Y][G]}for(var H=0;H<this.n;H++)this.V[H][G]=0;this.V[G][G]=1}for(var $=x-1,Q=Math.pow(2,-52),ee=Math.pow(2,-966);x>0;){var te=void 0,le=void 0;for(te=x-2;te>=-1&&te!==-1;te--)if(Math.abs(u[te])<=ee+Q*(Math.abs(this.s[te])+Math.abs(this.s[te+1]))){u[te]=0;break}if(te===x-2)le=4;else{var Ee=void 0;for(Ee=x-1;Ee>=te&&Ee!==te;Ee--){var fe=(Ee!==x?Math.abs(u[Ee]):0)+(Ee!==te+1?Math.abs(u[Ee-1]):0);if(Math.abs(this.s[Ee])<=ee+Q*fe){this.s[Ee]=0;break}}Ee===te?le=3:Ee===x-1?le=1:(le=2,te=Ee)}switch(te++,le){case 1:{var se=u[x-2];u[x-2]=0;for(var ve=x-2;ve>=te;ve--){var ce=i.hypot(this.s[ve],se),ye=this.s[ve]/ce,ge=se/ce;this.s[ve]=ce,ve!==te&&(se=-ge*u[ve-1],u[ve-1]=ye*u[ve-1]);for(var de=0;de<this.n;de++)ce=ye*this.V[de][ve]+ge*this.V[de][x-1],this.V[de][x-1]=-ge*this.V[de][ve]+ye*this.V[de][x-1],this.V[de][ve]=ce}}break;case 2:{var be=u[te-1];u[te-1]=0;for(var Re=te;Re<x;Re++){var Pe=i.hypot(this.s[Re],be),Be=this.s[Re]/Pe,Ne=be/Pe;this.s[Re]=Pe,be=-Ne*u[Re],u[Re]=Be*u[Re];for(var Me=0;Me<this.m;Me++)Pe=Be*this.U[Me][Re]+Ne*this.U[Me][te-1],this.U[Me][te-1]=-Ne*this.U[Me][Re]+Be*this.U[Me][te-1],this.U[Me][Re]=Pe}}break;case 3:{var ne=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[te])),Math.abs(u[te])),B=this.s[x-1]/ne,V=this.s[x-2]/ne,W=u[x-2]/ne,Z=this.s[te]/ne,j=u[te]/ne,ae=((V+B)*(V-B)+W*W)/2,re=B*W*(B*W),ie=0;(function(Ie,qe){return Ie||qe})(ae!==0,re!==0)&&(ie=Math.sqrt(ae*ae+re),ae<0&&(ie=-ie),ie=re/(ae+ie));for(var ue=(Z+B)*(Z-B)+ie,oe=Z*j,he=te;he<x-1;he++){var me=i.hypot(ue,oe),pe=ue/me,Te=oe/me;he!==te&&(u[he-1]=me),ue=pe*this.s[he]+Te*u[he],u[he]=pe*u[he]-Te*this.s[he],oe=Te*this.s[he+1],this.s[he+1]=pe*this.s[he+1];for(var De=0;De<this.n;De++)me=pe*this.V[De][he]+Te*this.V[De][he+1],this.V[De][he+1]=-Te*this.V[De][he]+pe*this.V[De][he+1],this.V[De][he]=me;if(me=i.hypot(ue,oe),pe=ue/me,Te=oe/me,this.s[he]=me,ue=pe*u[he]+Te*this.s[he+1],this.s[he+1]=-Te*u[he]+pe*this.s[he+1],oe=Te*u[he+1],u[he+1]=pe*u[he+1],he<this.m-1)for(var Le=0;Le<this.m;Le++)me=pe*this.U[Le][he]+Te*this.U[Le][he+1],this.U[Le][he+1]=-Te*this.U[Le][he]+pe*this.U[Le][he+1],this.U[Le][he]=me}u[x-2]=ue}break;case 4:{if(this.s[te]<=0){this.s[te]=this.s[te]<0?-this.s[te]:0;for(var xe=0;xe<=$;xe++)this.V[xe][te]=-this.V[xe][te]}for(;te<$&&!(this.s[te]>=this.s[te+1]);){var ke=this.s[te];if(this.s[te]=this.s[te+1],this.s[te+1]=ke,te<this.n-1)for(var Ce=0;Ce<this.n;Ce++)ke=this.V[Ce][te+1],this.V[Ce][te+1]=this.V[Ce][te],this.V[Ce][te]=ke;if(te<this.m-1)for(var Ae=0;Ae<this.m;Ae++)ke=this.U[Ae][te+1],this.U[Ae][te+1]=this.U[Ae][te],this.U[Ae][te]=ke;te++}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})])})})(li)),li.exports}var uI=ui.exports,hE;function lI(){return hE||(hE=1,(function(t,e){(function(a,n){t.exports=n(sI())})(uI,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(k){return N.has(k)});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 Y(H){for(var $=H.getChild().getNodes(),Q,ee=0,te=0;te<$.length;te++)Q=$[te],Q.getChild()==null?x.fixedNodeSet.has(Q.id)&&(ee+=100):ee+=Y(Q);return ee};if(this.constraints.fixedNodeConstraint){this.constraints.fixedNodeConstraint.forEach(function($){x.fixedNodeSet.add($.nodeId)});for(var N=this.graphManager.getAllNodes(),I,M=0;M<N.length;M++)if(I=N[M],I.getChild()!=null){var k=O(I);k>0&&(I.fixedNodeWeight=k)}}if(this.constraints.relativePlacementConstraint){var F=new Map,_=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(Y){x.fixedNodesOnHorizontal.add(Y),x.fixedNodesOnVertical.add(Y)}),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(H){F.set(H,"dummy"+M),x.dummyToNodeForVerticalAlignment.get("dummy"+M).push(H),x.fixedNodeSet.has(H)&&x.fixedNodesOnHorizontal.add("dummy"+M)});if(this.constraints.alignmentConstraint.horizontal)for(var X=this.constraints.alignmentConstraint.horizontal,M=0;M<X.length;M++)this.dummyToNodeForHorizontalAlignment.set("dummy"+M,[]),X[M].forEach(function(H){_.set(H,"dummy"+M),x.dummyToNodeForHorizontalAlignment.get("dummy"+M).push(H),x.fixedNodeSet.has(H)&&x.fixedNodesOnVertical.add("dummy"+M)})}if(g.RELAX_MOVEMENT_ON_CONSTRAINTS)this.shuffle=function(Y){var H,$,Q;for(Q=Y.length-1;Q>=2*Y.length/3;Q--)H=Math.floor(Math.random()*(Q+1)),$=Y[Q],Y[Q]=Y[H],Y[H]=$;return Y},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(Y){if(Y.left){var H=F.has(Y.left)?F.get(Y.left):Y.left,$=F.has(Y.right)?F.get(Y.right):Y.right;x.nodesInRelativeHorizontal.includes(H)||(x.nodesInRelativeHorizontal.push(H),x.nodeToRelativeConstraintMapHorizontal.set(H,[]),x.dummyToNodeForVerticalAlignment.has(H)?x.nodeToTempPositionMapHorizontal.set(H,x.idToNodeMap.get(x.dummyToNodeForVerticalAlignment.get(H)[0]).getCenterX()):x.nodeToTempPositionMapHorizontal.set(H,x.idToNodeMap.get(H).getCenterX())),x.nodesInRelativeHorizontal.includes($)||(x.nodesInRelativeHorizontal.push($),x.nodeToRelativeConstraintMapHorizontal.set($,[]),x.dummyToNodeForVerticalAlignment.has($)?x.nodeToTempPositionMapHorizontal.set($,x.idToNodeMap.get(x.dummyToNodeForVerticalAlignment.get($)[0]).getCenterX()):x.nodeToTempPositionMapHorizontal.set($,x.idToNodeMap.get($).getCenterX())),x.nodeToRelativeConstraintMapHorizontal.get(H).push({right:$,gap:Y.gap}),x.nodeToRelativeConstraintMapHorizontal.get($).push({left:H,gap:Y.gap})}else{var Q=_.has(Y.top)?_.get(Y.top):Y.top,ee=_.has(Y.bottom)?_.get(Y.bottom):Y.bottom;x.nodesInRelativeVertical.includes(Q)||(x.nodesInRelativeVertical.push(Q),x.nodeToRelativeConstraintMapVertical.set(Q,[]),x.dummyToNodeForHorizontalAlignment.has(Q)?x.nodeToTempPositionMapVertical.set(Q,x.idToNodeMap.get(x.dummyToNodeForHorizontalAlignment.get(Q)[0]).getCenterY()):x.nodeToTempPositionMapVertical.set(Q,x.idToNodeMap.get(Q).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(Q).push({bottom:ee,gap:Y.gap}),x.nodeToRelativeConstraintMapVertical.get(ee).push({top:Q,gap:Y.gap})}});else{var q=new Map,G=new Map;this.constraints.relativePlacementConstraint.forEach(function(Y){if(Y.left){var H=F.has(Y.left)?F.get(Y.left):Y.left,$=F.has(Y.right)?F.get(Y.right):Y.right;q.has(H)?q.get(H).push($):q.set(H,[$]),q.has($)?q.get($).push(H):q.set($,[H])}else{var Q=_.has(Y.top)?_.get(Y.top):Y.top,ee=_.has(Y.bottom)?_.get(Y.bottom):Y.bottom;G.has(Q)?G.get(Q).push(ee):G.set(Q,[ee]),G.has(ee)?G.get(ee).push(Q):G.set(ee,[Q])}});var U=function(H,$){var Q=[],ee=[],te=new S,le=new Set,Ee=0;return H.forEach(function(fe,se){if(!le.has(se)){Q[Ee]=[],ee[Ee]=!1;var ve=se;for(te.push(ve),le.add(ve),Q[Ee].push(ve);te.length!=0;){ve=te.shift(),$.has(ve)&&(ee[Ee]=!0);var ce=H.get(ve);ce.forEach(function(ye){le.has(ye)||(te.push(ye),le.add(ye),Q[Ee].push(ye))})}Ee++}}),{components:Q,isFixed:ee}},K=U(q,x.fixedNodesOnHorizontal);this.componentsOnHorizontal=K.components,this.fixedComponentsOnHorizontal=K.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 Y=x.idToNodeMap.get(J.nodeId);Y.displacementX=0,Y.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 k=I/N[M].length,O=0;O<N[M].length;O++)this.idToNodeMap.get(N[M][O]).displacementX=k}if(this.constraints.alignmentConstraint.horizontal)for(var F=this.constraints.alignmentConstraint.horizontal,M=0;M<F.length;M++){for(var _=0,O=0;O<F[M].length;O++){if(this.fixedNodeSet.has(F[M][O])){_=0;break}_+=this.idToNodeMap.get(F[M][O]).displacementY}for(var z=_/F[M].length,O=0;O<F[M].length;O++)this.idToNodeMap.get(F[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 Y=0;x.dummyToNodeForVerticalAlignment.has(J)?Y=x.idToNodeMap.get(x.dummyToNodeForVerticalAlignment.get(J)[0]).displacementX:Y=x.idToNodeMap.get(J).displacementX,x.nodeToRelativeConstraintMapHorizontal.get(J).forEach(function(H){if(H.right){var $=x.nodeToTempPositionMapHorizontal.get(H.right)-x.nodeToTempPositionMapHorizontal.get(J)-Y;$<H.gap&&(Y-=H.gap-$)}else{var $=x.nodeToTempPositionMapHorizontal.get(J)-x.nodeToTempPositionMapHorizontal.get(H.left)+Y;$<H.gap&&(Y+=H.gap-$)}}),x.nodeToTempPositionMapHorizontal.set(J,x.nodeToTempPositionMapHorizontal.get(J)+Y),x.dummyToNodeForVerticalAlignment.has(J)?x.dummyToNodeForVerticalAlignment.get(J).forEach(function(H){x.idToNodeMap.get(H).displacementX=Y}):x.idToNodeMap.get(J).displacementX=Y}}),this.nodesInRelativeVertical.forEach(function(J){if(!x.fixedNodesOnHorizontal.has(J)){var Y=0;x.dummyToNodeForHorizontalAlignment.has(J)?Y=x.idToNodeMap.get(x.dummyToNodeForHorizontalAlignment.get(J)[0]).displacementY:Y=x.idToNodeMap.get(J).displacementY,x.nodeToRelativeConstraintMapVertical.get(J).forEach(function(H){if(H.bottom){var $=x.nodeToTempPositionMapVertical.get(H.bottom)-x.nodeToTempPositionMapVertical.get(J)-Y;$<H.gap&&(Y-=H.gap-$)}else{var $=x.nodeToTempPositionMapVertical.get(J)-x.nodeToTempPositionMapVertical.get(H.top)+Y;$<H.gap&&(Y+=H.gap-$)}}),x.nodeToTempPositionMapVertical.set(J,x.nodeToTempPositionMapVertical.get(J)+Y),x.dummyToNodeForHorizontalAlignment.has(J)?x.dummyToNodeForHorizontalAlignment.get(J).forEach(function(H){x.idToNodeMap.get(H).displacementY=Y}):x.idToNodeMap.get(J).displacementY=Y}});else{for(var M=0;M<this.componentsOnHorizontal.length;M++){var X=this.componentsOnHorizontal[M];if(this.fixedComponentsOnHorizontal[M])for(var O=0;O<X.length;O++)this.dummyToNodeForVerticalAlignment.has(X[O])?this.dummyToNodeForVerticalAlignment.get(X[O]).forEach(function(H){x.idToNodeMap.get(H).displacementX=0}):this.idToNodeMap.get(X[O]).displacementX=0;else{for(var q=0,G=0,O=0;O<X.length;O++)if(this.dummyToNodeForVerticalAlignment.has(X[O])){var U=this.dummyToNodeForVerticalAlignment.get(X[O]);q+=U.length*this.idToNodeMap.get(U[0]).displacementX,G+=U.length}else q+=this.idToNodeMap.get(X[O]).displacementX,G++;for(var K=q/G,O=0;O<X.length;O++)this.dummyToNodeForVerticalAlignment.has(X[O])?this.dummyToNodeForVerticalAlignment.get(X[O]).forEach(function(H){x.idToNodeMap.get(H).displacementX=K}):this.idToNodeMap.get(X[O]).displacementX=K}}for(var M=0;M<this.componentsOnVertical.length;M++){var X=this.componentsOnVertical[M];if(this.fixedComponentsOnVertical[M])for(var O=0;O<X.length;O++)this.dummyToNodeForHorizontalAlignment.has(X[O])?this.dummyToNodeForHorizontalAlignment.get(X[O]).forEach(function($){x.idToNodeMap.get($).displacementY=0}):this.idToNodeMap.get(X[O]).displacementY=0;else{for(var q=0,G=0,O=0;O<X.length;O++)if(this.dummyToNodeForHorizontalAlignment.has(X[O])){var U=this.dummyToNodeForHorizontalAlignment.get(X[O]);q+=U.length*this.idToNodeMap.get(U[0]).displacementY,G+=U.length}else q+=this.idToNodeMap.get(X[O]).displacementY,G++;for(var K=q/G,O=0;O<X.length;O++)this.dummyToNodeForHorizontalAlignment.has(X[O])?this.dummyToNodeForHorizontalAlignment.get(X[O]).forEach(function(te){x.idToNodeMap.get(te).displacementY=K}):this.idToNodeMap.get(X[O]).displacementY=K}}}},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(),k=I.getTarget();if(O==k)I.getBendpoints().push(new E),I.getBendpoints().push(new E),this.createDummyNodesForBendpoints(I),N.add(I);else{var F=[];if(F=F.concat(O.getEdgeListToNode(k)),F=F.concat(k.getEdgeListToNode(O)),!N.has(F[0])){if(F.length>1){var _;for(_=0;_<F.length;_++){var z=F[_];z.getBendpoints().push(new E),this.createDummyNodesForBendpoints(z)}}F.forEach(function(X){N.add(X)})}}}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,k=0,F=new E(0,0),_=0;_<x.length;_++){_%M==0&&(k=0,O=I,_!=0&&(O+=g.DEFAULT_COMPONENT_SEPERATION),I=0);var z=x[_],X=L.findCenterOfTree(z);N.x=k,N.y=O,F=D.radialLayout(z,X,N),F.y>I&&(I=Math.floor(F.y)),k=Math.floor(F.x+g.DEFAULT_COMPONENT_SEPERATION)}this.transform(new E(b.WORLD_CENTER_X-F.x/2,b.WORLD_CENTER_Y-F.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),k=new R;k.setDeviceOrgX(O.getMinX()),k.setDeviceOrgY(O.getMinY()),k.setWorldOrgX(M.x),k.setWorldOrgY(M.y);for(var F=0;F<x.length;F++){var _=x[F];_.transform(k)}var z=new E(O.getMaxX(),O.getMaxY());return k.inverseTransformPoint(z)},D.branchRadialLayout=function(x,N,M,I,O,k){var F=(I-M+1)/2;F<0&&(F+=180);var _=(F+M)%360,z=_*C.TWO_PI/360,X=O*Math.cos(z),q=O*Math.sin(z);x.setCenter(X,q);var G=[];G=G.concat(x.getEdges());var U=G.length;N!=null&&U--;for(var K=0,J=G.length,Y,H=x.getEdgesBetween(N);H.length>1;){var $=H[0];H.splice(0,1);var Q=G.indexOf($);Q>=0&&G.splice(Q,1),J--,U--}N!=null?Y=(G.indexOf(H[0])+1)%J:Y=0;for(var ee=Math.abs(I-M)/U,te=Y;K!=U;te=++te%J){var le=G[te].getOtherEnd(x);if(le!=N){var Ee=(M+K*ee)%360,fe=(Ee+ee)%360;D.branchRadialLayout(le,x,Ee,fe,O+k,k),K++}}},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 k=I[O],F=k.getParent();this.getNodeDegreeWithChildren(k)===0&&(F.id==null||!this.getToBeTiled(F))&&M.push(k)}for(var O=0;O<M.length;O++){var k=M[O],_=k.getParent().id;typeof N[_]>"u"&&(N[_]=[]),N[_]=N[_].concat(k)}Object.keys(N).forEach(function(z){if(N[z].length>1){var X="DummyCompound_"+z;x.memberGroups[X]=N[z];var q=N[z][0].getParent(),G=new c(x.graphManager);G.id=X,G.paddingLeft=q.paddingLeft||0,G.paddingRight=q.paddingRight||0,G.paddingBottom=q.paddingBottom||0,G.paddingTop=q.paddingTop||0,x.idToDummyNode[X]=G;var U=x.getGraphManager().add(x.newGraph(),G),K=q.getChild();K.add(G);for(var J=0;J<N[z].length;J++){var Y=N[z][J];K.remove(Y),U.add(Y)}}})},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,k=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(k+I.labelHeight),I.labelMarginTop=I.labelHeight):I.labelPosVertical=="center"&&I.labelHeight>k?(I.rect.y-=(I.labelHeight-k)/2,I.setHeight(I.labelHeight),I.labelMarginTop=(I.labelHeight-k)/2):I.labelPosVertical=="bottom"&&I.setHeight(k+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,k=N.labelMarginLeft,F=N.labelMarginTop;this.adjustLocations(this.tiledMemberPack[M],N.rect.x,N.rect.y,I,O,k,F)}},D.prototype.repopulateZeroDegreeMembers=function(){var x=this,N=this.tiledZeroDegreePack;Object.keys(N).forEach(function(M){var I=x.idToDummyNode[M],O=I.paddingLeft,k=I.paddingTop,F=I.labelMarginLeft,_=I.labelMarginTop;x.adjustLocations(N[M],I.rect.x,I.rect.y,O,k,F,_)})},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 k=I[O];if(this.getNodeDegree(k)>0)return this.toBeTiled[N]=!1,!1;if(k.getChild()==null){this.toBeTiled[k.id]=!1;continue}if(!this.getToBeTiled(k))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,k,F){N+=I+k,M+=O+F;for(var _=N,z=0;z<x.rows.length;z++){var X=x.rows[z];N=_;for(var q=0,G=0;G<X.length;G++){var U=X[G];U.rect.x=N,U.rect.y=M,N+=U.rect.width+x.horizontalPadding,U.rect.height>q&&(q=U.rect.height)}M+=q+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 k=O.rect.width,F=O.rect.height;O.labelWidth&&(O.labelPosHorizontal=="left"?(O.rect.x-=O.labelWidth,O.setWidth(k+O.labelWidth),O.labelMarginLeft=O.labelWidth):O.labelPosHorizontal=="center"&&O.labelWidth>k?(O.rect.x-=(O.labelWidth-k)/2,O.setWidth(O.labelWidth),O.labelMarginLeft=(O.labelWidth-k)/2):O.labelPosHorizontal=="right"&&O.setWidth(k+O.labelWidth)),O.labelHeight&&(O.labelPosVertical=="top"?(O.rect.y-=O.labelHeight,O.setHeight(F+O.labelHeight),O.labelMarginTop=O.labelHeight):O.labelPosVertical=="center"&&O.labelHeight>F?(O.rect.y-=(O.labelHeight-F)/2,O.setHeight(O.labelHeight),O.labelMarginTop=(O.labelHeight-F)/2):O.labelPosVertical=="bottom"&&O.setHeight(F+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),k=this.getOrgRatio(I),F;return k<O?F=I:F=M,F},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,k=0,F=0,_=0;x.forEach(function(J){k+=J.getWidth(),F+=J.getHeight(),J.getWidth()>_&&(_=J.getWidth())});var z=k/O,X=F/O,q=Math.pow(M-I,2)+4*(z+I)*(X+M)*O,G=(I-M+Math.sqrt(q))/(2*(z+I)),U;N?(U=Math.ceil(G),U==G&&U++):U=Math.floor(G);var K=U*(z+I)-I;return _>K&&(K=_),K+=I*2,K},D.prototype.tileNodesByFavoringDim=function(x,N,M){var I=g.TILING_PADDING_VERTICAL,O=g.TILING_PADDING_HORIZONTAL,k=g.TILING_COMPARE_BY,F={rows:[],rowWidth:[],rowHeight:[],width:0,height:N,verticalPadding:I,horizontalPadding:O,centerX:0,centerY:0};k&&(F.idealRowWidth=this.calcIdealRowWidth(x,M));var _=function(Y){return Y.rect.width*Y.rect.height},z=function(Y,H){return _(H)-_(Y)};x.sort(function(J,Y){var H=z;return F.idealRowWidth?(H=k,H(J.id,Y.id)):H(J,Y)});for(var X=0,q=0,G=0;G<x.length;G++){var U=x[G];X+=U.getCenterX(),q+=U.getCenterY()}F.centerX=X/x.length,F.centerY=q/x.length;for(var G=0;G<x.length;G++){var U=x[G];if(F.rows.length==0)this.insertNodeToRow(F,U,0,N);else if(this.canAddHorizontal(F,U.rect.width,U.rect.height)){var K=F.rows.length-1;F.idealRowWidth||(K=this.getShortestRowIndex(F)),this.insertNodeToRow(F,U,K,N)}else this.insertNodeToRow(F,U,F.rows.length,N);this.shiftToLastRow(F)}return F},D.prototype.insertNodeToRow=function(x,N,M,I){var O=I;if(M==x.rows.length){var k=[];x.rows.push(k),x.rowWidth.push(O),x.rowHeight.push(0)}var F=x.rowWidth[M]+N.rect.width;x.rows[M].length>0&&(F+=x.horizontalPadding),x.rowWidth[M]=F,x.width<F&&(x.width=F);var _=N.rect.height;M>0&&(_+=x.verticalPadding);var z=0;_>x.rowHeight[M]&&(z=x.rowHeight[M],x.rowHeight[M]=_,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 k=this.getShortestRowIndex(x);if(k<0)return!0;var F=x.rowWidth[k];if(F+x.horizontalPadding+N<=x.width)return!0;var _=0;x.rowHeight[k]<M&&k>0&&(_=M+x.verticalPadding-x.rowHeight[k]);var z;x.width-F>=N+x.horizontalPadding?z=(x.height+_)/(F+N+x.horizontalPadding):z=(x.height+_)/x.width,_=M+x.verticalPadding;var X;return x.width<N?X=(x.height+_)/N:X=(x.height+_)/x.width,X<1&&(X=1/X),z<1&&(z=1/z),z<X},D.prototype.shiftToLastRow=function(x){var N=this.getLongestRowIndex(x),M=x.rowWidth.length-1,I=x.rows[N],O=I[I.length-1],k=O.width+x.horizontalPadding;if(x.width-x.rowWidth[M]>k&&N!=M){I.splice(-1,1),x.rows[M].push(O),x.rowWidth[N]=x.rowWidth[N]-k,x.rowWidth[M]=x.rowWidth[M]+k,x.width=x.rowWidth[instance.getLongestRowIndex(x)];for(var F=Number.MIN_VALUE,_=0;_<I.length;_++)I[_].height>F&&(F=I[_].height);N>0&&(F+=x.verticalPadding);var z=x.rowHeight[N]+x.rowHeight[M];x.rowHeight[N]=F,x.rowHeight[M]<O.height+x.verticalPadding&&(x.rowHeight[M]=O.height+x.verticalPadding);var X=x.rowHeight[N]+x.rowHeight[M];x.height+=X-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 k=0;k<I.length;k++)if(M=I[k],M.getEdges().length==1&&!M.getEdges()[0].isInterGraph&&M.getChild()==null){if(g.PURE_INCREMENTAL){var F=M.getEdges()[0].getOtherEnd(M),_=new T(M.getCenterX()-F.getCenterX(),M.getCenterY()-F.getCenterY());O.push([M,M.getEdges()[0],M.getOwner(),_])}else O.push([M,M.getEdges()[0],M.getOwner()]);N=!0}if(N==!0){for(var z=[],X=0;X<O.length;X++)O[X][0].getEdges().length==1&&(z.push(O[X]),O[X][0].getOwner().remove(O[X][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,k=M.finishX,F=M.startY,_=M.finishY,z=0,X=0,q=0,G=0,U=[z,q,X,G];if(F>0)for(var K=O;K<=k;K++)U[0]+=this.grid[K][F-1].length+this.grid[K][F].length-1;if(k<this.grid.length-1)for(var K=F;K<=_;K++)U[1]+=this.grid[k+1][K].length+this.grid[k][K].length-1;if(_<this.grid[0].length-1)for(var K=O;K<=k;K++)U[2]+=this.grid[K][_+1].length+this.grid[K][_].length-1;if(O>0)for(var K=F;K<=_;K++)U[3]+=this.grid[O-1][K].length+this.grid[O][K].length-1;for(var J=w.MAX_VALUE,Y,H,$=0;$<U.length;$++)U[$]<J?(J=U[$],Y=1,H=$):U[$]==J&&Y++;if(Y==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(Y==2&&J==0){var Q=Math.floor(Math.random()*2);U[0]==0&&U[1]==0?Q==0?N=0:N=1:U[0]==0&&U[2]==0?Q==0?N=0:N=2:U[0]==0&&U[3]==0?Q==0?N=0:N=3:U[1]==0&&U[2]==0?Q==0?N=1:N=2:U[1]==0&&U[3]==0?Q==0?N=1:N=3:Q==0?N=2:N=3}else if(Y==4&&J==0){var Q=Math.floor(Math.random()*4);N=Q}else N=H;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(V){!V.gap&&V.gap!=0&&(V.left?V.gap=h.DEFAULT_EDGE_LENGTH+b.get(V.left).getWidth()/2+b.get(V.right).getWidth()/2:V.gap=h.DEFAULT_EDGE_LENGTH+b.get(V.top).getHeight()/2+b.get(V.bottom).getHeight()/2)});var R=function(W,Z){return{x:W.x-Z.x,y:W.y-Z.y}},S=function(W){var Z=0,j=0;return W.forEach(function(ae){Z+=E[m.get(ae)],j+=T[m.get(ae)]}),{x:Z/W.size,y:j/W.size}},D=function(W,Z,j,ae,re){function ie(Le,xe){var ke=new Set(Le),Ce=!0,Ae=!1,Ue=void 0;try{for(var Ie=xe[Symbol.iterator](),qe;!(Ce=(qe=Ie.next()).done);Ce=!0){var ze=qe.value;ke.add(ze)}}catch(Ze){Ae=!0,Ue=Ze}finally{try{!Ce&&Ie.return&&Ie.return()}finally{if(Ae)throw Ue}}return ke}var ue=new Map;W.forEach(function(Le,xe){ue.set(xe,0)}),W.forEach(function(Le,xe){Le.forEach(function(ke){ue.set(ke.id,ue.get(ke.id)+1)})});var oe=new Map,he=new Map,me=new v;ue.forEach(function(Le,xe){Le==0?(me.push(xe),j||(Z=="horizontal"?oe.set(xe,m.has(xe)?E[m.get(xe)]:ae.get(xe)):oe.set(xe,m.has(xe)?T[m.get(xe)]:ae.get(xe)))):oe.set(xe,Number.NEGATIVE_INFINITY),j&&he.set(xe,new Set([xe]))}),j&&re.forEach(function(Le){var xe=[];if(Le.forEach(function(Ae){j.has(Ae)&&xe.push(Ae)}),xe.length>0){var ke=0;xe.forEach(function(Ae){Z=="horizontal"?(oe.set(Ae,m.has(Ae)?E[m.get(Ae)]:ae.get(Ae)),ke+=oe.get(Ae)):(oe.set(Ae,m.has(Ae)?T[m.get(Ae)]:ae.get(Ae)),ke+=oe.get(Ae))}),ke=ke/xe.length,Le.forEach(function(Ae){j.has(Ae)||oe.set(Ae,ke)})}else{var Ce=0;Le.forEach(function(Ae){Z=="horizontal"?Ce+=m.has(Ae)?E[m.get(Ae)]:ae.get(Ae):Ce+=m.has(Ae)?T[m.get(Ae)]:ae.get(Ae)}),Ce=Ce/Le.length,Le.forEach(function(Ae){oe.set(Ae,Ce)})}});for(var pe=function(){var xe=me.shift(),ke=W.get(xe);ke.forEach(function(Ce){if(oe.get(Ce.id)<oe.get(xe)+Ce.gap)if(j&&j.has(Ce.id)){var Ae=void 0;if(Z=="horizontal"?Ae=m.has(Ce.id)?E[m.get(Ce.id)]:ae.get(Ce.id):Ae=m.has(Ce.id)?T[m.get(Ce.id)]:ae.get(Ce.id),oe.set(Ce.id,Ae),Ae<oe.get(xe)+Ce.gap){var Ue=oe.get(xe)+Ce.gap-Ae;he.get(xe).forEach(function(Ie){oe.set(Ie,oe.get(Ie)-Ue)})}}else oe.set(Ce.id,oe.get(xe)+Ce.gap);ue.set(Ce.id,ue.get(Ce.id)-1),ue.get(Ce.id)==0&&me.push(Ce.id),j&&he.set(Ce.id,ie(he.get(xe),he.get(Ce.id)))})};me.length!=0;)pe();if(j){var Te=new Set;W.forEach(function(Le,xe){Le.length==0&&Te.add(xe)});var De=[];he.forEach(function(Le,xe){if(Te.has(xe)){var ke=!1,Ce=!0,Ae=!1,Ue=void 0;try{for(var Ie=Le[Symbol.iterator](),qe;!(Ce=(qe=Ie.next()).done);Ce=!0){var ze=qe.value;j.has(ze)&&(ke=!0)}}catch(We){Ae=!0,Ue=We}finally{try{!Ce&&Ie.return&&Ie.return()}finally{if(Ae)throw Ue}}if(!ke){var Ze=!1,tt=void 0;De.forEach(function(We,Nt){We.has([].concat(f(Le))[0])&&(Ze=!0,tt=Nt)}),Ze?Le.forEach(function(We){De[tt].add(We)}):De.push(new Set(Le))}}}),De.forEach(function(Le,xe){var ke=Number.POSITIVE_INFINITY,Ce=Number.POSITIVE_INFINITY,Ae=Number.NEGATIVE_INFINITY,Ue=Number.NEGATIVE_INFINITY,Ie=!0,qe=!1,ze=void 0;try{for(var Ze=Le[Symbol.iterator](),tt;!(Ie=(tt=Ze.next()).done);Ie=!0){var We=tt.value,Nt=void 0;Z=="horizontal"?Nt=m.has(We)?E[m.get(We)]:ae.get(We):Nt=m.has(We)?T[m.get(We)]:ae.get(We);var Ft=oe.get(We);Nt<ke&&(ke=Nt),Nt>Ae&&(Ae=Nt),Ft<Ce&&(Ce=Ft),Ft>Ue&&(Ue=Ft)}}catch(mr){qe=!0,ze=mr}finally{try{!Ie&&Ze.return&&Ze.return()}finally{if(qe)throw ze}}var mt=(ke+Ae)/2-(Ce+Ue)/2,at=!0,ut=!1,Gt=void 0;try{for(var lt=Le[Symbol.iterator](),qr;!(at=(qr=lt.next()).done);at=!0){var yr=qr.value;oe.set(yr,oe.get(yr)+mt)}}catch(mr){ut=!0,Gt=mr}finally{try{!at&&lt.return&&lt.return()}finally{if(ut)throw Gt}}})}return oe},P=function(W){var Z=0,j=0,ae=0,re=0;if(W.forEach(function(he){he.left?E[m.get(he.left)]-E[m.get(he.right)]>=0?Z++:j++:T[m.get(he.top)]-T[m.get(he.bottom)]>=0?ae++:re++}),Z>j&&ae>re)for(var ie=0;ie<m.size;ie++)E[ie]=-1*E[ie],T[ie]=-1*T[ie];else if(Z>j)for(var ue=0;ue<m.size;ue++)E[ue]=-1*E[ue];else if(ae>re)for(var oe=0;oe<m.size;oe++)T[oe]=-1*T[oe]},x=function(W){var Z=[],j=new v,ae=new Set,re=0;return W.forEach(function(ie,ue){if(!ae.has(ue)){Z[re]=[];var oe=ue;for(j.push(oe),ae.add(oe),Z[re].push(oe);j.length!=0;){oe=j.shift();var he=W.get(oe);he.forEach(function(me){ae.has(me.id)||(j.push(me.id),ae.add(me.id),Z[re].push(me.id))})}re++}}),Z},N=function(W){var Z=new Map;return W.forEach(function(j,ae){Z.set(ae,[])}),W.forEach(function(j,ae){j.forEach(function(re){Z.get(ae).push(re),Z.get(re.id).push({id:ae,gap:re.gap,direction:re.direction})})}),Z},M=function(W){var Z=new Map;return W.forEach(function(j,ae){Z.set(ae,[])}),W.forEach(function(j,ae){j.forEach(function(re){Z.get(re.id).push({id:ae,gap:re.gap,direction:re.direction})})}),Z},I=[],O=[],k=!1,F=!1,_=new Set,z=new Map,X=new Map,q=[];if(y.fixedNodeConstraint&&y.fixedNodeConstraint.forEach(function(V){_.add(V.nodeId)}),y.relativePlacementConstraint&&(y.relativePlacementConstraint.forEach(function(V){V.left?(z.has(V.left)?z.get(V.left).push({id:V.right,gap:V.gap,direction:"horizontal"}):z.set(V.left,[{id:V.right,gap:V.gap,direction:"horizontal"}]),z.has(V.right)||z.set(V.right,[])):(z.has(V.top)?z.get(V.top).push({id:V.bottom,gap:V.gap,direction:"vertical"}):z.set(V.top,[{id:V.bottom,gap:V.gap,direction:"vertical"}]),z.has(V.bottom)||z.set(V.bottom,[]))}),X=N(z),q=x(X)),h.TRANSFORM_ON_CONSTRAINT_HANDLING){if(y.fixedNodeConstraint&&y.fixedNodeConstraint.length>1)y.fixedNodeConstraint.forEach(function(V,W){I[W]=[V.position.x,V.position.y],O[W]=[E[m.get(V.nodeId)],T[m.get(V.nodeId)]]}),k=!0;else if(y.alignmentConstraint)(function(){var V=0;if(y.alignmentConstraint.vertical){for(var W=y.alignmentConstraint.vertical,Z=function(oe){var he=new Set;W[oe].forEach(function(Te){he.add(Te)});var me=new Set([].concat(f(he)).filter(function(Te){return _.has(Te)})),pe=void 0;me.size>0?pe=E[m.get(me.values().next().value)]:pe=S(he).x,W[oe].forEach(function(Te){I[V]=[pe,T[m.get(Te)]],O[V]=[E[m.get(Te)],T[m.get(Te)]],V++})},j=0;j<W.length;j++)Z(j);k=!0}if(y.alignmentConstraint.horizontal){for(var ae=y.alignmentConstraint.horizontal,re=function(oe){var he=new Set;ae[oe].forEach(function(Te){he.add(Te)});var me=new Set([].concat(f(he)).filter(function(Te){return _.has(Te)})),pe=void 0;me.size>0?pe=E[m.get(me.values().next().value)]:pe=S(he).y,ae[oe].forEach(function(Te){I[V]=[E[m.get(Te)],pe],O[V]=[E[m.get(Te)],T[m.get(Te)]],V++})},ie=0;ie<ae.length;ie++)re(ie);k=!0}y.relativePlacementConstraint&&(F=!0)})();else if(y.relativePlacementConstraint){for(var G=0,U=0,K=0;K<q.length;K++)q[K].length>G&&(G=q[K].length,U=K);if(G<X.size/2)P(y.relativePlacementConstraint),k=!1,F=!1;else{var J=new Map,Y=new Map,H=[];q[U].forEach(function(V){z.get(V).forEach(function(W){W.direction=="horizontal"?(J.has(V)?J.get(V).push(W):J.set(V,[W]),J.has(W.id)||J.set(W.id,[]),H.push({left:V,right:W.id})):(Y.has(V)?Y.get(V).push(W):Y.set(V,[W]),Y.has(W.id)||Y.set(W.id,[]),H.push({top:V,bottom:W.id}))})}),P(H),F=!1;var $=D(J,"horizontal"),Q=D(Y,"vertical");q[U].forEach(function(V,W){O[W]=[E[m.get(V)],T[m.get(V)]],I[W]=[],$.has(V)?I[W][0]=$.get(V):I[W][0]=E[m.get(V)],Q.has(V)?I[W][1]=Q.get(V):I[W][1]=T[m.get(V)]}),k=!0}}if(k){for(var ee=void 0,te=c.transpose(I),le=c.transpose(O),Ee=0;Ee<te.length;Ee++)te[Ee]=c.multGamma(te[Ee]),le[Ee]=c.multGamma(le[Ee]);var fe=c.multMat(te,c.transpose(le)),se=d.svd(fe);ee=c.multMat(se.V,c.transpose(se.U));for(var ve=0;ve<m.size;ve++){var ce=[E[ve],T[ve]],ye=[ee[0][0],ee[1][0]],ge=[ee[0][1],ee[1][1]];E[ve]=c.dotProduct(ce,ye),T[ve]=c.dotProduct(ce,ge)}F&&P(y.relativePlacementConstraint)}}if(h.ENFORCE_CONSTRAINTS){if(y.fixedNodeConstraint&&y.fixedNodeConstraint.length>0){var de={x:0,y:0};y.fixedNodeConstraint.forEach(function(V,W){var Z={x:E[m.get(V.nodeId)],y:T[m.get(V.nodeId)]},j=V.position,ae=R(j,Z);de.x+=ae.x,de.y+=ae.y}),de.x/=y.fixedNodeConstraint.length,de.y/=y.fixedNodeConstraint.length,E.forEach(function(V,W){E[W]+=de.x}),T.forEach(function(V,W){T[W]+=de.y}),y.fixedNodeConstraint.forEach(function(V){E[m.get(V.nodeId)]=V.position.x,T[m.get(V.nodeId)]=V.position.y})}if(y.alignmentConstraint){if(y.alignmentConstraint.vertical)for(var be=y.alignmentConstraint.vertical,Re=function(W){var Z=new Set;be[W].forEach(function(re){Z.add(re)});var j=new Set([].concat(f(Z)).filter(function(re){return _.has(re)})),ae=void 0;j.size>0?ae=E[m.get(j.values().next().value)]:ae=S(Z).x,Z.forEach(function(re){_.has(re)||(E[m.get(re)]=ae)})},Pe=0;Pe<be.length;Pe++)Re(Pe);if(y.alignmentConstraint.horizontal)for(var Be=y.alignmentConstraint.horizontal,Ne=function(W){var Z=new Set;Be[W].forEach(function(re){Z.add(re)});var j=new Set([].concat(f(Z)).filter(function(re){return _.has(re)})),ae=void 0;j.size>0?ae=T[m.get(j.values().next().value)]:ae=S(Z).y,Z.forEach(function(re){_.has(re)||(T[m.get(re)]=ae)})},Me=0;Me<Be.length;Me++)Ne(Me)}y.relativePlacementConstraint&&(function(){var V=new Map,W=new Map,Z=new Map,j=new Map,ae=new Map,re=new Map,ie=new Set,ue=new Set;if(_.forEach(function(vt){ie.add(vt),ue.add(vt)}),y.alignmentConstraint){if(y.alignmentConstraint.vertical)for(var oe=y.alignmentConstraint.vertical,he=function(Fe){Z.set("dummy"+Fe,[]),oe[Fe].forEach(function(Ve){V.set(Ve,"dummy"+Fe),Z.get("dummy"+Fe).push(Ve),_.has(Ve)&&ie.add("dummy"+Fe)}),ae.set("dummy"+Fe,E[m.get(oe[Fe][0])])},me=0;me<oe.length;me++)he(me);if(y.alignmentConstraint.horizontal)for(var pe=y.alignmentConstraint.horizontal,Te=function(Fe){j.set("dummy"+Fe,[]),pe[Fe].forEach(function(Ve){W.set(Ve,"dummy"+Fe),j.get("dummy"+Fe).push(Ve),_.has(Ve)&&ue.add("dummy"+Fe)}),re.set("dummy"+Fe,T[m.get(pe[Fe][0])])},De=0;De<pe.length;De++)Te(De)}var Le=new Map,xe=new Map,ke=function(Fe){z.get(Fe).forEach(function(Ve){var Xt=void 0,bt=void 0;Ve.direction=="horizontal"?(Xt=V.get(Fe)?V.get(Fe):Fe,V.get(Ve.id)?bt={id:V.get(Ve.id),gap:Ve.gap,direction:Ve.direction}:bt=Ve,Le.has(Xt)?Le.get(Xt).push(bt):Le.set(Xt,[bt]),Le.has(bt.id)||Le.set(bt.id,[])):(Xt=W.get(Fe)?W.get(Fe):Fe,W.get(Ve.id)?bt={id:W.get(Ve.id),gap:Ve.gap,direction:Ve.direction}:bt=Ve,xe.has(Xt)?xe.get(Xt).push(bt):xe.set(Xt,[bt]),xe.has(bt.id)||xe.set(bt.id,[]))})},Ce=!0,Ae=!1,Ue=void 0;try{for(var Ie=z.keys()[Symbol.iterator](),qe;!(Ce=(qe=Ie.next()).done);Ce=!0){var ze=qe.value;ke(ze)}}catch(vt){Ae=!0,Ue=vt}finally{try{!Ce&&Ie.return&&Ie.return()}finally{if(Ae)throw Ue}}var Ze=N(Le),tt=N(xe),We=x(Ze),Nt=x(tt),Ft=M(Le),mt=M(xe),at=[],ut=[];We.forEach(function(vt,Fe){at[Fe]=[],vt.forEach(function(Ve){Ft.get(Ve).length==0&&at[Fe].push(Ve)})}),Nt.forEach(function(vt,Fe){ut[Fe]=[],vt.forEach(function(Ve){mt.get(Ve).length==0&&ut[Fe].push(Ve)})});var Gt=D(Le,"horizontal",ie,ae,at),lt=D(xe,"vertical",ue,re,ut),qr=function(Fe){Z.get(Fe)?Z.get(Fe).forEach(function(Ve){E[m.get(Ve)]=Gt.get(Fe)}):E[m.get(Fe)]=Gt.get(Fe)},yr=!0,mr=!1,In=void 0;try{for(var Ga=Gt.keys()[Symbol.iterator](),Pn;!(yr=(Pn=Ga.next()).done);yr=!0){var Ua=Pn.value;qr(Ua)}}catch(vt){mr=!0,In=vt}finally{try{!yr&&Ga.return&&Ga.return()}finally{if(mr)throw In}}var lo=function(Fe){j.get(Fe)?j.get(Fe).forEach(function(Ve){T[m.get(Ve)]=lt.get(Fe)}):T[m.get(Fe)]=lt.get(Fe)},ur=!0,ia=!1,Gr=void 0;try{for(var oa=lt.keys()[Symbol.iterator](),za;!(ur=(za=oa.next()).done);ur=!0){var Ua=za.value;lo(Ua)}}catch(vt){ia=!0,Gr=vt}finally{try{!ur&&oa.return&&oa.return()}finally{if(ia)throw Gr}}})()}for(var ne=0;ne<L.length;ne++){var B=L[ne];B.getChild()==null&&B.setCenter(E[m.get(B.id)],T[m.get(B.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})()})})(ui)),ui.exports}var fI=si.exports,cE;function hI(){return cE||(cE=1,(function(t,e){(function(a,n){t.exports=n(lI())})(fI,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 k=c.collection();x.neighborhood().nodes().forEach(function(X){d.intersection(x.edgesWith(X)).length>0&&k.merge(X)});for(var F=0;F<k.length;F++){var _=k[F];if(E=g.intersection(_.union(_.ancestors())),E!=null&&!b.has(E[0])){var z=E.union(E.descendants());z.forEach(function(X){y.push(X),b.add(X),P.merge(X),g.has(X)&&m.push(X)})}}};y.length!=0;)M();if(P.forEach(function(O){d.intersection(O.connectedEdges()).forEach(function(k){P.has(k.source())&&P.has(k.target())&&P.merge(k)})}),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(X){T=!0,L=X}finally{try{!E&&w.return&&w.return()}finally{if(T)throw L}}var k=c.x-(y+p)/2,F=c.y-(m+b)/2;d.xCoords=d.xCoords.map(function(X){return X+k}),d.yCoords=d.yCoords.map(function(X){return X+F})}else{Object.keys(d).forEach(function(X){var q=d[X],G=q.getRect().x,U=q.getRect().x+q.getRect().width,K=q.getRect().y,J=q.getRect().y+q.getRect().height;G<p&&(p=G),U>y&&(y=U),K<b&&(b=K),J>m&&(m=J)});var _=c.x-(y+p)/2,z=c.y-(m+b)/2;Object.keys(d).forEach(function(X){var q=d[X];q.setCenter(q.getCenterX()+_,q.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(X){return typeof X=="function"},N=function(X,q){return x(X)?X(q):X},M=f.calcParentsWithoutChildren(L,w),I=function z(X,q,G,U){for(var K=q.length,J=0;J<K;J++){var Y=q[J],H=null;Y.intersection(M).length==0&&(H=Y.children());var $=void 0,Q=Y.layoutDimensions({nodeDimensionsIncludeLabels:U.nodeDimensionsIncludeLabels});if(Y.outerWidth()!=null&&Y.outerHeight()!=null)if(U.randomize)if(!Y.isParent())$=X.add(new v(G.graphManager,new c(S[R.get(Y.id())]-Q.w/2,D[R.get(Y.id())]-Q.h/2),new d(parseFloat(Q.w),parseFloat(Q.h))));else{var ee=f.calcBoundingBox(Y,S,D,R);Y.intersection(M).length==0?$=X.add(new v(G.graphManager,new c(ee.topLeftX,ee.topLeftY),new d(ee.width,ee.height))):$=X.add(new v(G.graphManager,new c(ee.topLeftX,ee.topLeftY),new d(parseFloat(Q.w),parseFloat(Q.h))))}else $=X.add(new v(G.graphManager,new c(Y.position("x")-Q.w/2,Y.position("y")-Q.h/2),new d(parseFloat(Q.w),parseFloat(Q.h))));else $=X.add(new v(this.graphManager));if($.id=Y.data("id"),$.nodeRepulsion=N(U.nodeRepulsion,Y),$.paddingLeft=parseInt(Y.css("padding")),$.paddingTop=parseInt(Y.css("padding")),$.paddingRight=parseInt(Y.css("padding")),$.paddingBottom=parseInt(Y.css("padding")),U.nodeDimensionsIncludeLabels&&($.labelWidth=Y.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).w,$.labelHeight=Y.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).h,$.labelPosVertical=Y.css("text-valign"),$.labelPosHorizontal=Y.css("text-halign")),P[Y.data("id")]=$,isNaN($.rect.x)&&($.rect.x=0),isNaN($.rect.y)&&($.rect.y=0),H!=null&&H.length>0){var te=void 0;te=G.getGraphManager().add(G.newGraph(),$),z(te,H,G,U)}}},O=function(X,q,G){for(var U=0,K=0,J=0;J<G.length;J++){var Y=G[J],H=P[Y.data("source")],$=P[Y.data("target")];if(H&&$&&H!==$&&H.getEdgesBetween($).length==0){var Q=q.add(X.newEdge(),H,$);Q.id=Y.id(),Q.idealLength=N(E.idealEdgeLength,Y),Q.edgeElasticity=N(E.edgeElasticity,Y),U+=Q.idealLength,K++}}E.idealEdgeLength!=null&&(K>0?y.DEFAULT_EDGE_LENGTH=p.DEFAULT_EDGE_LENGTH=U/K: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)},k=function(X,q){q.fixedNodeConstraint&&(X.constraints.fixedNodeConstraint=q.fixedNodeConstraint),q.alignmentConstraint&&(X.constraints.alignmentConstraint=q.alignmentConstraint),q.relativePlacementConstraint&&(X.constraints.relativePlacementConstraint=q.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 F=new h,_=F.newGraphManager();return I(_.addRoot(),f.getTopMostNodes(C),F,E),O(F,_,A),k(F,E),F.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 k=c.getTopMostNodes(w.eles.nodes());if(D=c.connectComponents(C,w.eles,k),D.forEach(function(fe){var se=fe.boundingBox();P.push({x:se.x1+se.w/2,y:se.y1+se.h/2})}),w.randomize&&D.forEach(function(fe){w.eles=fe,R.push(g(w))}),w.quality=="default"||w.quality=="proof"){var F=C.collection();if(w.tile){var _=new Map,z=[],X=[],q=0,G={nodeIndexes:_,xCoords:z,yCoords:X},U=[];if(D.forEach(function(fe,se){fe.edges().length==0&&(fe.nodes().forEach(function(ve,ce){F.merge(fe.nodes()[ce]),ve.isParent()||(G.nodeIndexes.set(fe.nodes()[ce].id(),q++),G.xCoords.push(fe.nodes()[0].position().x),G.yCoords.push(fe.nodes()[0].position().y))}),U.push(se))}),F.length>1){var K=F.boundingBox();P.push({x:K.x1+K.w/2,y:K.y1+K.h/2}),D.push(F),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(fe,se){w.eles=fe,S.push(y(w,R[se])),c.relocateComponent(P[se],S[se],w)})}else D.forEach(function(fe,se){c.relocateComponent(P[se],R[se],w)});var Y=new Set;if(D.length>1){var H=[],$=A.filter(function(fe){return fe.css("display")=="none"});D.forEach(function(fe,se){var ve=void 0;if(w.quality=="draft"&&(ve=R[se].nodeIndexes),fe.nodes().not($).length>0){var ce={};ce.edges=[],ce.nodes=[];var ye=void 0;fe.nodes().not($).forEach(function(ge){if(w.quality=="draft")if(!ge.isParent())ye=ve.get(ge.id()),ce.nodes.push({x:R[se].xCoords[ye]-ge.boundingbox().w/2,y:R[se].yCoords[ye]-ge.boundingbox().h/2,width:ge.boundingbox().w,height:ge.boundingbox().h});else{var de=c.calcBoundingBox(ge,R[se].xCoords,R[se].yCoords,ve);ce.nodes.push({x:de.topLeftX,y:de.topLeftY,width:de.width,height:de.height})}else S[se][ge.id()]&&ce.nodes.push({x:S[se][ge.id()].getLeft(),y:S[se][ge.id()].getTop(),width:S[se][ge.id()].getWidth(),height:S[se][ge.id()].getHeight()})}),fe.edges().forEach(function(ge){var de=ge.source(),be=ge.target();if(de.css("display")!="none"&&be.css("display")!="none")if(w.quality=="draft"){var Re=ve.get(de.id()),Pe=ve.get(be.id()),Be=[],Ne=[];if(de.isParent()){var Me=c.calcBoundingBox(de,R[se].xCoords,R[se].yCoords,ve);Be.push(Me.topLeftX+Me.width/2),Be.push(Me.topLeftY+Me.height/2)}else Be.push(R[se].xCoords[Re]),Be.push(R[se].yCoords[Re]);if(be.isParent()){var ne=c.calcBoundingBox(be,R[se].xCoords,R[se].yCoords,ve);Ne.push(ne.topLeftX+ne.width/2),Ne.push(ne.topLeftY+ne.height/2)}else Ne.push(R[se].xCoords[Pe]),Ne.push(R[se].yCoords[Pe]);ce.edges.push({startX:Be[0],startY:Be[1],endX:Ne[0],endY:Ne[1]})}else S[se][de.id()]&&S[se][be.id()]&&ce.edges.push({startX:S[se][de.id()].getCenterX(),startY:S[se][de.id()].getCenterY(),endX:S[se][be.id()].getCenterX(),endY:S[se][be.id()].getCenterY()})}),ce.nodes.length>0&&(H.push(ce),Y.add(se))}});var Q=N.packComponents(H,w.randomize).shifts;if(w.quality=="draft")R.forEach(function(fe,se){var ve=fe.xCoords.map(function(ye){return ye+Q[se].dx}),ce=fe.yCoords.map(function(ye){return ye+Q[se].dy});fe.xCoords=ve,fe.yCoords=ce});else{var ee=0;Y.forEach(function(fe){Object.keys(S[fe]).forEach(function(se){var ve=S[fe][se];ve.setCenter(ve.getCenterX()+Q[ee].dx,ve.getCenterY()+Q[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 te=function(se,ve){if(w.quality=="default"||w.quality=="proof"){typeof se=="number"&&(se=ve);var ce=void 0,ye=void 0,ge=se.data("id");return S.forEach(function(be){ge in be&&(ce={x:be[ge].getRect().getCenterX(),y:be[ge].getRect().getCenterY()},ye=be[ge])}),w.nodeDimensionsIncludeLabels&&(ye.labelWidth&&(ye.labelPosHorizontal=="left"?ce.x+=ye.labelWidth/2:ye.labelPosHorizontal=="right"&&(ce.x-=ye.labelWidth/2)),ye.labelHeight&&(ye.labelPosVertical=="top"?ce.y+=ye.labelHeight/2:ye.labelPosVertical=="bottom"&&(ce.y-=ye.labelHeight/2))),ce==null&&(ce={x:se.position("x"),y:se.position("y")}),{x:ce.x,y:ce.y}}else{var de=void 0;return R.forEach(function(be){var Re=be.nodeIndexes.get(se.id());Re!=null&&(de={x:be.xCoords[Re],y:be.yCoords[Re]})}),de==null&&(de={x:se.position("x"),y:se.position("y")}),{x:de.x,y:de.y}}};if(w.quality=="default"||w.quality=="proof"||w.randomize){var le=c.calcParentsWithoutChildren(C,A),Ee=A.filter(function(fe){return fe.css("display")=="none"});w.eles=A.not(Ee),A.nodes().not(":parent").not(Ee).layoutPositions(L,w,te),le.length>0&&le.forEach(function(fe){fe.position(te(fe))})}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,k=g.samplingType,F=g.nodeSeparation,_=void 0,z=function(){for(var W=0,Z=0,j=!1;Z<_;){W=Math.floor(Math.random()*N),j=!1;for(var ae=0;ae<Z;ae++)if(R[ae]==W){j=!0;break}if(!j)R[Z]=W,Z++;else continue}},X=function(W,Z,j){for(var ae=[],re=0,ie=0,ue=0,oe=void 0,he=[],me=0,pe=1,Te=0;Te<N;Te++)he[Te]=M;for(ae[ie]=W,he[W]=0;ie>=re;){ue=ae[re++];for(var De=w[ue],Le=0;Le<De.length;Le++)oe=T.get(De[Le]),he[oe]==M&&(he[oe]=he[ue]+1,ae[++ie]=oe);D[ue][Z]=he[ue]*F}if(j){for(var xe=0;xe<N;xe++)D[xe][Z]<S[xe]&&(S[xe]=D[xe][Z]);for(var ke=0;ke<N;ke++)S[ke]>me&&(me=S[ke],pe=ke)}return pe},q=function(W){var Z=void 0;if(W){Z=Math.floor(Math.random()*N);for(var ae=0;ae<N;ae++)S[ae]=M;for(var re=0;re<_;re++)R[re]=Z,Z=X(Z,re,W)}else{z();for(var j=0;j<_;j++)X(R[j],j,W)}for(var ie=0;ie<N;ie++)for(var ue=0;ue<_;ue++)D[ie][ue]*=D[ie][ue];for(var oe=0;oe<_;oe++)P[oe]=[];for(var he=0;he<_;he++)for(var me=0;me<_;me++)P[he][me]=D[R[me]][he]},G=function(){for(var W=v.svd(P),Z=W.S,j=W.U,ae=W.V,re=Z[0]*Z[0]*Z[0],ie=[],ue=0;ue<_;ue++){ie[ue]=[];for(var oe=0;oe<_;oe++)ie[ue][oe]=0,ue==oe&&(ie[ue][oe]=Z[ue]/(Z[ue]*Z[ue]+re/(Z[ue]*Z[ue])))}x=h.multMat(h.multMat(ae,ie),h.transpose(j))},U=function(){for(var W=void 0,Z=void 0,j=[],ae=[],re=[],ie=[],ue=0;ue<N;ue++)j[ue]=Math.random(),ae[ue]=Math.random();j=h.normalize(j),ae=h.normalize(ae);for(var oe=I,he=I,me=void 0;;){for(var pe=0;pe<N;pe++)re[pe]=j[pe];if(j=h.multGamma(h.multL(h.multGamma(re),D,x)),W=h.dotProduct(re,j),j=h.normalize(j),oe=h.dotProduct(re,j),me=Math.abs(oe/he),me<=1+O&&me>=1)break;he=oe}for(var Te=0;Te<N;Te++)re[Te]=j[Te];for(he=I;;){for(var De=0;De<N;De++)ie[De]=ae[De];if(ie=h.minusOp(ie,h.multCons(re,h.dotProduct(re,ie))),ae=h.multGamma(h.multL(h.multGamma(ie),D,x)),Z=h.dotProduct(ie,ae),ae=h.normalize(ae),oe=h.dotProduct(ie,ae),me=Math.abs(oe/he),me<=1+O&&me>=1)break;he=oe}for(var Le=0;Le<N;Le++)ie[Le]=ae[Le];C=h.multCons(re,Math.sqrt(Math.abs(W))),A=h.multCons(ie,Math.sqrt(Math.abs(Z)))};f.connectComponents(p,y,f.getTopMostNodes(b),E),m.forEach(function(V){f.connectComponents(p,y,f.getTopMostNodes(V.descendants().intersection(y)),E)});for(var K=0,J=0;J<b.length;J++)b[J].isParent()||T.set(b[J].id(),K++);var Y=!0,H=!1,$=void 0;try{for(var Q=E.keys()[Symbol.iterator](),ee;!(Y=(ee=Q.next()).done);Y=!0){var te=ee.value;T.set(te,K++)}}catch(V){H=!0,$=V}finally{try{!Y&&Q.return&&Q.return()}finally{if(H)throw $}}for(var le=0;le<T.size;le++)w[le]=[];m.forEach(function(V){for(var W=V.children().intersection(y);W.nodes(":childless").length==0;)W=W.nodes()[0].children().intersection(y);var Z=0,j=W.nodes(":childless")[0].connectedEdges().length;W.nodes(":childless").forEach(function(ae,re){ae.connectedEdges().length<j&&(j=ae.connectedEdges().length,Z=re)}),L.set(V.id(),W.nodes(":childless")[Z].id())}),b.forEach(function(V){var W=void 0;V.isParent()?W=T.get(L.get(V.id())):W=T.get(V.id()),V.neighborhood().nodes().forEach(function(Z){y.intersection(V.edgesWith(Z)).length>0&&(Z.isParent()?w[W].push(L.get(Z.id())):w[W].push(Z.id()))})});var Ee=function(W){var Z=T.get(W),j=void 0;E.get(W).forEach(function(ae){p.getElementById(ae).isParent()?j=L.get(ae):j=ae,w[Z].push(j),w[T.get(j)].push(W)})},fe=!0,se=!1,ve=void 0;try{for(var ce=E.keys()[Symbol.iterator](),ye;!(fe=(ye=ce.next()).done);fe=!0){var ge=ye.value;Ee(ge)}}catch(V){se=!0,ve=V}finally{try{!fe&&ce.return&&ce.return()}finally{if(se)throw ve}}N=T.size;var de=void 0;if(N>2){_=N<g.sampleSize?N:g.sampleSize;for(var be=0;be<N;be++)D[be]=[];for(var Re=0;Re<_;Re++)x[Re]=[];return g.quality=="draft"||g.step=="all"?(q(k),G(),U(),de={nodeIndexes:T,xCoords:C,yCoords:A}):(T.forEach(function(V,W){C.push(p.getElementById(W).position("x")),A.push(p.getElementById(W).position("y"))}),de={nodeIndexes:T,xCoords:C,yCoords:A}),de}else{var Pe=T.keys(),Be=p.getElementById(Pe.next().value),Ne=Be.position(),Me=Be.outerWidth();if(C.push(Ne.x),A.push(Ne.y),N==2){var ne=p.getElementById(Pe.next().value),B=ne.outerWidth();C.push(Ne.x+Me/2+B/2+g.idealEdgeLength),A.push(Ne.y)}return de={nodeIndexes:T,xCoords:C,yCoords:A},de}};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})()})})(si)),si.exports}var cI=hI();const xI=Av(cI);var fi={exports:{}},hi={exports:{}},ci={exports:{}},vI=ci.exports,vE;function dI(){return vE||(vE=1,(function(t,e){(function(a,n){t.exports=n()})(vI,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),k=void 0,F=void 0,_=void 0,z=void 0,X=void 0,q=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?(k=this.getCardinalDirection(M,O,4),F=this.getCardinalDirection(I,O,2)):(k=this.getCardinalDirection(-M,O,3),F=this.getCardinalDirection(-I,O,1)):h>c?(k=this.getCardinalDirection(-M,O,1),F=this.getCardinalDirection(-I,O,3)):(k=this.getCardinalDirection(M,O,2),F=this.getCardinalDirection(I,O,4)),!x)switch(k){case 1:z=g,_=f+-T/O,l[0]=_,l[1]=z;break;case 2:_=m,z=h+E*O,l[0]=_,l[1]=z;break;case 3:z=b,_=f+T/O,l[0]=_,l[1]=z;break;case 4:_=y,z=h+-E*O,l[0]=_,l[1]=z;break}if(!N)switch(F){case 1:q=w,X=v+-P/O,l[2]=X,l[3]=q;break;case 2:X=S,q=c+D*O,l[2]=X,l[3]=q;break;case 3:q=R,X=v+P/O,l[2]=X,l[3]=q;break;case 4:X=A,q=c+-D*O,l[2]=X,l[3]=q;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})])})})(ci)),ci.exports}var gI=hi.exports,dE;function pI(){return dE||(dE=1,(function(t,e){(function(a,n){t.exports=n(dI())})(gI,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 k=O.length;C!=null&&k--;for(var F=0,_=O.length,z,X=w.getEdgesBetween(C);X.length>1;){var q=X[0];X.splice(0,1);var G=O.indexOf(q);G>=0&&O.splice(G,1),_--,k--}C!=null?z=(O.indexOf(X[0])+1)%_:z=0;for(var U=Math.abs(R-A)/k,K=z;F!=k;K=++K%_){var J=O[K].getOtherEnd(w);if(J!=C){var Y=(A+F*U)%360,H=(Y+U)%360;T.branchRadialLayout(J,w,Y,H,S+D,D),F++}}},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 k=w.getGraphManager().add(w.newGraph(),O),F=I.getChild();F.add(O);for(var _=0;_<C[N].length;_++){var z=C[N][_];F.remove(z),k.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,k=[N,I,M,O];if(P>0)for(var F=S;F<=D;F++)k[0]+=this.grid[F][P-1].length+this.grid[F][P].length-1;if(D<this.grid.length-1)for(var F=P;F<=x;F++)k[1]+=this.grid[D+1][F].length+this.grid[D][F].length-1;if(x<this.grid[0].length-1)for(var F=S;F<=D;F++)k[2]+=this.grid[F][x+1].length+this.grid[F][x].length-1;if(S>0)for(var F=P;F<=x;F++)k[3]+=this.grid[S-1][F].length+this.grid[S][F].length-1;for(var _=y.MAX_VALUE,z,X,q=0;q<k.length;q++)k[q]<_?(_=k[q],z=1,X=q):k[q]==_&&z++;if(z==3&&_==0)k[0]==0&&k[1]==0&&k[2]==0?C=1:k[0]==0&&k[1]==0&&k[3]==0?C=0:k[0]==0&&k[2]==0&&k[3]==0?C=3:k[1]==0&&k[2]==0&&k[3]==0&&(C=2);else if(z==2&&_==0){var G=Math.floor(Math.random()*2);k[0]==0&&k[1]==0?G==0?C=0:C=1:k[0]==0&&k[2]==0?G==0?C=0:C=2:k[0]==0&&k[3]==0?G==0?C=0:C=3:k[1]==0&&k[2]==0?G==0?C=1:C=2:k[1]==0&&k[3]==0?G==0?C=1:C=3:G==0?C=2:C=3}else if(z==4&&_==0){var G=Math.floor(Math.random()*4);C=G}else C=X;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})])})})(hi)),hi.exports}var yI=fi.exports,gE;function mI(){return gE||(gE=1,(function(t,e){(function(a,n){t.exports=n(pI())})(yI,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,k){typeof O=="number"&&(O=k);var F=O.data("id"),_=L.idToLNode[F];return{x:_.getRect().getCenterX(),y:_.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}))},k=L.options.refresh,F,_=0;_<k&&!F;_++)F=L.stopped||L.layout.tick();if(F){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(X,q){if(typeof X=="number"&&(X=q),!X.isParent()){for(var G=X.id(),U=z[G],K=X;U==null&&(U=z[K.data("parent")]||z["DummyCompound_"+K.data("parent")],z[G]=U,K=K.parent()[0],K!=null););return U!=null?{x:U.x,y:U.y}:{x:X.position("x"),y:X.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})])})})(fi)),fi.exports}var bI=mI();const CI=Av(bI);export{CI as a,TI as b,Sa as c,xI as f};