/*
 Highcharts JS v9.1.0 (2021-05-03)

 Highcharts funnel module

 (c) 2010-2021 Kacper Madej

 License: www.highcharts.com/license
*/
(function(a){"object"===typeof module&&module.exports?(a["default"]=a,module.exports=a):"function"===typeof define&&define.amd?define("highcharts/modules/funnel3d",["highcharts","highcharts/highcharts-3d","highcharts/modules/cylinder"],function(u){a(u);a.Highcharts=u;return a}):a("undefined"!==typeof Highcharts?Highcharts:void 0)})(function(a){function u(a,f,l,m){a.hasOwnProperty(f)||(a[f]=m.apply(null,l))}a=a?a._modules:{};u(a,"Series/Funnel3D/Funnel3DPoint.js",[a["Core/Series/SeriesRegistry.js"],
a["Core/Utilities.js"]],function(a,f){var l=this&&this.__extends||function(){var a=function(e,n){a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,e){a.__proto__=e}||function(a,e){for(var h in e)e.hasOwnProperty(h)&&(a[h]=e[h])};return a(e,n)};return function(e,n){function f(){this.constructor=e}a(e,n);e.prototype=null===n?Object.create(n):(f.prototype=n.prototype,new f)}}();f=f.extend;a=function(a){function e(){var e=null!==a&&a.apply(this,arguments)||this;e.dlBoxRaw=void 0;e.options=
void 0;e.series=void 0;e.y=void 0;return e}l(e,a);return e}(a.seriesTypes.column.prototype.pointClass);f(a.prototype,{shapeType:"funnel3d"});return a});u(a,"Series/Funnel3D/Funnel3DComposition.js",[a["Core/Color/Color.js"],a["Core/Globals.js"],a["Core/Utilities.js"]],function(a,f,l){var m=a.parse,e=f.charts;a=f.Renderer.prototype;var n=a.cuboidPath;a=a.elements3d;var u=l.error,H=l.extend,h=l.merge;a.funnel3d=h(a.cuboid,{parts:"top bottom frontUpper backUpper frontLower backLower rightUpper rightLower".split(" "),
mainParts:["top","bottom"],sideGroups:["upperGroup","lowerGroup"],sideParts:{upperGroup:["frontUpper","backUpper","rightUpper"],lowerGroup:["frontLower","backLower","rightLower"]},pathType:"funnel3d",opacitySetter:function(b){var c=this,a=c.parts,d=f.charts[c.renderer.chartIndex],k="group-opacity-"+b+"-"+d.index;c.parts=c.mainParts;c.singleSetterForParts("opacity",b);c.parts=a;d.renderer.filterId||(d.renderer.definition({tagName:"filter",attributes:{id:k},children:[{tagName:"feComponentTransfer",
children:[{tagName:"feFuncA",attributes:{type:"table",tableValues:"0 "+b}}]}]}),c.sideGroups.forEach(function(a){c[a].attr({filter:"url(#"+k+")"})}),c.renderer.styledMode&&(d.renderer.definition({tagName:"style",textContent:".highcharts-"+k+" {filter:url(#"+k+")}"}),c.sideGroups.forEach(function(c){c.addClass("highcharts-"+k)})));return c},fillSetter:function(a){var c=this,b=m(a),d=b.rgba[3],k={top:m(a).brighten(.1).get(),bottom:m(a).brighten(-.2).get()};1>d?(b.rgba[3]=1,b=b.get("rgb"),c.attr({opacity:d})):
b=a;b.linearGradient||b.radialGradient||!c.gradientForSides||(b={linearGradient:{x1:0,x2:1,y1:1,y2:1},stops:[[0,m(a).brighten(-.2).get()],[.5,a],[1,m(a).brighten(-.2).get()]]});b.linearGradient?c.sideGroups.forEach(function(a){var t=c[a].gradientBox,d=b.linearGradient,v=h(b,{linearGradient:{x1:t.x+d.x1*t.width,y1:t.y+d.y1*t.height,x2:t.x+d.x2*t.width,y2:t.y+d.y2*t.height}});c.sideParts[a].forEach(function(a){k[a]=v})}):(h(!0,k,{frontUpper:b,backUpper:b,rightUpper:b,frontLower:b,backLower:b,rightLower:b}),
b.radialGradient&&c.sideGroups.forEach(function(a){var b=c[a].gradientBox,d=b.x+b.width/2,v=b.y+b.height/2,k=Math.min(b.width,b.height);c.sideParts[a].forEach(function(a){c[a].setRadialReference([d,v,k])})}));c.singleSetterForParts("fill",null,k);c.color=c.fill=a;b.linearGradient&&[c.frontLower,c.frontUpper].forEach(function(a){(a=(a=a.element)&&c.renderer.gradients[a.gradient])&&"userSpaceOnUse"!==a.attr("gradientUnits")&&a.attr({gradientUnits:"userSpaceOnUse"})});return c},adjustForGradient:function(){var a=
this,c;a.sideGroups.forEach(function(b){var d={x:Number.MAX_VALUE,y:Number.MAX_VALUE},k={x:-Number.MAX_VALUE,y:-Number.MAX_VALUE};a.sideParts[b].forEach(function(b){c=a[b].getBBox(!0);d={x:Math.min(d.x,c.x),y:Math.min(d.y,c.y)};k={x:Math.max(k.x,c.x+c.width),y:Math.max(k.y,c.y+c.height)}});a[b].gradientBox={x:d.x,width:k.x-d.x,y:d.y,height:k.y-d.y}})},zIndexSetter:function(){this.finishedOnAdd&&this.adjustForGradient();return this.renderer.Element.prototype.zIndexSetter.apply(this,arguments)},onAdd:function(){this.adjustForGradient();
this.finishedOnAdd=!0}});H(f.Renderer.prototype,{funnel3d:function(a){var b=this.element3d("funnel3d",a),e=this.styledMode,d={"stroke-width":1,stroke:"none"};b.upperGroup=this.g("funnel3d-upper-group").attr({zIndex:b.frontUpper.zIndex}).add(b);[b.frontUpper,b.backUpper,b.rightUpper].forEach(function(a){e||a.attr(d);a.add(b.upperGroup)});b.lowerGroup=this.g("funnel3d-lower-group").attr({zIndex:b.frontLower.zIndex}).add(b);[b.frontLower,b.backLower,b.rightLower].forEach(function(a){e||a.attr(d);a.add(b.lowerGroup)});
b.gradientForSides=a.gradientForSides;return b},funnel3dPath:function(a){this.getCylinderEnd||u("A required Highcharts module is missing: cylinder.js",!0,e[this.chartIndex]);var b=e[this.chartIndex],f=a.alphaCorrection=90-Math.abs(b.options.chart.options3d.alpha%180-90),d=n.call(this,h(a,{depth:a.width,width:(a.width+a.bottom.width)/2})),k=d.isTop,q=!d.isFront,t=!!a.middle,y=this.getCylinderEnd(b,h(a,{x:a.x-a.width/2,z:a.z-a.width/2,alphaCorrection:f})),v=a.bottom.width,I=h(a,{width:v,x:a.x-v/2,z:a.z-
v/2,alphaCorrection:f}),l=this.getCylinderEnd(b,I,!0),z=v,F=I,g=l,m=l;t&&(z=a.middle.width,F=h(a,{y:a.y+a.middle.fraction*a.height,width:z,x:a.x-z/2,z:a.z-z/2}),g=this.getCylinderEnd(b,F,!1),m=this.getCylinderEnd(b,F,!1));d={top:y,bottom:l,frontUpper:this.getCylinderFront(y,g),zIndexes:{group:d.zIndexes.group,top:0!==k?0:3,bottom:1!==k?0:3,frontUpper:q?2:1,backUpper:q?1:2,rightUpper:q?2:1}};d.backUpper=this.getCylinderBack(y,g);y=1!==Math.min(z,a.width)/Math.max(z,a.width);d.rightUpper=this.getCylinderFront(this.getCylinderEnd(b,
h(a,{x:a.x-a.width/2,z:a.z-a.width/2,alphaCorrection:y?-f:0}),!1),this.getCylinderEnd(b,h(F,{alphaCorrection:y?-f:0}),!t));t&&(y=1!==Math.min(z,v)/Math.max(z,v),h(!0,d,{frontLower:this.getCylinderFront(m,l),backLower:this.getCylinderBack(m,l),rightLower:this.getCylinderFront(this.getCylinderEnd(b,h(I,{alphaCorrection:y?-f:0}),!0),this.getCylinderEnd(b,h(F,{alphaCorrection:y?-f:0}),!1)),zIndexes:{frontLower:q?2:1,backLower:q?1:2,rightLower:q?1:2}}));return d}})});u(a,"Series/Funnel3D/Funnel3DSeries.js",
[a["Series/Funnel3D/Funnel3DPoint.js"],a["Core/Globals.js"],a["Extensions/Math3D.js"],a["Core/Series/SeriesRegistry.js"],a["Core/Utilities.js"]],function(a,f,l,m,e){var n=this&&this.__extends||function(){var a=function(b,c){a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])};return a(b,c)};return function(b,c){function d(){this.constructor=b}a(b,c);b.prototype=null===c?Object.create(c):(d.prototype=c.prototype,
new d)}}();f=f.noop;var u=l.perspective,H=m.series,h=m.seriesTypes.column,b=e.extend,c=e.merge,E=e.pick,d=e.relativeLength;l=function(a){function e(){var b=null!==a&&a.apply(this,arguments)||this;b.center=void 0;b.data=void 0;b.options=void 0;b.points=void 0;return b}n(e,a);e.prototype.alignDataLabel=function(a,b,c){var d=a.dlBoxRaw,e=this.chart.inverted,f=a.plotY>E(this.translatedThreshold,this.yAxis.len),k=E(c.inside,!!this.options.stacking),g={x:d.x,y:d.y,height:0};c.align=E(c.align,!e||k?"center":
f?"right":"left");c.verticalAlign=E(c.verticalAlign,e||k?"middle":f?"top":"bottom");"top"!==c.verticalAlign&&(g.y+=d.bottom/("bottom"===c.verticalAlign?1:2));g.width=this.getWidthAt(g.y);this.options.reversed&&(g.width=d.fullWidth-g.width);k?g.x-=g.width/2:"left"===c.align?(c.align="right",g.x-=1.5*g.width):"right"===c.align?(c.align="left",g.x+=g.width/2):g.x-=g.width/2;a.dlBox=g;h.prototype.alignDataLabel.apply(this,arguments)};e.prototype.bindAxes=function(){H.prototype.bindAxes.apply(this,arguments);
b(this.xAxis.options,{gridLineWidth:0,lineWidth:0,title:void 0,tickPositions:[]});c(!0,this.yAxis.options,{gridLineWidth:0,title:void 0,labels:{enabled:!1}})};e.prototype.translate=function(){H.prototype.translate.apply(this,arguments);var a=0,c=this.chart,e=this.options,f=e.reversed,k=e.ignoreHiddenPoint,h=c.plotWidth,l=c.plotHeight,g=0,m=e.center,n=d(m[0],h),q=d(m[1],l),J=d(e.width,h),w,A,r=d(e.height,l),K=d(e.neckWidth,h),L=d(e.neckHeight,l),D=q-r/2+r-L;h=this.data;var B,M,x,C,N,G,p;this.getWidthAt=
A=function(a){var b=q-r/2;return a>D||r===L?K:K+(J-K)*(1-(a-b)/(r-L))};this.center=[n,q,r];this.centerX=n;h.forEach(function(b){k&&!1===b.visible||(a+=b.y)});h.forEach(function(d){N=null;B=a?d.y/a:0;x=q-r/2+g*r;C=x+B*r;w=A(x);G=C-x;p={gradientForSides:E(d.options.gradientForSides,e.gradientForSides),x:n,y:x,height:G,width:w,z:1,top:{width:w}};w=A(C);p.bottom={fraction:B,width:w};x>=D?p.isCylinder=!0:C>D&&(N=C,w=A(D),C=D,p.bottom.width=w,p.middle={fraction:G?(D-x)/G:0,width:w});f&&(p.y=x=q+r/2-(g+
B)*r,p.middle&&(p.middle.fraction=1-(G?p.middle.fraction:0)),w=p.width,p.width=p.bottom.width,p.bottom.width=w);d.shapeArgs=b(d.shapeArgs,p);d.percentage=100*B;d.plotX=n;d.plotY=f?q+r/2-(g+B/2)*r:(x+(N||C))/2;M=u([{x:n,y:d.plotY,z:f?-(J-A(d.plotY))/2:-A(d.plotY)/2}],c,!0)[0];d.tooltipPos=[M.x,M.y];d.dlBoxRaw={x:n,width:A(d.plotY),y:x,bottom:p.height||0,fullWidth:J};k&&!1===d.visible||(g+=B)})};e.defaultOptions=c(h.defaultOptions,{center:["50%","50%"],width:"90%",neckWidth:"30%",height:"100%",neckHeight:"25%",
reversed:!1,gradientForSides:!0,animation:!1,edgeWidth:0,colorByPoint:!0,showInLegend:!1,dataLabels:{align:"right",crop:!1,inside:!1,overflow:"allow"}});return e}(h);b(l.prototype,{pointClass:a,translate3dShapes:f});m.registerSeriesType("funnel3d",l);"";return l});u(a,"masters/modules/funnel3d.src.js",[],function(){})});
//# sourceMappingURL=funnel3d.js.map