!/**
 * Highstock JS v12.5.0 (2026-01-12)
 * @module highcharts/indicators/dmi
 * @requires highcharts
 * @requires highcharts/modules/stock
 *
 * Indicator series type for Highcharts Stock
 *
 * (c) 2010-2026 Highsoft AS
 * Author: Rafal Sebestjanski
 *
 * 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(require("highcharts"),require("highcharts").SeriesRegistry):"function"==typeof define&&define.amd?define("highcharts/indicators/dmi",[["highcharts/highcharts"],["highcharts/highcharts","SeriesRegistry"]],e):"object"==typeof exports?exports["highcharts/indicators/dmi"]=e(require("highcharts"),require("highcharts").SeriesRegistry):t.Highcharts=e(t.Highcharts,t.Highcharts.SeriesRegistry)}(this,function(t,e){return function(){"use strict";var r,i,o={512:function(t){t.exports=e},944:function(e){e.exports=t}},n={};function a(t){var e=n[t];if(void 0!==e)return e.exports;var r=n[t]={exports:{}};return o[t](r,r.exports,a),r.exports}a.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return a.d(e,{a:e}),e},a.d=function(t,e){for(var r in e)a.o(e,r)&&!a.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},a.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)};var s={};a.d(s,{default:function(){return A}});var p=a(944),l=a.n(p),h=a(512),u=a.n(h),c=u().seriesTypes.sma.prototype,f=l().defined,y=l().error,d=l().merge;!function(t){var e=["bottomLine"],r=["top","bottom"],i=["top"];function o(t){return"plot"+t.charAt(0).toUpperCase()+t.slice(1)}function n(t,e){var r=[];return(t.pointArrayMap||[]).forEach(function(t){t!==e&&r.push(o(t))}),r}function a(){var t,e=this,r=e.pointValKey,i=e.linesApiNames,a=e.areaLinesNames,s=e.points,p=e.options,l=e.graph,h={options:{gapSize:p.gapSize}},u=[],g=n(e,r),m=s.length;if(g.forEach(function(e,r){for(u[r]=[];m--;)t=s[m],u[r].push({x:t.x,plotX:t.plotX,plotY:t[e],isNull:!f(t[e])});m=s.length}),e.userOptions.fillColor&&a.length){var v=u[g.indexOf(o(a[0]))],D=1===a.length?s:u[g.indexOf(o(a[1]))],x=e.color;e.points=D,e.nextPoints=v,e.color=e.userOptions.fillColor,e.options=d(s,h),e.graph=e.area,e.fillGraph=!0,c.drawGraph.call(e),e.area=e.graph,delete e.nextPoints,delete e.fillGraph,e.color=x}i.forEach(function(t,r){u[r]?(e.points=u[r],p[t]?e.options=d(p[t].styles,h):y('Error: "There is no '+t+' in DOCS options declared. Check if linesApiNames are consistent with your DOCS line names."'),e.graph=e["graph"+t],c.drawGraph.call(e),e["graph"+t]=e.graph):y('Error: "'+t+" doesn't have equivalent in pointArrayMap. To many elements in linesApiNames relative to pointArrayMap.\"")}),e.points=s,e.options=p,e.graph=l,c.drawGraph.call(e)}function s(t){var e,r=[],i=[];if(t=t||this.points,this.fillGraph&&this.nextPoints){if((e=c.getGraphPath.call(this,this.nextPoints))&&e.length){e[0][0]="L",r=c.getGraphPath.call(this,t),i=e.slice(0,r.length);for(var o=i.length-1;o>=0;o--)r.push(i[o])}}else r=c.getGraphPath.apply(this,arguments);return r}function p(t){var e=[];return(this.pointArrayMap||[]).forEach(function(r){e.push(t[r])}),e}function l(){var t,e=this,r=this.pointArrayMap,i=[];i=n(this),c.translate.apply(this,arguments),this.points.forEach(function(o){r.forEach(function(r,n){t=o[r],e.dataModify&&(t=e.dataModify.modifyValue(t)),null!==t&&(o[i[n]]=e.yAxis.toPixels(t,!0))})})}t.compose=function(t){var o=t.prototype;return o.linesApiNames=o.linesApiNames||e.slice(),o.pointArrayMap=o.pointArrayMap||r.slice(),o.pointValKey=o.pointValKey||"top",o.areaLinesNames=o.areaLinesNames||i.slice(),o.drawGraph=a,o.getGraphPath=s,o.toYData=p,o.translate=l,t}}(i||(i={}));var g=i,m=(r=function(t,e){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function i(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}),v=u().seriesTypes.sma,D=l().correctFloat,x=l().extend,M=l().isArray,b=l().merge,I=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return m(e,t),e.prototype.calculateDM=function(t,e,r){var i=t[e][1],o=t[e][2],n=t[e-1][1],a=t[e-1][2];return D(i-n>a-o?r?Math.max(i-n,0):0:r?0:Math.max(a-o,0))},e.prototype.calculateDI=function(t,e){return t/e*100},e.prototype.calculateDX=function(t,e){return D(Math.abs(t-e)/Math.abs(t+e)*100)},e.prototype.smoothValues=function(t,e,r){return D(t-t/r+e)},e.prototype.getTR=function(t,e){return D(Math.max(t[1]-t[2],e?Math.abs(t[1]-e[3]):0,e?Math.abs(t[2]-e[3]):0))},e.prototype.getValues=function(t,e){var r=e.period,i=t.xData,o=t.yData,n=o?o.length:0,a=[],s=[],p=[];if(!(i.length<=r)&&M(o[0])&&4===o[0].length){var l,h=0,u=0,c=0;for(l=1;l<n;l++){var f=void 0,y=void 0,d=void 0,g=void 0,m=void 0,v=void 0,D=void 0,x=void 0,b=void 0;l<=r?(g=this.calculateDM(o,l,!0),m=this.calculateDM(o,l),v=this.getTR(o[l],o[l-1]),h+=g,u+=m,c+=v,l===r&&(D=this.calculateDI(h,c),x=this.calculateDI(u,c),b=this.calculateDX(h,u),a.push([i[l],b,D,x]),s.push(i[l]),p.push([b,D,x]))):(g=this.calculateDM(o,l,!0),m=this.calculateDM(o,l),v=this.getTR(o[l],o[l-1]),f=this.smoothValues(h,g,r),y=this.smoothValues(u,m,r),d=this.smoothValues(c,v,r),h=f,u=y,c=d,D=this.calculateDI(h,c),x=this.calculateDI(u,c),b=this.calculateDX(h,u),a.push([i[l],b,D,x]),s.push(i[l]),p.push([b,D,x]))}return{values:a,xData:s,yData:p}}},e.defaultOptions=b(v.defaultOptions,{params:{index:void 0},marker:{enabled:!1},tooltip:{pointFormat:'<span style="color: {point.color}">●</span><b> {series.name}</b><br/><span style="color: {point.color}">DX</span>: {point.y}<br/><span style="color: {point.series.options.plusDILine.styles.lineColor}">+DI</span>: {point.plusDI}<br/><span style="color: {point.series.options.minusDILine.styles.lineColor}">-DI</span>: {point.minusDI}<br/>'},plusDILine:{styles:{lineWidth:1,lineColor:"#06b535"}},minusDILine:{styles:{lineWidth:1,lineColor:"#f21313"}},dataGrouping:{approximation:"averages"}}),e}(v);x(I.prototype,{areaLinesNames:[],nameBase:"DMI",linesApiNames:["plusDILine","minusDILine"],pointArrayMap:["y","plusDI","minusDI"],parallelArrays:["x","y","plusDI","minusDI"],pointValKey:"y"}),g.compose(I),u().registerSeriesType("dmi",I);var A=l();return s.default}()});