import{g as t}from"./index-B1MHyEgd.js";function e(t,e){return e.forEach(function(e){e&&"string"!=typeof e&&!Array.isArray(e)&&Object.keys(e).forEach(function(i){if("default"!==i&&!(i in t)){var a=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(t,i,a.get?a:{enumerable:!0,get:function(){return e[i]}})}})}),Object.freeze(t)}var i,a={exports:{}};var s,r=i?a.exports:(i=1,s="undefined"==typeof window?a.exports:window,a.exports=((t,e)=>(()=>{var i={512:t=>{t.exports=e},944:e=>{e.exports=t}},a={};function s(t){var e=a[t];if(void 0!==e)return e.exports;var r=a[t]={exports:{}};return i[t](r,r.exports,s),r.exports}s.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return s.d(e,{a:e}),e},s.d=(t,e)=>{for(var i in e)s.o(e,i)&&!s.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},s.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var r={};s.d(r,{default:()=>b});var o=s(944),n=s.n(o),h=s(512),p=s.n(h);let{candlestick:{prototype:{pointClass:l}},hlc:{prototype:{pointClass:u}}}=p().seriesTypes,{composed:c}=n(),{candlestick:f}=p().seriesTypes,{addEvent:d,merge:y,pushUnique:g}=n();function k(){this.series.forEach(t=>{t.is("heikinashi")&&(t.heikiashiData.length=0,t.getHeikinashiData())})}function D(){let t=this.points,e=this.heikiashiData,i=this.cropStart||0;for(let a=0;a<t.length;a++){let s=t[a],r=e[a+i];s.open=r[0],s.high=r[1],s.low=r[2],s.close=r[3]}}function x(){this.heikiashiData.length&&(this.heikiashiData.length=0)}class m extends f{constructor(){super(...arguments),this.heikiashiData=[]}static compose(t,e){f.compose(t),g(c,"HeikinAshi")&&(d(e,"postProcessData",k),d(m,"afterTranslate",D),d(m,"updatedData",x))}getHeikinashiData(){let t=this.allGroupedTable||this.dataTable,e=t.rowCount,i=this.heikiashiData;if(!i.length&&e){this.modifyFirstPointValue(t.getRow(0,this.pointArrayMap));for(let a=1;a<e;a++)this.modifyDataPoint(t.getRow(a,this.pointArrayMap),i[a-1])}this.heikiashiData=i}init(){super.init.apply(this,arguments),this.heikiashiData=[]}modifyFirstPointValue(t){let e=(t[0]+t[1]+t[2]+t[3])/4,i=(t[0]+t[3])/2;this.heikiashiData.push([e,t[1],t[2],i])}modifyDataPoint(t,e){let i=(e[0]+e[3])/2,a=(t[0]+t[1]+t[2]+t[3])/4,s=Math.max(t[1],a,i),r=Math.min(t[2],a,i);this.heikiashiData.push([i,s,r,a])}}m.defaultOptions=y(f.defaultOptions,{dataGrouping:{groupAll:!0}}),m.prototype.pointClass=class extends l{},p().registerSeriesType("heikinashi",m);let v=n();m.compose(v.Series,v.Axis);let b=n();return r.default})())(s._Highcharts,s._Highcharts.SeriesRegistry)),o=e({__proto__:null,default:t(r)},[r]);export{o as h};
//# sourceMappingURL=heikinashi-Kb-Y_V6U.js.map
