/* Highcharts JS v9.1.1 (2021-06-03) Data module (c) 2012-2021 Torstein Honsi License: www.highcharts.com/license */ 'use strict';(function(b){"object"===typeof module&&module.exports?(b["default"]=b,module.exports=b):"function"===typeof define&&define.amd?define("highcharts/modules/data",["highcharts"],function(p){b(p);b.Highcharts=p;return b}):b("undefined"!==typeof Highcharts?Highcharts:void 0)})(function(b){function p(b,x,u,p){b.hasOwnProperty(x)||(b[x]=p.apply(null,u))}b=b?b._modules:{};p(b,"Extensions/Ajax.js",[b["Core/Globals.js"],b["Core/Utilities.js"]],function(b,p){var u=p.merge,x=p.objectEach;b.ajax= function(b){var c=u(!0,{url:!1,type:"get",dataType:"json",success:!1,error:!1,data:!1,headers:{}},b);b={json:"application/json",xml:"application/xml",text:"text/plain",octet:"application/octet-stream"};var r=new XMLHttpRequest;if(!c.url)return!1;r.open(c.type.toUpperCase(),c.url,!0);c.headers["Content-Type"]||r.setRequestHeader("Content-Type",b[c.dataType]||b.text);x(c.headers,function(b,c){r.setRequestHeader(c,b)});r.onreadystatechange=function(){if(4===r.readyState){if(200===r.status){var b=r.responseText; if("json"===c.dataType)try{b=JSON.parse(b)}catch(B){c.error&&c.error(r,B);return}return c.success&&c.success(b)}c.error&&c.error(r,r.responseText)}};try{c.data=JSON.stringify(c.data)}catch(P){}r.send(c.data||!0)};b.getJSON=function(p,c){b.ajax({url:p,success:c,dataType:"json",headers:{"Content-Type":"text/plain"}})};return{ajax:b.ajax,getJSON:b.getJSON}});p(b,"Extensions/Data.js",[b["Extensions/Ajax.js"],b["Core/Chart/Chart.js"],b["Core/Globals.js"],b["Core/Series/Point.js"],b["Core/Series/SeriesRegistry.js"], b["Core/Utilities.js"]],function(b,p,u,G,H,c){var r=b.ajax,x=u.doc,B=H.seriesTypes;b=c.addEvent;var I=c.defined,J=c.extend,K=c.fireEvent,E=c.isNumber,D=c.merge,L=c.objectEach,M=c.pick,N=c.splat;c=function(){function b(a,d,g){this.options=this.rawColumns=this.firstRowAsNames=this.chartOptions=this.chart=void 0;this.dateFormats={"YYYY/mm/dd":{regex:/^([0-9]{4})[\-\/\.]([0-9]{1,2})[\-\/\.]([0-9]{1,2})$/,parser:function(a){return a?Date.UTC(+a[1],a[2]-1,+a[3]):NaN}},"dd/mm/YYYY":{regex:/^([0-9]{1,2})[\-\/\.]([0-9]{1,2})[\-\/\.]([0-9]{4})$/, parser:function(a){return a?Date.UTC(+a[3],a[2]-1,+a[1]):NaN},alternative:"mm/dd/YYYY"},"mm/dd/YYYY":{regex:/^([0-9]{1,2})[\-\/\.]([0-9]{1,2})[\-\/\.]([0-9]{4})$/,parser:function(a){return a?Date.UTC(+a[3],a[1]-1,+a[2]):NaN}},"dd/mm/YY":{regex:/^([0-9]{1,2})[\-\/\.]([0-9]{1,2})[\-\/\.]([0-9]{2})$/,parser:function(a){if(!a)return NaN;var d=+a[3];d=d>(new Date).getFullYear()-2E3?d+1900:d+2E3;return Date.UTC(d,a[2]-1,+a[1])},alternative:"mm/dd/YY"},"mm/dd/YY":{regex:/^([0-9]{1,2})[\-\/\.]([0-9]{1,2})[\-\/\.]([0-9]{2})$/, parser:function(a){return a?Date.UTC(+a[3]+2E3,a[1]-1,+a[2]):NaN}}};this.init(a,d,g)}b.prototype.init=function(a,d,g){var e=a.decimalPoint;d&&(this.chartOptions=d);g&&(this.chart=g);"."!==e&&","!==e&&(e=void 0);this.options=a;this.columns=a.columns||this.rowsToColumns(a.rows)||[];this.firstRowAsNames=M(a.firstRowAsNames,this.firstRowAsNames,!0);this.decimalRegex=e&&new RegExp("^(-?[0-9]+)"+e+"([0-9]+)$");this.rawColumns=[];if(this.columns.length){this.dataFound();var k=!0}this.hasURLOption(a)&&(clearTimeout(this.liveDataTimeout), k=!1);k||(k=this.fetchLiveData());k||(k=!!this.parseCSV().length);k||(k=!!this.parseTable().length);k||(k=this.parseGoogleSpreadsheet());!k&&a.afterComplete&&a.afterComplete()};b.prototype.hasURLOption=function(a){return!(!a||!(a.rowsURL||a.csvURL||a.columnsURL))};b.prototype.getColumnDistribution=function(){var a=this.chartOptions,d=this.options,g=[],e=function(a){return(B[a||"line"].prototype.pointArrayMap||[0]).length},k=a&&a.chart&&a.chart.type,h=[],b=[],n=0;d=d&&d.seriesMapping||a&&a.series&& a.series.map(function(){return{x:0}})||[];var f;(a&&a.series||[]).forEach(function(a){h.push(e(a.type||k))});d.forEach(function(a){g.push(a.x||0)});0===g.length&&g.push(0);d.forEach(function(d){var g=new F,l=h[n]||e(k),m=(a&&a.series||[])[n]||{},c=B[m.type||k||"line"].prototype.pointArrayMap,z=c||["y"];(I(d.x)||m.isCartesian||!c)&&g.addColumnReader(d.x,"x");L(d,function(a,d){"x"!==d&&g.addColumnReader(a,d)});for(f=0;fn||n>O?(++n,m=""):(!isNaN(parseFloat(m))&&isFinite(m)?(m=parseFloat(m),k("number")):isNaN(Date.parse(m))?k("string"):(m=m.replace(/\//g,"-"),k("date")),C.lengthm[","]?";":",";b.decimalPoint||(b.decimalPoint=d>g?".":",",k.decimalRegex=new RegExp("^(-?[0-9]+)"+ b.decimalPoint+"([0-9]+)$"));return e}function e(a,d){var e=[],g=0,c=!1,h=[],m=[],f;if(!d||d>a.length)d=a.length;for(;gl[f]?"YY":"YYYY":12=l[f]?(e[f]="dd",c=!0):e[f].length|| (e[f]="mm")))}if(c){for(f=0;fa)a=0;if(!c||c>=l.length)c=l.length-1;if(b.itemDelimiter)var z=b.itemDelimiter;else z=null,z=g(l);var w=0;for(q=a;q<=c;q++)"#"===l[q][0]?w++:d(l[q],q-a-w);b.columnTypes&&0!==b.columnTypes.length||!v.length||!v[0].length||"date"!==v[0][1]||b.dateFormat||(b.dateFormat=e(C[0]));this.dataFound()}return C}; b.prototype.parseTable=function(){var a=this.options,d=a.table,g=this.columns||[],e=a.startRow||0,b=a.endRow||Number.MAX_VALUE,c=a.startColumn||0,l=a.endColumn||Number.MAX_VALUE;d&&("string"===typeof d&&(d=x.getElementById(d)),[].forEach.call(d.getElementsByTagName("tr"),function(a,d){d>=e&&d<=b&&[].forEach.call(a.children,function(a,b){var k=g[b-c],f=1;if(("TD"===a.tagName||"TH"===a.tagName)&&b>=c&&b<=l)for(g[b-c]||(g[b-c]=[]),g[b-c][d-e]=a.innerHTML;d-e>=f&&void 0===k[d-e-f];)k[d-e-f]=null,f++})}), this.dataFound());return g};b.prototype.fetchLiveData=function(){function a(k){function f(f,h,m){function n(){c&&g.liveDataURL===f&&(d.liveDataTimeout=setTimeout(a,l))}if(!f||!/^(http|\/|\.\/|\.\.\/)/.test(f))return f&&e.error&&e.error("Invalid URL"),!1;k&&(clearTimeout(d.liveDataTimeout),g.liveDataURL=f);r({url:f,dataType:m||"json",success:function(a){g&&g.series&&h(a);n()},error:function(a,d){3>++b&&n();return e.error&&e.error(d,a)}});return!0}f(n.csvURL,function(a){g.update({data:{csv:a}})},"text")|| f(n.rowsURL,function(a){g.update({data:{rows:a}})})||f(n.columnsURL,function(a){g.update({data:{columns:a}})})}var d=this,g=this.chart,e=this.options,b=0,c=e.enablePolling,l=1E3*(e.dataRefreshRate||2),n=D(e);if(!this.hasURLOption(e))return!1;1E3>l&&(l=1E3);delete e.csvURL;delete e.rowsURL;delete e.columnsURL;a(!0);return this.hasURLOption(e)};b.prototype.parseGoogleSpreadsheet=function(){function a(d){var b=["https://spreadsheets.google.com/feeds/cells",e,c,"public/values?alt=json"].join("/");r({url:b, dataType:"json",success:function(e){d(e);g.enablePolling&&setTimeout(function(){a(d)},1E3*(g.dataRefreshRate||2))},error:function(a,d){return g.error&&g.error(d,a)}})}var d=this,g=this.options,e=g.googleSpreadsheetKey,b=this.chart,c=g.googleSpreadsheetWorksheet||1,l=g.startRow||0,n=g.endRow||Number.MAX_VALUE,f=g.startColumn||0,p=g.endColumn||Number.MAX_VALUE,q=1E3*(g.dataRefreshRate||2);4E3>q&&(q=4E3);e&&(delete g.googleSpreadsheetKey,a(function(a){var e=[];a=a.feed.entry;var g=(a||[]).length,k=0, c;if(!a||0===a.length)return!1;for(c=0;c=f&&c<=p&&(e[c-f]=[]);for(c=0;c=f&&q<=p&&k>=l&&k<=n){var t=h.gs$cell||h.content;h=null;t.numericValue?h=0<=t.$t.indexOf("/")||0<=t.$t.indexOf("-")?t.$t:0a[b+1])):(y&&y.length&&(n=this.parseDate(m)),l&&E(n)&&"float"!== r?(f[b]=m,a[b]=n,a.isDatetime=!0,"undefined"!==typeof a[b+1]&&(m=n>a[b+1],m!==q&&"undefined"!==typeof q&&(this.alternativeFormat?(this.dateFormat=this.alternativeFormat,b=a.length,this.alternativeFormat=this.dateFormats[this.dateFormat].alternative):a.unsorted=!0),q=m)):(a[b]=""===y?null:y,0!==b&&(a.isDatetime||a.isNumeric)&&(a.mixed=!0)))}l&&a.mixed&&(e[d]=g[d]);if(l&&q&&this.options.sort)for(d=0;d