!/**
 * Highcharts JS v13.0.0 (2026-06-11)
 * @module highcharts/modules/networkgraph
 * @requires highcharts
 *
 * Force directed graph module
 *
 * (c) 2010-2026 Highsoft AS
 * Author: Torstein Hønsi
 *
 * A commercial license may be required depending on use,
 * see www.highcharts.com/license
 */function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(t._Highcharts,t._Highcharts.SVGElement,t._Highcharts.SeriesRegistry):"function"==typeof define&&define.amd?define("highcharts/modules/networkgraph",["highcharts/highcharts"],function(t){return e(t,t.SVGElement,t.SeriesRegistry)}):"object"==typeof exports?exports["highcharts/modules/networkgraph"]=e(t._Highcharts,t._Highcharts.SVGElement,t._Highcharts.SeriesRegistry):t.Highcharts=e(t.Highcharts,t.Highcharts.SVGElement,t.Highcharts.SeriesRegistry)}("u"<typeof window?this:window,function(t,e,i){return function(){"use strict";var o,s,r,n,a,h={28:function(t){t.exports=e},512:function(t){t.exports=i},944:function(e){e.exports=t}},p={};function d(t){var e=p[t];if(void 0!==e)return e.exports;var i=p[t]={exports:{}};return h[t](i,i.exports,d),i.exports}d.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return d.d(e,{a:e}),e},d.d=function(t,e){for(var i in e)d.o(e,i)&&!d.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},d.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)};var l={};d.d(l,{default:function(){return ta}});var c=d(944),u=d.n(c),f=d(28),y=d.n(f),m=u().composed;function g(){var t,e,i,o,s=this;s.container&&(t=(0,c.addEvent)(s.container,"mousedown",function(t){e&&e(),i&&i(),(o=s.hoverPoint)&&o.series&&o.series.hasDraggableNodes&&o.series.options.draggable&&(o.series.onMouseDown(o,t),e=(0,c.addEvent)(s.container,"mousemove",function(t){return o&&o.series&&o.series.onMouseMove(o,t)}),i=(0,c.addEvent)(s.container.ownerDocument,"mouseup",function(t){return e(),i(),o&&o.series&&o.series.onMouseUp(o,t)}))})),(0,c.addEvent)(s,"destroy",function(){t()})}var v={compose:function(t){(0,c.pushUnique)(m,"DragNodes")&&(0,c.addEvent)(t,"load",g)},onMouseDown:function(t,e){var i,o=this.chart.options.chart.panKey;if(!(o&&e[""+o+"Key"])){var s=(null==(i=this.chart.pointer)?void 0:i.normalize(e))||e;t.fixedPosition={chartX:s.chartX,chartY:s.chartY,plotX:t.plotX,plotY:t.plotY},t.inDragMode=!0}},onMouseMove:function(t,e){var i;if(t.fixedPosition&&t.inDragMode){var o=this.chart,s=(null==(i=o.pointer)?void 0:i.normalize(e))||e,r=t.fixedPosition.chartX-s.chartX,n=t.fixedPosition.chartY-s.chartY,a=o.graphLayoutsLookup,h=void 0,p=void 0;(Math.abs(r)>5||Math.abs(n)>5)&&(h=t.fixedPosition.plotX-r,p=t.fixedPosition.plotY-n,o.isInsidePlot(h,p)&&(t.plotX=h,t.plotY=p,t.hasDragged=!0,this.redrawHalo(t),a.forEach(function(t){t.restartSimulation()})))}},onMouseUp:function(t){t.fixedPosition&&(t.hasDragged&&(this.layout.enableSimulation?this.layout.start():this.chart.redraw()),t.inDragMode=t.hasDragged=!1,this.options.fixedDraggable||delete t.fixedPosition)},redrawHalo:function(t){t&&this.halo&&this.halo.attr({d:t.haloPath(this.options.states.hover.halo.size)})}},b=u().setAnimation,x=u().composed;function k(){this.graphLayoutsLookup&&(this.graphLayoutsLookup.forEach(function(t){t.updateSimulation()}),this.redraw())}function N(){this.graphLayoutsLookup&&(this.graphLayoutsLookup.forEach(function(t){t.updateSimulation(!1)}),this.redraw())}function L(){this.graphLayoutsLookup&&this.graphLayoutsLookup.forEach(function(t){t.stop()})}function P(){var t,e,i=!1,o=function(t){t.maxIterations--&&isFinite(t.temperature)&&!t.isStable()&&!t.enableSimulation&&(t.beforeStep&&t.beforeStep(),t.step(),e=!1,i=!0)};if(this.graphLayoutsLookup&&!(null==(t=this.pointer)?void 0:t.hasDragged)){for(b(!1,this),this.graphLayoutsLookup.forEach(function(t){return t.start()});!e;)e=!0,this.graphLayoutsLookup.forEach(o);i&&this.series.forEach(function(t){t&&t.layout&&t.render()})}}var w=function(t){(0,c.pushUnique)(x,"GraphLayout")&&((0,c.addEvent)(t,"afterPrint",k),(0,c.addEvent)(t,"beforePrint",N),(0,c.addEvent)(t,"predraw",L),(0,c.addEvent)(t,"render",P))},S={},E={},M=d(512),T=d.n(M),X=T().series,Y=X.prototype,D=X.prototype.pointClass.prototype;!function(t){function e(){var t;if(!(null==(t=this.hasDataLabels)?void 0:t.call(this))&&this.nodes)for(var e=0,i=this.nodes;e<i.length;e++)i[e].destroyElements({dataLabel:1})}function i(){return this.data=[].concat(this.points||[],this.nodes),Y.destroy.apply(this,arguments)}function o(){this.nodes&&(this.nodes.forEach(function(t){t.destroy()}),this.nodes.length=0),Y.setData.apply(this,arguments)}function s(t){var e=arguments,i=this.isNode?this.linksTo.concat(this.linksFrom):[this.fromNode,this.toNode];"select"!==t&&i.forEach(function(t){t&&t.series&&(D.setState.apply(t,e),!t.isNode&&(t.fromNode.graphic&&D.setState.apply(t.fromNode,e),t.toNode&&t.toNode.graphic&&D.setState.apply(t.toNode,e)))}),D.setState.apply(this,e)}function r(t,e,i,o){var s=this,r=this.series.options.nodes,n=this.series.options.data,a=(null==n?void 0:n.length)||0,h=null==n?void 0:n[this.index];if(D.update.call(this,t,!this.isNode&&e,i,o),this.isNode){var p=(r||[]).reduce(function(t,e,i){return s.id===e.id?i:t},-1),d=(0,c.merge)(r&&r[p]||{},(null==n?void 0:n[this.index])||{});n&&(h?n[this.index]=h:n.length=a),r?p>=0?r[p]=d:r.push(d):this.series.options.nodes=[d],(0,c.pick)(e,!0)&&this.series.chart.redraw(i)}}t.compose=function(t,n){var a=t.prototype,h=n.prototype;return a.setNodeState=s,a.setState=s,a.update=r,h.destroy=i,h.setData=o,(0,c.addEvent)(n,"afterUpdate",e),n},t.createNode=function(t){var e,i=this.pointClass,o=function(t,e){return(0,c.find)(t,function(t){return t.id===e})},s=o(this.nodes,t);if(!s){e=this.options.nodes&&o(this.options.nodes,t);var r=new i(this,(0,c.extend)({className:"highcharts-node",isNode:!0,id:t,y:1},e));r.linksTo=[],r.linksFrom=[],r.getSum=function(){var t=0,e=0;return r.linksTo.forEach(function(e){t+=e.weight||0}),r.linksFrom.forEach(function(t){e+=t.weight||0}),Math.max(t,e)},r.offset=function(t,e){for(var i=0,o=0;o<r[e].length;o++){if(r[e][o]===t)return i;i+=r[e][o].weight}},r.hasShape=function(){var t=0;return r.linksTo.forEach(function(e){e.outgoing&&t++}),!r.linksTo.length||t!==r.linksTo.length},r.index=this.nodes.push(r)-1,s=r}return s.formatPrefix="node",s.name=s.name||s.options.id||"",s.mass=(0,c.pick)(s.options.mass,s.options.marker&&s.options.marker.radius,this.options.marker&&this.options.marker.radius,4),s},t.destroy=i,t.generatePoints=function(){var t=this,e=this.chart,i={};Y.generatePoints.call(this),this.nodes||(this.nodes=[]),this.colorCounter=0,this.nodes.forEach(function(t){t.linksFrom.length=0,t.linksTo.length=0,t.level=t.options.level}),this.points.forEach(function(o){(0,c.defined)(o.from)&&(i[o.from]||(i[o.from]=t.createNode(o.from)),i[o.from].linksFrom.push(o),o.fromNode=i[o.from],e.styledMode?o.colorIndex=(0,c.pick)(o.options.colorIndex,i[o.from].colorIndex):o.color=o.options.color||i[o.from].color),(0,c.defined)(o.to)&&(i[o.to]||(i[o.to]=t.createNode(o.to)),i[o.to].linksTo.push(o),o.toNode=i[o.to]),o.name=o.name||o.id},this),this.nodeLookup=i},t.setNodeState=s,t.updateNode=r}(a||(a={}));var F=a,O=(o=function(t,e){return(o=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)},function(t,e){function i(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}),C=T().series,A=C.prototype,I=C.prototype.pointClass,_=function(t){function e(e,i,o){var s=t.call(this,e,i,o)||this;return s.series.options.draggable&&!s.series.chart.styledMode&&((0,c.addEvent)(s,"mouseOver",function(){(0,c.css)(this.series.chart.container,{cursor:"move"})}),(0,c.addEvent)(s,"mouseOut",function(){(0,c.css)(this.series.chart.container,{cursor:"default"})})),s}return O(e,t),e.prototype.destroy=function(){return this.isNode&&this.linksFrom.concat(this.linksTo).forEach(function(t){t.destroyElements&&t.destroyElements()}),this.series.layout.removeElementFromCollection(this,this.series.layout[this.isNode?"nodes":"links"]),I.prototype.destroy.apply(this,arguments)},e.prototype.getDegree=function(){var t=this.isNode?this.linksFrom.length+this.linksTo.length:0;return 0===t?1:t},e.prototype.getLinkAttributes=function(){var t=this.series.options.link,e=this.options;return{"stroke-width":(0,c.pick)(e.width,t.width),stroke:e.color||t.color,dashstyle:e.dashStyle||t.dashStyle,opacity:(0,c.pick)(e.opacity,t.opacity,1)}},e.prototype.getLinkPath=function(){var t=this.fromNode,e=this.toNode;return t.plotX>e.plotX&&(t=this.toNode,e=this.fromNode),[["M",t.plotX||0,t.plotY||0],["L",e.plotX||0,e.plotY||0]]},e.prototype.getMass=function(){var t=this.fromNode.mass,e=this.toNode.mass,i=t+e;return{fromNode:1-t/i,toNode:1-e/i}},e.prototype.isValid=function(){return!this.isNode||(0,c.defined)(this.id)},e.prototype.redrawLink=function(){var t,e=this.getLinkPath();if(this.graphic){this.shapeArgs={d:e},this.series.chart.styledMode||(t=this.series.pointAttribs(this),this.graphic.attr(t),(this.dataLabels||[]).forEach(function(e){e&&e.attr({opacity:t.opacity})})),this.graphic.animate(this.shapeArgs);var i=e[0],o=e[1];"M"===i[0]&&"L"===o[0]&&(this.plotX=(i[1]+o[1])/2,this.plotY=(i[2]+o[2])/2)}},e.prototype.remove=function(t,e){var i,o=this.series,s=o.options.nodes||[],r=s.length;if(this.isNode){for(o.points=[],[].concat(this.linksFrom).concat(this.linksTo).forEach(function(t){(i=t.fromNode.linksFrom.indexOf(t))>-1&&t.fromNode.linksFrom.splice(i,1),(i=t.toNode.linksTo.indexOf(t))>-1&&t.toNode.linksTo.splice(i,1),A.removePoint.call(o,o.data.indexOf(t),!1,!1)}),o.points=o.data.slice(),o.nodes.splice(o.nodes.indexOf(this),1);r--;)if(s[r].id===this.options.id){o.options.nodes.splice(r,1);break}this&&this.destroy(),o.isDirty=!0,o.isDirtyData=!0,t&&o.chart.redraw(t)}else o.removePoint(o.data.indexOf(this),t,e)},e.prototype.renderLink=function(){var t;!this.graphic&&(this.graphic=this.series.chart.renderer.path(this.getLinkPath()).addClass(this.getClassName(),!0).add(this.series.group),this.series.chart.styledMode||(t=this.series.pointAttribs(this),this.graphic.attr(t),(this.dataLabels||[]).forEach(function(e){e&&e.attr({opacity:t.opacity})})))},e}(I);(0,c.extend)(_.prototype,{setState:F.setNodeState});var R={stickyTracking:!1,inactiveOtherPoints:!0,marker:{enabled:!0,states:{inactive:{opacity:.3,animation:{duration:50}}}},states:{inactive:{linkOpacity:.3,animation:{duration:50}}},dataLabels:{formatter:function(){var t;return String(null!=(t=this.key)?t:"")},linkFormatter:function(){return this.fromNode.name+"<br>"+this.toNode.name},linkTextPath:{enabled:!0},textPath:{enabled:!1},style:{transition:"opacity 2000ms"},defer:!0,animation:{defer:1e3}},link:{color:"rgba(100, 100, 100, 0.5)",width:1},draggable:!0,layoutAlgorithm:{initialPositions:"circle",initialPositionRadius:1,enableSimulation:!1,theta:.5,maxSpeed:10,approximation:"none",type:"reingold-fruchterman",integration:"euler",maxIterations:1e3,gravitationalConstant:.0625,friction:-.981},showInLegend:!1},H={attractive:function(t,e,i,o){var s=t.getMass(),r=i.x/o*e,n=i.y/o*e;t.fromNode.fixedPosition||(t.fromNode.dispX-=r*s.fromNode/t.fromNode.degree,t.fromNode.dispY-=n*s.fromNode/t.fromNode.degree),t.toNode.fixedPosition||(t.toNode.dispX+=r*s.toNode/t.toNode.degree,t.toNode.dispY+=n*s.toNode/t.toNode.degree)},attractiveForceFunction:function(t,e){return t*t/e},barycenter:function(){var t=this.options.gravitationalConstant,e=this.barycenter.xFactor,i=this.barycenter.yFactor;this.nodes.forEach(function(o){if(!o.fixedPosition){var s=o.getDegree(),r=s*(1+s/2);o.dispX+=(e-o.plotX)*t*r/o.degree,o.dispY+=(i-o.plotY)*t*r/o.degree}})},getK:function(t){return Math.pow(t.box.width*t.box.height/t.nodes.length,.3)},integrate:function(t,e){e.dispX+=e.dispX*t.options.friction,e.dispY+=e.dispY*t.options.friction;var i=e.temperature=t.vectorLength({x:e.dispX,y:e.dispY});0!==i&&(e.plotX+=e.dispX/i*Math.min(Math.abs(e.dispX),t.temperature),e.plotY+=e.dispY/i*Math.min(Math.abs(e.dispY),t.temperature))},repulsive:function(t,e,i,o){t.dispX+=i.x/o*e/t.degree,t.dispY+=i.y/o*e/t.degree},repulsiveForceFunction:function(t,e){return e*e/t}},B=function(){function t(t){this.body=!1,this.isEmpty=!1,this.isInternal=!1,this.nodes=[],this.box=t,this.boxSize=Math.min(t.width,t.height)}return t.prototype.divideBox=function(){var e=this.box.width/2,i=this.box.height/2;this.nodes[0]=new t({left:this.box.left,top:this.box.top,width:e,height:i}),this.nodes[1]=new t({left:this.box.left+e,top:this.box.top,width:e,height:i}),this.nodes[2]=new t({left:this.box.left+e,top:this.box.top+i,width:e,height:i}),this.nodes[3]=new t({left:this.box.left,top:this.box.top+i,width:e,height:i})},t.prototype.getBoxPosition=function(t){var e=t.plotX<this.box.left+this.box.width/2,i=t.plotY<this.box.top+this.box.height/2;return e?3*!i:i?1:2},t.prototype.insert=function(e,i){var o;this.isInternal?this.nodes[this.getBoxPosition(e)].insert(e,i-1):(this.isEmpty=!1,this.body?i?(this.isInternal=!0,this.divideBox(),!0!==this.body&&(this.nodes[this.getBoxPosition(this.body)].insert(this.body,i-1),this.body=!0),this.nodes[this.getBoxPosition(e)].insert(e,i-1)):((o=new t({top:e.plotX||NaN,left:e.plotY||NaN,width:.1,height:.1})).body=e,o.isInternal=!1,this.nodes.push(o)):(this.isInternal=!1,this.body=e))},t.prototype.updateMassAndCenter=function(){var t=0,e=0,i=0;if(this.isInternal){for(var o=0,s=this.nodes;o<s.length;o++){var r=s[o];r.isEmpty||(t+=r.mass,e+=r.plotX*r.mass,i+=r.plotY*r.mass)}e/=t,i/=t}else this.body&&(t=this.body.mass,e=this.body.plotX,i=this.body.plotY);this.mass=t,this.plotX=e,this.plotY=i},t}(),G=function(){function t(t,e,i,o){this.box={left:t,top:e,width:i,height:o},this.maxDepth=25,this.root=new B(this.box),this.root.isInternal=!0,this.root.isRoot=!0,this.root.divideBox()}return t.prototype.calculateMassAndCenter=function(){this.visitNodeRecursive(null,null,function(t){t.updateMassAndCenter()})},t.prototype.insertNodes=function(t){for(var e=0;e<t.length;e++){var i=t[e];this.root.insert(i,this.maxDepth)}},t.prototype.visitNodeRecursive=function(t,e,i){var o;if(t||(t=this.root),t===this.root&&e&&(o=e(t)),!1!==o){for(var s=0,r=t.nodes;s<r.length;s++){var n=r[s];if(n.isInternal){if(e&&(o=e(n)),!1===o)continue;this.visitNodeRecursive(n,e,i)}else n.body&&e&&e(n.body);i&&i(n)}t===this.root&&i&&i(t)}},t}(),j={attractive:function(t,e,i){var o=t.getMass(),s=-i.x*e*this.diffTemperature,r=-i.y*e*this.diffTemperature;t.fromNode.fixedPosition||(t.fromNode.plotX-=s*o.fromNode/t.fromNode.degree,t.fromNode.plotY-=r*o.fromNode/t.fromNode.degree),t.toNode.fixedPosition||(t.toNode.plotX+=s*o.toNode/t.toNode.degree,t.toNode.plotY+=r*o.toNode/t.toNode.degree)},attractiveForceFunction:function(t,e){return(e-t)/t},barycenter:function(){var t=this.options.gravitationalConstant||0,e=(this.barycenter.xFactor-(this.box.left+this.box.width)/2)*t,i=(this.barycenter.yFactor-(this.box.top+this.box.height)/2)*t;this.nodes.forEach(function(t){t.fixedPosition||(t.plotX-=e/t.mass/t.degree,t.plotY-=i/t.mass/t.degree)})},getK:function(t){return Math.pow(t.box.width*t.box.height/t.nodes.length,.5)},integrate:function(t,e){var i=-t.options.friction,o=t.options.maxSpeed,s=e.prevX,r=e.prevY,n=(e.plotX+e.dispX-s)*i,a=(e.plotY+e.dispY-r)*i,h=Math.abs,p=h(n)/(n||1),d=h(a)/(a||1),l=p*Math.min(o,Math.abs(n)),c=d*Math.min(o,Math.abs(a));e.prevX=e.plotX+e.dispX,e.prevY=e.plotY+e.dispY,e.plotX+=l,e.plotY+=c,e.temperature=t.vectorLength({x:l,y:c})},repulsive:function(t,e,i){var o=e*this.diffTemperature/t.mass/t.degree;t.fixedPosition||(t.plotX+=i.x*o,t.plotY+=i.y*o)},repulsiveForceFunction:function(t,e){return(e-t)/t*(e>t)}},q=u().win,K=function(){function t(){this.box={},this.currentStep=0,this.initialRendering=!0,this.links=[],this.nodes=[],this.series=[],this.simulation=!1}return t.compose=function(e){w(e),S.euler=H,S.verlet=j,E["reingold-fruchterman"]=t},t.prototype.init=function(t){this.options=t,this.nodes=[],this.links=[],this.series=[],this.box={x:0,y:0,width:0,height:0},this.setInitialRendering(!0),this.integration=S[t.integration],this.enableSimulation=t.enableSimulation,this.attractiveForce=(0,c.pick)(t.attractiveForce,this.integration.attractiveForceFunction),this.repulsiveForce=(0,c.pick)(t.repulsiveForce,this.integration.repulsiveForceFunction),this.approximation=t.approximation},t.prototype.updateSimulation=function(t){this.enableSimulation=(0,c.pick)(t,this.options.enableSimulation)},t.prototype.start=function(){var t=this.series,e=this.options;this.currentStep=0,this.forces=t[0]&&t[0].forces||[],this.chart=t[0]&&t[0].chart,this.initialRendering&&(this.initPositions(),t.forEach(function(t){t.finishedAnimating=!0,t.render()})),this.setK(),this.resetSimulation(e),this.enableSimulation&&this.step()},t.prototype.step=function(){var t=this,e=this.series;this.currentStep++,"barnes-hut"===this.approximation&&(this.createQuadTree(),this.quadTree.calculateMassAndCenter());for(var i=0,o=this.forces||[];i<o.length;i++)this[o[i]+"Forces"](this.temperature);if(this.applyLimits(),this.temperature=this.coolDown(this.startTemperature,this.diffTemperature,this.currentStep),this.prevSystemTemperature=this.systemTemperature,this.systemTemperature=this.getSystemTemperature(),this.enableSimulation){for(var s=0;s<e.length;s++){var r=e[s];r.chart&&r.render()}this.maxIterations--&&isFinite(this.temperature)&&!this.isStable()?(this.simulation&&q.cancelAnimationFrame(this.simulation),this.simulation=q.requestAnimationFrame(function(){return t.step()})):(this.simulation=!1,this.series.forEach(function(t){(0,c.fireEvent)(t,"afterSimulation")}))}},t.prototype.stop=function(){this.simulation&&q.cancelAnimationFrame(this.simulation)},t.prototype.setArea=function(t,e,i,o){this.box={left:t,top:e,width:i,height:o}},t.prototype.setK=function(){this.k=this.options.linkLength||this.integration.getK(this)},t.prototype.addElementsToCollection=function(t,e){for(var i=0;i<t.length;i++){var o=t[i];-1===e.indexOf(o)&&e.push(o)}},t.prototype.removeElementFromCollection=function(t,e){var i=e.indexOf(t);-1!==i&&e.splice(i,1)},t.prototype.clear=function(){this.nodes.length=0,this.links.length=0,this.series.length=0,this.resetSimulation()},t.prototype.resetSimulation=function(){this.forcedStop=!1,this.systemTemperature=0,this.setMaxIterations(),this.setTemperature(),this.setDiffTemperature()},t.prototype.restartSimulation=function(){this.simulation?this.resetSimulation():(this.setInitialRendering(!1),this.enableSimulation?this.start():this.setMaxIterations(1),this.chart&&this.chart.redraw(),this.setInitialRendering(!0))},t.prototype.setMaxIterations=function(t){this.maxIterations=(0,c.pick)(t,this.options.maxIterations)},t.prototype.setTemperature=function(){this.temperature=this.startTemperature=Math.sqrt(this.nodes.length)},t.prototype.setDiffTemperature=function(){this.diffTemperature=this.startTemperature/(this.options.maxIterations+1)},t.prototype.setInitialRendering=function(t){this.initialRendering=t},t.prototype.createQuadTree=function(){this.quadTree=new G(this.box.left,this.box.top,this.box.width,this.box.height),this.quadTree.insertNodes(this.nodes)},t.prototype.initPositions=function(){var t=this.options.initialPositions;if((0,c.isFunction)(t)){t.call(this);for(var e=0,i=this.nodes;e<i.length;e++){var o=i[e];(0,c.defined)(o.prevX)||(o.prevX=o.plotX),(0,c.defined)(o.prevY)||(o.prevY=o.plotY),o.dispX=0,o.dispY=0}}else"circle"===t?this.setCircularPositions():this.setRandomPositions()},t.prototype.setCircularPositions=function(){for(var t,e=this.box,i=this.nodes,o=2*Math.PI/(i.length+1),s=i.filter(function(t){return 0===t.linksTo.length}),r={},n=this.options.initialPositionRadius,a=function(t){for(var e=0,i=t.linksFrom||[];e<i.length;e++){var o=i[e];r[o.toNode.id]||(r[o.toNode.id]=!0,h.push(o.toNode),a(o.toNode))}},h=[],p=0;p<s.length;p++){var d=s[p];h.push(d),a(d)}if(h.length)for(var l=0;l<i.length;l++){var u=i[l];-1===h.indexOf(u)&&h.push(u)}else h=i;for(var f=0,y=h.length;f<y;++f)(t=h[f]).plotX=t.prevX=(0,c.pick)(t.plotX,e.width/2+n*Math.cos(f*o)),t.plotY=t.prevY=(0,c.pick)(t.plotY,e.height/2+n*Math.sin(f*o)),t.dispX=0,t.dispY=0},t.prototype.setRandomPositions=function(){for(var t,e=this.box,i=this.nodes,o=i.length+1,s=function(t){var e=t*t/Math.PI;return e-Math.floor(e)},r=0,n=i.length;r<n;++r)(t=i[r]).plotX=t.prevX=(0,c.pick)(t.plotX,e.width*s(r)),t.plotY=t.prevY=(0,c.pick)(t.plotY,e.height*s(o+r)),t.dispX=0,t.dispY=0},t.prototype.force=function(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];this.integration[t].apply(this,e)},t.prototype.barycenterForces=function(){this.getBarycenter(),this.force("barycenter")},t.prototype.getBarycenter=function(){for(var t=0,e=0,i=0,o=0,s=this.nodes;o<s.length;o++){var r=s[o];e+=r.plotX*r.mass,i+=r.plotY*r.mass,t+=r.mass}return this.barycenter={x:e,y:i,xFactor:e/t,yFactor:i/t},this.barycenter},t.prototype.barnesHutApproximation=function(t,e){var i,o,s=this.getDistXY(t,e),r=this.vectorLength(s);return t!==e&&0!==r&&(e.isInternal?e.boxSize/r<this.options.theta&&0!==r?(o=this.repulsiveForce(r,this.k),this.force("repulsive",t,o*e.mass,s,r),i=!1):i=!0:(o=this.repulsiveForce(r,this.k),this.force("repulsive",t,o*e.mass,s,r))),i},t.prototype.repulsiveForces=function(){var t=this;if("barnes-hut"===this.approximation)for(var e=function(e){i.quadTree.visitNodeRecursive(null,function(i){return t.barnesHutApproximation(e,i)})},i=this,o=0,s=this.nodes;o<s.length;o++){var r=s[o];e(r)}else for(var n=void 0,a=void 0,h=void 0,p=0,d=this.nodes;p<d.length;p++)for(var r=d[p],l=0,c=this.nodes;l<c.length;l++){var u=c[l];r===u||r.fixedPosition||(h=this.getDistXY(r,u),0!==(a=this.vectorLength(h))&&(n=this.repulsiveForce(a,this.k),this.force("repulsive",r,n*u.mass,h,a)))}},t.prototype.attractiveForces=function(){for(var t,e,i,o=0,s=this.links;o<s.length;o++){var r=s[o];r.fromNode&&r.toNode&&(t=this.getDistXY(r.fromNode,r.toNode),0!==(e=this.vectorLength(t))&&(i=this.attractiveForce(e,this.k),this.force("attractive",r,i,t,e)))}},t.prototype.applyLimits=function(){for(var t=this.nodes,e=0;e<t.length;e++){var i=t[e];i.fixedPosition||(this.integration.integrate(this,i),this.applyLimitBox(i,this.box),i.dispX=0,i.dispY=0)}},t.prototype.applyLimitBox=function(t,e){var i=t.radius;t.plotX=(0,c.clamp)(t.plotX,e.left+i,e.width-i),t.plotY=(0,c.clamp)(t.plotY,e.top+i,e.height-i)},t.prototype.coolDown=function(t,e,i){return t-e*i},t.prototype.isStable=function(){return 1e-5>Math.abs(this.systemTemperature-this.prevSystemTemperature)||this.temperature<=0},t.prototype.getSystemTemperature=function(){for(var t=0,e=0,i=this.nodes;e<i.length;e++)t+=i[e].temperature;return t},t.prototype.vectorLength=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)},t.prototype.getDistR=function(t,e){var i=this.getDistXY(t,e);return this.vectorLength(i)},t.prototype.getDistXY=function(t,e){var i=t.plotX-e.plotX,o=t.plotY-e.plotY;return{x:i,y:o,absX:Math.abs(i),absY:Math.abs(o)}},t}(),U=function(){return(U=Object.assign||function(t){for(var e,i=1,o=arguments.length;i<o;i++)for(var s in e=arguments[i])Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s]);return t}).apply(this,arguments)},z=u().animObject,V={initDataLabels:function(){var t=this.options.dataLabels;if(!this.dataLabelsGroup){var e=this.initDataLabelsGroup(0,t);return!this.chart.styledMode&&(null==t?void 0:t.style)&&e.css(t.style),e.attr({opacity:0}),this.visible&&(this.options.animation&&(null==t?void 0:t.animation)?e.animate({opacity:1},t.animation):e.attr({opacity:1}),e.show()),e}return this.dataLabelsGroup.attr(U({opacity:1},this.getPlotBox("data-labels"))),this.dataLabelsGroup},initDataLabelsDefer:function(){var t,e=this,i=this.options.dataLabels;(null==i?void 0:i.defer)&&(null==(t=this.options.layoutAlgorithm)?void 0:t.enableSimulation)?(0,c.syncTimeout)(function(){e.deferDataLabels=!1},i?z(i.animation).defer:0):this.deferDataLabels=!1}},Q=u().composed,W=u().deg2rad,J=(s=function(t,e){return(s=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=t}s(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}),Z=u().noop,$=T().series,tt=T().seriesTypes,te=tt.column.prototype,ti=tt.line.prototype,to=V.initDataLabels,ts=V.initDataLabelsDefer;r=y(),(0,c.pushUnique)(Q,"TextPath")&&((0,c.addEvent)(r,"afterGetBBox",function(t){var e,i=t.bBox,o=null==(e=this.element)?void 0:e.querySelector("textPath");if(o){for(var s=[],r=this.renderer.fontMetrics(this.element),n=r.b,a=r.h-n,h=RegExp('(<tspan>|<tspan(?!\\sclass="highcharts-br")[^>]*>|<\\/tspan>)',"g"),p=o.innerHTML.replace(h,"").split(/<tspan class="highcharts-br"[^>]*>/),d=p.length,l=function(t,e){var i=e.x,s=e.y,r=(o.getRotationOfChar(t)-90)*W,h=Math.cos(r),p=Math.sin(r);return[[i-a*h,s-a*p],[i+n*h,s+n*p]]},c=0,u=0;u<d;u++){for(var f=p[u].length,y=0;y<f;y+=5)try{var m=c+y+u,g=l(m,o.getStartPositionOfChar(m)),v=g[0],b=g[1];0===y?(s.push(b),s.push(v)):(0===u&&s.unshift(b),u===d-1&&s.push(v))}catch(t){break}c+=f-1;try{var m=c+u,x=o.getEndPositionOfChar(m),k=l(m,x),v=k[0],b=k[1];s.unshift(b),s.unshift(v)}catch(t){break}}s.length&&s.push(s[0].slice()),i.polygon=s}return i}),(0,c.addEvent)(r,"beforeAddingDataLabel",function(t){var e,i=t.labelOptions,o=t.point,s=i[o.formatPrefix+"TextPath"]||i.textPath;s&&!i.useHTML&&(this.setTextPath((null==(e=o.getDataLabelPath)?void 0:e.call(o,this))||o.graphic,s),o.dataLabelPath&&!s.enabled&&(o.dataLabelPath=o.dataLabelPath.destroy()))}),r.prototype.setTextPath=null!=(n=r.prototype.setTextPath)?n:function(t,e){var i=this,o=this.renderer.url,s=this.text||this,r=s.textPath,n=(0,c.merge)({enabled:!0,attributes:{dy:-5,startOffset:"50%",textAnchor:"middle"}},e),a=n.attributes,h=n.enabled;if(t=t||r&&r.path,null==r||r.undo(),t&&h){var p=(0,c.addEvent)(s,"afterModifyTree",function(e){if(t&&h){var r=t.attr("id");r||t.attr("id",r=(0,c.uniqueKey)());var n={x:0,y:0};(0,c.defined)(a.dx)&&(n.dx=a.dx,delete a.dx),(0,c.defined)(a.dy)&&(n.dy=a.dy,delete a.dy),s.attr(n),i.attr({transform:""}),i.box&&(i.box=i.box.destroy());var p=e.nodes.slice(0);e.nodes.length=0,e.nodes[0]={tagName:"textPath",attributes:(0,c.extend)(a,{"text-anchor":a.textAnchor,href:""+o+"#".concat(r)}),children:p}}});s.textPath={path:t,undo:p}}else s.attr({dx:0,dy:0}),delete s.textPath;return this.added&&(s.textCache="",this.renderer.buildText(s)),this});var tr=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.deferDataLabels=!0,e}return J(e,t),e.compose=function(t){v.compose(t),K.compose(t)},e.prototype.deferLayout=function(){var t,e=this.options.layoutAlgorithm,i=this.chart.options.chart,o=this.chart.graphLayoutsStorage,s=this.chart.graphLayoutsLookup;this.visible&&(o||(this.chart.graphLayoutsStorage=o={},this.chart.graphLayoutsLookup=s=[]),(t=o[e.type])||(e.enableSimulation=(0,c.defined)(i.forExport)?!i.forExport:e.enableSimulation,o[e.type]=t=new E[e.type],t.init(e),s.splice(t.index,0,t)),this.layout=t,t.setArea(0,0,this.chart.plotWidth,this.chart.plotHeight),t.addElementsToCollection([this],t.series),t.addElementsToCollection(this.nodes,t.nodes),t.addElementsToCollection(this.points,t.links))},e.prototype.destroy=function(){this.layout&&this.layout.removeElementFromCollection(this,this.layout.series),F.destroy.call(this)},e.prototype.drawDataLabels=function(){if(!this.deferDataLabels){var t,e=this.options.dataLabels;(null==e?void 0:e.textPath)&&(t=e.textPath),$.prototype.drawDataLabels.call(this,this.nodes),(null==e?void 0:e.linkTextPath)&&(e.textPath=e.linkTextPath),$.prototype.drawDataLabels.call(this,this.data),(null==e?void 0:e.textPath)&&(e.textPath=t)}},e.prototype.generatePoints=function(){var t,e;for(F.generatePoints.apply(this,arguments),this.options.nodes&&this.options.nodes.forEach(function(t){this.nodeLookup[t.id]||(this.nodeLookup[t.id]=this.createNode(t.id))},this),e=this.nodes.length-1;e>=0;e--)(t=this.nodes[e]).degree=t.getDegree(),t.radius=(0,c.pick)(t.marker&&t.marker.radius,this.options.marker&&this.options.marker.radius,0),t.key=t.name,this.nodeLookup[t.id]||t.remove();this.data.forEach(function(t){t.formatPrefix="link"}),this.indexateNodes()},e.prototype.getPointsCollection=function(){return this.nodes||[]},e.prototype.indexateNodes=function(){this.nodes.forEach(function(t,e){t.index=e})},e.prototype.init=function(e,i){var o=this;return t.prototype.init.call(this,e,i),ts.call(this),(0,c.addEvent)(this,"updatedData",function(){o.layout&&o.layout.stop()}),(0,c.addEvent)(this,"afterUpdate",function(){o.nodes.forEach(function(t){t&&t.series&&t.resolveColor()})}),(0,c.addEvent)(this,"afterSimulation",function(){this.deferDataLabels=!1,this.drawDataLabels()}),this},e.prototype.markerAttribs=function(t,e){var i=$.prototype.markerAttribs.call(this,t,e);return(0,c.defined)(t.plotY)||(i.y=0),i.x=(t.plotX||0)-(i.width||0)/2,i},e.prototype.pointAttribs=function(t,e){var i=e||t&&t.state||"normal",o=this.options.states[i],s=$.prototype.pointAttribs.call(this,t,i);return t&&!t.isNode&&(s=t.getLinkAttributes(),o&&(s={stroke:o.linkColor||s.stroke,dashstyle:o.linkDashStyle||s.dashstyle,opacity:(0,c.pick)(o.linkOpacity,s.opacity),"stroke-width":o.linkColor||s["stroke-width"]})),s},e.prototype.render=function(){var t=this.points,e=this.chart.hoverPoint,i=[];this.points=this.nodes,ti.render.call(this),this.points=t,t.forEach(function(t){t.fromNode&&t.toNode&&(t.renderLink(),t.redrawLink())}),e&&e.series===this&&this.redrawHalo(e),this.chart.hasRendered&&!this.options.dataLabels.allowOverlap&&(this.nodes.concat(this.points).forEach(function(t){t.dataLabel&&i.push(t.dataLabel)}),this.chart.hideOverlappingLabels(i))},e.prototype.setState=function(t,e){e?(this.points=this.nodes.concat(this.data),$.prototype.setState.apply(this,arguments),this.points=this.data):$.prototype.setState.apply(this,arguments),this.layout.simulation||t||this.render()},e.prototype.translate=function(){this.generatePoints(),this.deferLayout(),this.nodes.forEach(function(t){t.isInside=!0,t.linksFrom.forEach(function(t){t.shapeType="path",t.y=1})})},e.defaultOptions=(0,c.merge)($.defaultOptions,R),e}($);(0,c.extend)(tr.prototype,{pointClass:_,animate:void 0,directTouch:!0,drawGraph:void 0,forces:["barycenter","repulsive","attractive"],hasDraggableNodes:!0,isCartesian:!1,noSharedTooltip:!0,pointArrayMap:["from","to"],requireSorting:!1,trackerGroups:["group","markerGroup","dataLabelsGroup"],initDataLabels:to,buildKDTree:Z,createNode:F.createNode,drawTracker:te.drawTracker,onMouseDown:v.onMouseDown,onMouseMove:v.onMouseMove,onMouseUp:v.onMouseUp,redrawHalo:v.redrawHalo}),T().registerSeriesType("networkgraph",tr);var tn=u();tr.compose(tn.Chart);var ta=u();return l.default}()});