/**
 * Highcharts JS v13.0.0 (2026-06-11)
 * @module highcharts/modules/funnel
 * @requires highcharts
 *
 * Highcharts funnel module
 *
 * (c) 2010-2026 Highsoft AS
 * Author: Torstein Hønsi
 *
 * 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(),l={radius:0,scope:"stack",where:void 0},o=t.default.SeriesRegistry;var r=e.n(o);let{composed:n,noop:h}=i(),{column:p,pie:c}=r().seriesTypes,g=r().series.prototype.alignDataLabel;function u(t,e){return/%$/.test(t)?e*parseInt(t,10)/100:parseInt(t,10)}class x extends c{alignDataLabel(t,e,i,d,s){let l=t.series,o=l.options.reversed,r=t.dlBox||t.shapeArgs,{align:n,verticalAlign:h}=i,p=(0,a.splat)(i.padding||0),c=((l.options||{}).dataLabels||{}).inside,u=l.center[1],x=t.plotY||0,y=e.height??e.getBBox().height,b=l.getWidthAt((o?2*u-x:x)-r.height/2+y),L="middle"===h?(r.topWidth-r.bottomWidth)/4:(b-r.bottomWidth)/2,f=r.y,m=r.x;"middle"===h?f=r.y-r.height/2+y/2:"top"===h&&(f=r.y-r.height+y+p[0]),("top"===h&&!o||"bottom"===h&&o||"middle"===h)&&("right"===n?m=r.x-p[1%p.length]+L:"left"===n&&(m=r.x+p[3%p.length]-L)),d={x:m,y:o?f-r.height:f,width:r.bottomWidth,height:r.height},i.verticalAlign="bottom",c&&(i.distance=void 0),c&&t.visible&&g.call(l,t,e,i,d,s),c&&(!t.visible&&t.dataLabel&&(t.dataLabel.placed=!1),t.contrastColor&&e.css({color:t.contrastColor}))}drawDataLabels(){((0,a.splat)(this.options.dataLabels||{})[0].inside?p:c).prototype.drawDataLabels.call(this)}getDataLabelPosition(t,e){let a=t.plotY||0,i=t.half?1:-1,d=this.getXPos(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(){var t;let e=this,i=e.chart,d=e.options,s=d.reversed,o=d.ignoreHiddenPoint,r=(t=d.borderRadius,(0,a.isObject)(t)||(t={radius:t||0}),(0,a.merge)(l,void 0,t)),n=i.plotWidth,p=i.plotHeight,c=d.center,g=u(c[0],n),x=u(c[1],p),y=u(d.width,n),b=u(d.height,p),L=u(d.neckWidth,n),f=u(d.neckHeight,p),m=x-b/2+b-f,v=e.points,M=(0,a.relativeLength)(r.radius,y),W=r.scope,A=+("left"===d.dataLabels.position),P=t=>{let e=Math.tan(t/2),a=Math.cos(I),i=Math.sin(I),d=M,l=d/e,o=Math.tan((Math.PI-t)/3.2104);return l>H&&(d=(l=H)*e),{dx:[l*a,(l-(o*=d))*a,l-o,l],dy:[l*i,(l-o)*i,l-o,l].map(t=>s?-t:t)}},C=0,k=0,O,w,D,I,H,Y,B,S,T,j,X,R;for(let t of(e.getWidthAt=function(t){let e=x-b/2;return t>m||b===f?L:L+(y-L)*(1-(t-e)/(b-f))},e.getXPos=function(t,i,d){return g+(i?-1:1)*(e.getWidthAt(s?2*x-t:t)/2+(d.dataLabel?.dataLabelPosition?.distance??(0,a.relativeLength)(this.options.dataLabels?.distance||0,y)))},e.center=[g,x,b],e.centerX=g,v))t.y&&t.isValid()&&(!o||!1!==t.visible)&&(C+=t.y);for(let t of v){if(R=null,D=C?t.y/C:0,j=(B=x-b/2+k*b)+D*b,S=(Y=g-(O=e.getWidthAt(B))/2)+O,X=(T=g-(O=e.getWidthAt(j))/2)+O,(0,a.correctFloat)(B)>=m?(Y=T=g-L/2,S=X=g+L/2):j>m&&(R=j,X=(T=g-(O=e.getWidthAt(m))/2)+O,j=m),s&&(B=2*x-B,j=2*x-j,null!==R&&(R=2*x-R)),M&&("point"===W||0===t.index||t.index===v.length-1||null!==R)){let e=Math.abs(j-B),a=S-X,i=X-T,d=Math.sqrt(a*a+e*e);I=Math.atan(0!==a?e/a:1/0),H=d/2,null!==R&&(H=Math.min(H,Math.abs(R-j)/2)),i>=1&&(H=Math.min(H,i/2));let s=P(I);if(w="stack"===W&&0!==t.index?[["M",Y,B],["L",S,B]]:[["M",Y+s.dx[0],B+s.dy[0]],["C",Y+s.dx[1],B+s.dy[1],Y+s.dx[2],B,Y+s.dx[3],B],["L",S-s.dx[3],B],["C",S-s.dx[2],B,S-s.dx[1],B+s.dy[1],S-s.dx[0],B+s.dy[0]]],null!==R){let e=P(Math.PI/2);s=P(Math.PI/2+I),w.push(["L",X+s.dx[0],j-s.dy[0]],["C",X+s.dx[1],j-s.dy[1],X,j+s.dy[2],X,j+s.dy[3]]),"stack"===W&&t.index!==v.length-1?w.push(["L",X,R],["L",T,R]):w.push(["L",X,R-e.dy[3]],["C",X,R-e.dy[2],X-e.dx[2],R,X-e.dx[3],R],["L",T+e.dx[3],R],["C",T+e.dx[2],R,T,R-e.dy[2],T,R-e.dy[3]]),w.push(["L",T,j+s.dy[3]],["C",T,j+s.dy[2],T-s.dx[1],j-s.dy[1],T-s.dx[0],j-s.dy[0]])}else i>=1?(s=P(Math.PI-I),"stack"===W&&0===t.index?w.push(["L",X,j],["L",T,j]):w.push(["L",X+s.dx[0],j-s.dy[0]],["C",X+s.dx[1],j-s.dy[1],X-s.dx[2],j,X-s.dx[3],j],["L",T+s.dx[3],j],["C",T+s.dx[2],j,T-s.dx[1],j-s.dy[1],T-s.dx[0],j-s.dy[0]])):(s=P(Math.PI-2*I),w.push(["L",T+s.dx[0],j-s.dy[0]],["C",T+s.dx[1],j-s.dy[1],T-s.dx[1],j-s.dy[1],T-s.dx[0],j-s.dy[0]]))}else w=[["M",Y,B],["L",S,B],["L",X,j]],null!==R&&w.push(["L",X,R],["L",T,R]),w.push(["L",T,j]);w.push(["Z"]),t.shapeType="path",t.shapeArgs={d:w},t.percentage=100*D,t.plotX=g,t.plotY=(B+(R||j))/2,t.tooltipPos=[g,t.plotY],t.dlBox={x:T,y:B,topWidth:S-Y,bottomWidth:X-T,height:Math.abs((0,a.pick)(R,j)-B),width:NaN},t.slice=h,t.half=A,t.isValid()&&(!o||!1!==t.visible)&&(k+=D)}(0,a.fireEvent)(e,"afterTranslate")}sortByAngle(t){t.sort((t,e)=>t.plotY-e.plotY)}}function y(){for(let t of this.series){let e=t.options&&t.options.dataLabels;(0,a.isArray)(e)&&(e=e[0]),t.is("pie")&&t.placeDataLabels&&e&&!e.inside&&t.placeDataLabels()}}x.defaultOptions=(0,a.merge)(c.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:"var(--highcharts-neutral-color-20)",borderColor:"var(--highcharts-neutral-color-100)"}}}),(0,a.extend)(x.prototype,{animate:h}),(x||(x={})).compose=function(t){(0,a.pushUnique)(n,"FunnelSeries")&&(0,a.addEvent)(t,"afterHideAllOverlappingLabels",y)},r().registerSeriesType("funnel",x);let b=x;class L extends b{}L.defaultOptions=(0,a.merge)(b.defaultOptions,{neckHeight:"0%",neckWidth:"0%",reversed:!0}),r().registerSeriesType("pyramid",L);let f=i();b.compose(f.Chart);let m=i();export{m as default};