!/**
 * Highstock JS v12.5.0 (2026-01-12)
 * @module highcharts/modules/datagrouping
 * @requires highcharts
 *
 * Data grouping module
 *
 * (c) 2010-2026 Highsoft AS
 * Author: Torstein Hønsi
 *
 * 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,require("highcharts").Templating):"function"==typeof define&&define.amd?define("highcharts/modules/datagrouping",[["highcharts/highcharts"],["highcharts/highcharts","SeriesRegistry"],["highcharts/highcharts","Templating"]],e):"object"==typeof exports?exports["highcharts/modules/datagrouping"]=e(require("highcharts"),require("highcharts").SeriesRegistry,require("highcharts").Templating):t.Highcharts=e(t.Highcharts,t.Highcharts.SeriesRegistry,t.Highcharts.Templating)}(this,function(t,e,i){return function(){"use strict";var o,r,n,a,s={512:function(t){t.exports=e},944:function(e){e.exports=t},984:function(t){t.exports=i}},u={};function l(t){var e=u[t];if(void 0!==e)return e.exports;var i=u[t]={exports:{}};return s[t](i,i.exports,l),i.exports}l.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return l.d(e,{a:e}),e},l.d=function(t,e){for(var i in e)l.o(e,i)&&!l.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},l.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)};var h={};l.d(h,{default:function(){return tb}});var p=l(944),d=l.n(p),c={},g=d().arrayMax,f=d().arrayMin,m=d().correctFloat,v=d().extend,y=d().isNumber;function x(t){var e=t.length,i=G(t);return y(i)&&e&&(i=m(i/e)),i}function G(t){var e,i=t.length;if(!i&&t.hasNulls)e=null;else if(i)for(e=0;i--;)e+=t[i];return e}var b={average:x,averages:function(){var t=[];return[].forEach.call(arguments,function(e){t.push(x(e))}),void 0===t[0]?void 0:t},close:function(t){return t.length?t[t.length-1]:t.hasNulls?null:void 0},high:function(t){return t.length?g(t):t.hasNulls?null:void 0},hlc:function(t,e,i){if(t=c.high(t),e=c.low(e),i=c.close(i),y(t)||y(e)||y(i))return[t,e,i]},low:function(t){return t.length?f(t):t.hasNulls?null:void 0},ohlc:function(t,e,i,o){if(t=c.open(t),e=c.high(e),i=c.low(i),o=c.close(o),y(t)||y(e)||y(i)||y(o))return[t,e,i,o]},open:function(t){return t.length?t[0]:t.hasNulls?null:void 0},range:function(t,e){return(t=c.low(t),e=c.high(e),y(t)||y(e))?[t,e]:null===t&&null===e?null:void 0},sum:G};v(c,b);var M={groupPixelWidth:2,dateTimeLabelFormats:{millisecond:["%[AebHMSL]","%[AebHMSL]","-%[HMSL]"],second:["%[AebHMS]","%[AebHMS]","-%[HMS]"],minute:["%[AebHM]","%[AebHM]","-%[HM]"],hour:["%[AebHM]","%[AebHM]","-%[HM]"],day:["%[AebY]","%[Aeb]","-%[AebY]"],week:["%v %[AebY]","%[Aeb]","-%[AebY]"],month:["%[BY]","%[B]","-%[BY]"],year:["%Y","%Y","-%Y"]}},A={line:{},spline:{},area:{},areaspline:{},arearange:{},column:{groupPixelWidth:10},columnrange:{groupPixelWidth:10},candlestick:{groupPixelWidth:10},ohlc:{groupPixelWidth:5},hlc:{groupPixelWidth:5},heikinashi:{groupPixelWidth:10}},T=[["millisecond",[1,2,5,10,20,25,50,100,200,500]],["second",[1,2,5,10,15,30]],["minute",[1,2,5,10,15,30]],["hour",[1,2,3,4,6,8,12]],["day",[1]],["week",[1]],["month",[1,3,6]],["year",null]],D=d().addEvent,C=d().extend,w=d().merge,P=d().pick;function S(t){var e=this,i=e.series;i.forEach(function(t){t.groupPixelWidth=void 0}),i.forEach(function(i){i.groupPixelWidth=e.getGroupPixelWidth&&e.getGroupPixelWidth(),i.groupPixelWidth&&(i.hasProcessed=!0),i.applyGrouping(!!t.hasExtremesChanged)})}function k(){for(var t,e,i=this.series,o=i.length,r=0,n=!1;o--;)(e=i[o].options.dataGrouping)&&(r=Math.max(r,P(e.groupPixelWidth,M.groupPixelWidth)),t=(i[o].dataTable.getModified()||i[o].dataTable).rowCount,(i[o].groupPixelWidth||t>this.chart.plotSizeX/r||t&&e.forced)&&(n=!0));return n?r:0}function R(){this.series.forEach(function(t){t.hasProcessed=!1})}function F(t,e){var i;if(e=P(e,!0),t||(t={forced:!1,units:null}),this instanceof r)for(i=this.series.length;i--;)this.series[i].update({dataGrouping:t},!1);else this.chart.options.series.forEach(function(e){e.dataGrouping="boolean"==typeof t?t:w(t,e.dataGrouping)});this.ordinal&&(this.ordinal.slope=void 0),e&&this.chart.redraw()}var O=function(t){r=t;var e=t.prototype;e.applyGrouping||(D(t,"afterSetScale",R),D(t,"postProcessData",S),C(e,{applyGrouping:S,getGroupPixelWidth:k,setDataGrouping:F}))},W=function(t,e,i){if(i||2==arguments.length)for(var o,r=0,n=e.length;r<n;r++)!o&&r in e||(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))};(o=n||(n={})).setLength=function(t,e,i){return Array.isArray(t)?(t.length=e,t):t[i?"subarray":"slice"](0,e)},o.splice=function(t,e,i,o,r){if(void 0===r&&(r=[]),Array.isArray(t))return Array.isArray(r)||(r=Array.from(r)),{removed:t.splice.apply(t,W([e,i],r,!1)),array:t};var n=Object.getPrototypeOf(t).constructor,a=t[o?"subarray":"slice"](e,e+i),s=new n(t.length-i+r.length);return s.set(t.subarray(0,e),0),s.set(r,e),s.set(t.subarray(e+i),e+r.length),{removed:a,array:s}},o.convertToNumber=function(t,e){switch(typeof t){case"boolean":return+!!t;case"number":return isNaN(t)&&!e?null:t;default:return isNaN(t=parseFloat("".concat(null!=t?t:"")))&&!e?null:t}};var N=n,E=N.setLength,H=N.splice,I=d().fireEvent,j=d().objectEach,q=d().uniqueKey,L=function(){function t(t){void 0===t&&(t={});var e=this;this.autoId=!t.id,this.columns={},this.id=t.id||q(),this.rowCount=0,this.versionTag=q();var i=0;j(t.columns||{},function(t,o){e.columns[o]=t.slice(),i=Math.max(i,t.length)}),this.applyRowCount(i)}return t.prototype.applyRowCount=function(t){var e=this;this.rowCount=t,j(this.columns,function(i,o){i.length!==t&&(e.columns[o]=E(i,t))})},t.prototype.deleteRows=function(t,e){var i=this;if(void 0===e&&(e=1),e>0&&t<this.rowCount){var o=0;j(this.columns,function(r,n){i.columns[n]=H(r,t,e).array,o=r.length}),this.rowCount=o}I(this,"afterDeleteRows",{rowIndex:t,rowCount:e}),this.versionTag=q()},t.prototype.getColumn=function(t,e){return this.columns[t]},t.prototype.getColumns=function(t,e){var i=this;return(t||Object.keys(this.columns)).reduce(function(t,e){return t[e]=i.columns[e],t},{})},t.prototype.getRow=function(t,e){var i=this;return(e||Object.keys(this.columns)).map(function(e){var o;return null==(o=i.columns[e])?void 0:o[t]})},t.prototype.setColumn=function(t,e,i,o){var r;void 0===e&&(e=[]),void 0===i&&(i=0),this.setColumns(((r={})[t]=e,r),i,o)},t.prototype.setColumns=function(t,e,i){var o=this,r=this.rowCount;j(t,function(t,e){o.columns[e]=t.slice(),r=t.length}),this.applyRowCount(r),(null==i?void 0:i.silent)||(I(this,"afterSetColumns"),this.versionTag=q())},t.prototype.setRow=function(t,e,i,o){void 0===e&&(e=this.rowCount);var r=this.columns,n=i?this.rowCount+1:e+1,a=Object.keys(t);if((null==o?void 0:o.addColumns)!==!1)for(var s=0,u=a.length;s<u;s++){var l=a[s];r[l]||(r[l]=[])}j(r,function(a,s){var u,l;a||(null==o?void 0:o.addColumns)===!1||(a=Array(n)),a&&(i?a=H(a,e,0,!0,[null!=(u=t[s])?u:null]).array:a[e]=null!=(l=t[s])?l:null,r[s]=a)}),n>this.rowCount&&this.applyRowCount(n),(null==o?void 0:o.silent)||(I(this,"afterSetRows"),this.versionTag=q())},t.prototype.getModified=function(){return this.modified||this},t}(),Y=d().addEvent,z=d().getMagnitude,X=d().normalizeTickInterval,B=d().timeUnits;!function(t){function e(){return this.chart.time.getTimeTicks.apply(this.chart.time,arguments)}function i(){if("datetime"!==this.type){this.dateTime=void 0;return}this.dateTime||(this.dateTime=new o(this))}t.compose=function(t){return t.keepProps.includes("dateTime")||(t.keepProps.push("dateTime"),t.prototype.getTimeTicks=e,Y(t,"afterSetType",i)),t};var o=function(){function t(t){this.axis=t}return t.prototype.normalizeTimeTickInterval=function(t,e){var i,o=e||[["millisecond",[1,2,5,10,20,25,50,100,200,500]],["second",[1,2,5,10,15,30]],["minute",[1,2,5,10,15,30]],["hour",[1,2,3,4,6,8,12]],["day",[1,2]],["week",[1,2]],["month",[1,2,3,4,6]],["year",null]],r=o[o.length-1],n=B[r[0]],a=r[1];for(i=0;i<o.length&&(n=B[(r=o[i])[0]],a=r[1],!o[i+1]||!(t<=(n*a[a.length-1]+B[o[i+1][0]])/2));i++);n===B.year&&t<5*n&&(a=[1,2,5]);var s=X(t/n,a,"year"===r[0]?Math.max(z(t/n),1):1);return{unitRange:n,count:s,unitName:r[0]}},t.prototype.getXDateFormat=function(t,e){var i=this.axis,o=i.chart.time;return i.closestPointRange?o.getDateFormat(i.closestPointRange,t,i.options.startOfWeek,e)||o.resolveDTLFormat(e.year).main:o.resolveDTLFormat(e.day).main},t}();t.Additions=o}(a||(a={}));var U=a,_=l(512),K=l.n(_)().series.prototype,J=d().addEvent,Q=d().defined,V=d().error,Z=d().extend,$=d().isNumber,tt=d().merge,te=d().pick,ti=d().splat,to=K.generatePoints;function tr(t){var e,i,o,r,n=this.chart,a=this.options.dataGrouping,s=!1!==this.allowDG&&a&&te(a.enabled,n.options.isStock),u=this.reserveSpace(),l=this.currentDataGrouping,h=!1;s&&!this.requireSorting&&(this.requireSorting=h=!0);var p=!1==(x=this,G=t,!(x.isCartesian&&!x.isDirty&&!x.xAxis.isDirty&&!x.yAxis.isDirty&&!G))||!s;if(h&&(this.requireSorting=!1),!p){this.destroyGroupedData();var d=a.groupAll?this.dataTable:this.dataTable.getModified()||this.dataTable,c=this.getColumn("x",!a.groupAll),g=n.plotSizeX,f=this.xAxis,m=f.getExtremes(),v=f.options.ordinal,y=this.groupPixelWidth;if(y&&c&&d.rowCount&&g&&$(m.min)){i=!0,this.isDirty=!0,this.points=null;var x,G,b,M=m.min,A=m.max,D=v&&f.ordinal&&f.ordinal.getGroupIntervalFactor(M,A,this)||1,C=y*(A-M)/g*D,w=f.getTimeTicks(U.Additions.prototype.normalizeTimeTickInterval(C,a.units||T),Math.min(M,c[0]),Math.max(A,c[c.length-1]),f.options.startOfWeek,c,this.closestPointRange),P=K.groupData.apply(this,[d,w,a.approximation]),S=P.modified,k=S.getColumn("x",!0),R=0;for((null==a?void 0:a.smoothed)&&S.rowCount&&(a.firstAnchor="firstPoint",a.anchor="middle",a.lastAnchor="lastPoint",V(32,!1,n,{"dataGrouping.smoothed":"use dataGrouping.anchor"})),e=1;e<w.length;e++)w.info.segmentStarts&&-1!==w.info.segmentStarts.indexOf(e)||(R=Math.max(w[e]-w[e-1],R));(o=w.info).gapSize=R,this.closestPointRange=w.info.totalRange,this.groupMap=P.groupMap,this.currentDataGrouping=o,function(t,e,i){var o=t.options.dataGrouping,r=t.currentDataGrouping&&t.currentDataGrouping.gapSize,n=t.getColumn("x");if(o&&n.length&&r&&t.groupMap){var a=e.length-1,s=o.anchor,u=o.firstAnchor,l=o.lastAnchor,h=e.length-1,p=0;if(u&&n[0]>=e[0]){p++;var d=t.groupMap[0].start,c=t.groupMap[0].length,g=void 0;$(d)&&$(c)&&(g=d+(c-1)),e[0]=({start:e[0],middle:e[0]+.5*r,end:e[0]+r,firstPoint:n[0],lastPoint:g&&n[g]})[u]}if(a>0&&l&&r&&e[a]>=i-r){h--;var f=t.groupMap[t.groupMap.length-1].start;e[a]=({start:e[a],middle:e[a]+.5*r,end:e[a]+r,firstPoint:f&&n[f],lastPoint:n[n.length-1]})[l]}if(s&&"start"!==s)for(var m=r*({middle:.5,end:1})[s];h>=p;)e[h]+=m,h--}}(this,k||[],A),u&&k&&(Q((b=k)[0])&&$(f.min)&&$(f.dataMin)&&b[0]<f.min&&((!Q(f.options.min)&&f.min<=f.dataMin||f.min===f.dataMin)&&(f.min=Math.min(b[0],f.min)),f.dataMin=Math.min(b[0],f.dataMin)),Q(b[b.length-1])&&$(f.max)&&$(f.dataMax)&&b[b.length-1]>f.max&&((!Q(f.options.max)&&$(f.dataMax)&&f.max>=f.dataMax||f.max===f.dataMax)&&(f.max=Math.max(b[b.length-1],f.max)),f.dataMax=Math.max(b[b.length-1],f.dataMax))),a.groupAll&&(this.allGroupedTable=S,k=(S=(r=this.cropData(S,f.min||0,f.max||0)).modified).getColumn("x"),this.cropStart=r.start),this.dataTable.modified=S}else this.groupMap=void 0,this.currentDataGrouping=void 0;this.hasGroupedData=i,this.preventGraphAnimation=(l&&l.totalRange)!==(o&&o.totalRange)}}function tn(){this.groupedData&&(this.groupedData.forEach(function(t,e){t&&(this.groupedData[e]=t.destroy?t.destroy():null)},this),this.groupedData.length=0,delete this.allGroupedTable)}function ta(){to.apply(this),this.destroyGroupedData(),this.groupedData=this.hasGroupedData?this.points:null}function ts(){return this.is("arearange")?"range":this.is("ohlc")?"ohlc":this.is("hlc")?"hlc":this.is("column")||this.options.cumulative?"sum":"average"}function tu(t,e,i){var o,r,n,a=t.getColumn("x",!0)||[],s=t.getColumn("y",!0),u=this,l=u.data,h=u.options&&u.options.data,p=[],d=new L,g=[],f=t.rowCount,m=!!s,v=[],y=u.pointArrayMap,x=y&&y.length,G=["x"].concat(y||["y"]),b=(y||["y"]).map(function(){return[]}),M=this.options.dataGrouping&&this.options.dataGrouping.groupAll,A=0,T=0,D="function"==typeof i?i:i&&c[i]?c[i]:c[u.getDGApproximation&&u.getDGApproximation()||"average"];if(x)for(var C=y.length;C--;)v.push([]);else v.push([]);for(var w=x||1,P=0;P<=f;P++)if(!(a[P]<e[0])){for(;void 0!==e[A+1]&&a[P]>=e[A+1]||P===f;){if(o=e[A],u.dataGroupInfo={start:M?T:u.cropStart+T,length:v[0].length,groupStart:o},n=D.apply(u,v),u.pointClass&&!Q(u.dataGroupInfo.options)&&(u.dataGroupInfo.options=tt(u.pointClass.prototype.optionsToObject.call({series:u},u.options.data[u.cropStart+T])),G.forEach(function(t){delete u.dataGroupInfo.options[t]})),void 0!==n){p.push(o);for(var S=ti(n),k=0;k<S.length;k++)b[k].push(S[k]);g.push(u.dataGroupInfo)}T=P;for(var k=0;k<w;k++)v[k].length=0,v[k].hasNulls=!1;if(A+=1,P===f)break}if(P===f)break;if(y)for(var R=M?P:u.cropStart+P,F=l&&l[R]||u.pointClass.prototype.applyOptions.apply({series:u},[h[R]]),O=void 0,k=0;k<x;k++)$(O=F[y[k]])?v[k].push(O):null===O&&(v[k].hasNulls=!0);else $(r=m?s[P]:null)?v[0].push(r):null===r&&(v[0].hasNulls=!0)}var W={x:p};return(y||["y"]).forEach(function(t,e){W[t]=b[e]}),d.setColumns(W),{groupMap:g,modified:d}}function tl(t){var e=t.options,i=this.type,o=this.chart.options.plotOptions,r=this.useCommonDataGrouping&&M,n=d().defaultOptions.plotOptions[i].dataGrouping;if(o&&(A[i]||r)){var a=this.chart.rangeSelector;n||(n=tt(M,A[i])),e.dataGrouping=tt(r,n,o.series&&o.series.dataGrouping,o[i].dataGrouping,this.userOptions.dataGrouping,!e.isInternal&&a&&$(a.selected)&&a.buttonOptions[a.selected].dataGrouping)}}var th=function(t){var e=t.prototype;e.applyGrouping||(J(t.prototype.pointClass,"update",function(){if(this.dataGroup)return V(24,!1,this.series.chart),!1}),J(t,"afterSetOptions",tl),J(t,"destroy",tn),Z(e,{applyGrouping:tr,destroyGroupedData:tn,generatePoints:ta,getDGApproximation:ts,groupData:tu}))},tp=l(984),td=l.n(tp)().format,tc=d().composed,tg=d().addEvent,tf=d().extend,tm=d().isNumber,tv=d().pick,ty=d().pushUnique;function tx(t){var e,i,o,r,n,a,s=this.chart,u=s.time,l=t.point,h=l.series,p=h.options,d=h.tooltipOptions,c=p.dataGrouping,g=h.xAxis,f=d.xDateFormat||"",m=d[t.isFooter?"footerFormat":"headerFormat"];if(g&&"datetime"===g.options.type&&c&&tm(l.key)){o=h.currentDataGrouping,r=c.dateTimeLabelFormats||M.dateTimeLabelFormats,o?(n=r[o.unitName],1===o.count?f=n[0]:(f=n[1],i=n[2])):!f&&r&&g.dateTime&&(f=g.dateTime.getXDateFormat(l.x,d.dateTimeLabelFormats));var v=tv(null==(e=h.groupMap)?void 0:e[l.index].groupStart,l.key),y=v+((null==o?void 0:o.totalRange)||0)-1;a=u.dateFormat(f,v),i&&(a+=u.dateFormat(i,y)),h.chart.styledMode&&(m=this.styledModeFormat(m)),t.text=td(m,{point:tf(l,{key:a}),series:h},s),t.preventDefault()}}var tG=d();tG.dataGrouping=tG.dataGrouping||{},tG.dataGrouping.approximationDefaults=tG.dataGrouping.approximationDefaults||b,tG.dataGrouping.approximations=tG.dataGrouping.approximations||c,({compose:function(t,e,i){O(t),th(e),i&&ty(tc,"DataGrouping")&&tg(i,"headerFormatter",tx)},groupData:tu}).compose(tG.Axis,tG.Series,tG.Tooltip);var tb=d();return h.default}()});