!/**
 * Highstock JS v12.5.0 (2026-01-12)
 * @module highcharts/indicators/macd
 * @requires highcharts
 * @requires highcharts/modules/stock
 *
 * Indicator series type for Highcharts Stock
 *
 * (c) 2010-2026 Highsoft AS
 * Author: Sebastian Bochan
 *
 * A commercial license may be required depending on use.
 * See www.highcharts.com/license
 */function(o,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("highcharts"),require("highcharts").SeriesRegistry):"function"==typeof define&&define.amd?define("highcharts/indicators/macd",[["highcharts/highcharts"],["highcharts/highcharts","SeriesRegistry"]],t):"object"==typeof exports?exports["highcharts/indicators/macd"]=t(require("highcharts"),require("highcharts").SeriesRegistry):o.Highcharts=t(o.Highcharts,o.Highcharts.SeriesRegistry)}(this,function(o,t){return function(){"use strict";var e,i={512:function(o){o.exports=t},944:function(t){t.exports=o}},s={};function n(o){var t=s[o];if(void 0!==t)return t.exports;var e=s[o]={exports:{}};return i[o](e,e.exports,n),e.exports}n.n=function(o){var t=o&&o.__esModule?function(){return o.default}:function(){return o};return n.d(t,{a:t}),t},n.d=function(o,t){for(var e in t)n.o(t,e)&&!n.o(o,e)&&Object.defineProperty(o,e,{enumerable:!0,get:t[e]})},n.o=function(o,t){return Object.prototype.hasOwnProperty.call(o,t)};var r={};n.d(r,{default:function(){return v}});var a=n(944),p=n.n(a),l=n(512),h=n.n(l),c=(e=function(o,t){return(e=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(o,t){o.__proto__=t}||function(o,t){for(var e in t)t.hasOwnProperty(e)&&(o[e]=t[e])})(o,t)},function(o,t){function i(){this.constructor=o}e(o,t),o.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),d=p().noop,u=h().seriesTypes.sma,g=p().extend,y=p().correctFloat,f=p().defined,m=p().merge,x=function(o){function t(){return null!==o&&o.apply(this,arguments)||this}return c(t,o),t.prototype.init=function(){h().seriesTypes.sma.prototype.init.apply(this,arguments);var o,t,e,i,s,n=this.color,r=this.colorIndex;this.options&&(f(this.colorIndex)&&((null==(o=this.options.signalLine)?void 0:o.styles)&&!this.options.signalLine.styles.lineColor&&(this.options.colorIndex=this.colorIndex+1,this.getCyclic("color",void 0,this.chart.options.colors),this.options.signalLine.styles.lineColor=this.color),(null==(t=this.options.macdLine)?void 0:t.styles)&&!this.options.macdLine.styles.lineColor&&(this.options.colorIndex=this.colorIndex+1,this.getCyclic("color",void 0,this.chart.options.colors),this.options.macdLine.styles.lineColor=this.color)),this.macdZones={zones:null==(e=this.options.macdLine)?void 0:e.zones,startIndex:0},this.signalZones={zones:null==(i=this.macdZones.zones)?void 0:i.concat(this.options.signalLine.zones),startIndex:null==(s=this.macdZones.zones)?void 0:s.length}),this.color=n,this.colorIndex=r},t.prototype.toYData=function(o){return[o.y,o.signal,o.MACD]},t.prototype.translate=function(){var o=this,t=["plotSignal","plotMACD"];p().seriesTypes.column.prototype.translate.apply(o),o.points.forEach(function(e){[e.signal,e.MACD].forEach(function(i,s){null!==i&&(e[t[s]]=o.yAxis.toPixels(i,!0))})})},t.prototype.destroy=function(){this.graph=null,this.graphmacd=this.graphmacd&&this.graphmacd.destroy(),this.graphsignal=this.graphsignal&&this.graphsignal.destroy(),h().seriesTypes.sma.prototype.destroy.apply(this,arguments)},t.prototype.drawGraph=function(){for(var o,t=this,e=t.points,i=t.options,s=t.zones,n={options:{gapSize:i.gapSize}},r=[[],[]],a=e.length;a--;)f((o=e[a]).plotMACD)&&r[0].push({plotX:o.plotX,plotY:o.plotMACD,isNull:!f(o.plotMACD)}),f(o.plotSignal)&&r[1].push({plotX:o.plotX,plotY:o.plotSignal,isNull:!f(o.plotMACD)});["macd","signal"].forEach(function(o,e){var s;t.points=r[e],t.options=m((null==(s=i[""+o+"Line"])?void 0:s.styles)||{},n),t.graph=t["graph".concat(o)],t.zones=(t[""+o+"Zones"].zones||[]).slice(t[""+o+"Zones"].startIndex||0),h().seriesTypes.sma.prototype.drawGraph.call(t),t["graph".concat(o)]=t.graph}),t.points=e,t.options=i,t.zones=s},t.prototype.applyZones=function(){var o=this.zones;this.zones=this.signalZones.zones,h().seriesTypes.sma.prototype.applyZones.call(this),this.graphmacd&&this.options.macdLine.zones.length&&this.graphmacd.hide(),this.zones=o},t.prototype.getValues=function(o,t){var e,i,s,n=t.longPeriod-t.shortPeriod,r=[],a=[],p=[],l=0,c=[];if(!(o.xData.length<t.longPeriod+t.signalPeriod)){for(s=0,e=h().seriesTypes.ema.prototype.getValues(o,{period:t.shortPeriod,index:t.index}),i=h().seriesTypes.ema.prototype.getValues(o,{period:t.longPeriod,index:t.index}),e=e.values,i=i.values;s<=e.length;s++)f(i[s])&&f(i[s][1])&&f(e[s+n])&&f(e[s+n][0])&&r.push([e[s+n][0],0,null,e[s+n][1]-i[s][1]]);for(s=0;s<r.length;s++)a.push(r[s][0]),p.push([0,null,r[s][3]]);for(s=0,c=(c=h().seriesTypes.ema.prototype.getValues({xData:a,yData:p},{period:t.signalPeriod,index:2})).values;s<r.length;s++)r[s][0]>=c[0][0]&&(r[s][2]=c[l][1],p[s]=[0,c[l][1],r[s][3]],null===r[s][3]?(r[s][1]=0,p[s][0]=0):(r[s][1]=y(r[s][3]-c[l][1]),p[s][0]=y(r[s][3]-c[l][1])),l++);return{values:r,xData:a,yData:p}}},t.defaultOptions=m(u.defaultOptions,{params:{shortPeriod:12,longPeriod:26,signalPeriod:9,period:26},signalLine:{zones:[],styles:{lineWidth:1,lineColor:void 0}},macdLine:{zones:[],styles:{lineWidth:1,lineColor:void 0}},threshold:0,groupPadding:.1,pointPadding:.1,crisp:!1,states:{hover:{halo:{size:0}}},tooltip:{pointFormat:'<span style="color:{point.color}">●</span> <b> {series.name}</b><br/>Value: {point.MACD}<br/>Signal: {point.signal}<br/>Histogram: {point.y}<br/>'},dataGrouping:{approximation:"averages"},minPointLength:0}),t}(u);g(x.prototype,{nameComponents:["longPeriod","shortPeriod","signalPeriod"],pointArrayMap:["y","signal","MACD"],parallelArrays:["x","y","signal","MACD"],pointValKey:"y",markerAttribs:d,getColumnMetrics:p().seriesTypes.column.prototype.getColumnMetrics,crispCol:p().seriesTypes.column.prototype.crispCol,drawPoints:p().seriesTypes.column.prototype.drawPoints}),h().registerSeriesType("macd",x);var v=p();return r.default}()});