!/**
 * Highstock JS v12.6.0 (2026-04-13)
 * @module highcharts/indicators/regressions
 * @requires highcharts
 * @requires highcharts/modules/stock
 *
 * Indicator series type for Highcharts Stock
 *
 * (c) 2010-2026 Highsoft AS
 * Author: Kamil Kulig
 *
 * A commercial license may be required depending on use.
 * See www.highcharts.com/license
 */function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(e._Highcharts,e._Highcharts.SeriesRegistry):"function"==typeof define&&define.amd?define("highcharts/indicators/regressions",["highcharts/highcharts"],function(e){return t(e,e.SeriesRegistry)}):"object"==typeof exports?exports["highcharts/indicators/regressions"]=t(e._Highcharts,e._Highcharts.SeriesRegistry):e.Highcharts=t(e.Highcharts,e.Highcharts.SeriesRegistry)}("u"<typeof window?this:window,(e,t)=>(()=>{"use strict";var r={512:e=>{e.exports=t},944:t=>{t.exports=e}},n={};function s(e){var t=n[e];if(void 0!==t)return t.exports;var i=n[e]={exports:{}};return r[e](i,i.exports,s),i.exports}s.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},s.d=(e,t)=>{for(var r in t)s.o(t,r)&&!s.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var i={};s.d(i,{default:()=>j});var o=s(944),a=s.n(o),l=s(512),p=s.n(l);let{doc:c,win:u}=a();function g(e,t){let r;for(r in e||(e={}),t)e[r]=t[r];return e}function f(e){return h(e)&&"number"==typeof e.nodeType}function d(e){let t=Object.prototype.toString.call(e);return"[object Array]"===t||"[object Array Iterator]"===t}function h(e,t){return!!e&&"object"==typeof e&&(!t||!d(e))}function y(e,...t){let r,n=[e,...t],s={},i=function(e,t){return"object"!=typeof e&&(e={}),function(e,t,r){for(let r in e)Object.hasOwnProperty.call(e,r)&&t.call((0,e[r]),e[r],r,e)}(t,function(r,n){if("__proto__"!==n&&"constructor"!==n){let s;!h(r,!0)||(s=r?.constructor,h(r,!0)&&!f(r)&&s?.name&&"Object"!==s.name)||f(r)?e[n]=t[n]:e[n]=i(e[n]||{},r)}}),e};!0===e&&(s=n[1],n=Array.prototype.slice.call(n,2));let o=n.length;for(r=0;r<o;r++)s=i(s,n[r]);return s}Array.prototype.find;let{sma:m}=p().seriesTypes;class x extends m{getRegressionLineParameters(e,t){let r=this.options.params.index,n=function(e,t){return d(e)?e[t]:e},s=e.reduce(function(e,t){return t+e},0),i=t.reduce(function(e,t){return n(t,r)+e},0),o=s/e.length,a=i/t.length,l,p,c=0,u=0;for(p=0;p<e.length;p++)c+=(l=e[p]-o)*(n(t[p],r)-a),u+=Math.pow(l,2);let g=u?c/u:0;return{slope:g,intercept:a-g*o}}getEndPointY(e,t){return e.slope*t+e.intercept}transformXData(e,t){let r=e[0];return e.map(function(e){return(e-r)/t})}findClosestDistance(e){let t,r,n;for(n=1;n<e.length-1;n++)(t=e[n]-e[n-1])>0&&(void 0===r||t<r)&&(r=t);return r}getValues(e,t){let r,n,s,i,o,a,l,p,c,u=e.xData,g=e.yData,f=t.period,h={xData:[],yData:[],values:[]},y=this.options.params.xAxisUnit||this.findClosestDistance(u);for(n=f-1;n<=u.length-1;n++)s=n-f+1,i=n+1,o=u[n],l=u.slice(s,i),p=g.slice(s,i),c=this.transformXData(l,y),r=this.getRegressionLineParameters(c,p),a=this.getEndPointY(r,c[c.length-1]),h.values.push({regressionLineParameters:r,x:o,y:a}),d(h.xData)&&h.xData.push(o),d(h.yData)&&h.yData.push(a);return h}}x.defaultOptions=y(m.defaultOptions,{params:{xAxisUnit:null},tooltip:{valueDecimals:4}}),g(x.prototype,{nameBase:"Linear Regression Indicator"}),p().registerSeriesType("linearregression",x),p().registerSeriesType("linearRegression",x);let{linearregression:b}=p().seriesTypes;class O extends b{getEndPointY(e){return e.slope}}O.defaultOptions=y(b.defaultOptions),g(O.prototype,{nameBase:"Linear Regression Slope Indicator"}),p().registerSeriesType("linearregressionslope",O),p().registerSeriesType("linearRegressionSlope",O);let{linearregression:S}=p().seriesTypes;class T extends S{getEndPointY(e){return e.intercept}}T.defaultOptions=y(S.defaultOptions),g(T.prototype,{nameBase:"Linear Regression Intercept Indicator"}),p().registerSeriesType("linearregressionintercept",T),p().registerSeriesType("linearRegressionIntercept",T);let{linearregression:R}=p().seriesTypes;class D extends R{slopeToAngle(e){return 180/Math.PI*Math.atan(e)}getEndPointY(e){return this.slopeToAngle(e.slope)}}D.defaultOptions=y(R.defaultOptions,{tooltip:{pointFormat:'<span style="color:{point.color}">●</span>{series.name}: <b>{point.y}\xb0</b><br/>'}}),g(D.prototype,{nameBase:"Linear Regression Angle Indicator"}),p().registerSeriesType("linearregressionangle",D),p().registerSeriesType("linearRegressionAngle",D);let j=a();return i.default})());