/**
 * Highstock JS v11.2.0 (2023-10-30)
 *
 * HeikinAshi series type for Highcharts Stock
 *
 * (c) 2010-2021 Karol Kolodziej
 *
 * License: www.highcharts.com/license
 */!function(i){"object"==typeof module&&module.exports?(i.default=i,module.exports=i):"function"==typeof define&&define.amd?define("highcharts/modules/heikinashi",["highcharts","highcharts/modules/stock"],function(e){return i(e),i.Highcharts=e,i}):i("undefined"!=typeof Highcharts?Highcharts:void 0)}(function(i){"use strict";var e=i?i._modules:{};function s(i,e,s,t){i.hasOwnProperty(e)||(i[e]=t.apply(null,s),"function"==typeof CustomEvent&&window.dispatchEvent(new CustomEvent("HighchartsModuleLoaded",{detail:{path:e,module:i[e]}})))}s(e,"Series/HeikinAshi/HeikinAshiPoint.js",[e["Core/Series/SeriesRegistry.js"]],function(i){let{candlestick:{prototype:{pointClass:e}},hlc:{prototype:{pointClass:s}}}=i.seriesTypes;return class extends e{constructor(){super(...arguments),this.resolveColor=s.prototype.resolveColor}}}),s(e,"Series/HeikinAshi/HeikinAshiSeriesDefaults.js",[],function(){return{dataGrouping:{groupAll:!0}}}),s(e,"Series/HeikinAshi/HeikinAshiSeries.js",[e["Series/HeikinAshi/HeikinAshiPoint.js"],e["Series/HeikinAshi/HeikinAshiSeriesDefaults.js"],e["Core/Series/SeriesRegistry.js"],e["Core/Utilities.js"]],function(i,e,s,t){let{candlestick:h}=s.seriesTypes,{addEvent:a,merge:o}=t,n=[];function r(){let i=this.series;i.forEach(i=>{i.is("heikinashi")&&(i.heikiashiData.length=0,i.getHeikinashiData())})}function l(){let i=this.points,e=this.heikiashiData,s=this.cropStart||0;this.processedYData.length=0;for(let t=0;t<i.length;t++){let h=i[t],a=e[t+s];h.open=a[0],h.high=a[1],h.low=a[2],h.close=a[3],this.processedYData.push([h.open,h.high,h.low,h.close])}}function p(){this.heikiashiData.length&&(this.heikiashiData.length=0)}class u extends h{constructor(){super(...arguments),this.data=void 0,this.heikiashiData=[],this.options=void 0,this.points=void 0,this.yData=void 0,this.processedYData=void 0}static compose(i,e,...s){h.compose(i),t.pushUnique(n,e)&&a(e,"postProcessData",r),t.pushUnique(n,u)&&(a(u,"afterTranslate",l),a(u,"updatedData",p))}getHeikinashiData(){let i=this.allGroupedData||this.yData,e=this.heikiashiData;if(!e.length&&i&&i.length){let s=i[0];this.modifyFirstPointValue(s);for(let s=1;s<i.length;s++){let t=i[s],h=e[s-1];this.modifyDataPoint(t,h)}}this.heikiashiData=e}init(){super.init.apply(this,arguments),this.heikiashiData=[]}modifyFirstPointValue(i){let e=(i[0]+i[1]+i[2]+i[3])/4,s=(i[0]+i[3])/2;this.heikiashiData.push([e,i[1],i[2],s])}modifyDataPoint(i,e){let s=(e[0]+e[3])/2,t=(i[0]+i[1]+i[2]+i[3])/4,h=Math.max(i[1],t,s),a=Math.min(i[2],t,s);this.heikiashiData.push([s,h,a,t])}}return u.defaultOptions=o(h.defaultOptions,e),u.prototype.pointClass=i,s.registerSeriesType("heikinashi",u),u}),s(e,"masters/modules/heikinashi.src.js",[e["Core/Globals.js"],e["Series/HeikinAshi/HeikinAshiSeries.js"]],function(i,e){e.compose(i.Series,i.Axis)})});//# sourceMappingURL=heikinashi.js.map