/**
 * Highcharts JS v12.5.0 (2026-01-12)
 * @module highcharts/modules/funnel
 * @requires highcharts
 *
 * Highcharts funnel module
 *
 * (c) 2010-2026 Highsoft AS
 * Author: Torstein Honsi
 *
 * A commercial license may be required depending on use.
 * See www.highcharts.com/license
 */import*as t from"../highcharts.js";var e={};e.n=t=>{var a=t&&t.__esModule?()=>t.default:()=>t;return e.d(a,{a:a}),a},e.d=(t,a)=>{for(var i in a)e.o(a,i)&&!e.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:a[i]})},e.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);let a=t.default;var i=e.n(a);let{defaultOptions:d}=i(),{noop:s}=i(),{addEvent:l,extend:o,isObject:n,merge:r,relativeLength:h}=i(),p={radius:0,scope:"stack",where:void 0};function c(t,e){return n(t)||(t={radius:t||0}),r(p,e,t)}let u=t.default.SeriesRegistry;var g=e.n(u);let{composed:x,noop:y}=i(),{column:b,pie:L}=g().seriesTypes,{addEvent:f,correctFloat:m,extend:v,fireEvent:M,isArray:W,merge:A,pick:C,pushUnique:P,relativeLength:k,splat:w}=i(),O=g().series.prototype.alignDataLabel;function D(t,e){return/%$/.test(t)?e*parseInt(t,10)/100:parseInt(t,10)}class I extends L{alignDataLabel(t,e,a,i,d){let s=t.series,l=s.options.reversed,o=t.dlBox||t.shapeArgs,{align:n,padding:r=0,verticalAlign:h}=a,p=((s.options||{}).dataLabels||{}).inside,c=s.center[1],u=t.plotY||0,g=e.height??e.getBBox().height,x=s.getWidthAt((l?2*c-u:u)-o.height/2+g),y="middle"===h?(o.topWidth-o.bottomWidth)/4:(x-o.bottomWidth)/2,b=o.y,L=o.x;"middle"===h?b=o.y-o.height/2+g/2:"top"===h&&(b=o.y-o.height+g+r),("top"===h&&!l||"bottom"===h&&l||"middle"===h)&&("right"===n?L=o.x-r+y:"left"===n&&(L=o.x+r-y)),i={x:L,y:l?b-o.height:b,width:o.bottomWidth,height:o.height},a.verticalAlign="bottom",p&&(a.distance=void 0),p&&t.visible&&O.call(s,t,e,a,i,d),p&&(!t.visible&&t.dataLabel&&(t.dataLabel.placed=!1),t.contrastColor&&e.css({color:t.contrastColor}))}drawDataLabels(){(w(this.options.dataLabels||{})[0].inside?b:L).prototype.drawDataLabels.call(this)}getDataLabelPosition(t,e){let a=t.plotY||0,i=t.half?1:-1,d=this.getX(a,!!t.half,t);return{distance:e,natural:{x:0,y:a},computed:{},alignment:t.half?"right":"left",connectorPosition:{breakAt:{x:d+(e-5)*i,y:a},touchingSliceAt:{x:d+e*i,y:a}}}}translate(){let t=this,e=t.chart,a=t.options,i=a.reversed,d=a.ignoreHiddenPoint,s=c(a.borderRadius),l=e.plotWidth,o=e.plotHeight,n=a.center,r=D(n[0],l),h=D(n[1],o),p=D(a.width,l),u=D(a.height,o),g=D(a.neckWidth,l),x=D(a.neckHeight,o),b=h-u/2+u-x,L=t.points,f=k(s.radius,p),v=s.scope,W=+("left"===a.dataLabels.position),A=t=>{let e=Math.tan(t/2),a=Math.cos(Y),d=Math.sin(Y),s=f,l=s/e,o=Math.tan((Math.PI-t)/3.2104);return l>B&&(s=(l=B)*e),{dx:[l*a,(l-(o*=s))*a,l-o,l],dy:[l*d,(l-o)*d,l-o,l].map(t=>i?-t:t)}},P=0,w=0,O,I,H,Y,B,S,T,X,j,R,_,N;for(let e of(t.getWidthAt=function(t){let e=h-u/2;return t>b||u===x?g:g+(p-g)*(1-(t-e)/(u-x))},t.getX=function(e,a,d){return r+(a?-1:1)*(t.getWidthAt(i?2*h-e:e)/2+(d.dataLabel?.dataLabelPosition?.distance??k(this.options.dataLabels?.distance||0,p)))},t.center=[r,h,u],t.centerX=r,L))e.y&&e.isValid()&&(!d||!1!==e.visible)&&(P+=e.y);for(let e of L){if(N=null,H=P?e.y/P:0,R=(T=h-u/2+w*u)+H*u,X=(S=r-(O=t.getWidthAt(T))/2)+O,_=(j=r-(O=t.getWidthAt(R))/2)+O,m(T)>=b?(S=j=r-g/2,X=_=r+g/2):R>b&&(N=R,_=(j=r-(O=t.getWidthAt(b))/2)+O,R=b),i&&(T=2*h-T,R=2*h-R,null!==N&&(N=2*h-N)),f&&("point"===v||0===e.index||e.index===L.length-1||null!==N)){let t=Math.abs(R-T),a=X-_,i=_-j,d=Math.sqrt(a*a+t*t);Y=Math.atan(0!==a?t/a:1/0),B=d/2,null!==N&&(B=Math.min(B,Math.abs(N-R)/2)),i>=1&&(B=Math.min(B,i/2));let s=A(Y);if(I="stack"===v&&0!==e.index?[["M",S,T],["L",X,T]]:[["M",S+s.dx[0],T+s.dy[0]],["C",S+s.dx[1],T+s.dy[1],S+s.dx[2],T,S+s.dx[3],T],["L",X-s.dx[3],T],["C",X-s.dx[2],T,X-s.dx[1],T+s.dy[1],X-s.dx[0],T+s.dy[0]]],null!==N){let t=A(Math.PI/2);s=A(Math.PI/2+Y),I.push(["L",_+s.dx[0],R-s.dy[0]],["C",_+s.dx[1],R-s.dy[1],_,R+s.dy[2],_,R+s.dy[3]]),"stack"===v&&e.index!==L.length-1?I.push(["L",_,N],["L",j,N]):I.push(["L",_,N-t.dy[3]],["C",_,N-t.dy[2],_-t.dx[2],N,_-t.dx[3],N],["L",j+t.dx[3],N],["C",j+t.dx[2],N,j,N-t.dy[2],j,N-t.dy[3]]),I.push(["L",j,R+s.dy[3]],["C",j,R+s.dy[2],j-s.dx[1],R-s.dy[1],j-s.dx[0],R-s.dy[0]])}else i>=1?(s=A(Math.PI-Y),"stack"===v&&0===e.index?I.push(["L",_,R],["L",j,R]):I.push(["L",_+s.dx[0],R-s.dy[0]],["C",_+s.dx[1],R-s.dy[1],_-s.dx[2],R,_-s.dx[3],R],["L",j+s.dx[3],R],["C",j+s.dx[2],R,j-s.dx[1],R-s.dy[1],j-s.dx[0],R-s.dy[0]])):(s=A(Math.PI-2*Y),I.push(["L",j+s.dx[0],R-s.dy[0]],["C",j+s.dx[1],R-s.dy[1],j-s.dx[1],R-s.dy[1],j-s.dx[0],R-s.dy[0]]))}else I=[["M",S,T],["L",X,T],["L",_,R]],null!==N&&I.push(["L",_,N],["L",j,N]),I.push(["L",j,R]);I.push(["Z"]),e.shapeType="path",e.shapeArgs={d:I},e.percentage=100*H,e.plotX=r,e.plotY=(T+(N||R))/2,e.tooltipPos=[r,e.plotY],e.dlBox={x:j,y:T,topWidth:X-S,bottomWidth:_-j,height:Math.abs(C(N,R)-T),width:NaN},e.slice=y,e.half=W,e.isValid()&&(!d||!1!==e.visible)&&(w+=H)}M(t,"afterTranslate")}sortByAngle(t){t.sort((t,e)=>t.plotY-e.plotY)}}function H(){for(let t of this.series){let e=t.options&&t.options.dataLabels;W(e)&&(e=e[0]),t.is("pie")&&t.placeDataLabels&&e&&!e.inside&&t.placeDataLabels()}}I.defaultOptions=A(L.defaultOptions,{animation:!1,borderRadius:0,center:["50%","50%"],width:"90%",neckWidth:"30%",height:"100%",neckHeight:"25%",reversed:!1,size:!0,dataLabels:{connectorWidth:1,verticalAlign:"middle"},states:{select:{color:"#cccccc",borderColor:"#000000"}}}),v(I.prototype,{animate:y}),(I||(I={})).compose=function(t){P(x,"FunnelSeries")&&f(t,"afterHideAllOverlappingLabels",H)},g().registerSeriesType("funnel",I);let Y=I,{merge:B}=i();class S extends Y{}S.defaultOptions=B(Y.defaultOptions,{neckHeight:"0%",neckWidth:"0%",reversed:!0}),g().registerSeriesType("pyramid",S);let T=i();Y.compose(T.Chart);let X=i();export{X as default};