!/**
 * Highcharts JS v13.0.0 (2026-06-11)
 * @module highcharts/modules/windbarb
 * @requires highcharts
 *
 * Wind barb series module
 *
 * (c) 2010-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.dataGrouping.approximations,t._Highcharts.Series.types.column,t._Highcharts.Series,t._Highcharts.SeriesRegistry):"function"==typeof define&&define.amd?define("highcharts/modules/windbarb",["highcharts/highcharts"],function(t){return e(t,t.dataGrouping,["approximations"],t.Series,["types"],["column"],t.Series,t.SeriesRegistry)}):"object"==typeof exports?exports["highcharts/modules/windbarb"]=e(t._Highcharts,t._Highcharts.dataGrouping.approximations,t._Highcharts.Series.types.column,t._Highcharts.Series,t._Highcharts.SeriesRegistry):t.Highcharts=e(t.Highcharts,t.Highcharts.dataGrouping.approximations,t.Highcharts.Series.types.column,t.Highcharts.Series,t.Highcharts.SeriesRegistry)}("u"<typeof window?this:window,(t,e,r,o,i)=>(()=>{"use strict";var s,a={448:t=>{t.exports=r},512:t=>{t.exports=i},820:t=>{t.exports=o},944:e=>{e.exports=t},956:t=>{t.exports=e}},n={};function l(t){var e=n[t];if(void 0!==e)return e.exports;var r=n[t]={exports:{}};return a[t](r,r.exports,l),r.exports}l.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return l.d(e,{a:e}),e},l.d=(t,e)=>{for(var r in e)l.o(e,r)&&!l.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},l.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var p={};l.d(p,{default:()=>A});var h=l(944),c=l.n(h),d=l(956),u=l.n(d),f=l(448),g=l.n(f),x=l(820),b=l.n(x);let{composed:y}=c(),{prototype:m}=g(),{prototype:v}=b();var S=s||(s={});function w(t){return v.getPlotBox.call(this.options.onSeries&&this.chart.get(this.options.onSeries)||this,t)}function L(){m.translate.apply(this);let t=this,e=t.options,r=t.chart,o=t.points,i=e.onSeries,s=i&&r.get(i),a=s&&s.options.step,n=s&&s.points,l=r.inverted,p=t.xAxis,c=t.yAxis,d=o.length-1,u,f,g=e.onKey||"y",x=n&&n.length,b=0,y,v,S,w,L;if(s&&s.visible&&x){for(b=(s.pointXOffset||0)+(s.barW||0)/2,w=s.currentDataGrouping,v=n[x-1].x+(w?w.totalRange:0),(0,h.stableSort)(o,(t,e)=>t.x-e.x),g="plot"+g[0].toUpperCase()+g.substr(1);x--&&o[d];)if(y=n[x],(u=o[d]).y=y.y,y.x<=u.x&&void 0!==y[g]){if(u.x<=v&&(u.plotY=y[g],y.x<u.x&&!a&&(S=n[x+1]))&&void 0!==S[g])if((0,h.defined)(u.plotX)&&s.is("spline")){let t=[y.plotX||0,y.plotY||0],e=[S.plotX||0,S.plotY||0],r=y.controlPoints?.high||t,o=S.controlPoints?.low||e,i=(i,s)=>Math.pow(1-i,3)*t[s]+3*(1-i)*(1-i)*i*r[s]+3*(1-i)*i*i*o[s]+i*i*i*e[s],s=0,a=1,n;for(let t=0;t<100;t++){let t=(s+a)/2,e=i(t,0);if(null===e)break;if(.25>Math.abs(e-u.plotX)){n=t;break}e<u.plotX?s=t:a=t}(0,h.defined)(n)&&(u.plotY=i(n,1),u.y=c.toValue(u.plotY,!0))}else L=(u.x-y.x)/(S.x-y.x),u.plotY+=L*(S[g]-y[g]),u.y+=L*(S.y-y.y);if(d--,x++,d<0)break}}o.forEach((e,r)=>{let i;e.plotX+=b,(void 0===e.plotY||l)&&(e.plotX>=0&&e.plotX<=p.len?l?(e.plotY=p.translate(e.x,0,1,0,1),e.plotX=(0,h.defined)(e.y)?c.translate(e.y,0,0,0,1):0):e.plotY=(p.opposite?0:t.yAxis.len)+p.offset:e.shapeArgs={}),(f=o[r-1])&&f.plotX===e.plotX&&(void 0===f.stackIndex&&(f.stackIndex=0),i=f.stackIndex+1),e.stackIndex=i}),this.onSeries=s}S.compose=function(t){if((0,h.pushUnique)(y,"OnSeries")){let e=t.prototype;e.getPlotBox=w,e.translate=L}return t},S.getPlotBox=w,S.translate=L;let H=s;var k=l(512),X=l.n(k);class G extends g().prototype.pointClass{isValid(){return(0,h.isNumber)(this.value)&&this.value>=0}}let{animObject:M}=c(),{column:O}=X().seriesTypes;class P extends O{init(t,e){super.init(t,e)}pointAttribs(t,e){let r=this.options,o=t?.color||this.color,i=this.options.lineWidth;return e&&(o=r.states[e].color||o,i=(r.states[e].lineWidth||i)+(r.states[e].lineWidthPlus||0)),{stroke:o,"stroke-width":i}}windArrow(t){let e=t.beaufortLevel,r=this.options.vectorLength/20,o=1.943844*t.value,i,s=-10;if(t.isNull)return[];if(0===e)return this.chart.renderer.symbols.circle(-10*r,-10*r,20*r,20*r);let a=[["M",0,7*r],["L",-1.5*r,7*r],["L",0,10*r],["L",1.5*r,7*r],["L",0,7*r],["L",0,-10*r]];if((i=(o-o%50)/50)>0)for(;i--;)a.push(-10===s?["L",0,s*r]:["M",0,s*r],["L",5*r,s*r+2],["L",0,s*r+4]),o-=50,s+=7;if((i=(o-o%10)/10)>0)for(;i--;)a.push(-10===s?["L",0,s*r]:["M",0,s*r],["L",7*r,s*r]),o-=10,s+=3;if((i=(o-o%5)/5)>0)for(;i--;)a.push(-10===s?["L",0,s*r]:["M",0,s*r],["L",4*r,s*r]),o-=5,s+=3;return a}drawPoints(){let t=this.chart,e=this.yAxis,r=t.inverted,o=this.options.vectorLength/2;for(let i of this.points){let s=i.plotX,a=i.plotY;!1===this.options.clip||t.isInsidePlot(s,0)?(i.graphic||(i.graphic=this.chart.renderer.path().add(this.markerGroup).addClass("highcharts-point highcharts-color-"+(0,h.pick)(i.colorIndex,i.series.colorIndex))),i.graphic.attr({d:this.windArrow(i),translateX:s+this.options.xOffset,translateY:a+this.options.yOffset,rotation:i.direction}),this.chart.styledMode||i.graphic.attr(this.pointAttribs(i))):i.graphic&&(i.graphic=i.graphic.destroy()),i.tooltipPos=[s+this.options.xOffset+(r&&!this.onSeries?o:0),a+this.options.yOffset-(r?0:o+e.pos-t.plotTop)]}}animate(t){t?this.markerGroup.attr({opacity:.01}):this.markerGroup.animate({opacity:1},M(this.options.animation))}markerAttribs(){return{}}getExtremes(){return{}}shouldShowTooltip(t,e,r={}){return r.ignoreX=this.chart.inverted,r.ignoreY=!r.ignoreX,super.shouldShowTooltip(t,e,r)}}P.defaultOptions=(0,h.merge)(O.defaultOptions,{dataGrouping:{enabled:!0,approximation:"windbarb",groupPixelWidth:30},lineWidth:2,onSeries:null,states:{hover:{lineWidthPlus:0}},tooltip:{pointFormat:'<span style="color:{point.color}">●</span> {series.name}: <b>{point.value}</b> ({point.beaufort})<br/>'},vectorLength:20,colorKey:"value",yOffset:-20,xOffset:0}),H.compose(P),(0,h.extend)(P.prototype,{beaufortFloor:[0,.3,1.6,3.4,5.5,8,10.8,13.9,17.2,20.8,24.5,28.5,32.7],beaufortName:["Calm","Light air","Light breeze","Gentle breeze","Moderate breeze","Fresh breeze","Strong breeze","Near gale","Gale","Strong gale","Storm","Violent storm","Hurricane"],invertible:!1,parallelArrays:["x","value","direction"],pointArrayMap:["value","direction"],pointClass:G,trackerGroups:["markerGroup"],translate:function(){let t=this.beaufortFloor,e=this.beaufortName;for(let r of(H.translate.call(this),this.points)){let o=0;for(;o<t.length&&!(t[o]>r.value);o++);r.beaufortLevel=o-1,r.beaufort=e[o-1]}}}),X().registerSeriesType("windbarb",P),u().windbarb||(u().windbarb=(t,e)=>{let r=0,o=0;for(let i=0,s=t.length;i<s;i++)r+=t[i]*Math.cos(e[i]*c().deg2rad),o+=t[i]*Math.sin(e[i]*c().deg2rad);return[t.reduce((t,e)=>t+e,0)/t.length,Math.atan2(o,r)/c().deg2rad]});let A=c();return p.default})());