!/**
 * Highcharts JS v13.0.0 (2026-06-11)
 * @module highcharts/modules/data-tools
 * @requires highcharts
 *
 * Highcharts
 *
 * (c) 2010-2026 Highsoft AS
 *
 * 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(t._Highcharts):"function"==typeof define&&define.amd?define("highcharts/modules/data-tools",["highcharts/highcharts"],function(t){return e(t)}):"object"==typeof exports?exports["highcharts/modules/data-tools"]=e(t._Highcharts):t.Highcharts=e(t.Highcharts)}("u"<typeof window?this:window,function(t){return function(){"use strict";var e,r,n,o,i,a,s,u,l,c,f,p,h,d,y,v={944:function(e){e.exports=t}},m={};function g(t){var e=m[t];if(void 0!==e)return e.exports;var r=m[t]={exports:{}};return v[t](r,r.exports,g),r.exports}g.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return g.d(e,{a:e}),e},g.d=function(t,e){for(var r in e)g.o(e,r)&&!g.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},g.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)};var b={};g.d(b,{default:function(){return eR}});var w=g(944),O=g.n(w),C=function(){function t(){}return t.registerType=function(e,r){return!!e&&!t.types[e]&&!!(t.types[e]=r)},t.prototype.benchmark=function(t,e){var r=[],n=this,o=function(){n.modifyTable(t),n.emit({type:"afterBenchmarkIteration"})},i=(0,w.merge)({iterations:1},e).iterations;n.on("afterBenchmarkIteration",function(){r.length===i?n.emit({type:"afterBenchmark",results:r}):o()});var a={startTime:0,endTime:0};return n.on("modify",function(){a.startTime=window.performance.now()}),n.on("afterModify",function(){a.endTime=window.performance.now(),r.push(a.endTime-a.startTime)}),o(),r},t.prototype.emit=function(t){(0,w.fireEvent)(this,t.type,t)},t.prototype.modify=function(t,e){var r=this;return new Promise(function(n,o){t.modified||(t.modified=t.clone(!1,e));try{n(r.modifyTable(t,e))}catch(n){r.emit({type:"error",detail:e,table:t}),o(n instanceof Error?n:Error(""+n))}})},t.prototype.on=function(t,e){return(0,w.addEvent)(this,t,e)},t.types={},t}(),R=function(t,e,r){if(r||2==arguments.length)for(var n,o=0,i=e.length;o<i;o++)!n&&o in e||(n||(n=Array.prototype.slice.call(e,0,o)),n[o]=e[o]);return t.concat(n||Array.prototype.slice.call(e))},N=function(t,e,r){return Array.isArray(t)?(t.length=e,t):t[r?"subarray":"slice"](0,e)},T=function(t,e,r,n,o){if(void 0===o&&(o=[]),Array.isArray(t))return Array.isArray(o)||(o=Array.from(o)),{removed:t.splice.apply(t,R([e,r],o,!1)),array:t};var i=Object.getPrototypeOf(t).constructor,a=t[n?"subarray":"slice"](e,e+r),s=new i(t.length-r+o.length);return s.set(t.subarray(0,e),0),s.set(o,e),s.set(t.subarray(e+r),e+o.length),{removed:a,array:s}},A=function(){function t(t){void 0===t&&(t={});var e=this;this.isDataTable=!0,this.autoId=!t.id,this.columns={},this.id=t.id||(0,w.uniqueKey)(),this.rowCount=0,this.versionTag=(0,w.uniqueKey)();var r=0;(0,w.objectEach)(t.columns||{},function(t,n){e.columns[n]=t.slice(),r=Math.max(r,t.length)}),this.applyRowCount(r)}return t.prototype.applyRowCount=function(t){var e=this;this.rowCount=t,(0,w.objectEach)(this.columns,function(r,n){r.length!==t&&(e.columns[n]=N(r,t))})},t.prototype.deleteRows=function(t,e){var r=this;if(void 0===e&&(e=1),e>0&&t<this.rowCount){var n=0;(0,w.objectEach)(this.columns,function(o,i){r.columns[i]=T(o,t,e).array,n=o.length}),this.rowCount=n}(0,w.fireEvent)(this,"afterDeleteRows",{rowIndex:t,rowCount:e}),this.versionTag=(0,w.uniqueKey)()},t.prototype.getColumn=function(t,e){return this.columns[t]},t.prototype.getColumns=function(t,e){var r=this;return(t||Object.keys(this.columns)).reduce(function(t,e){return t[e]=r.columns[e],t},{})},t.prototype.getRowObject=function(t,e){var r,n={},o=this.columns;null!=e||(e=Object.keys(this.columns));for(var i=0,a=e;i<a.length;i++){var s=a[i];n[s]=null==(r=o[s])?void 0:r[t]}return n},t.prototype.setColumn=function(t,e,r,n){var o;void 0===e&&(e=[]),void 0===r&&(r=0),this.setColumns(((o={})[t]=e,o),r,n)},t.prototype.setColumns=function(t,e,r){var n=this,o=this.rowCount;(0,w.objectEach)(t,function(t,e){n.columns[e]=t.slice(),o=t.length}),this.applyRowCount(o),(null==r?void 0:r.silent)||((0,w.fireEvent)(this,"afterSetColumns"),this.versionTag=(0,w.uniqueKey)())},t.prototype.setRow=function(t,e,r,n){void 0===e&&(e=this.rowCount);var o,i=this.columns,a=r?this.rowCount+1:e+1,s=Object.keys(t);if((null==n?void 0:n.addColumns)!==!1)for(var u=0,l=s.length;u<l;u++)i[o=s[u]]||(i[o]=Array(this.rowCount));(0,w.objectEach)(i,function(n,o){n&&(r?n=T(n,e,0,!0,[t[o]]).array:n[e]=o in t?t[o]:n[e],i[o]=n)}),this.applyRowCount(Math.max(a,this.rowCount)),(null==n?void 0:n.silent)||((0,w.fireEvent)(this,"afterSetRows",{rowIndex:e}),this.versionTag=(0,w.uniqueKey)())},t.prototype.getModified=function(){return this.modified||this},t}(),j=(e=function(t,r){return(e=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,r)},function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}),_=function(){return(_=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},x=function(t){function e(e){void 0===e&&(e={});var r=t.call(this,e)||this;return r.metadata=e.metadata,r}return j(e,t),e.prototype.clone=function(t,r){var n={};this.emit({type:"cloneTable",detail:r}),t||(n.columns=this.columns),this.autoId||(n.id=this.id);var o=new e(n);return t||(o.versionTag=this.versionTag,o.originalRowIndexes=this.originalRowIndexes,o.localRowIndexes=this.localRowIndexes),o.metadata=_({},this.metadata),this.emit({type:"afterCloneTable",detail:r,tableClone:o}),o},e.prototype.deleteColumns=function(t,e){var r=this.columns,n={},o={},i=this.modifier,a=this.rowCount;if((t=t||Object.keys(r)).length){this.emit({type:"deleteColumns",columnIds:t,detail:e});for(var s=0,u=t.length,l=void 0,c=void 0;s<u;++s)(l=r[c=t[s]])&&(n[c]=l,o[c]=Array(a)),delete r[c];return Object.keys(r).length||(this.rowCount=0,this.deleteRowIndexReferences()),i&&i.modifyTable(this),this.emit({type:"afterDeleteColumns",columns:n,columnIds:t,detail:e}),n}},e.prototype.deleteRowIndexReferences=function(){delete this.originalRowIndexes,delete this.localRowIndexes},e.prototype.deleteRows=function(t,e,r){var n,o,i=this;void 0===e&&(e=1);var a=this.columns,s=this.modifier,u=[];if((0,w.defined)(t)?Array.isArray(t)?o=(n=t.filter(function(t,e,r){return t>=0&&t<i.rowCount&&r.indexOf(t)===e}).sort(function(t,e){return e-t})).length:(n=[t],o=e):(n=[0],o=this.rowCount),this.emit({type:"deleteRows",detail:r,rowCount:o,rowIndex:null!=t?t:0}),o>0)for(var l=Object.keys(a),c=0;c<l.length;++c){var f=l[c],p=a[f],h=void 0;if(1===n.length&&o>1){var d=T(p,n[0],o);h=d.removed,a[f]=d.array}else{h=[];for(var y=0,v=n;y<v.length;y++){var m=v[y];h.push(p[m]),T(p,m,1)}h.reverse()}c||(this.rowCount=p.length);for(var g=0,b=h.length;g<b;++g)u[g]=u[g]||[],u[g][c]=h[g]}return s&&s.modifyTable(this),this.emit({type:"afterDeleteRows",detail:r,rowCount:o,rowIndex:null!=t?t:0,rows:u}),u},e.prototype.emit=function(t){["afterDeleteColumns","afterDeleteRows","afterSetCell","afterSetColumns","afterSetRows"].includes(t.type)&&(this.versionTag=(0,w.uniqueKey)()),(0,w.fireEvent)(this,t.type,t)},e.prototype.getCell=function(t,e){var r=this.columns[t];if(r)return r[e]},e.prototype.getColumn=function(t,e){return this.getColumns([t],e)[t]},e.prototype.getColumnIds=function(){return Object.keys(this.columns)},e.prototype.getColumns=function(t,e,r){var n=this.columns,o={};t=t||Object.keys(n);for(var i=0,a=t.length,s=void 0,u=void 0;i<a;++i)(s=n[u=t[i]])&&(e?o[u]=s:r&&!Array.isArray(s)?o[u]=Array.from(s):o[u]=s.slice());return o},e.prototype.getLocalRowIndex=function(t){var e=this.localRowIndexes;return e?e[t]:t},e.prototype.getModifier=function(){return this.modifier},e.prototype.getOriginalRowIndex=function(t){var e=this.originalRowIndexes;return e?e[t]:t},e.prototype.getRow=function(t,e){return this.getRows(t,1,e)[0]},e.prototype.getRowCount=function(){return this.rowCount},e.prototype.getRowIndexBy=function(t,e,r){var n=this.columns[t];if(n){var o=-1;if(Array.isArray(n)?o=n.indexOf(e,r):(0,w.isNumber)(e)&&(o=n.indexOf(e,r)),-1!==o)return o}},e.prototype.getRowObject=function(t,e){return this.getRowObjects(t,1,e)[0]},e.prototype.getRowObjects=function(t,e,r){void 0===t&&(t=0),void 0===e&&(e=this.rowCount-t);var n=this.columns,o=Array(e);r=r||Object.keys(n);for(var i=t,a=0,s=Math.min(this.rowCount,t+e),u=void 0,l=void 0;i<s;++i,++a){l=o[a]={};for(var c=0,f=r;c<f.length;c++){var p=f[c];u=n[p],l[p]=u?u[i]:void 0}}return o},e.prototype.getRows=function(t,e,r){void 0===t&&(t=0),void 0===e&&(e=this.rowCount-t);var n=this.columns,o=Array(e);r=r||Object.keys(n);for(var i=t,a=0,s=Math.min(this.rowCount,t+e),u=void 0,l=void 0;i<s;++i,++a){l=o[a]=[];for(var c=0,f=r;c<f.length;c++)u=n[f[c]],l.push(u?u[i]:void 0)}return o},e.prototype.getVersionTag=function(){return this.versionTag},e.prototype.hasColumns=function(t){for(var e=this.columns,r=0,n=t.length,o=void 0;r<n;++r)if(!e[t[r]])return!1;return!0},e.prototype.hasRowWith=function(t,e){var r=this.columns[t];return Array.isArray(r)?-1!==r.indexOf(e):!!((0,w.defined)(e)&&Number.isFinite(e))&&-1!==r.indexOf(+e)},e.prototype.on=function(t,e){return(0,w.addEvent)(this,t,e)},e.prototype.changeColumnId=function(t,e){var r=this.columns;return!!r[t]&&(t!==e&&(r[e]=r[t],delete r[t]),!0)},e.prototype.setCell=function(t,e,r,n){var o=this.columns,i=this.modifier,a=o[t];a&&a[e]===r||(this.emit({type:"setCell",cellValue:r,columnId:t,detail:n,rowIndex:e}),a||(a=o[t]=Array(this.rowCount)),e>=this.rowCount&&(this.rowCount=e+1),a[e]=r,i&&i.modifyTable(this),this.emit({type:"afterSetCell",cellValue:r,columnId:t,detail:n,rowIndex:e}))},e.prototype.setColumns=function(e,r,n,o){var i=this.columns,a=this.modifier,s=Object.keys(e),u=this.rowCount;if(this.emit({type:"setColumns",columns:e,columnIds:s,detail:n,rowIndex:r}),(0,w.defined)(r)||o){for(var l=0,c=s.length,f=void 0,p=void 0,h=void 0,d=void 0;l<c;++l){f=e[h=s[l]],d=Object.getPrototypeOf((p=i[h])&&o?p:f).constructor,p?d===Array?Array.isArray(p)||(p=Array.from(p)):p.length<u&&(p=new d(u)).set(i[h]):p=new d(u),i[h]=p;for(var y=r||0,v=f.length;y<v;++y)p[y]=f[y];u=Math.max(u,f.length)}this.applyRowCount(u)}else t.prototype.setColumns.call(this,e,r,(0,w.extend)(n,{silent:!0}));a&&a.modifyTable(this),this.emit({type:"afterSetColumns",columns:e,columnIds:s,detail:n,rowIndex:r})},e.prototype.setModifier=function(t,e){var r=this;return r.emit({type:"setModifier",detail:e,modifier:t,modified:r.getModified()}),r.modifier=t,(t?t.modify(r):Promise.resolve(r)).then(function(r){return r.emit({type:"afterSetModifier",detail:e,modifier:t,modified:r.getModified()}),r}).catch(function(e){throw r.emit({type:"setModifierError",error:e,modifier:t,modified:r.getModified()}),e})},e.prototype.setOriginalRowIndexes=function(t,e){if(void 0===e&&(e=!1),this.originalRowIndexes=t,!e)for(var r=this.localRowIndexes=[],n=0,o=t.length,i=void 0;n<o;++n)i=t[n],(0,w.defined)(i)&&(r[i]=n)},e.prototype.setRow=function(t,e,r,n){this.setRows([t],e,r,n)},e.prototype.setRows=function(e,r,n,o){void 0===r&&(r=this.rowCount);var i=this.columns,a=Object.keys(i),s=this.modifier,u=e.length;this.emit({type:"setRows",detail:o,rowCount:u,rowIndex:r,rows:e});for(var l=0,c=r,f=void 0;l<u;++l,++c)if(0===Object.keys(f=e[l]).length)for(var p=0,h=a.length;p<h;++p){var d=i[a[p]];n?i[a[p]]=T(d,c,0,!0,[null]).array:d[c]=null}else if(Array.isArray(f))for(var p=0,h=a.length;p<h;++p)i[a[p]][c]=f[p];else t.prototype.setRow.call(this,f,c,n,{silent:!0});var y=n?u+e.length:r+u;if(y>this.rowCount){this.rowCount=y;for(var l=0,v=a.length;l<v;++l){var m=a[l];i[m]=N(i[m],y)}}s&&s.modifyTable(this),this.emit({type:"afterSetRows",detail:o,rowCount:u,rowIndex:r,rows:e})},e}(A),P=function(t,e,r,n){return new(r||(r=Promise))(function(o,i){function a(t){try{u(n.next(t))}catch(t){i(t)}}function s(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):((e=t.value)instanceof r?e:new r(function(t){t(e)})).then(a,s)}u((n=n.apply(t,e||[])).next())})},I=function(t,e){var r,n,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(u){var l=[s,u];if(r)throw TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(i=0)),i;)try{if(r=1,n&&(o=2&l[0]?n.return:l[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,l[1])).done)return o;switch(n=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,n=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===l[0]||2===l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(6===l[0]&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=e.call(t,i)}catch(t){l=[6,t],n=0}finally{r=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}},M=function(){function t(t){this.dataTables={},this.loaded=!1,this.metadata=t.metadata||{columns:{}},this.options=t;var e=null==t?void 0:t.dataTables,r=0;if(t.options&&console.error("The `DataConnectorOptions.options` property was removed in Dashboards v4.0.0. Check how to upgrade your connector to use the new options structure here: https://api.highcharts.com/dashboards/#interfaces/Data_DataTableOptions.DataTableOptions"),e&&(null==e?void 0:e.length)>0)for(var n=0,o=e.length;n<o;++n){var i=e[n],a=null==i?void 0:i.key;this.dataTables[null!=a?a:r]=new x(i),!a&&r++}else this.dataTables[0]=new x({id:t.id})}return t.registerType=function(e,r){return!!e&&!t.types[e]&&!!(t.types[e]=r)},Object.defineProperty(t.prototype,"polling",{get:function(){return!!this._polling},enumerable:!1,configurable:!0}),t.prototype.getTable=function(t){return t?this.dataTables[t]:Object.values(this.dataTables)[0]},t.prototype.describeColumn=function(t,e){var r=this.metadata.columns;r[t]=(0,w.merge)(r[t]||{},e)},t.prototype.describeColumns=function(t){for(var e,r=Object.keys(t);"string"==typeof(e=r.pop());)this.describeColumn(e,t[e])},t.prototype.getColumnOrder=function(){var t=this.metadata.columns,e=Object.keys(t||{});if(e.length)return e.sort(function(e,r){return(0,w.pick)(t[e].index,0)-(0,w.pick)(t[r].index,0)})},t.prototype.getSortedColumns=function(){return this.getTable().getColumns(this.getColumnOrder())},t.prototype.setColumnOrder=function(t){for(var e=0,r=t.length;e<r;++e)this.describeColumn(t[e],{index:e})},t.prototype.update=function(t){return P(this,arguments,void 0,function(t,e){var r;return void 0===e&&(e=!0),I(this,function(n){switch(n.label){case 0:if(this.emit({type:"beforeUpdate"}),(0,w.merge)(!0,this.options,t),r=this.options,("enablePolling"in t||"dataRefreshRate"in t)&&("enablePolling"in r&&r.enablePolling?(this.stopPolling(),this.startPolling("dataRefreshRate"in r&&"number"==typeof r.dataRefreshRate?1e3*Math.max(r.dataRefreshRate,1):1e3)):this.stopPolling()),!e)return[3,2];return[4,this.load()];case 1:n.sent(),n.label=2;case 2:return this.emit({type:"afterUpdate"}),[2]}})})},t.prototype.load=function(){return this.emit({type:"afterLoad"}),Promise.resolve(this)},t.prototype.applyTableModifiers=function(){return P(this,void 0,void 0,function(){var t,e,r,n,o,i,a,s,u,l,c,f;return I(this,function(p){switch(p.label){case 0:t=null==(u=this.options)?void 0:u.dataTables,e=function(e,n){var o,i;return I(this,function(a){switch(a.label){case 0:if(!(o=null!=(c=null==(l=null==t?void 0:t.find(function(t){return t.key===e}))?void 0:l.dataModifier)?c:null==(f=r.options)?void 0:f.dataModifier))return[2,"continue"];return i=o&&C.types[o.type],[4,n.setModifier(i?new i(o):void 0)];case 1:return a.sent(),[2]}})},r=this,n=0,o=Object.entries(this.dataTables),p.label=1;case 1:if(!(n<o.length))return[3,4];return a=(i=o[n])[0],s=i[1],[5,e(a,s)];case 2:p.sent(),p.label=3;case 3:return n++,[3,1];case 4:return[2,this]}})})},t.prototype.startPolling=function(t){void 0===t&&(t=1e3);var e=this;this.pollingController=new AbortController,window.clearTimeout(e._polling),e._polling=window.setTimeout(function(){return e.load().catch(function(t){return e.emit({type:"loadError",error:t})}).then(function(){e._polling&&e.startPolling(t)})},t)},t.prototype.stopPolling=function(){var t;this.polling&&(null==(t=null===this||void 0===this?void 0:this.pollingController)||t.abort(),window.clearTimeout(this._polling),delete this._polling)},t.prototype.emit=function(t){(0,w.fireEvent)(this,t.type,t)},t.prototype.on=function(t,e){return(0,w.addEvent)(this,t,e)},t.prototype.initConverters=function(t,e,r){for(var n=0,o=0,i=Object.entries(this.dataTables);o<i.length;o++){var a=i[o],s=a[0],u=a[1],l=e(s),c=r(l,t);u.deleteColumns(),u.setColumns(c),0===n&&(this.converter=l),n++}},t.types={},t}();function E(t,e){return"string"==typeof t&&(t=t.replace(/^\s+|\s+$/g,""),e&&/^[\d\s]+$/.test(t)&&(t=t.replace(/\s/g,""))),t}var F=function(t,e){var r;if("string"==typeof t)r=e.parseDate(t);else if("number"==typeof t)r=t;else{if(t instanceof Date)return t;r=e.parseDate(""+t)}return new Date(r)},D=function(t,e){if("number"==typeof t)return t;if("boolean"==typeof t)return+!!t;if("string"==typeof t){if(t.indexOf(" ")>-1&&(t=t.replace(/\s+/g,"")),e){if(!e.test(t))return NaN;t=t.replace(e,"$1.$2")}return parseFloat(t)}return t instanceof Date?t.getDate():t?t.getRowCount():NaN},S=function(t){return""+t},k=function(t,e){void 0===t&&(t=[]);for(var r={},n=0,o=Math.max(e.length,t.length);n<o;++n)r[e[n]||"".concat(n)]=t[n]?t[n].slice():[];return r},L=function(t,e){var r="string";if("string"==typeof t){var n=E("".concat(t)),o=e.decimalRegExp,i=E(n,!0);o&&(i=o.test(i)?i.replace(o,"$1.$2"):"");var a=parseFloat(i);if(+i===a)t=a;else{var s=e.parseDate(t);r=(0,w.isNumber)(s)?"Date":"string"}}return"number"==typeof t&&(r=t>31536e6?"Date":"number"),r},Y=function(){function t(e){this.dateFormats={"YYYY/mm/dd":{regex:/^(\d{4})([\-\.\/])(\d{1,2})\2(\d{1,2})$/,parser:function(t){return t?Date.UTC(+t[1],t[3]-1,+t[4]):NaN}},"dd/mm/YYYY":{regex:/^(\d{1,2})([\-\.\/])(\d{1,2})\2(\d{4})$/,parser:function(t){return t?Date.UTC(+t[4],t[3]-1,+t[1]):NaN},alternative:"mm/dd/YYYY"},"mm/dd/YYYY":{regex:/^(\d{1,2})([\-\.\/])(\d{1,2})\2(\d{4})$/,parser:function(t){return t?Date.UTC(+t[4],t[1]-1,+t[3]):NaN}},"dd/mm/YY":{regex:/^(\d{1,2})([\-\.\/])(\d{1,2})\2(\d{2})$/,parser:function(t){var e=new Date;if(!t)return NaN;var r=+t[4];return r>e.getFullYear()-2e3?r+=1900:r+=2e3,Date.UTC(r,t[3]-1,+t[1])},alternative:"mm/dd/YY"},"mm/dd/YY":{regex:/^(\d{1,2})([\-\.\/])(\d{1,2})\2(\d{2})$/,parser:function(t){return t?Date.UTC(+t[4]+2e3,t[1]-1,+t[3]):NaN}}};var r=(0,w.merge)(t.defaultOptions,e),n=r.decimalPoint;("."===n||","===n)&&(n="."===n?"\\.":",",this.decimalRegExp=RegExp("^(-?[0-9]+)"+n+"([0-9]+)$")),this.options=r}return t.registerType=function(e,r){return!!e&&!t.types[e]&&!!(t.types[e]=r)},t.prototype.convertByType=function(t){var e=this;return({number:function(t){return D(t,e.decimalRegExp)},Date:function(t){return F(t,e)},string:S})[L(t,e)].call(e,t)},t.prototype.deduceDateFormat=function(t,e,r){var n,o,i,a=[],s=[],u="YYYY/mm/dd",l=[],c=0,f=!1;for((!e||e>t.length)&&(e=t.length);c<e;c++)if(void 0!==t[c]&&t[c]&&t[c].length)for(i=0,n=t[c].trim().replace(/[\-\.\/]/g," ").split(" "),l=["","",""];i<n.length;i++)i<l.length&&(o=parseInt(n[i],10))&&(s[i]=!s[i]||s[i]<o?o:s[i],void 0!==a[i]?a[i]!==o&&(a[i]=!1):a[i]=o,o>31?o<100?l[i]="YY":l[i]="YYYY":o>12&&o<=31?(l[i]="dd",f=!0):l[i].length||(l[i]="mm"));if(f){for(i=0;i<a.length;i++)!1!==a[i]?s[i]>12&&"YY"!==l[i]&&"YYYY"!==l[i]&&(l[i]="YY"):s[i]>12&&"mm"===l[i]&&(l[i]="dd");3===l.length&&"dd"===l[1]&&"dd"===l[2]&&(l[2]="YY"),u=l.join("/")}return r&&(this.options.dateFormat=u),u},t.prototype.emit=function(t){(0,w.fireEvent)(this,t.type,t)},t.prototype.on=function(t,e){return(0,w.addEvent)(this,t,e)},t.prototype.parseDate=function(t,e){var r,n=this.options,o=e||n.dateFormat,i=NaN,a=null;if(n.parseDate)i=n.parseDate(t);else{var s=this.dateFormats;if(o){var u=s[o];u||(u=s["YYYY/mm/dd"]),(a=t.match(u.regex))&&(i=u.parser(a))}else for(r in s){var u=s[r];if(a=t.match(u.regex)){o=r,i=u.parser(a);break}}if(!a){var l=Date.parse(t);!isNaN(l)&&(i=l-6e4*new Date(l).getTimezoneOffset(),t.includes("2001")||2001!==new Date(i).getFullYear()||(i=NaN))}}return i},t.defaultOptions={dateFormat:"",firstRowAsNames:!0},t.types={},t}(),V=function(){function t(t){void 0===t&&(t={}),this.emittingRegister=[],this.listenerMap={},this.stateMap=t}return t.prototype.addListener=function(t,e,r){var n=this.listenerMap[t]=this.listenerMap[t]||{};return(n[e]=n[e]||[]).push(r),this},t.prototype.buildEmittingTag=function(t){return("position"===t.cursor.type?[t.table.id,t.cursor.column,t.cursor.row,t.cursor.state,t.cursor.type]:[t.table.id,t.cursor.columns,t.cursor.firstRow,t.cursor.lastRow,t.cursor.state,t.cursor.type]).join("\0")},t.prototype.emitCursor=function(t,e,r,n){var o,i=t.id,a=e.state,s=this.listenerMap[i]&&this.listenerMap[i][a];if(s){var u=this.stateMap[i]=null!=(o=this.stateMap[i])?o:{},l=u[e.state]||[];n&&(l.length||(u[e.state]=l),-1===H(e,l)&&l.push(e));var c={cursor:e,cursors:l,table:t};r&&(c.event=r);var f=this.emittingRegister,p=this.buildEmittingTag(c);if(f.indexOf(p)>=0)return this;try{this.emittingRegister.push(p);for(var h=0,d=s.length;h<d;++h)s[h].call(this,c)}finally{var y=this.emittingRegister.indexOf(p);y>=0&&this.emittingRegister.splice(y,1)}}return this},t.prototype.remitCursor=function(t,e){var r=this.stateMap[t]&&this.stateMap[t][e.state];if(r){var n=H(e,r);n>=0&&r.splice(n,1)}return this},t.prototype.removeListener=function(t,e,r){var n=this.listenerMap[t]&&this.listenerMap[t][e];if(n){var o=n.indexOf(r);o>=0&&n.splice(o,1)}return this},t}();function H(t,e){if("position"===t.type){for(var r=void 0,n=0,o=e.length;n<o;++n)if("position"===(r=e[n]).type&&r.state===t.state&&r.column===t.column&&r.row===t.row)return n}else for(var i=JSON.stringify(t.columns),r=void 0,n=0,o=e.length;n<o;++n)if("range"===(r=e[n]).type&&r.state===t.state&&r.firstRow===t.firstRow&&r.lastRow===t.lastRow&&JSON.stringify(r.columns)===i)return n;return -1}var U=function(t,e){var r,n,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(u){var l=[s,u];if(r)throw TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(i=0)),i;)try{if(r=1,n&&(o=2&l[0]?n.return:l[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,l[1])).done)return o;switch(n=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,n=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===l[0]||2===l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(6===l[0]&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=e.call(t,i)}catch(t){l=[6,t],n=0}finally{r=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}},$=function(){function t(e){this.options=(0,w.merge)(t.defaultOptions,e),this.connectors={},this.waiting={}}return t.prototype.emit=function(t){(0,w.fireEvent)(this,t.type,t)},t.prototype.getConnector=function(t){var e=this,r=this.connectors[t];if(null==r?void 0:r.loaded)return Promise.resolve(r);var n=this.waiting[t];if(!n){n=this.waiting[t]=[];var o=this.getConnectorOptions(t);if(!o)throw Error("Connector '".concat(t,"' not found."));this.loadConnector(o).then(function(r){delete e.waiting[t];for(var o=0,i=n.length;o<i;++o)n[o][0](r)}).catch(function(r){delete e.waiting[t];for(var o=0,i=n.length;o<i;++o)n[o][1](r)})}return new Promise(function(t,e){n.push([t,e])})},t.prototype.getConnectorIds=function(){for(var t=this.options.connectors,e=[],r=0,n=t.length;r<n;++r)e.push(t[r].id);return e},t.prototype.getConnectorOptions=function(t){for(var e=this.options.connectors,r=0,n=e.length;r<n;++r)if(e[r].id===t)return e[r]},t.prototype.isNewConnector=function(t){return!this.connectors[t]},t.prototype.loadConnector=function(t){var e=this;return new Promise(function(r,n){e.emit({type:"load",options:t});var o=M.types[t.type];if(!o)throw Error("Connector type not found. (".concat(t.type,")"));var i=e.connectors[t.id]=new o(t);i.load().then(function(n){i.converter=n.converter,i.loaded=!0,e.emit({type:"afterLoad",options:t}),r(i)}).catch(n)})},t.prototype.cancelPendingRequests=function(){for(var t=this.connectors,e=0,r=Object.keys(t);e<r.length;e++)t[r[e]].stopPolling()},t.prototype.on=function(t,e){return(0,w.addEvent)(this,t,e)},t.prototype.setConnectorOptions=function(t,e){var r,n,o,i;return r=this,n=void 0,o=void 0,i=function(){var r,n,o,i,a;return U(this,function(s){switch(s.label){case 0:for(r=this.options.connectors,n=this.connectors,this.emit({type:"setConnectorOptions",options:t}),o=0,i=r.length;o<i;++o)if(r[o].id===t.id){r.splice(o,1);break}if(!(a=n[t.id]))return[3,3];if(!e)return[3,2];return[4,a.update(t,!0)];case 1:return s.sent(),[3,3];case 2:a.stopPolling(),a=void 0,delete n[t.id],s.label=3;case 3:return a||r.push(t),this.emit({type:"afterSetConnectorOptions",options:t}),[2]}})},new(o||(o=Promise))(function(t,e){function a(t){try{u(i.next(t))}catch(t){e(t)}}function s(t){try{u(i.throw(t))}catch(t){e(t)}}function u(e){var r;e.done?t(e.value):((r=e.value)instanceof o?r:new o(function(t){t(r)})).then(a,s)}u((i=i.apply(r,n||[])).next())})},t.defaultOptions={connectors:[]},t}(),B=/^(?:FALSE|TRUE)/,G=/^[+\-]?\d+(?:\.\d+)?(?:e[+\-]\d+)?/,K=/^[+\-]?\d+(?:,\d+)?(?:e[+\-]\d+)?/,Z=/^([A-Z][A-Z\d\.]*)\(/,X=/^(?:[+\-*\/^<=>]|<=|=>)/,q=/^(\$?[A-Z]+)(\$?\d+)\:(\$?[A-Z]+)(\$?\d+)/,J=/^R(\d*|\[\d+\])C(\d*|\[\d+\])\:R(\d*|\[\d+\])C(\d*|\[\d+\])/,W=/^(\$?[A-Z]+)(\$?\d+)(?![\:C])/,z=/^R(\d*|\[\d+\])C(\d*|\[\d+\])(?!\:)/;function Q(t){for(var e=0,r=0,n=t.length,o=void 0,i=1;r<n;++r){if("("===(o=t[r])){e||(i=r+1),++e;continue}if(")"===o&&!--e)return t.substring(i,r)}if(e>0){var a=Error("Incomplete parentheses.");throw a.name="FormulaParseError",a}return""}function tt(t){for(var e=-1,r=0,n=t.length,o=void 0,i=!1;r<n;++r){if("\\"===(o=t[r])){i=!i;continue}if(i){i=!1;continue}if('"'===o)if(!(e<0))return t.substring(e+1,r);else e=r}var a=Error("Incomplete string.");throw a.name="FormulaParseError",a}function te(t,e){if(r=t.match(J)){var r,n=""===r[2]||"["===r[2][0],o=""===r[1]||"["===r[1][0],i=""===r[4]||"["===r[4][0],a=""===r[3]||"["===r[3][0],s={type:"range",beginColumn:n?parseInt(r[2].substring(1,-1)||"0",10):parseInt(r[2],10)-1,beginRow:o?parseInt(r[1].substring(1,-1)||"0",10):parseInt(r[1],10)-1,endColumn:i?parseInt(r[4].substring(1,-1)||"0",10):parseInt(r[4],10)-1,endRow:a?parseInt(r[3].substring(1,-1)||"0",10):parseInt(r[3],10)-1};return n&&(s.beginColumnRelative=!0),o&&(s.beginRowRelative=!0),i&&(s.endColumnRelative=!0),a&&(s.endRowRelative=!0),s}if(r=t.match(q)){var n="$"!==r[1][0],o="$"!==r[2][0],i="$"!==r[3][0],a="$"!==r[4][0],s={type:"range",beginColumn:to(n?r[1]:r[1].substring(1))-1,beginRow:parseInt(o?r[2]:r[2].substring(1),10)-1,endColumn:to(i?r[3]:r[3].substring(1))-1,endRow:parseInt(a?r[4]:r[4].substring(1),10)-1};return n&&(s.beginColumnRelative=!0),o&&(s.beginRowRelative=!0),i&&(s.endColumnRelative=!0),a&&(s.endRowRelative=!0),s}var u=tn(t,e);return 1===u.length&&"string"!=typeof u[0]?u[0]:u}function tr(t){var e=t.length,r=t[e-2];return"-"===t[e-1]&&(0,w.isString)(r)&&!!r.match(/\*|\/|\^/)}function tn(t,e){for(var r,n=e?K:G,o=[],i=("="===t[0]?t.substring(1):t).trim();i;){if(r=i.match(z)){var a=""===r[2]||"["===r[2][0],s=""===r[1]||"["===r[1][0],u={type:"reference",column:a?parseInt(r[2].substring(1,-1)||"0",10):parseInt(r[2],10)-1,row:s?parseInt(r[1].substring(1,-1)||"0",10):parseInt(r[1],10)-1};a&&(u.columnRelative=!0),s&&(u.rowRelative=!0),tr(o)&&(o.pop(),u.isNegative=!0),o.push(u),i=i.substring(r[0].length).trim();continue}if(r=i.match(W)){var a="$"!==r[1][0],s="$"!==r[2][0],u={type:"reference",column:to(a?r[1]:r[1].substring(1))-1,row:parseInt(s?r[2]:r[2].substring(1),10)-1};a&&(u.columnRelative=!0),s&&(u.rowRelative=!0),tr(o)&&(o.pop(),u.isNegative=!0),o.push(u),i=i.substring(r[0].length).trim();continue}if(r=i.match(X)){o.push(r[0]),i=i.substring(r[0].length).trim();continue}if(r=i.match(B)){o.push("TRUE"===r[0]),i=i.substring(r[0].length).trim();continue}if(r=i.match(n)){var l=parseFloat(r[0]);tr(o)&&(o.pop(),l=-l),o.push(l),i=i.substring(r[0].length).trim();continue}if('"'===i[0]){var c=tt(i);o.push(c.substring(1,-1)),i=i.substring(c.length+2).trim();continue}if(r=i.match(Z)){var f=Q(i=i.substring(r[1].length).trim());o.push({type:"function",name:r[1],args:function(t,e){for(var r=[],n=e?";":",",o=0,i="",a=0,s=t.length,u=void 0;a<s;++a)if((u=t[a])===n&&!o&&i)r.push(te(i,e)),i="";else if('"'!==u||o||i)" "!==u&&(i+=u,"("===u?++o:")"===u&&--o);else{var l=tt(t.substring(a));r.push(l),a+=l.length+1}return!o&&i&&r.push(te(i,e)),r}(f,e)}),i=i.substring(f.length+2).trim();continue}if("("===i[0]){var p=Q(i);if(p){o.push(tn(p,e)),i=i.substring(p.length+2).trim();continue}}var h=t.length-i.length,d=Error("Unexpected character `"+t.substring(h,h+1)+"` at position "+(h+1)+". (`..."+t.substring(h-5,h+6)+"...`)");throw d.name="FormulaParseError",d}return o}function to(t){for(var e=0,r=0,n=t.length,o=void 0,i=t.length-1;r<n;++r)(o=t.charCodeAt(r))>=65&&o<=90&&(e+=(o-64)*Math.pow(26,i)),--i;return e}var ti={parseFormula:tn},ta=["+","-","*","/","^","=","<","<=",">",">="],ts={isFormula:function(t){return Array.isArray(t)},isFunction:function(t){return"object"==typeof t&&!Array.isArray(t)&&"function"===t.type},isOperator:function(t){return"string"==typeof t&&ta.indexOf(t)>=0},isRange:function(t){return"object"==typeof t&&!Array.isArray(t)&&"range"===t.type},isReference:function(t){return"object"==typeof t&&!Array.isArray(t)&&"reference"===t.type},isValue:function(t){return"boolean"==typeof t||"number"==typeof t||"string"==typeof t}},tu=ts.isFormula,tl=ts.isFunction,tc=ts.isOperator,tf=ts.isRange,tp=ts.isReference,th=ts.isValue,td=/ */,ty=Number.MAX_VALUE/1.000000000001,tv=Number.MAX_VALUE/1.000000000002,tm=Number.MAX_VALUE,tg={"^":3,"*":2,"/":2,"+":1,"-":1,"=":0,"<":0,"<=":0,">":0,">=":0},tb={},tw=/^[A-Z][A-Z\.]*$/;function tO(t){switch(typeof t){case"boolean":return t?tm:ty;case"string":return tv;case"number":return t;default:return NaN}}function tC(t){return"string"==typeof t?t.toLowerCase().replace(td,"\0"):t}function tR(t){switch(typeof t){case"boolean":return+!!t;case"string":return parseFloat(t.replace(",","."));case"number":return t;default:return NaN}}function tN(t,e){return th(t)?t:tf(t)?e&&tT(t,e)||[]:tl(t)?tx(t,e):t_(tu(t)?t:[t],e)}function tT(t,e){for(var r=e.getColumnIds().slice(t.beginColumn,t.endColumn+1),n=[],o=0,i=r.length,a=void 0;o<i;++o)for(var s=e.getColumn(r[o],!0)||[],u=t.beginRow,l=t.endRow+1;u<l;++u)"string"==typeof(a=s[u])&&"="===a[0]&&e!==e.getModified()&&(a=e.getModified().getCell(r[o],u)),n.push(th(a)?a:NaN);return n}function tA(t,e){var r=e.getColumnIds()[t.column];if(r){var n=e.getCell(r,t.row);if("string"==typeof n&&"="===n[0]&&e!==e.getModified()){var o=e.getModified().getCell(r,t.row);return th(o)?o:NaN}if(th(n))return t.isNegative?-n:n}return NaN}function tj(t,e){(t.length<2||e.length<1)&&t.push(NaN);var r=t.pop(),n=t.pop(),o=e.pop();(0,w.defined)(r)&&(0,w.defined)(n)&&(0,w.defined)(o)?t.push(function(t,e,r){var n;switch(t){case"=":return tC(e)===tC(r);case"<":if(typeof e==typeof r)return tC(e)<tC(r);return tO(e)<tO(r);case"<=":if(typeof e==typeof r)return tC(e)<=tC(r);return tO(e)<=tO(r);case">":if(typeof e==typeof r)return tC(e)>tC(r);return tO(e)>tO(r);case">=":if(typeof e==typeof r)return tC(e)>=tC(r);return tO(e)>=tO(r)}switch(e=tR(e),r=tR(r),t){case"+":n=e+r;break;case"-":n=e-r;break;case"*":n=e*r;break;case"/":n=e/r;break;case"^":n=Math.pow(e,r);break;default:return NaN}return n%1?Math.round(1e9*n)/1e9:n}(o,n,r)):t.push(NaN)}function t_(t,e){for(var r=[],n=[],o=!0,i=0,a=t.length;i<a;++i){var s=t[i];if(tc(s)){if(o&&"-"===s)r.push(0),n.push("-"),o=!0;else{for(;n.length&&tg[n[n.length-1]]>=tg[s];)tj(r,n);n.push(s),o=!0}continue}var u=void 0;if(th(s))u=s;else if(tp(s))u=e?tA(s,e):NaN;else if(tl(s)){var l=tx(s,e);u=th(l)?l:NaN}else tu(s)&&(u=t_(s,e));if(void 0===u)return NaN;r.push(u),o=!1}for(;n.length;)tj(r,n);return 1!==r.length?NaN:r[0]}function tx(t,e,r){var n=tb[t.name];if(n)try{return n(t.args,e)}catch(t){return NaN}var o=Error('Function "'.concat(t.name,'" not found.'));throw o.name="FormulaProcessError",o}var tP={asNumber:tR,getArgumentValue:tN,getArgumentsValues:function(t,e){for(var r=[],n=0,o=t.length;n<o;++n)r.push(tN(t[n],e));return r},getRangeValues:tT,getReferenceValue:tA,processFormula:t_,processorFunctions:tb,registerProcessorFunction:function(t,e){return tw.test(t)&&!tb[t]&&!!(tb[t]=e)},translateReferences:function t(e,r,n){void 0===r&&(r=0),void 0===n&&(n=0);for(var o=0,i=e.length,a=void 0;o<i;++o)Array.isArray(a=e[o])?t(a,r,n):tl(a)?t(a.args,r,n):tf(a)?(a.beginColumnRelative&&(a.beginColumn+=r),a.beginRowRelative&&(a.beginRow+=n),a.endColumnRelative&&(a.endColumn+=r),a.endRowRelative&&(a.endRow+=n)):tp(a)&&(a.columnRelative&&(a.column+=r),a.rowRelative&&(a.row+=n));return e}},tI=tP.getArgumentValue;tP.registerProcessorFunction("ABS",function(t,e){var r=tI(t[0],e);switch(typeof r){case"number":return Math.abs(r);case"object":for(var n=[],o=0,i=r.length,a=void 0;o<i;++o){if("number"!=typeof(a=r[o]))return NaN;n.push(Math.abs(a))}return n;default:return NaN}});var tM=tP.getArgumentValue;tP.registerProcessorFunction("AND",function t(e,r){for(var n=0,o=e.length,i=void 0;n<o;++n)if(!(i=tM(e[n],r))||"object"==typeof i&&!t(i,r))return!1;return!0});var tE=tP.getArgumentsValues;tP.registerProcessorFunction("AVERAGE",function(t,e){for(var r=tE(t,e),n=0,o=0,i=0,a=r.length,s=void 0;i<a;++i)switch(typeof(s=r[i])){case"number":isNaN(s)||(++n,o+=s);break;case"object":for(var u=0,l=s.length,c=void 0;u<l;++u)"number"!=typeof(c=s[u])||isNaN(c)||(++n,o+=c)}return n?o/n:0});var tF=tP.getArgumentValue;tP.registerProcessorFunction("AVERAGEA",function(t,e){for(var r=0,n=0,o=0,i=t.length,a=void 0;o<i;++o)switch(typeof(a=tF(t[o],e))){case"boolean":++r,n+=+!!a;continue;case"number":isNaN(a)||(++r,n+=a);continue;case"string":++r;continue;default:for(var s=0,u=a.length,l=void 0;s<u;++s)switch(typeof(l=a[s])){case"boolean":++r,n+=+!!l;continue;case"number":isNaN(l)||(++r,n+=l);continue;case"string":++r;continue}continue}return r?n/r:0}),tP.registerProcessorFunction("COUNT",function t(e,r){for(var n=tP.getArgumentsValues(e,r),o=0,i=0,a=n.length,s=void 0;i<a;++i)switch(typeof(s=n[i])){case"number":!isNaN(s)&&++o;break;case"object":o+=t(s,r)}return o}),tP.registerProcessorFunction("COUNTA",function t(e,r){for(var n=tP.getArgumentsValues(e,r),o=0,i=0,a=n.length,s=void 0;i<a;++i){switch(typeof(s=n[i])){case"number":if(isNaN(s))continue;break;case"object":o+=t(s,r);continue;case"string":if(!s)continue}++o}return o});var tD=tP.getArgumentValue;tP.registerProcessorFunction("IF",function(t,e){return tD(t[0],e)?tD(t[1],e):tD(t[2],e)});var tS=tP.getArgumentValue;tP.registerProcessorFunction("ISNA",function(t,e){var r=tS(t[0],e);return"number"!=typeof r||isNaN(r)});var tk=tP.getArgumentsValues;tP.registerProcessorFunction("MAX",function t(e,r){for(var n=tk(e,r),o=-1/0,i=0,a=n.length,s=void 0;i<a;++i)switch(typeof(s=n[i])){case"number":s>o&&(o=s);break;case"object":(s=t(s))>o&&(o=s)}return isFinite(o)?o:0}),tP.registerProcessorFunction("MEDIAN",function(t,e){for(var r=[],n=tP.getArgumentsValues(t,e),o=0,i=n.length,a=void 0;o<i;++o)switch(typeof(a=n[o])){case"number":isNaN(a)||r.push(a);break;case"object":for(var s=0,u=a.length,l=void 0;s<u;++s)"number"!=typeof(l=a[s])||isNaN(l)||r.push(l)}var c=r.length;if(!c)return NaN;var f=Math.floor(c/2);return c%2?r[f]:(r[f-1]+r[f])/2});var tL=tP.getArgumentsValues;tP.registerProcessorFunction("MIN",function t(e,r){for(var n=tL(e,r),o=1/0,i=0,a=n.length,s=void 0;i<a;++i)switch(typeof(s=n[i])){case"number":s<o&&(o=s);break;case"object":(s=t(s))<o&&(o=s)}return isFinite(o)?o:0});var tY=tP.getArgumentValue;function tV(t,e){for(var r={},n=tP.getArgumentsValues(t,e),o=0,i=n.length,a=void 0;o<i;++o)switch(typeof(a=n[o])){case"number":isNaN(a)||(r[a]=(r[a]||0)+1);break;case"object":for(var s=0,u=a.length,l=void 0;s<u;++s)"number"!=typeof(l=a[s])||isNaN(l)||(r[l]=(r[l]||0)+1)}return r}function tH(t,e){var r=tV(t,e),n=Object.keys(r);if(!n.length)return NaN;for(var o=parseFloat(n[0]),i=r[n[0]],a=1,s=n.length,u=void 0,l=void 0,c=void 0;a<s;++a)i<(c=r[u=n[a]])?(o=parseFloat(u),i=c):i===c&&o>(l=parseFloat(u))&&(o=l,i=c);return i>1?o:NaN}tP.registerProcessorFunction("MOD",function(t,e){var r=tY(t[0],e),n=tY(t[1],e);return("object"==typeof r&&(r=r[0]),"object"==typeof n&&(n=n[0]),"number"!=typeof r||"number"!=typeof n||0===n)?NaN:r%n}),tP.registerProcessorFunction("MODE",tH),tP.registerProcessorFunction("MODE.MULT",function(t,e){var r=tV(t,e),n=Object.keys(r);if(!n.length)return NaN;for(var o=[parseFloat(n[0])],i=r[n[0]],a=1,s=n.length,u=void 0,l=void 0;a<s;++a)i<(l=r[u=n[a]])?(o=[parseFloat(u)],i=l):i===l&&o.push(parseFloat(u));return i>1?o:NaN}),tP.registerProcessorFunction("MODE.SNGL",tH);var tU=tP.getArgumentValue;tP.registerProcessorFunction("NOT",function(t,e){var r=tU(t[0],e);switch("object"==typeof r&&(r=r[0]),typeof r){case"boolean":case"number":return!r}return NaN});var t$=tP.getArgumentValue;tP.registerProcessorFunction("OR",function t(e,r){for(var n=0,o=e.length,i=void 0;n<o;++n)if("object"==typeof(i=t$(e[n],r))){if(t(i,r))return!0}else if(i)return!0;return!1});var tB=tP.getArgumentsValues;tP.registerProcessorFunction("PRODUCT",function t(e,r){for(var n=tB(e,r),o=1,i=!1,a=0,s=n.length,u=void 0;a<s;++a)switch(typeof(u=n[a])){case"number":isNaN(u)||(i=!0,o*=u);break;case"object":i=!0,o*=t(u,r)}return i?o:0}),tP.registerProcessorFunction("SUM",function t(e,r){for(var n=tP.getArgumentsValues(e,r),o=0,i=0,a=n.length,s=void 0;i<a;++i)switch(typeof(s=n[i])){case"number":isNaN(s)||(o+=s);break;case"object":o+=t(s,r)}return o});var tG=tP.getArgumentValue;tP.registerProcessorFunction("XOR",function(t,e){for(var r=0,n=t.length,o=void 0,i=void 0;r<n;++r)switch(typeof(i=tG(t[r],e))){case"boolean":case"number":if(void 0===o)o=!!i;else if(!!i!==o)return!0;break;case"object":for(var a=0,s=i.length,u=void 0;a<s;++a)switch(typeof(u=i[a])){case"boolean":case"number":if(void 0===o)o=!!u;else if(!!u!==o)return!0}}return!1});var tK=function(){return(tK=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},tZ=tK(tK(tK({},ti),tP),ts),tX=(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)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),tq=function(){return(tq=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},tJ=function(t){function e(r){var n=this,o=(0,w.merge)(e.defaultOptions,r);return(n=t.call(this,o)||this).headers=[],n.dataTypes=[],n.options=o,n}return tX(e,t),e.prototype.parse=function(t,e){var r,n,o=this.dataTypes,i=(0,w.merge)(this.options,t),a=i.beforeParse,s=i.lineDelimiter,u=i.firstRowAsNames,l=i.itemDelimiter,c=0,f=i.csv,p=i.startRow,h=i.endRow,d=[];if(this.emit({type:"parse",columns:d,detail:e,headers:this.headers}),f&&a&&(f=a(f)),f){if(r=f.replace(/\r\n|\r/g,"\n").split(s||"\n"),(!p||p<0)&&(p=0),(!h||h>=r.length)&&(h=r.length-1),l||(this.guessedItemDelimiter=this.guessDelimiter(r)),u){for(var y=r[0].split(l||this.guessedItemDelimiter||","),v=0;v<y.length;v++)y[v]=y[v].trim().replace(/^["']|["']$/g,"");this.headers=y,p++}var m=0;for(c=p;c<=h;c++)"#"===r[c][0]?m++:this.parseCSVRow(d,r[c],c-p-m);o.length&&o[0].length&&"date"===o[0][1]&&!this.options.dateFormat&&this.deduceDateFormat(d[0],null,!0);for(var v=0,g=d.length;v<g;++v){n=d[v];for(var b=0,O=n.length;b<O;++b)if(n[b]&&"string"==typeof n[b]){var C=this.convertByType(n[b]);C instanceof Date&&(C=C.getTime()),d[v][b]=C}}}return d.forEach(function(t){t.length=Math.max.apply(Math,d.map(function(t){return t.length}))}),this.emit({type:"afterParse",columns:d,detail:e,headers:this.headers}),k(d,this.headers)},e.prototype.parseCSVRow=function(t,e,r){var n=this,o=n.dataTypes,i=n.options,a=i.startColumn,s=i.endColumn,u=n.options.itemDelimiter||n.guessedItemDelimiter,l=n.options.decimalPoint;l&&l!==u||(l=n.guessedDecimalPoint||".");var c=0,f="",p="",h=0,d=0,y=function(t){f=e[t]},v=function(t){o.length<d+1&&o.push([t]),o[d][o[d].length-1]!==t&&o[d].push(t)},m=function(){if(a>h||h>s){++h,p="";return}if("string"==typeof p){var e=parseFloat(p);!isNaN(e)&&isFinite(Number(p))?(p=e,v("number")):isNaN(Date.parse(p))?v("string"):(p=p.replace(/\//g,"-"),v("date"))}else v("number");if(t.length<d+1&&t.push([]),"number"!=typeof p&&"number"!==L(p,n)&&l){var o=p;"number"!==L(p=p.replace(l,"."),n)&&(p=o)}t[d][r]=p,p="",++d,++h};if(e.trim().length&&"#"!==e.trim()[0]){for(;c<e.length;c++){if(y(c),"#"===f&&!/^#[A-F\d]{3,3}|[A-F\d]{6,6}/i.test(e.substring(c)))return void m();if('"'===f)for(y(++c);c<e.length&&'"'!==f;)p+=f,y(++c);else f===u?m():p+=f}m()}},e.prototype.guessDelimiter=function(t){for(var e,r=0,n=0,o={",":0,";":0,"	":0},i=t.length,a=0;a<i;a++){var s=!1,u=void 0,l=void 0,c=void 0,f="";if(a>13)break;for(var p=t[a],h=0;h<p.length&&(u=p[h],l=p[h+1],c=p[h-1],"#"!==u);h++){if('"'===u)if(s){if('"'!==c&&'"'!==l){for(;" "===l&&h<p.length;)l=p[++h];void 0!==o[l]&&o[l]++,s=!1}}else s=!0;else void 0!==o[u]?(isNaN(Date.parse(f=f.trim()))?(isNaN(Number(f))||!isFinite(Number(f)))&&o[u]++:o[u]++,f=""):f+=u;","===u&&n++,"."===u&&r++}}return o[";"]>o[","]?e=";":(o[","]>o[";"],e=","),r>n?this.guessedDecimalPoint=".":this.guessedDecimalPoint=",",e},e.defaultOptions=tq(tq({},Y.defaultOptions),{lineDelimiter:"\n",startColumn:0,endColumn:Number.MAX_VALUE,startRow:0,endRow:Number.MAX_VALUE}),e}(Y);Y.registerType("CSV",tJ);var tW=(n=function(t,e){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),tz=function(t){function e(r){var n=this,o=(0,w.merge)(e.defaultOptions,r);return(n=t.call(this,o)||this).options=o,o.enablePolling&&n.startPolling(1e3*Math.max(o.dataRefreshRate||0,1)),n}return tW(e,t),e.prototype.emit=function(t){(0,w.fireEvent)(this,t.type,t)},e.prototype.load=function(t){var e,r=this,n=this,o=n.options,i=o.csv,a=o.csvURL,s=o.dataTables,u=o.decimalPoint;return n.emit({type:"load",csv:i}),Promise.resolve(a?fetch(a,{signal:null==(e=null==n?void 0:n.pollingController)?void 0:e.signal}).then(function(t){return t.text()}):i||"").then(function(t){return t&&r.initConverters(t,function(t){var e=(null==s?void 0:s.find(function(e){return e.key===t}))||{},r=e.firstRowAsNames,n=void 0===r?o.firstRowAsNames:r,i=e.beforeParse,a=void 0===i?o.beforeParse:i;return new tJ((0,w.merge)(o,{decimalPoint:u,firstRowAsNames:n,beforeParse:a}))},function(t,e){return t.parse({csv:e})}),n.applyTableModifiers().then(function(){return t})}).then(function(e){return n.emit({type:"afterLoad",detail:t,csv:e}),n}).catch(function(e){throw n.emit({type:"loadError",detail:t,error:e}),e})},e.defaultOptions={id:"csv-connector",type:"CSV",csv:"",csvURL:"",enablePolling:!1,dataRefreshRate:1,firstRowAsNames:!0},e}(M);M.registerType("CSV",tz);var tQ=(o=function(t,e){return(o=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),t0=function(){return(t0=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},t1=function(t){function e(r){var n=this,o=(0,w.merge)(e.defaultOptions,r);return(n=t.call(this,o)||this).headerColumnIds=[],n.headers=[],n.options=o,n}return tQ(e,t),e.prototype.parse=function(t,e){var r=(t=(0,w.merge)(this.options,t)).beforeParse,n=t.orientation,o=t.firstRowAsNames,i=t.columnIds,a=t.data;if(!a)return{};this.headers=[];var s=[];return this.emit({type:"parse",columns:s,detail:e,headers:this.headers}),r&&(a=r(a)),a=a.slice(),"columns"===n?this.parseColumnsOrientation(s,a,o,i):"rows"===n&&this.parseRowsOrientation(s,a,o,i),this.emit({type:"afterParse",columns:s,detail:e,headers:this.headers}),k(s,this.headers)},e.prototype.parseColumnsOrientation=function(t,e,r,n){for(var o=0,i=e.length;o<i;o++){var a=e[o];if(!Array.isArray(a))return;Array.isArray(this.headers)?(r?this.headers.push("".concat(a.shift())):n&&Array.isArray(n)&&this.headers.push(n[o]),t.push(a)):(0,w.error)("JSONConverter: Invalid `columnIds` option.",!1)}},e.prototype.parseRowsOrientation=function(t,e,r,n){r?this.headers=e.shift():n&&(this.headerColumnIds=n);for(var o=0,i=e.length;o<i;o++){var a=e[o];(0,w.isArray)(a)||(a=this.convertItemToRow(a,n));for(var s=0,u=a.length;s<u;s++)t.length<s+1&&t.push([]),t[s].push(a[s]),r||0!==o||(Array.isArray(this.headerColumnIds)?this.headers.push(this.headerColumnIds[s]||s.toString()):(0,w.error)("JSONConverter: Invalid `columnIds` option.",!1))}},e.prototype.convertItemToRow=function(t,e){var r=this;if(e&&!Array.isArray(e)){var n=[];return(0,w.objectEach)(e,function(e,o){n.push(e.reduce(function(t,e){return t[e]},t)),0>r.headers.indexOf(o)&&r.headers.push(o)}),n}return r.headerColumnIds=Object.keys(t),Object.values(t)},e.defaultOptions=t0(t0({},Y.defaultOptions),{orientation:"rows"}),e}(Y);Y.registerType("JSON",t1);var t2=(i=function(t,e){return(i=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),t3=function(t,e){var r,n,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(u){var l=[s,u];if(r)throw TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(i=0)),i;)try{if(r=1,n&&(o=2&l[0]?n.return:l[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,l[1])).done)return o;switch(n=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,n=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===l[0]||2===l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(6===l[0]&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=e.call(t,i)}catch(t){l=[6,t],n=0}finally{r=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}},t4=function(t){function e(r){var n=this,o=(0,w.merge)(e.defaultOptions,r);return(n=t.call(this,o)||this).options=o,o.enablePolling&&n.startPolling(1e3*Math.max(o.dataRefreshRate||0,1)),n}return t2(e,t),e.prototype.emit=function(t){(0,w.fireEvent)(this,t.type,t)},e.prototype.load=function(t){var e,r=this,n=this,o=n.options,i=o.data,a=o.dataUrl,s=o.dataTables;return n.emit({type:"load",detail:t,data:i}),Promise.resolve(a?fetch(a,{signal:null==(e=null==n?void 0:n.pollingController)?void 0:e.signal}).then(function(t){return t.json()}).catch(function(e){n.emit({type:"loadError",detail:t,error:e}),console.warn("Unable to fetch data from ".concat(a,"."))}):i||[]).then(function(t){var e,i,a;return e=void 0,i=void 0,a=function(){return t3(this,function(e){return t&&this.initConverters(t,function(e){var r=(null==s?void 0:s.find(function(t){return t.key===e}))||{},n=r.columnIds,i=void 0===n?o.columnIds:n,a=r.firstRowAsNames,u=void 0===a?o.firstRowAsNames:a,l=r.orientation,c=void 0===l?o.orientation:l,f=r.beforeParse;return new t1({data:t,columnIds:i,firstRowAsNames:u,orientation:c,beforeParse:void 0===f?o.beforeParse:f})},function(t,e){return t.parse({data:e})}),[2,n.applyTableModifiers().then(function(){return null!=t?t:[]})]})},new(i||(i=Promise))(function(t,n){function o(t){try{u(a.next(t))}catch(t){n(t)}}function s(t){try{u(a.throw(t))}catch(t){n(t)}}function u(e){var r;e.done?t(e.value):((r=e.value)instanceof i?r:new i(function(t){t(r)})).then(o,s)}u((a=a.apply(r,e||[])).next())})}).then(function(e){return n.emit({type:"afterLoad",detail:t,data:e}),n}).catch(function(e){throw n.emit({type:"loadError",detail:t,error:e}),e})},e.defaultOptions={type:"JSON",id:"json-connector",data:[],enablePolling:!1,dataRefreshRate:0,firstRowAsNames:!0,orientation:"rows"},e}(M);M.registerType("JSON",t4);var t6=(a=function(t,e){return(a=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}a(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),t5=function(){return(t5=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},t9=function(t){function e(r){var n=this,o=(0,w.merge)(e.defaultOptions,r);return(n=t.call(this,o)||this).header=[],n.options=o,n}return t6(e,t),e.prototype.parse=function(t,e){var r,n,o=(0,w.merge)(this.options,t),i=((null==(r=o.json)?void 0:r.values)||[]).map(function(t){return t.slice()});if(0===i.length)return{};this.header=[],this.emit({type:"parse",columns:[],detail:e,headers:this.header});var a=o.beforeParse,s=o.json;a&&s&&(i=a(s.values));for(var u=0,l=i.length;u<l;u++){n=i[u],this.header[u]=o.firstRowAsNames?"".concat(n.shift()):(0,w.uniqueKey)();for(var c=0,f=n.length;c<f;++c){var p,h=n[c];p=h,"[object Date]"===Object.prototype.toString.call(p)&&(h=h.getTime()),i[u][c]=h}}return this.emit({type:"afterParse",columns:i,detail:e,headers:this.header}),k(i,this.header)},e.defaultOptions=t5({},Y.defaultOptions),e}(Y);Y.registerType("GoogleSheets",t9);var t7=(s=function(t,e){return(s=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}s(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),t8=function(t){function e(r){var n=this,o=(0,w.merge)(e.defaultOptions,r);return(n=t.call(this,o)||this).options=o,n}return t7(e,t),e.prototype.emit=function(t){(0,w.fireEvent)(this,t.type,t)},e.prototype.load=function(t){var e,r,n,o,i,a,s,u,l,c,f,p,h,d=this,y=this,v=y.options,m=v.dataRefreshRate,g=v.enablePolling,b=v.googleAPIKey,O=v.googleSpreadsheetKey,C=v.dataTables,R=(e=b,r=O,void 0===(n=v)&&(n={}),c=new URL("https://sheets.googleapis.com/v4/spreadsheets/".concat(r,"/values/")),f=n.onlyColumnIds?"A1:Z1":(void 0===(o=n)&&(o={}),i=o.endColumn,a=o.endRow,s=o.googleSpreadsheetRange,u=o.startColumn,l=o.startRow,s||(et[u||0]||"A")+(Math.max(l||0,0)+1)+":"+(et[(0,w.pick)(i,25)]||"Z")+(a?Math.max(a,0):"Z")),c.pathname+=f,(p=c.searchParams).set("alt","json"),n.onlyColumnIds||(p.set("dateTimeRenderOption","FORMATTED_STRING"),p.set("majorDimension","COLUMNS"),p.set("valueRenderOption","UNFORMATTED_VALUE")),p.set("prettyPrint","false"),p.set("key",e),c.href);if(y.emit({type:"load",detail:t,url:R}),!URL.canParse(R))throw Error("Invalid URL: "+R);return fetch(R,{signal:null==(h=null==y?void 0:y.pollingController)?void 0:h.signal}).then(function(t){return t.json()}).then(function(t){if("object"==typeof t&&t&&"object"==typeof t.error&&t.error&&"number"==typeof t.error.code&&"string"==typeof t.error.message&&"string"==typeof t.error.status)throw Error(t.error.message);return d.initConverters(t,function(t){var e=(null==C?void 0:C.find(function(e){return e.key===t}))||{},r=e.firstRowAsNames,n=void 0===r?v.firstRowAsNames:r,o=e.beforeParse;return new t9({firstRowAsNames:n,beforeParse:void 0===o?v.beforeParse:o})},function(t,e){return t.parse({json:e})}),y.applyTableModifiers()}).then(function(){return y.emit({type:"afterLoad",detail:t,url:R}),g&&setTimeout(function(){return y.load()},1e3*Math.max(m||0,1)),y}).catch(function(e){throw y.emit({type:"loadError",detail:t,error:e}),e})},e.defaultOptions={id:"google-sheets-connector",type:"GoogleSheets",googleAPIKey:"",googleSpreadsheetKey:"",enablePolling:!1,dataRefreshRate:2,firstRowAsNames:!0},e}(M),et="ABCDEFGHIJKLMNOPQRSTUVWXYZ";M.registerType("GoogleSheets",t8);var ee=(u=function(t,e){return(u=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}u(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),er=function(){return(er=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},en=function(t){function e(r){var n=this,o=(0,w.merge)(e.defaultOptions,r);return(n=t.call(this,o)||this).headers=[],n.options=o,o.tableElement&&(n.tableElement=o.tableElement,n.tableElementID=o.tableElement.id),n}return ee(e,t),e.prototype.export=function(t,e){void 0===e&&(e=this.options);var r=!1!==e.firstRowAsNames,n=e.useMultiLevelHeaders,o=t.getSortedColumns(),i=Object.keys(o),a=[],s=i.length,u=[],l="";if(r){var c=[];if(n){for(var f=0;f<i.length;f++){var p=i[f],h=o[p];Array.isArray(h)||(h=Array.from(h));var d=(h.shift()||"").toString();o[p]=h,c.push(d)}l=this.getTableHeaderHTML(i,c,e)}else l=this.getTableHeaderHTML(void 0,i,e)}for(var y=0;y<s;y++)for(var p=i[y],h=o[p],v=h.length,m=0;m<v;m++){var g=h[m];u[m]||(u[m]=[]),"string"!=typeof g&&"number"!=typeof g&&void 0!==g&&(g=(g||"").toString()),u[m][y]=this.getCellHTMLFromValue(y?"td":"th",null,y?"":'scope="row"',g),y===s-1&&a.push("<tr>"+u[m].join("")+"</tr>")}var b="";return e.tableCaption&&(b='<caption class="highcharts-table-caption">'+e.tableCaption+"</caption>"),"<table>"+b+l+"<tbody>"+a.join("")+"</tbody></table>"},e.prototype.getCellHTMLFromValue=function(t,e,r,n,o){var i=n,a="text"+(e?" "+e:"");return"number"==typeof i?(i=i.toString(),","===o&&(i=i.replace(".",o)),a="number"):n||(i="",a="empty"),"<"+t+(r?" "+r:"")+' class="'+a+'">'+i+"</"+t+">"},e.prototype.getTableHeaderHTML=function(t,e,r){void 0===t&&(t=[]),void 0===e&&(e=[]),void 0===r&&(r=this.options);var n,o,i=r.useMultiLevelHeaders,a=r.useRowspanHeaders,s="<thead>",u=0,l=e&&e.length,c=0;if(i&&t&&e&&!function(t,e){var r=t.length;if(e.length!==r)return!1;for(;--r;)if(t[r]!==e[r])return!1;return!0}(t,e)){for(s+="<tr>";u<l;++u)(n=t[u])===t[u+1]?++c:c?(s+=this.getCellHTMLFromValue("th","highcharts-table-topheading",'scope="col" colspan="'+(c+1)+'"',n),c=0):(n===e[u]?a?(o=2,e.splice(u,1)):(o=1,e[u]=""):o=1,s+=this.getCellHTMLFromValue("th","highcharts-table-topheading",'scope="col"'+(o>1?' valign="top" rowspan="'+o+'"':""),n));s+="</tr>"}if(e){for(s+="<tr>",u=0,l=e.length;u<l;++u)void 0!==e[u]&&(s+=this.getCellHTMLFromValue("th",null,'scope="col"',e[u]));s+="</tr>"}return s+"</thead>"},e.prototype.parse=function(t,e){var r=[],n=[],o=(0,w.merge)(this.options,t),i=o.endRow,a=o.startColumn,s=o.endColumn,u=o.firstRowAsNames,l=o.tableElement||this.tableElement;if(!(l instanceof HTMLElement))return this.emit({type:"parseError",columns:r,detail:e,headers:n,error:"Not a valid HTML Table"}),{};this.tableElement=l,this.tableElementID=l.id,this.emit({type:"parse",columns:r,detail:e,headers:this.headers});var c,f=l.getElementsByTagName("tr"),p=f.length,h=0,d=o.startRow;if(u&&p){for(var y=f[0].children,v=y.length,m=a;m<v&&!(m>s);m++)("TD"===(c=y[m]).tagName||"TH"===c.tagName)&&n.push(c.innerHTML);d++}for(;h<p;){if(h>=d&&h<=i)for(var g=f[h].children,b=g.length,O=0;O<b;){var C=O-a,R=r[C];if(("TD"===(c=g[O]).tagName||"TH"===c.tagName)&&O>=a&&O<=s){r[C]||(r[C]=[]);var N=this.convertByType(c.innerHTML);N instanceof Date&&(N=N.getTime()),r[C][h-d]=N;for(var m=1;h-d>=m&&void 0===R[h-d-m];)R[h-d-m]=null,m++}O++}h++}return this.headers=n,this.emit({type:"afterParse",columns:r,detail:e,headers:n}),k(r,this.headers)},e.defaultOptions=er(er({},Y.defaultOptions),{useRowspanHeaders:!0,useMultiLevelHeaders:!0,startColumn:0,endColumn:Number.MAX_VALUE,startRow:0,endRow:Number.MAX_VALUE}),e}(Y);Y.registerType("HTMLTable",en);var eo=(l=function(t,e){return(l=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}l(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),ei=function(t,e){var r,n,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(u){var l=[s,u];if(r)throw TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(i=0)),i;)try{if(r=1,n&&(o=2&l[0]?n.return:l[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,l[1])).done)return o;switch(n=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,n=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===l[0]||2===l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(6===l[0]&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=e.call(t,i)}catch(t){l=[6,t],n=0}finally{r=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}},ea=O().win,es=function(t){function e(r){var n=this,o=(0,w.merge)(e.defaultOptions,r);return(n=t.call(this,o)||this).options=o,n.converter=new en(o),n}return eo(e,t),e.prototype.load=function(t){var e,r,n,o;return e=this,r=void 0,n=void 0,o=function(){var e,r,n,o,i,a,s;return ei(this,function(u){switch(u.label){case 0:if(e=this,r=e.options,n=e.converter,o=e.getTable(),i=r.htmlTable,e.emit({type:"load",detail:t}),"string"==typeof i?(e.tableID=i,a=ea.document.getElementById(i)):(a=i,e.tableID=a.id),e.tableElement=a||void 0,!e.tableElement)return e.emit({type:"loadError",detail:t,error:"HTML table not provided, or element with ID not found"}),[2,Promise.reject(Error("HTML table not provided, or element with ID not found"))];return s=n.parse((0,w.merge)({tableElement:e.tableElement},r),t),o.deleteColumns(),o.setColumns(s),[4,e.applyTableModifiers()];case 1:return u.sent(),e.emit({type:"afterLoad",detail:t}),[2,e]}})},new(n||(n=Promise))(function(t,i){function a(t){try{u(o.next(t))}catch(t){i(t)}}function s(t){try{u(o.throw(t))}catch(t){i(t)}}function u(e){var r;e.done?t(e.value):((r=e.value)instanceof n?r:new n(function(t){t(r)})).then(a,s)}u((o=o.apply(e,r||[])).next())})},e.defaultOptions={id:"HTML-table-connector",type:"HTMLTable",htmlTable:""},e}(M);M.registerType("HTMLTable",es);var eu=(c=function(t,e){return(c=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}c(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),el=function(t,e){var r,n,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(u){var l=[s,u];if(r)throw TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(i=0)),i;)try{if(r=1,n&&(o=2&l[0]?n.return:l[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,l[1])).done)return o;switch(n=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,n=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===l[0]||2===l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(6===l[0]&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=e.call(t,i)}catch(t){l=[6,t],n=0}finally{r=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}},ec=function(t){function e(r){for(var n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];var i=t.call(this)||this;i.chain=n,i.options=(0,w.merge)(e.defaultOptions,r);for(var a=i.options.chain||[],s=0,u=a.length,l=void 0,c=void 0;s<u;++s)(l=a[s]).type&&(c=C.types[l.type])&&n.push(new c(l));return i}return eu(e,t),e.prototype.add=function(t,e){this.emit({type:"addModifier",detail:e,modifier:t}),this.chain.push(t),this.emit({type:"addModifier",detail:e,modifier:t})},e.prototype.clear=function(t){this.emit({type:"clearChain",detail:t}),this.chain.length=0,this.emit({type:"afterClearChain",detail:t})},e.prototype.modify=function(t,e){var r,n,o,i;return r=this,n=void 0,o=void 0,i=function(){var r,n,o,i,a;return el(this,function(s){switch(s.label){case 0:r=this.options.reverse?this.chain.slice().reverse():this.chain.slice(),t.modified||(t.modified=t.clone(!1,e)),n=t,o=0,i=r.length,s.label=1;case 1:if(!(o<i))return[3,7];s.label=2;case 2:return s.trys.push([2,4,,5]),[4,r[o].modify(n,e)];case 3:return s.sent(),[3,5];case 4:throw a=s.sent(),this.emit({type:"error",detail:e,table:t}),a;case 5:n=n.getModified(),s.label=6;case 6:return++o,[3,1];case 7:return t.modified=n,[2,t]}})},new(o||(o=Promise))(function(t,e){function a(t){try{u(i.next(t))}catch(t){e(t)}}function s(t){try{u(i.throw(t))}catch(t){e(t)}}function u(e){var r;e.done?t(e.value):((r=e.value)instanceof o?r:new o(function(t){t(r)})).then(a,s)}u((i=i.apply(r,n||[])).next())})},e.prototype.modifyTable=function(t,e){this.emit({type:"modify",detail:e,table:t});for(var r=this.options.reverse?this.chain.reverse():this.chain.slice(),n=t.getModified(),o=0,i=r.length,a=void 0;o<i;++o)n=r[o].modifyTable(n,e).getModified();return t.modified=n,this.emit({type:"afterModify",detail:e,table:t}),t},e.prototype.remove=function(t,e){var r=this.chain;this.emit({type:"removeModifier",detail:e,modifier:t}),r.splice(r.indexOf(t),1),this.emit({type:"afterRemoveModifier",detail:e,modifier:t})},e.prototype.emit=function(t){(0,w.fireEvent)(this,t.type,t)},e.prototype.on=function(t,e){return(0,w.addEvent)(this,t,e)},e.defaultOptions={type:"Chain"},e}(C);C.registerType("Chain",ec);var ef=(f=function(t,e){return(f=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}f(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),ep=function(t){function e(r){var n=t.call(this)||this;return n.options=(0,w.merge)(e.defaultOptions,r),n}return ef(e,t),e.prototype.modifyTable=function(t,e){this.emit({type:"modify",detail:e,table:t});var r=t.getModified();if(t.hasColumns(["columnIds"])){for(var n=(t.deleteColumns(["columnIds"])||{}).columnIds||[],o={},i=[],a=0,s=n.length;a<s;++a)i.push(""+n[a]);for(var a=0,s=t.getRowCount(),u=void 0;a<s;++a)(u=t.getRow(a))&&(o[i[a]]=u);r.deleteColumns(),r.setColumns(o)}else{for(var o={},a=0,s=t.getRowCount(),u=void 0;a<s;++a)(u=t.getRow(a))&&(o["".concat(a)]=u);o.columnIds=t.getColumnIds(),r.deleteColumns(),r.setColumns(o)}return this.emit({type:"afterModify",detail:e,table:t}),t},e.defaultOptions={type:"Invert"},e}(C);C.registerType("Invert",ep);var eh=(p=function(t,e){return(p=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}p(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),ed=function(){return(ed=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ey=function(t){function e(r){var n=t.call(this)||this;return n.options=ed(ed({},e.defaultOptions),r),n}return eh(e,t),e.prototype.modifyTable=function(t,e){this.emit({type:"modify",detail:e,table:t});for(var r=this.options.alternativeSeparators,n=this.options.formulaColumns||t.getColumnIds(),o=t.getModified(),i=0,a=n.length,s=void 0;i<a;++i)s=n[i],n.indexOf(s)>=0&&o.setColumn(s,this.processColumn(t,s));for(var u=this.options.columnFormulas||[],i=0,a=u.length,l=void 0,c=void 0;i<a;++i)l=u[i],c=ti.parseFormula(l.formula,r),o.setColumn(l.column,this.processColumnFormula(c,t,l.rowStart,l.rowEnd));return this.emit({type:"afterModify",detail:e,table:t}),t},e.prototype.processColumn=function(t,e,r){void 0===r&&(r=0);for(var n=this.options.alternativeSeparators,o=(t.getColumn(e,!0)||[]).slice(r>0?r:0),i=0,a=o.length,s=[],u=void 0;i<a;++i)if("string"==typeof(u=o[i])&&"="===u[0])try{s=""===u?s:ti.parseFormula(u.substring(1),n),o[i]=tP.processFormula(s,t)}catch(t){o[i]=NaN}return o},e.prototype.processColumnFormula=function(t,e,r,n){void 0===r&&(r=0),void 0===n&&(n=e.getRowCount()),r=r>=0?r:0,n=n>=0?n:e.getRowCount()+n;for(var o=[],i=e.getModified(),a=0,s=n-r;a<s;++a)try{o[a]=tP.processFormula(t,i)}catch(t){o[a]=NaN}finally{t=tP.translateReferences(t,0,1)}return o},e.defaultOptions={type:"Math",alternativeSeparators:!1},e}(C);C.registerType("Math",ey);var ev=(h=function(t,e){return(h=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}h(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),em=function(t){function e(r){var n=t.call(this)||this;return n.options=(0,w.merge)(e.defaultOptions,r),n}return ev(e,t),e.prototype.modifyTable=function(t,e){this.emit({type:"modify",detail:e,table:t});var r=this.options,n=r.start,o=r.end;n=Math.max(0,n||0);var i=Math.max((o=Math.min(o||1/0,t.getRowCount()))-n,0),a=t.getModified();return a.deleteRows(),a.setRows(t.getRows(n,i)),a.setOriginalRowIndexes(Array.from({length:i},function(e,r){return t.getOriginalRowIndex(n+r)})),this.emit({type:"afterModify",detail:e,table:t}),t},e.defaultOptions={type:"Range",start:0,end:1/0},e}(C);C.registerType("Range",em);var eg=(d=function(t,e){return(d=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}d(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),eb=function(t){function e(r){var n=t.call(this)||this;return n.options=(0,w.merge)(e.defaultOptions,r),n}return eg(e,t),e.ascending=function(t,e){return(t||0)<(e||0)?-1:+((t||0)>(e||0))},e.descending=function(t,e){return(e||0)<(t||0)?-1:+((e||0)>(t||0))},e.compareFactory=function(t,r){return r?"desc"===t?function(t,e){return-r(t,e)}:r:"asc"===t?e.ascending:e.descending},e.prototype.getRowReferences=function(t){for(var e=t.getRows(),r=[],n=0,o=e.length;n<o;++n)r.push({index:n,row:e[n]});return r},e.prototype.modifyTable=function(t,r){this.emit({type:"modify",detail:r,table:t});for(var n,o=t.getColumnIds(),i=t.getRowCount(),a=this.getRowReferences(t),s=this.options,u=s.direction,l=s.orderInColumn,c=s.compare,f=t.getModified(),p=("columns"in this.options)?this.options.columns:[this.options.orderByColumn],h=[],d=0,y=p.length;d<y;++d){var v=p[d],m="string"==typeof v,g=m?v:v.column,b=o.indexOf(g);-1!==b&&h.push({columnIndex:b,compare:e.compareFactory(m?u:v.direction||u,m?c:v.compare||c)})}if(h.length&&a.sort(function(t,e){for(var r=0,n=h.length;r<n;++r){var o=h[r],i=o.columnIndex,a=(0,o.compare)(t.row[i],e.row[i]);if(a)return a}return t.index-e.index}),l){for(var g=[],d=0;d<i;++d)g[a[d].index]=d;f.setColumns(((n={})[l]=g,n))}else{for(var w=[],O=[],C=void 0,d=0;d<i;++d)C=a[d],w.push(t.getOriginalRowIndex(C.index)),O.push(C.row);f.setRows(O,0),f.setOriginalRowIndexes(w)}return this.emit({type:"afterModify",detail:r,table:t}),t},e.defaultOptions={type:"Sort",direction:"desc",orderByColumn:"y"},e}(C);C.registerType("Sort",eb);var ew=(y=function(t,e){return(y=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}y(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),eO=function(t){function e(r){var n=t.call(this)||this;return n.options=(0,w.merge)(e.defaultOptions,r),n}return ew(e,t),e.compile=function(t){var e=this;if((0,w.isFunction)(t))return t;var r=t.operator;switch(r){case"and":var n=t.conditions.map(function(t){return e.compile(t)});return function(t,e,r){return n.every(function(n){return n(t,e,r)})};case"or":var o=t.conditions.map(function(t){return e.compile(t)});return function(t,e,r){return o.some(function(n){return n(t,e,r)})};case"not":var i=this.compile(t.condition);return function(t,e,r){return!i(t,e,r)}}var a=t.columnId,s=t.value;switch(r){case"==":return function(t){return t[a]==s};case"===":return function(t){return t[a]===s};case"!=":return function(t){return t[a]!=s};case"!==":return function(t){return t[a]!==s};case">":return function(t){return(t[a]||0)>(s||0)};case">=":return function(t){return(t[a]||0)>=(s||0)};case"<":return function(t){return(t[a]||0)<(s||0)};case"<=":return function(t){return(t[a]||0)<=(s||0)};case"empty":return function(t){return null===t[a]||""===t[a]}}var u=t.ignoreCase,l=function(t){var e=""+t;return null==u||u?e.toLowerCase():e};return"contains"===r?function(t){return l(t[a]).includes(l(s))}:function(t){return l(t[a])[r](l(s))}},e.prototype.modifyTable=function(t,r){this.emit({type:"modify",detail:r,table:t});var n=this.options.condition;if(!n)return t;for(var o=e.compile(n),i=t.getModified(),a=[],s=[],u=0,l=t.getRowCount();u<l;++u){var c=t.getRowObject(u);c&&o(c,t,u)&&(a.push(c),s.push(t.getOriginalRowIndex(u)))}return i.deleteRows(),i.setRows(a),i.setOriginalRowIndexes(s),this.emit({type:"afterModify",detail:r,table:t}),t},e.defaultOptions={type:"Filter"},e}(C);C.registerType("Filter",eO);var eC=O();eC.DataConnector=eC.DataConnector||M,eC.DataConverter=eC.DataConverter||Y,eC.DataCursor=eC.DataCursor||V,eC.DataModifier=eC.DataModifier||C,eC.DataPool=eC.DataPool||$,eC.DataTable=eC.DataTable||x,eC.Formula=eC.Formula||tZ;var eR=O();return b.default}()});