highcharts
Version:
JavaScript charting framework
15 lines • 18.6 kB
JavaScript
/**
* Highcharts JS v13.0.1 (2026-08-17)
* @module highcharts/modules/data
* @requires highcharts
*
* Data module
*
* (c) 2012-2026 Highsoft AS
* Author: Torstein Hønsi
*
* A commercial license may be required depending on use,
* see www.highcharts.com/license
*/import*as e from"../highcharts.js";let t={};t.n=e=>{let s=e&&e.__esModule?()=>e.default:()=>e;return t.d(s,{a:s}),s},t.d=(e,s)=>{if(Array.isArray(s))for(var i=0;i<s.length;){var r=s[i++],a=s[i++];t.o(e,r)?0===a&&i++:0===a?Object.defineProperty(e,r,{enumerable:!0,value:s[i++]}):Object.defineProperty(e,r,{enumerable:!0,get:a})}else for(var r in s)t.o(s,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:s[r]})},t.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);let s=e.default;var i=t.n(s);let{win:r}=i();function a(e){let t={json:"application/json",xml:"application/xml",text:"text/plain",octet:"application/octet-stream"},i=new XMLHttpRequest;function r(t,s){e.error&&e.error(t,s)}if(!e.url)return!1;i.open((e.type||"get").toUpperCase(),e.url,!0),e.headers?.["Content-Type"]||i.setRequestHeader("Content-Type",t[e.dataType||"json"]||t.text),(0,s.objectEach)(e.headers,function(e,t){i.setRequestHeader(t,e)}),e.responseType&&(i.responseType=e.responseType),i.onreadystatechange=function(){let t;if(4===i.readyState){if(200===i.status){if("blob"!==e.responseType&&(t=i.responseText,"json"===e.dataType))try{t=JSON.parse(t)}catch(e){if(e instanceof Error)return r(i,e)}return e.success?.(t,i)}r(i,i.responseText)}},e.data&&"string"!=typeof e.data&&(e.data=JSON.stringify(e.data)),i.send(e.data)}let n={ajax:a,getJSON:function(e,t){n.ajax({url:e,success:t,dataType:"json",headers:{"Content-Type":"text/plain"}})}};n.post=async function(e,t,i){let a=new r.FormData;(0,s.objectEach)(t,function(e,t){a.append(t,e)}),a.append("b64","true");let n=await r.fetch(e,{method:"POST",body:a,...i});if(n.ok){let e=await n.text(),i=document.createElement("a");i.href=`data:${t.type};base64,${e}`,i.download=t.filename,i.click(),(0,s.discardElement)(i)}};let o=e.default.Axis;var l=t.n(o);let u=e.default.Chart;var h=t.n(u);let{setLength:d,splice:c}={convertToNumber:function(e,t){switch(typeof e){case"boolean":return+!!e;case"number":return isNaN(e)&&!t?null:e;default:return isNaN(e=parseFloat(`${e??""}`))&&!t?null:e}},setLength:function(e,t,s){return Array.isArray(e)?(e.length=t,e):e[s?"subarray":"slice"](0,t)},splice:function(e,t,s,i,r=[]){if(Array.isArray(e))return Array.isArray(r)||(r=Array.from(r)),{removed:e.splice(t,s,...r),array:e};let a=Object.getPrototypeOf(e).constructor,n=e[i?"subarray":"slice"](t,t+s),o=new a(e.length-s+r.length);return o.set(e.subarray(0,t),0),o.set(r,t),o.set(e.subarray(t+s),t+r.length),{removed:n,array:o}}},m=class{constructor(e={}){this.isDataTable=!0,this.autoId=!e.id,this.columns={},this.id=e.id||(0,s.uniqueKey)(),this.rowCount=0,this.versionTag=(0,s.uniqueKey)();let t=0;(0,s.objectEach)(e.columns||{},(e,s)=>{this.columns[s]=e.slice(),t=Math.max(t,e.length)}),this.applyRowCount(t)}applyRowCount(e){this.rowCount=e,(0,s.objectEach)(this.columns,(t,s)=>{t.length!==e&&(this.columns[s]=d(t,e))})}deleteRows(e,t=1){if(t>0&&e<this.rowCount){let i=0;(0,s.objectEach)(this.columns,(s,r)=>{this.columns[r]=c(s,e,t).array,i=s.length}),this.rowCount=i}(0,s.fireEvent)(this,"afterDeleteRows",{rowIndex:e,rowCount:t}),this.versionTag=(0,s.uniqueKey)()}getColumn(e,t){return this.columns[e]}getColumns(e,t){return(e||Object.keys(this.columns)).reduce((e,t)=>(e[t]=this.columns[t],e),{})}getRowObject(e,t){let s={},i=this.columns;for(let r of(t??(t=Object.keys(this.columns)),t))s[r]=i[r]?.[e];return s}setColumn(e,t=[],s=0,i){this.setColumns({[e]:t},s,i)}setColumns(e,t,i){let r=this.rowCount;(0,s.objectEach)(e,(e,t)=>{this.columns[t]=e.slice(),r=e.length}),this.applyRowCount(r),i?.silent||((0,s.fireEvent)(this,"afterSetColumns"),this.versionTag=(0,s.uniqueKey)())}setRow(e,t=this.rowCount,i,r){var a;let{columns:n}=this,o=i?this.rowCount+1:t+1,l=Object.keys(e);if(r?.addColumns!==!1)for(let e=0,t=l.length;e<t;e++)n[a=l[e]]||(n[a]=Array(this.rowCount));(0,s.objectEach)(n,(s,r)=>{s&&(i?s=c(s,t,0,!0,[e[r]]).array:s[t]=r in e?e[r]:s[t],n[r]=s)}),this.applyRowCount(Math.max(o,this.rowCount)),r?.silent||((0,s.fireEvent)(this,"afterSetRows",{rowIndex:t}),this.versionTag=(0,s.uniqueKey)())}getModified(){return this.modified||this}},p=e.default.Point;var f=t.n(p);let g=e.default.SeriesRegistry;var y=t.n(g);let x=e.default.Time;var v=t.n(x);let{doc:C}=i(),{seriesTypes:R}=y();function N(e){return!!(e.rowsURL||e.csvURL||e.columnsURL)}class T{static data(e,t={},s){return new T(e,t,s)}static rowsToColumns(e){let t,s,i,r,a;if(e)for(t=0,a=[],s=e.length;t<s;t++)for(i=0,r=e[t].length;i<r;i++)a[i]||(a[i]=[]),a[i][t]=e[t][i];return a}constructor(e,t={},s){this.rowsToColumns=T.rowsToColumns,this.dateFormats={"YYYY/mm/dd":{regex:/^(\d{4})[\-\/\.](\d{1,2})[\-\/\.](\d{1,2})$/,parser:function(e){return e?Date.UTC(+e[1],e[2]-1,+e[3]):NaN}},"dd/mm/YYYY":{regex:/^(\d{1,2})[\-\/\.](\d{1,2})[\-\/\.](\d{4})$/,parser:function(e){return e?Date.UTC(+e[3],e[2]-1,+e[1]):NaN},alternative:"mm/dd/YYYY"},"mm/dd/YYYY":{regex:/^(\d{1,2})[\-\/\.](\d{1,2})[\-\/\.](\d{4})$/,parser:function(e){return e?Date.UTC(+e[3],e[1]-1,+e[2]):NaN}},"dd/mm/YY":{regex:/^(\d{1,2})[\-\/\.](\d{1,2})[\-\/\.](\d{2})$/,parser:function(e){if(!e)return NaN;let t=new Date,s=+e[3];return s>t.getFullYear()-2e3?s+=1900:s+=2e3,Date.UTC(s,e[2]-1,+e[1])},alternative:"mm/dd/YY"},"mm/dd/YY":{regex:/^(\d{1,2})[\-\/\.](\d{1,2})[\-\/\.](\d{2})$/,parser:function(e){return e?Date.UTC(+e[3]+2e3,e[1]-1,+e[2]):NaN}}},this.chart=s,this.chartOptions=t,this.options=e,this.rawColumns=[],this.init(e,t,s)}init(e,t,i){let r=e.decimalPoint,a;t&&(this.chartOptions=t),i&&(this.chart=i),"."!==r&&","!==r&&(r=void 0),this.options=e,this.columns=e.columns||this.rowsToColumns(e.rows)||[],this.firstRowAsNames=e.firstRowAsNames??this.firstRowAsNames??!0,this.decimalRegex=r&&RegExp("^(-?[0-9]+)"+r+"([0-9]+)$"),void 0!==this.liveDataTimeout&&(0,s.internalClearTimeout)(this.liveDataTimeout),this.rawColumns=[],this.columns.length&&(this.dataFound(),a=!N(e)),a||(a=this.fetchLiveData()),a||(a=!!this.parseCSV().length),a||(a=!!this.parseTable().length),a||(a=this.parseGoogleSpreadsheet()),!a&&e.afterComplete&&e.afterComplete(this)}getColumnDistribution(){let e=this.chartOptions,t=this.options,i=[],r=function(e="line"){return(R[e].prototype.pointArrayMap||[0]).length},a=function(e="line"){return R[e].prototype.pointArrayMap},n=e?.chart?.type,o=[],l=[],u=t?.seriesMapping||e?.series?.map(function(){return{x:0}})||[],h=0;(e?.series||[]).forEach(e=>{o.push(r(e.type||n))}),u.forEach(e=>{i.push(e.x||0)}),0===i.length&&i.push(0),u.forEach(t=>{let i=new w,u=o[h]||r(n),d=(e?.series??[])[h]??{},c=a(d.type||n),m=c??["y"];((0,s.defined)(t.x)||d.isCartesian||!c)&&i.addColumnReader(t.x,"x"),(0,s.objectEach)(t,function(e,t){"x"!==t&&i.addColumnReader(e,t)});for(let e=0;e<u;e++)i.hasReader(m[e])||i.addColumnReader(void 0,m[e]);l.push(i),h++});let d=a(n);void 0===d&&(d=["y"]),this.valueCount={global:r(n),xColumns:i,individual:o,seriesBuilders:l,globalPointArrayMap:d}}dataFound(){this.options.switchRowsAndColumns&&(this.columns=this.rowsToColumns(this.columns)),this.getColumnDistribution(),this.parseTypes(),!1!==this.parsed()&&this.complete()}parseCSV(e){let t=this,i=this.columns=[],r=e||this.options,a=r.startColumn||0,n=r.endColumn||Number.MAX_VALUE,o=[],l={",":0,";":0," ":0},u=r.csv,h=r.startRow||0,d=r.endRow||Number.MAX_VALUE,c,m,p=0;if(u&&r.beforeParse&&(u=r.beforeParse.call(this,u,this)),u){if(m=u.replace(/\r\n/g,"\n").replace(/\r/g,"\n").split(r.lineDelimiter||"\n"),(!h||h<0)&&(h=0),(!d||d>=m.length)&&(d=m.length-1),r.itemDelimiter)c=r.itemDelimiter;else{let e,s,i;e=0,s=0,i=!1,m.some(function(t,i){let r=!1,a,n,o,u="";if(i>13)return!0;for(let i=0;i<t.length;i++){if(a=t[i],n=t[i+1],o=t[i-1],"#"===a)return;if('"'===a)if(r){if('"'!==o&&'"'!==n){for(;" "===n&&i<t.length;)n=t[++i];void 0!==l[n]&&l[n]++,r=!1}}else r=!0;else void 0!==l[a]?(isNaN(Date.parse(u=u.trim()))?(isNaN(u)||!isFinite(u))&&l[a]++:l[a]++,u=""):u+=a;","===a&&s++,"."===a&&e++}}),l[";"]>l[","]?i=";":(l[","],l[";"],i=","),r.decimalPoint||(e>s?r.decimalPoint=".":r.decimalPoint=",",t.decimalRegex=RegExp("^(-?[0-9]+)"+r.decimalPoint+"([0-9]+)$")),c=i}let e=0;for(p=h;p<=d;p++)"#"===m[p][0]?e++:function(e,t,s,l){let u=0,h="",d="",m="",p="",f=0,g=0;function y(t){h=e[t],d=e[t-1],m=e[t+1]}function x(e){o.length<g+1&&o.push([e]),o[g][o[g].length-1]!==e&&o[g].push(e)}function v(){if(a>f||f>n){++f,p="";return}r.columnTypes||(!isNaN(parseFloat(p))&&isFinite(p)?(p=parseFloat(p),x("number")):isNaN(Date.parse(p))?x("string"):(p=p.replace(/\//g,"-"),x("date"))),i.length<g+1&&i.push([]),i[g][t]=p,p="",++g,++f}if(e.trim().length&&"#"!==e.trim()[0]){for(;u<e.length;u++)if(y(u),'"'===h)for(y(++u);u<e.length&&('"'!==h||'"'===d||'"'===m);)('"'!==h||'"'===h&&'"'!==d)&&(p+=h),y(++u);else h===c?v():p+=h;v()}}(m[p],p-h-e);(!r.columnTypes||0===r.columnTypes.length)&&o.length&&o[0].length&&"date"===o[0][1]&&!r.dateFormat&&(r.dateFormat=function(e,i){let r="YYYY/mm/dd",a=[],n=[],o,l=[],u,h=0,d=!1,c;for((!i||i>e.length)&&(i=e.length);h<i;h++)if(void 0!==e[h]&&e[h]?.length)for(c=0,o=e[h].trim().replace(/\//g," ").replace(/\-/g," ").replace(/\./g," ").split(" "),l=["","",""];c<o.length;c++)c<l.length&&(o[c]=parseInt(o[c],10),o[c]&&(n[c]=!n[c]||n[c]<o[c]?o[c]:n[c],void 0!==a[c]?a[c]!==o[c]&&(a[c]=!1):a[c]=o[c],o[c]>31?o[c]<100?l[c]="YY":l[c]="YYYY":o[c]>12&&o[c]<=31?(l[c]="dd",d=!0):l[c].length||(l[c]="mm")));if(d){for(c=0;c<a.length;c++)!1!==a[c]?n[c]>12&&"YY"!==l[c]&&"YYYY"!==l[c]&&(l[c]="YY"):n[c]>12&&"mm"===l[c]&&(l[c]="dd");return(3===l.length&&"dd"===l[1]&&"dd"===l[2]&&(l[2]="YY"),u=l.join("/"),t.dateFormats[u])?u:((0,s.fireEvent)(t,"deduceDateFailed"),r)}return r}(i[0])),this.dataFound()}return i}parseTable(){let e=this.options,t=this.columns||[],s=e.startRow||0,i=e.endRow||Number.MAX_VALUE,r=e.startColumn||0,a=e.endColumn||Number.MAX_VALUE;if(e.table){let n=e.table;"string"==typeof n&&(n=C.getElementById(n)),[].forEach.call(n.getElementsByTagName("tr"),(e,n)=>{n>=s&&n<=i&&[].forEach.call(e.children,(e,i)=>{let o=t[i-r],l=1;if(("TD"===e.tagName||"TH"===e.tagName)&&i>=r&&i<=a)for(t[i-r]||(t[i-r]=[]),t[i-r][n-s]=e.innerHTML;n-s>=l&&void 0===o[n-s-l];)o[n-s-l]=null,l++})}),this.dataFound()}return t}fetchLiveData(){let e=this,t=this.chart,i=this.options,r=i.enablePolling,n=(0,s.merge)(i),o=0,l=1e3*(i.dataRefreshRate||2);return!!N(i)&&(l=Math.max(l,1e3),delete i.csvURL,delete i.rowsURL,delete i.columnsURL,!function i(u){function h(n,h,d){if(!n||!/^(http|\/|\.\/|\.\.\/)/.test(n))return n&&(0,s.error)(`Invalid URL: ${n}`,!1,t),!1;function c(){r&&t.liveDataURL===n&&(e.liveDataTimeout=setTimeout(i,l))}return u&&((0,s.internalClearTimeout)(e.liveDataTimeout),t.liveDataURL=n),a({url:n,dataType:d||"json",success:function(e){t?.series&&h(e),c()},error:function(e,i){if(++o<3&&c(),t.options)return(0,s.error)(`Request failed - ${e.status}
`+("string"==typeof i?i:i.message),!1,t)}}),!0}h(n.csvURL,function(e){t.update({data:{csv:e}})},"text")||h(n.rowsURL,function(e){t.update({data:{rows:e}})})||h(n.columnsURL,function(e){t.update({data:{columns:e}})})}(!0),N(i))}parseGoogleSpreadsheet(){let e=this,t=this.options,i=t.googleSpreadsheetKey,r=this.chart,n=Math.max(1e3*(t.dataRefreshRate||2),4e3);return i&&(delete t.googleSpreadsheetKey,!function o(l){a({url:["https://sheets.googleapis.com/v4/spreadsheets",i,"values",(()=>{if(t.googleSpreadsheetRange)return t.googleSpreadsheetRange;let e="ABCDEFGHIJKLMNOPQRSTUVWXYZ",i=(e.charAt(t.startColumn||0)||"A")+((t.startRow||0)+1),r=e.charAt(t.endColumn??-1)||"ZZ";return(0,s.defined)(t.endRow)&&(r+=t.endRow+1),`${i}:${r}`})(),"?alt=json&majorDimension=COLUMNS&valueRenderOption=UNFORMATTED_VALUE&dateTimeRenderOption=FORMATTED_STRING&key="+t.googleAPIKey].join("/"),dataType:"json",success:function(s){l(s),t.enablePolling&&(e.liveDataTimeout=setTimeout(function(){o(l)},n))},error:function(e,t){if(r.options)return(0,s.error)(`Request failed - ${e.status}
`+("string"==typeof t?t:t.message),!1,r)}})}(function(t){let s=t.values;if(!s||0===s.length)return!1;let i=s.reduce((e,t)=>Math.max(e,t.length),0);s.forEach(e=>{for(let t=0;t<i;t++)void 0===e[t]&&(e[t]=null)}),r?.series?r.update({data:{columns:s}}):(e.columns=s,e.dataFound())})),!1}trim(e,t){return"string"==typeof e&&(e=e.replace(/^\s+|\s+$/g,""),t&&/[\d\s]+/.test(e)&&(e=e.replace(/\s/g,"")),this.decimalRegex&&(e=e.replace(this.decimalRegex,"$1.$2"))),e}parseTypes(){let e=this.columns||[],t=e.length;for(;t--;)this.parseColumn(e[t],t)}parseColumn(e,t){let i=this.rawColumns,r=this.columns=this.columns||[],a=this.firstRowAsNames,n=this.valueCount?.xColumns.indexOf(t)!==-1,o=[],l=this.chartOptions,u=(this.options.columnTypes||[])[t],h=n&&l?.xAxis&&"category"===(0,s.splat)(l.xAxis)[0].type||"string"===u,d=(0,s.defined)(e.name),c=e.length,m,p,f,g,y,x,v;for(i[t]||(i[t]=[]);c--;)m=o[c]||e[c],f=this.trim(m),p=parseFloat(g=this.trim(m,!0)),void 0===i[t][c]&&(i[t][c]=f),h||0===c&&a&&!d?e[c]=""+f:+g===p?(e[c]=p,p>31536e6&&"float"!==u?e.isDatetime=!0:e.isNumeric=!0,void 0!==e[c+1]&&(v=p>e[c+1])):(f?.length&&(y=this.parseDate(m)),n&&(0,s.isNumber)(y)&&"float"!==u?(o[c]=m,e[c]=y,e.isDatetime=!0,void 0!==e[c+1]&&((x=y>e[c+1])!==v&&void 0!==v&&this.alternativeFormat&&(this.dateFormat=this.alternativeFormat,c=e.length,this.alternativeFormat=this.dateFormats[this.dateFormat].alternative),v=x)):(e[c]=""===f?null:f,0!==c&&(e.isDatetime||e.isNumeric)&&(e.mixed=!0)));n&&e.mixed&&(r[t]=i[t])}parseDate(e){let t=this.options.parseDate,s,i,r,a=this.options.dateFormat||this.dateFormat,n;if(t)s=t(e);else if(!1===t)s=e;else if("string"==typeof e){if(a)(r=this.dateFormats[a])||(r=this.dateFormats["YYYY/mm/dd"]),(n=e.match(r.regex))&&(s=r.parser(n));else for(i in this.dateFormats)if(r=this.dateFormats[i],n=e.match(r.regex)){this.dateFormat=a=i,this.alternativeFormat=r.alternative,s=r.parser(n);break}n||(s=new(v())().parse(e))}return s}getData(){if(this.columns)return this.rowsToColumns(this.columns)?.slice(1)}getDataTable(){return new m({columns:Object.values(this.columns||[]).reduce((e,t)=>{let s=t.slice(),i=s.shift();return("string"==typeof i||"number"==typeof i)&&(e[i]=s),e},{})})}parsed(){if(this.options.parsed)return this.options.parsed.call(this,this.columns,this)}complete(){let e=this.columns=this.columns||[],t=this.options,i=[],r="linear",a,n,o,l,u,h,d,c,m,p;if([].length=e.length,t.complete||t.afterComplete){var f,g;let y,x;if(this.firstRowAsNames)for(o=0;o<e.length;o++){let t=e[o];(0,s.defined)(t.name)||(t.name=(t.shift()??"").toString())}for(a=[],f=e?.length||0,g=this.valueCount.seriesBuilders,y=Array(f).fill(!0),x=[],g.forEach(e=>{e.getReferencedColumnIndexes().forEach(e=>{y[e]=!1})}),y.forEach((e,t)=>{e&&x.push(t)}),h=0;h<this.valueCount.seriesBuilders.length;h++)(c=this.valueCount.seriesBuilders[h]).populateColumns(x)&&i.push(c);for(;x.length>0;){for((c=new w).addColumnReader(0,"x"),-1!==(p=x.indexOf(0))&&x.splice(p,1),o=0;o<this.valueCount.global;o++)c.addColumnReader(void 0,this.valueCount.globalPointArrayMap[o]);c.populateColumns(x)&&i.push(c)}if(i.length>0&&i[0].readers.length>0&&void 0!==(m=e?.[i[0].readers[0].columnIndex??-1])&&(m.isDatetime?r="datetime":m.isNumeric||(r="category")),"category"===r)for(h=0;h<i.length;h++)for(u=0,c=i[h];u<c.readers.length;u++)"x"===c.readers[u].configName&&(c.readers[u].configName="name");for(h=0;h<i.length;h++){for(l=0,c=i[h],n=[];l<e[0].length;l++)n[l]=c.read(e,l);a[h]={data:n,pointStart:n[0]&&(c.pointIsArray?n[0]?.[0]:n[0]?.x)||void 0},c.name&&(a[h].name=c.name),"category"===r&&(a[h].turboThreshold=0,a[h].pointStart=0)}d={series:a},"linear"!==r||this.xAxisOptions&&this.xAxisOptions.type!==r?(this.xAxisOptions={type:r},"category"===r&&(this.xAxisOptions.uniqueNames=!1)):r=this.xAxisOptions=void 0,this.chart||(0,s.merge)(!0,d,{xAxis:this.xAxisOptions||{}}),t.complete?.(d),t.afterComplete?.(this,d)}}xAxisUpdateHandler(e){let t=this.xAxisOptions;t&&(!e.options.type&&t.type&&(e.type=t.type),e.options.uniqueNames||!1!==t.uniqueNames||(e.uniqueNames=t.uniqueNames))}update(e,t){let i=this.chart,r=i.options;e&&(e.afterComplete=function(e,s){if(!s)return;let r=i.xAxis[0],a=e.xAxisOptions;a&&r&&(r.type!==a.type&&!r.options.type||r.uniqueNames&&!1===a.uniqueNames&&void 0===r.options.uniqueNames)?r.update({},!1):(s?.series||[]).forEach(function(e){delete e.pointStart}),i.update(s,t,!0)},(0,s.merge)(!0,r.data,e),r.data?.googleSpreadsheetKey&&!e.columns&&delete r.data.columns,this.init(r.data||{},r))}}(0,s.addEvent)(l(),"afterSetOptions",function(){this.isXAxis&&(!this.chart.xAxis.length||this.chart.xAxis[0]===this)&&this.chart.data?.xAxisUpdateHandler(this)}),(0,s.addEvent)(h(),"init",function(e){let t=this,i=e.args[1],r=(0,s.getOptions)().data,a=e.args[0]||{};if((r||a&&a.data)&&!t.hasDataDef){t.hasDataDef=!0;let n=(0,s.merge)(r,a.data);t.data=new T((0,s.extend)(n,{afterComplete:function(e,r){let n,o;if(Object.hasOwnProperty.call(a,"series"))if("object"==typeof a.series)for(n=Math.max(a.series.length,r?.series?.length??0);n--;)o=a.series[n]||{},a.series[n]=(0,s.merge)(o,r?.series?.[n]??{});else delete a.series;a=(0,s.merge)(r,a),t.data=e,t.init(a,i)}}),a,t),e.preventDefault()}});class w{constructor(){this.readers=[],this.pointIsArray=!0}populateColumns(e){let t=!0;return this.readers.forEach(t=>{void 0===t.columnIndex&&(t.columnIndex=e.shift())}),this.readers.forEach(e=>{void 0===e.columnIndex&&(t=!1)}),t}read(e,t){let s=this.pointIsArray,i=s?[]:{};if(this.readers.forEach(r=>{let a=e[r.columnIndex][t];s?i.push(a):r.configName.indexOf(".")>0?f().prototype.setNestedProperty(i,a,r.configName):i[r.configName]=a}),void 0===this.name&&this.readers.length>=2){let t=[];this.readers.forEach(function(e){("x"===e.configName||"name"===e.configName||"y"===e.configName)&&void 0!==e.columnIndex&&t.push(e.columnIndex)}),t.length>=2&&(t.shift(),t.sort(function(e,t){return e-t})),this.name=e[t.shift()??0].name}return i}addColumnReader(e,t){this.readers.push({columnIndex:e,configName:t}),"x"!==t&&"y"!==t&&void 0!==t&&(this.pointIsArray=!1)}getReferencedColumnIndexes(){let e,t,s=[];for(e=0;e<this.readers.length;e+=1)void 0!==(t=this.readers[e]).columnIndex&&s.push(t.columnIndex);return s}hasReader(e){let t;for(t=0;t<this.readers.length;t+=1)if(this.readers[t].configName===e)return!0}}let b=i();b.Data=b.Data||T,b.HttpUtilities=b.HttpUtilities||n,b.ajax=b.HttpUtilities.ajax,b.data=b.Data.data,b.getJSON=b.HttpUtilities.getJSON,b.post=b.HttpUtilities.post;let A=i();export{A as default};