!/**
 * Highcharts JS v12.5.0 (2026-01-12)
 * @module highcharts/modules/sankey
 * @requires highcharts
 *
 * Sankey diagram module
 *
 * (c) 2010-2026 Highsoft AS
 * Author: Torstein Honsi
 *
 * A commercial license may be required depending on use.
 * See www.highcharts.com/license
 */function(t,o){"object"==typeof exports&&"object"==typeof module?module.exports=o(require("highcharts"),require("highcharts").SeriesRegistry,require("highcharts").Point,require("highcharts").Color,require("highcharts").SVGElement):"function"==typeof define&&define.amd?define("highcharts/modules/sankey",[["highcharts/highcharts"],["highcharts/highcharts","SeriesRegistry"],["highcharts/highcharts","Point"],["highcharts/highcharts","Color"],["highcharts/highcharts","SVGElement"]],o):"object"==typeof exports?exports["highcharts/modules/sankey"]=o(require("highcharts"),require("highcharts").SeriesRegistry,require("highcharts").Point,require("highcharts").Color,require("highcharts").SVGElement):t.Highcharts=o(t.Highcharts,t.Highcharts.SeriesRegistry,t.Highcharts.Point,t.Highcharts.Color,t.Highcharts.SVGElement)}(this,function(t,o,e,n,i){return function(){"use strict";var r,s,a,h,l,d,p={28:function(t){t.exports=i},260:function(t){t.exports=e},512:function(t){t.exports=o},620:function(t){t.exports=n},944:function(o){o.exports=t}},c={};function u(t){var o=c[t];if(void 0!==o)return o.exports;var e=c[t]={exports:{}};return p[t](e,e.exports,u),e.exports}u.n=function(t){var o=t&&t.__esModule?function(){return t.default}:function(){return t};return u.d(o,{a:o}),o},u.d=function(t,o){for(var e in o)u.o(o,e)&&!u.o(t,e)&&Object.defineProperty(t,e,{enumerable:!0,get:o[e]})},u.o=function(t,o){return Object.prototype.hasOwnProperty.call(t,o)};var f={};u.d(f,{default:function(){return tk}});var g=u(944),m=u.n(g),y=u(512),v=u.n(y),b=v().series,x=b.prototype,k=b.prototype.pointClass.prototype,P=m().defined,C=m().extend,N=m().find,S=m().merge,L=m().pick;!function(t){function o(){return this.data=[].concat(this.points||[],this.nodes),x.destroy.apply(this,arguments)}function e(){this.nodes&&(this.nodes.forEach(function(t){t.destroy()}),this.nodes.length=0),x.setData.apply(this,arguments)}function n(t){var o=arguments,e=this.isNode?this.linksTo.concat(this.linksFrom):[this.fromNode,this.toNode];"select"!==t&&e.forEach(function(t){t&&t.series&&(k.setState.apply(t,o),!t.isNode&&(t.fromNode.graphic&&k.setState.apply(t.fromNode,o),t.toNode&&t.toNode.graphic&&k.setState.apply(t.toNode,o)))}),k.setState.apply(this,o)}function i(t,o,e,n){var i=this,r=this.series.options.nodes,s=this.series.options.data,a=(null==s?void 0:s.length)||0,h=null==s?void 0:s[this.index];if(k.update.call(this,t,!this.isNode&&o,e,n),this.isNode){var l=(r||[]).reduce(function(t,o,e){return i.id===o.id?e:t},-1),d=S(r&&r[l]||{},(null==s?void 0:s[this.index])||{});s&&(h?s[this.index]=h:s.length=a),r?l>=0?r[l]=d:r.push(d):this.series.options.nodes=[d],L(o,!0)&&this.series.chart.redraw(e)}}t.compose=function(t,r){var s=t.prototype,a=r.prototype;return s.setNodeState=n,s.setState=n,s.update=i,a.destroy=o,a.setData=e,r},t.createNode=function(t){var o,e=this.pointClass,n=function(t,o){return N(t,function(t){return t.id===o})},i=n(this.nodes,t);if(!i){o=this.options.nodes&&n(this.options.nodes,t);var r=new e(this,C({className:"highcharts-node",isNode:!0,id:t,y:1},o));r.linksTo=[],r.linksFrom=[],r.getSum=function(){var t=0,o=0;return r.linksTo.forEach(function(o){t+=o.weight||0}),r.linksFrom.forEach(function(t){o+=t.weight||0}),Math.max(t,o)},r.offset=function(t,o){for(var e=0,n=0;n<r[o].length;n++){if(r[o][n]===t)return e;e+=r[o][n].weight}},r.hasShape=function(){var t=0;return r.linksTo.forEach(function(o){o.outgoing&&t++}),!r.linksTo.length||t!==r.linksTo.length},r.index=this.nodes.push(r)-1,i=r}return i.formatPrefix="node",i.name=i.name||i.options.id||"",i.mass=L(i.options.mass,i.options.marker&&i.options.marker.radius,this.options.marker&&this.options.marker.radius,4),i},t.destroy=o,t.generatePoints=function(){var t=this,o=this.chart,e={};x.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(n){P(n.from)&&(e[n.from]||(e[n.from]=t.createNode(n.from)),e[n.from].linksFrom.push(n),n.fromNode=e[n.from],o.styledMode?n.colorIndex=L(n.options.colorIndex,e[n.from].colorIndex):n.color=n.options.color||e[n.from].color),P(n.to)&&(e[n.to]||(e[n.to]=t.createNode(n.to)),e[n.to].linksTo.push(n),n.toNode=e[n.to]),n.name=n.name||n.id},this),this.nodeLookup=e},t.setNodeState=n,t.updateNode=i}(l||(l={}));var O=l,T=u(260),w=u.n(T),M=(r=function(t,o){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,o){t.__proto__=o}||function(t,o){for(var e in o)o.hasOwnProperty(e)&&(t[e]=o[e])})(t,o)},function(t,o){function e(){this.constructor=t}r(t,o),t.prototype=null===o?Object.create(o):(e.prototype=o.prototype,new e)}),F=v().seriesTypes.column,W=m().defined,z=function(t){function o(){return null!==t&&t.apply(this,arguments)||this}return M(o,t),o.prototype.applyOptions=function(t,o){return w().prototype.applyOptions.call(this,t,o),W(this.options.level)&&(this.options.column=this.column=this.options.level),this},o.prototype.getClassName=function(){return(this.isNode?"highcharts-node ":"highcharts-link ")+w().prototype.getClassName.call(this)},o.prototype.getFromNode=function(){for(var t,o=-1,e=0;e<this.linksTo.length;e++){var n=this.linksTo[e];n.fromNode.column>o&&n.fromNode!==this&&(o=(t=n.fromNode).column)}return{fromNode:t,fromColumn:o}},o.prototype.setNodeColumn=function(){W(this.options.column)||(0===this.linksTo.length?this.column=0:this.column=this.getFromNode().fromColumn+1)},o.prototype.isValid=function(){return this.isNode||"number"==typeof this.weight},o}(F.prototype.pointClass),_={borderWidth:0,colorByPoint:!0,curveFactor:.33,dataLabels:{enabled:!0,backgroundColor:"none",crop:!1,nodeFormat:void 0,nodeFormatter:function(){return this.point.name},format:void 0,formatter:function(){},inside:!0},inactiveOtherPoints:!0,linkColorMode:"from",linkOpacity:.5,opacity:1,minLinkWidth:0,nodeAlignment:"center",nodeWidth:20,nodePadding:10,nodeDistance:30,showInLegend:!1,states:{hover:{linkOpacity:1,opacity:1},inactive:{linkOpacity:.1,opacity:.1,animation:{duration:50}}},tooltip:{followPointer:!0,headerFormat:'<span style="font-size: 0.8em">{series.name}</span><br/>',pointFormat:"{point.fromNode.name} → {point.toNode.name}: <b>{point.weight}</b><br/>",nodeFormat:"{point.name}: <b>{point.sum}</b><br/>"}},A=m().defined,D=m().getAlignFactor,j=m().relativeLength;(s=d||(d={})).compose=function(t,o){return t.sankeyColumn=new a(t,o),t},s.SankeyColumnAdditions=a=function(){function t(t,o){this.points=t,this.series=o}return t.prototype.getTranslationFactor=function(t){for(var o,e,n=this.points,i=n.slice(),r=t.chart,s=t.options.minLinkWidth||0,a=0,h=(r.plotSizeY||0)-(t.options.borderWidth||0)-(n.length-1)*t.nodePadding;n.length;){for(a=h/n.sankeyColumn.sum(),o=!1,e=n.length;e--;)n[e].getSum()*a<s&&(n.splice(e,1),h=Math.max(0,h-s),o=!0);if(!o)break}n.length=0;for(var l=0;l<i.length;l++){var d=i[l];n.push(d)}return a},t.prototype.top=function(t){var o=this.series,e=o.nodePadding,n=this.points.reduce(function(n,i){return n>0&&(n+=e),n+=Math.max(i.getSum()*t,o.options.minLinkWidth||0)},0);return D(o.options.nodeAlignment||"center")*((o.chart.plotSizeY||0)-n)},t.prototype.left=function(t){var o=this.series,e=o.chart,n=o.options.equalNodes,i=e.inverted?e.plotHeight:e.plotWidth,r=o.nodePadding,s=this.points.reduce(function(e,s){return e>0&&(e+=r),e+=n?i/s.series.nodes.length-r:Math.max(s.getSum()*t,o.options.minLinkWidth||0)},0);return((e.plotSizeX||0)-Math.round(s))/2},t.prototype.sum=function(){return this.points.reduce(function(t,o){return t+o.getSum()},0)},t.prototype.offset=function(t,o){var e,n=this.points,i=this.series,r=i.nodePadding,s=0;if(i.is("organization")&&t.hangsFrom)return{absoluteTop:t.hangsFrom.nodeY};for(var a=0;a<n.length;a++){var h=n[a].getSum(),l=Math.max(h*o,i.options.minLinkWidth||0),d=t.options[i.chart.inverted?"offsetHorizontal":"offsetVertical"],p=t.options.offset||0;if(e=h?l+r:0,n[a]===t)return{relativeTop:s+(A(d)?j(d,l):j(p,e))};s+=e}},t}();var E=d,Y=u(620),B=u.n(Y),q=(m().extend,m().isArray),H=m().isNumber,I=m().isObject,X=m().merge,R=m().pick,V=m().relativeLength,G=function(t){var o,e,n,i,r,s,a={};if(I(t))for(i=H(t.from)?t.from:1,s=t.levels,e={},o=I(t.defaults)?t.defaults:{},q(s)&&(e=s.reduce(function(t,e){var n,r,s;return I(e)&&H(e.level)&&(r=R((s=X({},e)).levelIsConstant,o.levelIsConstant),delete s.levelIsConstant,delete s.level,I(t[n=e.level+(r?0:i-1)])?X(!0,t[n],s):t[n]=s),t},{})),r=H(t.to)?t.to:1,n=0;n<=r;n++)a[n]=X({},o,I(e[n])?e[n]:{});return a},Z=function(t,o){var e=t.chart,n=t.options,i=n.nodeDistance,r=void 0===i?0:i,s=n.nodeWidth,a=void 0===s?0:s,h=e.plotSizeX,l=void 0===h?1:h;if("auto"===a){if("string"==typeof r&&/%$/.test(r))return l/(o+parseFloat(r)/100*(o-1));var d=Number(r);return(l+d)/(o||1)-d}return V(a,l)},K=u(28),$=u.n(K),J=m().deg2rad,Q=m().addEvent,U=m().merge,tt=m().uniqueKey,to=m().defined,te=m().extend;function tn(t,o){var e=this;o=U(!0,{enabled:!0,attributes:{dy:-5,startOffset:"50%",textAnchor:"middle"}},o);var n=this.renderer.url,i=this.text||this,r=i.textPath,s=o.attributes,a=o.enabled;if(t=t||r&&r.path,r&&r.undo(),t&&a){var h=Q(i,"afterModifyTree",function(o){if(t&&a){var r=t.attr("id");r||t.attr("id",r=tt());var h={x:0,y:0};to(s.dx)&&(h.dx=s.dx,delete s.dx),to(s.dy)&&(h.dy=s.dy,delete s.dy),i.attr(h),e.attr({transform:""}),e.box&&(e.box=e.box.destroy());var l=o.nodes.slice(0);o.nodes.length=0,o.nodes[0]={tagName:"textPath",attributes:te(s,{"text-anchor":s.textAnchor,href:""+n+"#".concat(r)}),children:l}}});i.textPath={path:t,undo:h}}else i.attr({dx:0,dy:0}),delete i.textPath;return this.added&&(i.textCache="",this.renderer.buildText(i)),this}function ti(t){var o,e=t.bBox,n=null==(o=this.element)?void 0:o.querySelector("textPath");if(n){for(var i=[],r=this.renderer.fontMetrics(this.element),s=r.b,a=r.h-s,h=RegExp('(<tspan>|<tspan(?!\\sclass="highcharts-br")[^>]*>|<\\/tspan>)',"g"),l=n.innerHTML.replace(h,"").split(/<tspan class="highcharts-br"[^>]*>/),d=l.length,p=function(t,o){var e=o.x,i=o.y,r=(n.getRotationOfChar(t)-90)*J,h=Math.cos(r),l=Math.sin(r);return[[e-a*h,i-a*l],[e+s*h,i+s*l]]},c=0,u=0;u<d;u++){for(var f=l[u].length,g=0;g<f;g+=5)try{var m=c+g+u,y=p(m,n.getStartPositionOfChar(m)),v=y[0],b=y[1];0===g?(i.push(b),i.push(v)):(0===u&&i.unshift(b),u===d-1&&i.push(v))}catch(t){break}c+=f-1;try{var m=c+u,x=n.getEndPositionOfChar(m),k=p(m,x),v=k[0],b=k[1];i.unshift(b),i.unshift(v)}catch(t){break}}i.length&&i.push(i[0].slice()),e.polygon=i}return e}function tr(t){var o,e=t.labelOptions,n=t.point,i=e[n.formatPrefix+"TextPath"]||e.textPath;i&&!e.useHTML&&(this.setTextPath((null==(o=n.getDataLabelPath)?void 0:o.call(n,this))||n.graphic,i),n.dataLabelPath&&!i.enabled&&(n.dataLabelPath=n.dataLabelPath.destroy()))}var ts=(h=function(t,o){return(h=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,o){t.__proto__=o}||function(t,o){for(var e in o)Object.prototype.hasOwnProperty.call(o,e)&&(t[e]=o[e])})(t,o)},function(t,o){if("function"!=typeof o&&null!==o)throw TypeError("Class extends value "+String(o)+" is not a constructor or null");function e(){this.constructor=t}h(t,o),t.prototype=null===o?Object.create(o):(e.prototype=o.prototype,new e)}),ta=function(){return(ta=Object.assign||function(t){for(var o,e=1,n=arguments.length;e<n;e++)for(var i in o=arguments[e])Object.prototype.hasOwnProperty.call(o,i)&&(t[i]=o[i]);return t}).apply(this,arguments)},th=v().seriesTypes,tl=th.column,td=th.line,tp=B().parse,tc=m().clamp,tu=m().crisp,tf=m().extend,tg=m().isObject,tm=m().merge,ty=m().pick,tv=m().relativeLength,tb=m().stableSort;({compose:function(t){Q(t,"afterGetBBox",ti),Q(t,"beforeAddingDataLabel",tr);var o=t.prototype;o.setTextPath||(o.setTextPath=tn)}}).compose($());var tx=function(t){function o(){return null!==t&&t.apply(this,arguments)||this}return ts(o,t),o.getDLOptions=function(t){var o=tg(t.optionsPoint)?t.optionsPoint.dataLabels:{},e=tg(t.level)?t.level.dataLabels:{};return tm({style:{}},e,o,{zIndex:null==e?void 0:e.zIndex})},o.prototype.createNodeColumns=function(){for(var t=[],o=0,e=this.nodes;o<e.length;o++){var n=e[o];n.setNodeColumn(),t[n.column]||(t[n.column]=E.compose([],this)),t[n.column].push(n)}for(var i=0;i<t.length;i++)void 0===t[i]&&(t[i]=E.compose([],this));return t},o.prototype.order=function(t,o){if(void 0===t.level){t.level=o;for(var e=0,n=t.linksFrom;e<n.length;e++){var i=n[e];i.toNode&&this.order(i.toNode,o+1)}}},o.prototype.generatePoints=function(){if(O.generatePoints.apply(this,arguments),this.orderNodes){for(var t=0,o=this.nodes;t<o.length;t++){var e=o[t];0===e.linksTo.length&&this.order(e,0)}tb(this.nodes,function(t,o){return t.level-o.level})}},o.prototype.getNodePadding=function(){var t=this.options.nodePadding||0;if(this.nodeColumns){var o=this.nodeColumns.reduce(function(t,o){return Math.max(t,o.length)},0);o*t>this.chart.plotSizeY&&(t=this.chart.plotSizeY/o)}return t},o.prototype.hasData=function(){return!!this.dataTable.rowCount},o.prototype.pointAttribs=function(t,o){if(!t)return{};var e=this,n=t.isNode?t.level:t.fromNode.level,i=e.mapOptionsToLevel[n||0]||{},r=t.options,s=i.states&&i.states[o||""]||{},a=["colorByPoint","borderColor","borderWidth","linkOpacity","opacity"].reduce(function(t,o){return t[o]=ty(s[o],r[o],i[o],e.options[o]),t},{}),h=ty(s.color,r.color,a.colorByPoint?t.color:i.color);return t.isNode?{fill:h,stroke:a.borderColor,"stroke-width":a.borderWidth,opacity:a.opacity}:{fill:h,"fill-opacity":a.linkOpacity}},o.prototype.drawTracker=function(){tl.prototype.drawTracker.call(this,this.points),tl.prototype.drawTracker.call(this,this.nodes)},o.prototype.drawPoints=function(){tl.prototype.drawPoints.call(this,this.points),tl.prototype.drawPoints.call(this,this.nodes)},o.prototype.drawDataLabels=function(){tl.prototype.drawDataLabels.call(this,this.points),tl.prototype.drawDataLabels.call(this,this.nodes)},o.prototype.translate=function(){this.generatePoints(),this.nodeColumns=this.createNodeColumns();var t=this,o=this.chart,e=this.options,n=this.nodeColumns,i=n.length;this.nodeWidth=Z(this,i),this.nodePadding=this.getNodePadding(),this.translationFactor=n.reduce(function(o,e){return Math.min(o,e.sankeyColumn.getTranslationFactor(t))},1/0),this.colDistance=(o.plotSizeX-this.nodeWidth-e.borderWidth)/Math.max(1,n.length-1),t.mapOptionsToLevel=G({from:1,levels:e.levels,to:n.length-1,defaults:{borderColor:e.borderColor,borderRadius:e.borderRadius,borderWidth:e.borderWidth,color:t.color,colorByPoint:e.colorByPoint,levelIsConstant:!0,linkColor:e.linkColor,linkLineWidth:e.linkLineWidth,linkOpacity:e.linkOpacity,states:e.states}});for(var r=0;r<n.length;r++)for(var s=n[r],a=0;a<s.length;a++){var h=s[a];t.translateNode(h,s)}for(var l=0,d=this.nodes;l<d.length;l++)for(var h=d[l],p=0,c=h.linksFrom;p<c.length;p++){var u=c[p];(u.weight||u.isNull)&&u.to&&(t.translateLink(u),u.allowShadow=!1)}},o.prototype.translateLink=function(t){var o=function(o,e){var n=o.offset(t,e)*s;return Math.min(o.nodeY+n,o.nodeY+(o.shapeArgs&&o.shapeArgs.height||0)-u)},e=t.fromNode,n=t.toNode,i=this.chart,r=i.inverted,s=this.translationFactor,a=this.options,h=ty(t.linkColorMode,a.linkColorMode),l=(i.inverted?-this.colDistance:this.colDistance)*a.curveFactor,d=e.nodeX,p=n.nodeX,c=t.outgoing,u=Math.max(t.weight*s,this.options.minLinkWidth),f=o(e,"linksFrom"),g=o(n,"linksTo"),m=this.nodeWidth,y=p>d+m;if(i.inverted&&(f=i.plotSizeY-f,g=(i.plotSizeY||0)-g,m=-m,u=-u,y=d>p),t.shapeType="path",t.linkBase=[f,f+u,g,g+u],y&&"number"==typeof g)t.shapeArgs={d:[["M",d+m,f],["C",d+m+l,f,p-l,g,p,g],["L",p+(c?m:0),g+u/2],["L",p,g+u],["C",p-l,g+u,d+m+l,f+u,d+m,f+u],["Z"]]};else if("number"==typeof g){var v=i.plotHeight-f-u,b=p-20-u,x=p-20,k=d+m,P=k+20,C=P+u,N=f,S=f+u,L=S+20,O=L+v,T=O+20,w=T+u,M=g,F=M+u,W=F+20,z=S-.7*u,_=T+.7*u,A=F-.7*u,D=p-.7*u,j=k+.7*u;t.shapeArgs={d:[["M",k,N],["C",j,N,C,z,C,L],["L",C,O],["C",C,_,j,w,k,w],["L",p,w],["C",D,w,b,_,b,O],["L",b,W],["C",b,A,D,M,p,M],["L",p,F],["C",x,F,x,F,x,W],["L",x,O],["C",x,T,x,T,p,T],["L",k,T],["C",P,T,P,T,P,O],["L",P,L],["C",P,S,P,S,k,S],["Z"]]}}if(t.dlBox={x:d+(p-d+m)/2,y:f+(g-f)/2,height:u,width:0},t.tooltipPos=i.inverted?[i.plotSizeY-t.dlBox.y-u/2,i.plotSizeX-t.dlBox.x]:[t.dlBox.x,t.dlBox.y+u/2],t.y=t.plotY=1,t.x=t.plotX=1,!t.options.color){if("from"===h)t.color=e.color;else if("to"===h)t.color=n.color;else if("gradient"===h){var E=tp(e.color).get(),Y=tp(n.color).get();t.color={linearGradient:{x1:1,x2:0,y1:0,y2:0},stops:[[0,r?E:Y],[1,r?Y:E]]}}}},o.prototype.translateNode=function(t,e){var n=this.translationFactor,i=this.chart,r=this.options,s=r.borderRadius,a=r.borderWidth,h=void 0===a?0:a,l=t.getSum(),d=Math.max(Math.round(l*n),this.options.minLinkWidth),p=Math.round(this.nodeWidth),c=e.sankeyColumn.offset(t,n),u=tu(ty(c.absoluteTop,e.sankeyColumn.top(n)+c.relativeTop),h),f=tu(this.colDistance*t.column+h/2,h)+tv(t.options[i.inverted?"offsetVertical":"offsetHorizontal"]||0,p),g=i.inverted?i.plotSizeX-f:f;if(t.sum=l,l){t.shapeType="roundedRect",t.nodeX=g,t.nodeY=u;var m=g,y=u,v=t.options.width||r.width||p,b=t.options.height||r.height||d,x=tc(tv("object"==typeof s?s.radius:s||0,v),0,d/2);i.inverted&&(m=g-p,y=i.plotSizeY-u-d,v=t.options.height||r.height||p,b=t.options.width||r.width||d),t.dlOptions=ta(ta({},o.getDLOptions({level:this.mapOptionsToLevel[t.level],optionsPoint:t.options})),{zIndex:void 0}),t.plotX=1,t.plotY=1,t.tooltipPos=i.inverted?[i.plotSizeY-y-b/2,i.plotSizeX-m-v/2]:[m+v/2,y+b/2],t.shapeArgs={x:m,y:y,width:v,height:b,r:x,display:t.hasShape()?"":"none"}}else t.dlOptions={enabled:!1}},o.defaultOptions=tm(tl.defaultOptions,_),o}(tl);O.compose(z,tx),tf(tx.prototype,{animate:td.prototype.animate,createNode:O.createNode,forceDL:!0,invertible:!0,isCartesian:!1,orderNodes:!0,noSharedTooltip:!0,pointArrayMap:["from","to","weight"],pointClass:z,searchPoint:m().noop}),v().registerSeriesType("sankey",tx);var tk=m();return f.default}()});