!/**
 * Highcharts JS v13.0.0 (2026-06-11)
 * @module highcharts/modules/series-label
 * @requires highcharts
 *
 * (c) 2009-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.Templating):"function"==typeof define&&define.amd?define("highcharts/modules/series-label",["highcharts/highcharts"],function(t){return e(t,t.Templating)}):"object"==typeof exports?exports["highcharts/modules/series-label"]=e(t._Highcharts,t._Highcharts.Templating):t.Highcharts=e(t.Highcharts,t.Highcharts.Templating)}("u"<typeof window?this:window,function(t,e){return function(){"use strict";var r={944:function(e){e.exports=t},984:function(t){t.exports=e}},o={};function a(t){var e=o[t];if(void 0!==e)return e.exports;var i=o[t]={exports:{}};return r[t](i,i.exports,a),i.exports}a.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return a.d(e,{a:e}),e},a.d=function(t,e){for(var r in e)a.o(e,r)&&!a.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},a.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)};var i={};a.d(i,{default:function(){return Y}});var n=a(944),h=a.n(n),s=a(984),l=a.n(s),c={enabled:!0,connectorAllowed:!1,connectorNeighbourDistance:24,format:void 0,formatter:void 0,minFontSize:null,maxFontSize:null,onArea:null,style:{fontSize:"0.8em",fontWeight:"bold"},useHTML:!1,boxesToAvoid:[]};function p(t,e,r,o,a,i){var n=(i-e)*(r-t)-(o-e)*(a-t);return n>0||!(n<0)}function u(t,e,r,o,a,i,n,h){return p(t,e,a,i,n,h)!==p(r,o,a,i,n,h)&&p(t,e,r,o,a,i)!==p(t,e,r,o,n,h)}var d=function(t,e,r){if(r||2==arguments.length)for(var o,a=0,i=e.length;a<i;a++)!o&&a in e||(o||(o=Array.prototype.slice.call(e,0,a)),o[a]=e[a]);return t.concat(o||Array.prototype.slice.call(e))},f=h().animObject,x=l().format,g=h().setOptions,b=h().composed,m=function(t,e,r,o,a,i,n,h){return u(t,e,t+r,e,a,i,n,h)||u(t+r,e,t+r,e+o,a,i,n,h)||u(t,e+o,t+r,e+o,a,i,n,h)||u(t,e,t,e+o,a,i,n,h)};function v(t,e,r,o,a){var i,h,s,l,c,p,u,f,x,g=t.chart,b=t.options.label||{},v=(0,n.pick)(b.onArea,!!t.area),y=v||b.connectorAllowed,X=g.boxesToAvoid,w=Number.MAX_VALUE,Y=Number.MAX_VALUE;for(f=0;X&&f<X.length;f+=1){if(i=X[f],!((h={left:e,right:e+o.width,top:r,bottom:r+o.height}).left>i.right||h.right<i.left||h.top>i.bottom||h.bottom<i.top))return!1}for(f=0;f<g.series.length;f+=1){var M=g.series[f],A=M.interpolatedPoints&&d([],M.interpolatedPoints,!0);if(M.visible&&A){for(var S=g.plotHeight/10,T=g.plotTop;T<=g.plotTop+g.plotHeight;T+=S)A.unshift({chartX:g.plotLeft,chartY:T}),A.push({chartX:g.plotLeft+g.plotWidth,chartY:T});for(x=1;x<A.length;x+=1){if(A[x].chartX>=e-16&&A[x-1].chartX<=e+o.width+16){if(m(e,r,o.width,o.height,A[x-1].chartX,A[x-1].chartY,A[x].chartX,A[x].chartY))return!1;t===M&&!c&&a&&(c=m(e-16,r-16,o.width+32,o.height+32,A[x-1].chartX,A[x-1].chartY,A[x].chartX,A[x].chartY))}(y||c)&&(t!==M||v)&&(w=Math.min(w,(p=e+o.width/2-A[x].chartX)*p+(u=r+o.height/2-A[x].chartY)*u))}if(!v&&y&&t===M&&(a&&!c||w<Math.pow(b.connectorNeighbourDistance||1,2))){for(x=1;x<A.length;x+=1)(s=Math.min(Math.pow(e+o.width/2-A[x].chartX,2)+Math.pow(r+o.height/2-A[x].chartY,2),Math.pow(e-A[x].chartX,2)+Math.pow(r-A[x].chartY,2),Math.pow(e+o.width-A[x].chartX,2)+Math.pow(r-A[x].chartY,2),Math.pow(e+o.width-A[x].chartX,2)+Math.pow(r+o.height-A[x].chartY,2),Math.pow(e-A[x].chartX,2)+Math.pow(r+o.height-A[x].chartY,2)))<Y&&(Y=s,l=A[x]);c=!0}}}return(!a||!!c)&&{x:e,y:r,weight:w-(l?Y:0),connectorPoint:l}}function y(t){if(this.renderer){var e=this,r=f(e.renderer.globalAnimation).duration;e.labelSeries=[],e.labelSeriesMaxSum=0,e.seriesLabelTimer&&(0,n.internalClearTimeout)(e.seriesLabelTimer),e.series.forEach(function(o){var a=o.options.label||{},i=o.labelBySeries,n=i&&i.closest,h=o.getColumn("y");a.enabled&&o.visible&&(o.graph||o.area)&&!o.boosted&&e.labelSeries&&(e.labelSeries.push(o),a.minFontSize&&a.maxFontSize&&h.length&&(o.sum=h.reduce(function(t,e){return(t||0)+(e||0)},0),e.labelSeriesMaxSum=Math.max(e.labelSeriesMaxSum||0,o.sum||0)),"load"===t.type&&(r=Math.max(r,f(o.options.animation).duration)),n&&(void 0!==n[0].plotX?i.animate({x:n[0].plotX+n[1],y:n[0].plotY+n[2]}):i.attr({opacity:0})))}),e.seriesLabelTimer=(0,n.syncTimeout)(function(){var t,r;e.series&&e.labelSeries&&(e.boxesToAvoid=[],t=e.labelSeries||[],r=e.boxesToAvoid,e.series.forEach(function(t){return(t.points||[]).forEach(function(e){return(e.dataLabels||[]).forEach(function(e){var o=e.getBBox(),a=o.width,i=o.height,n=(e.translateX||0)+(t.xAxis?t.xAxis.pos:t.chart.plotLeft),h=(e.translateY||0)+(t.yAxis?t.yAxis.pos:t.chart.plotTop);r.push({left:n,top:h,right:n+a,bottom:h+i})})})}),t.forEach(function(t){var e=t.options.label||{};t.interpolatedPoints=function(t){if(t.xAxis||t.yAxis){var e,r,o,a,i,h,s=t.points,l=[],c=t.graph||t.area,p=c&&c.element,u=t.chart.inverted,d=t.xAxis,f=t.yAxis,x=u?f.pos:d.pos,g=u?d.pos:f.pos,b=u?d.len:f.len,m=u?f.len:d.len,v=t.options.label||{},y=(0,n.pick)(v.onArea,!!t.area),X=f.getThreshold(t.options.threshold),w={},Y=u?"chartCenterX":"chartCenterY";if(t.getPointSpline&&p&&p.getPointAtLength&&!y&&s.length<(t.chart.plotSizeX||0)/16){var M=c.toD&&c.attr("d");for(c.toD&&c.attr({d:c.toD}),a=p.getTotalLength(),r=0;r<a;r+=16){var A=p.getPointAtLength(r),S=u?m-A.y:A.x,T=u?b-A.x:A.y;k({chartX:x+S,chartY:g+T,plotX:S,plotY:T})}M&&c.attr({d:M});var L=s[s.length-1],P=L.pos();k({chartX:x+((null==P?void 0:P[0])||0),chartY:g+((null==P?void 0:P[1])||0)})}else{a=s.length;var E=void 0;for(r=0;r<a;r+=1){var L=s[r],B=L.pos()||[],S=B[0],T=B[1],C=L.plotHigh;if((0,n.isNumber)(S)&&(0,n.isNumber)(T)){var H={plotX:S,plotY:T,chartX:x+S,chartY:g+T};if(y&&(C&&(H.plotY=C,H.chartY=g+C),u?H.chartCenterX=x+m-((C||L.plotY||0)+(0,n.pick)(L.yBottom,X))/2:H.chartCenterY=g+((C||T)+(0,n.pick)(L.yBottom,X))/2),E&&(o=Math.max(Math.abs(H.chartX-E.chartX),Math.abs(H.chartY-E.chartY)))>16&&o<999)for(h=1,i=Math.ceil(o/16);h<i;h+=1)k(((e={chartX:E.chartX+(H.chartX-E.chartX)*(h/i),chartY:E.chartY+(H.chartY-E.chartY)*(h/i)})[Y]=(E[Y]||0)+((H[Y]||0)-(E[Y]||0))*(h/i),e.plotX=(E.plotX||0)+(S-(E.plotX||0))*(h/i),e.plotY=(E.plotY||0)+(T-(E.plotY||0))*(h/i),e));k(H),E=H}}}return l}function k(t){var e=Math.round((t.plotX||0)/8)+","+Math.round((t.plotY||0)/8);w[e]||(w[e]=1,l.push(t))}}(t),r.push.apply(r,e.boxesToAvoid||[])}),e.series.forEach(function(t){var r=t.options.label;if(r&&(t.xAxis||t.yAxis)){var o,a,i,h,s,l,c,p,u,d,g,b="highcharts-color-"+(0,n.pick)(t.colorIndex,"none"),m=!t.labelBySeries,y=r.minFontSize,X=r.maxFontSize,w=e.inverted,Y=w?t.yAxis.pos:t.xAxis.pos,M=w?t.xAxis.pos:t.yAxis.pos,A=e.inverted?t.yAxis.len:t.xAxis.len,S=e.inverted?t.xAxis.len:t.yAxis.len,T=t.interpolatedPoints,L=(0,n.pick)(r.onArea,!!t.area),P=[],E=t.getColumn("x"),B=t.labelBySeries;if(L&&!w&&(u=[t.xAxis.toPixels(E[0]),t.xAxis.toPixels(E[E.length-1])],d=Math.min.apply(Math,u),g=Math.max.apply(Math,u)),t.visible&&!t.boosted&&T){if(!B){var C,H,k,z=t.name;if("string"==typeof r.format?z=x(r.format,t,e):r.formatter&&(z=r.formatter.call(t,t)),t.labelBySeries=B=e.renderer.label(z,0,0,"connector",0,0,r.useHTML).addClass("highcharts-series-label highcharts-series-label-"+t.index+" "+(t.options.className||"")+" "+b),!e.renderer.styledMode){var N="string"==typeof t.color?t.color:"var(--highcharts-neutral-color-60)";B.css((0,n.extend)({color:L?e.renderer.getContrast(N):N},r.style||{})),B.attr({opacity:+!!e.renderer.forExport,stroke:t.color,"stroke-width":1})}y&&X&&B.css({fontSize:(C=t,H=y,k=X,H+(C.sum||0)/(C.chart.labelSeriesMaxSum||0)*(k-H)+"px")}),B.attr({padding:0,zIndex:3}).add()}for((i=B.getBBox()).width=Math.round(i.width),c=T.length-1;c>0;c-=1)L?U(h=(null!=(o=T[c].chartCenterX)?o:T[c].chartX)-i.width/2,s=(null!=(a=T[c].chartCenterY)?a:T[c].chartY)-i.height/2,i)&&(p=v(t,h,s,i)):(U(h=T[c].chartX+3,s=T[c].chartY-i.height-3,i)&&(p=v(t,h,s,i,!0)),p&&P.push(p),U(h=T[c].chartX+3,s=T[c].chartY+3,i)&&(p=v(t,h,s,i,!0)),p&&P.push(p),U(h=T[c].chartX-i.width-3,s=T[c].chartY+3,i)&&(p=v(t,h,s,i,!0)),p&&P.push(p),U(h=T[c].chartX-i.width-3,s=T[c].chartY-i.height-3,i)&&(p=v(t,h,s,i,!0))),p&&P.push(p);if(r.connectorAllowed&&!P.length&&!L)for(h=Y+A-i.width;h>=Y;h-=16)for(s=M;s<M+S-i.height;s+=16)(l=v(t,h,s,i,!0))&&P.push(l);if(P.length){P.sort(function(t,e){return e.weight-t.weight}),p=P[0],(e.boxesToAvoid||[]).push({left:p.x,right:p.x+i.width,top:p.y,bottom:p.y+i.height});var _=Math.sqrt(Math.pow(Math.abs(p.x-(B.x||0)),2)+Math.pow(Math.abs(p.y-(B.y||0)),2));if(_&&t.labelBySeries){var D={opacity:+!!e.renderer.forExport,x:p.x,y:p.y},j={opacity:1};_<=10&&(j={x:D.x,y:D.y},D={});var F=void 0;m&&(F=f(t.options.animation),F.duration*=.2),t.labelBySeries.attr((0,n.extend)(D,{anchorX:p.connectorPoint&&(p.connectorPoint.plotX||0)+Y,anchorY:p.connectorPoint&&(p.connectorPoint.plotY||0)+M})).animate(j,F),t.options.kdNow=!0,t.buildKDTree();var O=t.searchPoint({chartX:p.x,chartY:p.y},!0);O&&(B.closest=[O,p.x-(O.plotX||0),p.y-(O.plotY||0)])}}else V()}else V()}function U(t,e,r){var o=Math.max(Y,(0,n.pick)(d,-1/0)),a=Math.min(Y+A,(0,n.pick)(g,1/0));return t>o&&t<=a-r.width&&e>=M&&e<=M+S-r.height}function V(){B&&(t.labelBySeries=B.destroy())}}),(0,n.fireEvent)(e,"afterDrawSeriesLabels"))},e.renderer.forExport||!r?0:r)}}function X(t,e,r,o,a){var i,h,s=a&&a.anchorX,l=a&&a.anchorY,c=r/2;return(0,n.isNumber)(s)&&(0,n.isNumber)(l)&&(i=[["M",s,l]],(h=e-l)<0&&(h=-o-h),h<r&&(c=s<t+r/2?h:r-h),l>e+o?i.push(["L",t+c,e+o]):l<e?i.push(["L",t+c,e]):s<t?i.push(["L",t,e+o/2]):s>t+r&&i.push(["L",t+r,e+o/2])),i||[]}var w=h();({compose:function(t,e){(0,n.pushUnique)(b,"SeriesLabel")&&((0,n.addEvent)(t,"load",y),(0,n.addEvent)(t,"redraw",y),e.prototype.symbols.connector=X,g({plotOptions:{series:{label:c}}}))}}).compose(w.Chart,w.SVGRenderer);var Y=h();return i.default}()});