From 350c092de1ebaa6d6aeaa8a07a53a06ce0398191 Mon Sep 17 00:00:00 2001 From: Hamza Islam Date: Sun, 15 Sep 2024 22:53:24 +0500 Subject: [PATCH] #32 added sample graph of 350 nodes --- demo/index.js | 2 +- demo/samples/sample9.graphml | 4 ++++ dist/cytoscape-hyse.cjs.js | 10 ++++++++++ dist/cytoscape-hyse.esm.js | 10 ++++++++++ 4 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 demo/samples/sample9.graphml create mode 100644 dist/cytoscape-hyse.cjs.js create mode 100644 dist/cytoscape-hyse.esm.js diff --git a/demo/index.js b/demo/index.js index 0596c52..a377023 100644 --- a/demo/index.js +++ b/demo/index.js @@ -13,7 +13,7 @@ async function pageLoaded() { options.push("class"); options.push("bom"); options.push("knowledge-graph"); - for (let i = 1;i<9;i++){ + for (let i = 1;i<10;i++){ options.push("sample"+i); } for (const graph in window.experimentSmallGraphs) { diff --git a/demo/samples/sample9.graphml b/demo/samples/sample9.graphml new file mode 100644 index 0000000..4a71859 --- /dev/null +++ b/demo/samples/sample9.graphml @@ -0,0 +1,4 @@ + + + -33.22996391095831-836.6139692188997161.52178042377741-385.2564638304635-187.95504067037416-615.4868651705118573.1825895855731430.29548843062121992.9611657656812711.9095037835965147.4991166975554-321.056981231902852281.2188319942125747.93986721169811611.9190926716738753.2234582976236-484.6483302139271688.1291387806053-399.23801852905285514.9448611798033966.2032653453348-483.625920202097861152.7025589284015721.8299946915101-791.4743556025733724.206582933390711031.75978785233311001348.361610311517110011891.60550865013153001297.738766763132962001200.28959963925393001235.44742307990845200179.186907329825124002103.8835579120305312.1386076652563611611.9752369347311001476.383217972749262001418.0100038923728200245.668274671913371465.48595311329151887.98362775169413001919.900331529641920011098.43923852300671001485.077331401170750011356.989077762286601942.83722680661514001122.3293045791973001408.668169286410430539.9866974657524-267.668349801966511302.75694809370092001993.972055680343101537.494393537090101412.36482746344255001-111.969326578356811001-268.29883105758281001899.63340643981251001256.092295088533201655.952433822243601100.1479763200673610011451.073064066221110011304.48762124760511001769.493597661743401185.4309511898189566.68477288203611914.6311376393082-426.22209826756111633.30777577650061001487.141975693961573001171.421401935973120011367.2693338247994001811.33553719082001972.10480424492655001337.39498816709425500-280.6428158894542-900.68081030914981507.3009484923163600110.325581001892731347.83435971962741494.7161840815135100-22.10244359723707-673.652256197042312.32768660291802171001188.520070764548221001347.57861225594993001622.22668012547530011726.13829410622272001-33.1447874375675820011603.420563444836301478.73276772316827002192.580470003189370.383186446757751767.4870529260119100140.546283257736143001-178.278333057299052001965.57674585759210011659.71957557026782001270.65591215866317100139.77844526449428-642.57011107497511358.52363563983283200267.7114999896929-730.046149417271105.4253820934431320011230.1332333187847011714.8810125685873005.133950796489657-739.81402790041761684.07762786786074001422.78432574346581001275.155317084448430011625.105101931799330011038.792273666158750011165.8959989611876100137.25722615270383620011082.476556411922520011020.7968160244596001359.5874375825014001756.72716769507672001881.350328992516801620.02988956137154001936.709284361871860011529.13048558048151001974.038439395439820011487.7075224804516011233.95104053258210011701.2949028943321001242.788757589486786001593.61972825303456001564.2400289645065100-860.3325172560395-65.54234571431141430.5030695683336-532.75597369979231820.9958753305167300-221.66398392866878896.4089891465056-664.9313223952591773.185856918329711160.52228969055983001626.8804927550917500-457.89101329923636144.975923900628571-105.43672605593482001555.082486948340930011146.32959962808640013.9451714221655874001688.84740532267453001258.149564597909835001833.1848359037426100-472.3935510549829359.9050164824888-127.41750849576583683.276219909423311191.26248275833342001-134.988589826964643001330.3774270809595460011925.78621525312041002297.376697429597315.8523912584156511416.0525512708484200-131.2406441713299-774.490643643295711534.202504672890720011075.578623092772460011109.05330275717030958.3919617084042-702.21609421260611091.40267177123687001506.443066735410478001701.27533337191622001396.596517313416580011710.053900310019640011027.70002347980632001954.38400353715453001-46.03983742204242430011802.3386475660491001749.3068503580582-82.9535903195006511795.9230957637362001903.88635840333965001142.3579771898926911.0320263975666194.13773740768917-529.55267682506541724.480779594484370011871.81684330785520011379.4580261991823300317.15519333957917-544.6029101302611-363.4385817051257457.97006423801141343.746008392638547001279.098800871726678001291.6223167446676740011358.72219200480692001-73.314338834133274001417.59510570403073001876.81135862931314001172.587748877652645001779.7858937709875-179.407967859222911217.00870837709954001158.36308272467494600745.61043783608351331.194386070269512059.76880905350220011457.56850264521653001696.33479258536485001425.3300845984100540011076.55319249934974001598.3684168891702545.602686765846211136.4634243006032001666.560488363309790046.22003816615871-95.694553223311541-195.13424732426824001148.65769682210668001-318.889649389249772001222.613946741091984001151.72967409349474001299.2273939621712619.47565353055071096.29919350391741051.76181094868931533.307577178104200-222.2566921731469739.26641322231191185.813584716925270011246.48523477402420011529.833381874452240011595.632705038679420011539.08253739344153001589.929171643522620011090.38667657235730011008.82575532149834001645.878907428483620011956.74161914371962001555.90397974586945001555.29533966892684001019.3623552849748930.96102196313961419.00358276135816001851.121638731707560011021.9338042821663001-249.334408187740762001835.18439756687425001969.1720498090571700106.14001584654831-693.483488410373811048.68090167369138001754.692730343142630011509.95345907227855001812.496959007073140011446.8564750571954001680.260026007481360011108.69443794988625001-196.93311705543543001765.547588388941760060.617998215417651299.9220273142611903.979431965051440011806.32343444251023001-149.91014235063974001845.868807456973470011474.45777001493682001765.934289355760150011231.1572678321018300172.054334951879685001925.19843032231178001714.128397820466780011375.984932598457110011617.70588293326454001603.16692462670237001025.0777370830415867.34571985372591700.286402668620810011805.65862385665974001426.833791373850949001490.64380843894524001611.46273833278218001865.19598647621572001817.25176089097568001258.4978060460426783.133419141313111304.158407043644530011290.49834783763144001747.66018473528634001092.907469736544-472.4605258559423-866.063652519178594.2758439200985-908.5065484757067117.158945852284571040.0384319217296-365.99511201774754-827.9617750808009155.28747874723751-451.60138399753896578.8259898640634-663.1214938905619594.499093449725129.2653478781723031452.5447642424754-573.8905299232658553.4237350046424666.92997538542261102.91615094359462011.7650774990277630.4925649670807-606.4178348907773478.99961467643016445.9364141323402-397.78160374988335-153.74499775011483-965.99452636816640.06833848373514-356.464050868779487.9944591673651-449.93305341261004-887.360417855033324.14774016483742662.1128363818911275.5070532008971274.77670256606871091.862213538335-168.11031880116053801.4625123170833-528.5597159133846418.38397315398174-842.4461257225967.855303668944322.000001520938476573.7070445359279348.2687106368871-487.9140168750281-557.3588226232563750.4408435876746-118.51161561265761-883.0238677250017-241.16385202557498-821.08007672364151147.8158137709408-805.10963348315481793.1328352172889-363.8757815175387-12.0464524289824681396.66722360260342116.7724362382028652.9959863189981198.7626215305304682.3508848808823-21.30006773153305-458.94000676362762253.207998059966620.4251735498954-656.1596491409308694.54335690594032334.615656405689585.35194754068911582.3990346158198656.6539213886897362.63646676939044-607.5276132404638488.25848088866695-573.0546508717412252.3079739396043-684.0108942883631-683.8859363028681140.83758602763103-757.6704889660489531.69109049976371218.2922550666892952.73945486594941942.451017369127-351.26504533741314901.2444514177345-389.81922969237297893.6801192264667-535.43514772176162035.5295539566503777.311111064564130.860167479976641498.7816568990668661.10041513663491037.5512667095254-851.1580062048653497.836154734904651227.80390416492011040.9891032145072-145.8415194390005-540.46610046602971857.9024203187334-242.538457929060541123.5574746885034975.2515987734445-17.260557239221885650.69725055903921061.8899102368548-769.2775779383253663.62098211209291160.4949417062192868.2019300840063-144.96557913190202952.2733341461712-263.43212634358434-288.99366137336915838.36772505236511382.7296685502654782.79200807895511975.4506194795176-317.7895796596431168.677933545210831410.4201910930499589.36595344926141536.800375662899865.91893703017405-510.96208074475221934.8629132729136573.4496912636199149.75932120964492-750.58860795102581669.164898472467-143.902423402286331395.41856265481581054.48038721683061802.5114142378063-305.07613633462312139.911286300817-540.9058703577212214.0852137095258269.438353776041159.514356513242-729.474560778109881.22122750674727-407.204523298969042119.466676283328738.409402282352253.029588459238-595.9028301355683298.62426367870813952.29345602923662004.176927909548-246.271535129538251884.2767512151172-112.720144128930512106.493759863828-297.59742954236924652.0258629359781389.3714970842498-56.84837002980458-413.30512872756805-787.1291648660324640.72307312935672049.0596058272477-425.7464572633415193.660690055435421308.185566892141953.442764958496283.2746778504593-967.960006864741772.05371878009994925.5932022552555-629.61542666016241871.9662496102085534.99850880027361302.9154701677796719.81148466158022014.8466113796796-469.1365900777605999.3568151674012-430.64236263463881651.5010157905683701.3061283172854-182.66369366194226-712.4962303979278-975.5647161302354-15.847817192538269292.24872527596796-415.633920827133348.176387301440011551.12079324235652343.2294170473656641.010639555766828.964762074301962-615.4672093639194-763.903650591598495.73445091572893226.87213643338976-811.26912424965771777.17299425689522.2416194707737787-83.719162993333381494.47301995472661078.25264675605-664.58347893261335.7612234451335996.1199412621164-88.7586752761427-307.070711917506-779.47361004298570.113122656953007972231.732189438412695.2567813320711-628.118516089098368.08500587963165-587.3610481040713642.00108755636112084.400811454438-346.635830847277252060.119666417184-577.389533787965165.320707073593131212.0024210301203699.79846656239231543.7019407174048665.02552812825791484.294068016721061.247315576876-545.8601082093278 + \ No newline at end of file diff --git a/dist/cytoscape-hyse.cjs.js b/dist/cytoscape-hyse.cjs.js new file mode 100644 index 0000000..6b0b5ca --- /dev/null +++ b/dist/cytoscape-hyse.cjs.js @@ -0,0 +1,10 @@ +"use strict";var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};function e(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}function r(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function n(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,i,o=r.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(t){i={error:t}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return a}function i(t,e,r){if(r||2===arguments.length)for(var n,i=0,o=e.length;ie?(this.rect.x-=(this.labelWidth-e)/2,this.setWidth(this.labelWidth)):"right"==this.labelPosHorizontal&&this.setWidth(e+this.labelWidth)),this.labelHeight&&("top"==this.labelPosVertical?(this.rect.y-=this.labelHeight,this.setHeight(r+this.labelHeight)):"center"==this.labelPosVertical&&this.labelHeight>r?(this.rect.y-=(this.labelHeight-r)/2,this.setHeight(this.labelHeight)):"bottom"==this.labelPosVertical&&this.setHeight(r+this.labelHeight))}}},c.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==i.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},c.prototype.transform=function(t){var e=this.rect.x;e>a.WORLD_BOUNDARY?e=a.WORLD_BOUNDARY:e<-a.WORLD_BOUNDARY&&(e=-a.WORLD_BOUNDARY);var r=this.rect.y;r>a.WORLD_BOUNDARY?r=a.WORLD_BOUNDARY:r<-a.WORLD_BOUNDARY&&(r=-a.WORLD_BOUNDARY);var n=new u(e,r),i=t.inverseTransformPoint(n);this.setLocation(i.x,i.y)},c.prototype.getLeft=function(){return this.rect.x},c.prototype.getRight=function(){return this.rect.x+this.rect.width},c.prototype.getTop=function(){return this.rect.y},c.prototype.getBottom=function(){return this.rect.y+this.rect.height},c.prototype.getParent=function(){return null==this.owner?null:this.owner.getParent()},t.exports=c},function(t,e,r){var n=r(0);function i(){}for(var o in n)i[o]=n[o];i.MAX_ITERATIONS=2500,i.DEFAULT_EDGE_LENGTH=50,i.DEFAULT_SPRING_STRENGTH=.45,i.DEFAULT_REPULSION_STRENGTH=4500,i.DEFAULT_GRAVITY_STRENGTH=.4,i.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,i.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,i.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,i.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,i.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,i.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,i.COOLING_ADAPTATION_FACTOR=.33,i.ADAPTATION_LOWER_NODE_LIMIT=1e3,i.ADAPTATION_UPPER_NODE_LIMIT=5e3,i.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,i.MAX_NODE_DISPLACEMENT=3*i.MAX_NODE_DISPLACEMENT_INCREMENTAL,i.MIN_REPULSION_DIST=i.DEFAULT_EDGE_LENGTH/10,i.CONVERGENCE_CHECK_PERIOD=100,i.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,i.MIN_EDGE_LENGTH=1,i.GRID_CALCULATION_CHECK_PERIOD=10,t.exports=i},function(t,e,r){function n(t,e){null==t&&null==e?(this.x=0,this.y=0):(this.x=t,this.y=e)}n.prototype.getX=function(){return this.x},n.prototype.getY=function(){return this.y},n.prototype.setX=function(t){this.x=t},n.prototype.setY=function(t){this.y=t},n.prototype.getDifference=function(t){return new DimensionD(this.x-t.x,this.y-t.y)},n.prototype.getCopy=function(){return new n(this.x,this.y)},n.prototype.translate=function(t){return this.x+=t.width,this.y+=t.height,this},t.exports=n},function(t,e,r){var n=r(2),i=r(10),o=r(0),a=r(7),s=r(3),u=r(1),c=r(13),h=r(12),l=r(11);function f(t,e,r){n.call(this,r),this.estimatedSize=i.MIN_VALUE,this.margin=o.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=t,null!=e&&e instanceof a?this.graphManager=e:null!=e&&e instanceof Layout&&(this.graphManager=e.graphManager)}for(var d in f.prototype=Object.create(n.prototype),n)f[d]=n[d];f.prototype.getNodes=function(){return this.nodes},f.prototype.getEdges=function(){return this.edges},f.prototype.getGraphManager=function(){return this.graphManager},f.prototype.getParent=function(){return this.parent},f.prototype.getLeft=function(){return this.left},f.prototype.getRight=function(){return this.right},f.prototype.getTop=function(){return this.top},f.prototype.getBottom=function(){return this.bottom},f.prototype.isConnected=function(){return this.isConnected},f.prototype.add=function(t,e,r){if(null==e&&null==r){var n=t;if(null==this.graphManager)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(n)>-1)throw"Node already in graph!";return n.owner=this,this.getNodes().push(n),n}var i=t;if(!(this.getNodes().indexOf(e)>-1&&this.getNodes().indexOf(r)>-1))throw"Source or target not in graph!";if(e.owner!=r.owner||e.owner!=this)throw"Both owners must be this graph!";return e.owner!=r.owner?null:(i.source=e,i.target=r,i.isInterGraph=!1,this.getEdges().push(i),e.edges.push(i),r!=e&&r.edges.push(i),i)},f.prototype.remove=function(t){var e=t;if(t instanceof s){if(null==e)throw"Node is null!";if(null==e.owner||e.owner!=this)throw"Owner graph is invalid!";if(null==this.graphManager)throw"Owner graph manager is invalid!";for(var r=e.edges.slice(),n=r.length,i=0;i-1&&h>-1))throw"Source and/or target doesn't know this edge!";if(o.source.edges.splice(c,1),o.target!=o.source&&o.target.edges.splice(h,1),-1==(a=o.source.owner.getEdges().indexOf(o)))throw"Not in owner's edge list!";o.source.owner.getEdges().splice(a,1)}},f.prototype.updateLeftTop=function(){for(var t,e,r,n=i.MAX_VALUE,o=i.MAX_VALUE,a=this.getNodes(),s=a.length,u=0;u(t=c.getTop())&&(n=t),o>(e=c.getLeft())&&(o=e)}return n==i.MAX_VALUE?null:(r=null!=a[0].getParent().paddingLeft?a[0].getParent().paddingLeft:this.margin,this.left=o-r,this.top=n-r,new h(this.left,this.top))},f.prototype.updateBounds=function(t){for(var e,r,n,o,a,s=i.MAX_VALUE,u=-i.MAX_VALUE,h=i.MAX_VALUE,l=-i.MAX_VALUE,f=this.nodes,d=f.length,p=0;p(e=g.getLeft())&&(s=e),u<(r=g.getRight())&&(u=r),h>(n=g.getTop())&&(h=n),l<(o=g.getBottom())&&(l=o)}var v=new c(s,h,u-s,l-h);s==i.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),a=null!=f[0].getParent().paddingLeft?f[0].getParent().paddingLeft:this.margin,this.left=v.x-a,this.right=v.x+v.width+a,this.top=v.y-a,this.bottom=v.y+v.height+a},f.calculateBounds=function(t){for(var e,r,n,o,a=i.MAX_VALUE,s=-i.MAX_VALUE,u=i.MAX_VALUE,h=-i.MAX_VALUE,l=t.length,f=0;f(e=d.getLeft())&&(a=e),s<(r=d.getRight())&&(s=r),u>(n=d.getTop())&&(u=n),h<(o=d.getBottom())&&(h=o)}return new c(a,u,s-a,h-u)},f.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},f.prototype.getEstimatedSize=function(){if(this.estimatedSize==i.MIN_VALUE)throw"assert failed";return this.estimatedSize},f.prototype.calcEstimatedSize=function(){for(var t=0,e=this.nodes,r=e.length,n=0;n=this.nodes.length){var u=0;i.forEach((function(e){e.owner==t&&u++})),u==this.nodes.length&&(this.isConnected=!0)}}else this.isConnected=!0},t.exports=f},function(t,e,r){var n,i=r(1);function o(t){n=r(6),this.layout=t,this.graphs=[],this.edges=[]}o.prototype.addRoot=function(){var t=this.layout.newGraph(),e=this.layout.newNode(null),r=this.add(t,e);return this.setRootGraph(r),this.rootGraph},o.prototype.add=function(t,e,r,n,i){if(null==r&&null==n&&null==i){if(null==t)throw"Graph is null!";if(null==e)throw"Parent node is null!";if(this.graphs.indexOf(t)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(t),null!=t.parent)throw"Already has a parent!";if(null!=e.child)throw"Already has a child!";return t.parent=e,e.child=t,t}i=r,r=t;var o=(n=e).getOwner(),a=i.getOwner();if(null==o||o.getGraphManager()!=this)throw"Source not in this graph mgr!";if(null==a||a.getGraphManager()!=this)throw"Target not in this graph mgr!";if(o==a)return r.isInterGraph=!1,o.add(r,n,i);if(r.isInterGraph=!0,r.source=n,r.target=i,this.edges.indexOf(r)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(r),null==r.source||null==r.target)throw"Edge source and/or target is null!";if(-1!=r.source.edges.indexOf(r)||-1!=r.target.edges.indexOf(r))throw"Edge already in source and/or target incidency list!";return r.source.edges.push(r),r.target.edges.push(r),r},o.prototype.remove=function(t){if(t instanceof n){var e=t;if(e.getGraphManager()!=this)throw"Graph not in this graph mgr";if(e!=this.rootGraph&&(null==e.parent||e.parent.graphManager!=this))throw"Invalid parent node!";for(var r,o=[],a=(o=o.concat(e.getEdges())).length,s=0;s=e.getRight()?r[0]+=Math.min(e.getX()-t.getX(),t.getRight()-e.getRight()):e.getX()<=t.getX()&&e.getRight()>=t.getRight()&&(r[0]+=Math.min(t.getX()-e.getX(),e.getRight()-t.getRight())),t.getY()<=e.getY()&&t.getBottom()>=e.getBottom()?r[1]+=Math.min(e.getY()-t.getY(),t.getBottom()-e.getBottom()):e.getY()<=t.getY()&&e.getBottom()>=t.getBottom()&&(r[1]+=Math.min(t.getY()-e.getY(),e.getBottom()-t.getBottom()));var o=Math.abs((e.getCenterY()-t.getCenterY())/(e.getCenterX()-t.getCenterX()));e.getCenterY()===t.getCenterY()&&e.getCenterX()===t.getCenterX()&&(o=1);var a=o*r[0],s=r[1]/o;r[0]a)return r[0]=n,r[1]=u,r[2]=o,r[3]=_,!1;if(io)return r[0]=s,r[1]=i,r[2]=y,r[3]=a,!1;if(no?(r[0]=h,r[1]=l,x=!0):(r[0]=c,r[1]=u,x=!0):A===L&&(n>o?(r[0]=s,r[1]=u,x=!0):(r[0]=f,r[1]=l,x=!0)),-T===L?o>n?(r[2]=m,r[3]=_,N=!0):(r[2]=y,r[3]=v,N=!0):T===L&&(o>n?(r[2]=g,r[3]=v,N=!0):(r[2]=w,r[3]=_,N=!0)),x&&N)return!1;if(n>o?i>a?(C=this.getCardinalDirection(A,L,4),M=this.getCardinalDirection(T,L,2)):(C=this.getCardinalDirection(-A,L,3),M=this.getCardinalDirection(-T,L,1)):i>a?(C=this.getCardinalDirection(-A,L,1),M=this.getCardinalDirection(-T,L,3)):(C=this.getCardinalDirection(A,L,2),M=this.getCardinalDirection(T,L,4)),!x)switch(C){case 1:I=u,O=n+-p/L,r[0]=O,r[1]=I;break;case 2:O=f,I=i+d*L,r[0]=O,r[1]=I;break;case 3:I=l,O=n+p/L,r[0]=O,r[1]=I;break;case 4:O=h,I=i+-d*L,r[0]=O,r[1]=I}if(!N)switch(M){case 1:R=v,D=o+-b/L,r[2]=D,r[3]=R;break;case 2:D=w,R=a+E*L,r[2]=D,r[3]=R;break;case 3:R=_,D=o+b/L,r[2]=D,r[3]=R;break;case 4:D=m,R=a+-E*L,r[2]=D,r[3]=R}}return!1},i.getCardinalDirection=function(t,e,r){return t>e?r:1+r%4},i.getIntersection=function(t,e,r,i){if(null==i)return this.getIntersection2(t,e,r);var o,a,s,u,c,h,l,f=t.x,d=t.y,p=e.x,g=e.y,v=r.x,y=r.y,m=i.x,_=i.y;return 0==(l=(o=g-d)*(u=v-m)-(a=_-y)*(s=f-p))?null:new n((s*(h=m*y-v*_)-u*(c=p*d-f*g))/l,(a*c-o*h)/l)},i.angleOfVector=function(t,e,r,n){var i=void 0;return t!==r?(i=Math.atan((n-e)/(r-t)),r=0){var h=(-u+Math.sqrt(u*u-4*s*c))/(2*s),l=(-u-Math.sqrt(u*u-4*s*c))/(2*s);return h>=0&&h<=1?[h]:l>=0&&l<=1?[l]:null}return null},i.HALF_PI=.5*Math.PI,i.ONE_AND_HALF_PI=1.5*Math.PI,i.TWO_PI=2*Math.PI,i.THREE_PI=3*Math.PI,t.exports=i},function(t,e,r){function n(){}n.sign=function(t){return t>0?1:t<0?-1:0},n.floor=function(t){return t<0?Math.ceil(t):Math.floor(t)},n.ceil=function(t){return t<0?Math.floor(t):Math.ceil(t)},t.exports=n},function(t,e,r){function n(){}n.MAX_VALUE=2147483647,n.MIN_VALUE=-2147483648,t.exports=n},function(t,e,r){var n=function(){function t(t,e){for(var r=0;r0&&e;){for(s.push(c[0]);s.length>0&&e;){var h=s[0];s.splice(0,1),a.add(h);var l=h.getEdges();for(o=0;o-1&&c.splice(g,1)}a=new Set,u=new Map}else t=[]}return t},f.prototype.createDummyNodesForBendpoints=function(t){for(var e=[],r=t.source,n=this.graphManager.calcLowestCommonAncestor(t.source,t.target),i=0;i0){for(var i=this.edgeToDummyNodes.get(r),o=0;o=0&&e.splice(l,1),h.getNeighborsList().forEach((function(t){if(r.indexOf(t)<0){var e=n.get(t)-1;1==e&&u.push(t),n.set(t,e)}}))}r=r.concat(u),1!=e.length&&2!=e.length||(i=!0,o=e[0])}return o},f.prototype.setGraphManager=function(t){this.graphManager=t},t.exports=f},function(t,e,r){function n(){}n.seed=1,n.x=0,n.nextDouble=function(){return n.x=1e4*Math.sin(n.seed++),n.x-Math.floor(n.x)},t.exports=n},function(t,e,r){var n=r(5);function i(t,e){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}i.prototype.getWorldOrgX=function(){return this.lworldOrgX},i.prototype.setWorldOrgX=function(t){this.lworldOrgX=t},i.prototype.getWorldOrgY=function(){return this.lworldOrgY},i.prototype.setWorldOrgY=function(t){this.lworldOrgY=t},i.prototype.getWorldExtX=function(){return this.lworldExtX},i.prototype.setWorldExtX=function(t){this.lworldExtX=t},i.prototype.getWorldExtY=function(){return this.lworldExtY},i.prototype.setWorldExtY=function(t){this.lworldExtY=t},i.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},i.prototype.setDeviceOrgX=function(t){this.ldeviceOrgX=t},i.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},i.prototype.setDeviceOrgY=function(t){this.ldeviceOrgY=t},i.prototype.getDeviceExtX=function(){return this.ldeviceExtX},i.prototype.setDeviceExtX=function(t){this.ldeviceExtX=t},i.prototype.getDeviceExtY=function(){return this.ldeviceExtY},i.prototype.setDeviceExtY=function(t){this.ldeviceExtY=t},i.prototype.transformX=function(t){var e=0,r=this.lworldExtX;return 0!=r&&(e=this.ldeviceOrgX+(t-this.lworldOrgX)*this.ldeviceExtX/r),e},i.prototype.transformY=function(t){var e=0,r=this.lworldExtY;return 0!=r&&(e=this.ldeviceOrgY+(t-this.lworldOrgY)*this.ldeviceExtY/r),e},i.prototype.inverseTransformX=function(t){var e=0,r=this.ldeviceExtX;return 0!=r&&(e=this.lworldOrgX+(t-this.ldeviceOrgX)*this.lworldExtX/r),e},i.prototype.inverseTransformY=function(t){var e=0,r=this.ldeviceExtY;return 0!=r&&(e=this.lworldOrgY+(t-this.ldeviceOrgY)*this.lworldExtY/r),e},i.prototype.inverseTransformPoint=function(t){return new n(this.inverseTransformX(t.x),this.inverseTransformY(t.y))},t.exports=i},function(t,e,r){var n=r(15),i=r(4),o=r(0),a=r(8),s=r(9);function u(){n.call(this),this.useSmartIdealEdgeLengthCalculation=i.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=i.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=i.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=i.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=i.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*i.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=i.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=i.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=i.MAX_ITERATIONS}for(var c in u.prototype=Object.create(n.prototype),n)u[c]=n[c];u.prototype.initParameters=function(){n.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=i.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},u.prototype.calcIdealEdgeLengths=function(){for(var t,e,r,n,a,s,u,c=this.getGraphManager().getAllEdges(),h=0;hi.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*i.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(t-i.ADAPTATION_LOWER_NODE_LIMIT)/(i.ADAPTATION_UPPER_NODE_LIMIT-i.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-i.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=i.MAX_NODE_DISPLACEMENT_INCREMENTAL):(t>i.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(i.COOLING_ADAPTATION_FACTOR,1-(t-i.ADAPTATION_LOWER_NODE_LIMIT)/(i.ADAPTATION_UPPER_NODE_LIMIT-i.ADAPTATION_LOWER_NODE_LIMIT)*(1-i.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=i.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(5*this.getAllNodes().length,this.maxIterations),this.displacementThresholdPerNode=3*i.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},u.prototype.calcSpringForces=function(){for(var t,e=this.getAllEdges(),r=0;r0&&void 0!==arguments[0])||arguments[0],s=arguments.length>1&&void 0!==arguments[1]&&arguments[1],u=this.getAllNodes();if(this.useFRGridVariant)for(this.totalIterations%i.GRID_CALCULATION_CHECK_PERIOD==1&&a&&this.updateGrid(),o=new Set,t=0;t(u=e.getEstimatedSize()*this.gravityRangeFactor)||s>u)&&(t.gravitationForceX=-this.gravityConstant*i,t.gravitationForceY=-this.gravityConstant*o):(a>(u=e.getEstimatedSize()*this.compoundGravityRangeFactor)||s>u)&&(t.gravitationForceX=-this.gravityConstant*i*this.compoundGravityConstant,t.gravitationForceY=-this.gravityConstant*o*this.compoundGravityConstant)},u.prototype.isConverged=function(){var t,e=!1;return this.totalIterations>this.maxIterations/3&&(e=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),t=this.totalDisplacement=s.length||c>=s[0].length))for(var h=0;ht}}]),t}();t.exports=o},function(t,e,r){function n(){}n.svd=function(t){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=t.length,this.n=t[0].length;var e=Math.min(this.m,this.n);this.s=function(t){for(var e=[];t-- >0;)e.push(0);return e}(Math.min(this.m+1,this.n)),this.U=function t(e){if(0==e.length)return 0;for(var r=[],n=0;n0;)e.push(0);return e}(this.n),a=function(t){for(var e=[];t-- >0;)e.push(0);return e}(this.m),s=Math.min(this.m-1,this.n),u=Math.max(0,Math.min(this.n-2,this.m)),c=0;c=0;M--)if(0!==this.s[M]){for(var O=M+1;O=0;G--){if(function(t,e){return t&&e}(G0;){var W=void 0,V=void 0;for(W=T-2;W>=-1&&-1!==W;W--)if(Math.abs(o[W])<=B+H*(Math.abs(this.s[W])+Math.abs(this.s[W+1]))){o[W]=0;break}if(W===T-2)V=4;else{var q=void 0;for(q=T-1;q>=W&&q!==W;q--){var $=(q!==T?Math.abs(o[q]):0)+(q!==W+1?Math.abs(o[q-1]):0);if(Math.abs(this.s[q])<=B+H*$){this.s[q]=0;break}}q===W?V=3:q===T-1?V=1:(V=2,W=q)}switch(W++,V){case 1:var Z=o[T-2];o[T-2]=0;for(var K=T-2;K>=W;K--){var Q=n.hypot(this.s[K],Z),J=this.s[K]/Q,tt=Z/Q;this.s[K]=Q,K!==W&&(Z=-tt*o[K-1],o[K-1]=J*o[K-1]);for(var et=0;et=this.s[W+1]);){var Tt=this.s[W];if(this.s[W]=this.s[W+1],this.s[W+1]=Tt,WMath.abs(e)?(r=e/t,r=Math.abs(t)*Math.sqrt(1+r*r)):0!=e?(r=t/e,r=Math.abs(e)*Math.sqrt(1+r*r)):r=0,r},t.exports=n},function(t,e,r){var n=function(){function t(t,e){for(var r=0;r2&&void 0!==arguments[2]?arguments[2]:1,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1;i(this,t),this.sequence1=e,this.sequence2=r,this.match_score=n,this.mismatch_penalty=o,this.gap_penalty=a,this.iMax=e.length+1,this.jMax=r.length+1,this.grid=new Array(this.iMax);for(var s=0;s=0;r--){var n=this.listeners[r];n.event===t&&n.callback===e&&this.listeners.splice(r,1)}},i.emit=function(t,e){for(var r=0;r{var n={};n.layoutBase=r(551),n.CoSEConstants=r(806),n.CoSEEdge=r(767),n.CoSEGraph=r(880),n.CoSEGraphManager=r(578),n.CoSELayout=r(765),n.CoSENode=r(991),n.ConstraintHandler=r(902),t.exports=n},806:(t,e,r)=>{var n=r(551).FDLayoutConstants;function i(){}for(var o in n)i[o]=n[o];i.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,i.DEFAULT_RADIAL_SEPARATION=n.DEFAULT_EDGE_LENGTH,i.DEFAULT_COMPONENT_SEPERATION=60,i.TILE=!0,i.TILING_PADDING_VERTICAL=10,i.TILING_PADDING_HORIZONTAL=10,i.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,i.ENFORCE_CONSTRAINTS=!0,i.APPLY_LAYOUT=!0,i.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,i.TREE_REDUCTION_ON_INCREMENTAL=!0,i.PURE_INCREMENTAL=i.DEFAULT_INCREMENTAL,t.exports=i},767:(t,e,r)=>{var n=r(551).FDLayoutEdge;function i(t,e,r){n.call(this,t,e,r)}for(var o in i.prototype=Object.create(n.prototype),n)i[o]=n[o];t.exports=i},880:(t,e,r)=>{var n=r(551).LGraph;function i(t,e,r){n.call(this,t,e,r)}for(var o in i.prototype=Object.create(n.prototype),n)i[o]=n[o];t.exports=i},578:(t,e,r)=>{var n=r(551).LGraphManager;function i(t){n.call(this,t)}for(var o in i.prototype=Object.create(n.prototype),n)i[o]=n[o];t.exports=i},765:(t,e,r)=>{var n=r(551).FDLayout,i=r(578),o=r(880),a=r(991),s=r(767),u=r(806),c=r(902),h=r(551).FDLayoutConstants,l=r(551).LayoutConstants,f=r(551).Point,d=r(551).PointD,p=r(551).DimensionD,g=r(551).Layout,v=r(551).Integer,y=r(551).IGeometry,m=r(551).LGraph,_=r(551).Transform,w=r(551).LinkedList;function E(){n.call(this),this.toBeTiled={},this.constraints={}}for(var b in E.prototype=Object.create(n.prototype),n)E[b]=n[b];E.prototype.newGraphManager=function(){var t=new i(this);return this.graphManager=t,t},E.prototype.newGraph=function(t){return new o(null,this.graphManager,t)},E.prototype.newNode=function(t){return new a(this.graphManager,t)},E.prototype.newEdge=function(t){return new s(null,null,t)},E.prototype.initParameters=function(){n.prototype.initParameters.call(this,arguments),this.isSubLayout||(u.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=u.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=u.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=h.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=h.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=h.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=h.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},E.prototype.initSpringEmbedder=function(){n.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/h.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},E.prototype.layout=function(){return l.DEFAULT_CREATE_BENDS_AS_NEEDED&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},E.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)u.TREE_REDUCTION_ON_INCREMENTAL&&(this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation(),e=new Set(this.getAllNodes()),r=this.nodesWithGravity.filter((function(t){return e.has(t)})),this.graphManager.setAllNodesToApplyGravitation(r));else{var t=this.getFlatForest();if(t.length>0)this.positionNodesRadially(t);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var e=new Set(this.getAllNodes()),r=this.nodesWithGravity.filter((function(t){return e.has(t)}));this.graphManager.setAllNodesToApplyGravitation(r),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(c.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),u.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},E.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished){if(!(this.prunedNodesAll.length>0))return!0;this.isTreeGrowing=!0}if(this.totalIterations%h.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged()){if(!(this.prunedNodesAll.length>0))return!0;this.isTreeGrowing=!0}this.coolingCycle++,0==this.layoutQuality?this.coolingAdjuster=this.coolingCycle:1==this.layoutQuality&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var t=new Set(this.getAllNodes()),e=this.nodesWithGravity.filter((function(e){return t.has(e)}));this.graphManager.setAllNodesToApplyGravitation(e),this.graphManager.updateBounds(),this.updateGrid(),u.PURE_INCREMENTAL?this.coolingFactor=h.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=h.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()),u.PURE_INCREMENTAL?this.coolingFactor=h.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=h.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var r=!this.isTreeGrowing&&!this.isGrowthFinished,n=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(r,n),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},E.prototype.getPositionsData=function(){for(var t=this.graphManager.getAllNodes(),e={},r=0;r0&&this.updateDisplacements(),e=0;e0&&(n.fixedNodeWeight=o)}if(this.constraints.relativePlacementConstraint){var a=new Map,s=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach((function(e){t.fixedNodesOnHorizontal.add(e),t.fixedNodesOnVertical.add(e)})),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical){var c=this.constraints.alignmentConstraint.vertical;for(r=0;r=2*t.length/3;n--)e=Math.floor(Math.random()*(n+1)),r=t[n],t[n]=t[e],t[e]=r;return t},this.nodesInRelativeHorizontal=[],this.nodesInRelativeVertical=[],this.nodeToRelativeConstraintMapHorizontal=new Map,this.nodeToRelativeConstraintMapVertical=new Map,this.nodeToTempPositionMapHorizontal=new Map,this.nodeToTempPositionMapVertical=new Map,this.constraints.relativePlacementConstraint.forEach((function(e){if(e.left){var r=a.has(e.left)?a.get(e.left):e.left,n=a.has(e.right)?a.get(e.right):e.right;t.nodesInRelativeHorizontal.includes(r)||(t.nodesInRelativeHorizontal.push(r),t.nodeToRelativeConstraintMapHorizontal.set(r,[]),t.dummyToNodeForVerticalAlignment.has(r)?t.nodeToTempPositionMapHorizontal.set(r,t.idToNodeMap.get(t.dummyToNodeForVerticalAlignment.get(r)[0]).getCenterX()):t.nodeToTempPositionMapHorizontal.set(r,t.idToNodeMap.get(r).getCenterX())),t.nodesInRelativeHorizontal.includes(n)||(t.nodesInRelativeHorizontal.push(n),t.nodeToRelativeConstraintMapHorizontal.set(n,[]),t.dummyToNodeForVerticalAlignment.has(n)?t.nodeToTempPositionMapHorizontal.set(n,t.idToNodeMap.get(t.dummyToNodeForVerticalAlignment.get(n)[0]).getCenterX()):t.nodeToTempPositionMapHorizontal.set(n,t.idToNodeMap.get(n).getCenterX())),t.nodeToRelativeConstraintMapHorizontal.get(r).push({right:n,gap:e.gap}),t.nodeToRelativeConstraintMapHorizontal.get(n).push({left:r,gap:e.gap})}else{var i=s.has(e.top)?s.get(e.top):e.top,o=s.has(e.bottom)?s.get(e.bottom):e.bottom;t.nodesInRelativeVertical.includes(i)||(t.nodesInRelativeVertical.push(i),t.nodeToRelativeConstraintMapVertical.set(i,[]),t.dummyToNodeForHorizontalAlignment.has(i)?t.nodeToTempPositionMapVertical.set(i,t.idToNodeMap.get(t.dummyToNodeForHorizontalAlignment.get(i)[0]).getCenterY()):t.nodeToTempPositionMapVertical.set(i,t.idToNodeMap.get(i).getCenterY())),t.nodesInRelativeVertical.includes(o)||(t.nodesInRelativeVertical.push(o),t.nodeToRelativeConstraintMapVertical.set(o,[]),t.dummyToNodeForHorizontalAlignment.has(o)?t.nodeToTempPositionMapVertical.set(o,t.idToNodeMap.get(t.dummyToNodeForHorizontalAlignment.get(o)[0]).getCenterY()):t.nodeToTempPositionMapVertical.set(o,t.idToNodeMap.get(o).getCenterY())),t.nodeToRelativeConstraintMapVertical.get(i).push({bottom:o,gap:e.gap}),t.nodeToRelativeConstraintMapVertical.get(o).push({top:i,gap:e.gap})}}));else{var l=new Map,f=new Map;this.constraints.relativePlacementConstraint.forEach((function(t){if(t.left){var e=a.has(t.left)?a.get(t.left):t.left,r=a.has(t.right)?a.get(t.right):t.right;l.has(e)?l.get(e).push(r):l.set(e,[r]),l.has(r)?l.get(r).push(e):l.set(r,[e])}else{var n=s.has(t.top)?s.get(t.top):t.top,i=s.has(t.bottom)?s.get(t.bottom):t.bottom;f.has(n)?f.get(n).push(i):f.set(n,[i]),f.has(i)?f.get(i).push(n):f.set(i,[n])}}));var d=function(t,e){var r=[],n=[],i=new w,o=new Set,a=0;return t.forEach((function(s,u){if(!o.has(u)){r[a]=[],n[a]=!1;var c=u;for(i.push(c),o.add(c),r[a].push(c);0!=i.length;)c=i.shift(),e.has(c)&&(n[a]=!0),t.get(c).forEach((function(t){o.has(t)||(i.push(t),o.add(t),r[a].push(t))}));a++}})),{components:r,isFixed:n}},p=d(l,t.fixedNodesOnHorizontal);this.componentsOnHorizontal=p.components,this.fixedComponentsOnHorizontal=p.isFixed;var g=d(f,t.fixedNodesOnVertical);this.componentsOnVertical=g.components,this.fixedComponentsOnVertical=g.isFixed}}},E.prototype.updateDisplacements=function(){var t=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach((function(e){var r=t.idToNodeMap.get(e.nodeId);r.displacementX=0,r.displacementY=0})),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var e=this.constraints.alignmentConstraint.vertical,r=0;r1)for(s=0;sn&&(n=Math.floor(a.y)),o=Math.floor(a.x+u.DEFAULT_COMPONENT_SEPERATION)}this.transform(new d(l.WORLD_CENTER_X-a.x/2,l.WORLD_CENTER_Y-a.y/2))},E.radialLayout=function(t,e,r){var n=Math.max(this.maxDiagonalInTree(t),u.DEFAULT_RADIAL_SEPARATION);E.branchRadialLayout(e,null,0,359,0,n);var i=m.calculateBounds(t),o=new _;o.setDeviceOrgX(i.getMinX()),o.setDeviceOrgY(i.getMinY()),o.setWorldOrgX(r.x),o.setWorldOrgY(r.y);for(var a=0;a1;){var v=g[0];g.splice(0,1);var m=h.indexOf(v);m>=0&&h.splice(m,1),p--,l--}f=null!=e?(h.indexOf(g[0])+1)%p:0;for(var _=Math.abs(n-r)/l,w=f;d!=l;w=++w%p){var b=h[w].getOtherEnd(t);if(b!=e){var x=(r+d*_)%360,N=(x+_)%360;E.branchRadialLayout(b,t,x,N,i+o,o),d++}}},E.maxDiagonalInTree=function(t){for(var e=v.MIN_VALUE,r=0;re&&(e=n)}return e},E.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},E.prototype.groupZeroDegreeMembers=function(){var t=this,e={};this.memberGroups={},this.idToDummyNode={};for(var r=[],n=this.graphManager.getAllNodes(),i=0;i1){var n="DummyCompound_"+r;t.memberGroups[n]=e[r];var i=e[r][0].getParent(),o=new a(t.graphManager);o.id=n,o.paddingLeft=i.paddingLeft||0,o.paddingRight=i.paddingRight||0,o.paddingBottom=i.paddingBottom||0,o.paddingTop=i.paddingTop||0,t.idToDummyNode[n]=o;var s=t.getGraphManager().add(t.newGraph(),o),u=i.getChild();u.add(o);for(var c=0;ci?(n.rect.x-=(n.labelWidth-i)/2,n.setWidth(n.labelWidth),n.labelMarginLeft=(n.labelWidth-i)/2):"right"==n.labelPosHorizontal&&n.setWidth(i+n.labelWidth)),n.labelHeight&&("top"==n.labelPosVertical?(n.rect.y-=n.labelHeight,n.setHeight(o+n.labelHeight),n.labelMarginTop=n.labelHeight):"center"==n.labelPosVertical&&n.labelHeight>o?(n.rect.y-=(n.labelHeight-o)/2,n.setHeight(n.labelHeight),n.labelMarginTop=(n.labelHeight-o)/2):"bottom"==n.labelPosVertical&&n.setHeight(o+n.labelHeight))}}))},E.prototype.repopulateCompounds=function(){for(var t=this.compoundOrder.length-1;t>=0;t--){var e=this.compoundOrder[t],r=e.id,n=e.paddingLeft,i=e.paddingTop,o=e.labelMarginLeft,a=e.labelMarginTop;this.adjustLocations(this.tiledMemberPack[r],e.rect.x,e.rect.y,n,i,o,a)}},E.prototype.repopulateZeroDegreeMembers=function(){var t=this,e=this.tiledZeroDegreePack;Object.keys(e).forEach((function(r){var n=t.idToDummyNode[r],i=n.paddingLeft,o=n.paddingTop,a=n.labelMarginLeft,s=n.labelMarginTop;t.adjustLocations(e[r],n.rect.x,n.rect.y,i,o,a,s)}))},E.prototype.getToBeTiled=function(t){var e=t.id;if(null!=this.toBeTiled[e])return this.toBeTiled[e];var r=t.getChild();if(null==r)return this.toBeTiled[e]=!1,!1;for(var n=r.getNodes(),i=0;i0)return this.toBeTiled[e]=!1,!1;if(null!=o.getChild()){if(!this.getToBeTiled(o))return this.toBeTiled[e]=!1,!1}else this.toBeTiled[o.id]=!1}return this.toBeTiled[e]=!0,!0},E.prototype.getNodeDegree=function(t){t.id;for(var e=t.getEdges(),r=0,n=0;nh&&(h=f.rect.height)}r+=h+t.verticalPadding}},E.prototype.tileCompoundMembers=function(t,e){var r=this;this.tiledMemberPack=[],Object.keys(t).forEach((function(n){var i=e[n];if(r.tiledMemberPack[n]=r.tileNodes(t[n],i.paddingLeft+i.paddingRight),i.rect.width=r.tiledMemberPack[n].width,i.rect.height=r.tiledMemberPack[n].height,i.setCenter(r.tiledMemberPack[n].centerX,r.tiledMemberPack[n].centerY),i.labelMarginLeft=0,i.labelMarginTop=0,u.NODE_DIMENSIONS_INCLUDE_LABELS){var o=i.rect.width,a=i.rect.height;i.labelWidth&&("left"==i.labelPosHorizontal?(i.rect.x-=i.labelWidth,i.setWidth(o+i.labelWidth),i.labelMarginLeft=i.labelWidth):"center"==i.labelPosHorizontal&&i.labelWidth>o?(i.rect.x-=(i.labelWidth-o)/2,i.setWidth(i.labelWidth),i.labelMarginLeft=(i.labelWidth-o)/2):"right"==i.labelPosHorizontal&&i.setWidth(o+i.labelWidth)),i.labelHeight&&("top"==i.labelPosVertical?(i.rect.y-=i.labelHeight,i.setHeight(a+i.labelHeight),i.labelMarginTop=i.labelHeight):"center"==i.labelPosVertical&&i.labelHeight>a?(i.rect.y-=(i.labelHeight-a)/2,i.setHeight(i.labelHeight),i.labelMarginTop=(i.labelHeight-a)/2):"bottom"==i.labelPosVertical&&i.setHeight(a+i.labelHeight))}}))},E.prototype.tileNodes=function(t,e){var r=this.tileNodesByFavoringDim(t,e,!0),n=this.tileNodesByFavoringDim(t,e,!1),i=this.getOrgRatio(r);return this.getOrgRatio(n)s&&(s=t.getWidth())}));var c,h=o/i,l=a/i,f=Math.pow(r-n,2)+4*(h+n)*(l+r)*i,d=(n-r+Math.sqrt(f))/(2*(h+n));e?(c=Math.ceil(d))==d&&c++:c=Math.floor(d);var p=c*(h+n)-n;return s>p&&(p=s),p+=2*n},E.prototype.tileNodesByFavoringDim=function(t,e,r){var n=u.TILING_PADDING_VERTICAL,i=u.TILING_PADDING_HORIZONTAL,o=u.TILING_COMPARE_BY,a={rows:[],rowWidth:[],rowHeight:[],width:0,height:e,verticalPadding:n,horizontalPadding:i,centerX:0,centerY:0};o&&(a.idealRowWidth=this.calcIdealRowWidth(t,r));var s=function(t){return t.rect.width*t.rect.height},c=function(t,e){return s(e)-s(t)};t.sort((function(t,e){var r=c;return a.idealRowWidth?(r=o)(t.id,e.id):r(t,e)}));for(var h=0,l=0,f=0;f0&&(o+=t.horizontalPadding),t.rowWidth[r]=o,t.width0&&(a+=t.verticalPadding);var s=0;a>t.rowHeight[r]&&(s=t.rowHeight[r],t.rowHeight[r]=a,s=t.rowHeight[r]-s),t.height+=s,t.rows[r].push(e)},E.prototype.getShortestRowIndex=function(t){for(var e=-1,r=Number.MAX_VALUE,n=0;nr&&(e=n,r=t.rowWidth[n]);return e},E.prototype.canAddHorizontal=function(t,e,r){if(t.idealRowWidth){var n=t.rows.length-1;return t.rowWidth[n]+e+t.horizontalPadding<=t.idealRowWidth}var i=this.getShortestRowIndex(t);if(i<0)return!0;var o=t.rowWidth[i];if(o+t.horizontalPadding+e<=t.width)return!0;var a,s,u=0;return t.rowHeight[i]0&&(u=r+t.verticalPadding-t.rowHeight[i]),a=t.width-o>=e+t.horizontalPadding?(t.height+u)/(o+e+t.horizontalPadding):(t.height+u)/t.width,u=r+t.verticalPadding,(s=t.widtho&&e!=r){n.splice(-1,1),t.rows[r].push(i),t.rowWidth[e]=t.rowWidth[e]-o,t.rowWidth[r]=t.rowWidth[r]+o,t.width=t.rowWidth[instance.getLongestRowIndex(t)];for(var a=Number.MIN_VALUE,s=0;sa&&(a=n[s].height);e>0&&(a+=t.verticalPadding);var u=t.rowHeight[e]+t.rowHeight[r];t.rowHeight[e]=a,t.rowHeight[r]0)for(var l=i;l<=o;l++)c[0]+=this.grid[l][a-1].length+this.grid[l][a].length-1;if(o0)for(l=a;l<=s;l++)c[3]+=this.grid[i-1][l].length+this.grid[i][l].length-1;for(var f,d,p=v.MAX_VALUE,g=0;g{var n=r(551).FDLayoutNode,i=r(551).IMath;function o(t,e,r,i){n.call(this,t,e,r,i)}for(var a in o.prototype=Object.create(n.prototype),n)o[a]=n[a];o.prototype.calculateDisplacement=function(){var t=this.graphManager.getLayout();null!=this.getChild()&&this.fixedNodeWeight?(this.displacementX+=t.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=t.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=t.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=t.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>t.coolingFactor*t.maxNodeDisplacement&&(this.displacementX=t.coolingFactor*t.maxNodeDisplacement*i.sign(this.displacementX)),Math.abs(this.displacementY)>t.coolingFactor*t.maxNodeDisplacement&&(this.displacementY=t.coolingFactor*t.maxNodeDisplacement*i.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},o.prototype.propogateDisplacementToChildren=function(t,e){for(var r,n=this.getChild().getNodes(),i=0;i{function n(t){if(Array.isArray(t)){for(var e=0,r=Array(t.length);e0){var o=0;n.forEach((function(t){"horizontal"==e?(l.set(t,u.has(t)?c[u.get(t)]:i.get(t)),o+=l.get(t)):(l.set(t,u.has(t)?h[u.get(t)]:i.get(t)),o+=l.get(t))})),o/=n.length,t.forEach((function(t){r.has(t)||l.set(t,o)}))}else{var a=0;t.forEach((function(t){a+="horizontal"==e?u.has(t)?c[u.get(t)]:i.get(t):u.has(t)?h[u.get(t)]:i.get(t)})),a/=t.length,t.forEach((function(t){l.set(t,a)}))}}));for(var p=function(){var n=d.shift();t.get(n).forEach((function(t){if(l.get(t.id)a&&(a=m),_s&&(s=_)}}catch(t){d=!0,p=t}finally{try{!f&&v.return&&v.return()}finally{if(d)throw p}}var w=(n+a)/2-(o+s)/2,E=!0,b=!1,x=void 0;try{for(var N,A=t[Symbol.iterator]();!(E=(N=A.next()).done);E=!0){var T=N.value;l.set(T,l.get(T)+w)}}catch(t){b=!0,x=t}finally{try{!E&&A.return&&A.return()}finally{if(b)throw x}}}))}return l},y=function(t){var e=0,r=0,n=0,i=0;if(t.forEach((function(t){t.left?c[u.get(t.left)]-c[u.get(t.right)]>=0?e++:r++:h[u.get(t.top)]-h[u.get(t.bottom)]>=0?n++:i++})),e>r&&n>i)for(var o=0;or)for(var a=0;ai)for(var s=0;s1)e.fixedNodeConstraint.forEach((function(t,e){E[e]=[t.position.x,t.position.y],b[e]=[c[u.get(t.nodeId)],h[u.get(t.nodeId)]]})),x=!0;else if(e.alignmentConstraint)!function(){var t=0;if(e.alignmentConstraint.vertical){for(var r=e.alignmentConstraint.vertical,i=function(e){var i=new Set;r[e].forEach((function(t){i.add(t)}));var o=new Set([].concat(n(i)).filter((function(t){return A.has(t)}))),a=void 0;a=o.size>0?c[u.get(o.values().next().value)]:g(i).x,r[e].forEach((function(e){E[t]=[a,h[u.get(e)]],b[t]=[c[u.get(e)],h[u.get(e)]],t++}))},o=0;o0?c[u.get(i.values().next().value)]:g(r).y,a[e].forEach((function(e){E[t]=[c[u.get(e)],o],b[t]=[c[u.get(e)],h[u.get(e)]],t++}))},l=0;lM&&(M=C[I].length,O=I);if(M0){var V={x:0,y:0};e.fixedNodeConstraint.forEach((function(t,e){var r,n,i={x:c[u.get(t.nodeId)],y:h[u.get(t.nodeId)]},o=t.position,a=(n=i,{x:(r=o).x-n.x,y:r.y-n.y});V.x+=a.x,V.y+=a.y})),V.x/=e.fixedNodeConstraint.length,V.y/=e.fixedNodeConstraint.length,c.forEach((function(t,e){c[e]+=V.x})),h.forEach((function(t,e){h[e]+=V.y})),e.fixedNodeConstraint.forEach((function(t){c[u.get(t.nodeId)]=t.position.x,h[u.get(t.nodeId)]=t.position.y}))}if(e.alignmentConstraint){if(e.alignmentConstraint.vertical)for(var q=e.alignmentConstraint.vertical,$=function(t){var e=new Set;q[t].forEach((function(t){e.add(t)}));var r=new Set([].concat(n(e)).filter((function(t){return A.has(t)}))),i=void 0;i=r.size>0?c[u.get(r.values().next().value)]:g(e).x,e.forEach((function(t){A.has(t)||(c[u.get(t)]=i)}))},Z=0;Z0?h[u.get(r.values().next().value)]:g(e).y,e.forEach((function(t){A.has(t)||(h[u.get(t)]=i)}))},J=0;J{e.exports=t}},r={},n=function t(n){var i=r[n];if(void 0!==i)return i.exports;var o=r[n]={exports:{}};return e[n](o,o.exports,t),o.exports}(45),n;var e,r,n}))}(u);var h=u.exports,l=function(t){function r(e,r,n,i,o,a){var s=t.call(this,e,r,n,i)||this;return s.layerIdx=-1,s.order=-1,s.isDirected=0,s.id=o,s.rank=a,s.noOfChildren=1,s.parentId="",s}return e(r,t),r.prototype.calculateDisplacement=function(){var t=this.graphManager.getLayout(),e=t.coolingFactor;1==this.isDirected&&(e=.7*t.directedCoolingFactor),this.displacementX+=e*(this.springForceX+this.repulsionForceX)/this.noOfChildren,1!==this.isDirected&&(this.displacementY+=e*(this.springForceY+this.repulsionForceY)/this.noOfChildren),Math.abs(this.displacementX)>e*t.maxNodeDisplacement&&(this.displacementX=e*t.maxNodeDisplacement*u.exports.layoutBase.IMath.sign(this.displacementX)),1!=this.isDirected&&Math.abs(this.displacementY)>e*t.maxNodeDisplacement&&(this.displacementY=e*t.maxNodeDisplacement*u.exports.layoutBase.IMath.sign(this.displacementY)),this.child&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},r.prototype.propogateDisplacementToChildren=function(t,e){this.child.nodes.forEach((function(r){r.child?r.propogateDisplacementToChildren(t,e):(r.displacementX+=t,r.displacementY+=e)}))},r.prototype.move=function(){var t=this.graphManager.getLayout();this.child||(1!=this.isDirected?(this.moveBy(this.displacementX,this.displacementY),t.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY),0===this.isDirected?t.undirectedDisplacement+=Math.abs(this.displacementY):t.directedDisplacement+=Math.abs(this.displacementY)):(this.moveBy(this.displacementX,0),t.totalDisplacement+=Math.abs(this.displacementX),1==this.isDirected?t.directedDisplacement+=Math.abs(this.displacementY):t.undirectedDisplacement+=Math.abs(this.displacementY)))},r.prototype.swapPositionWith=function(t,e){void 0===e&&(e=!0);var n=t.rect.x,i=t.rect.y,o=this.rect.x,a=this.rect.y;if(u.exports.layoutBase.uniformNodeDimensions||(n0&&this.prepareOrderedLayers(),this.prepareCompoundNodes(),this.dummyCompoundNodes.forEach((function(t){r.graphManager.getRoot().add(t),r.graphManager.allNodes.push(t)})),this.graphManager.getRoot().calcEstimatedSize();var u=0;for(s=0;s0&&(void 0===r[a]&&(r[a]=new Set),s.forEach((function(t){r[a].has(t)||r[a].add(t)}))),t.child&&t.child.nodes.forEach((function(t){i(t,a)})),t.parentId){var u=t.owner.parent;i(u,a)}t.edges.filter((function(t){return 1!=t.source.isDirected&&1!=t.target.isDirected})).forEach((function(e){var r=e.source.id==t.id?e.target:e.source;i(r,a)}))}},o=function(t){var e=t.edges.filter((function(t){return 1==t.source.isDirected||1==t.target.isDirected}));return e.length>0?e.map((function(e){return e.source.id==t.id?e.target:e.source})):[]},a=this.graphManager.allNodes.filter((function(t){return 1!=t.isDirected})),s=0;sf.rect.x+f.rect.width)&&(f=t),(1!=d.isDirected||t.rect.yp.rect.y+p.rect.height)&&(p=t)}));var g=function(n){var i=Object.keys(e)[n],o=e[Object.keys(e)[n]],a=r[i],s=[],c=[];null==a||0==a.size?(c.push(p.rect.y+p.rect.height),s.push(f.rect.x+f.rect.width)):a.forEach((function(t){s.push(t.rect.x),c.push(t.rect.y)}));var g=v.newGraph(),y=0;o.forEach((function(t){t.setRect({x:0,y:0},t.rect),y++,t.parentId||g.add(t)})),g.calcEstimatedSize();var m=new u.exports.layoutBase.PointD(0,0),_=new u.exports.layoutBase.DimensionD(g.getEstimatedSize(),g.getEstimatedSize()),w=new l(v.graphManager,m,_,null,"compoundNode"+i,-1);w.isDirected=0,w.nodeRepulsion=v.nodeRepulsion,w.noOfChildren=y,v.graphManager.add(g,w);var E=s.reduce((function(t,e){return t+e}))/s.length,b=c.reduce((function(t,e){return t+e}))/c.length,x=Math.abs(Math.abs(b)-Math.abs(d.rect.y)),N=Math.abs(p.rect.y+p.rect.height-b),A=Math.abs(Math.abs(E)-Math.abs(h.rect.x)),T=Math.abs(f.rect.x+f.rect.width-E),L=Math.min(x,N,A,T),C=x==L,M=A==L,O=T==L,I=N==L,D=new u.exports.layoutBase.PointD(E,b),R=function(t,e){return!(e.x>t.x+t.width||e.x+e.widtht.y+t.height||e.y+e.heighte.rect.x&&(s=e),a=!0):(s=e,a=!0):u.push(e)})),a&&null!=s&&(t.setRect({x:s.rect.x-50-t.rect.width,y:D.y-t.rect.height/2},t.rect),F(t,e,r))}else if("up"==e){var c=!1,h=null,f=[];r.forEach((function(e){R(t.rect,e.rect)?null!=h&&h instanceof l?(h.rect.y>e.rect.y&&(h=e),c=!0):(h=e,c=!0):f.push(e)})),c&&null!=h&&(t.setRect({x:D.x-t.rect.width/2,y:h.rect.y-50-t.rect.height},t.rect),F(t,e,r))}else if("down"==e){var d=!1,p=null,g=[];r.forEach((function(e){R(t.rect,e.rect)?null!=p&&p instanceof l?(p.rect.y+p.rect.heightthis.maxIterations/3&&(e=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),t=this.totalDisplacement<2*this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,this.oldDirectedDisplacement=this.directedDisplacement,this.oldUndirectedDisplacement=this.undirectedDisplacement,t||e},r.prototype.tick=function(){if(this.totalIterations++,this.totalIterations%u.exports.CoSEConstants.CONVERGENCE_CHECK_PERIOD==0){if(this.isDirectedConverged()||this.totalIterations>this.maxIterations)return!0;this.isFastCooling?this.coolingFactor=this.initialCoolingFactor*((this.maxIterations-this.totalIterations*this.coolingCoefficient)/this.maxIterations):this.coolingFactor=this.initialCoolingFactor*((this.maxIterations-this.totalIterations)/this.maxIterations),this.coolingFactor<0&&(this.coolingFactor=0)}return this.totalDisplacement=0,this.graphManager.updateBounds(),t.prototype.calcSpringForces.call(this),this.useFRGridVariant?this.gridRepulsion():(this.calcRepulsionForces(),this.repulsionTopLevel()),this.swapAndFlip(),this.moveNodes(),!1},r.prototype.gridRepulsion=function(){var t,e=null,r=this.graphManager.getAllNodes();(this.totalIterations%u.exports.layoutBase.FDLayoutConstants.GRID_CALCULATION_CHECK_PERIOD==1||this.forceUpdateGrid)&&this.updateGrid(),t=new Set;for(var n=0;n=a.length||c>=a[0].length))for(var h=0;ho?o-a:a-o),Math.abs(c)s||i>a&&othis.swapForceLimit&&e.push({pairId:s,swapForce:c,layerId:n,n1:o,n2:a,order1:i,order2:i+1,connectedEdgeCount:u})}}e.length>0&&(this.forceUpdateGrid=!0),e.sort((function(t,e){return e.swapForce-t.swapForce}));var h={};for(r=0;rr){var s=r+(t[a].rect.x-r)*o;t[a].moveBy(s-t[a].rect.x,0)}else{s=r-(r-t[a].rect.x)*o;t[a].moveBy(s-t[a].rect.x,0)}(new Date).getTime()},r.prototype.setPositionsFromLayering=function(){for(var t=this.orderedLayers,e=this.orderGap,r=Math.max.apply(Math,i([],n(t.map((function(t){return t.length}))),!1))*e,o=0;oc.source.rect.x&&s.target.rect.xc.target.rect.x)&&e++)}},n=this,i=0;i=this.orderedLayers[t][e+1].rect.x)return!1;return!0},r.prototype.maintainLayers=function(t){var e=t.displacementX>0?t.order+1:t.order-1,r=this.orderedLayers[t.layerIdx][e];if(t.displacementX>0)for(;r&&t.rect.x>r.rect.x;)this.swapOnOrderedLayers(t.layerIdx,e-1,e),e++,r=this.orderedLayers[t.layerIdx][e];else for(;r&&t.rect.x + * Copyright OpenJS Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ +!function(t,e){(function(){var r,n="Expected a function",i="__lodash_hash_undefined__",o="__lodash_placeholder__",s=16,u=32,c=64,h=128,l=256,f=1/0,d=9007199254740991,p=NaN,g=4294967295,v=[["ary",h],["bind",1],["bindKey",2],["curry",8],["curryRight",s],["flip",512],["partial",u],["partialRight",c],["rearg",l]],y="[object Arguments]",m="[object Array]",_="[object Boolean]",w="[object Date]",E="[object Error]",b="[object Function]",x="[object GeneratorFunction]",N="[object Map]",A="[object Number]",T="[object Object]",L="[object Promise]",C="[object RegExp]",M="[object Set]",O="[object String]",I="[object Symbol]",D="[object WeakMap]",R="[object ArrayBuffer]",F="[object DataView]",P="[object Float32Array]",S="[object Float64Array]",G="[object Int8Array]",j="[object Int16Array]",k="[object Int32Array]",U="[object Uint8Array]",Y="[object Uint8ClampedArray]",X="[object Uint16Array]",z="[object Uint32Array]",H=/\b__p \+= '';/g,B=/\b(__p \+=) '' \+/g,W=/(__e\(.*?\)|\b__t\)) \+\n'';/g,V=/&(?:amp|lt|gt|quot|#39);/g,q=/[&<>"']/g,$=RegExp(V.source),Z=RegExp(q.source),K=/<%-([\s\S]+?)%>/g,Q=/<%([\s\S]+?)%>/g,J=/<%=([\s\S]+?)%>/g,tt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,et=/^\w*$/,rt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,nt=/[\\^$.*+?()[\]{}|]/g,it=RegExp(nt.source),ot=/^\s+/,at=/\s/,st=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ut=/\{\n\/\* \[wrapped with (.+)\] \*/,ct=/,? & /,ht=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,lt=/[()=,{}\[\]\/\s]/,ft=/\\(\\)?/g,dt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,pt=/\w*$/,gt=/^[-+]0x[0-9a-f]+$/i,vt=/^0b[01]+$/i,yt=/^\[object .+?Constructor\]$/,mt=/^0o[0-7]+$/i,_t=/^(?:0|[1-9]\d*)$/,wt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Et=/($^)/,bt=/['\n\r\u2028\u2029\\]/g,xt="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Nt="\\u2700-\\u27bf",At="a-z\\xdf-\\xf6\\xf8-\\xff",Tt="A-Z\\xc0-\\xd6\\xd8-\\xde",Lt="\\ufe0e\\ufe0f",Ct="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Mt="['’]",Ot="[\\ud800-\\udfff]",It="["+Ct+"]",Dt="["+xt+"]",Rt="\\d+",Ft="[\\u2700-\\u27bf]",Pt="["+At+"]",St="[^\\ud800-\\udfff"+Ct+Rt+Nt+At+Tt+"]",Gt="\\ud83c[\\udffb-\\udfff]",jt="[^\\ud800-\\udfff]",kt="(?:\\ud83c[\\udde6-\\uddff]){2}",Ut="[\\ud800-\\udbff][\\udc00-\\udfff]",Yt="["+Tt+"]",Xt="(?:"+Pt+"|"+St+")",zt="(?:"+Yt+"|"+St+")",Ht="(?:['’](?:d|ll|m|re|s|t|ve))?",Bt="(?:['’](?:D|LL|M|RE|S|T|VE))?",Wt="(?:"+Dt+"|"+Gt+")"+"?",Vt="[\\ufe0e\\ufe0f]?",qt=Vt+Wt+("(?:\\u200d(?:"+[jt,kt,Ut].join("|")+")"+Vt+Wt+")*"),$t="(?:"+[Ft,kt,Ut].join("|")+")"+qt,Zt="(?:"+[jt+Dt+"?",Dt,kt,Ut,Ot].join("|")+")",Kt=RegExp(Mt,"g"),Qt=RegExp(Dt,"g"),Jt=RegExp(Gt+"(?="+Gt+")|"+Zt+qt,"g"),te=RegExp([Yt+"?"+Pt+"+"+Ht+"(?="+[It,Yt,"$"].join("|")+")",zt+"+"+Bt+"(?="+[It,Yt+Xt,"$"].join("|")+")",Yt+"?"+Xt+"+"+Ht,Yt+"+"+Bt,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Rt,$t].join("|"),"g"),ee=RegExp("[\\u200d\\ud800-\\udfff"+xt+Lt+"]"),re=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ne=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],ie=-1,oe={};oe[P]=oe[S]=oe[G]=oe[j]=oe[k]=oe[U]=oe[Y]=oe[X]=oe[z]=!0,oe[y]=oe[m]=oe[R]=oe[_]=oe[F]=oe[w]=oe[E]=oe[b]=oe[N]=oe[A]=oe[T]=oe[C]=oe[M]=oe[O]=oe[D]=!1;var ae={};ae[y]=ae[m]=ae[R]=ae[F]=ae[_]=ae[w]=ae[P]=ae[S]=ae[G]=ae[j]=ae[k]=ae[N]=ae[A]=ae[T]=ae[C]=ae[M]=ae[O]=ae[I]=ae[U]=ae[Y]=ae[X]=ae[z]=!0,ae[E]=ae[b]=ae[D]=!1;var se={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ue=parseFloat,ce=parseInt,he="object"==typeof a&&a&&a.Object===Object&&a,le="object"==typeof self&&self&&self.Object===Object&&self,fe=he||le||Function("return this")(),de=e&&!e.nodeType&&e,pe=de&&t&&!t.nodeType&&t,ge=pe&&pe.exports===de,ve=ge&&he.process,ye=function(){try{var t=pe&&pe.require&&pe.require("util").types;return t||ve&&ve.binding&&ve.binding("util")}catch(t){}}(),me=ye&&ye.isArrayBuffer,_e=ye&&ye.isDate,we=ye&&ye.isMap,Ee=ye&&ye.isRegExp,be=ye&&ye.isSet,xe=ye&&ye.isTypedArray;function Ne(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}function Ae(t,e,r,n){for(var i=-1,o=null==t?0:t.length;++i-1}function Ie(t,e,r){for(var n=-1,i=null==t?0:t.length;++n-1;);return r}function tr(t,e){for(var r=t.length;r--&&Ue(e,t[r],0)>-1;);return r}function er(t,e){for(var r=t.length,n=0;r--;)t[r]===e&&++n;return n}var rr=Be({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),nr=Be({"&":"&","<":"<",">":">",'"':""","'":"'"});function ir(t){return"\\"+se[t]}function or(t){return ee.test(t)}function ar(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r}function sr(t,e){return function(r){return t(e(r))}}function ur(t,e){for(var r=-1,n=t.length,i=0,a=[];++r",""":'"',"'":"'"});var gr=function t(e){var a,at=(e=null==e?fe:gr.defaults(fe.Object(),e,gr.pick(fe,ne))).Array,xt=e.Date,Nt=e.Error,At=e.Function,Tt=e.Math,Lt=e.Object,Ct=e.RegExp,Mt=e.String,Ot=e.TypeError,It=at.prototype,Dt=At.prototype,Rt=Lt.prototype,Ft=e["__core-js_shared__"],Pt=Dt.toString,St=Rt.hasOwnProperty,Gt=0,jt=(a=/[^.]+$/.exec(Ft&&Ft.keys&&Ft.keys.IE_PROTO||""))?"Symbol(src)_1."+a:"",kt=Rt.toString,Ut=Pt.call(Lt),Yt=fe._,Xt=Ct("^"+Pt.call(St).replace(nt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),zt=ge?e.Buffer:r,Ht=e.Symbol,Bt=e.Uint8Array,Wt=zt?zt.allocUnsafe:r,Vt=sr(Lt.getPrototypeOf,Lt),qt=Lt.create,$t=Rt.propertyIsEnumerable,Zt=It.splice,Jt=Ht?Ht.isConcatSpreadable:r,ee=Ht?Ht.iterator:r,se=Ht?Ht.toStringTag:r,he=function(){try{var t=po(Lt,"defineProperty");return t({},"",{}),t}catch(t){}}(),le=e.clearTimeout!==fe.clearTimeout&&e.clearTimeout,de=xt&&xt.now!==fe.Date.now&&xt.now,pe=e.setTimeout!==fe.setTimeout&&e.setTimeout,ve=Tt.ceil,ye=Tt.floor,Ge=Lt.getOwnPropertySymbols,Be=zt?zt.isBuffer:r,vr=e.isFinite,yr=It.join,mr=sr(Lt.keys,Lt),_r=Tt.max,wr=Tt.min,Er=xt.now,br=e.parseInt,xr=Tt.random,Nr=It.reverse,Ar=po(e,"DataView"),Tr=po(e,"Map"),Lr=po(e,"Promise"),Cr=po(e,"Set"),Mr=po(e,"WeakMap"),Or=po(Lt,"create"),Ir=Mr&&new Mr,Dr={},Rr=Yo(Ar),Fr=Yo(Tr),Pr=Yo(Lr),Sr=Yo(Cr),Gr=Yo(Mr),jr=Ht?Ht.prototype:r,kr=jr?jr.valueOf:r,Ur=jr?jr.toString:r;function Yr(t){if(is(t)&&!Va(t)&&!(t instanceof Br)){if(t instanceof Hr)return t;if(St.call(t,"__wrapped__"))return Xo(t)}return new Hr(t)}var Xr=function(){function t(){}return function(e){if(!ns(e))return{};if(qt)return qt(e);t.prototype=e;var n=new t;return t.prototype=r,n}}();function zr(){}function Hr(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=r}function Br(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=g,this.__views__=[]}function Wr(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e=e?t:e)),t}function hn(t,e,n,i,o,a){var s,u=1&e,c=2&e,h=4&e;if(n&&(s=o?n(t,i,o,a):n(t)),s!==r)return s;if(!ns(t))return t;var l=Va(t);if(l){if(s=function(t){var e=t.length,r=new t.constructor(e);e&&"string"==typeof t[0]&&St.call(t,"index")&&(r.index=t.index,r.input=t.input);return r}(t),!u)return Ii(t,s)}else{var f=yo(t),d=f==b||f==x;if(Ka(t))return Ai(t,u);if(f==T||f==y||d&&!o){if(s=c||d?{}:_o(t),!u)return c?function(t,e){return Di(t,vo(t),e)}(t,function(t,e){return t&&Di(e,Ps(e),t)}(s,t)):function(t,e){return Di(t,go(t),e)}(t,an(s,t))}else{if(!ae[f])return o?t:{};s=function(t,e,r){var n=t.constructor;switch(e){case R:return Ti(t);case _:case w:return new n(+t);case F:return function(t,e){var r=e?Ti(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}(t,r);case P:case S:case G:case j:case k:case U:case Y:case X:case z:return Li(t,r);case N:return new n;case A:case O:return new n(t);case C:return function(t){var e=new t.constructor(t.source,pt.exec(t));return e.lastIndex=t.lastIndex,e}(t);case M:return new n;case I:return i=t,kr?Lt(kr.call(i)):{}}var i}(t,f,u)}}a||(a=new Zr);var p=a.get(t);if(p)return p;a.set(t,s),cs(t)?t.forEach((function(r){s.add(hn(r,e,n,r,t,a))})):os(t)&&t.forEach((function(r,i){s.set(i,hn(r,e,n,i,t,a))}));var g=l?r:(h?c?ao:oo:c?Ps:Fs)(t);return Te(g||t,(function(r,i){g&&(r=t[i=r]),rn(s,i,hn(r,e,n,i,t,a))})),s}function ln(t,e,n){var i=n.length;if(null==t)return!i;for(t=Lt(t);i--;){var o=n[i],a=e[o],s=t[o];if(s===r&&!(o in t)||!a(s))return!1}return!0}function fn(t,e,i){if("function"!=typeof t)throw new Ot(n);return Fo((function(){t.apply(r,i)}),e)}function dn(t,e,r,n){var i=-1,o=Oe,a=!0,s=t.length,u=[],c=e.length;if(!s)return u;r&&(e=De(e,Ze(r))),n?(o=Ie,a=!1):e.length>=200&&(o=Qe,a=!1,e=new $r(e));t:for(;++i-1},Vr.prototype.set=function(t,e){var r=this.__data__,n=nn(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this},qr.prototype.clear=function(){this.size=0,this.__data__={hash:new Wr,map:new(Tr||Vr),string:new Wr}},qr.prototype.delete=function(t){var e=lo(this,t).delete(t);return this.size-=e?1:0,e},qr.prototype.get=function(t){return lo(this,t).get(t)},qr.prototype.has=function(t){return lo(this,t).has(t)},qr.prototype.set=function(t,e){var r=lo(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this},$r.prototype.add=$r.prototype.push=function(t){return this.__data__.set(t,i),this},$r.prototype.has=function(t){return this.__data__.has(t)},Zr.prototype.clear=function(){this.__data__=new Vr,this.size=0},Zr.prototype.delete=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r},Zr.prototype.get=function(t){return this.__data__.get(t)},Zr.prototype.has=function(t){return this.__data__.has(t)},Zr.prototype.set=function(t,e){var r=this.__data__;if(r instanceof Vr){var n=r.__data__;if(!Tr||n.length<199)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new qr(n)}return r.set(t,e),this.size=r.size,this};var pn=Pi(bn),gn=Pi(xn,!0);function vn(t,e){var r=!0;return pn(t,(function(t,n,i){return r=!!e(t,n,i)})),r}function yn(t,e,n){for(var i=-1,o=t.length;++i0&&r(s)?e>1?_n(s,e-1,r,n,i):Re(i,s):n||(i[i.length]=s)}return i}var wn=Si(),En=Si(!0);function bn(t,e){return t&&wn(t,e,Fs)}function xn(t,e){return t&&En(t,e,Fs)}function Nn(t,e){return Me(e,(function(e){return ts(t[e])}))}function An(t,e){for(var n=0,i=(e=Ei(e,t)).length;null!=t&&ne}function Mn(t,e){return null!=t&&St.call(t,e)}function On(t,e){return null!=t&&e in Lt(t)}function In(t,e,n){for(var i=n?Ie:Oe,o=t[0].length,a=t.length,s=a,u=at(a),c=1/0,h=[];s--;){var l=t[s];s&&e&&(l=De(l,Ze(e))),c=wr(l.length,c),u[s]=!n&&(e||o>=120&&l.length>=120)?new $r(s&&l):r}l=t[0];var f=-1,d=u[0];t:for(;++f=s?u:u*("desc"==r[n]?-1:1)}return t.index-e.index}(t,e,r)}))}function Vn(t,e,r){for(var n=-1,i=e.length,o={};++n-1;)s!==t&&Zt.call(s,u,1),Zt.call(t,u,1);return t}function $n(t,e){for(var r=t?e.length:0,n=r-1;r--;){var i=e[r];if(r==n||i!==o){var o=i;Eo(i)?Zt.call(t,i,1):di(t,i)}}return t}function Zn(t,e){return t+ye(xr()*(e-t+1))}function Kn(t,e){var r="";if(!t||e<1||e>d)return r;do{e%2&&(r+=t),(e=ye(e/2))&&(t+=t)}while(e);return r}function Qn(t,e){return Po(Mo(t,e,au),t+"")}function Jn(t){return Qr(zs(t))}function ti(t,e){var r=zs(t);return jo(r,cn(e,0,r.length))}function ei(t,e,n,i){if(!ns(t))return t;for(var o=-1,a=(e=Ei(e,t)).length,s=a-1,u=t;null!=u&&++oi?0:i+e),(r=r>i?i:r)<0&&(r+=i),i=e>r?0:r-e>>>0,e>>>=0;for(var o=at(i);++n>>1,a=t[o];null!==a&&!ls(a)&&(r?a<=e:a=200){var c=e?null:Ki(t);if(c)return cr(c);a=!1,i=Qe,u=new $r}else u=e?[]:s;t:for(;++n=i?t:oi(t,e,n)}var Ni=le||function(t){return fe.clearTimeout(t)};function Ai(t,e){if(e)return t.slice();var r=t.length,n=Wt?Wt(r):new t.constructor(r);return t.copy(n),n}function Ti(t){var e=new t.constructor(t.byteLength);return new Bt(e).set(new Bt(t)),e}function Li(t,e){var r=e?Ti(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}function Ci(t,e){if(t!==e){var n=t!==r,i=null===t,o=t==t,a=ls(t),s=e!==r,u=null===e,c=e==e,h=ls(e);if(!u&&!h&&!a&&t>e||a&&s&&c&&!u&&!h||i&&s&&c||!n&&c||!o)return 1;if(!i&&!a&&!h&&t1?n[o-1]:r,s=o>2?n[2]:r;for(a=t.length>3&&"function"==typeof a?(o--,a):r,s&&bo(n[0],n[1],s)&&(a=o<3?r:a,o=1),e=Lt(e);++i-1?o[a?e[s]:s]:r}}function Yi(t){return io((function(e){var i=e.length,o=i,a=Hr.prototype.thru;for(t&&e.reverse();o--;){var s=e[o];if("function"!=typeof s)throw new Ot(n);if(a&&!u&&"wrapper"==uo(s))var u=new Hr([],!0)}for(o=u?o:i;++o1&&m.reverse(),f&&cu))return!1;var h=a.get(t),l=a.get(e);if(h&&l)return h==e&&l==t;var f=-1,d=!0,p=2&n?new $r:r;for(a.set(t,e),a.set(e,t);++f-1&&t%1==0&&t1?"& ":"")+e[n],e=e.join(r>2?", ":" "),t.replace(st,"{\n/* [wrapped with "+e+"] */\n")}(n,function(t,e){return Te(v,(function(r){var n="_."+r[0];e&r[1]&&!Oe(t,n)&&t.push(n)})),t.sort()}(function(t){var e=t.match(ut);return e?e[1].split(ct):[]}(n),r)))}function Go(t){var e=0,n=0;return function(){var i=Er(),o=16-(i-n);if(n=i,o>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(r,arguments)}}function jo(t,e){var n=-1,i=t.length,o=i-1;for(e=e===r?i:e;++n1?t[e-1]:r;return n="function"==typeof n?(t.pop(),n):r,ua(t,n)}));function ga(t){var e=Yr(t);return e.__chain__=!0,e}function va(t,e){return e(t)}var ya=io((function(t){var e=t.length,n=e?t[0]:0,i=this.__wrapped__,o=function(e){return un(e,t)};return!(e>1||this.__actions__.length)&&i instanceof Br&&Eo(n)?((i=i.slice(n,+n+(e?1:0))).__actions__.push({func:va,args:[o],thisArg:r}),new Hr(i,this.__chain__).thru((function(t){return e&&!t.length&&t.push(r),t}))):this.thru(o)}));var ma=Ri((function(t,e,r){St.call(t,r)?++t[r]:sn(t,r,1)}));var _a=Ui(Wo),wa=Ui(Vo);function Ea(t,e){return(Va(t)?Te:pn)(t,ho(e,3))}function ba(t,e){return(Va(t)?Le:gn)(t,ho(e,3))}var xa=Ri((function(t,e,r){St.call(t,r)?t[r].push(e):sn(t,r,[e])}));var Na=Qn((function(t,e,r){var n=-1,i="function"==typeof e,o=$a(t)?at(t.length):[];return pn(t,(function(t){o[++n]=i?Ne(e,t,r):Dn(t,e,r)})),o})),Aa=Ri((function(t,e,r){sn(t,r,e)}));function Ta(t,e){return(Va(t)?De:Yn)(t,ho(e,3))}var La=Ri((function(t,e,r){t[r?0:1].push(e)}),(function(){return[[],[]]}));var Ca=Qn((function(t,e){if(null==t)return[];var r=e.length;return r>1&&bo(t,e[0],e[1])?e=[]:r>2&&bo(e[0],e[1],e[2])&&(e=[e[0]]),Wn(t,_n(e,1),[])})),Ma=de||function(){return fe.Date.now()};function Oa(t,e,n){return e=n?r:e,e=t&&null==e?t.length:e,Ji(t,h,r,r,r,r,e)}function Ia(t,e){var i;if("function"!=typeof e)throw new Ot(n);return t=ys(t),function(){return--t>0&&(i=e.apply(this,arguments)),t<=1&&(e=r),i}}var Da=Qn((function(t,e,r){var n=1;if(r.length){var i=ur(r,co(Da));n|=u}return Ji(t,n,e,r,i)})),Ra=Qn((function(t,e,r){var n=3;if(r.length){var i=ur(r,co(Ra));n|=u}return Ji(e,n,t,r,i)}));function Fa(t,e,i){var o,a,s,u,c,h,l=0,f=!1,d=!1,p=!0;if("function"!=typeof t)throw new Ot(n);function g(e){var n=o,i=a;return o=a=r,l=e,u=t.apply(i,n)}function v(t){return l=t,c=Fo(m,e),f?g(t):u}function y(t){var n=t-h;return h===r||n>=e||n<0||d&&t-l>=s}function m(){var t=Ma();if(y(t))return _(t);c=Fo(m,function(t){var r=e-(t-h);return d?wr(r,s-(t-l)):r}(t))}function _(t){return c=r,p&&o?g(t):(o=a=r,u)}function w(){var t=Ma(),n=y(t);if(o=arguments,a=this,h=t,n){if(c===r)return v(h);if(d)return Ni(c),c=Fo(m,e),g(h)}return c===r&&(c=Fo(m,e)),u}return e=_s(e)||0,ns(i)&&(f=!!i.leading,s=(d="maxWait"in i)?_r(_s(i.maxWait)||0,e):s,p="trailing"in i?!!i.trailing:p),w.cancel=function(){c!==r&&Ni(c),l=0,o=h=a=c=r},w.flush=function(){return c===r?u:_(Ma())},w}var Pa=Qn((function(t,e){return fn(t,1,e)})),Sa=Qn((function(t,e,r){return fn(t,_s(e)||0,r)}));function Ga(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new Ot(n);var r=function(){var n=arguments,i=e?e.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var a=t.apply(this,n);return r.cache=o.set(i,a)||o,a};return r.cache=new(Ga.Cache||qr),r}function ja(t){if("function"!=typeof t)throw new Ot(n);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}Ga.Cache=qr;var ka=bi((function(t,e){var r=(e=1==e.length&&Va(e[0])?De(e[0],Ze(ho())):De(_n(e,1),Ze(ho()))).length;return Qn((function(n){for(var i=-1,o=wr(n.length,r);++i=e})),Wa=Rn(function(){return arguments}())?Rn:function(t){return is(t)&&St.call(t,"callee")&&!$t.call(t,"callee")},Va=at.isArray,qa=me?Ze(me):function(t){return is(t)&&Ln(t)==R};function $a(t){return null!=t&&rs(t.length)&&!ts(t)}function Za(t){return is(t)&&$a(t)}var Ka=Be||_u,Qa=_e?Ze(_e):function(t){return is(t)&&Ln(t)==w};function Ja(t){if(!is(t))return!1;var e=Ln(t);return e==E||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!ss(t)}function ts(t){if(!ns(t))return!1;var e=Ln(t);return e==b||e==x||"[object AsyncFunction]"==e||"[object Proxy]"==e}function es(t){return"number"==typeof t&&t==ys(t)}function rs(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=d}function ns(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function is(t){return null!=t&&"object"==typeof t}var os=we?Ze(we):function(t){return is(t)&&yo(t)==N};function as(t){return"number"==typeof t||is(t)&&Ln(t)==A}function ss(t){if(!is(t)||Ln(t)!=T)return!1;var e=Vt(t);if(null===e)return!0;var r=St.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&Pt.call(r)==Ut}var us=Ee?Ze(Ee):function(t){return is(t)&&Ln(t)==C};var cs=be?Ze(be):function(t){return is(t)&&yo(t)==M};function hs(t){return"string"==typeof t||!Va(t)&&is(t)&&Ln(t)==O}function ls(t){return"symbol"==typeof t||is(t)&&Ln(t)==I}var fs=xe?Ze(xe):function(t){return is(t)&&rs(t.length)&&!!oe[Ln(t)]};var ds=qi(Un),ps=qi((function(t,e){return t<=e}));function gs(t){if(!t)return[];if($a(t))return hs(t)?fr(t):Ii(t);if(ee&&t[ee])return function(t){for(var e,r=[];!(e=t.next()).done;)r.push(e.value);return r}(t[ee]());var e=yo(t);return(e==N?ar:e==M?cr:zs)(t)}function vs(t){return t?(t=_s(t))===f||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function ys(t){var e=vs(t),r=e%1;return e==e?r?e-r:e:0}function ms(t){return t?cn(ys(t),0,g):0}function _s(t){if("number"==typeof t)return t;if(ls(t))return p;if(ns(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=ns(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=$e(t);var r=vt.test(t);return r||mt.test(t)?ce(t.slice(2),r?2:8):gt.test(t)?p:+t}function ws(t){return Di(t,Ps(t))}function Es(t){return null==t?"":li(t)}var bs=Fi((function(t,e){if(To(e)||$a(e))Di(e,Fs(e),t);else for(var r in e)St.call(e,r)&&rn(t,r,e[r])})),xs=Fi((function(t,e){Di(e,Ps(e),t)})),Ns=Fi((function(t,e,r,n){Di(e,Ps(e),t,n)})),As=Fi((function(t,e,r,n){Di(e,Fs(e),t,n)})),Ts=io(un);var Ls=Qn((function(t,e){t=Lt(t);var n=-1,i=e.length,o=i>2?e[2]:r;for(o&&bo(e[0],e[1],o)&&(i=1);++n1),e})),Di(t,ao(t),r),n&&(r=hn(r,7,ro));for(var i=e.length;i--;)di(r,e[i]);return r}));var ks=io((function(t,e){return null==t?{}:function(t,e){return Vn(t,e,(function(e,r){return Os(t,r)}))}(t,e)}));function Us(t,e){if(null==t)return{};var r=De(ao(t),(function(t){return[t]}));return e=ho(e),Vn(t,r,(function(t,r){return e(t,r[0])}))}var Ys=Qi(Fs),Xs=Qi(Ps);function zs(t){return null==t?[]:Ke(t,Fs(t))}var Hs=ji((function(t,e,r){return e=e.toLowerCase(),t+(r?Bs(e):e)}));function Bs(t){return Js(Es(t).toLowerCase())}function Ws(t){return(t=Es(t))&&t.replace(wt,rr).replace(Qt,"")}var Vs=ji((function(t,e,r){return t+(r?"-":"")+e.toLowerCase()})),qs=ji((function(t,e,r){return t+(r?" ":"")+e.toLowerCase()})),$s=Gi("toLowerCase");var Zs=ji((function(t,e,r){return t+(r?"_":"")+e.toLowerCase()}));var Ks=ji((function(t,e,r){return t+(r?" ":"")+Js(e)}));var Qs=ji((function(t,e,r){return t+(r?" ":"")+e.toUpperCase()})),Js=Gi("toUpperCase");function tu(t,e,n){return t=Es(t),(e=n?r:e)===r?function(t){return re.test(t)}(t)?function(t){return t.match(te)||[]}(t):function(t){return t.match(ht)||[]}(t):t.match(e)||[]}var eu=Qn((function(t,e){try{return Ne(t,r,e)}catch(t){return Ja(t)?t:new Nt(t)}})),ru=io((function(t,e){return Te(e,(function(e){e=Uo(e),sn(t,e,Da(t[e],t))})),t}));function nu(t){return function(){return t}}var iu=Yi(),ou=Yi(!0);function au(t){return t}function su(t){return Gn("function"==typeof t?t:hn(t,1))}var uu=Qn((function(t,e){return function(r){return Dn(r,t,e)}})),cu=Qn((function(t,e){return function(r){return Dn(t,r,e)}}));function hu(t,e,r){var n=Fs(e),i=Nn(e,n);null!=r||ns(e)&&(i.length||!n.length)||(r=e,e=t,t=this,i=Nn(e,Fs(e)));var o=!(ns(r)&&"chain"in r&&!r.chain),a=ts(t);return Te(i,(function(r){var n=e[r];t[r]=n,a&&(t.prototype[r]=function(){var e=this.__chain__;if(o||e){var r=t(this.__wrapped__),i=r.__actions__=Ii(this.__actions__);return i.push({func:n,args:arguments,thisArg:t}),r.__chain__=e,r}return n.apply(t,Re([this.value()],arguments))})})),t}function lu(){}var fu=Bi(De),du=Bi(Ce),pu=Bi(Se);function gu(t){return xo(t)?He(Uo(t)):function(t){return function(e){return An(e,t)}}(t)}var vu=Vi(),yu=Vi(!0);function mu(){return[]}function _u(){return!1}var wu=Hi((function(t,e){return t+e}),0),Eu=Zi("ceil"),bu=Hi((function(t,e){return t/e}),1),xu=Zi("floor");var Nu,Au=Hi((function(t,e){return t*e}),1),Tu=Zi("round"),Lu=Hi((function(t,e){return t-e}),0);return Yr.after=function(t,e){if("function"!=typeof e)throw new Ot(n);return t=ys(t),function(){if(--t<1)return e.apply(this,arguments)}},Yr.ary=Oa,Yr.assign=bs,Yr.assignIn=xs,Yr.assignInWith=Ns,Yr.assignWith=As,Yr.at=Ts,Yr.before=Ia,Yr.bind=Da,Yr.bindAll=ru,Yr.bindKey=Ra,Yr.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return Va(t)?t:[t]},Yr.chain=ga,Yr.chunk=function(t,e,n){e=(n?bo(t,e,n):e===r)?1:_r(ys(e),0);var i=null==t?0:t.length;if(!i||e<1)return[];for(var o=0,a=0,s=at(ve(i/e));oo?0:o+n),(i=i===r||i>o?o:ys(i))<0&&(i+=o),i=n>i?0:ms(i);n>>0)?(t=Es(t))&&("string"==typeof e||null!=e&&!us(e))&&!(e=li(e))&&or(t)?xi(fr(t),0,n):t.split(e,n):[]},Yr.spread=function(t,e){if("function"!=typeof t)throw new Ot(n);return e=null==e?0:_r(ys(e),0),Qn((function(r){var n=r[e],i=xi(r,0,e);return n&&Re(i,n),Ne(t,this,i)}))},Yr.tail=function(t){var e=null==t?0:t.length;return e?oi(t,1,e):[]},Yr.take=function(t,e,n){return t&&t.length?oi(t,0,(e=n||e===r?1:ys(e))<0?0:e):[]},Yr.takeRight=function(t,e,n){var i=null==t?0:t.length;return i?oi(t,(e=i-(e=n||e===r?1:ys(e)))<0?0:e,i):[]},Yr.takeRightWhile=function(t,e){return t&&t.length?gi(t,ho(e,3),!1,!0):[]},Yr.takeWhile=function(t,e){return t&&t.length?gi(t,ho(e,3)):[]},Yr.tap=function(t,e){return e(t),t},Yr.throttle=function(t,e,r){var i=!0,o=!0;if("function"!=typeof t)throw new Ot(n);return ns(r)&&(i="leading"in r?!!r.leading:i,o="trailing"in r?!!r.trailing:o),Fa(t,e,{leading:i,maxWait:e,trailing:o})},Yr.thru=va,Yr.toArray=gs,Yr.toPairs=Ys,Yr.toPairsIn=Xs,Yr.toPath=function(t){return Va(t)?De(t,Uo):ls(t)?[t]:Ii(ko(Es(t)))},Yr.toPlainObject=ws,Yr.transform=function(t,e,r){var n=Va(t),i=n||Ka(t)||fs(t);if(e=ho(e,4),null==r){var o=t&&t.constructor;r=i?n?new o:[]:ns(t)&&ts(o)?Xr(Vt(t)):{}}return(i?Te:bn)(t,(function(t,n,i){return e(r,t,n,i)})),r},Yr.unary=function(t){return Oa(t,1)},Yr.union=ia,Yr.unionBy=oa,Yr.unionWith=aa,Yr.uniq=function(t){return t&&t.length?fi(t):[]},Yr.uniqBy=function(t,e){return t&&t.length?fi(t,ho(e,2)):[]},Yr.uniqWith=function(t,e){return e="function"==typeof e?e:r,t&&t.length?fi(t,r,e):[]},Yr.unset=function(t,e){return null==t||di(t,e)},Yr.unzip=sa,Yr.unzipWith=ua,Yr.update=function(t,e,r){return null==t?t:pi(t,e,wi(r))},Yr.updateWith=function(t,e,n,i){return i="function"==typeof i?i:r,null==t?t:pi(t,e,wi(n),i)},Yr.values=zs,Yr.valuesIn=function(t){return null==t?[]:Ke(t,Ps(t))},Yr.without=ca,Yr.words=tu,Yr.wrap=function(t,e){return Ua(wi(e),t)},Yr.xor=ha,Yr.xorBy=la,Yr.xorWith=fa,Yr.zip=da,Yr.zipObject=function(t,e){return mi(t||[],e||[],rn)},Yr.zipObjectDeep=function(t,e){return mi(t||[],e||[],ei)},Yr.zipWith=pa,Yr.entries=Ys,Yr.entriesIn=Xs,Yr.extend=xs,Yr.extendWith=Ns,hu(Yr,Yr),Yr.add=wu,Yr.attempt=eu,Yr.camelCase=Hs,Yr.capitalize=Bs,Yr.ceil=Eu,Yr.clamp=function(t,e,n){return n===r&&(n=e,e=r),n!==r&&(n=(n=_s(n))==n?n:0),e!==r&&(e=(e=_s(e))==e?e:0),cn(_s(t),e,n)},Yr.clone=function(t){return hn(t,4)},Yr.cloneDeep=function(t){return hn(t,5)},Yr.cloneDeepWith=function(t,e){return hn(t,5,e="function"==typeof e?e:r)},Yr.cloneWith=function(t,e){return hn(t,4,e="function"==typeof e?e:r)},Yr.conformsTo=function(t,e){return null==e||ln(t,e,Fs(e))},Yr.deburr=Ws,Yr.defaultTo=function(t,e){return null==t||t!=t?e:t},Yr.divide=bu,Yr.endsWith=function(t,e,n){t=Es(t),e=li(e);var i=t.length,o=n=n===r?i:cn(ys(n),0,i);return(n-=e.length)>=0&&t.slice(n,o)==e},Yr.eq=za,Yr.escape=function(t){return(t=Es(t))&&Z.test(t)?t.replace(q,nr):t},Yr.escapeRegExp=function(t){return(t=Es(t))&&it.test(t)?t.replace(nt,"\\$&"):t},Yr.every=function(t,e,n){var i=Va(t)?Ce:vn;return n&&bo(t,e,n)&&(e=r),i(t,ho(e,3))},Yr.find=_a,Yr.findIndex=Wo,Yr.findKey=function(t,e){return je(t,ho(e,3),bn)},Yr.findLast=wa,Yr.findLastIndex=Vo,Yr.findLastKey=function(t,e){return je(t,ho(e,3),xn)},Yr.floor=xu,Yr.forEach=Ea,Yr.forEachRight=ba,Yr.forIn=function(t,e){return null==t?t:wn(t,ho(e,3),Ps)},Yr.forInRight=function(t,e){return null==t?t:En(t,ho(e,3),Ps)},Yr.forOwn=function(t,e){return t&&bn(t,ho(e,3))},Yr.forOwnRight=function(t,e){return t&&xn(t,ho(e,3))},Yr.get=Ms,Yr.gt=Ha,Yr.gte=Ba,Yr.has=function(t,e){return null!=t&&mo(t,e,Mn)},Yr.hasIn=Os,Yr.head=$o,Yr.identity=au,Yr.includes=function(t,e,r,n){t=$a(t)?t:zs(t),r=r&&!n?ys(r):0;var i=t.length;return r<0&&(r=_r(i+r,0)),hs(t)?r<=i&&t.indexOf(e,r)>-1:!!i&&Ue(t,e,r)>-1},Yr.indexOf=function(t,e,r){var n=null==t?0:t.length;if(!n)return-1;var i=null==r?0:ys(r);return i<0&&(i=_r(n+i,0)),Ue(t,e,i)},Yr.inRange=function(t,e,n){return e=vs(e),n===r?(n=e,e=0):n=vs(n),function(t,e,r){return t>=wr(e,r)&&t<_r(e,r)}(t=_s(t),e,n)},Yr.invoke=Rs,Yr.isArguments=Wa,Yr.isArray=Va,Yr.isArrayBuffer=qa,Yr.isArrayLike=$a,Yr.isArrayLikeObject=Za,Yr.isBoolean=function(t){return!0===t||!1===t||is(t)&&Ln(t)==_},Yr.isBuffer=Ka,Yr.isDate=Qa,Yr.isElement=function(t){return is(t)&&1===t.nodeType&&!ss(t)},Yr.isEmpty=function(t){if(null==t)return!0;if($a(t)&&(Va(t)||"string"==typeof t||"function"==typeof t.splice||Ka(t)||fs(t)||Wa(t)))return!t.length;var e=yo(t);if(e==N||e==M)return!t.size;if(To(t))return!jn(t).length;for(var r in t)if(St.call(t,r))return!1;return!0},Yr.isEqual=function(t,e){return Fn(t,e)},Yr.isEqualWith=function(t,e,n){var i=(n="function"==typeof n?n:r)?n(t,e):r;return i===r?Fn(t,e,r,n):!!i},Yr.isError=Ja,Yr.isFinite=function(t){return"number"==typeof t&&vr(t)},Yr.isFunction=ts,Yr.isInteger=es,Yr.isLength=rs,Yr.isMap=os,Yr.isMatch=function(t,e){return t===e||Pn(t,e,fo(e))},Yr.isMatchWith=function(t,e,n){return n="function"==typeof n?n:r,Pn(t,e,fo(e),n)},Yr.isNaN=function(t){return as(t)&&t!=+t},Yr.isNative=function(t){if(Ao(t))throw new Nt("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Sn(t)},Yr.isNil=function(t){return null==t},Yr.isNull=function(t){return null===t},Yr.isNumber=as,Yr.isObject=ns,Yr.isObjectLike=is,Yr.isPlainObject=ss,Yr.isRegExp=us,Yr.isSafeInteger=function(t){return es(t)&&t>=-9007199254740991&&t<=d},Yr.isSet=cs,Yr.isString=hs,Yr.isSymbol=ls,Yr.isTypedArray=fs,Yr.isUndefined=function(t){return t===r},Yr.isWeakMap=function(t){return is(t)&&yo(t)==D},Yr.isWeakSet=function(t){return is(t)&&"[object WeakSet]"==Ln(t)},Yr.join=function(t,e){return null==t?"":yr.call(t,e)},Yr.kebabCase=Vs,Yr.last=Jo,Yr.lastIndexOf=function(t,e,n){var i=null==t?0:t.length;if(!i)return-1;var o=i;return n!==r&&(o=(o=ys(n))<0?_r(i+o,0):wr(o,i-1)),e==e?function(t,e,r){for(var n=r+1;n--;)if(t[n]===e)return n;return n}(t,e,o):ke(t,Xe,o,!0)},Yr.lowerCase=qs,Yr.lowerFirst=$s,Yr.lt=ds,Yr.lte=ps,Yr.max=function(t){return t&&t.length?yn(t,au,Cn):r},Yr.maxBy=function(t,e){return t&&t.length?yn(t,ho(e,2),Cn):r},Yr.mean=function(t){return ze(t,au)},Yr.meanBy=function(t,e){return ze(t,ho(e,2))},Yr.min=function(t){return t&&t.length?yn(t,au,Un):r},Yr.minBy=function(t,e){return t&&t.length?yn(t,ho(e,2),Un):r},Yr.stubArray=mu,Yr.stubFalse=_u,Yr.stubObject=function(){return{}},Yr.stubString=function(){return""},Yr.stubTrue=function(){return!0},Yr.multiply=Au,Yr.nth=function(t,e){return t&&t.length?Bn(t,ys(e)):r},Yr.noConflict=function(){return fe._===this&&(fe._=Yt),this},Yr.noop=lu,Yr.now=Ma,Yr.pad=function(t,e,r){t=Es(t);var n=(e=ys(e))?lr(t):0;if(!e||n>=e)return t;var i=(e-n)/2;return Wi(ye(i),r)+t+Wi(ve(i),r)},Yr.padEnd=function(t,e,r){t=Es(t);var n=(e=ys(e))?lr(t):0;return e&&ne){var i=t;t=e,e=i}if(n||t%1||e%1){var o=xr();return wr(t+o*(e-t+ue("1e-"+((o+"").length-1))),e)}return Zn(t,e)},Yr.reduce=function(t,e,r){var n=Va(t)?Fe:We,i=arguments.length<3;return n(t,ho(e,4),r,i,pn)},Yr.reduceRight=function(t,e,r){var n=Va(t)?Pe:We,i=arguments.length<3;return n(t,ho(e,4),r,i,gn)},Yr.repeat=function(t,e,n){return e=(n?bo(t,e,n):e===r)?1:ys(e),Kn(Es(t),e)},Yr.replace=function(){var t=arguments,e=Es(t[0]);return t.length<3?e:e.replace(t[1],t[2])},Yr.result=function(t,e,n){var i=-1,o=(e=Ei(e,t)).length;for(o||(o=1,t=r);++id)return[];var r=g,n=wr(t,g);e=ho(e),t-=g;for(var i=qe(n,e);++r=a)return t;var u=n-lr(i);if(u<1)return i;var c=s?xi(s,0,u).join(""):t.slice(0,u);if(o===r)return c+i;if(s&&(u+=c.length-u),us(o)){if(t.slice(u).search(o)){var h,l=c;for(o.global||(o=Ct(o.source,Es(pt.exec(o))+"g")),o.lastIndex=0;h=o.exec(l);)var f=h.index;c=c.slice(0,f===r?u:f)}}else if(t.indexOf(li(o),u)!=u){var d=c.lastIndexOf(o);d>-1&&(c=c.slice(0,d))}return c+i},Yr.unescape=function(t){return(t=Es(t))&&$.test(t)?t.replace(V,pr):t},Yr.uniqueId=function(t){var e=++Gt;return Es(t)+e},Yr.upperCase=Qs,Yr.upperFirst=Js,Yr.each=Ea,Yr.eachRight=ba,Yr.first=$o,hu(Yr,(Nu={},bn(Yr,(function(t,e){St.call(Yr.prototype,e)||(Nu[e]=t)})),Nu),{chain:!1}),Yr.VERSION="4.17.21",Te(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){Yr[t].placeholder=Yr})),Te(["drop","take"],(function(t,e){Br.prototype[t]=function(n){n=n===r?1:_r(ys(n),0);var i=this.__filtered__&&!e?new Br(this):this.clone();return i.__filtered__?i.__takeCount__=wr(n,i.__takeCount__):i.__views__.push({size:wr(n,g),type:t+(i.__dir__<0?"Right":"")}),i},Br.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}})),Te(["filter","map","takeWhile"],(function(t,e){var r=e+1,n=1==r||3==r;Br.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:ho(t,3),type:r}),e.__filtered__=e.__filtered__||n,e}})),Te(["head","last"],(function(t,e){var r="take"+(e?"Right":"");Br.prototype[t]=function(){return this[r](1).value()[0]}})),Te(["initial","tail"],(function(t,e){var r="drop"+(e?"":"Right");Br.prototype[t]=function(){return this.__filtered__?new Br(this):this[r](1)}})),Br.prototype.compact=function(){return this.filter(au)},Br.prototype.find=function(t){return this.filter(t).head()},Br.prototype.findLast=function(t){return this.reverse().find(t)},Br.prototype.invokeMap=Qn((function(t,e){return"function"==typeof t?new Br(this):this.map((function(r){return Dn(r,t,e)}))})),Br.prototype.reject=function(t){return this.filter(ja(ho(t)))},Br.prototype.slice=function(t,e){t=ys(t);var n=this;return n.__filtered__&&(t>0||e<0)?new Br(n):(t<0?n=n.takeRight(-t):t&&(n=n.drop(t)),e!==r&&(n=(e=ys(e))<0?n.dropRight(-e):n.take(e-t)),n)},Br.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Br.prototype.toArray=function(){return this.take(g)},bn(Br.prototype,(function(t,e){var n=/^(?:filter|find|map|reject)|While$/.test(e),i=/^(?:head|last)$/.test(e),o=Yr[i?"take"+("last"==e?"Right":""):e],a=i||/^find/.test(e);o&&(Yr.prototype[e]=function(){var e=this.__wrapped__,s=i?[1]:arguments,u=e instanceof Br,c=s[0],h=u||Va(e),l=function(t){var e=o.apply(Yr,Re([t],s));return i&&f?e[0]:e};h&&n&&"function"==typeof c&&1!=c.length&&(u=h=!1);var f=this.__chain__,d=!!this.__actions__.length,p=a&&!f,g=u&&!d;if(!a&&h){e=g?e:new Br(this);var v=t.apply(e,s);return v.__actions__.push({func:va,args:[l],thisArg:r}),new Hr(v,f)}return p&&g?t.apply(this,s):(v=this.thru(l),p?i?v.value()[0]:v.value():v)})})),Te(["pop","push","shift","sort","splice","unshift"],(function(t){var e=It[t],r=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",n=/^(?:pop|shift)$/.test(t);Yr.prototype[t]=function(){var t=arguments;if(n&&!this.__chain__){var i=this.value();return e.apply(Va(i)?i:[],t)}return this[r]((function(r){return e.apply(Va(r)?r:[],t)}))}})),bn(Br.prototype,(function(t,e){var r=Yr[e];if(r){var n=r.name+"";St.call(Dr,n)||(Dr[n]=[]),Dr[n].push({name:e,func:r})}})),Dr[Xi(r,2).name]=[{name:"wrapper",func:r}],Br.prototype.clone=function(){var t=new Br(this.__wrapped__);return t.__actions__=Ii(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=Ii(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=Ii(this.__views__),t},Br.prototype.reverse=function(){if(this.__filtered__){var t=new Br(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},Br.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,r=Va(t),n=e<0,i=r?t.length:0,o=function(t,e,r){var n=-1,i=r.length;for(;++n=this.__values__.length;return{done:t,value:t?r:this.__values__[this.__index__++]}},Yr.prototype.plant=function(t){for(var e,n=this;n instanceof zr;){var i=Xo(n);i.__index__=0,i.__values__=r,e?o.__wrapped__=i:e=i;var o=i;n=n.__wrapped__}return o.__wrapped__=t,e},Yr.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof Br){var e=t;return this.__actions__.length&&(e=new Br(this)),(e=e.reverse()).__actions__.push({func:va,args:[na],thisArg:r}),new Hr(e,this.__chain__)}return this.thru(na)},Yr.prototype.toJSON=Yr.prototype.valueOf=Yr.prototype.value=function(){return vi(this.__wrapped__,this.__actions__)},Yr.prototype.first=Yr.prototype.head,ee&&(Yr.prototype[ee]=function(){return this}),Yr}();pe?((pe.exports=gr)._=gr,de._=gr):fe._=gr}).call(a)}(g,g.exports);var v=function(){this.__data__=[],this.size=0};var y=function(t,e){return t===e||t!=t&&e!=e},m=y;var _=function(t,e){for(var r=t.length;r--;)if(m(t[r][0],e))return r;return-1},w=_,E=Array.prototype.splice;var b=_;var x=_;var N=_;var A=v,T=function(t){var e=this.__data__,r=w(e,t);return!(r<0)&&(r==e.length-1?e.pop():E.call(e,r,1),--this.size,!0)},L=function(t){var e=this.__data__,r=b(e,t);return r<0?void 0:e[r][1]},C=function(t){return x(this.__data__,t)>-1},M=function(t,e){var r=this.__data__,n=N(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this};function O(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e-1&&t%1==0&&t-1&&t%1==0&&t<=9007199254740991},Ye=Q,Xe=Ue,ze=Te,He={};He["[object Float32Array]"]=He["[object Float64Array]"]=He["[object Int8Array]"]=He["[object Int16Array]"]=He["[object Int32Array]"]=He["[object Uint8Array]"]=He["[object Uint8ClampedArray]"]=He["[object Uint16Array]"]=He["[object Uint32Array]"]=!0,He["[object Arguments]"]=He["[object Array]"]=He["[object ArrayBuffer]"]=He["[object Boolean]"]=He["[object DataView]"]=He["[object Date]"]=He["[object Error]"]=He["[object Function]"]=He["[object Map]"]=He["[object Number]"]=He["[object Object]"]=He["[object RegExp]"]=He["[object Set]"]=He["[object String]"]=He["[object WeakMap]"]=!1;var Be=function(t){return ze(t)&&Xe(t.length)&&!!He[Ye(t)]};var We=function(t){return function(e){return t(e)}},Ve={exports:{}};!function(t,e){var r=G,n=e&&!e.nodeType&&e,i=n&&t&&!t.nodeType&&t,o=i&&i.exports===n&&r.process,a=function(){try{var t=i&&i.require&&i.require("util").types;return t||o&&o.binding&&o.binding("util")}catch(t){}}();t.exports=a}(Ve,Ve.exports);var qe=Be,$e=We,Ze=Ve.exports,Ke=Ze&&Ze.isTypedArray,Qe=Ke?$e(Ke):qe,Je=Ae,tr=Fe,er=Pe,rr=Se.exports,nr=ke,ir=Qe,or=Object.prototype.hasOwnProperty;var ar=function(t,e){var r=er(t),n=!r&&tr(t),i=!r&&!n&&rr(t),o=!r&&!n&&!i&&ir(t),a=r||n||i||o,s=a?Je(t.length,String):[],u=s.length;for(var c in t)!e&&!or.call(t,c)||a&&("length"==c||i&&("offset"==c||"parent"==c)||o&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||nr(c,u))||s.push(c);return s},sr=Object.prototype;var ur=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||sr)};var cr=function(t,e){return function(r){return t(e(r))}},hr=cr(Object.keys,Object),lr=ur,fr=hr,dr=Object.prototype.hasOwnProperty;var pr=function(t){if(!lr(t))return fr(t);var e=[];for(var r in Object(t))dr.call(t,r)&&"constructor"!=r&&e.push(r);return e},gr=nt,vr=Ue;var yr=function(t){return null!=t&&vr(t.length)&&!gr(t)},mr=ar,_r=pr,wr=yr;var Er=function(t){return wr(t)?mr(t):_r(t)},br=Ne,xr=Er;var Nr=function(t,e){return t&&br(e,xr(e),t)};var Ar=J,Tr=ur,Lr=function(t){var e=[];if(null!=t)for(var r in Object(t))e.push(r);return e},Cr=Object.prototype.hasOwnProperty;var Mr=ar,Or=function(t){if(!Ar(t))return Lr(t);var e=Tr(t),r=[];for(var n in t)("constructor"!=n||!e&&Cr.call(t,n))&&r.push(n);return r},Ir=yr;var Dr=function(t){return Ir(t)?Mr(t,!0):Or(t)},Rr=Ne,Fr=Dr;var Pr=function(t,e){return t&&Rr(e,Fr(e),t)},Sr={exports:{}};!function(t,e){var r=U,n=e&&!e.nodeType&&e,i=n&&t&&!t.nodeType&&t,o=i&&i.exports===n?r.Buffer:void 0,a=o?o.allocUnsafe:void 0;t.exports=function(t,e){if(e)return t.slice();var r=t.length,n=a?a(r):new t.constructor(r);return t.copy(n),n}}(Sr,Sr.exports);var Gr=function(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++rs))return!1;var c=o.get(t),h=o.get(e);if(c&&h)return c==e&&h==t;var l=-1,f=!0,d=2&r?new lo:void 0;for(o.set(t,e),o.set(e,t);++l0&&n(u)?r>1?t(u,r-1,n,i,o):Nu(o,u):i||(o[o.length]=u)}return o};var Lu=function(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)},Cu=Math.max;var Mu=function(t,e,r){return e=Cu(void 0===e?t.length-1:e,0),function(){for(var n=arguments,i=-1,o=Cu(n.length-e,0),a=Array(o);++i0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(Du),Pu=Zi,Su=Mu,Gu=Fu;var ju=function(t,e){return Gu(Su(t,e,Pu),t+"")};var ku=function(t,e,r,n){for(var i=t.length,o=r+(n?1:-1);n?o--:++o-1};var Hu=function(t,e,r){for(var n=-1,i=null==t?0:t.length;++n=200){var c=e?null:Qu(t);if(c)return Ju(c);a=!1,i=Ku,u=new qu}else u=e?[]:s;t:for(;++no){var a=i;i=o,o=a}return i+""+o+""+(fc.isUndefined(n)?"\0":n)}function mc(t,e,r,n){var i=""+e,o=""+r;if(!t&&i>o){var a=i;i=o,o=a}var s={v:i,w:o};return n&&(s.name=n),s}function _c(t,e){return yc(t,e.v,e.w,e.name)}pc.prototype._nodeCount=0,pc.prototype._edgeCount=0,pc.prototype.isDirected=function(){return this._isDirected},pc.prototype.isMultigraph=function(){return this._isMultigraph},pc.prototype.isCompound=function(){return this._isCompound},pc.prototype.setGraph=function(t){return this._label=t,this},pc.prototype.graph=function(){return this._label},pc.prototype.setDefaultNodeLabel=function(t){return fc.isFunction(t)||(t=fc.constant(t)),this._defaultNodeLabelFn=t,this},pc.prototype.nodeCount=function(){return this._nodeCount},pc.prototype.nodes=function(){return fc.keys(this._nodes)},pc.prototype.sources=function(){var t=this;return fc.filter(this.nodes(),(function(e){return fc.isEmpty(t._in[e])}))},pc.prototype.sinks=function(){var t=this;return fc.filter(this.nodes(),(function(e){return fc.isEmpty(t._out[e])}))},pc.prototype.setNodes=function(t,e){var r=arguments,n=this;return fc.each(t,(function(t){r.length>1?n.setNode(t,e):n.setNode(t)})),this},pc.prototype.setNode=function(t,e){return fc.has(this._nodes,t)?(arguments.length>1&&(this._nodes[t]=e),this):(this._nodes[t]=arguments.length>1?e:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]="\0",this._children[t]={},this._children["\0"][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)},pc.prototype.node=function(t){return this._nodes[t]},pc.prototype.hasNode=function(t){return fc.has(this._nodes,t)},pc.prototype.removeNode=function(t){var e=this;if(fc.has(this._nodes,t)){var r=function(t){e.removeEdge(e._edgeObjs[t])};delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],fc.each(this.children(t),(function(t){e.setParent(t)})),delete this._children[t]),fc.each(fc.keys(this._in[t]),r),delete this._in[t],delete this._preds[t],fc.each(fc.keys(this._out[t]),r),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this},pc.prototype.setParent=function(t,e){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(fc.isUndefined(e))e="\0";else{for(var r=e+="";!fc.isUndefined(r);r=this.parent(r))if(r===t)throw new Error("Setting "+e+" as parent of "+t+" would create a cycle");this.setNode(e)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=e,this._children[e][t]=!0,this},pc.prototype._removeFromParentsChildList=function(t){delete this._children[this._parent[t]][t]},pc.prototype.parent=function(t){if(this._isCompound){var e=this._parent[t];if("\0"!==e)return e}},pc.prototype.children=function(t){if(fc.isUndefined(t)&&(t="\0"),this._isCompound){var e=this._children[t];if(e)return fc.keys(e)}else{if("\0"===t)return this.nodes();if(this.hasNode(t))return[]}},pc.prototype.predecessors=function(t){var e=this._preds[t];if(e)return fc.keys(e)},pc.prototype.successors=function(t){var e=this._sucs[t];if(e)return fc.keys(e)},pc.prototype.neighbors=function(t){var e=this.predecessors(t);if(e)return fc.union(e,this.successors(t))},pc.prototype.isLeaf=function(t){return 0===(this.isDirected()?this.successors(t):this.neighbors(t)).length},pc.prototype.filterNodes=function(t){var e=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});e.setGraph(this.graph());var r=this;fc.each(this._nodes,(function(r,n){t(n)&&e.setNode(n,r)})),fc.each(this._edgeObjs,(function(t){e.hasNode(t.v)&&e.hasNode(t.w)&&e.setEdge(t,r.edge(t))}));var n={};function i(t){var o=r.parent(t);return void 0===o||e.hasNode(o)?(n[t]=o,o):o in n?n[o]:i(o)}return this._isCompound&&fc.each(e.nodes(),(function(t){e.setParent(t,i(t))})),e},pc.prototype.setDefaultEdgeLabel=function(t){return fc.isFunction(t)||(t=fc.constant(t)),this._defaultEdgeLabelFn=t,this},pc.prototype.edgeCount=function(){return this._edgeCount},pc.prototype.edges=function(){return fc.values(this._edgeObjs)},pc.prototype.setPath=function(t,e){var r=this,n=arguments;return fc.reduce(t,(function(t,i){return n.length>1?r.setEdge(t,i,e):r.setEdge(t,i),i})),this},pc.prototype.setEdge=function(){var t,e,r,n,i=!1,o=arguments[0];"object"==typeof o&&null!==o&&"v"in o?(t=o.v,e=o.w,r=o.name,2===arguments.length&&(n=arguments[1],i=!0)):(t=o,e=arguments[1],r=arguments[3],arguments.length>2&&(n=arguments[2],i=!0)),t=""+t,e=""+e,fc.isUndefined(r)||(r=""+r);var a=yc(this._isDirected,t,e,r);if(fc.has(this._edgeLabels,a))return i&&(this._edgeLabels[a]=n),this;if(!fc.isUndefined(r)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(e),this._edgeLabels[a]=i?n:this._defaultEdgeLabelFn(t,e,r);var s=mc(this._isDirected,t,e,r);return t=s.v,e=s.w,Object.freeze(s),this._edgeObjs[a]=s,gc(this._preds[e],t),gc(this._sucs[t],e),this._in[e][a]=s,this._out[t][a]=s,this._edgeCount++,this},pc.prototype.edge=function(t,e,r){var n=1===arguments.length?_c(this._isDirected,arguments[0]):yc(this._isDirected,t,e,r);return this._edgeLabels[n]},pc.prototype.hasEdge=function(t,e,r){var n=1===arguments.length?_c(this._isDirected,arguments[0]):yc(this._isDirected,t,e,r);return fc.has(this._edgeLabels,n)},pc.prototype.removeEdge=function(t,e,r){var n=1===arguments.length?_c(this._isDirected,arguments[0]):yc(this._isDirected,t,e,r),i=this._edgeObjs[n];return i&&(t=i.v,e=i.w,delete this._edgeLabels[n],delete this._edgeObjs[n],vc(this._preds[e],t),vc(this._sucs[t],e),delete this._in[e][n],delete this._out[t][n],this._edgeCount--),this},pc.prototype.inEdges=function(t,e){var r=this._in[t];if(r){var n=fc.values(r);return e?fc.filter(n,(function(t){return t.v===e})):n}},pc.prototype.outEdges=function(t,e){var r=this._out[t];if(r){var n=fc.values(r);return e?fc.filter(n,(function(t){return t.w===e})):n}},pc.prototype.nodeEdges=function(t,e){var r=this.inEdges(t,e);if(r)return r.concat(this.outEdges(t,e))};var wc={Graph:dc,version:"2.1.8"},Ec=lc,bc=dc,xc={write:function(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:Nc(t),edges:Ac(t)};Ec.isUndefined(t.graph())||(e.value=Ec.clone(t.graph()));return e},read:function(t){var e=new bc(t.options).setGraph(t.value);return Ec.each(t.nodes,(function(t){e.setNode(t.v,t.value),t.parent&&e.setParent(t.v,t.parent)})),Ec.each(t.edges,(function(t){e.setEdge({v:t.v,w:t.w,name:t.name},t.value)})),e}};function Nc(t){return Ec.map(t.nodes(),(function(e){var r=t.node(e),n=t.parent(e),i={v:e};return Ec.isUndefined(r)||(i.value=r),Ec.isUndefined(n)||(i.parent=n),i}))}function Ac(t){return Ec.map(t.edges(),(function(e){var r=t.edge(e),n={v:e.v,w:e.w};return Ec.isUndefined(e.name)||(n.name=e.name),Ec.isUndefined(r)||(n.value=r),n}))}var Tc=lc,Lc=function(t){var e,r={},n=[];function i(n){Tc.has(r,n)||(r[n]=!0,e.push(n),Tc.each(t.successors(n),i),Tc.each(t.predecessors(n),i))}return Tc.each(t.nodes(),(function(t){e=[],i(t),e.length&&n.push(e)})),n};var Cc=lc,Mc=Oc;function Oc(){this._arr=[],this._keyIndices={}}Oc.prototype.size=function(){return this._arr.length},Oc.prototype.keys=function(){return this._arr.map((function(t){return t.key}))},Oc.prototype.has=function(t){return Cc.has(this._keyIndices,t)},Oc.prototype.priority=function(t){var e=this._keyIndices[t];if(void 0!==e)return this._arr[e].priority},Oc.prototype.min=function(){if(0===this.size())throw new Error("Queue underflow");return this._arr[0].key},Oc.prototype.add=function(t,e){var r=this._keyIndices;if(t=String(t),!Cc.has(r,t)){var n=this._arr,i=n.length;return r[t]=i,n.push({key:t,priority:e}),this._decrease(i),!0}return!1},Oc.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var t=this._arr.pop();return delete this._keyIndices[t.key],this._heapify(0),t.key},Oc.prototype.decrease=function(t,e){var r=this._keyIndices[t];if(e>this._arr[r].priority)throw new Error("New priority is greater than current priority. Key: "+t+" Old: "+this._arr[r].priority+" New: "+e);this._arr[r].priority=e,this._decrease(r)},Oc.prototype._heapify=function(t){var e=this._arr,r=2*t,n=r+1,i=t;r>1].priority0&&(i=s.removeMin(),(o=a[i]).distance!==Number.POSITIVE_INFINITY);)n(i).forEach(u);return a}(t,String(e),r||Rc,n||function(e){return t.outEdges(e)})},Rc=lc.constant(1);var Fc=Dc,Pc=lc,Sc=function(t,e,r){return Pc.transform(t.nodes(),(function(n,i){n[i]=Fc(t,i,e,r)}),{})};var Gc=lc,jc=function(t){var e=0,r=[],n={},i=[];function o(a){var s=n[a]={onStack:!0,lowlink:e,index:e++};if(r.push(a),t.successors(a).forEach((function(t){Gc.has(n,t)?n[t].onStack&&(s.lowlink=Math.min(s.lowlink,n[t].index)):(o(t),s.lowlink=Math.min(s.lowlink,n[t].lowlink))})),s.lowlink===s.index){var u,c=[];do{u=r.pop(),n[u].onStack=!1,c.push(u)}while(a!==u);i.push(c)}}return t.nodes().forEach((function(t){Gc.has(n,t)||o(t)})),i};var kc=lc,Uc=jc,Yc=function(t){return kc.filter(Uc(t),(function(e){return e.length>1||1===e.length&&t.hasEdge(e[0],e[0])}))};var Xc=function(t,e,r){return function(t,e,r){var n={},i=t.nodes();return i.forEach((function(t){n[t]={},n[t][t]={distance:0},i.forEach((function(e){t!==e&&(n[t][e]={distance:Number.POSITIVE_INFINITY})})),r(t).forEach((function(r){var i=r.v===t?r.w:r.v,o=e(r);n[t][i]={distance:o,predecessor:t}}))})),i.forEach((function(t){var e=n[t];i.forEach((function(r){var o=n[r];i.forEach((function(r){var n=o[t],i=e[r],a=o[r],s=n.distance+i.distance;s0;){if(r=o.removeMin(),th.has(i,r))n.setEdge(r,i[r]);else{if(s)throw new Error("Input graph is not connected: "+t);s=!0}t.nodeEdges(r).forEach(a)}return n},tarjan:jc,topsort:Bc},version:wc.version};function ih(){var t={};t._next=t._prev=t,this._sentinel=t}function oh(t){t._prev._next=t._next,t._next._prev=t._prev,delete t._next,delete t._prev}function ah(t,e){if("_next"!==t&&"_prev"!==t)return e}ih.prototype.dequeue=function(){var t=this._sentinel,e=t._prev;if(e!==t)return oh(e),e},ih.prototype.enqueue=function(t){var e=this._sentinel;t._prev&&t._next&&oh(t),t._next=e._next,e._next._prev=t,e._next=t,t._prev=e},ih.prototype.toString=function(){for(var t=[],e=this._sentinel,r=e._prev;r!==e;)t.push(JSON.stringify(r,ah)),r=r._prev;return"["+t.join(", ")+"]"};var sh=g.exports.constant(1);function uh(t,e){if(t.nodeCount()<=1)return[];var r=function(t,e){var r=new nh.Graph,n=0,i=0;g.exports.forEach(t.nodes(),(function(t){r.setNode(t,{v:t,in:0,out:0})})),g.exports.forEach(t.edges(),(function(t){var o=r.edge(t.v,t.w)||0,a=e(t),s=o+a;r.setEdge(t.v,t.w,s),i=Math.max(i,r.node(t.v).out+=a),n=Math.max(n,r.node(t.w).in+=a)}));var o=g.exports.range(i+n+3).map((function(){return new ih})),a=n+1;return g.exports.forEach(r.nodes(),(function(t){hh(o,a,r.node(t))})),{graph:r,buckets:o,zeroIdx:a}}(t,e||sh),n=function(t,e,r){var n,i=[],o=e[e.length-1],a=e[0];for(;t.nodeCount();){for(;n=a.dequeue();)ch(t,e,r,n);for(;n=o.dequeue();)ch(t,e,r,n);if(t.nodeCount())for(var s=e.length-2;s>0;--s)if(n=e[s].dequeue()){i=i.concat(ch(t,e,r,n,!0));break}}return i}(r.graph,r.buckets,r.zeroIdx);return g.exports.flatten(g.exports.map(n,(function(e){return t.outEdges(e.v,e.w)})),!0)}function ch(t,e,r,n,i){var o=i?[]:void 0;return g.exports.forEach(t.inEdges(n.v),(function(n){var a=t.edge(n),s=t.node(n.v);i&&o.push({v:n.v,w:n.w}),s.out-=a,hh(e,r,s)})),g.exports.forEach(t.outEdges(n.v),(function(n){var i=t.edge(n),o=n.w,a=t.node(o);a.in-=i,hh(e,r,a)})),t.removeNode(n.v),o}function hh(t,e,r){r.out?r.in?t[r.out-r.in+e].enqueue(r):t[t.length-1].enqueue(r):t[0].enqueue(r)}function lh(t){var e="greedy"===t.graph().acyclicer?uh(t,function(t){return function(e){return t.edge(e).weight}}(t)):function(t){var e=[],r={},n={};function i(o){g.exports.has(n,o)||(n[o]=!0,r[o]=!0,g.exports.forEach(t.outEdges(o),(function(t){g.exports.has(r,t.w)?e.push(t):i(t.w)})),delete r[o])}return g.exports.forEach(t.nodes(),i),e}(t);g.exports.forEach(e,(function(e){var r=t.edge(e);t.removeEdge(e),r.forwardName=e.name,r.reversed=!0,t.setEdge(e.w,e.v,r,g.exports.uniqueId("rev"))}))}function fh(t,e,r,n){var i;do{i=g.exports.uniqueId(n)}while(t.hasNode(i));return r.dummy=e,t.setNode(i,r),i}function dh(t){var e=g.exports.map(g.exports.range(gh(t)+1),(function(){return[]}));return g.exports.forEach(t.nodes(),(function(r){var n=t.node(r),i=n.rank;g.exports.isUndefined(i)||(e[i][n.order]=r)})),e}function ph(t,e,r,n){var i={width:0,height:0};return arguments.length>=4&&(i.rank=r,i.order=n),fh(t,"border",i,e)}function gh(t){return g.exports.max(g.exports.map(t.nodes(),(function(e){var r=t.node(e).rank;if(!g.exports.isUndefined(r))return r})))}function vh(t,e){var r=g.exports.now();try{return e()}finally{console.log(t+" time: "+(g.exports.now()-r)+"ms")}}function yh(t,e){return e()}function mh(t){t.graph().dummyChains=[],g.exports.forEach(t.edges(),(function(e){!function(t,e){var r,n,i,o=e.v,a=t.node(o).rank,s=e.w,u=t.node(s).rank,c=e.name,h=t.edge(e),l=h.labelRank;if(u===a+1)return;for(t.removeEdge(e),i=0,++a;aa.lim&&(s=a,u=!0);var c=g.exports.filter(e.edges(),(function(e){return u===Rh(t,t.node(e.v),s)&&u!==Rh(t,t.node(e.w),s)}));return g.exports.minBy(c,(function(t){return wh(e,t)}))}function Dh(t,e,r,n){var i=r.v,o=r.w;t.removeEdge(i,o),t.setEdge(n.v,n.w,{}),Ch(t),Th(t,e),function(t,e){var r=g.exports.find(t.nodes(),(function(t){return!e.node(t).parent})),n=nh.alg.preorder(t,r);n=n.slice(1),g.exports.forEach(n,(function(r){var n=t.node(r).parent,i=e.edge(r,n),o=!1;i||(i=e.edge(n,r),o=!0),e.node(r).rank=e.node(n).rank+(o?i.minlen:-i.minlen)}))}(t,e)}function Rh(t,e,r){return r.low<=e.lim&&e.lim<=r.lim}function Fh(t){switch(t.graph().ranker){case"network-simplex":default:Sh(t);break;case"tight-tree":!function(t){_h(t),Eh(t)}(t);break;case"longest-path":Ph(t)}}Ah.initLowLimValues=Ch,Ah.initCutValues=Th,Ah.calcCutValue=Lh,Ah.leaveEdge=Oh,Ah.enterEdge=Ih,Ah.exchangeEdges=Dh;var Ph=_h;function Sh(t){Ah(t)}function Gh(t){var e=function(t){var e={},r=0;function n(i){var o=r;g.exports.forEach(t.children(i),n),e[i]={low:o,lim:r++}}return g.exports.forEach(t.children(),n),e}(t);g.exports.forEach(t.graph().dummyChains,(function(r){for(var n=t.node(r),i=n.edgeObj,o=function(t,e,r,n){var i,o,a=[],s=[],u=Math.min(e[r].low,e[n].low),c=Math.max(e[r].lim,e[n].lim);i=r;do{i=t.parent(i),a.push(i)}while(i&&(e[i].low>u||c>e[i].lim));o=i,i=n;for(;(i=t.parent(i))!==o;)s.push(i);return{path:a.concat(s.reverse()),lca:o}}(t,e,i.v,i.w),a=o.path,s=o.lca,u=0,c=a[u],h=!0;r!==i.w;){if(n=t.node(r),h){for(;(c=a[u])!==s&&t.node(c).maxRank0;)e%2&&(r+=s[e+1]),s[e=e-1>>1]+=t.weight;u+=t.weight*r}))),u}function zh(t,e){var r={};return g.exports.forEach(t,(function(t,e){var n=r[t.v]={indegree:0,in:[],out:[],vs:[t.v],i:e};g.exports.isUndefined(t.barycenter)||(n.barycenter=t.barycenter,n.weight=t.weight)})),g.exports.forEach(e.edges(),(function(t){var e=r[t.v],n=r[t.w];g.exports.isUndefined(e)||g.exports.isUndefined(n)||(n.indegree++,e.out.push(r[t.w]))})),function(t){var e=[];function r(t){return function(e){e.merged||(g.exports.isUndefined(e.barycenter)||g.exports.isUndefined(t.barycenter)||e.barycenter>=t.barycenter)&&function(t,e){var r=0,n=0;t.weight&&(r+=t.barycenter*t.weight,n+=t.weight);e.weight&&(r+=e.barycenter*e.weight,n+=e.weight);t.vs=e.vs.concat(t.vs),t.barycenter=r/n,t.weight=n,t.i=Math.min(e.i,t.i),e.merged=!0}(t,e)}}function n(e){return function(r){r.in.push(e),0==--r.indegree&&t.push(r)}}for(;t.length;){var i=t.pop();e.push(i),g.exports.forEach(i.in.reverse(),r(i)),g.exports.forEach(i.out,n(i))}return g.exports.map(g.exports.filter(e,(function(t){return!t.merged})),(function(t){return g.exports.pick(t,["vs","i","barycenter","weight"])}))}(g.exports.filter(r,(function(t){return!t.indegree})))}function Hh(t,e){var r,n=function(t,e){var r={lhs:[],rhs:[]};return g.exports.forEach(t,(function(t){e(t)?r.lhs.push(t):r.rhs.push(t)})),r}(t,(function(t){return g.exports.has(t,"barycenter")})),i=n.lhs,o=g.exports.sortBy(n.rhs,(function(t){return-t.i})),a=[],s=0,u=0,c=0;i.sort((r=!!e,function(t,e){return t.barycentere.barycenter?1:r?e.i-t.i:t.i-e.i})),c=Bh(a,o,c),g.exports.forEach(i,(function(t){c+=t.vs.length,a.push(t.vs),s+=t.barycenter*t.weight,u+=t.weight,c=Bh(a,o,c)}));var h={vs:g.exports.flatten(a,!0)};return u&&(h.barycenter=s/u,h.weight=u),h}function Bh(t,e,r){for(var n;e.length&&(n=g.exports.last(e)).i<=r;)e.pop(),t.push(n.vs),r++;return r}function Wh(t,e,r,n){var i=t.children(e),o=t.node(e),a=o?o.borderLeft:void 0,s=o?o.borderRight:void 0,u={};a&&(i=g.exports.filter(i,(function(t){return t!==a&&t!==s})));var c=function(t,e){return g.exports.map(e,(function(e){var r=t.inEdges(e);if(r.length){var n=g.exports.reduce(r,(function(e,r){var n=t.edge(r),i=t.node(r.v);return{sum:e.sum+n.weight*i.order,weight:e.weight+n.weight}}),{sum:0,weight:0});return{v:e,barycenter:n.sum/n.weight,weight:n.weight}}return{v:e}}))}(t,i);g.exports.forEach(c,(function(e){if(t.children(e.v).length){var i=Wh(t,e.v,r,n);u[e.v]=i,g.exports.has(i,"barycenter")&&(o=e,a=i,g.exports.isUndefined(o.barycenter)?(o.barycenter=a.barycenter,o.weight=a.weight):(o.barycenter=(o.barycenter*o.weight+a.barycenter*a.weight)/(o.weight+a.weight),o.weight+=a.weight))}var o,a}));var h=zh(c,r);!function(t,e){g.exports.forEach(t,(function(t){t.vs=g.exports.flatten(t.vs.map((function(t){return e[t]?e[t].vs:t})),!0)}))}(h,u);var l=Hh(h,n);if(a&&(l.vs=g.exports.flatten([a,l.vs,s],!0),t.predecessors(a).length)){var f=t.node(t.predecessors(a)[0]),d=t.node(t.predecessors(s)[0]);g.exports.has(l,"barycenter")||(l.barycenter=0,l.weight=0),l.barycenter=(l.barycenter*l.weight+f.order+d.order)/(l.weight+2),l.weight+=2}return l}function Vh(t,e,r){var n=function(t){var e;for(;t.hasNode(e=g.exports.uniqueId("_root")););return e}(t),i=new nh.Graph({compound:!0}).setGraph({root:n}).setDefaultNodeLabel((function(e){return t.node(e)}));return g.exports.forEach(t.nodes(),(function(o){var a=t.node(o),s=t.parent(o);(a.rank===e||a.minRank<=e&&e<=a.maxRank)&&(i.setNode(o),i.setParent(o,s||n),g.exports.forEach(t[r](o),(function(e){var r=e.v===o?e.w:e.v,n=i.edge(r,o),a=g.exports.isUndefined(n)?0:n.weight;i.setEdge(r,o,{weight:t.edge(e).weight+a})})),g.exports.has(a,"minRank")&&i.setNode(o,{borderLeft:a.borderLeft[e],borderRight:a.borderRight[e]}))})),i}var qh={};function $h(t,e,r,o){var a=r.eles.nodes(),s=function(t){for(var e=[],r=0;r0&&e.push(n)}return e}(e);!function(t){for(var e=0;e1){var d=r.newGraph();Zh(t,r.graphManager.add(d,g),r,n,o,s,g)}n.eles.nodes("#"+i[a].id()).data("parent")&&(g.parentId=n.eles.nodes("#"+i[a].id()).data("parent")),g.noOfChildren>=2&&(g.noOfChildren-=1);var p=e.add(g);qh[i[a].id()]=p}else{var g;s=t.node(s.id()),c=new u.exports.layoutBase.PointD(s.x,s.y),h=new u.exports.layoutBase.DimensionD(s.width,s.height),(g=new l(r.graphManager,c,h,null,i[a].id(),s.rank)).nodeRepulsion=n.nodeRepulsion,g.isDirected=1;p=e.add(g);qh[i[a].id()]=p}}}}(t,p.addRoot(),c,r),function(t,e,r){for(var n=r.eles.edges(),i={},o=0;o1){var g=r.newGraph();Zh(t,r.graphManager.add(g,p),r,n,i,c,p)}n.eles.nodes("#"+c.id()).data("parent")&&(p.parentId=n.eles.nodes("#"+c.id()).data("parent")),p.noOfChildren>=2&&(p.noOfChildren-=1);var v=a.getChild().add(p);qh[c.id()]=v}}}function Kh(t,e,r){var n=gh(t),i=Qh(t,g.exports.range(1,n+1),"inEdges"),o=Qh(t,g.exports.range(n-1,-1,-1),"outEdges"),a=function(t){var e={},r=g.exports.filter(t.nodes(),(function(e){return!t.children(e).length})),n=g.exports.max(g.exports.map(r,(function(e){return t.node(e).rank}))),i=g.exports.map(g.exports.range(n+1),(function(){return[]})),o=g.exports.sortBy(r,(function(e){return t.node(e).rank}));return g.exports.forEach(o,(function r(n){if(!g.exports.has(e,n)){e[n]=!0;var o=t.node(n);i[o.rank].push(n),g.exports.forEach(t.successors(n),r)}})),i}(t);if(tl(t,a),e.isForceDirected){const n=$h(t,a,e,r);e.isRelayer&&tl(t,n)}else{for(var s,u=Number.POSITIVE_INFINITY,c=0,h=0;h<4;++c,++h){Jh(c%2?i:o,c%4>=2);var l=Yh(t,a=dh(t));lh&&(h=p.h),p.w>l&&(l=p.w)}e.rankGap+=h,e.orderGap<20+l&&(e.orderGap=20+l),u("nodesep",e.nodeSep),u("edgesep",e.edgeSep),u("ranksep",e.rankSep),u("rankdir",e.rankDir),u("align",e.align),u("ranker",e.ranker),u("acyclicer",e.acyclicer),a.setGraph(s),a.setDefaultEdgeLabel((function(){return{}})),a.setDefaultNodeLabel((function(){return{}}));var g=n.edges().stdFilter((function(t){return 1==t.source().data("isDirected")&&1==t.target().data("isDirected")}));for(f=0;f=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function n(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,i,o=r.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(t){i={error:t}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return a}function i(t,e,r){if(r||2===arguments.length)for(var n,i=0,o=e.length;ie?(this.rect.x-=(this.labelWidth-e)/2,this.setWidth(this.labelWidth)):"right"==this.labelPosHorizontal&&this.setWidth(e+this.labelWidth)),this.labelHeight&&("top"==this.labelPosVertical?(this.rect.y-=this.labelHeight,this.setHeight(r+this.labelHeight)):"center"==this.labelPosVertical&&this.labelHeight>r?(this.rect.y-=(this.labelHeight-r)/2,this.setHeight(this.labelHeight)):"bottom"==this.labelPosVertical&&this.setHeight(r+this.labelHeight))}}},c.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==i.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},c.prototype.transform=function(t){var e=this.rect.x;e>a.WORLD_BOUNDARY?e=a.WORLD_BOUNDARY:e<-a.WORLD_BOUNDARY&&(e=-a.WORLD_BOUNDARY);var r=this.rect.y;r>a.WORLD_BOUNDARY?r=a.WORLD_BOUNDARY:r<-a.WORLD_BOUNDARY&&(r=-a.WORLD_BOUNDARY);var n=new u(e,r),i=t.inverseTransformPoint(n);this.setLocation(i.x,i.y)},c.prototype.getLeft=function(){return this.rect.x},c.prototype.getRight=function(){return this.rect.x+this.rect.width},c.prototype.getTop=function(){return this.rect.y},c.prototype.getBottom=function(){return this.rect.y+this.rect.height},c.prototype.getParent=function(){return null==this.owner?null:this.owner.getParent()},t.exports=c},function(t,e,r){var n=r(0);function i(){}for(var o in n)i[o]=n[o];i.MAX_ITERATIONS=2500,i.DEFAULT_EDGE_LENGTH=50,i.DEFAULT_SPRING_STRENGTH=.45,i.DEFAULT_REPULSION_STRENGTH=4500,i.DEFAULT_GRAVITY_STRENGTH=.4,i.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,i.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,i.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,i.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,i.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,i.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,i.COOLING_ADAPTATION_FACTOR=.33,i.ADAPTATION_LOWER_NODE_LIMIT=1e3,i.ADAPTATION_UPPER_NODE_LIMIT=5e3,i.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,i.MAX_NODE_DISPLACEMENT=3*i.MAX_NODE_DISPLACEMENT_INCREMENTAL,i.MIN_REPULSION_DIST=i.DEFAULT_EDGE_LENGTH/10,i.CONVERGENCE_CHECK_PERIOD=100,i.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,i.MIN_EDGE_LENGTH=1,i.GRID_CALCULATION_CHECK_PERIOD=10,t.exports=i},function(t,e,r){function n(t,e){null==t&&null==e?(this.x=0,this.y=0):(this.x=t,this.y=e)}n.prototype.getX=function(){return this.x},n.prototype.getY=function(){return this.y},n.prototype.setX=function(t){this.x=t},n.prototype.setY=function(t){this.y=t},n.prototype.getDifference=function(t){return new DimensionD(this.x-t.x,this.y-t.y)},n.prototype.getCopy=function(){return new n(this.x,this.y)},n.prototype.translate=function(t){return this.x+=t.width,this.y+=t.height,this},t.exports=n},function(t,e,r){var n=r(2),i=r(10),o=r(0),a=r(7),s=r(3),u=r(1),c=r(13),h=r(12),l=r(11);function f(t,e,r){n.call(this,r),this.estimatedSize=i.MIN_VALUE,this.margin=o.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=t,null!=e&&e instanceof a?this.graphManager=e:null!=e&&e instanceof Layout&&(this.graphManager=e.graphManager)}for(var d in f.prototype=Object.create(n.prototype),n)f[d]=n[d];f.prototype.getNodes=function(){return this.nodes},f.prototype.getEdges=function(){return this.edges},f.prototype.getGraphManager=function(){return this.graphManager},f.prototype.getParent=function(){return this.parent},f.prototype.getLeft=function(){return this.left},f.prototype.getRight=function(){return this.right},f.prototype.getTop=function(){return this.top},f.prototype.getBottom=function(){return this.bottom},f.prototype.isConnected=function(){return this.isConnected},f.prototype.add=function(t,e,r){if(null==e&&null==r){var n=t;if(null==this.graphManager)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(n)>-1)throw"Node already in graph!";return n.owner=this,this.getNodes().push(n),n}var i=t;if(!(this.getNodes().indexOf(e)>-1&&this.getNodes().indexOf(r)>-1))throw"Source or target not in graph!";if(e.owner!=r.owner||e.owner!=this)throw"Both owners must be this graph!";return e.owner!=r.owner?null:(i.source=e,i.target=r,i.isInterGraph=!1,this.getEdges().push(i),e.edges.push(i),r!=e&&r.edges.push(i),i)},f.prototype.remove=function(t){var e=t;if(t instanceof s){if(null==e)throw"Node is null!";if(null==e.owner||e.owner!=this)throw"Owner graph is invalid!";if(null==this.graphManager)throw"Owner graph manager is invalid!";for(var r=e.edges.slice(),n=r.length,i=0;i-1&&h>-1))throw"Source and/or target doesn't know this edge!";if(o.source.edges.splice(c,1),o.target!=o.source&&o.target.edges.splice(h,1),-1==(a=o.source.owner.getEdges().indexOf(o)))throw"Not in owner's edge list!";o.source.owner.getEdges().splice(a,1)}},f.prototype.updateLeftTop=function(){for(var t,e,r,n=i.MAX_VALUE,o=i.MAX_VALUE,a=this.getNodes(),s=a.length,u=0;u(t=c.getTop())&&(n=t),o>(e=c.getLeft())&&(o=e)}return n==i.MAX_VALUE?null:(r=null!=a[0].getParent().paddingLeft?a[0].getParent().paddingLeft:this.margin,this.left=o-r,this.top=n-r,new h(this.left,this.top))},f.prototype.updateBounds=function(t){for(var e,r,n,o,a,s=i.MAX_VALUE,u=-i.MAX_VALUE,h=i.MAX_VALUE,l=-i.MAX_VALUE,f=this.nodes,d=f.length,p=0;p(e=g.getLeft())&&(s=e),u<(r=g.getRight())&&(u=r),h>(n=g.getTop())&&(h=n),l<(o=g.getBottom())&&(l=o)}var v=new c(s,h,u-s,l-h);s==i.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),a=null!=f[0].getParent().paddingLeft?f[0].getParent().paddingLeft:this.margin,this.left=v.x-a,this.right=v.x+v.width+a,this.top=v.y-a,this.bottom=v.y+v.height+a},f.calculateBounds=function(t){for(var e,r,n,o,a=i.MAX_VALUE,s=-i.MAX_VALUE,u=i.MAX_VALUE,h=-i.MAX_VALUE,l=t.length,f=0;f(e=d.getLeft())&&(a=e),s<(r=d.getRight())&&(s=r),u>(n=d.getTop())&&(u=n),h<(o=d.getBottom())&&(h=o)}return new c(a,u,s-a,h-u)},f.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},f.prototype.getEstimatedSize=function(){if(this.estimatedSize==i.MIN_VALUE)throw"assert failed";return this.estimatedSize},f.prototype.calcEstimatedSize=function(){for(var t=0,e=this.nodes,r=e.length,n=0;n=this.nodes.length){var u=0;i.forEach((function(e){e.owner==t&&u++})),u==this.nodes.length&&(this.isConnected=!0)}}else this.isConnected=!0},t.exports=f},function(t,e,r){var n,i=r(1);function o(t){n=r(6),this.layout=t,this.graphs=[],this.edges=[]}o.prototype.addRoot=function(){var t=this.layout.newGraph(),e=this.layout.newNode(null),r=this.add(t,e);return this.setRootGraph(r),this.rootGraph},o.prototype.add=function(t,e,r,n,i){if(null==r&&null==n&&null==i){if(null==t)throw"Graph is null!";if(null==e)throw"Parent node is null!";if(this.graphs.indexOf(t)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(t),null!=t.parent)throw"Already has a parent!";if(null!=e.child)throw"Already has a child!";return t.parent=e,e.child=t,t}i=r,r=t;var o=(n=e).getOwner(),a=i.getOwner();if(null==o||o.getGraphManager()!=this)throw"Source not in this graph mgr!";if(null==a||a.getGraphManager()!=this)throw"Target not in this graph mgr!";if(o==a)return r.isInterGraph=!1,o.add(r,n,i);if(r.isInterGraph=!0,r.source=n,r.target=i,this.edges.indexOf(r)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(r),null==r.source||null==r.target)throw"Edge source and/or target is null!";if(-1!=r.source.edges.indexOf(r)||-1!=r.target.edges.indexOf(r))throw"Edge already in source and/or target incidency list!";return r.source.edges.push(r),r.target.edges.push(r),r},o.prototype.remove=function(t){if(t instanceof n){var e=t;if(e.getGraphManager()!=this)throw"Graph not in this graph mgr";if(e!=this.rootGraph&&(null==e.parent||e.parent.graphManager!=this))throw"Invalid parent node!";for(var r,o=[],a=(o=o.concat(e.getEdges())).length,s=0;s=e.getRight()?r[0]+=Math.min(e.getX()-t.getX(),t.getRight()-e.getRight()):e.getX()<=t.getX()&&e.getRight()>=t.getRight()&&(r[0]+=Math.min(t.getX()-e.getX(),e.getRight()-t.getRight())),t.getY()<=e.getY()&&t.getBottom()>=e.getBottom()?r[1]+=Math.min(e.getY()-t.getY(),t.getBottom()-e.getBottom()):e.getY()<=t.getY()&&e.getBottom()>=t.getBottom()&&(r[1]+=Math.min(t.getY()-e.getY(),e.getBottom()-t.getBottom()));var o=Math.abs((e.getCenterY()-t.getCenterY())/(e.getCenterX()-t.getCenterX()));e.getCenterY()===t.getCenterY()&&e.getCenterX()===t.getCenterX()&&(o=1);var a=o*r[0],s=r[1]/o;r[0]a)return r[0]=n,r[1]=u,r[2]=o,r[3]=_,!1;if(io)return r[0]=s,r[1]=i,r[2]=y,r[3]=a,!1;if(no?(r[0]=h,r[1]=l,x=!0):(r[0]=c,r[1]=u,x=!0):A===L&&(n>o?(r[0]=s,r[1]=u,x=!0):(r[0]=f,r[1]=l,x=!0)),-T===L?o>n?(r[2]=m,r[3]=_,N=!0):(r[2]=y,r[3]=v,N=!0):T===L&&(o>n?(r[2]=g,r[3]=v,N=!0):(r[2]=w,r[3]=_,N=!0)),x&&N)return!1;if(n>o?i>a?(C=this.getCardinalDirection(A,L,4),M=this.getCardinalDirection(T,L,2)):(C=this.getCardinalDirection(-A,L,3),M=this.getCardinalDirection(-T,L,1)):i>a?(C=this.getCardinalDirection(-A,L,1),M=this.getCardinalDirection(-T,L,3)):(C=this.getCardinalDirection(A,L,2),M=this.getCardinalDirection(T,L,4)),!x)switch(C){case 1:I=u,O=n+-p/L,r[0]=O,r[1]=I;break;case 2:O=f,I=i+d*L,r[0]=O,r[1]=I;break;case 3:I=l,O=n+p/L,r[0]=O,r[1]=I;break;case 4:O=h,I=i+-d*L,r[0]=O,r[1]=I}if(!N)switch(M){case 1:R=v,D=o+-b/L,r[2]=D,r[3]=R;break;case 2:D=w,R=a+E*L,r[2]=D,r[3]=R;break;case 3:R=_,D=o+b/L,r[2]=D,r[3]=R;break;case 4:D=m,R=a+-E*L,r[2]=D,r[3]=R}}return!1},i.getCardinalDirection=function(t,e,r){return t>e?r:1+r%4},i.getIntersection=function(t,e,r,i){if(null==i)return this.getIntersection2(t,e,r);var o,a,s,u,c,h,l,f=t.x,d=t.y,p=e.x,g=e.y,v=r.x,y=r.y,m=i.x,_=i.y;return 0==(l=(o=g-d)*(u=v-m)-(a=_-y)*(s=f-p))?null:new n((s*(h=m*y-v*_)-u*(c=p*d-f*g))/l,(a*c-o*h)/l)},i.angleOfVector=function(t,e,r,n){var i=void 0;return t!==r?(i=Math.atan((n-e)/(r-t)),r=0){var h=(-u+Math.sqrt(u*u-4*s*c))/(2*s),l=(-u-Math.sqrt(u*u-4*s*c))/(2*s);return h>=0&&h<=1?[h]:l>=0&&l<=1?[l]:null}return null},i.HALF_PI=.5*Math.PI,i.ONE_AND_HALF_PI=1.5*Math.PI,i.TWO_PI=2*Math.PI,i.THREE_PI=3*Math.PI,t.exports=i},function(t,e,r){function n(){}n.sign=function(t){return t>0?1:t<0?-1:0},n.floor=function(t){return t<0?Math.ceil(t):Math.floor(t)},n.ceil=function(t){return t<0?Math.floor(t):Math.ceil(t)},t.exports=n},function(t,e,r){function n(){}n.MAX_VALUE=2147483647,n.MIN_VALUE=-2147483648,t.exports=n},function(t,e,r){var n=function(){function t(t,e){for(var r=0;r0&&e;){for(s.push(c[0]);s.length>0&&e;){var h=s[0];s.splice(0,1),a.add(h);var l=h.getEdges();for(o=0;o-1&&c.splice(g,1)}a=new Set,u=new Map}else t=[]}return t},f.prototype.createDummyNodesForBendpoints=function(t){for(var e=[],r=t.source,n=this.graphManager.calcLowestCommonAncestor(t.source,t.target),i=0;i0){for(var i=this.edgeToDummyNodes.get(r),o=0;o=0&&e.splice(l,1),h.getNeighborsList().forEach((function(t){if(r.indexOf(t)<0){var e=n.get(t)-1;1==e&&u.push(t),n.set(t,e)}}))}r=r.concat(u),1!=e.length&&2!=e.length||(i=!0,o=e[0])}return o},f.prototype.setGraphManager=function(t){this.graphManager=t},t.exports=f},function(t,e,r){function n(){}n.seed=1,n.x=0,n.nextDouble=function(){return n.x=1e4*Math.sin(n.seed++),n.x-Math.floor(n.x)},t.exports=n},function(t,e,r){var n=r(5);function i(t,e){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}i.prototype.getWorldOrgX=function(){return this.lworldOrgX},i.prototype.setWorldOrgX=function(t){this.lworldOrgX=t},i.prototype.getWorldOrgY=function(){return this.lworldOrgY},i.prototype.setWorldOrgY=function(t){this.lworldOrgY=t},i.prototype.getWorldExtX=function(){return this.lworldExtX},i.prototype.setWorldExtX=function(t){this.lworldExtX=t},i.prototype.getWorldExtY=function(){return this.lworldExtY},i.prototype.setWorldExtY=function(t){this.lworldExtY=t},i.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},i.prototype.setDeviceOrgX=function(t){this.ldeviceOrgX=t},i.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},i.prototype.setDeviceOrgY=function(t){this.ldeviceOrgY=t},i.prototype.getDeviceExtX=function(){return this.ldeviceExtX},i.prototype.setDeviceExtX=function(t){this.ldeviceExtX=t},i.prototype.getDeviceExtY=function(){return this.ldeviceExtY},i.prototype.setDeviceExtY=function(t){this.ldeviceExtY=t},i.prototype.transformX=function(t){var e=0,r=this.lworldExtX;return 0!=r&&(e=this.ldeviceOrgX+(t-this.lworldOrgX)*this.ldeviceExtX/r),e},i.prototype.transformY=function(t){var e=0,r=this.lworldExtY;return 0!=r&&(e=this.ldeviceOrgY+(t-this.lworldOrgY)*this.ldeviceExtY/r),e},i.prototype.inverseTransformX=function(t){var e=0,r=this.ldeviceExtX;return 0!=r&&(e=this.lworldOrgX+(t-this.ldeviceOrgX)*this.lworldExtX/r),e},i.prototype.inverseTransformY=function(t){var e=0,r=this.ldeviceExtY;return 0!=r&&(e=this.lworldOrgY+(t-this.ldeviceOrgY)*this.lworldExtY/r),e},i.prototype.inverseTransformPoint=function(t){return new n(this.inverseTransformX(t.x),this.inverseTransformY(t.y))},t.exports=i},function(t,e,r){var n=r(15),i=r(4),o=r(0),a=r(8),s=r(9);function u(){n.call(this),this.useSmartIdealEdgeLengthCalculation=i.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=i.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=i.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=i.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=i.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*i.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=i.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=i.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=i.MAX_ITERATIONS}for(var c in u.prototype=Object.create(n.prototype),n)u[c]=n[c];u.prototype.initParameters=function(){n.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=i.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},u.prototype.calcIdealEdgeLengths=function(){for(var t,e,r,n,a,s,u,c=this.getGraphManager().getAllEdges(),h=0;hi.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*i.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(t-i.ADAPTATION_LOWER_NODE_LIMIT)/(i.ADAPTATION_UPPER_NODE_LIMIT-i.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-i.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=i.MAX_NODE_DISPLACEMENT_INCREMENTAL):(t>i.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(i.COOLING_ADAPTATION_FACTOR,1-(t-i.ADAPTATION_LOWER_NODE_LIMIT)/(i.ADAPTATION_UPPER_NODE_LIMIT-i.ADAPTATION_LOWER_NODE_LIMIT)*(1-i.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=i.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(5*this.getAllNodes().length,this.maxIterations),this.displacementThresholdPerNode=3*i.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},u.prototype.calcSpringForces=function(){for(var t,e=this.getAllEdges(),r=0;r0&&void 0!==arguments[0])||arguments[0],s=arguments.length>1&&void 0!==arguments[1]&&arguments[1],u=this.getAllNodes();if(this.useFRGridVariant)for(this.totalIterations%i.GRID_CALCULATION_CHECK_PERIOD==1&&a&&this.updateGrid(),o=new Set,t=0;t(u=e.getEstimatedSize()*this.gravityRangeFactor)||s>u)&&(t.gravitationForceX=-this.gravityConstant*i,t.gravitationForceY=-this.gravityConstant*o):(a>(u=e.getEstimatedSize()*this.compoundGravityRangeFactor)||s>u)&&(t.gravitationForceX=-this.gravityConstant*i*this.compoundGravityConstant,t.gravitationForceY=-this.gravityConstant*o*this.compoundGravityConstant)},u.prototype.isConverged=function(){var t,e=!1;return this.totalIterations>this.maxIterations/3&&(e=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),t=this.totalDisplacement=s.length||c>=s[0].length))for(var h=0;ht}}]),t}();t.exports=o},function(t,e,r){function n(){}n.svd=function(t){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=t.length,this.n=t[0].length;var e=Math.min(this.m,this.n);this.s=function(t){for(var e=[];t-- >0;)e.push(0);return e}(Math.min(this.m+1,this.n)),this.U=function t(e){if(0==e.length)return 0;for(var r=[],n=0;n0;)e.push(0);return e}(this.n),a=function(t){for(var e=[];t-- >0;)e.push(0);return e}(this.m),s=Math.min(this.m-1,this.n),u=Math.max(0,Math.min(this.n-2,this.m)),c=0;c=0;M--)if(0!==this.s[M]){for(var O=M+1;O=0;G--){if(function(t,e){return t&&e}(G0;){var W=void 0,V=void 0;for(W=T-2;W>=-1&&-1!==W;W--)if(Math.abs(o[W])<=B+H*(Math.abs(this.s[W])+Math.abs(this.s[W+1]))){o[W]=0;break}if(W===T-2)V=4;else{var q=void 0;for(q=T-1;q>=W&&q!==W;q--){var $=(q!==T?Math.abs(o[q]):0)+(q!==W+1?Math.abs(o[q-1]):0);if(Math.abs(this.s[q])<=B+H*$){this.s[q]=0;break}}q===W?V=3:q===T-1?V=1:(V=2,W=q)}switch(W++,V){case 1:var Z=o[T-2];o[T-2]=0;for(var K=T-2;K>=W;K--){var Q=n.hypot(this.s[K],Z),J=this.s[K]/Q,tt=Z/Q;this.s[K]=Q,K!==W&&(Z=-tt*o[K-1],o[K-1]=J*o[K-1]);for(var et=0;et=this.s[W+1]);){var Tt=this.s[W];if(this.s[W]=this.s[W+1],this.s[W+1]=Tt,WMath.abs(e)?(r=e/t,r=Math.abs(t)*Math.sqrt(1+r*r)):0!=e?(r=t/e,r=Math.abs(e)*Math.sqrt(1+r*r)):r=0,r},t.exports=n},function(t,e,r){var n=function(){function t(t,e){for(var r=0;r2&&void 0!==arguments[2]?arguments[2]:1,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1;i(this,t),this.sequence1=e,this.sequence2=r,this.match_score=n,this.mismatch_penalty=o,this.gap_penalty=a,this.iMax=e.length+1,this.jMax=r.length+1,this.grid=new Array(this.iMax);for(var s=0;s=0;r--){var n=this.listeners[r];n.event===t&&n.callback===e&&this.listeners.splice(r,1)}},i.emit=function(t,e){for(var r=0;r{var n={};n.layoutBase=r(551),n.CoSEConstants=r(806),n.CoSEEdge=r(767),n.CoSEGraph=r(880),n.CoSEGraphManager=r(578),n.CoSELayout=r(765),n.CoSENode=r(991),n.ConstraintHandler=r(902),t.exports=n},806:(t,e,r)=>{var n=r(551).FDLayoutConstants;function i(){}for(var o in n)i[o]=n[o];i.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,i.DEFAULT_RADIAL_SEPARATION=n.DEFAULT_EDGE_LENGTH,i.DEFAULT_COMPONENT_SEPERATION=60,i.TILE=!0,i.TILING_PADDING_VERTICAL=10,i.TILING_PADDING_HORIZONTAL=10,i.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,i.ENFORCE_CONSTRAINTS=!0,i.APPLY_LAYOUT=!0,i.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,i.TREE_REDUCTION_ON_INCREMENTAL=!0,i.PURE_INCREMENTAL=i.DEFAULT_INCREMENTAL,t.exports=i},767:(t,e,r)=>{var n=r(551).FDLayoutEdge;function i(t,e,r){n.call(this,t,e,r)}for(var o in i.prototype=Object.create(n.prototype),n)i[o]=n[o];t.exports=i},880:(t,e,r)=>{var n=r(551).LGraph;function i(t,e,r){n.call(this,t,e,r)}for(var o in i.prototype=Object.create(n.prototype),n)i[o]=n[o];t.exports=i},578:(t,e,r)=>{var n=r(551).LGraphManager;function i(t){n.call(this,t)}for(var o in i.prototype=Object.create(n.prototype),n)i[o]=n[o];t.exports=i},765:(t,e,r)=>{var n=r(551).FDLayout,i=r(578),o=r(880),a=r(991),s=r(767),u=r(806),c=r(902),h=r(551).FDLayoutConstants,l=r(551).LayoutConstants,f=r(551).Point,d=r(551).PointD,p=r(551).DimensionD,g=r(551).Layout,v=r(551).Integer,y=r(551).IGeometry,m=r(551).LGraph,_=r(551).Transform,w=r(551).LinkedList;function E(){n.call(this),this.toBeTiled={},this.constraints={}}for(var b in E.prototype=Object.create(n.prototype),n)E[b]=n[b];E.prototype.newGraphManager=function(){var t=new i(this);return this.graphManager=t,t},E.prototype.newGraph=function(t){return new o(null,this.graphManager,t)},E.prototype.newNode=function(t){return new a(this.graphManager,t)},E.prototype.newEdge=function(t){return new s(null,null,t)},E.prototype.initParameters=function(){n.prototype.initParameters.call(this,arguments),this.isSubLayout||(u.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=u.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=u.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=h.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=h.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=h.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=h.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},E.prototype.initSpringEmbedder=function(){n.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/h.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},E.prototype.layout=function(){return l.DEFAULT_CREATE_BENDS_AS_NEEDED&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},E.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)u.TREE_REDUCTION_ON_INCREMENTAL&&(this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation(),e=new Set(this.getAllNodes()),r=this.nodesWithGravity.filter((function(t){return e.has(t)})),this.graphManager.setAllNodesToApplyGravitation(r));else{var t=this.getFlatForest();if(t.length>0)this.positionNodesRadially(t);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var e=new Set(this.getAllNodes()),r=this.nodesWithGravity.filter((function(t){return e.has(t)}));this.graphManager.setAllNodesToApplyGravitation(r),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(c.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),u.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},E.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished){if(!(this.prunedNodesAll.length>0))return!0;this.isTreeGrowing=!0}if(this.totalIterations%h.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged()){if(!(this.prunedNodesAll.length>0))return!0;this.isTreeGrowing=!0}this.coolingCycle++,0==this.layoutQuality?this.coolingAdjuster=this.coolingCycle:1==this.layoutQuality&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var t=new Set(this.getAllNodes()),e=this.nodesWithGravity.filter((function(e){return t.has(e)}));this.graphManager.setAllNodesToApplyGravitation(e),this.graphManager.updateBounds(),this.updateGrid(),u.PURE_INCREMENTAL?this.coolingFactor=h.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=h.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()),u.PURE_INCREMENTAL?this.coolingFactor=h.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=h.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var r=!this.isTreeGrowing&&!this.isGrowthFinished,n=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(r,n),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},E.prototype.getPositionsData=function(){for(var t=this.graphManager.getAllNodes(),e={},r=0;r0&&this.updateDisplacements(),e=0;e0&&(n.fixedNodeWeight=o)}if(this.constraints.relativePlacementConstraint){var a=new Map,s=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach((function(e){t.fixedNodesOnHorizontal.add(e),t.fixedNodesOnVertical.add(e)})),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical){var c=this.constraints.alignmentConstraint.vertical;for(r=0;r=2*t.length/3;n--)e=Math.floor(Math.random()*(n+1)),r=t[n],t[n]=t[e],t[e]=r;return t},this.nodesInRelativeHorizontal=[],this.nodesInRelativeVertical=[],this.nodeToRelativeConstraintMapHorizontal=new Map,this.nodeToRelativeConstraintMapVertical=new Map,this.nodeToTempPositionMapHorizontal=new Map,this.nodeToTempPositionMapVertical=new Map,this.constraints.relativePlacementConstraint.forEach((function(e){if(e.left){var r=a.has(e.left)?a.get(e.left):e.left,n=a.has(e.right)?a.get(e.right):e.right;t.nodesInRelativeHorizontal.includes(r)||(t.nodesInRelativeHorizontal.push(r),t.nodeToRelativeConstraintMapHorizontal.set(r,[]),t.dummyToNodeForVerticalAlignment.has(r)?t.nodeToTempPositionMapHorizontal.set(r,t.idToNodeMap.get(t.dummyToNodeForVerticalAlignment.get(r)[0]).getCenterX()):t.nodeToTempPositionMapHorizontal.set(r,t.idToNodeMap.get(r).getCenterX())),t.nodesInRelativeHorizontal.includes(n)||(t.nodesInRelativeHorizontal.push(n),t.nodeToRelativeConstraintMapHorizontal.set(n,[]),t.dummyToNodeForVerticalAlignment.has(n)?t.nodeToTempPositionMapHorizontal.set(n,t.idToNodeMap.get(t.dummyToNodeForVerticalAlignment.get(n)[0]).getCenterX()):t.nodeToTempPositionMapHorizontal.set(n,t.idToNodeMap.get(n).getCenterX())),t.nodeToRelativeConstraintMapHorizontal.get(r).push({right:n,gap:e.gap}),t.nodeToRelativeConstraintMapHorizontal.get(n).push({left:r,gap:e.gap})}else{var i=s.has(e.top)?s.get(e.top):e.top,o=s.has(e.bottom)?s.get(e.bottom):e.bottom;t.nodesInRelativeVertical.includes(i)||(t.nodesInRelativeVertical.push(i),t.nodeToRelativeConstraintMapVertical.set(i,[]),t.dummyToNodeForHorizontalAlignment.has(i)?t.nodeToTempPositionMapVertical.set(i,t.idToNodeMap.get(t.dummyToNodeForHorizontalAlignment.get(i)[0]).getCenterY()):t.nodeToTempPositionMapVertical.set(i,t.idToNodeMap.get(i).getCenterY())),t.nodesInRelativeVertical.includes(o)||(t.nodesInRelativeVertical.push(o),t.nodeToRelativeConstraintMapVertical.set(o,[]),t.dummyToNodeForHorizontalAlignment.has(o)?t.nodeToTempPositionMapVertical.set(o,t.idToNodeMap.get(t.dummyToNodeForHorizontalAlignment.get(o)[0]).getCenterY()):t.nodeToTempPositionMapVertical.set(o,t.idToNodeMap.get(o).getCenterY())),t.nodeToRelativeConstraintMapVertical.get(i).push({bottom:o,gap:e.gap}),t.nodeToRelativeConstraintMapVertical.get(o).push({top:i,gap:e.gap})}}));else{var l=new Map,f=new Map;this.constraints.relativePlacementConstraint.forEach((function(t){if(t.left){var e=a.has(t.left)?a.get(t.left):t.left,r=a.has(t.right)?a.get(t.right):t.right;l.has(e)?l.get(e).push(r):l.set(e,[r]),l.has(r)?l.get(r).push(e):l.set(r,[e])}else{var n=s.has(t.top)?s.get(t.top):t.top,i=s.has(t.bottom)?s.get(t.bottom):t.bottom;f.has(n)?f.get(n).push(i):f.set(n,[i]),f.has(i)?f.get(i).push(n):f.set(i,[n])}}));var d=function(t,e){var r=[],n=[],i=new w,o=new Set,a=0;return t.forEach((function(s,u){if(!o.has(u)){r[a]=[],n[a]=!1;var c=u;for(i.push(c),o.add(c),r[a].push(c);0!=i.length;)c=i.shift(),e.has(c)&&(n[a]=!0),t.get(c).forEach((function(t){o.has(t)||(i.push(t),o.add(t),r[a].push(t))}));a++}})),{components:r,isFixed:n}},p=d(l,t.fixedNodesOnHorizontal);this.componentsOnHorizontal=p.components,this.fixedComponentsOnHorizontal=p.isFixed;var g=d(f,t.fixedNodesOnVertical);this.componentsOnVertical=g.components,this.fixedComponentsOnVertical=g.isFixed}}},E.prototype.updateDisplacements=function(){var t=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach((function(e){var r=t.idToNodeMap.get(e.nodeId);r.displacementX=0,r.displacementY=0})),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var e=this.constraints.alignmentConstraint.vertical,r=0;r1)for(s=0;sn&&(n=Math.floor(a.y)),o=Math.floor(a.x+u.DEFAULT_COMPONENT_SEPERATION)}this.transform(new d(l.WORLD_CENTER_X-a.x/2,l.WORLD_CENTER_Y-a.y/2))},E.radialLayout=function(t,e,r){var n=Math.max(this.maxDiagonalInTree(t),u.DEFAULT_RADIAL_SEPARATION);E.branchRadialLayout(e,null,0,359,0,n);var i=m.calculateBounds(t),o=new _;o.setDeviceOrgX(i.getMinX()),o.setDeviceOrgY(i.getMinY()),o.setWorldOrgX(r.x),o.setWorldOrgY(r.y);for(var a=0;a1;){var v=g[0];g.splice(0,1);var m=h.indexOf(v);m>=0&&h.splice(m,1),p--,l--}f=null!=e?(h.indexOf(g[0])+1)%p:0;for(var _=Math.abs(n-r)/l,w=f;d!=l;w=++w%p){var b=h[w].getOtherEnd(t);if(b!=e){var x=(r+d*_)%360,N=(x+_)%360;E.branchRadialLayout(b,t,x,N,i+o,o),d++}}},E.maxDiagonalInTree=function(t){for(var e=v.MIN_VALUE,r=0;re&&(e=n)}return e},E.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},E.prototype.groupZeroDegreeMembers=function(){var t=this,e={};this.memberGroups={},this.idToDummyNode={};for(var r=[],n=this.graphManager.getAllNodes(),i=0;i1){var n="DummyCompound_"+r;t.memberGroups[n]=e[r];var i=e[r][0].getParent(),o=new a(t.graphManager);o.id=n,o.paddingLeft=i.paddingLeft||0,o.paddingRight=i.paddingRight||0,o.paddingBottom=i.paddingBottom||0,o.paddingTop=i.paddingTop||0,t.idToDummyNode[n]=o;var s=t.getGraphManager().add(t.newGraph(),o),u=i.getChild();u.add(o);for(var c=0;ci?(n.rect.x-=(n.labelWidth-i)/2,n.setWidth(n.labelWidth),n.labelMarginLeft=(n.labelWidth-i)/2):"right"==n.labelPosHorizontal&&n.setWidth(i+n.labelWidth)),n.labelHeight&&("top"==n.labelPosVertical?(n.rect.y-=n.labelHeight,n.setHeight(o+n.labelHeight),n.labelMarginTop=n.labelHeight):"center"==n.labelPosVertical&&n.labelHeight>o?(n.rect.y-=(n.labelHeight-o)/2,n.setHeight(n.labelHeight),n.labelMarginTop=(n.labelHeight-o)/2):"bottom"==n.labelPosVertical&&n.setHeight(o+n.labelHeight))}}))},E.prototype.repopulateCompounds=function(){for(var t=this.compoundOrder.length-1;t>=0;t--){var e=this.compoundOrder[t],r=e.id,n=e.paddingLeft,i=e.paddingTop,o=e.labelMarginLeft,a=e.labelMarginTop;this.adjustLocations(this.tiledMemberPack[r],e.rect.x,e.rect.y,n,i,o,a)}},E.prototype.repopulateZeroDegreeMembers=function(){var t=this,e=this.tiledZeroDegreePack;Object.keys(e).forEach((function(r){var n=t.idToDummyNode[r],i=n.paddingLeft,o=n.paddingTop,a=n.labelMarginLeft,s=n.labelMarginTop;t.adjustLocations(e[r],n.rect.x,n.rect.y,i,o,a,s)}))},E.prototype.getToBeTiled=function(t){var e=t.id;if(null!=this.toBeTiled[e])return this.toBeTiled[e];var r=t.getChild();if(null==r)return this.toBeTiled[e]=!1,!1;for(var n=r.getNodes(),i=0;i0)return this.toBeTiled[e]=!1,!1;if(null!=o.getChild()){if(!this.getToBeTiled(o))return this.toBeTiled[e]=!1,!1}else this.toBeTiled[o.id]=!1}return this.toBeTiled[e]=!0,!0},E.prototype.getNodeDegree=function(t){t.id;for(var e=t.getEdges(),r=0,n=0;nh&&(h=f.rect.height)}r+=h+t.verticalPadding}},E.prototype.tileCompoundMembers=function(t,e){var r=this;this.tiledMemberPack=[],Object.keys(t).forEach((function(n){var i=e[n];if(r.tiledMemberPack[n]=r.tileNodes(t[n],i.paddingLeft+i.paddingRight),i.rect.width=r.tiledMemberPack[n].width,i.rect.height=r.tiledMemberPack[n].height,i.setCenter(r.tiledMemberPack[n].centerX,r.tiledMemberPack[n].centerY),i.labelMarginLeft=0,i.labelMarginTop=0,u.NODE_DIMENSIONS_INCLUDE_LABELS){var o=i.rect.width,a=i.rect.height;i.labelWidth&&("left"==i.labelPosHorizontal?(i.rect.x-=i.labelWidth,i.setWidth(o+i.labelWidth),i.labelMarginLeft=i.labelWidth):"center"==i.labelPosHorizontal&&i.labelWidth>o?(i.rect.x-=(i.labelWidth-o)/2,i.setWidth(i.labelWidth),i.labelMarginLeft=(i.labelWidth-o)/2):"right"==i.labelPosHorizontal&&i.setWidth(o+i.labelWidth)),i.labelHeight&&("top"==i.labelPosVertical?(i.rect.y-=i.labelHeight,i.setHeight(a+i.labelHeight),i.labelMarginTop=i.labelHeight):"center"==i.labelPosVertical&&i.labelHeight>a?(i.rect.y-=(i.labelHeight-a)/2,i.setHeight(i.labelHeight),i.labelMarginTop=(i.labelHeight-a)/2):"bottom"==i.labelPosVertical&&i.setHeight(a+i.labelHeight))}}))},E.prototype.tileNodes=function(t,e){var r=this.tileNodesByFavoringDim(t,e,!0),n=this.tileNodesByFavoringDim(t,e,!1),i=this.getOrgRatio(r);return this.getOrgRatio(n)s&&(s=t.getWidth())}));var c,h=o/i,l=a/i,f=Math.pow(r-n,2)+4*(h+n)*(l+r)*i,d=(n-r+Math.sqrt(f))/(2*(h+n));e?(c=Math.ceil(d))==d&&c++:c=Math.floor(d);var p=c*(h+n)-n;return s>p&&(p=s),p+=2*n},E.prototype.tileNodesByFavoringDim=function(t,e,r){var n=u.TILING_PADDING_VERTICAL,i=u.TILING_PADDING_HORIZONTAL,o=u.TILING_COMPARE_BY,a={rows:[],rowWidth:[],rowHeight:[],width:0,height:e,verticalPadding:n,horizontalPadding:i,centerX:0,centerY:0};o&&(a.idealRowWidth=this.calcIdealRowWidth(t,r));var s=function(t){return t.rect.width*t.rect.height},c=function(t,e){return s(e)-s(t)};t.sort((function(t,e){var r=c;return a.idealRowWidth?(r=o)(t.id,e.id):r(t,e)}));for(var h=0,l=0,f=0;f0&&(o+=t.horizontalPadding),t.rowWidth[r]=o,t.width0&&(a+=t.verticalPadding);var s=0;a>t.rowHeight[r]&&(s=t.rowHeight[r],t.rowHeight[r]=a,s=t.rowHeight[r]-s),t.height+=s,t.rows[r].push(e)},E.prototype.getShortestRowIndex=function(t){for(var e=-1,r=Number.MAX_VALUE,n=0;nr&&(e=n,r=t.rowWidth[n]);return e},E.prototype.canAddHorizontal=function(t,e,r){if(t.idealRowWidth){var n=t.rows.length-1;return t.rowWidth[n]+e+t.horizontalPadding<=t.idealRowWidth}var i=this.getShortestRowIndex(t);if(i<0)return!0;var o=t.rowWidth[i];if(o+t.horizontalPadding+e<=t.width)return!0;var a,s,u=0;return t.rowHeight[i]0&&(u=r+t.verticalPadding-t.rowHeight[i]),a=t.width-o>=e+t.horizontalPadding?(t.height+u)/(o+e+t.horizontalPadding):(t.height+u)/t.width,u=r+t.verticalPadding,(s=t.widtho&&e!=r){n.splice(-1,1),t.rows[r].push(i),t.rowWidth[e]=t.rowWidth[e]-o,t.rowWidth[r]=t.rowWidth[r]+o,t.width=t.rowWidth[instance.getLongestRowIndex(t)];for(var a=Number.MIN_VALUE,s=0;sa&&(a=n[s].height);e>0&&(a+=t.verticalPadding);var u=t.rowHeight[e]+t.rowHeight[r];t.rowHeight[e]=a,t.rowHeight[r]0)for(var l=i;l<=o;l++)c[0]+=this.grid[l][a-1].length+this.grid[l][a].length-1;if(o0)for(l=a;l<=s;l++)c[3]+=this.grid[i-1][l].length+this.grid[i][l].length-1;for(var f,d,p=v.MAX_VALUE,g=0;g{var n=r(551).FDLayoutNode,i=r(551).IMath;function o(t,e,r,i){n.call(this,t,e,r,i)}for(var a in o.prototype=Object.create(n.prototype),n)o[a]=n[a];o.prototype.calculateDisplacement=function(){var t=this.graphManager.getLayout();null!=this.getChild()&&this.fixedNodeWeight?(this.displacementX+=t.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=t.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=t.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=t.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>t.coolingFactor*t.maxNodeDisplacement&&(this.displacementX=t.coolingFactor*t.maxNodeDisplacement*i.sign(this.displacementX)),Math.abs(this.displacementY)>t.coolingFactor*t.maxNodeDisplacement&&(this.displacementY=t.coolingFactor*t.maxNodeDisplacement*i.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},o.prototype.propogateDisplacementToChildren=function(t,e){for(var r,n=this.getChild().getNodes(),i=0;i{function n(t){if(Array.isArray(t)){for(var e=0,r=Array(t.length);e0){var o=0;n.forEach((function(t){"horizontal"==e?(l.set(t,u.has(t)?c[u.get(t)]:i.get(t)),o+=l.get(t)):(l.set(t,u.has(t)?h[u.get(t)]:i.get(t)),o+=l.get(t))})),o/=n.length,t.forEach((function(t){r.has(t)||l.set(t,o)}))}else{var a=0;t.forEach((function(t){a+="horizontal"==e?u.has(t)?c[u.get(t)]:i.get(t):u.has(t)?h[u.get(t)]:i.get(t)})),a/=t.length,t.forEach((function(t){l.set(t,a)}))}}));for(var p=function(){var n=d.shift();t.get(n).forEach((function(t){if(l.get(t.id)a&&(a=m),_s&&(s=_)}}catch(t){d=!0,p=t}finally{try{!f&&v.return&&v.return()}finally{if(d)throw p}}var w=(n+a)/2-(o+s)/2,E=!0,b=!1,x=void 0;try{for(var N,A=t[Symbol.iterator]();!(E=(N=A.next()).done);E=!0){var T=N.value;l.set(T,l.get(T)+w)}}catch(t){b=!0,x=t}finally{try{!E&&A.return&&A.return()}finally{if(b)throw x}}}))}return l},y=function(t){var e=0,r=0,n=0,i=0;if(t.forEach((function(t){t.left?c[u.get(t.left)]-c[u.get(t.right)]>=0?e++:r++:h[u.get(t.top)]-h[u.get(t.bottom)]>=0?n++:i++})),e>r&&n>i)for(var o=0;or)for(var a=0;ai)for(var s=0;s1)e.fixedNodeConstraint.forEach((function(t,e){E[e]=[t.position.x,t.position.y],b[e]=[c[u.get(t.nodeId)],h[u.get(t.nodeId)]]})),x=!0;else if(e.alignmentConstraint)!function(){var t=0;if(e.alignmentConstraint.vertical){for(var r=e.alignmentConstraint.vertical,i=function(e){var i=new Set;r[e].forEach((function(t){i.add(t)}));var o=new Set([].concat(n(i)).filter((function(t){return A.has(t)}))),a=void 0;a=o.size>0?c[u.get(o.values().next().value)]:g(i).x,r[e].forEach((function(e){E[t]=[a,h[u.get(e)]],b[t]=[c[u.get(e)],h[u.get(e)]],t++}))},o=0;o0?c[u.get(i.values().next().value)]:g(r).y,a[e].forEach((function(e){E[t]=[c[u.get(e)],o],b[t]=[c[u.get(e)],h[u.get(e)]],t++}))},l=0;lM&&(M=C[I].length,O=I);if(M0){var V={x:0,y:0};e.fixedNodeConstraint.forEach((function(t,e){var r,n,i={x:c[u.get(t.nodeId)],y:h[u.get(t.nodeId)]},o=t.position,a=(n=i,{x:(r=o).x-n.x,y:r.y-n.y});V.x+=a.x,V.y+=a.y})),V.x/=e.fixedNodeConstraint.length,V.y/=e.fixedNodeConstraint.length,c.forEach((function(t,e){c[e]+=V.x})),h.forEach((function(t,e){h[e]+=V.y})),e.fixedNodeConstraint.forEach((function(t){c[u.get(t.nodeId)]=t.position.x,h[u.get(t.nodeId)]=t.position.y}))}if(e.alignmentConstraint){if(e.alignmentConstraint.vertical)for(var q=e.alignmentConstraint.vertical,$=function(t){var e=new Set;q[t].forEach((function(t){e.add(t)}));var r=new Set([].concat(n(e)).filter((function(t){return A.has(t)}))),i=void 0;i=r.size>0?c[u.get(r.values().next().value)]:g(e).x,e.forEach((function(t){A.has(t)||(c[u.get(t)]=i)}))},Z=0;Z0?h[u.get(r.values().next().value)]:g(e).y,e.forEach((function(t){A.has(t)||(h[u.get(t)]=i)}))},J=0;J{e.exports=t}},r={},n=function t(n){var i=r[n];if(void 0!==i)return i.exports;var o=r[n]={exports:{}};return e[n](o,o.exports,t),o.exports}(45),n;var e,r,n}));var l=c.exports,f=function(t){function r(e,r,n,i,o,a){var s=t.call(this,e,r,n,i)||this;return s.layerIdx=-1,s.order=-1,s.isDirected=0,s.id=o,s.rank=a,s.noOfChildren=1,s.parentId="",s}return e(r,t),r.prototype.calculateDisplacement=function(){var t=this.graphManager.getLayout(),e=t.coolingFactor;1==this.isDirected&&(e=.7*t.directedCoolingFactor),this.displacementX+=e*(this.springForceX+this.repulsionForceX)/this.noOfChildren,1!==this.isDirected&&(this.displacementY+=e*(this.springForceY+this.repulsionForceY)/this.noOfChildren),Math.abs(this.displacementX)>e*t.maxNodeDisplacement&&(this.displacementX=e*t.maxNodeDisplacement*c.exports.layoutBase.IMath.sign(this.displacementX)),1!=this.isDirected&&Math.abs(this.displacementY)>e*t.maxNodeDisplacement&&(this.displacementY=e*t.maxNodeDisplacement*c.exports.layoutBase.IMath.sign(this.displacementY)),this.child&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},r.prototype.propogateDisplacementToChildren=function(t,e){this.child.nodes.forEach((function(r){r.child?r.propogateDisplacementToChildren(t,e):(r.displacementX+=t,r.displacementY+=e)}))},r.prototype.move=function(){var t=this.graphManager.getLayout();this.child||(1!=this.isDirected?(this.moveBy(this.displacementX,this.displacementY),t.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY),0===this.isDirected?t.undirectedDisplacement+=Math.abs(this.displacementY):t.directedDisplacement+=Math.abs(this.displacementY)):(this.moveBy(this.displacementX,0),t.totalDisplacement+=Math.abs(this.displacementX),1==this.isDirected?t.directedDisplacement+=Math.abs(this.displacementY):t.undirectedDisplacement+=Math.abs(this.displacementY)))},r.prototype.swapPositionWith=function(t,e){void 0===e&&(e=!0);var n=t.rect.x,i=t.rect.y,o=this.rect.x,a=this.rect.y;if(c.exports.layoutBase.uniformNodeDimensions||(n0&&this.prepareOrderedLayers(),this.prepareCompoundNodes(),this.dummyCompoundNodes.forEach((function(t){r.graphManager.getRoot().add(t),r.graphManager.allNodes.push(t)})),this.graphManager.getRoot().calcEstimatedSize();var u=0;for(s=0;s0&&(void 0===r[a]&&(r[a]=new Set),s.forEach((function(t){r[a].has(t)||r[a].add(t)}))),t.child&&t.child.nodes.forEach((function(t){i(t,a)})),t.parentId){var u=t.owner.parent;i(u,a)}t.edges.filter((function(t){return 1!=t.source.isDirected&&1!=t.target.isDirected})).forEach((function(e){var r=e.source.id==t.id?e.target:e.source;i(r,a)}))}},o=function(t){var e=t.edges.filter((function(t){return 1==t.source.isDirected||1==t.target.isDirected}));return e.length>0?e.map((function(e){return e.source.id==t.id?e.target:e.source})):[]},a=this.graphManager.allNodes.filter((function(t){return 1!=t.isDirected})),s=0;sl.rect.x+l.rect.width)&&(l=t),(1!=d.isDirected||t.rect.yp.rect.y+p.rect.height)&&(p=t)}));var g=function(n){var i=Object.keys(e)[n],o=e[Object.keys(e)[n]],a=r[i],s=[],u=[];null==a||0==a.size?(u.push(p.rect.y+p.rect.height),s.push(l.rect.x+l.rect.width)):a.forEach((function(t){s.push(t.rect.x),u.push(t.rect.y)}));var g=v.newGraph(),y=0;o.forEach((function(t){t.setRect({x:0,y:0},t.rect),y++,t.parentId||g.add(t)})),g.calcEstimatedSize();var m=new c.exports.layoutBase.PointD(0,0),_=new c.exports.layoutBase.DimensionD(g.getEstimatedSize(),g.getEstimatedSize()),w=new f(v.graphManager,m,_,null,"compoundNode"+i,-1);w.isDirected=0,w.nodeRepulsion=v.nodeRepulsion,w.noOfChildren=y,v.graphManager.add(g,w);var E=s.reduce((function(t,e){return t+e}))/s.length,b=u.reduce((function(t,e){return t+e}))/u.length,x=Math.abs(Math.abs(b)-Math.abs(d.rect.y)),N=Math.abs(p.rect.y+p.rect.height-b),A=Math.abs(Math.abs(E)-Math.abs(h.rect.x)),T=Math.abs(l.rect.x+l.rect.width-E),L=Math.min(x,N,A,T),C=x==L,M=A==L,O=T==L,I=N==L,D=new c.exports.layoutBase.PointD(E,b),R=function(t,e){return!(e.x>t.x+t.width||e.x+e.widtht.y+t.height||e.y+e.heighte.rect.x&&(s=e),a=!0):(s=e,a=!0):u.push(e)})),a&&null!=s&&(t.setRect({x:s.rect.x-50-t.rect.width,y:D.y-t.rect.height/2},t.rect),F(t,e,r))}else if("up"==e){var c=!1,h=null,l=[];r.forEach((function(e){R(t.rect,e.rect)?null!=h&&h instanceof f?(h.rect.y>e.rect.y&&(h=e),c=!0):(h=e,c=!0):l.push(e)})),c&&null!=h&&(t.setRect({x:D.x-t.rect.width/2,y:h.rect.y-50-t.rect.height},t.rect),F(t,e,r))}else if("down"==e){var d=!1,p=null,g=[];r.forEach((function(e){R(t.rect,e.rect)?null!=p&&p instanceof f?(p.rect.y+p.rect.heightthis.maxIterations/3&&(e=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),t=this.totalDisplacement<2*this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,this.oldDirectedDisplacement=this.directedDisplacement,this.oldUndirectedDisplacement=this.undirectedDisplacement,t||e},r.prototype.tick=function(){if(this.totalIterations++,this.totalIterations%c.exports.CoSEConstants.CONVERGENCE_CHECK_PERIOD==0){if(this.isDirectedConverged()||this.totalIterations>this.maxIterations)return!0;this.isFastCooling?this.coolingFactor=this.initialCoolingFactor*((this.maxIterations-this.totalIterations*this.coolingCoefficient)/this.maxIterations):this.coolingFactor=this.initialCoolingFactor*((this.maxIterations-this.totalIterations)/this.maxIterations),this.coolingFactor<0&&(this.coolingFactor=0)}return this.totalDisplacement=0,this.graphManager.updateBounds(),t.prototype.calcSpringForces.call(this),this.useFRGridVariant?this.gridRepulsion():(this.calcRepulsionForces(),this.repulsionTopLevel()),this.swapAndFlip(),this.moveNodes(),!1},r.prototype.gridRepulsion=function(){var t,e=null,r=this.graphManager.getAllNodes();(this.totalIterations%c.exports.layoutBase.FDLayoutConstants.GRID_CALCULATION_CHECK_PERIOD==1||this.forceUpdateGrid)&&this.updateGrid(),t=new Set;for(var n=0;n=a.length||u>=a[0].length))for(var h=0;ho?o-a:a-o),Math.abs(u)s||i>a&&othis.swapForceLimit&&e.push({pairId:s,swapForce:c,layerId:n,n1:o,n2:a,order1:i,order2:i+1,connectedEdgeCount:u})}}e.length>0&&(this.forceUpdateGrid=!0),e.sort((function(t,e){return e.swapForce-t.swapForce}));var h={};for(r=0;rr){var s=r+(t[a].rect.x-r)*o;t[a].moveBy(s-t[a].rect.x,0)}else{s=r-(r-t[a].rect.x)*o;t[a].moveBy(s-t[a].rect.x,0)}(new Date).getTime()},r.prototype.setPositionsFromLayering=function(){for(var t=this.orderedLayers,e=this.orderGap,r=Math.max.apply(Math,i([],n(t.map((function(t){return t.length}))),!1))*e,o=0;oc.source.rect.x&&s.target.rect.xc.target.rect.x)&&e++)}},n=this,i=0;i=this.orderedLayers[t][e+1].rect.x)return!1;return!0},r.prototype.maintainLayers=function(t){var e=t.displacementX>0?t.order+1:t.order-1,r=this.orderedLayers[t.layerIdx][e];if(t.displacementX>0)for(;r&&t.rect.x>r.rect.x;)this.swapOnOrderedLayers(t.layerIdx,e-1,e),e++,r=this.orderedLayers[t.layerIdx][e];else for(;r&&t.rect.x + * Copyright OpenJS Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ +!function(t,e){(function(){var r,n="Expected a function",i="__lodash_hash_undefined__",o="__lodash_placeholder__",s=16,u=32,c=64,h=128,l=256,f=1/0,d=9007199254740991,p=NaN,g=4294967295,v=[["ary",h],["bind",1],["bindKey",2],["curry",8],["curryRight",s],["flip",512],["partial",u],["partialRight",c],["rearg",l]],y="[object Arguments]",m="[object Array]",_="[object Boolean]",w="[object Date]",E="[object Error]",b="[object Function]",x="[object GeneratorFunction]",N="[object Map]",A="[object Number]",T="[object Object]",L="[object Promise]",C="[object RegExp]",M="[object Set]",O="[object String]",I="[object Symbol]",D="[object WeakMap]",R="[object ArrayBuffer]",F="[object DataView]",P="[object Float32Array]",S="[object Float64Array]",G="[object Int8Array]",j="[object Int16Array]",k="[object Int32Array]",U="[object Uint8Array]",Y="[object Uint8ClampedArray]",X="[object Uint16Array]",z="[object Uint32Array]",H=/\b__p \+= '';/g,B=/\b(__p \+=) '' \+/g,W=/(__e\(.*?\)|\b__t\)) \+\n'';/g,V=/&(?:amp|lt|gt|quot|#39);/g,q=/[&<>"']/g,$=RegExp(V.source),Z=RegExp(q.source),K=/<%-([\s\S]+?)%>/g,Q=/<%([\s\S]+?)%>/g,J=/<%=([\s\S]+?)%>/g,tt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,et=/^\w*$/,rt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,nt=/[\\^$.*+?()[\]{}|]/g,it=RegExp(nt.source),ot=/^\s+/,at=/\s/,st=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ut=/\{\n\/\* \[wrapped with (.+)\] \*/,ct=/,? & /,ht=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,lt=/[()=,{}\[\]\/\s]/,ft=/\\(\\)?/g,dt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,pt=/\w*$/,gt=/^[-+]0x[0-9a-f]+$/i,vt=/^0b[01]+$/i,yt=/^\[object .+?Constructor\]$/,mt=/^0o[0-7]+$/i,_t=/^(?:0|[1-9]\d*)$/,wt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Et=/($^)/,bt=/['\n\r\u2028\u2029\\]/g,xt="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Nt="\\u2700-\\u27bf",At="a-z\\xdf-\\xf6\\xf8-\\xff",Tt="A-Z\\xc0-\\xd6\\xd8-\\xde",Lt="\\ufe0e\\ufe0f",Ct="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Mt="['’]",Ot="[\\ud800-\\udfff]",It="["+Ct+"]",Dt="["+xt+"]",Rt="\\d+",Ft="[\\u2700-\\u27bf]",Pt="["+At+"]",St="[^\\ud800-\\udfff"+Ct+Rt+Nt+At+Tt+"]",Gt="\\ud83c[\\udffb-\\udfff]",jt="[^\\ud800-\\udfff]",kt="(?:\\ud83c[\\udde6-\\uddff]){2}",Ut="[\\ud800-\\udbff][\\udc00-\\udfff]",Yt="["+Tt+"]",Xt="(?:"+Pt+"|"+St+")",zt="(?:"+Yt+"|"+St+")",Ht="(?:['’](?:d|ll|m|re|s|t|ve))?",Bt="(?:['’](?:D|LL|M|RE|S|T|VE))?",Wt="(?:"+Dt+"|"+Gt+")"+"?",Vt="[\\ufe0e\\ufe0f]?",qt=Vt+Wt+("(?:\\u200d(?:"+[jt,kt,Ut].join("|")+")"+Vt+Wt+")*"),$t="(?:"+[Ft,kt,Ut].join("|")+")"+qt,Zt="(?:"+[jt+Dt+"?",Dt,kt,Ut,Ot].join("|")+")",Kt=RegExp(Mt,"g"),Qt=RegExp(Dt,"g"),Jt=RegExp(Gt+"(?="+Gt+")|"+Zt+qt,"g"),te=RegExp([Yt+"?"+Pt+"+"+Ht+"(?="+[It,Yt,"$"].join("|")+")",zt+"+"+Bt+"(?="+[It,Yt+Xt,"$"].join("|")+")",Yt+"?"+Xt+"+"+Ht,Yt+"+"+Bt,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Rt,$t].join("|"),"g"),ee=RegExp("[\\u200d\\ud800-\\udfff"+xt+Lt+"]"),re=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ne=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],ie=-1,oe={};oe[P]=oe[S]=oe[G]=oe[j]=oe[k]=oe[U]=oe[Y]=oe[X]=oe[z]=!0,oe[y]=oe[m]=oe[R]=oe[_]=oe[F]=oe[w]=oe[E]=oe[b]=oe[N]=oe[A]=oe[T]=oe[C]=oe[M]=oe[O]=oe[D]=!1;var ae={};ae[y]=ae[m]=ae[R]=ae[F]=ae[_]=ae[w]=ae[P]=ae[S]=ae[G]=ae[j]=ae[k]=ae[N]=ae[A]=ae[T]=ae[C]=ae[M]=ae[O]=ae[I]=ae[U]=ae[Y]=ae[X]=ae[z]=!0,ae[E]=ae[b]=ae[D]=!1;var se={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ue=parseFloat,ce=parseInt,he="object"==typeof a&&a&&a.Object===Object&&a,le="object"==typeof self&&self&&self.Object===Object&&self,fe=he||le||Function("return this")(),de=e&&!e.nodeType&&e,pe=de&&t&&!t.nodeType&&t,ge=pe&&pe.exports===de,ve=ge&&he.process,ye=function(){try{var t=pe&&pe.require&&pe.require("util").types;return t||ve&&ve.binding&&ve.binding("util")}catch(t){}}(),me=ye&&ye.isArrayBuffer,_e=ye&&ye.isDate,we=ye&&ye.isMap,Ee=ye&&ye.isRegExp,be=ye&&ye.isSet,xe=ye&&ye.isTypedArray;function Ne(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}function Ae(t,e,r,n){for(var i=-1,o=null==t?0:t.length;++i-1}function Ie(t,e,r){for(var n=-1,i=null==t?0:t.length;++n-1;);return r}function tr(t,e){for(var r=t.length;r--&&Ue(e,t[r],0)>-1;);return r}function er(t,e){for(var r=t.length,n=0;r--;)t[r]===e&&++n;return n}var rr=Be({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),nr=Be({"&":"&","<":"<",">":">",'"':""","'":"'"});function ir(t){return"\\"+se[t]}function or(t){return ee.test(t)}function ar(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r}function sr(t,e){return function(r){return t(e(r))}}function ur(t,e){for(var r=-1,n=t.length,i=0,a=[];++r",""":'"',"'":"'"});var gr=function t(e){var a,at=(e=null==e?fe:gr.defaults(fe.Object(),e,gr.pick(fe,ne))).Array,xt=e.Date,Nt=e.Error,At=e.Function,Tt=e.Math,Lt=e.Object,Ct=e.RegExp,Mt=e.String,Ot=e.TypeError,It=at.prototype,Dt=At.prototype,Rt=Lt.prototype,Ft=e["__core-js_shared__"],Pt=Dt.toString,St=Rt.hasOwnProperty,Gt=0,jt=(a=/[^.]+$/.exec(Ft&&Ft.keys&&Ft.keys.IE_PROTO||""))?"Symbol(src)_1."+a:"",kt=Rt.toString,Ut=Pt.call(Lt),Yt=fe._,Xt=Ct("^"+Pt.call(St).replace(nt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),zt=ge?e.Buffer:r,Ht=e.Symbol,Bt=e.Uint8Array,Wt=zt?zt.allocUnsafe:r,Vt=sr(Lt.getPrototypeOf,Lt),qt=Lt.create,$t=Rt.propertyIsEnumerable,Zt=It.splice,Jt=Ht?Ht.isConcatSpreadable:r,ee=Ht?Ht.iterator:r,se=Ht?Ht.toStringTag:r,he=function(){try{var t=po(Lt,"defineProperty");return t({},"",{}),t}catch(t){}}(),le=e.clearTimeout!==fe.clearTimeout&&e.clearTimeout,de=xt&&xt.now!==fe.Date.now&&xt.now,pe=e.setTimeout!==fe.setTimeout&&e.setTimeout,ve=Tt.ceil,ye=Tt.floor,Ge=Lt.getOwnPropertySymbols,Be=zt?zt.isBuffer:r,vr=e.isFinite,yr=It.join,mr=sr(Lt.keys,Lt),_r=Tt.max,wr=Tt.min,Er=xt.now,br=e.parseInt,xr=Tt.random,Nr=It.reverse,Ar=po(e,"DataView"),Tr=po(e,"Map"),Lr=po(e,"Promise"),Cr=po(e,"Set"),Mr=po(e,"WeakMap"),Or=po(Lt,"create"),Ir=Mr&&new Mr,Dr={},Rr=Yo(Ar),Fr=Yo(Tr),Pr=Yo(Lr),Sr=Yo(Cr),Gr=Yo(Mr),jr=Ht?Ht.prototype:r,kr=jr?jr.valueOf:r,Ur=jr?jr.toString:r;function Yr(t){if(is(t)&&!Va(t)&&!(t instanceof Br)){if(t instanceof Hr)return t;if(St.call(t,"__wrapped__"))return Xo(t)}return new Hr(t)}var Xr=function(){function t(){}return function(e){if(!ns(e))return{};if(qt)return qt(e);t.prototype=e;var n=new t;return t.prototype=r,n}}();function zr(){}function Hr(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=r}function Br(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=g,this.__views__=[]}function Wr(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e=e?t:e)),t}function hn(t,e,n,i,o,a){var s,u=1&e,c=2&e,h=4&e;if(n&&(s=o?n(t,i,o,a):n(t)),s!==r)return s;if(!ns(t))return t;var l=Va(t);if(l){if(s=function(t){var e=t.length,r=new t.constructor(e);e&&"string"==typeof t[0]&&St.call(t,"index")&&(r.index=t.index,r.input=t.input);return r}(t),!u)return Ii(t,s)}else{var f=yo(t),d=f==b||f==x;if(Ka(t))return Ai(t,u);if(f==T||f==y||d&&!o){if(s=c||d?{}:_o(t),!u)return c?function(t,e){return Di(t,vo(t),e)}(t,function(t,e){return t&&Di(e,Ps(e),t)}(s,t)):function(t,e){return Di(t,go(t),e)}(t,an(s,t))}else{if(!ae[f])return o?t:{};s=function(t,e,r){var n=t.constructor;switch(e){case R:return Ti(t);case _:case w:return new n(+t);case F:return function(t,e){var r=e?Ti(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}(t,r);case P:case S:case G:case j:case k:case U:case Y:case X:case z:return Li(t,r);case N:return new n;case A:case O:return new n(t);case C:return function(t){var e=new t.constructor(t.source,pt.exec(t));return e.lastIndex=t.lastIndex,e}(t);case M:return new n;case I:return i=t,kr?Lt(kr.call(i)):{}}var i}(t,f,u)}}a||(a=new Zr);var p=a.get(t);if(p)return p;a.set(t,s),cs(t)?t.forEach((function(r){s.add(hn(r,e,n,r,t,a))})):os(t)&&t.forEach((function(r,i){s.set(i,hn(r,e,n,i,t,a))}));var g=l?r:(h?c?ao:oo:c?Ps:Fs)(t);return Te(g||t,(function(r,i){g&&(r=t[i=r]),rn(s,i,hn(r,e,n,i,t,a))})),s}function ln(t,e,n){var i=n.length;if(null==t)return!i;for(t=Lt(t);i--;){var o=n[i],a=e[o],s=t[o];if(s===r&&!(o in t)||!a(s))return!1}return!0}function fn(t,e,i){if("function"!=typeof t)throw new Ot(n);return Fo((function(){t.apply(r,i)}),e)}function dn(t,e,r,n){var i=-1,o=Oe,a=!0,s=t.length,u=[],c=e.length;if(!s)return u;r&&(e=De(e,Ze(r))),n?(o=Ie,a=!1):e.length>=200&&(o=Qe,a=!1,e=new $r(e));t:for(;++i-1},Vr.prototype.set=function(t,e){var r=this.__data__,n=nn(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this},qr.prototype.clear=function(){this.size=0,this.__data__={hash:new Wr,map:new(Tr||Vr),string:new Wr}},qr.prototype.delete=function(t){var e=lo(this,t).delete(t);return this.size-=e?1:0,e},qr.prototype.get=function(t){return lo(this,t).get(t)},qr.prototype.has=function(t){return lo(this,t).has(t)},qr.prototype.set=function(t,e){var r=lo(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this},$r.prototype.add=$r.prototype.push=function(t){return this.__data__.set(t,i),this},$r.prototype.has=function(t){return this.__data__.has(t)},Zr.prototype.clear=function(){this.__data__=new Vr,this.size=0},Zr.prototype.delete=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r},Zr.prototype.get=function(t){return this.__data__.get(t)},Zr.prototype.has=function(t){return this.__data__.has(t)},Zr.prototype.set=function(t,e){var r=this.__data__;if(r instanceof Vr){var n=r.__data__;if(!Tr||n.length<199)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new qr(n)}return r.set(t,e),this.size=r.size,this};var pn=Pi(bn),gn=Pi(xn,!0);function vn(t,e){var r=!0;return pn(t,(function(t,n,i){return r=!!e(t,n,i)})),r}function yn(t,e,n){for(var i=-1,o=t.length;++i0&&r(s)?e>1?_n(s,e-1,r,n,i):Re(i,s):n||(i[i.length]=s)}return i}var wn=Si(),En=Si(!0);function bn(t,e){return t&&wn(t,e,Fs)}function xn(t,e){return t&&En(t,e,Fs)}function Nn(t,e){return Me(e,(function(e){return ts(t[e])}))}function An(t,e){for(var n=0,i=(e=Ei(e,t)).length;null!=t&&ne}function Mn(t,e){return null!=t&&St.call(t,e)}function On(t,e){return null!=t&&e in Lt(t)}function In(t,e,n){for(var i=n?Ie:Oe,o=t[0].length,a=t.length,s=a,u=at(a),c=1/0,h=[];s--;){var l=t[s];s&&e&&(l=De(l,Ze(e))),c=wr(l.length,c),u[s]=!n&&(e||o>=120&&l.length>=120)?new $r(s&&l):r}l=t[0];var f=-1,d=u[0];t:for(;++f=s?u:u*("desc"==r[n]?-1:1)}return t.index-e.index}(t,e,r)}))}function Vn(t,e,r){for(var n=-1,i=e.length,o={};++n-1;)s!==t&&Zt.call(s,u,1),Zt.call(t,u,1);return t}function $n(t,e){for(var r=t?e.length:0,n=r-1;r--;){var i=e[r];if(r==n||i!==o){var o=i;Eo(i)?Zt.call(t,i,1):di(t,i)}}return t}function Zn(t,e){return t+ye(xr()*(e-t+1))}function Kn(t,e){var r="";if(!t||e<1||e>d)return r;do{e%2&&(r+=t),(e=ye(e/2))&&(t+=t)}while(e);return r}function Qn(t,e){return Po(Mo(t,e,au),t+"")}function Jn(t){return Qr(zs(t))}function ti(t,e){var r=zs(t);return jo(r,cn(e,0,r.length))}function ei(t,e,n,i){if(!ns(t))return t;for(var o=-1,a=(e=Ei(e,t)).length,s=a-1,u=t;null!=u&&++oi?0:i+e),(r=r>i?i:r)<0&&(r+=i),i=e>r?0:r-e>>>0,e>>>=0;for(var o=at(i);++n>>1,a=t[o];null!==a&&!ls(a)&&(r?a<=e:a=200){var c=e?null:Ki(t);if(c)return cr(c);a=!1,i=Qe,u=new $r}else u=e?[]:s;t:for(;++n=i?t:oi(t,e,n)}var Ni=le||function(t){return fe.clearTimeout(t)};function Ai(t,e){if(e)return t.slice();var r=t.length,n=Wt?Wt(r):new t.constructor(r);return t.copy(n),n}function Ti(t){var e=new t.constructor(t.byteLength);return new Bt(e).set(new Bt(t)),e}function Li(t,e){var r=e?Ti(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}function Ci(t,e){if(t!==e){var n=t!==r,i=null===t,o=t==t,a=ls(t),s=e!==r,u=null===e,c=e==e,h=ls(e);if(!u&&!h&&!a&&t>e||a&&s&&c&&!u&&!h||i&&s&&c||!n&&c||!o)return 1;if(!i&&!a&&!h&&t1?n[o-1]:r,s=o>2?n[2]:r;for(a=t.length>3&&"function"==typeof a?(o--,a):r,s&&bo(n[0],n[1],s)&&(a=o<3?r:a,o=1),e=Lt(e);++i-1?o[a?e[s]:s]:r}}function Yi(t){return io((function(e){var i=e.length,o=i,a=Hr.prototype.thru;for(t&&e.reverse();o--;){var s=e[o];if("function"!=typeof s)throw new Ot(n);if(a&&!u&&"wrapper"==uo(s))var u=new Hr([],!0)}for(o=u?o:i;++o1&&m.reverse(),f&&cu))return!1;var h=a.get(t),l=a.get(e);if(h&&l)return h==e&&l==t;var f=-1,d=!0,p=2&n?new $r:r;for(a.set(t,e),a.set(e,t);++f-1&&t%1==0&&t1?"& ":"")+e[n],e=e.join(r>2?", ":" "),t.replace(st,"{\n/* [wrapped with "+e+"] */\n")}(n,function(t,e){return Te(v,(function(r){var n="_."+r[0];e&r[1]&&!Oe(t,n)&&t.push(n)})),t.sort()}(function(t){var e=t.match(ut);return e?e[1].split(ct):[]}(n),r)))}function Go(t){var e=0,n=0;return function(){var i=Er(),o=16-(i-n);if(n=i,o>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(r,arguments)}}function jo(t,e){var n=-1,i=t.length,o=i-1;for(e=e===r?i:e;++n1?t[e-1]:r;return n="function"==typeof n?(t.pop(),n):r,ua(t,n)}));function ga(t){var e=Yr(t);return e.__chain__=!0,e}function va(t,e){return e(t)}var ya=io((function(t){var e=t.length,n=e?t[0]:0,i=this.__wrapped__,o=function(e){return un(e,t)};return!(e>1||this.__actions__.length)&&i instanceof Br&&Eo(n)?((i=i.slice(n,+n+(e?1:0))).__actions__.push({func:va,args:[o],thisArg:r}),new Hr(i,this.__chain__).thru((function(t){return e&&!t.length&&t.push(r),t}))):this.thru(o)}));var ma=Ri((function(t,e,r){St.call(t,r)?++t[r]:sn(t,r,1)}));var _a=Ui(Wo),wa=Ui(Vo);function Ea(t,e){return(Va(t)?Te:pn)(t,ho(e,3))}function ba(t,e){return(Va(t)?Le:gn)(t,ho(e,3))}var xa=Ri((function(t,e,r){St.call(t,r)?t[r].push(e):sn(t,r,[e])}));var Na=Qn((function(t,e,r){var n=-1,i="function"==typeof e,o=$a(t)?at(t.length):[];return pn(t,(function(t){o[++n]=i?Ne(e,t,r):Dn(t,e,r)})),o})),Aa=Ri((function(t,e,r){sn(t,r,e)}));function Ta(t,e){return(Va(t)?De:Yn)(t,ho(e,3))}var La=Ri((function(t,e,r){t[r?0:1].push(e)}),(function(){return[[],[]]}));var Ca=Qn((function(t,e){if(null==t)return[];var r=e.length;return r>1&&bo(t,e[0],e[1])?e=[]:r>2&&bo(e[0],e[1],e[2])&&(e=[e[0]]),Wn(t,_n(e,1),[])})),Ma=de||function(){return fe.Date.now()};function Oa(t,e,n){return e=n?r:e,e=t&&null==e?t.length:e,Ji(t,h,r,r,r,r,e)}function Ia(t,e){var i;if("function"!=typeof e)throw new Ot(n);return t=ys(t),function(){return--t>0&&(i=e.apply(this,arguments)),t<=1&&(e=r),i}}var Da=Qn((function(t,e,r){var n=1;if(r.length){var i=ur(r,co(Da));n|=u}return Ji(t,n,e,r,i)})),Ra=Qn((function(t,e,r){var n=3;if(r.length){var i=ur(r,co(Ra));n|=u}return Ji(e,n,t,r,i)}));function Fa(t,e,i){var o,a,s,u,c,h,l=0,f=!1,d=!1,p=!0;if("function"!=typeof t)throw new Ot(n);function g(e){var n=o,i=a;return o=a=r,l=e,u=t.apply(i,n)}function v(t){return l=t,c=Fo(m,e),f?g(t):u}function y(t){var n=t-h;return h===r||n>=e||n<0||d&&t-l>=s}function m(){var t=Ma();if(y(t))return _(t);c=Fo(m,function(t){var r=e-(t-h);return d?wr(r,s-(t-l)):r}(t))}function _(t){return c=r,p&&o?g(t):(o=a=r,u)}function w(){var t=Ma(),n=y(t);if(o=arguments,a=this,h=t,n){if(c===r)return v(h);if(d)return Ni(c),c=Fo(m,e),g(h)}return c===r&&(c=Fo(m,e)),u}return e=_s(e)||0,ns(i)&&(f=!!i.leading,s=(d="maxWait"in i)?_r(_s(i.maxWait)||0,e):s,p="trailing"in i?!!i.trailing:p),w.cancel=function(){c!==r&&Ni(c),l=0,o=h=a=c=r},w.flush=function(){return c===r?u:_(Ma())},w}var Pa=Qn((function(t,e){return fn(t,1,e)})),Sa=Qn((function(t,e,r){return fn(t,_s(e)||0,r)}));function Ga(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new Ot(n);var r=function(){var n=arguments,i=e?e.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var a=t.apply(this,n);return r.cache=o.set(i,a)||o,a};return r.cache=new(Ga.Cache||qr),r}function ja(t){if("function"!=typeof t)throw new Ot(n);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}Ga.Cache=qr;var ka=bi((function(t,e){var r=(e=1==e.length&&Va(e[0])?De(e[0],Ze(ho())):De(_n(e,1),Ze(ho()))).length;return Qn((function(n){for(var i=-1,o=wr(n.length,r);++i=e})),Wa=Rn(function(){return arguments}())?Rn:function(t){return is(t)&&St.call(t,"callee")&&!$t.call(t,"callee")},Va=at.isArray,qa=me?Ze(me):function(t){return is(t)&&Ln(t)==R};function $a(t){return null!=t&&rs(t.length)&&!ts(t)}function Za(t){return is(t)&&$a(t)}var Ka=Be||_u,Qa=_e?Ze(_e):function(t){return is(t)&&Ln(t)==w};function Ja(t){if(!is(t))return!1;var e=Ln(t);return e==E||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!ss(t)}function ts(t){if(!ns(t))return!1;var e=Ln(t);return e==b||e==x||"[object AsyncFunction]"==e||"[object Proxy]"==e}function es(t){return"number"==typeof t&&t==ys(t)}function rs(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=d}function ns(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function is(t){return null!=t&&"object"==typeof t}var os=we?Ze(we):function(t){return is(t)&&yo(t)==N};function as(t){return"number"==typeof t||is(t)&&Ln(t)==A}function ss(t){if(!is(t)||Ln(t)!=T)return!1;var e=Vt(t);if(null===e)return!0;var r=St.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&Pt.call(r)==Ut}var us=Ee?Ze(Ee):function(t){return is(t)&&Ln(t)==C};var cs=be?Ze(be):function(t){return is(t)&&yo(t)==M};function hs(t){return"string"==typeof t||!Va(t)&&is(t)&&Ln(t)==O}function ls(t){return"symbol"==typeof t||is(t)&&Ln(t)==I}var fs=xe?Ze(xe):function(t){return is(t)&&rs(t.length)&&!!oe[Ln(t)]};var ds=qi(Un),ps=qi((function(t,e){return t<=e}));function gs(t){if(!t)return[];if($a(t))return hs(t)?fr(t):Ii(t);if(ee&&t[ee])return function(t){for(var e,r=[];!(e=t.next()).done;)r.push(e.value);return r}(t[ee]());var e=yo(t);return(e==N?ar:e==M?cr:zs)(t)}function vs(t){return t?(t=_s(t))===f||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function ys(t){var e=vs(t),r=e%1;return e==e?r?e-r:e:0}function ms(t){return t?cn(ys(t),0,g):0}function _s(t){if("number"==typeof t)return t;if(ls(t))return p;if(ns(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=ns(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=$e(t);var r=vt.test(t);return r||mt.test(t)?ce(t.slice(2),r?2:8):gt.test(t)?p:+t}function ws(t){return Di(t,Ps(t))}function Es(t){return null==t?"":li(t)}var bs=Fi((function(t,e){if(To(e)||$a(e))Di(e,Fs(e),t);else for(var r in e)St.call(e,r)&&rn(t,r,e[r])})),xs=Fi((function(t,e){Di(e,Ps(e),t)})),Ns=Fi((function(t,e,r,n){Di(e,Ps(e),t,n)})),As=Fi((function(t,e,r,n){Di(e,Fs(e),t,n)})),Ts=io(un);var Ls=Qn((function(t,e){t=Lt(t);var n=-1,i=e.length,o=i>2?e[2]:r;for(o&&bo(e[0],e[1],o)&&(i=1);++n1),e})),Di(t,ao(t),r),n&&(r=hn(r,7,ro));for(var i=e.length;i--;)di(r,e[i]);return r}));var ks=io((function(t,e){return null==t?{}:function(t,e){return Vn(t,e,(function(e,r){return Os(t,r)}))}(t,e)}));function Us(t,e){if(null==t)return{};var r=De(ao(t),(function(t){return[t]}));return e=ho(e),Vn(t,r,(function(t,r){return e(t,r[0])}))}var Ys=Qi(Fs),Xs=Qi(Ps);function zs(t){return null==t?[]:Ke(t,Fs(t))}var Hs=ji((function(t,e,r){return e=e.toLowerCase(),t+(r?Bs(e):e)}));function Bs(t){return Js(Es(t).toLowerCase())}function Ws(t){return(t=Es(t))&&t.replace(wt,rr).replace(Qt,"")}var Vs=ji((function(t,e,r){return t+(r?"-":"")+e.toLowerCase()})),qs=ji((function(t,e,r){return t+(r?" ":"")+e.toLowerCase()})),$s=Gi("toLowerCase");var Zs=ji((function(t,e,r){return t+(r?"_":"")+e.toLowerCase()}));var Ks=ji((function(t,e,r){return t+(r?" ":"")+Js(e)}));var Qs=ji((function(t,e,r){return t+(r?" ":"")+e.toUpperCase()})),Js=Gi("toUpperCase");function tu(t,e,n){return t=Es(t),(e=n?r:e)===r?function(t){return re.test(t)}(t)?function(t){return t.match(te)||[]}(t):function(t){return t.match(ht)||[]}(t):t.match(e)||[]}var eu=Qn((function(t,e){try{return Ne(t,r,e)}catch(t){return Ja(t)?t:new Nt(t)}})),ru=io((function(t,e){return Te(e,(function(e){e=Uo(e),sn(t,e,Da(t[e],t))})),t}));function nu(t){return function(){return t}}var iu=Yi(),ou=Yi(!0);function au(t){return t}function su(t){return Gn("function"==typeof t?t:hn(t,1))}var uu=Qn((function(t,e){return function(r){return Dn(r,t,e)}})),cu=Qn((function(t,e){return function(r){return Dn(t,r,e)}}));function hu(t,e,r){var n=Fs(e),i=Nn(e,n);null!=r||ns(e)&&(i.length||!n.length)||(r=e,e=t,t=this,i=Nn(e,Fs(e)));var o=!(ns(r)&&"chain"in r&&!r.chain),a=ts(t);return Te(i,(function(r){var n=e[r];t[r]=n,a&&(t.prototype[r]=function(){var e=this.__chain__;if(o||e){var r=t(this.__wrapped__),i=r.__actions__=Ii(this.__actions__);return i.push({func:n,args:arguments,thisArg:t}),r.__chain__=e,r}return n.apply(t,Re([this.value()],arguments))})})),t}function lu(){}var fu=Bi(De),du=Bi(Ce),pu=Bi(Se);function gu(t){return xo(t)?He(Uo(t)):function(t){return function(e){return An(e,t)}}(t)}var vu=Vi(),yu=Vi(!0);function mu(){return[]}function _u(){return!1}var wu=Hi((function(t,e){return t+e}),0),Eu=Zi("ceil"),bu=Hi((function(t,e){return t/e}),1),xu=Zi("floor");var Nu,Au=Hi((function(t,e){return t*e}),1),Tu=Zi("round"),Lu=Hi((function(t,e){return t-e}),0);return Yr.after=function(t,e){if("function"!=typeof e)throw new Ot(n);return t=ys(t),function(){if(--t<1)return e.apply(this,arguments)}},Yr.ary=Oa,Yr.assign=bs,Yr.assignIn=xs,Yr.assignInWith=Ns,Yr.assignWith=As,Yr.at=Ts,Yr.before=Ia,Yr.bind=Da,Yr.bindAll=ru,Yr.bindKey=Ra,Yr.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return Va(t)?t:[t]},Yr.chain=ga,Yr.chunk=function(t,e,n){e=(n?bo(t,e,n):e===r)?1:_r(ys(e),0);var i=null==t?0:t.length;if(!i||e<1)return[];for(var o=0,a=0,s=at(ve(i/e));oo?0:o+n),(i=i===r||i>o?o:ys(i))<0&&(i+=o),i=n>i?0:ms(i);n>>0)?(t=Es(t))&&("string"==typeof e||null!=e&&!us(e))&&!(e=li(e))&&or(t)?xi(fr(t),0,n):t.split(e,n):[]},Yr.spread=function(t,e){if("function"!=typeof t)throw new Ot(n);return e=null==e?0:_r(ys(e),0),Qn((function(r){var n=r[e],i=xi(r,0,e);return n&&Re(i,n),Ne(t,this,i)}))},Yr.tail=function(t){var e=null==t?0:t.length;return e?oi(t,1,e):[]},Yr.take=function(t,e,n){return t&&t.length?oi(t,0,(e=n||e===r?1:ys(e))<0?0:e):[]},Yr.takeRight=function(t,e,n){var i=null==t?0:t.length;return i?oi(t,(e=i-(e=n||e===r?1:ys(e)))<0?0:e,i):[]},Yr.takeRightWhile=function(t,e){return t&&t.length?gi(t,ho(e,3),!1,!0):[]},Yr.takeWhile=function(t,e){return t&&t.length?gi(t,ho(e,3)):[]},Yr.tap=function(t,e){return e(t),t},Yr.throttle=function(t,e,r){var i=!0,o=!0;if("function"!=typeof t)throw new Ot(n);return ns(r)&&(i="leading"in r?!!r.leading:i,o="trailing"in r?!!r.trailing:o),Fa(t,e,{leading:i,maxWait:e,trailing:o})},Yr.thru=va,Yr.toArray=gs,Yr.toPairs=Ys,Yr.toPairsIn=Xs,Yr.toPath=function(t){return Va(t)?De(t,Uo):ls(t)?[t]:Ii(ko(Es(t)))},Yr.toPlainObject=ws,Yr.transform=function(t,e,r){var n=Va(t),i=n||Ka(t)||fs(t);if(e=ho(e,4),null==r){var o=t&&t.constructor;r=i?n?new o:[]:ns(t)&&ts(o)?Xr(Vt(t)):{}}return(i?Te:bn)(t,(function(t,n,i){return e(r,t,n,i)})),r},Yr.unary=function(t){return Oa(t,1)},Yr.union=ia,Yr.unionBy=oa,Yr.unionWith=aa,Yr.uniq=function(t){return t&&t.length?fi(t):[]},Yr.uniqBy=function(t,e){return t&&t.length?fi(t,ho(e,2)):[]},Yr.uniqWith=function(t,e){return e="function"==typeof e?e:r,t&&t.length?fi(t,r,e):[]},Yr.unset=function(t,e){return null==t||di(t,e)},Yr.unzip=sa,Yr.unzipWith=ua,Yr.update=function(t,e,r){return null==t?t:pi(t,e,wi(r))},Yr.updateWith=function(t,e,n,i){return i="function"==typeof i?i:r,null==t?t:pi(t,e,wi(n),i)},Yr.values=zs,Yr.valuesIn=function(t){return null==t?[]:Ke(t,Ps(t))},Yr.without=ca,Yr.words=tu,Yr.wrap=function(t,e){return Ua(wi(e),t)},Yr.xor=ha,Yr.xorBy=la,Yr.xorWith=fa,Yr.zip=da,Yr.zipObject=function(t,e){return mi(t||[],e||[],rn)},Yr.zipObjectDeep=function(t,e){return mi(t||[],e||[],ei)},Yr.zipWith=pa,Yr.entries=Ys,Yr.entriesIn=Xs,Yr.extend=xs,Yr.extendWith=Ns,hu(Yr,Yr),Yr.add=wu,Yr.attempt=eu,Yr.camelCase=Hs,Yr.capitalize=Bs,Yr.ceil=Eu,Yr.clamp=function(t,e,n){return n===r&&(n=e,e=r),n!==r&&(n=(n=_s(n))==n?n:0),e!==r&&(e=(e=_s(e))==e?e:0),cn(_s(t),e,n)},Yr.clone=function(t){return hn(t,4)},Yr.cloneDeep=function(t){return hn(t,5)},Yr.cloneDeepWith=function(t,e){return hn(t,5,e="function"==typeof e?e:r)},Yr.cloneWith=function(t,e){return hn(t,4,e="function"==typeof e?e:r)},Yr.conformsTo=function(t,e){return null==e||ln(t,e,Fs(e))},Yr.deburr=Ws,Yr.defaultTo=function(t,e){return null==t||t!=t?e:t},Yr.divide=bu,Yr.endsWith=function(t,e,n){t=Es(t),e=li(e);var i=t.length,o=n=n===r?i:cn(ys(n),0,i);return(n-=e.length)>=0&&t.slice(n,o)==e},Yr.eq=za,Yr.escape=function(t){return(t=Es(t))&&Z.test(t)?t.replace(q,nr):t},Yr.escapeRegExp=function(t){return(t=Es(t))&&it.test(t)?t.replace(nt,"\\$&"):t},Yr.every=function(t,e,n){var i=Va(t)?Ce:vn;return n&&bo(t,e,n)&&(e=r),i(t,ho(e,3))},Yr.find=_a,Yr.findIndex=Wo,Yr.findKey=function(t,e){return je(t,ho(e,3),bn)},Yr.findLast=wa,Yr.findLastIndex=Vo,Yr.findLastKey=function(t,e){return je(t,ho(e,3),xn)},Yr.floor=xu,Yr.forEach=Ea,Yr.forEachRight=ba,Yr.forIn=function(t,e){return null==t?t:wn(t,ho(e,3),Ps)},Yr.forInRight=function(t,e){return null==t?t:En(t,ho(e,3),Ps)},Yr.forOwn=function(t,e){return t&&bn(t,ho(e,3))},Yr.forOwnRight=function(t,e){return t&&xn(t,ho(e,3))},Yr.get=Ms,Yr.gt=Ha,Yr.gte=Ba,Yr.has=function(t,e){return null!=t&&mo(t,e,Mn)},Yr.hasIn=Os,Yr.head=$o,Yr.identity=au,Yr.includes=function(t,e,r,n){t=$a(t)?t:zs(t),r=r&&!n?ys(r):0;var i=t.length;return r<0&&(r=_r(i+r,0)),hs(t)?r<=i&&t.indexOf(e,r)>-1:!!i&&Ue(t,e,r)>-1},Yr.indexOf=function(t,e,r){var n=null==t?0:t.length;if(!n)return-1;var i=null==r?0:ys(r);return i<0&&(i=_r(n+i,0)),Ue(t,e,i)},Yr.inRange=function(t,e,n){return e=vs(e),n===r?(n=e,e=0):n=vs(n),function(t,e,r){return t>=wr(e,r)&&t<_r(e,r)}(t=_s(t),e,n)},Yr.invoke=Rs,Yr.isArguments=Wa,Yr.isArray=Va,Yr.isArrayBuffer=qa,Yr.isArrayLike=$a,Yr.isArrayLikeObject=Za,Yr.isBoolean=function(t){return!0===t||!1===t||is(t)&&Ln(t)==_},Yr.isBuffer=Ka,Yr.isDate=Qa,Yr.isElement=function(t){return is(t)&&1===t.nodeType&&!ss(t)},Yr.isEmpty=function(t){if(null==t)return!0;if($a(t)&&(Va(t)||"string"==typeof t||"function"==typeof t.splice||Ka(t)||fs(t)||Wa(t)))return!t.length;var e=yo(t);if(e==N||e==M)return!t.size;if(To(t))return!jn(t).length;for(var r in t)if(St.call(t,r))return!1;return!0},Yr.isEqual=function(t,e){return Fn(t,e)},Yr.isEqualWith=function(t,e,n){var i=(n="function"==typeof n?n:r)?n(t,e):r;return i===r?Fn(t,e,r,n):!!i},Yr.isError=Ja,Yr.isFinite=function(t){return"number"==typeof t&&vr(t)},Yr.isFunction=ts,Yr.isInteger=es,Yr.isLength=rs,Yr.isMap=os,Yr.isMatch=function(t,e){return t===e||Pn(t,e,fo(e))},Yr.isMatchWith=function(t,e,n){return n="function"==typeof n?n:r,Pn(t,e,fo(e),n)},Yr.isNaN=function(t){return as(t)&&t!=+t},Yr.isNative=function(t){if(Ao(t))throw new Nt("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Sn(t)},Yr.isNil=function(t){return null==t},Yr.isNull=function(t){return null===t},Yr.isNumber=as,Yr.isObject=ns,Yr.isObjectLike=is,Yr.isPlainObject=ss,Yr.isRegExp=us,Yr.isSafeInteger=function(t){return es(t)&&t>=-9007199254740991&&t<=d},Yr.isSet=cs,Yr.isString=hs,Yr.isSymbol=ls,Yr.isTypedArray=fs,Yr.isUndefined=function(t){return t===r},Yr.isWeakMap=function(t){return is(t)&&yo(t)==D},Yr.isWeakSet=function(t){return is(t)&&"[object WeakSet]"==Ln(t)},Yr.join=function(t,e){return null==t?"":yr.call(t,e)},Yr.kebabCase=Vs,Yr.last=Jo,Yr.lastIndexOf=function(t,e,n){var i=null==t?0:t.length;if(!i)return-1;var o=i;return n!==r&&(o=(o=ys(n))<0?_r(i+o,0):wr(o,i-1)),e==e?function(t,e,r){for(var n=r+1;n--;)if(t[n]===e)return n;return n}(t,e,o):ke(t,Xe,o,!0)},Yr.lowerCase=qs,Yr.lowerFirst=$s,Yr.lt=ds,Yr.lte=ps,Yr.max=function(t){return t&&t.length?yn(t,au,Cn):r},Yr.maxBy=function(t,e){return t&&t.length?yn(t,ho(e,2),Cn):r},Yr.mean=function(t){return ze(t,au)},Yr.meanBy=function(t,e){return ze(t,ho(e,2))},Yr.min=function(t){return t&&t.length?yn(t,au,Un):r},Yr.minBy=function(t,e){return t&&t.length?yn(t,ho(e,2),Un):r},Yr.stubArray=mu,Yr.stubFalse=_u,Yr.stubObject=function(){return{}},Yr.stubString=function(){return""},Yr.stubTrue=function(){return!0},Yr.multiply=Au,Yr.nth=function(t,e){return t&&t.length?Bn(t,ys(e)):r},Yr.noConflict=function(){return fe._===this&&(fe._=Yt),this},Yr.noop=lu,Yr.now=Ma,Yr.pad=function(t,e,r){t=Es(t);var n=(e=ys(e))?lr(t):0;if(!e||n>=e)return t;var i=(e-n)/2;return Wi(ye(i),r)+t+Wi(ve(i),r)},Yr.padEnd=function(t,e,r){t=Es(t);var n=(e=ys(e))?lr(t):0;return e&&ne){var i=t;t=e,e=i}if(n||t%1||e%1){var o=xr();return wr(t+o*(e-t+ue("1e-"+((o+"").length-1))),e)}return Zn(t,e)},Yr.reduce=function(t,e,r){var n=Va(t)?Fe:We,i=arguments.length<3;return n(t,ho(e,4),r,i,pn)},Yr.reduceRight=function(t,e,r){var n=Va(t)?Pe:We,i=arguments.length<3;return n(t,ho(e,4),r,i,gn)},Yr.repeat=function(t,e,n){return e=(n?bo(t,e,n):e===r)?1:ys(e),Kn(Es(t),e)},Yr.replace=function(){var t=arguments,e=Es(t[0]);return t.length<3?e:e.replace(t[1],t[2])},Yr.result=function(t,e,n){var i=-1,o=(e=Ei(e,t)).length;for(o||(o=1,t=r);++id)return[];var r=g,n=wr(t,g);e=ho(e),t-=g;for(var i=qe(n,e);++r=a)return t;var u=n-lr(i);if(u<1)return i;var c=s?xi(s,0,u).join(""):t.slice(0,u);if(o===r)return c+i;if(s&&(u+=c.length-u),us(o)){if(t.slice(u).search(o)){var h,l=c;for(o.global||(o=Ct(o.source,Es(pt.exec(o))+"g")),o.lastIndex=0;h=o.exec(l);)var f=h.index;c=c.slice(0,f===r?u:f)}}else if(t.indexOf(li(o),u)!=u){var d=c.lastIndexOf(o);d>-1&&(c=c.slice(0,d))}return c+i},Yr.unescape=function(t){return(t=Es(t))&&$.test(t)?t.replace(V,pr):t},Yr.uniqueId=function(t){var e=++Gt;return Es(t)+e},Yr.upperCase=Qs,Yr.upperFirst=Js,Yr.each=Ea,Yr.eachRight=ba,Yr.first=$o,hu(Yr,(Nu={},bn(Yr,(function(t,e){St.call(Yr.prototype,e)||(Nu[e]=t)})),Nu),{chain:!1}),Yr.VERSION="4.17.21",Te(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){Yr[t].placeholder=Yr})),Te(["drop","take"],(function(t,e){Br.prototype[t]=function(n){n=n===r?1:_r(ys(n),0);var i=this.__filtered__&&!e?new Br(this):this.clone();return i.__filtered__?i.__takeCount__=wr(n,i.__takeCount__):i.__views__.push({size:wr(n,g),type:t+(i.__dir__<0?"Right":"")}),i},Br.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}})),Te(["filter","map","takeWhile"],(function(t,e){var r=e+1,n=1==r||3==r;Br.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:ho(t,3),type:r}),e.__filtered__=e.__filtered__||n,e}})),Te(["head","last"],(function(t,e){var r="take"+(e?"Right":"");Br.prototype[t]=function(){return this[r](1).value()[0]}})),Te(["initial","tail"],(function(t,e){var r="drop"+(e?"":"Right");Br.prototype[t]=function(){return this.__filtered__?new Br(this):this[r](1)}})),Br.prototype.compact=function(){return this.filter(au)},Br.prototype.find=function(t){return this.filter(t).head()},Br.prototype.findLast=function(t){return this.reverse().find(t)},Br.prototype.invokeMap=Qn((function(t,e){return"function"==typeof t?new Br(this):this.map((function(r){return Dn(r,t,e)}))})),Br.prototype.reject=function(t){return this.filter(ja(ho(t)))},Br.prototype.slice=function(t,e){t=ys(t);var n=this;return n.__filtered__&&(t>0||e<0)?new Br(n):(t<0?n=n.takeRight(-t):t&&(n=n.drop(t)),e!==r&&(n=(e=ys(e))<0?n.dropRight(-e):n.take(e-t)),n)},Br.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Br.prototype.toArray=function(){return this.take(g)},bn(Br.prototype,(function(t,e){var n=/^(?:filter|find|map|reject)|While$/.test(e),i=/^(?:head|last)$/.test(e),o=Yr[i?"take"+("last"==e?"Right":""):e],a=i||/^find/.test(e);o&&(Yr.prototype[e]=function(){var e=this.__wrapped__,s=i?[1]:arguments,u=e instanceof Br,c=s[0],h=u||Va(e),l=function(t){var e=o.apply(Yr,Re([t],s));return i&&f?e[0]:e};h&&n&&"function"==typeof c&&1!=c.length&&(u=h=!1);var f=this.__chain__,d=!!this.__actions__.length,p=a&&!f,g=u&&!d;if(!a&&h){e=g?e:new Br(this);var v=t.apply(e,s);return v.__actions__.push({func:va,args:[l],thisArg:r}),new Hr(v,f)}return p&&g?t.apply(this,s):(v=this.thru(l),p?i?v.value()[0]:v.value():v)})})),Te(["pop","push","shift","sort","splice","unshift"],(function(t){var e=It[t],r=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",n=/^(?:pop|shift)$/.test(t);Yr.prototype[t]=function(){var t=arguments;if(n&&!this.__chain__){var i=this.value();return e.apply(Va(i)?i:[],t)}return this[r]((function(r){return e.apply(Va(r)?r:[],t)}))}})),bn(Br.prototype,(function(t,e){var r=Yr[e];if(r){var n=r.name+"";St.call(Dr,n)||(Dr[n]=[]),Dr[n].push({name:e,func:r})}})),Dr[Xi(r,2).name]=[{name:"wrapper",func:r}],Br.prototype.clone=function(){var t=new Br(this.__wrapped__);return t.__actions__=Ii(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=Ii(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=Ii(this.__views__),t},Br.prototype.reverse=function(){if(this.__filtered__){var t=new Br(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},Br.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,r=Va(t),n=e<0,i=r?t.length:0,o=function(t,e,r){var n=-1,i=r.length;for(;++n=this.__values__.length;return{done:t,value:t?r:this.__values__[this.__index__++]}},Yr.prototype.plant=function(t){for(var e,n=this;n instanceof zr;){var i=Xo(n);i.__index__=0,i.__values__=r,e?o.__wrapped__=i:e=i;var o=i;n=n.__wrapped__}return o.__wrapped__=t,e},Yr.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof Br){var e=t;return this.__actions__.length&&(e=new Br(this)),(e=e.reverse()).__actions__.push({func:va,args:[na],thisArg:r}),new Hr(e,this.__chain__)}return this.thru(na)},Yr.prototype.toJSON=Yr.prototype.valueOf=Yr.prototype.value=function(){return vi(this.__wrapped__,this.__actions__)},Yr.prototype.first=Yr.prototype.head,ee&&(Yr.prototype[ee]=function(){return this}),Yr}();pe?((pe.exports=gr)._=gr,de._=gr):fe._=gr}).call(a)}(v,v.exports);var y=function(){this.__data__=[],this.size=0};var m=function(t,e){return t===e||t!=t&&e!=e},_=m;var w=function(t,e){for(var r=t.length;r--;)if(_(t[r][0],e))return r;return-1},E=w,b=Array.prototype.splice;var x=w;var N=w;var A=w;var T=y,L=function(t){var e=this.__data__,r=E(e,t);return!(r<0)&&(r==e.length-1?e.pop():b.call(e,r,1),--this.size,!0)},C=function(t){var e=this.__data__,r=x(e,t);return r<0?void 0:e[r][1]},M=function(t){return N(this.__data__,t)>-1},O=function(t,e){var r=this.__data__,n=A(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this};function I(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e-1&&t%1==0&&t-1&&t%1==0&&t<=9007199254740991},Xe=J,ze=Ye,He=Le,Be={};Be["[object Float32Array]"]=Be["[object Float64Array]"]=Be["[object Int8Array]"]=Be["[object Int16Array]"]=Be["[object Int32Array]"]=Be["[object Uint8Array]"]=Be["[object Uint8ClampedArray]"]=Be["[object Uint16Array]"]=Be["[object Uint32Array]"]=!0,Be["[object Arguments]"]=Be["[object Array]"]=Be["[object ArrayBuffer]"]=Be["[object Boolean]"]=Be["[object DataView]"]=Be["[object Date]"]=Be["[object Error]"]=Be["[object Function]"]=Be["[object Map]"]=Be["[object Number]"]=Be["[object Object]"]=Be["[object RegExp]"]=Be["[object Set]"]=Be["[object String]"]=Be["[object WeakMap]"]=!1;var We=function(t){return He(t)&&ze(t.length)&&!!Be[Xe(t)]};var Ve=function(t){return function(e){return t(e)}},qe={exports:{}};!function(t,e){var r=j,n=e&&!e.nodeType&&e,i=n&&t&&!t.nodeType&&t,o=i&&i.exports===n&&r.process,a=function(){try{var t=i&&i.require&&i.require("util").types;return t||o&&o.binding&&o.binding("util")}catch(t){}}();t.exports=a}(qe,qe.exports);var $e=We,Ze=Ve,Ke=qe.exports,Qe=Ke&&Ke.isTypedArray,Je=Qe?Ze(Qe):$e,tr=Te,er=Pe,rr=Se,nr=Ge.exports,ir=Ue,or=Je,ar=Object.prototype.hasOwnProperty;var sr=function(t,e){var r=rr(t),n=!r&&er(t),i=!r&&!n&&nr(t),o=!r&&!n&&!i&&or(t),a=r||n||i||o,s=a?tr(t.length,String):[],u=s.length;for(var c in t)!e&&!ar.call(t,c)||a&&("length"==c||i&&("offset"==c||"parent"==c)||o&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||ir(c,u))||s.push(c);return s},ur=Object.prototype;var cr=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||ur)};var hr=function(t,e){return function(r){return t(e(r))}},lr=hr(Object.keys,Object),fr=cr,dr=lr,pr=Object.prototype.hasOwnProperty;var gr=function(t){if(!fr(t))return dr(t);var e=[];for(var r in Object(t))pr.call(t,r)&&"constructor"!=r&&e.push(r);return e},vr=it,yr=Ye;var mr=function(t){return null!=t&&yr(t.length)&&!vr(t)},_r=sr,wr=gr,Er=mr;var br=function(t){return Er(t)?_r(t):wr(t)},xr=Ae,Nr=br;var Ar=function(t,e){return t&&xr(e,Nr(e),t)};var Tr=tt,Lr=cr,Cr=function(t){var e=[];if(null!=t)for(var r in Object(t))e.push(r);return e},Mr=Object.prototype.hasOwnProperty;var Or=sr,Ir=function(t){if(!Tr(t))return Cr(t);var e=Lr(t),r=[];for(var n in t)("constructor"!=n||!e&&Mr.call(t,n))&&r.push(n);return r},Dr=mr;var Rr=function(t){return Dr(t)?Or(t,!0):Ir(t)},Fr=Ae,Pr=Rr;var Sr=function(t,e){return t&&Fr(e,Pr(e),t)},Gr={exports:{}};!function(t,e){var r=Y,n=e&&!e.nodeType&&e,i=n&&t&&!t.nodeType&&t,o=i&&i.exports===n?r.Buffer:void 0,a=o?o.allocUnsafe:void 0;t.exports=function(t,e){if(e)return t.slice();var r=t.length,n=a?a(r):new t.constructor(r);return t.copy(n),n}}(Gr,Gr.exports);var jr=function(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++rs))return!1;var c=o.get(t),h=o.get(e);if(c&&h)return c==e&&h==t;var l=-1,f=!0,d=2&r?new fo:void 0;for(o.set(t,e),o.set(e,t);++l0&&n(u)?r>1?t(u,r-1,n,i,o):Au(o,u):i||(o[o.length]=u)}return o};var Cu=function(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)},Mu=Math.max;var Ou=function(t,e,r){return e=Mu(void 0===e?t.length-1:e,0),function(){for(var n=arguments,i=-1,o=Mu(n.length-e,0),a=Array(o);++i0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(Ru),Su=Ki,Gu=Ou,ju=Pu;var ku=function(t,e){return ju(Gu(t,e,Su),t+"")};var Uu=function(t,e,r,n){for(var i=t.length,o=r+(n?1:-1);n?o--:++o-1};var Bu=function(t,e,r){for(var n=-1,i=null==t?0:t.length;++n=200){var c=e?null:Ju(t);if(c)return tc(c);a=!1,i=Qu,u=new $u}else u=e?[]:s;t:for(;++no){var a=i;i=o,o=a}return i+""+o+""+(dc.isUndefined(n)?"\0":n)}function _c(t,e,r,n){var i=""+e,o=""+r;if(!t&&i>o){var a=i;i=o,o=a}var s={v:i,w:o};return n&&(s.name=n),s}function wc(t,e){return mc(t,e.v,e.w,e.name)}gc.prototype._nodeCount=0,gc.prototype._edgeCount=0,gc.prototype.isDirected=function(){return this._isDirected},gc.prototype.isMultigraph=function(){return this._isMultigraph},gc.prototype.isCompound=function(){return this._isCompound},gc.prototype.setGraph=function(t){return this._label=t,this},gc.prototype.graph=function(){return this._label},gc.prototype.setDefaultNodeLabel=function(t){return dc.isFunction(t)||(t=dc.constant(t)),this._defaultNodeLabelFn=t,this},gc.prototype.nodeCount=function(){return this._nodeCount},gc.prototype.nodes=function(){return dc.keys(this._nodes)},gc.prototype.sources=function(){var t=this;return dc.filter(this.nodes(),(function(e){return dc.isEmpty(t._in[e])}))},gc.prototype.sinks=function(){var t=this;return dc.filter(this.nodes(),(function(e){return dc.isEmpty(t._out[e])}))},gc.prototype.setNodes=function(t,e){var r=arguments,n=this;return dc.each(t,(function(t){r.length>1?n.setNode(t,e):n.setNode(t)})),this},gc.prototype.setNode=function(t,e){return dc.has(this._nodes,t)?(arguments.length>1&&(this._nodes[t]=e),this):(this._nodes[t]=arguments.length>1?e:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]="\0",this._children[t]={},this._children["\0"][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)},gc.prototype.node=function(t){return this._nodes[t]},gc.prototype.hasNode=function(t){return dc.has(this._nodes,t)},gc.prototype.removeNode=function(t){var e=this;if(dc.has(this._nodes,t)){var r=function(t){e.removeEdge(e._edgeObjs[t])};delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],dc.each(this.children(t),(function(t){e.setParent(t)})),delete this._children[t]),dc.each(dc.keys(this._in[t]),r),delete this._in[t],delete this._preds[t],dc.each(dc.keys(this._out[t]),r),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this},gc.prototype.setParent=function(t,e){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(dc.isUndefined(e))e="\0";else{for(var r=e+="";!dc.isUndefined(r);r=this.parent(r))if(r===t)throw new Error("Setting "+e+" as parent of "+t+" would create a cycle");this.setNode(e)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=e,this._children[e][t]=!0,this},gc.prototype._removeFromParentsChildList=function(t){delete this._children[this._parent[t]][t]},gc.prototype.parent=function(t){if(this._isCompound){var e=this._parent[t];if("\0"!==e)return e}},gc.prototype.children=function(t){if(dc.isUndefined(t)&&(t="\0"),this._isCompound){var e=this._children[t];if(e)return dc.keys(e)}else{if("\0"===t)return this.nodes();if(this.hasNode(t))return[]}},gc.prototype.predecessors=function(t){var e=this._preds[t];if(e)return dc.keys(e)},gc.prototype.successors=function(t){var e=this._sucs[t];if(e)return dc.keys(e)},gc.prototype.neighbors=function(t){var e=this.predecessors(t);if(e)return dc.union(e,this.successors(t))},gc.prototype.isLeaf=function(t){return 0===(this.isDirected()?this.successors(t):this.neighbors(t)).length},gc.prototype.filterNodes=function(t){var e=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});e.setGraph(this.graph());var r=this;dc.each(this._nodes,(function(r,n){t(n)&&e.setNode(n,r)})),dc.each(this._edgeObjs,(function(t){e.hasNode(t.v)&&e.hasNode(t.w)&&e.setEdge(t,r.edge(t))}));var n={};function i(t){var o=r.parent(t);return void 0===o||e.hasNode(o)?(n[t]=o,o):o in n?n[o]:i(o)}return this._isCompound&&dc.each(e.nodes(),(function(t){e.setParent(t,i(t))})),e},gc.prototype.setDefaultEdgeLabel=function(t){return dc.isFunction(t)||(t=dc.constant(t)),this._defaultEdgeLabelFn=t,this},gc.prototype.edgeCount=function(){return this._edgeCount},gc.prototype.edges=function(){return dc.values(this._edgeObjs)},gc.prototype.setPath=function(t,e){var r=this,n=arguments;return dc.reduce(t,(function(t,i){return n.length>1?r.setEdge(t,i,e):r.setEdge(t,i),i})),this},gc.prototype.setEdge=function(){var t,e,r,n,i=!1,o=arguments[0];"object"==typeof o&&null!==o&&"v"in o?(t=o.v,e=o.w,r=o.name,2===arguments.length&&(n=arguments[1],i=!0)):(t=o,e=arguments[1],r=arguments[3],arguments.length>2&&(n=arguments[2],i=!0)),t=""+t,e=""+e,dc.isUndefined(r)||(r=""+r);var a=mc(this._isDirected,t,e,r);if(dc.has(this._edgeLabels,a))return i&&(this._edgeLabels[a]=n),this;if(!dc.isUndefined(r)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(e),this._edgeLabels[a]=i?n:this._defaultEdgeLabelFn(t,e,r);var s=_c(this._isDirected,t,e,r);return t=s.v,e=s.w,Object.freeze(s),this._edgeObjs[a]=s,vc(this._preds[e],t),vc(this._sucs[t],e),this._in[e][a]=s,this._out[t][a]=s,this._edgeCount++,this},gc.prototype.edge=function(t,e,r){var n=1===arguments.length?wc(this._isDirected,arguments[0]):mc(this._isDirected,t,e,r);return this._edgeLabels[n]},gc.prototype.hasEdge=function(t,e,r){var n=1===arguments.length?wc(this._isDirected,arguments[0]):mc(this._isDirected,t,e,r);return dc.has(this._edgeLabels,n)},gc.prototype.removeEdge=function(t,e,r){var n=1===arguments.length?wc(this._isDirected,arguments[0]):mc(this._isDirected,t,e,r),i=this._edgeObjs[n];return i&&(t=i.v,e=i.w,delete this._edgeLabels[n],delete this._edgeObjs[n],yc(this._preds[e],t),yc(this._sucs[t],e),delete this._in[e][n],delete this._out[t][n],this._edgeCount--),this},gc.prototype.inEdges=function(t,e){var r=this._in[t];if(r){var n=dc.values(r);return e?dc.filter(n,(function(t){return t.v===e})):n}},gc.prototype.outEdges=function(t,e){var r=this._out[t];if(r){var n=dc.values(r);return e?dc.filter(n,(function(t){return t.w===e})):n}},gc.prototype.nodeEdges=function(t,e){var r=this.inEdges(t,e);if(r)return r.concat(this.outEdges(t,e))};var Ec={Graph:pc,version:"2.1.8"},bc=fc,xc=pc,Nc={write:function(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:Ac(t),edges:Tc(t)};bc.isUndefined(t.graph())||(e.value=bc.clone(t.graph()));return e},read:function(t){var e=new xc(t.options).setGraph(t.value);return bc.each(t.nodes,(function(t){e.setNode(t.v,t.value),t.parent&&e.setParent(t.v,t.parent)})),bc.each(t.edges,(function(t){e.setEdge({v:t.v,w:t.w,name:t.name},t.value)})),e}};function Ac(t){return bc.map(t.nodes(),(function(e){var r=t.node(e),n=t.parent(e),i={v:e};return bc.isUndefined(r)||(i.value=r),bc.isUndefined(n)||(i.parent=n),i}))}function Tc(t){return bc.map(t.edges(),(function(e){var r=t.edge(e),n={v:e.v,w:e.w};return bc.isUndefined(e.name)||(n.name=e.name),bc.isUndefined(r)||(n.value=r),n}))}var Lc=fc,Cc=function(t){var e,r={},n=[];function i(n){Lc.has(r,n)||(r[n]=!0,e.push(n),Lc.each(t.successors(n),i),Lc.each(t.predecessors(n),i))}return Lc.each(t.nodes(),(function(t){e=[],i(t),e.length&&n.push(e)})),n};var Mc=fc,Oc=Ic;function Ic(){this._arr=[],this._keyIndices={}}Ic.prototype.size=function(){return this._arr.length},Ic.prototype.keys=function(){return this._arr.map((function(t){return t.key}))},Ic.prototype.has=function(t){return Mc.has(this._keyIndices,t)},Ic.prototype.priority=function(t){var e=this._keyIndices[t];if(void 0!==e)return this._arr[e].priority},Ic.prototype.min=function(){if(0===this.size())throw new Error("Queue underflow");return this._arr[0].key},Ic.prototype.add=function(t,e){var r=this._keyIndices;if(t=String(t),!Mc.has(r,t)){var n=this._arr,i=n.length;return r[t]=i,n.push({key:t,priority:e}),this._decrease(i),!0}return!1},Ic.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var t=this._arr.pop();return delete this._keyIndices[t.key],this._heapify(0),t.key},Ic.prototype.decrease=function(t,e){var r=this._keyIndices[t];if(e>this._arr[r].priority)throw new Error("New priority is greater than current priority. Key: "+t+" Old: "+this._arr[r].priority+" New: "+e);this._arr[r].priority=e,this._decrease(r)},Ic.prototype._heapify=function(t){var e=this._arr,r=2*t,n=r+1,i=t;r>1].priority0&&(i=s.removeMin(),(o=a[i]).distance!==Number.POSITIVE_INFINITY);)n(i).forEach(u);return a}(t,String(e),r||Fc,n||function(e){return t.outEdges(e)})},Fc=fc.constant(1);var Pc=Rc,Sc=fc,Gc=function(t,e,r){return Sc.transform(t.nodes(),(function(n,i){n[i]=Pc(t,i,e,r)}),{})};var jc=fc,kc=function(t){var e=0,r=[],n={},i=[];function o(a){var s=n[a]={onStack:!0,lowlink:e,index:e++};if(r.push(a),t.successors(a).forEach((function(t){jc.has(n,t)?n[t].onStack&&(s.lowlink=Math.min(s.lowlink,n[t].index)):(o(t),s.lowlink=Math.min(s.lowlink,n[t].lowlink))})),s.lowlink===s.index){var u,c=[];do{u=r.pop(),n[u].onStack=!1,c.push(u)}while(a!==u);i.push(c)}}return t.nodes().forEach((function(t){jc.has(n,t)||o(t)})),i};var Uc=fc,Yc=kc,Xc=function(t){return Uc.filter(Yc(t),(function(e){return e.length>1||1===e.length&&t.hasEdge(e[0],e[0])}))};var zc=function(t,e,r){return function(t,e,r){var n={},i=t.nodes();return i.forEach((function(t){n[t]={},n[t][t]={distance:0},i.forEach((function(e){t!==e&&(n[t][e]={distance:Number.POSITIVE_INFINITY})})),r(t).forEach((function(r){var i=r.v===t?r.w:r.v,o=e(r);n[t][i]={distance:o,predecessor:t}}))})),i.forEach((function(t){var e=n[t];i.forEach((function(r){var o=n[r];i.forEach((function(r){var n=o[t],i=e[r],a=o[r],s=n.distance+i.distance;s0;){if(r=o.removeMin(),eh.has(i,r))n.setEdge(r,i[r]);else{if(s)throw new Error("Input graph is not connected: "+t);s=!0}t.nodeEdges(r).forEach(a)}return n},tarjan:kc,topsort:Wc},version:Ec.version};function oh(){var t={};t._next=t._prev=t,this._sentinel=t}function ah(t){t._prev._next=t._next,t._next._prev=t._prev,delete t._next,delete t._prev}function sh(t,e){if("_next"!==t&&"_prev"!==t)return e}oh.prototype.dequeue=function(){var t=this._sentinel,e=t._prev;if(e!==t)return ah(e),e},oh.prototype.enqueue=function(t){var e=this._sentinel;t._prev&&t._next&&ah(t),t._next=e._next,e._next._prev=t,e._next=t,t._prev=e},oh.prototype.toString=function(){for(var t=[],e=this._sentinel,r=e._prev;r!==e;)t.push(JSON.stringify(r,sh)),r=r._prev;return"["+t.join(", ")+"]"};var uh=v.exports.constant(1);function ch(t,e){if(t.nodeCount()<=1)return[];var r=function(t,e){var r=new ih.Graph,n=0,i=0;v.exports.forEach(t.nodes(),(function(t){r.setNode(t,{v:t,in:0,out:0})})),v.exports.forEach(t.edges(),(function(t){var o=r.edge(t.v,t.w)||0,a=e(t),s=o+a;r.setEdge(t.v,t.w,s),i=Math.max(i,r.node(t.v).out+=a),n=Math.max(n,r.node(t.w).in+=a)}));var o=v.exports.range(i+n+3).map((function(){return new oh})),a=n+1;return v.exports.forEach(r.nodes(),(function(t){lh(o,a,r.node(t))})),{graph:r,buckets:o,zeroIdx:a}}(t,e||uh),n=function(t,e,r){var n,i=[],o=e[e.length-1],a=e[0];for(;t.nodeCount();){for(;n=a.dequeue();)hh(t,e,r,n);for(;n=o.dequeue();)hh(t,e,r,n);if(t.nodeCount())for(var s=e.length-2;s>0;--s)if(n=e[s].dequeue()){i=i.concat(hh(t,e,r,n,!0));break}}return i}(r.graph,r.buckets,r.zeroIdx);return v.exports.flatten(v.exports.map(n,(function(e){return t.outEdges(e.v,e.w)})),!0)}function hh(t,e,r,n,i){var o=i?[]:void 0;return v.exports.forEach(t.inEdges(n.v),(function(n){var a=t.edge(n),s=t.node(n.v);i&&o.push({v:n.v,w:n.w}),s.out-=a,lh(e,r,s)})),v.exports.forEach(t.outEdges(n.v),(function(n){var i=t.edge(n),o=n.w,a=t.node(o);a.in-=i,lh(e,r,a)})),t.removeNode(n.v),o}function lh(t,e,r){r.out?r.in?t[r.out-r.in+e].enqueue(r):t[t.length-1].enqueue(r):t[0].enqueue(r)}function fh(t){var e="greedy"===t.graph().acyclicer?ch(t,function(t){return function(e){return t.edge(e).weight}}(t)):function(t){var e=[],r={},n={};function i(o){v.exports.has(n,o)||(n[o]=!0,r[o]=!0,v.exports.forEach(t.outEdges(o),(function(t){v.exports.has(r,t.w)?e.push(t):i(t.w)})),delete r[o])}return v.exports.forEach(t.nodes(),i),e}(t);v.exports.forEach(e,(function(e){var r=t.edge(e);t.removeEdge(e),r.forwardName=e.name,r.reversed=!0,t.setEdge(e.w,e.v,r,v.exports.uniqueId("rev"))}))}function dh(t,e,r,n){var i;do{i=v.exports.uniqueId(n)}while(t.hasNode(i));return r.dummy=e,t.setNode(i,r),i}function ph(t){var e=v.exports.map(v.exports.range(vh(t)+1),(function(){return[]}));return v.exports.forEach(t.nodes(),(function(r){var n=t.node(r),i=n.rank;v.exports.isUndefined(i)||(e[i][n.order]=r)})),e}function gh(t,e,r,n){var i={width:0,height:0};return arguments.length>=4&&(i.rank=r,i.order=n),dh(t,"border",i,e)}function vh(t){return v.exports.max(v.exports.map(t.nodes(),(function(e){var r=t.node(e).rank;if(!v.exports.isUndefined(r))return r})))}function yh(t,e){var r=v.exports.now();try{return e()}finally{console.log(t+" time: "+(v.exports.now()-r)+"ms")}}function mh(t,e){return e()}function _h(t){t.graph().dummyChains=[],v.exports.forEach(t.edges(),(function(e){!function(t,e){var r,n,i,o=e.v,a=t.node(o).rank,s=e.w,u=t.node(s).rank,c=e.name,h=t.edge(e),l=h.labelRank;if(u===a+1)return;for(t.removeEdge(e),i=0,++a;aa.lim&&(s=a,u=!0);var c=v.exports.filter(e.edges(),(function(e){return u===Fh(t,t.node(e.v),s)&&u!==Fh(t,t.node(e.w),s)}));return v.exports.minBy(c,(function(t){return Eh(e,t)}))}function Rh(t,e,r,n){var i=r.v,o=r.w;t.removeEdge(i,o),t.setEdge(n.v,n.w,{}),Mh(t),Lh(t,e),function(t,e){var r=v.exports.find(t.nodes(),(function(t){return!e.node(t).parent})),n=ih.alg.preorder(t,r);n=n.slice(1),v.exports.forEach(n,(function(r){var n=t.node(r).parent,i=e.edge(r,n),o=!1;i||(i=e.edge(n,r),o=!0),e.node(r).rank=e.node(n).rank+(o?i.minlen:-i.minlen)}))}(t,e)}function Fh(t,e,r){return r.low<=e.lim&&e.lim<=r.lim}function Ph(t){switch(t.graph().ranker){case"network-simplex":default:Gh(t);break;case"tight-tree":!function(t){wh(t),bh(t)}(t);break;case"longest-path":Sh(t)}}Th.initLowLimValues=Mh,Th.initCutValues=Lh,Th.calcCutValue=Ch,Th.leaveEdge=Ih,Th.enterEdge=Dh,Th.exchangeEdges=Rh;var Sh=wh;function Gh(t){Th(t)}function jh(t){var e=function(t){var e={},r=0;function n(i){var o=r;v.exports.forEach(t.children(i),n),e[i]={low:o,lim:r++}}return v.exports.forEach(t.children(),n),e}(t);v.exports.forEach(t.graph().dummyChains,(function(r){for(var n=t.node(r),i=n.edgeObj,o=function(t,e,r,n){var i,o,a=[],s=[],u=Math.min(e[r].low,e[n].low),c=Math.max(e[r].lim,e[n].lim);i=r;do{i=t.parent(i),a.push(i)}while(i&&(e[i].low>u||c>e[i].lim));o=i,i=n;for(;(i=t.parent(i))!==o;)s.push(i);return{path:a.concat(s.reverse()),lca:o}}(t,e,i.v,i.w),a=o.path,s=o.lca,u=0,c=a[u],h=!0;r!==i.w;){if(n=t.node(r),h){for(;(c=a[u])!==s&&t.node(c).maxRank0;)e%2&&(r+=s[e+1]),s[e=e-1>>1]+=t.weight;u+=t.weight*r}))),u}function Hh(t,e){var r={};return v.exports.forEach(t,(function(t,e){var n=r[t.v]={indegree:0,in:[],out:[],vs:[t.v],i:e};v.exports.isUndefined(t.barycenter)||(n.barycenter=t.barycenter,n.weight=t.weight)})),v.exports.forEach(e.edges(),(function(t){var e=r[t.v],n=r[t.w];v.exports.isUndefined(e)||v.exports.isUndefined(n)||(n.indegree++,e.out.push(r[t.w]))})),function(t){var e=[];function r(t){return function(e){e.merged||(v.exports.isUndefined(e.barycenter)||v.exports.isUndefined(t.barycenter)||e.barycenter>=t.barycenter)&&function(t,e){var r=0,n=0;t.weight&&(r+=t.barycenter*t.weight,n+=t.weight);e.weight&&(r+=e.barycenter*e.weight,n+=e.weight);t.vs=e.vs.concat(t.vs),t.barycenter=r/n,t.weight=n,t.i=Math.min(e.i,t.i),e.merged=!0}(t,e)}}function n(e){return function(r){r.in.push(e),0==--r.indegree&&t.push(r)}}for(;t.length;){var i=t.pop();e.push(i),v.exports.forEach(i.in.reverse(),r(i)),v.exports.forEach(i.out,n(i))}return v.exports.map(v.exports.filter(e,(function(t){return!t.merged})),(function(t){return v.exports.pick(t,["vs","i","barycenter","weight"])}))}(v.exports.filter(r,(function(t){return!t.indegree})))}function Bh(t,e){var r,n=function(t,e){var r={lhs:[],rhs:[]};return v.exports.forEach(t,(function(t){e(t)?r.lhs.push(t):r.rhs.push(t)})),r}(t,(function(t){return v.exports.has(t,"barycenter")})),i=n.lhs,o=v.exports.sortBy(n.rhs,(function(t){return-t.i})),a=[],s=0,u=0,c=0;i.sort((r=!!e,function(t,e){return t.barycentere.barycenter?1:r?e.i-t.i:t.i-e.i})),c=Wh(a,o,c),v.exports.forEach(i,(function(t){c+=t.vs.length,a.push(t.vs),s+=t.barycenter*t.weight,u+=t.weight,c=Wh(a,o,c)}));var h={vs:v.exports.flatten(a,!0)};return u&&(h.barycenter=s/u,h.weight=u),h}function Wh(t,e,r){for(var n;e.length&&(n=v.exports.last(e)).i<=r;)e.pop(),t.push(n.vs),r++;return r}function Vh(t,e,r,n){var i=t.children(e),o=t.node(e),a=o?o.borderLeft:void 0,s=o?o.borderRight:void 0,u={};a&&(i=v.exports.filter(i,(function(t){return t!==a&&t!==s})));var c=function(t,e){return v.exports.map(e,(function(e){var r=t.inEdges(e);if(r.length){var n=v.exports.reduce(r,(function(e,r){var n=t.edge(r),i=t.node(r.v);return{sum:e.sum+n.weight*i.order,weight:e.weight+n.weight}}),{sum:0,weight:0});return{v:e,barycenter:n.sum/n.weight,weight:n.weight}}return{v:e}}))}(t,i);v.exports.forEach(c,(function(e){if(t.children(e.v).length){var i=Vh(t,e.v,r,n);u[e.v]=i,v.exports.has(i,"barycenter")&&(o=e,a=i,v.exports.isUndefined(o.barycenter)?(o.barycenter=a.barycenter,o.weight=a.weight):(o.barycenter=(o.barycenter*o.weight+a.barycenter*a.weight)/(o.weight+a.weight),o.weight+=a.weight))}var o,a}));var h=Hh(c,r);!function(t,e){v.exports.forEach(t,(function(t){t.vs=v.exports.flatten(t.vs.map((function(t){return e[t]?e[t].vs:t})),!0)}))}(h,u);var l=Bh(h,n);if(a&&(l.vs=v.exports.flatten([a,l.vs,s],!0),t.predecessors(a).length)){var f=t.node(t.predecessors(a)[0]),d=t.node(t.predecessors(s)[0]);v.exports.has(l,"barycenter")||(l.barycenter=0,l.weight=0),l.barycenter=(l.barycenter*l.weight+f.order+d.order)/(l.weight+2),l.weight+=2}return l}function qh(t,e,r){var n=function(t){var e;for(;t.hasNode(e=v.exports.uniqueId("_root")););return e}(t),i=new ih.Graph({compound:!0}).setGraph({root:n}).setDefaultNodeLabel((function(e){return t.node(e)}));return v.exports.forEach(t.nodes(),(function(o){var a=t.node(o),s=t.parent(o);(a.rank===e||a.minRank<=e&&e<=a.maxRank)&&(i.setNode(o),i.setParent(o,s||n),v.exports.forEach(t[r](o),(function(e){var r=e.v===o?e.w:e.v,n=i.edge(r,o),a=v.exports.isUndefined(n)?0:n.weight;i.setEdge(r,o,{weight:t.edge(e).weight+a})})),v.exports.has(a,"minRank")&&i.setNode(o,{borderLeft:a.borderLeft[e],borderRight:a.borderRight[e]}))})),i}var $h={};function Zh(t,e,r,o){var a=r.eles.nodes(),s=function(t){for(var e=[],r=0;r0&&e.push(n)}return e}(e);!function(t){for(var e=0;e1){var d=r.newGraph();Kh(t,r.graphManager.add(d,g),r,n,o,s,g)}n.eles.nodes("#"+i[a].id()).data("parent")&&(g.parentId=n.eles.nodes("#"+i[a].id()).data("parent")),g.noOfChildren>=2&&(g.noOfChildren-=1);var p=e.add(g);$h[i[a].id()]=p}else{var g;s=t.node(s.id()),u=new c.exports.layoutBase.PointD(s.x,s.y),h=new c.exports.layoutBase.DimensionD(s.width,s.height),(g=new f(r.graphManager,u,h,null,i[a].id(),s.rank)).nodeRepulsion=n.nodeRepulsion,g.isDirected=1;p=e.add(g);$h[i[a].id()]=p}}}}(t,h.addRoot(),u,r),function(t,e,r){for(var n=r.eles.edges(),i={},o=0;o1){var g=r.newGraph();Kh(t,r.graphManager.add(g,p),r,n,i,u,p)}n.eles.nodes("#"+u.id()).data("parent")&&(p.parentId=n.eles.nodes("#"+u.id()).data("parent")),p.noOfChildren>=2&&(p.noOfChildren-=1);var v=a.getChild().add(p);$h[u.id()]=v}}}function Qh(t,e,r){var n=vh(t),i=Jh(t,v.exports.range(1,n+1),"inEdges"),o=Jh(t,v.exports.range(n-1,-1,-1),"outEdges"),a=function(t){var e={},r=v.exports.filter(t.nodes(),(function(e){return!t.children(e).length})),n=v.exports.max(v.exports.map(r,(function(e){return t.node(e).rank}))),i=v.exports.map(v.exports.range(n+1),(function(){return[]})),o=v.exports.sortBy(r,(function(e){return t.node(e).rank}));return v.exports.forEach(o,(function r(n){if(!v.exports.has(e,n)){e[n]=!0;var o=t.node(n);i[o.rank].push(n),v.exports.forEach(t.successors(n),r)}})),i}(t);if(el(t,a),e.isForceDirected){const n=Zh(t,a,e,r);e.isRelayer&&el(t,n)}else{for(var s,u=Number.POSITIVE_INFINITY,c=0,h=0;h<4;++c,++h){tl(c%2?i:o,c%4>=2);var l=Xh(t,a=ph(t));lh&&(h=p.h),p.w>l&&(l=p.w)}e.rankGap+=h,e.orderGap<20+l&&(e.orderGap=20+l),u("nodesep",e.nodeSep),u("edgesep",e.edgeSep),u("ranksep",e.rankSep),u("rankdir",e.rankDir),u("align",e.align),u("ranker",e.ranker),u("acyclicer",e.acyclicer),a.setGraph(s),a.setDefaultEdgeLabel((function(){return{}})),a.setDefaultNodeLabel((function(){return{}}));var g=n.edges().stdFilter((function(t){return 1==t.source().data("isDirected")&&1==t.target().data("isDirected")}));for(f=0;f