@loaders.gl/json 3.1.0-alpha.4 → 3.1.0-alpha.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundle.d.ts +1 -0
- package/dist/dist.min.js +1 -1
- package/dist/es5/bundle.js +1 -1
- package/dist/es5/bundle.js.map +1 -1
- package/dist/es5/geojson-loader.js +29 -143
- package/dist/es5/geojson-loader.js.map +1 -1
- package/dist/es5/index.js +6 -6
- package/dist/es5/json-loader.js +18 -44
- package/dist/es5/json-loader.js.map +1 -1
- package/dist/es5/lib/clarinet/clarinet.js +373 -393
- package/dist/es5/lib/clarinet/clarinet.js.map +1 -1
- package/dist/es5/lib/jsonpath/jsonpath.js +54 -101
- package/dist/es5/lib/jsonpath/jsonpath.js.map +1 -1
- package/dist/es5/lib/parse-json-in-batches.js +78 -237
- package/dist/es5/lib/parse-json-in-batches.js.map +1 -1
- package/dist/es5/lib/parse-json.js +4 -9
- package/dist/es5/lib/parse-json.js.map +1 -1
- package/dist/es5/lib/parse-ndjson-in-batches.js +31 -143
- package/dist/es5/lib/parse-ndjson-in-batches.js.map +1 -1
- package/dist/es5/lib/parse-ndjson.js +2 -2
- package/dist/es5/lib/parse-ndjson.js.map +1 -1
- package/dist/es5/lib/parser/json-parser.js +112 -133
- package/dist/es5/lib/parser/json-parser.js.map +1 -1
- package/dist/es5/lib/parser/streaming-json-parser.js +65 -125
- package/dist/es5/lib/parser/streaming-json-parser.js.map +1 -1
- package/dist/es5/ndjson-loader.js +7 -29
- package/dist/es5/ndjson-loader.js.map +1 -1
- package/dist/esm/geojson-loader.js +1 -1
- package/dist/esm/json-loader.js +1 -1
- package/dist/esm/lib/parse-ndjson-in-batches.js +1 -1
- package/dist/esm/lib/parse-ndjson-in-batches.js.map +1 -1
- package/dist/esm/lib/parse-ndjson.js +1 -1
- package/dist/esm/lib/parse-ndjson.js.map +1 -1
- package/dist/esm/ndjson-loader.js +1 -1
- package/dist/geojson-loader.d.ts +15 -0
- package/dist/geojson-worker.js +1 -1
- package/dist/geojson-worker.js.map +1 -1
- package/dist/index.d.ts +7 -0
- package/dist/json-loader.d.ts +13 -0
- package/dist/jsonl-loader.d.ts +0 -0
- package/dist/lib/clarinet/clarinet.d.ts +40 -0
- package/dist/lib/jsonpath/jsonpath.d.ts +31 -0
- package/dist/lib/parse-json-in-batches.d.ts +3 -0
- package/dist/lib/parse-json.d.ts +2 -0
- package/dist/lib/parse-ndjson-in-batches.d.ts +3 -0
- package/dist/lib/parse-ndjson.d.ts +1 -0
- package/dist/lib/parser/json-parser.d.ts +17 -0
- package/dist/lib/parser/streaming-json-parser.d.ts +37 -0
- package/dist/ndjson-loader.d.ts +2 -0
- package/dist/workers/geojson-worker.d.ts +1 -0
- package/package.json +7 -6
package/dist/esm/json-loader.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import parseJSONSync from './lib/parse-json';
|
|
2
2
|
import parseJSONInBatches from './lib/parse-json-in-batches';
|
|
3
|
-
const VERSION = typeof "3.1.0-alpha.
|
|
3
|
+
const VERSION = typeof "3.1.0-alpha.5" !== 'undefined' ? "3.1.0-alpha.5" : 'latest';
|
|
4
4
|
const DEFAULT_JSON_LOADER_OPTIONS = {
|
|
5
5
|
json: {
|
|
6
6
|
shape: 'row-table',
|
|
@@ -24,7 +24,7 @@ export default async function* parseNDJSONInBatches(binaryAsyncIterator, options
|
|
|
24
24
|
yield batch;
|
|
25
25
|
}
|
|
26
26
|
} catch (error) {
|
|
27
|
-
throw new Error(
|
|
27
|
+
throw new Error("NDJSONLoader: failed to parse JSON on line ".concat(counter));
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/lib/parse-ndjson-in-batches.ts"],"names":["TableBatchBuilder","makeLineIterator","makeNumberedLineIterator","makeTextDecoderIterator","parseNDJSONInBatches","binaryAsyncIterator","options","textIterator","lineIterator","numberedLineIterator","schema","shape","tableBatchBuilder","counter","line","row","JSON","parse","addRow","chunkComplete","batch","getFullBatch","error","Error","getFinalBatch"],"mappings":"AACA,SAAQA,iBAAR,QAAgC,oBAAhC;AACA,SAEEC,gBAFF,EAGEC,wBAHF,EAIEC,uBAJF,QAKO,0BALP;AAOA,eAAe,gBAAgBC,oBAAhB,CACbC,mBADa,EAEbC,OAFa,EAGS;AACtB,QAAMC,YAAY,GAAGJ,uBAAuB,CAACE,mBAAD,CAA5C;AACA,QAAMG,YAAY,GAAGP,gBAAgB,CAACM,YAAD,CAArC;AACA,QAAME,oBAAoB,GAAGP,wBAAwB,CAACM,YAAD,CAArD;AAEA,QAAME,MAAM,GAAG,IAAf;AACA,QAAMC,KAAK,GAAG,WAAd;AAEA,QAAMC,iBAAiB,GAAG,IAAIZ,iBAAJ,CAAsBU,MAAtB,EAA8B,EACtD,GAAGJ,OADmD;AAEtDK,IAAAA;AAFsD,GAA9B,CAA1B;;AAKA,aAAW,MAAM;AAACE,IAAAA,OAAD;AAAUC,IAAAA;AAAV,GAAjB,IAAoCL,oBAApC,EAA0D;AACxD,QAAI;AACF,YAAMM,GAAG,GAAGC,IAAI,CAACC,KAAL,CAAWH,IAAX,CAAZ;AACAF,MAAAA,iBAAiB,CAACM,MAAlB,CAAyBH,GAAzB;AACAH,MAAAA,iBAAiB,CAACO,aAAlB,CAAgCL,IAAhC;AACA,YAAMM,KAAK,GAAGR,iBAAiB,CAACS,YAAlB,EAAd;;AACA,UAAID,KAAJ,EAAW;AACT,cAAMA,KAAN;AACD;AACF,KARD,CAQE,OAAOE,KAAP,EAAc;AACd,YAAM,IAAIC,KAAJ,
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/parse-ndjson-in-batches.ts"],"names":["TableBatchBuilder","makeLineIterator","makeNumberedLineIterator","makeTextDecoderIterator","parseNDJSONInBatches","binaryAsyncIterator","options","textIterator","lineIterator","numberedLineIterator","schema","shape","tableBatchBuilder","counter","line","row","JSON","parse","addRow","chunkComplete","batch","getFullBatch","error","Error","getFinalBatch"],"mappings":"AACA,SAAQA,iBAAR,QAAgC,oBAAhC;AACA,SAEEC,gBAFF,EAGEC,wBAHF,EAIEC,uBAJF,QAKO,0BALP;AAOA,eAAe,gBAAgBC,oBAAhB,CACbC,mBADa,EAEbC,OAFa,EAGS;AACtB,QAAMC,YAAY,GAAGJ,uBAAuB,CAACE,mBAAD,CAA5C;AACA,QAAMG,YAAY,GAAGP,gBAAgB,CAACM,YAAD,CAArC;AACA,QAAME,oBAAoB,GAAGP,wBAAwB,CAACM,YAAD,CAArD;AAEA,QAAME,MAAM,GAAG,IAAf;AACA,QAAMC,KAAK,GAAG,WAAd;AAEA,QAAMC,iBAAiB,GAAG,IAAIZ,iBAAJ,CAAsBU,MAAtB,EAA8B,EACtD,GAAGJ,OADmD;AAEtDK,IAAAA;AAFsD,GAA9B,CAA1B;;AAKA,aAAW,MAAM;AAACE,IAAAA,OAAD;AAAUC,IAAAA;AAAV,GAAjB,IAAoCL,oBAApC,EAA0D;AACxD,QAAI;AACF,YAAMM,GAAG,GAAGC,IAAI,CAACC,KAAL,CAAWH,IAAX,CAAZ;AACAF,MAAAA,iBAAiB,CAACM,MAAlB,CAAyBH,GAAzB;AACAH,MAAAA,iBAAiB,CAACO,aAAlB,CAAgCL,IAAhC;AACA,YAAMM,KAAK,GAAGR,iBAAiB,CAACS,YAAlB,EAAd;;AACA,UAAID,KAAJ,EAAW;AACT,cAAMA,KAAN;AACD;AACF,KARD,CAQE,OAAOE,KAAP,EAAc;AACd,YAAM,IAAIC,KAAJ,sDAAwDV,OAAxD,EAAN;AACD;AACF;;AAED,QAAMO,KAAK,GAAGR,iBAAiB,CAACY,aAAlB,EAAd;;AACA,MAAIJ,KAAJ,EAAW;AACT,UAAMA,KAAN;AACD;AACF","sourcesContent":["import type {Batch} from '@loaders.gl/schema';\nimport {TableBatchBuilder} from '@loaders.gl/schema';\nimport {\n LoaderOptions,\n makeLineIterator,\n makeNumberedLineIterator,\n makeTextDecoderIterator\n} from '@loaders.gl/loader-utils';\n\nexport default async function* parseNDJSONInBatches(\n binaryAsyncIterator: AsyncIterable<ArrayBuffer> | Iterable<ArrayBuffer>,\n options?: LoaderOptions\n): AsyncIterable<Batch> {\n const textIterator = makeTextDecoderIterator(binaryAsyncIterator);\n const lineIterator = makeLineIterator(textIterator);\n const numberedLineIterator = makeNumberedLineIterator(lineIterator);\n\n const schema = null;\n const shape = 'row-table';\n // @ts-ignore\n const tableBatchBuilder = new TableBatchBuilder(schema, {\n ...options,\n shape\n });\n\n for await (const {counter, line} of numberedLineIterator) {\n try {\n const row = JSON.parse(line);\n tableBatchBuilder.addRow(row);\n tableBatchBuilder.chunkComplete(line);\n const batch = tableBatchBuilder.getFullBatch();\n if (batch) {\n yield batch;\n }\n } catch (error) {\n throw new Error(`NDJSONLoader: failed to parse JSON on line ${counter}`);\n }\n }\n\n const batch = tableBatchBuilder.getFinalBatch();\n if (batch) {\n yield batch;\n }\n}\n"],"file":"parse-ndjson-in-batches.js"}
|
|
@@ -4,7 +4,7 @@ export default function parseNDJSONSync(ndjsonText) {
|
|
|
4
4
|
try {
|
|
5
5
|
return JSON.parse(line);
|
|
6
6
|
} catch (error) {
|
|
7
|
-
throw new Error(
|
|
7
|
+
throw new Error("NDJSONLoader: failed to parse JSON on line ".concat(counter + 1));
|
|
8
8
|
}
|
|
9
9
|
});
|
|
10
10
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/lib/parse-ndjson.ts"],"names":["parseNDJSONSync","ndjsonText","lines","trim","split","map","line","counter","JSON","parse","error","Error"],"mappings":"AAAA,eAAe,SAASA,eAAT,CAAyBC,UAAzB,EAA6C;AAC1D,QAAMC,KAAK,GAAGD,UAAU,CAACE,IAAX,GAAkBC,KAAlB,CAAwB,IAAxB,CAAd;AACA,SAAOF,KAAK,CAACG,GAAN,CAAU,CAACC,IAAD,EAAOC,OAAP,KAAmB;AAClC,QAAI;AACF,aAAOC,IAAI,CAACC,KAAL,CAAWH,IAAX,CAAP;AACD,KAFD,CAEE,OAAOI,KAAP,EAAc;AACd,YAAM,IAAIC,KAAJ,
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/parse-ndjson.ts"],"names":["parseNDJSONSync","ndjsonText","lines","trim","split","map","line","counter","JSON","parse","error","Error"],"mappings":"AAAA,eAAe,SAASA,eAAT,CAAyBC,UAAzB,EAA6C;AAC1D,QAAMC,KAAK,GAAGD,UAAU,CAACE,IAAX,GAAkBC,KAAlB,CAAwB,IAAxB,CAAd;AACA,SAAOF,KAAK,CAACG,GAAN,CAAU,CAACC,IAAD,EAAOC,OAAP,KAAmB;AAClC,QAAI;AACF,aAAOC,IAAI,CAACC,KAAL,CAAWH,IAAX,CAAP;AACD,KAFD,CAEE,OAAOI,KAAP,EAAc;AACd,YAAM,IAAIC,KAAJ,sDAAwDJ,OAAO,GAAG,CAAlE,EAAN;AACD;AACF,GANM,CAAP;AAOD","sourcesContent":["export default function parseNDJSONSync(ndjsonText: string) {\n const lines = ndjsonText.trim().split('\\n');\n return lines.map((line, counter) => {\n try {\n return JSON.parse(line);\n } catch (error) {\n throw new Error(`NDJSONLoader: failed to parse JSON on line ${counter + 1}`);\n }\n });\n}\n"],"file":"parse-ndjson.js"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import parseNDJSONSync from './lib/parse-ndjson';
|
|
2
2
|
import parseNDJSONInBatches from './lib/parse-ndjson-in-batches';
|
|
3
|
-
const VERSION = typeof "3.1.0-alpha.
|
|
3
|
+
const VERSION = typeof "3.1.0-alpha.5" !== 'undefined' ? "3.1.0-alpha.5" : 'latest';
|
|
4
4
|
export const NDJSONLoader = {
|
|
5
5
|
name: 'NDJSON',
|
|
6
6
|
id: 'ndjson',
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Loader, LoaderWithParser } from '@loaders.gl/loader-utils';
|
|
2
|
+
import type { JSONLoaderOptions } from './json-loader';
|
|
3
|
+
export declare type GeoJSONLoaderOptions = JSONLoaderOptions & {
|
|
4
|
+
geojson?: {
|
|
5
|
+
shape?: 'object-row-table';
|
|
6
|
+
};
|
|
7
|
+
gis?: {
|
|
8
|
+
format: 'geojson';
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* GeoJSON loader
|
|
13
|
+
*/
|
|
14
|
+
export declare const GeoJSONWorkerLoader: Loader;
|
|
15
|
+
export declare const GeoJSONLoader: LoaderWithParser;
|
package/dist/geojson-worker.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=30)}([function(t,e){t.exports=function(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,r){t.exports=r(20)},function(t,e,r){var n=r(12);t.exports=function(t){return new n(t)},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){function r(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}t.exports=function(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),t},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,r){var n=r(22),o=r(23),i=r(14),s=r(24);t.exports=function(t){return n(t)||o(t)||i(t)||s()},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,r){var n=r(21);t.exports=function(t){return function(){return new n(t.apply(this,arguments))}},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(t){var e;if("undefined"!=typeof Symbol&&(Symbol.asyncIterator&&(e=t[Symbol.asyncIterator]),null==e&&Symbol.iterator&&(e=t[Symbol.iterator])),null==e&&(e=t["@@asyncIterator"]),null==e&&(e=t["@@iterator"]),null==e)throw new TypeError("Object is not async iterable");return e.call(t)},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){function r(e){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(t.exports=r=function(t){return typeof t},t.exports.default=t.exports,t.exports.__esModule=!0):(t.exports=r=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.default=t.exports,t.exports.__esModule=!0),r(e)}t.exports=r,t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){function r(t,e,r,n,o,i,s){try{var a=t[i](s),u=a.value}catch(t){return void r(t)}a.done?e(u):Promise.resolve(u).then(n,o)}t.exports=function(t){return function(){var e=this,n=arguments;return new Promise((function(o,i){var s=t.apply(e,n);function a(t){r(s,o,i,a,u,"next",t)}function u(t){r(s,o,i,a,u,"throw",t)}a(void 0)}))}},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){function r(e){return t.exports=r=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},t.exports.default=t.exports,t.exports.__esModule=!0,r(e)}t.exports=r,t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(t){this.wrapped=t},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,r){var n=r(13);t.exports=function(t,e){if(t){if("string"==typeof t)return n(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(t,e):void 0}},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,r){var n=r(25),o=r(26),i=r(14),s=r(27);t.exports=function(t,e){return n(t)||o(t,e)||i(t,e)||s()},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,r){var n=r(28);function o(e,r,i){return"undefined"!=typeof Reflect&&Reflect.get?(t.exports=o=Reflect.get,t.exports.default=t.exports,t.exports.__esModule=!0):(t.exports=o=function(t,e,r){var o=n(t,e);if(o){var i=Object.getOwnPropertyDescriptor(o,e);return i.get?i.get.call(r):i.value}},t.exports.default=t.exports,t.exports.__esModule=!0),o(e,r,i||e)}t.exports=o,t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,r){var n=r(29);t.exports=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&n(t,e)},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,r){var n=r(9).default,o=r(8);t.exports=function(t,e){return!e||"object"!==n(e)&&"function"!=typeof e?o(t):e},t.exports.default=t.exports,t.exports.__esModule=!0},,function(t,e,r){var n=function(t){"use strict";var e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",s=n.toStringTag||"@@toStringTag";function a(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{a({},"")}catch(t){a=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var o=e&&e.prototype instanceof h?e:h,i=Object.create(o.prototype),s=new j(n||[]);return i._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return k()}for(r.method=o,r.arg=i;;){var s=r.delegate;if(s){var a=w(s,r);if(a){if(a===l)continue;return a}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=c(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===l)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}(t,r,s),i}function c(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var l={};function h(){}function f(){}function p(){}var d={};d[o]=function(){return this};var y=Object.getPrototypeOf,v=y&&y(y(_([])));v&&v!==e&&r.call(v,o)&&(d=v);var g=p.prototype=h.prototype=Object.create(d);function b(t){["next","throw","return"].forEach((function(e){a(t,e,(function(t){return this._invoke(e,t)}))}))}function m(t,e){var n;this._invoke=function(o,i){function s(){return new e((function(n,s){!function n(o,i,s,a){var u=c(t[o],t,i);if("throw"!==u.type){var l=u.arg,h=l.value;return h&&"object"==typeof h&&r.call(h,"__await")?e.resolve(h.__await).then((function(t){n("next",t,s,a)}),(function(t){n("throw",t,s,a)})):e.resolve(h).then((function(t){l.value=t,s(l)}),(function(t){return n("throw",t,s,a)}))}a(u.arg)}(o,i,n,s)}))}return n=n?n.then(s,s):s()}}function w(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,w(t,e),"throw"===e.method))return l;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var n=c(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,l;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,l):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function x(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function O(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(x,this),this.reset(!0)}function _(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=g.constructor=p,p.constructor=f,f.displayName=a(p,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===f||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,a(t,s,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},b(m.prototype),m.prototype[i]=function(){return this},t.AsyncIterator=m,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var s=new m(u(e,r,n,o),i);return t.isGeneratorFunction(r)?s:s.next().then((function(t){return t.done?t.value:s.next()}))},b(g),a(g,s,"Generator"),g[o]=function(){return this},g.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=_,j.prototype={constructor:j,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return s.type="throw",s.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],s=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var a=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(a&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(a){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var s=i?i.completion:{};return s.type=t,s.arg=e,i?(this.method="next",this.next=i.finallyLoc,l):this.complete(s)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),l},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),O(r),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;O(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:_(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}(t.exports);try{regeneratorRuntime=n}catch(t){Function("r","regeneratorRuntime = r")(n)}},function(t,e,r){var n=r(12);function o(t){var e,r;function o(e,r){try{var s=t[e](r),a=s.value,u=a instanceof n;Promise.resolve(u?a.wrapped:a).then((function(t){u?o("return"===e?"return":"next",t):i(s.done?"return":"normal",t)}),(function(t){o("throw",t)}))}catch(t){i("throw",t)}}function i(t,n){switch(t){case"return":e.resolve({value:n,done:!0});break;case"throw":e.reject(n);break;default:e.resolve({value:n,done:!1})}(e=e.next)?o(e.key,e.arg):r=null}this._invoke=function(t,n){return new Promise((function(i,s){var a={key:t,arg:n,resolve:i,reject:s,next:null};r?r=r.next=a:(e=r=a,o(t,n))}))},"function"!=typeof t.return&&(this.return=void 0)}o.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},o.prototype.next=function(t){return this._invoke("next",t)},o.prototype.throw=function(t){return this._invoke("throw",t)},o.prototype.return=function(t){return this._invoke("return",t)},t.exports=o,t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,r){var n=r(13);t.exports=function(t){if(Array.isArray(t))return n(t)},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(t){if(Array.isArray(t))return t},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(t,e){var r=t&&("undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"]);if(null!=r){var n,o,i=[],s=!0,a=!1;try{for(r=r.call(t);!(s=(n=r.next()).done)&&(i.push(n.value),!e||i.length!==e);s=!0);}catch(t){a=!0,o=t}finally{try{s||null==r.return||r.return()}finally{if(a)throw o}}return i}},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,r){var n=r(11);t.exports=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=n(t)););return t},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){function r(e,n){return t.exports=r=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},t.exports.default=t.exports,t.exports.__esModule=!0,r(e,n)}t.exports=r,t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,r){"use strict";r.r(e);var n=r(0),o=r.n(n),i=r(10),s=r.n(i),a=r(1),u=r.n(a),c=r(3),l=r.n(c),h=r(4),f=r.n(h),p=r(9),d=r.n(p);function y(t){return!!t&&(t instanceof ArrayBuffer||("undefined"!=typeof MessagePort&&t instanceof MessagePort||("undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas)))}var v=new Map,g=function(){function t(){l()(this,t)}return f()(t,null,[{key:"onmessage",set:function(t){self.onmessage=function(e){if(b(e)){var r=e.data,n=r.type,o=r.payload;t(n,o)}}}},{key:"addEventListener",value:function(t){var e=v.get(t);e||(e=function(e){if(b(e)){var r=e.data,n=r.type,o=r.payload;t(n,o)}}),self.addEventListener("message",e)}},{key:"removeEventListener",value:function(t){var e=v.get(t);v.delete(t),self.removeEventListener("message",e)}},{key:"postMessage",value:function(t,e){if(self){var r={source:"loaders.gl",type:t,payload:e},n=function t(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2?arguments[2]:void 0,o=n||new Set;if(e){if(y(e))o.add(e);else if(y(e.buffer))o.add(e.buffer);else if(ArrayBuffer.isView(e));else if(r&&"object"===d()(e))for(var i in e)t(e[i],r,o)}else;return void 0===n?Array.from(o):[]}(e);self.postMessage(r,n)}}}]),t}();function b(t){var e=t.type,r=t.data;return"message"===e&&r&&"string"==typeof r.source&&r.source.startsWith("loaders.gl")}function m(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function w(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?m(Object(r),!0).forEach((function(e){o()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):m(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var x=0;function O(t,e){return new Promise((function(r,n){var o=x++;g.addEventListener((function t(e,i){if(i.id===o)switch(e){case"done":g.removeEventListener(t),r(i.result);break;case"error":g.removeEventListener(t),n(i.error)}}));var i={id:o,input:t,options:e};g.postMessage("process",i)}))}function j(t){return _.apply(this,arguments)}function _(){return(_=s()(u.a.mark((function t(e){var r,n,o,i,s,a,c;return u.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.loader,n=e.arrayBuffer,o=e.options,i=e.context,!r.parseSync&&!r.parse){t.next=6;break}s=n,a=r.parseSync||r.parse,t.next=13;break;case 6:if(!r.parseTextSync){t.next=12;break}c=new TextDecoder,s=c.decode(n),a=r.parseTextSync,t.next=13;break;case 12:throw new Error("Could not load data with ".concat(r.name," loader"));case 13:return o=w(w({},o),{},{modules:r&&r.options&&r.options.modules||{},worker:!1}),t.next=16,a(s,w({},o),i,r);case 16:return t.abrupt("return",t.sent);case 17:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var k=r(2),A=r.n(k),P=r(6),E=r.n(P),S=r(7),L=r.n(S),C=r(5),I=r.n(C);function N(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function R(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?N(Object(r),!0).forEach((function(e){o()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):N(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function M(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return B(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return B(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,a=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return s=t.done,t},e:function(t){a=!0,i=t},f:function(){try{s||null==r.return||r.return()}finally{if(a)throw i}}}}function B(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function U(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=T(t);return F(t,r,{coordLength:e.coordLength||r.coordLength,numericPropKeys:e.numericPropKeys||r.numericPropKeys,PositionDataType:e.PositionDataType||Float32Array})}function T(t){var e,r,n=0,o=0,i=0,s=0,a=0,u=0,c=0,l=0,h=0,f=new Set,p={},d=M(t);try{for(d.s();!(e=d.n()).done;){var y=e.value,v=y.geometry;switch(v.type){case"Point":o++,n++,f.add(v.coordinates.length);break;case"MultiPoint":o++,n+=v.coordinates.length;var g,b=M(v.coordinates);try{for(b.s();!(g=b.n()).done;){var m=g.value;f.add(m.length)}}catch(t){b.e(t)}finally{b.f()}break;case"LineString":a++,i+=v.coordinates.length,s++;var w,x=M(v.coordinates);try{for(x.s();!(w=x.n()).done;){var O=w.value;f.add(O.length)}}catch(t){x.e(t)}finally{x.f()}break;case"MultiLineString":a++;var j,_=M(v.coordinates);try{for(_.s();!(j=_.n()).done;){var k=j.value;i+=k.length,s++;var A,P=M(k);try{for(P.s();!(A=P.n()).done;){var E=A.value;f.add(E.length)}}catch(t){P.e(t)}finally{P.f()}}}catch(t){_.e(t)}finally{_.f()}break;case"Polygon":h++,c++,l+=v.coordinates.length,u+=X(v.coordinates).length;var S,L=M(X(v.coordinates));try{for(L.s();!(S=L.n()).done;){var C=S.value;f.add(C.length)}}catch(t){L.e(t)}finally{L.f()}break;case"MultiPolygon":h++;var N,R=M(v.coordinates);try{for(R.s();!(N=R.n()).done;){var B=N.value;c++,l+=B.length,u+=X(B).length;var U,T=M(X(B));try{for(T.s();!(U=T.n()).done;){var F=U.value;f.add(F.length)}}catch(t){T.e(t)}finally{T.f()}}}catch(t){R.e(t)}finally{R.f()}break;default:throw new Error("Unsupported geometry type: ".concat(v.type))}if(y.properties)for(var D in y.properties){var J=y.properties[D];p[D]=p[D]||void 0===p[D]?(r=J,Number.isFinite(r)):p[D]}}}catch(t){d.e(t)}finally{d.f()}return{coordLength:f.size>0?Math.max.apply(Math,I()(f)):2,pointPositionsCount:n,pointFeaturesCount:o,linePositionsCount:i,linePathsCount:s,lineFeaturesCount:a,polygonPositionsCount:u,polygonObjectsCount:c,polygonRingsCount:l,polygonFeaturesCount:h,numericPropKeys:Object.keys(p).filter((function(t){return p[t]}))}}function F(t,e,r){for(var n=e.pointPositionsCount,o=e.pointFeaturesCount,i=e.linePositionsCount,s=e.linePathsCount,a=e.lineFeaturesCount,u=e.polygonPositionsCount,c=e.polygonObjectsCount,l=e.polygonRingsCount,h=e.polygonFeaturesCount,f=r.coordLength,p=r.numericPropKeys,d=r.PositionDataType,y=void 0===d?Float32Array:d,v=t.length>65535?Uint32Array:Uint16Array,g={positions:new y(n*f),globalFeatureIds:new v(n),featureIds:o>65535?new Uint32Array(n):new Uint16Array(n),numericProps:{},properties:Array(),fields:Array()},b={positions:new y(i*f),pathIndices:i>65535?new Uint32Array(s+1):new Uint16Array(s+1),globalFeatureIds:new v(i),featureIds:a>65535?new Uint32Array(i):new Uint16Array(i),numericProps:{},properties:Array(),fields:Array()},m={positions:new y(u*f),polygonIndices:u>65535?new Uint32Array(c+1):new Uint16Array(c+1),primitivePolygonIndices:u>65535?new Uint32Array(l+1):new Uint16Array(l+1),globalFeatureIds:new v(u),featureIds:h>65535?new Uint32Array(u):new Uint16Array(u),numericProps:{},properties:Array(),fields:Array()},w=0,x=[g,b,m];w<x.length;w++){var O,j=x[w],_=M(p||[]);try{for(_.s();!(O=_.n()).done;){var k=O.value;j.numericProps[k]=new Float32Array(j.positions.length/f)}}catch(t){_.e(t)}finally{_.f()}}b.pathIndices[s]=i,m.polygonIndices[c]=u,m.primitivePolygonIndices[l]=u;var A,P={pointPosition:0,pointFeature:0,linePosition:0,linePath:0,lineFeature:0,polygonPosition:0,polygonObject:0,polygonRing:0,polygonFeature:0,feature:0},E=M(t);try{for(E.s();!(A=E.n()).done;){var S=A.value,L=S.geometry,C=S.properties||{};switch(L.type){case"Point":D(L.coordinates,g,P,f,C),g.properties.push($(C,p)),P.pointFeature++;break;case"MultiPoint":J(L.coordinates,g,P,f,C),g.properties.push($(C,p)),P.pointFeature++;break;case"LineString":z(L.coordinates,b,P,f,C),b.properties.push($(C,p)),P.lineFeature++;break;case"MultiLineString":G(L.coordinates,b,P,f,C),b.properties.push($(C,p)),P.lineFeature++;break;case"Polygon":Y(L.coordinates,m,P,f,C),m.properties.push($(C,p)),P.polygonFeature++;break;case"MultiPolygon":V(L.coordinates,m,P,f,C),m.properties.push($(C,p)),P.polygonFeature++;break;default:throw new Error("Invalid geometry type")}P.feature++}}catch(t){E.e(t)}finally{E.f()}return function(t,e,r,n){var o={points:R(R({},t),{},{positions:{value:t.positions,size:n},globalFeatureIds:{value:t.globalFeatureIds,size:1},featureIds:{value:t.featureIds,size:1},type:"Point"}),lines:R(R({},e),{},{pathIndices:{value:e.pathIndices,size:1},positions:{value:e.positions,size:n},globalFeatureIds:{value:e.globalFeatureIds,size:1},featureIds:{value:e.featureIds,size:1},type:"LineString"}),polygons:R(R({},r),{},{polygonIndices:{value:r.polygonIndices,size:1},primitivePolygonIndices:{value:r.primitivePolygonIndices,size:1},positions:{value:r.positions,size:n},globalFeatureIds:{value:r.globalFeatureIds,size:1},featureIds:{value:r.featureIds,size:1},type:"Polygon"})};for(var i in o)for(var s in o[i].numericProps)o[i].numericProps[s]={value:o[i].numericProps[s],size:1};return o}(g,b,m,f)}function D(t,e,r,n,o){e.positions.set(t,r.pointPosition*n),e.globalFeatureIds[r.pointPosition]=r.feature,e.featureIds[r.pointPosition]=r.pointFeature,K(e,o,r.pointPosition,1),r.pointPosition++}function J(t,e,r,n,o){var i,s=M(t);try{for(s.s();!(i=s.n()).done;){D(i.value,e,r,n,o)}}catch(t){s.e(t)}finally{s.f()}}function z(t,e,r,n,o){e.pathIndices[r.linePath]=r.linePosition,r.linePath++,q(e.positions,t,r.linePosition,n);var i=t.length;K(e,o,r.linePosition,i),e.globalFeatureIds.set(new Uint32Array(i).fill(r.feature),r.linePosition),e.featureIds.set(new Uint32Array(i).fill(r.lineFeature),r.linePosition),r.linePosition+=i}function G(t,e,r,n,o){var i,s=M(t);try{for(s.s();!(i=s.n()).done;){z(i.value,e,r,n,o)}}catch(t){s.e(t)}finally{s.f()}}function Y(t,e,r,n,o){e.polygonIndices[r.polygonObject]=r.polygonPosition,r.polygonObject++;var i,s=M(t);try{for(s.s();!(i=s.n()).done;){var a=i.value;e.primitivePolygonIndices[r.polygonRing]=r.polygonPosition,r.polygonRing++,q(e.positions,a,r.polygonPosition,n);var u=a.length;K(e,o,r.polygonPosition,u),e.globalFeatureIds.set(new Uint32Array(u).fill(r.feature),r.polygonPosition),e.featureIds.set(new Uint32Array(u).fill(r.polygonFeature),r.polygonPosition),r.polygonPosition+=u}}catch(t){s.e(t)}finally{s.f()}}function V(t,e,r,n,o){var i,s=M(t);try{for(s.s();!(i=s.n()).done;){Y(i.value,e,r,n,o)}}catch(t){s.e(t)}finally{s.f()}}function K(t,e,r,n){for(var o in t.numericProps)o in e&&t.numericProps[o].set(new Array(n).fill(e[o]),r)}function $(t,e){var r={};for(var n in t)e.includes(n)||(r[n]=t[n]);return r}function q(t,e,r,n){var o,i=r*n,s=M(e);try{for(s.s();!(o=s.n()).done;){var a=o.value;t.set(a,i),i+=n}}catch(t){s.e(t)}finally{s.f()}}function X(t){var e;return(e=[]).concat.apply(e,I()(t))}function H(t,e){try{var r,n=JSON.parse(t);return null!==(r=e.json)&&void 0!==r&&r.table&&function t(e){if(Array.isArray(e))return e;if(e&&"object"===d()(e))for(var r=0,n=Object.values(e);r<n.length;r++){var o=n[r],i=t(o);if(i)return i}return null}(n)||n}catch(t){throw new Error("JSONLoader: failed to parse JSON")}}var W=function(){function t(e,r){if(l()(this,t),o()(this,"schema",void 0),o()(this,"options",void 0),o()(this,"length",0),o()(this,"rows",null),o()(this,"cursor",0),o()(this,"_headers",[]),this.options=r,this.schema=e,!Array.isArray(e))for(var n in this._headers=[],e)this._headers[e[n].index]=e[n].name}return f()(t,[{key:"rowCount",value:function(){return this.length}},{key:"addArrayRow",value:function(t,e){Number.isFinite(e)&&(this.cursor=e),this.rows=this.rows||new Array(100),this.rows[this.length]=t,this.length++}},{key:"addObjectRow",value:function(t,e){Number.isFinite(e)&&(this.cursor=e),this.rows=this.rows||new Array(100),this.rows[this.length]=t,this.length++}},{key:"getBatch",value:function(){var t=this.rows;return t?(t=t.slice(0,this.length),this.rows=null,{shape:this.options.shape,batchType:"data",data:t,length:this.length,schema:this.schema,cursor:this.cursor}):null}}]),t}();var Q=function(){function t(e,r){if(l()(this,t),o()(this,"schema",void 0),o()(this,"options",void 0),o()(this,"length",0),o()(this,"objectRows",null),o()(this,"arrayRows",null),o()(this,"cursor",0),o()(this,"_headers",[]),this.options=r,this.schema=e,!Array.isArray(e))for(var n in this._headers=[],e)this._headers[e[n].index]=e[n].name}return f()(t,[{key:"rowCount",value:function(){return this.length}},{key:"addArrayRow",value:function(t,e){switch(Number.isFinite(e)&&(this.cursor=e),this.options.shape){case"object-row-table":var r=function(t,e){if(!t)throw new Error("null row");if(!e)throw new Error("no headers");for(var r={},n=0;n<e.length;n++)r[e[n]]=t[n];return r}(t,this._headers);this.addObjectRow(r,e);break;case"array-row-table":this.arrayRows=this.arrayRows||new Array(100),this.arrayRows[this.length]=t,this.length++}}},{key:"addObjectRow",value:function(t,e){switch(Number.isFinite(e)&&(this.cursor=e),this.options.shape){case"array-row-table":var r=function(t,e){if(!t)throw new Error("null row");if(!e)throw new Error("no headers");for(var r=new Array(e.length),n=0;n<e.length;n++)r[n]=t[e[n]];return r}(t,this._headers);this.addArrayRow(r,e);break;case"object-row-table":this.objectRows=this.objectRows||new Array(100),this.objectRows[this.length]=t,this.length++}}},{key:"getBatch",value:function(){var t=this.arrayRows||this.objectRows;return t?(t=t.slice(0,this.length),this.arrayRows=null,this.objectRows=null,{shape:this.options.shape,batchType:"data",data:t,length:this.length,schema:this.schema,cursor:this.cursor}):null}}]),t}(),Z=r(15),tt=r.n(Z),et=function(){function t(e,r){l()(this,t),o()(this,"schema",void 0),o()(this,"length",0),o()(this,"allocated",0),o()(this,"columns",{}),this.schema=e,this._reallocateColumns()}return f()(t,[{key:"rowCount",value:function(){return this.length}},{key:"addArrayRow",value:function(t){this._reallocateColumns();var e=0;for(var r in this.columns)this.columns[r][this.length]=t[e++];this.length++}},{key:"addObjectRow",value:function(t){for(var e in this._reallocateColumns(),t)this.columns[e][this.length]=t[e];this.length++}},{key:"getBatch",value:function(){this._pruneColumns();var t=Array.isArray(this.schema)?this.columns:{};if(!Array.isArray(this.schema))for(var e in this.schema){var r=this.schema[e];t[r.name]=this.columns[r.index]}return this.columns={},{shape:"columnar-table",batchType:"data",data:t,schema:this.schema,length:this.length}}},{key:"_reallocateColumns",value:function(){if(!(this.length<this.allocated))for(var t in this.allocated=this.allocated>0?this.allocated*=2:100,this.columns={},this.schema){var e=this.schema[t],r=e.type||Float32Array,n=this.columns[e.index];if(n&&ArrayBuffer.isView(n)){var o=new r(this.allocated);o.set(n),this.columns[e.index]=o}else n?(n.length=this.allocated,this.columns[e.index]=n):this.columns[e.index]=new r(this.allocated)}}},{key:"_pruneColumns",value:function(){for(var t=0,e=Object.entries(this.columns);t<e.length;t++){var r=tt()(e[t],2),n=r[0],o=r[1];this.columns[n]=o.slice(0,this.length)}}}]),t}();function rt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function nt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?rt(Object(r),!0).forEach((function(e){o()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):rt(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var ot={shape:"array-row-table",batchSize:"auto",batchDebounceMs:0,limit:0,_limitMB:0},it=function(){function t(e,r){l()(this,t),o()(this,"schema",void 0),o()(this,"options",void 0),o()(this,"aggregator",null),o()(this,"batchCount",0),o()(this,"bytesUsed",0),o()(this,"isChunkComplete",!1),o()(this,"lastBatchEmittedMs",Date.now()),o()(this,"totalLength",0),o()(this,"totalBytes",0),o()(this,"rowBytes",0),this.schema=e,this.options=nt(nt({},ot),r)}return f()(t,[{key:"limitReached",value:function(){var t,e;return!!(Boolean(null===(t=this.options)||void 0===t?void 0:t.limit)&&this.totalLength>=this.options.limit)||!!(Boolean(null===(e=this.options)||void 0===e?void 0:e._limitMB)&&this.totalBytes/1e6>=this.options._limitMB)}},{key:"addRow",value:function(t){this.limitReached()||(this.totalLength++,this.rowBytes=this.rowBytes||this._estimateRowMB(t),this.totalBytes+=this.rowBytes,Array.isArray(t)?this.addArrayRow(t):this.addObjectRow(t))}},{key:"addArrayRow",value:function(t){if(!this.aggregator){var e=this._getTableBatchType();this.aggregator=new e(this.schema,this.options)}this.aggregator.addArrayRow(t)}},{key:"addObjectRow",value:function(t){if(!this.aggregator){var e=this._getTableBatchType();this.aggregator=new e(this.schema,this.options)}this.aggregator.addObjectRow(t)}},{key:"chunkComplete",value:function(t){t instanceof ArrayBuffer&&(this.bytesUsed+=t.byteLength),"string"==typeof t&&(this.bytesUsed+=t.length),this.isChunkComplete=!0}},{key:"getFullBatch",value:function(t){return this._isFull()?this._getBatch(t):null}},{key:"getFinalBatch",value:function(t){return this._getBatch(t)}},{key:"_estimateRowMB",value:function(t){return Array.isArray(t)?8*t.length:8*Object.keys(t).length}},{key:"_isFull",value:function(){if(!this.aggregator||0===this.aggregator.rowCount())return!1;if("auto"===this.options.batchSize){if(!this.isChunkComplete)return!1}else if(this.options.batchSize>this.aggregator.rowCount())return!1;return!(this.options.batchDebounceMs>Date.now()-this.lastBatchEmittedMs)&&(this.isChunkComplete=!1,this.lastBatchEmittedMs=Date.now(),!0)}},{key:"_getBatch",value:function(t){if(!this.aggregator)return null;null!=t&&t.bytesUsed&&(this.bytesUsed=t.bytesUsed);var e=this.aggregator.getBatch();return e.count=this.batchCount,e.bytesUsed=this.bytesUsed,Object.assign(e,t),this.batchCount++,this.aggregator=null,e}},{key:"_getTableBatchType",value:function(){switch(this.options.shape){case"row-table":return W;case"array-row-table":case"object-row-table":return Q;case"columnar-table":return et;case"arrow-table":if(!t.ArrowBatch)throw new Error("TableBatchBuilder");return t.ArrowBatch;default:throw new Error("TableBatchBuilder")}}}]),t}();function st(t){return at.apply(this,arguments)}function at(){return(at=E()(u.a.mark((function t(e){var r,n,o,i,s,a,c,l,h,f=arguments;return u.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=f.length>1&&void 0!==f[1]?f[1]:{},n=new TextDecoder(void 0,r),o=!0,i=!1,t.prev=4,a=L()(e);case 6:return t.next=8,A()(a.next());case 8:return c=t.sent,o=c.done,t.next=12,A()(c.value);case 12:if(l=t.sent,o){t.next=20;break}return h=l,t.next=17,"string"==typeof h?h:n.decode(h,{stream:!0});case 17:o=!0,t.next=6;break;case 20:t.next=26;break;case 22:t.prev=22,t.t0=t.catch(4),i=!0,s=t.t0;case 26:if(t.prev=26,t.prev=27,o||null==a.return){t.next=31;break}return t.next=31,A()(a.return());case 31:if(t.prev=31,!i){t.next=34;break}throw s;case 34:return t.finish(31);case 35:return t.finish(26);case 36:case"end":return t.stop()}}),t,null,[[4,22,26,36],[27,,31,35]])})))).apply(this,arguments)}o()(it,"ArrowBatch",void 0);var ut=r(8),ct=r.n(ut),lt=r(16),ht=r.n(lt),ft=r(17),pt=r.n(ft),dt=r(18),yt=r.n(dt),vt=r(11),gt=r.n(vt),bt=Number.MAX_SAFE_INTEGER,mt="debug"==={}.CDEBUG,wt={textNode:void 0,numberNode:""},xt=0,Ot={BEGIN:xt++,VALUE:xt++,OPEN_OBJECT:xt++,CLOSE_OBJECT:xt++,OPEN_ARRAY:xt++,CLOSE_ARRAY:xt++,TEXT_ESCAPE:xt++,STRING:xt++,BACKSLASH:xt++,END:xt++,OPEN_KEY:xt++,CLOSE_KEY:xt++,TRUE:xt++,TRUE2:xt++,TRUE3:xt++,FALSE:xt++,FALSE2:xt++,FALSE3:xt++,FALSE4:xt++,NULL:xt++,NULL2:xt++,NULL3:xt++,NUMBER_DECIMAL_POINT:xt++,NUMBER_DIGIT:xt++};for(var jt in Ot)Ot[Ot[jt]]=jt;xt=Ot;var _t=9,kt=10,At=13,Pt=32,Et=34,St=43,Lt=44,Ct=45,It=46,Nt=48,Rt=57,Mt=58,Bt=69,Ut=91,Tt=92,Ft=93,Dt=97,Jt=98,zt=101,Gt=102,Yt=108,Vt=110,Kt=114,$t=115,qt=116,Xt=117,Ht=123,Wt=125;var Qt=/[\\"\n]/g,Zt=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};l()(this,t),this._initialize(e)}return f()(t,[{key:"_initialize",value:function(t){this._clearBuffers(this),this.bufferCheckPosition=bt,this.q="",this.c="",this.p="",this.options=t||{},this.closed=!1,this.closedRoot=!1,this.sawRoot=!1,this.tag=null,this.error=null,this.state=xt.BEGIN,this.stack=new Array,this.position=this.column=0,this.line=1,this.slashed=!1,this.unicodeI=0,this.unicodeS=null,this.depth=0,"onready"in t&&(this.onready=t.onready),"onopenobject"in t&&(this.onopenobject=t.onopenobject),"onkey"in t&&(this.onkey=t.onkey),"oncloseobject"in t&&(this.oncloseobject=t.oncloseobject),"onopenarray"in t&&(this.onopenarray=t.onopenarray),"onclosearray"in t&&(this.onclosearray=t.onclosearray),"onvalue"in t&&(this.onvalue=t.onvalue),"onerror"in t&&(this.onerror=t.onerror),"onend"in t&&(this.onend=t.onend),"onchunkparsed"in t&&(this.onchunkparsed=t.onchunkparsed),te(this,"onready")}},{key:"_clearBuffers",value:function(){for(var t in wt)this[t]=wt[t]}},{key:"end",value:function(){return this.state===xt.VALUE&&0===this.depth||oe(this,"Unexpected end"),re(this),this.c="",this.closed=!0,te(this,"onend"),this._initialize(this.options),this}},{key:"resume",value:function(){return this.error=null,this}},{key:"close",value:function(){return this.write(null)}},{key:"write",value:function(t){if(this.error)throw this.error;if(this.closed)return oe(this,"Cannot write after close. Assign an onready handler.");if(null===t)return this.end();var e=0,r=t.charCodeAt(0),n=this.p;for(mt&&console.log("write -> ["+t+"]");r&&(n=r,this.c=r=t.charCodeAt(e++),n!==r?this.p=n:n=this.p,r);)switch(mt&&console.log(e,r,Ot[this.state]),this.position++,r===kt?(this.line++,this.column=0):this.column++,this.state){case xt.BEGIN:r===Ht?this.state=xt.OPEN_OBJECT:r===Ut?this.state=xt.OPEN_ARRAY:ie(r)||oe(this,"Non-whitespace before {[.");continue;case xt.OPEN_KEY:case xt.OPEN_OBJECT:if(ie(r))continue;if(this.state===xt.OPEN_KEY)this.stack.push(xt.CLOSE_KEY);else{if(r===Wt){te(this,"onopenobject"),this.depth++,te(this,"oncloseobject"),this.depth--,this.state=this.stack.pop()||xt.VALUE;continue}this.stack.push(xt.CLOSE_OBJECT)}r===Et?this.state=xt.STRING:oe(this,'Malformed object key should start with "');continue;case xt.CLOSE_KEY:case xt.CLOSE_OBJECT:if(ie(r))continue;this.state,xt.CLOSE_KEY;r===Mt?(this.state===xt.CLOSE_OBJECT?(this.stack.push(xt.CLOSE_OBJECT),re(this,"onopenobject"),this.depth++):re(this,"onkey"),this.state=xt.VALUE):r===Wt?(ee(this,"oncloseobject"),this.depth--,this.state=this.stack.pop()||xt.VALUE):r===Lt?(this.state===xt.CLOSE_OBJECT&&this.stack.push(xt.CLOSE_OBJECT),re(this),this.state=xt.OPEN_KEY):oe(this,"Bad object");continue;case xt.OPEN_ARRAY:case xt.VALUE:if(ie(r))continue;if(this.state===xt.OPEN_ARRAY){if(te(this,"onopenarray"),this.depth++,this.state=xt.VALUE,r===Ft){te(this,"onclosearray"),this.depth--,this.state=this.stack.pop()||xt.VALUE;continue}this.stack.push(xt.CLOSE_ARRAY)}r===Et?this.state=xt.STRING:r===Ht?this.state=xt.OPEN_OBJECT:r===Ut?this.state=xt.OPEN_ARRAY:r===qt?this.state=xt.TRUE:r===Gt?this.state=xt.FALSE:r===Vt?this.state=xt.NULL:r===Ct?this.numberNode+="-":Nt<=r&&r<=Rt?(this.numberNode+=String.fromCharCode(r),this.state=xt.NUMBER_DIGIT):oe(this,"Bad value");continue;case xt.CLOSE_ARRAY:if(r===Lt)this.stack.push(xt.CLOSE_ARRAY),re(this,"onvalue"),this.state=xt.VALUE;else if(r===Ft)ee(this,"onclosearray"),this.depth--,this.state=this.stack.pop()||xt.VALUE;else{if(ie(r))continue;oe(this,"Bad array")}continue;case xt.STRING:void 0===this.textNode&&(this.textNode="");var o=e-1,i=this.slashed,s=this.unicodeI;t:for(;;){for(mt&&console.log(e,r,Ot[this.state],i);s>0;)if(this.unicodeS+=String.fromCharCode(r),r=t.charCodeAt(e++),this.position++,4===s?(this.textNode+=String.fromCharCode(parseInt(this.unicodeS,16)),s=0,o=e-1):s++,!r)break t;if(r===Et&&!i){this.state=this.stack.pop()||xt.VALUE,this.textNode+=t.substring(o,e-1),this.position+=e-1-o;break}if(r===Tt&&!i&&(i=!0,this.textNode+=t.substring(o,e-1),this.position+=e-1-o,r=t.charCodeAt(e++),this.position++,!r))break;if(i){if(i=!1,r===Vt?this.textNode+="\n":r===Kt?this.textNode+="\r":r===qt?this.textNode+="\t":r===Gt?this.textNode+="\f":r===Jt?this.textNode+="\b":r===Xt?(s=1,this.unicodeS=""):this.textNode+=String.fromCharCode(r),r=t.charCodeAt(e++),this.position++,o=e-1,r)continue;break}Qt.lastIndex=e;var a=Qt.exec(t);if(null===a){e=t.length+1,this.textNode+=t.substring(o,e-1),this.position+=e-1-o;break}if(e=a.index+1,!(r=t.charCodeAt(a.index))){this.textNode+=t.substring(o,e-1),this.position+=e-1-o;break}}this.slashed=i,this.unicodeI=s;continue;case xt.TRUE:r===Kt?this.state=xt.TRUE2:oe(this,"Invalid true started with t"+r);continue;case xt.TRUE2:r===Xt?this.state=xt.TRUE3:oe(this,"Invalid true started with tr"+r);continue;case xt.TRUE3:r===zt?(te(this,"onvalue",!0),this.state=this.stack.pop()||xt.VALUE):oe(this,"Invalid true started with tru"+r);continue;case xt.FALSE:r===Dt?this.state=xt.FALSE2:oe(this,"Invalid false started with f"+r);continue;case xt.FALSE2:r===Yt?this.state=xt.FALSE3:oe(this,"Invalid false started with fa"+r);continue;case xt.FALSE3:r===$t?this.state=xt.FALSE4:oe(this,"Invalid false started with fal"+r);continue;case xt.FALSE4:r===zt?(te(this,"onvalue",!1),this.state=this.stack.pop()||xt.VALUE):oe(this,"Invalid false started with fals"+r);continue;case xt.NULL:r===Xt?this.state=xt.NULL2:oe(this,"Invalid null started with n"+r);continue;case xt.NULL2:r===Yt?this.state=xt.NULL3:oe(this,"Invalid null started with nu"+r);continue;case xt.NULL3:r===Yt?(te(this,"onvalue",null),this.state=this.stack.pop()||xt.VALUE):oe(this,"Invalid null started with nul"+r);continue;case xt.NUMBER_DECIMAL_POINT:r===It?(this.numberNode+=".",this.state=xt.NUMBER_DIGIT):oe(this,"Leading zero not followed by .");continue;case xt.NUMBER_DIGIT:Nt<=r&&r<=Rt?this.numberNode+=String.fromCharCode(r):r===It?(-1!==this.numberNode.indexOf(".")&&oe(this,"Invalid number has two dots"),this.numberNode+="."):r===zt||r===Bt?(-1===this.numberNode.indexOf("e")&&-1===this.numberNode.indexOf("E")||oe(this,"Invalid number has two exponential"),this.numberNode+="e"):r===St||r===Ct?(n!==zt&&n!==Bt&&oe(this,"Invalid symbol in number"),this.numberNode+=String.fromCharCode(r)):(ne(this),e--,this.state=this.stack.pop()||xt.VALUE);continue;default:oe(this,"Unknown state: "+this.state)}return this.position>=this.bufferCheckPosition&&function(t){var e=Math.max(bt,10),r=0;for(var n in wt){var o=void 0===t[n]?0:t[n].length;if(o>e)switch(n){case"text":closeText(t);break;default:oe(t,"Max buffer length exceeded: "+n)}r=Math.max(r,o)}t.bufferCheckPosition=bt-r+t.position}(this),te(this,"onchunkparsed"),this}}]),t}();function te(t,e,r){mt&&console.log("-- emit",e,r),t[e]&&t[e](r,t)}function ee(t,e,r){re(t),te(t,e,r)}function re(t,e){t.textNode=function(t,e){if(void 0===e)return e;t.trim&&(e=e.trim());t.normalize&&(e=e.replace(/\s+/g," "));return e}(t.options,t.textNode),void 0!==t.textNode&&te(t,e||"onvalue",t.textNode),t.textNode=void 0}function ne(t){t.numberNode&&te(t,"onvalue",parseFloat(t.numberNode)),t.numberNode=""}function oe(t,e){return re(t),e+="\nLine: "+t.line+"\nColumn: "+t.column+"\nChar: "+t.c,e=new Error(e),t.error=e,te(t,"onerror",e),t}function ie(t){return t===At||t===kt||t===Pt||t===_t}function se(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return ae(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ae(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,a=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return s=t.done,t},e:function(t){a=!0,i=t},f:function(){try{s||null==r.return||r.return()}finally{if(a)throw i}}}}function ae(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var ue=function(){function t(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(l()(this,t),o()(this,"path",void 0),this.path=["$"],r instanceof t)this.path=I()(r.path);else if(Array.isArray(r))(e=this.path).push.apply(e,I()(r));else if("string"==typeof r&&(this.path=r.split("."),"$"!==this.path[0]))throw new Error("JSONPaths must start with $")}return f()(t,[{key:"clone",value:function(){return new t(this)}},{key:"toString",value:function(){return this.path.join(".")}},{key:"push",value:function(t){this.path.push(t)}},{key:"pop",value:function(){return this.path.pop()}},{key:"set",value:function(t){this.path[this.path.length-1]=t}},{key:"equals",value:function(t){if(!this||!t||this.path.length!==t.path.length)return!1;for(var e=0;e<this.path.length;++e)if(this.path[e]!==t.path[e])return!1;return!0}},{key:"setFieldAtPath",value:function(t,e){var r=I()(this.path);r.shift();var n,o=r.pop(),i=se(r);try{for(i.s();!(n=i.n()).done;){t=t[n.value]}}catch(t){i.e(t)}finally{i.f()}t[o]=e}},{key:"getFieldAtPath",value:function(t){var e=I()(this.path);e.shift();var r,n=e.pop(),o=se(e);try{for(o.s();!(r=o.n()).done;){t=t[r.value]}}catch(t){o.e(t)}finally{o.f()}return t[n]}}]),t}();function ce(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return le(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return le(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,a=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return s=t.done,t},e:function(t){a=!0,i=t},f:function(){try{s||null==r.return||r.return()}finally{if(a)throw i}}}}function le(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function he(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=gt()(t);if(e){var o=gt()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return yt()(this,r)}}var fe=function(t){pt()(r,t);var e=he(r);function r(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};l()(this,r),t=e.call(this),o()(ct()(t),"jsonPaths",void 0),o()(ct()(t),"streamingJsonPath",null),o()(ct()(t),"streamingArray",null),o()(ct()(t),"topLevelObject",null);var i=n.jsonpaths||[];return t.jsonPaths=i.map((function(t){return new ue(t)})),t._extendParser(),t}return f()(r,[{key:"write",value:function(t){ht()(gt()(r.prototype),"write",this).call(this,t);var e=[];return this.streamingArray&&(e=I()(this.streamingArray),this.streamingArray.length=0),e}},{key:"getPartialResult",value:function(){return this.topLevelObject}},{key:"getStreamingJsonPath",value:function(){return this.streamingJsonPath}},{key:"getStreamingJsonPathAsString",value:function(){return this.streamingJsonPath&&this.streamingJsonPath.toString()}},{key:"getJsonPath",value:function(){return this.jsonpath}},{key:"_matchJSONPath",value:function(){var t=this.getJsonPath();if(0===this.jsonPaths.length)return!0;var e,r=ce(this.jsonPaths);try{for(r.s();!(e=r.n()).done;){if(e.value.equals(t))return!0}}catch(t){r.e(t)}finally{r.f()}return!1}},{key:"_extendParser",value:function(){var t=this;this.parser.onopenarray=function(){if(!t.streamingArray&&t._matchJSONPath())return t.streamingJsonPath=t.getJsonPath().clone(),t.streamingArray=[],void t._openArray(t.streamingArray);t._openArray()},this.parser.onopenobject=function(e){t.topLevelObject?t._openObject({}):(t.topLevelObject={},t._openObject(t.topLevelObject)),void 0!==e&&t.parser.onkey(e)}}}]),r}(function(){function t(){l()(this,t),o()(this,"jsonpath",void 0),o()(this,"_parser",void 0),this.reset(),this._initializeParser()}return f()(t,[{key:"reset",value:function(){this.result=void 0,this.previousStates=[],this.currentState=Object.freeze({container:[],key:null}),this.jsonpath=new ue}},{key:"write",value:function(t){this.parser.write(t)}},{key:"close",value:function(){this.parser.close()}},{key:"_pushOrSet",value:function(t){var e=this.currentState,r=e.container,n=e.key;null!==n?(r[n]=t,this.currentState.key=null):r.push(t)}},{key:"_openArray",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.jsonpath.push(null),this._pushOrSet(t),this.previousStates.push(this.currentState),this.currentState={container:t,isArray:!0,key:null}}},{key:"_closeArray",value:function(){this.jsonpath.pop(),this.currentState=this.previousStates.pop()}},{key:"_openObject",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.jsonpath.push(null),this._pushOrSet(t),this.previousStates.push(this.currentState),this.currentState={container:t,isArray:!1,key:null}}},{key:"_closeObject",value:function(){this.jsonpath.pop(),this.currentState=this.previousStates.pop()}},{key:"_initializeParser",value:function(){var t=this;this._parser=new Zt({onready:function(){t.jsonpath=new ue,t.previousStates.length=0,t.currentState.container.length=0},onopenobject:function(e){t._openObject({}),void 0!==e&&t.parser.onkey(e)},onkey:function(e){t.jsonpath.set(e),t.currentState.key=e},oncloseobject:function(){t._closeObject()},onopenarray:function(){t._openArray()},onclosearray:function(){t._closeArray()},onvalue:function(e){t._pushOrSet(e)},onerror:function(t){throw t},onend:function(){t.result=t.currentState.container.pop()}})}},{key:"parser",get:function(){return this._parser}}]),t}());function pe(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return de(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return de(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,a=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return s=t.done,t},e:function(t){a=!0,i=t},f:function(){try{s||null==r.return||r.return()}finally{if(a)throw i}}}}function de(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function ye(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function ve(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ye(Object(r),!0).forEach((function(e){o()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ye(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function ge(){return(ge=E()(u.a.mark((function t(e,r){var n,o,i,s,a,c,l,h,f,p,d,y,v,g,b,m,w,x,O,j,_,k,P,E,S,C,I;return u.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:o=st(e),i=r.metadata,s=r.json||{},a=s.jsonpaths,c=!0,null,l=(null==r||null===(n=r.json)||void 0===n?void 0:n.shape)||"row-table",h=new it(null,ve(ve({},r),{},{shape:l})),f=new fe({jsonpaths:a}),p=!0,d=!1,t.prev=10,v=L()(o);case 12:return t.next=14,A()(v.next());case 14:return g=t.sent,p=g.done,t.next=18,A()(g.value);case 18:if(b=t.sent,p){t.next=57;break}if(m=b,w=f.write(m),x=w.length>0&&f.getStreamingJsonPathAsString(),!(w.length>0&&c)){t.next=29;break}if(!i){t.next=28;break}return O={shape:l,batchType:"partial-result",data:[],length:0,bytesUsed:0,container:f.getPartialResult(),jsonpath:x},t.next=28,O;case 28:c=!1;case 29:j=pe(w),t.prev=30,j.s();case 32:if((_=j.n()).done){t.next=41;break}if(k=_.value,h.addRow(k),!(P=h.getFullBatch({jsonpath:x}))){t.next=39;break}return t.next=39,P;case 39:t.next=32;break;case 41:t.next=46;break;case 43:t.prev=43,t.t0=t.catch(30),j.e(t.t0);case 46:return t.prev=46,j.f(),t.finish(46);case 49:if(h.chunkComplete(m),!(E=h.getFullBatch({jsonpath:x}))){t.next=54;break}return t.next=54,E;case 54:p=!0,t.next=12;break;case 57:t.next=63;break;case 59:t.prev=59,t.t1=t.catch(10),d=!0,y=t.t1;case 63:if(t.prev=63,t.prev=64,p||null==v.return){t.next=68;break}return t.next=68,A()(v.return());case 68:if(t.prev=68,!d){t.next=71;break}throw y;case 71:return t.finish(68);case 72:return t.finish(63);case 73:if(S=f.getStreamingJsonPathAsString(),!(C=h.getFinalBatch({jsonpath:S}))){t.next=78;break}return t.next=78,C;case 78:if(!i){t.next=82;break}return I={shape:l,batchType:"final-result",container:f.getPartialResult(),jsonpath:f.getStreamingJsonPathAsString(),data:[],length:0},t.next=82,I;case 82:case"end":return t.stop()}}),t,null,[[10,59,63,73],[30,43,46,49],[64,,68,72]])})))).apply(this,arguments)}function be(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function me(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?be(Object(r),!0).forEach((function(e){o()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):be(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var we,xe={geojson:{shape:"object-row-table"},json:{jsonpaths:["$","$.features"]},gis:{format:"geojson"}},Oe=me(me({},{name:"GeoJSON",id:"geojson",module:"geojson",version:"3.1.0-alpha.4",worker:!0,extensions:["geojson"],mimeTypes:["application/geo+json"],category:"geometry",text:!0,options:xe}),{},{parse:function(t,e){return je.apply(this,arguments)},parseTextSync:_e,parseInBatches:function(t,e){(e=me(me({},xe),e)).json=me(me({},xe.geojson),e.geojson);var r=function(t,e){return ge.apply(this,arguments)}(t,e);switch(e.gis.format){case"binary":return function(t){return ke.apply(this,arguments)}(r);default:return r}}});function je(){return(je=s()(u.a.mark((function t(e,r){return u.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",_e((new TextDecoder).decode(e),r));case 1:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function _e(t,e){(e=me(me({},xe),e)).json=me(me({},xe.geojson),e.geojson),e.gis=e.gis||{};var r=H(t,e);switch(e.gis.format){case"binary":return U(r);default:return r}}function ke(){return(ke=E()(u.a.mark((function t(e){var r,n,o,i,s,a,c;return u.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=!0,n=!1,t.prev=2,i=L()(e);case 4:return t.next=6,A()(i.next());case 6:return s=t.sent,r=s.done,t.next=10,A()(s.value);case 10:if(a=t.sent,r){t.next=19;break}return(c=a).data=U(c.data),t.next=16,c;case 16:r=!0,t.next=4;break;case 19:t.next=25;break;case 21:t.prev=21,t.t0=t.catch(2),n=!0,o=t.t0;case 25:if(t.prev=25,t.prev=26,r||null==i.return){t.next=30;break}return t.next=30,A()(i.return());case 30:if(t.prev=30,!n){t.next=33;break}throw o;case 33:return t.finish(30);case 34:return t.finish(25);case 35:case"end":return t.stop()}}),t,null,[[2,21,25,35],[26,,30,34]])})))).apply(this,arguments)}we=Oe,"undefined"!=typeof self&&(g.onmessage=function(){var t=s()(u.a.mark((function t(e,r){var n,o,i,s,a;return u.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:t.t0=e,t.next="process"===t.t0?3:16;break;case 3:return t.prev=3,n=r.input,o=r.options,i=void 0===o?{}:o,t.next=7,j({loader:we,arrayBuffer:n,options:i,context:{parse:O}});case 7:s=t.sent,g.postMessage("done",{result:s}),t.next=15;break;case 11:t.prev=11,t.t1=t.catch(3),a=t.t1 instanceof Error?t.t1.message:"",g.postMessage("error",{error:a});case 15:return t.abrupt("break",16);case 16:case"end":return t.stop()}}),t,null,[[3,11]])})));return function(e,r){return t.apply(this,arguments)}}())}]);
|
|
1
|
+
!function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=30)}([function(t,e){t.exports=function(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,r){t.exports=r(20)},function(t,e,r){var n=r(12);t.exports=function(t){return new n(t)},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){function r(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}t.exports=function(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),t},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,r){var n=r(22),o=r(23),i=r(14),s=r(24);t.exports=function(t){return n(t)||o(t)||i(t)||s()},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,r){var n=r(21);t.exports=function(t){return function(){return new n(t.apply(this,arguments))}},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(t){var e;if("undefined"!=typeof Symbol&&(Symbol.asyncIterator&&(e=t[Symbol.asyncIterator]),null==e&&Symbol.iterator&&(e=t[Symbol.iterator])),null==e&&(e=t["@@asyncIterator"]),null==e&&(e=t["@@iterator"]),null==e)throw new TypeError("Object is not async iterable");return e.call(t)},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){function r(e){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(t.exports=r=function(t){return typeof t},t.exports.default=t.exports,t.exports.__esModule=!0):(t.exports=r=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.default=t.exports,t.exports.__esModule=!0),r(e)}t.exports=r,t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){function r(t,e,r,n,o,i,s){try{var a=t[i](s),u=a.value}catch(t){return void r(t)}a.done?e(u):Promise.resolve(u).then(n,o)}t.exports=function(t){return function(){var e=this,n=arguments;return new Promise((function(o,i){var s=t.apply(e,n);function a(t){r(s,o,i,a,u,"next",t)}function u(t){r(s,o,i,a,u,"throw",t)}a(void 0)}))}},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){function r(e){return t.exports=r=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},t.exports.default=t.exports,t.exports.__esModule=!0,r(e)}t.exports=r,t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(t){this.wrapped=t},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,r){var n=r(13);t.exports=function(t,e){if(t){if("string"==typeof t)return n(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(t,e):void 0}},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,r){var n=r(25),o=r(26),i=r(14),s=r(27);t.exports=function(t,e){return n(t)||o(t,e)||i(t,e)||s()},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,r){var n=r(28);function o(e,r,i){return"undefined"!=typeof Reflect&&Reflect.get?(t.exports=o=Reflect.get,t.exports.default=t.exports,t.exports.__esModule=!0):(t.exports=o=function(t,e,r){var o=n(t,e);if(o){var i=Object.getOwnPropertyDescriptor(o,e);return i.get?i.get.call(r):i.value}},t.exports.default=t.exports,t.exports.__esModule=!0),o(e,r,i||e)}t.exports=o,t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,r){var n=r(29);t.exports=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&n(t,e)},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,r){var n=r(9).default,o=r(8);t.exports=function(t,e){return!e||"object"!==n(e)&&"function"!=typeof e?o(t):e},t.exports.default=t.exports,t.exports.__esModule=!0},,function(t,e,r){var n=function(t){"use strict";var e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",s=n.toStringTag||"@@toStringTag";function a(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{a({},"")}catch(t){a=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var o=e&&e.prototype instanceof h?e:h,i=Object.create(o.prototype),s=new j(n||[]);return i._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return k()}for(r.method=o,r.arg=i;;){var s=r.delegate;if(s){var a=w(s,r);if(a){if(a===l)continue;return a}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=c(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===l)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}(t,r,s),i}function c(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var l={};function h(){}function f(){}function p(){}var d={};d[o]=function(){return this};var y=Object.getPrototypeOf,v=y&&y(y(_([])));v&&v!==e&&r.call(v,o)&&(d=v);var g=p.prototype=h.prototype=Object.create(d);function b(t){["next","throw","return"].forEach((function(e){a(t,e,(function(t){return this._invoke(e,t)}))}))}function m(t,e){var n;this._invoke=function(o,i){function s(){return new e((function(n,s){!function n(o,i,s,a){var u=c(t[o],t,i);if("throw"!==u.type){var l=u.arg,h=l.value;return h&&"object"==typeof h&&r.call(h,"__await")?e.resolve(h.__await).then((function(t){n("next",t,s,a)}),(function(t){n("throw",t,s,a)})):e.resolve(h).then((function(t){l.value=t,s(l)}),(function(t){return n("throw",t,s,a)}))}a(u.arg)}(o,i,n,s)}))}return n=n?n.then(s,s):s()}}function w(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,w(t,e),"throw"===e.method))return l;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var n=c(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,l;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,l):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function x(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function O(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(x,this),this.reset(!0)}function _(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=g.constructor=p,p.constructor=f,f.displayName=a(p,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===f||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,a(t,s,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},b(m.prototype),m.prototype[i]=function(){return this},t.AsyncIterator=m,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var s=new m(u(e,r,n,o),i);return t.isGeneratorFunction(r)?s:s.next().then((function(t){return t.done?t.value:s.next()}))},b(g),a(g,s,"Generator"),g[o]=function(){return this},g.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=_,j.prototype={constructor:j,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return s.type="throw",s.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],s=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var a=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(a&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(a){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var s=i?i.completion:{};return s.type=t,s.arg=e,i?(this.method="next",this.next=i.finallyLoc,l):this.complete(s)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),l},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),O(r),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;O(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:_(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}(t.exports);try{regeneratorRuntime=n}catch(t){Function("r","regeneratorRuntime = r")(n)}},function(t,e,r){var n=r(12);function o(t){var e,r;function o(e,r){try{var s=t[e](r),a=s.value,u=a instanceof n;Promise.resolve(u?a.wrapped:a).then((function(t){u?o("return"===e?"return":"next",t):i(s.done?"return":"normal",t)}),(function(t){o("throw",t)}))}catch(t){i("throw",t)}}function i(t,n){switch(t){case"return":e.resolve({value:n,done:!0});break;case"throw":e.reject(n);break;default:e.resolve({value:n,done:!1})}(e=e.next)?o(e.key,e.arg):r=null}this._invoke=function(t,n){return new Promise((function(i,s){var a={key:t,arg:n,resolve:i,reject:s,next:null};r?r=r.next=a:(e=r=a,o(t,n))}))},"function"!=typeof t.return&&(this.return=void 0)}o.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},o.prototype.next=function(t){return this._invoke("next",t)},o.prototype.throw=function(t){return this._invoke("throw",t)},o.prototype.return=function(t){return this._invoke("return",t)},t.exports=o,t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,r){var n=r(13);t.exports=function(t){if(Array.isArray(t))return n(t)},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(t){if(Array.isArray(t))return t},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(t,e){var r=t&&("undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"]);if(null!=r){var n,o,i=[],s=!0,a=!1;try{for(r=r.call(t);!(s=(n=r.next()).done)&&(i.push(n.value),!e||i.length!==e);s=!0);}catch(t){a=!0,o=t}finally{try{s||null==r.return||r.return()}finally{if(a)throw o}}return i}},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,r){var n=r(11);t.exports=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=n(t)););return t},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){function r(e,n){return t.exports=r=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},t.exports.default=t.exports,t.exports.__esModule=!0,r(e,n)}t.exports=r,t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,r){"use strict";r.r(e);var n=r(0),o=r.n(n),i=r(10),s=r.n(i),a=r(1),u=r.n(a),c=r(3),l=r.n(c),h=r(4),f=r.n(h),p=r(9),d=r.n(p);function y(t){return!!t&&(t instanceof ArrayBuffer||("undefined"!=typeof MessagePort&&t instanceof MessagePort||("undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas)))}var v=new Map,g=function(){function t(){l()(this,t)}return f()(t,null,[{key:"onmessage",set:function(t){self.onmessage=function(e){if(b(e)){var r=e.data,n=r.type,o=r.payload;t(n,o)}}}},{key:"addEventListener",value:function(t){var e=v.get(t);e||(e=function(e){if(b(e)){var r=e.data,n=r.type,o=r.payload;t(n,o)}}),self.addEventListener("message",e)}},{key:"removeEventListener",value:function(t){var e=v.get(t);v.delete(t),self.removeEventListener("message",e)}},{key:"postMessage",value:function(t,e){if(self){var r={source:"loaders.gl",type:t,payload:e},n=function t(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2?arguments[2]:void 0,o=n||new Set;if(e){if(y(e))o.add(e);else if(y(e.buffer))o.add(e.buffer);else if(ArrayBuffer.isView(e));else if(r&&"object"===d()(e))for(var i in e)t(e[i],r,o)}else;return void 0===n?Array.from(o):[]}(e);self.postMessage(r,n)}}}]),t}();function b(t){var e=t.type,r=t.data;return"message"===e&&r&&"string"==typeof r.source&&r.source.startsWith("loaders.gl")}function m(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function w(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?m(Object(r),!0).forEach((function(e){o()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):m(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var x=0;function O(t,e){return new Promise((function(r,n){var o=x++;g.addEventListener((function t(e,i){if(i.id===o)switch(e){case"done":g.removeEventListener(t),r(i.result);break;case"error":g.removeEventListener(t),n(i.error)}}));var i={id:o,input:t,options:e};g.postMessage("process",i)}))}function j(t){return _.apply(this,arguments)}function _(){return(_=s()(u.a.mark((function t(e){var r,n,o,i,s,a,c;return u.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.loader,n=e.arrayBuffer,o=e.options,i=e.context,!r.parseSync&&!r.parse){t.next=6;break}s=n,a=r.parseSync||r.parse,t.next=13;break;case 6:if(!r.parseTextSync){t.next=12;break}c=new TextDecoder,s=c.decode(n),a=r.parseTextSync,t.next=13;break;case 12:throw new Error("Could not load data with ".concat(r.name," loader"));case 13:return o=w(w({},o),{},{modules:r&&r.options&&r.options.modules||{},worker:!1}),t.next=16,a(s,w({},o),i,r);case 16:return t.abrupt("return",t.sent);case 17:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var k=r(2),A=r.n(k),P=r(6),E=r.n(P),S=r(7),L=r.n(S),C=r(5),I=r.n(C);function N(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function R(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?N(Object(r),!0).forEach((function(e){o()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):N(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function M(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return B(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return B(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,a=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return s=t.done,t},e:function(t){a=!0,i=t},f:function(){try{s||null==r.return||r.return()}finally{if(a)throw i}}}}function B(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function U(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=T(t);return F(t,r,{coordLength:e.coordLength||r.coordLength,numericPropKeys:e.numericPropKeys||r.numericPropKeys,PositionDataType:e.PositionDataType||Float32Array})}function T(t){var e,r,n=0,o=0,i=0,s=0,a=0,u=0,c=0,l=0,h=0,f=new Set,p={},d=M(t);try{for(d.s();!(e=d.n()).done;){var y=e.value,v=y.geometry;switch(v.type){case"Point":o++,n++,f.add(v.coordinates.length);break;case"MultiPoint":o++,n+=v.coordinates.length;var g,b=M(v.coordinates);try{for(b.s();!(g=b.n()).done;){var m=g.value;f.add(m.length)}}catch(t){b.e(t)}finally{b.f()}break;case"LineString":a++,i+=v.coordinates.length,s++;var w,x=M(v.coordinates);try{for(x.s();!(w=x.n()).done;){var O=w.value;f.add(O.length)}}catch(t){x.e(t)}finally{x.f()}break;case"MultiLineString":a++;var j,_=M(v.coordinates);try{for(_.s();!(j=_.n()).done;){var k=j.value;i+=k.length,s++;var A,P=M(k);try{for(P.s();!(A=P.n()).done;){var E=A.value;f.add(E.length)}}catch(t){P.e(t)}finally{P.f()}}}catch(t){_.e(t)}finally{_.f()}break;case"Polygon":h++,c++,l+=v.coordinates.length,u+=X(v.coordinates).length;var S,L=M(X(v.coordinates));try{for(L.s();!(S=L.n()).done;){var C=S.value;f.add(C.length)}}catch(t){L.e(t)}finally{L.f()}break;case"MultiPolygon":h++;var N,R=M(v.coordinates);try{for(R.s();!(N=R.n()).done;){var B=N.value;c++,l+=B.length,u+=X(B).length;var U,T=M(X(B));try{for(T.s();!(U=T.n()).done;){var F=U.value;f.add(F.length)}}catch(t){T.e(t)}finally{T.f()}}}catch(t){R.e(t)}finally{R.f()}break;default:throw new Error("Unsupported geometry type: ".concat(v.type))}if(y.properties)for(var D in y.properties){var J=y.properties[D];p[D]=p[D]||void 0===p[D]?(r=J,Number.isFinite(r)):p[D]}}}catch(t){d.e(t)}finally{d.f()}return{coordLength:f.size>0?Math.max.apply(Math,I()(f)):2,pointPositionsCount:n,pointFeaturesCount:o,linePositionsCount:i,linePathsCount:s,lineFeaturesCount:a,polygonPositionsCount:u,polygonObjectsCount:c,polygonRingsCount:l,polygonFeaturesCount:h,numericPropKeys:Object.keys(p).filter((function(t){return p[t]}))}}function F(t,e,r){for(var n=e.pointPositionsCount,o=e.pointFeaturesCount,i=e.linePositionsCount,s=e.linePathsCount,a=e.lineFeaturesCount,u=e.polygonPositionsCount,c=e.polygonObjectsCount,l=e.polygonRingsCount,h=e.polygonFeaturesCount,f=r.coordLength,p=r.numericPropKeys,d=r.PositionDataType,y=void 0===d?Float32Array:d,v=t.length>65535?Uint32Array:Uint16Array,g={positions:new y(n*f),globalFeatureIds:new v(n),featureIds:o>65535?new Uint32Array(n):new Uint16Array(n),numericProps:{},properties:Array(),fields:Array()},b={positions:new y(i*f),pathIndices:i>65535?new Uint32Array(s+1):new Uint16Array(s+1),globalFeatureIds:new v(i),featureIds:a>65535?new Uint32Array(i):new Uint16Array(i),numericProps:{},properties:Array(),fields:Array()},m={positions:new y(u*f),polygonIndices:u>65535?new Uint32Array(c+1):new Uint16Array(c+1),primitivePolygonIndices:u>65535?new Uint32Array(l+1):new Uint16Array(l+1),globalFeatureIds:new v(u),featureIds:h>65535?new Uint32Array(u):new Uint16Array(u),numericProps:{},properties:Array(),fields:Array()},w=0,x=[g,b,m];w<x.length;w++){var O,j=x[w],_=M(p||[]);try{for(_.s();!(O=_.n()).done;){var k=O.value;j.numericProps[k]=new Float32Array(j.positions.length/f)}}catch(t){_.e(t)}finally{_.f()}}b.pathIndices[s]=i,m.polygonIndices[c]=u,m.primitivePolygonIndices[l]=u;var A,P={pointPosition:0,pointFeature:0,linePosition:0,linePath:0,lineFeature:0,polygonPosition:0,polygonObject:0,polygonRing:0,polygonFeature:0,feature:0},E=M(t);try{for(E.s();!(A=E.n()).done;){var S=A.value,L=S.geometry,C=S.properties||{};switch(L.type){case"Point":D(L.coordinates,g,P,f,C),g.properties.push($(C,p)),P.pointFeature++;break;case"MultiPoint":J(L.coordinates,g,P,f,C),g.properties.push($(C,p)),P.pointFeature++;break;case"LineString":z(L.coordinates,b,P,f,C),b.properties.push($(C,p)),P.lineFeature++;break;case"MultiLineString":G(L.coordinates,b,P,f,C),b.properties.push($(C,p)),P.lineFeature++;break;case"Polygon":Y(L.coordinates,m,P,f,C),m.properties.push($(C,p)),P.polygonFeature++;break;case"MultiPolygon":V(L.coordinates,m,P,f,C),m.properties.push($(C,p)),P.polygonFeature++;break;default:throw new Error("Invalid geometry type")}P.feature++}}catch(t){E.e(t)}finally{E.f()}return function(t,e,r,n){var o={points:R(R({},t),{},{positions:{value:t.positions,size:n},globalFeatureIds:{value:t.globalFeatureIds,size:1},featureIds:{value:t.featureIds,size:1},type:"Point"}),lines:R(R({},e),{},{pathIndices:{value:e.pathIndices,size:1},positions:{value:e.positions,size:n},globalFeatureIds:{value:e.globalFeatureIds,size:1},featureIds:{value:e.featureIds,size:1},type:"LineString"}),polygons:R(R({},r),{},{polygonIndices:{value:r.polygonIndices,size:1},primitivePolygonIndices:{value:r.primitivePolygonIndices,size:1},positions:{value:r.positions,size:n},globalFeatureIds:{value:r.globalFeatureIds,size:1},featureIds:{value:r.featureIds,size:1},type:"Polygon"})};for(var i in o)for(var s in o[i].numericProps)o[i].numericProps[s]={value:o[i].numericProps[s],size:1};return o}(g,b,m,f)}function D(t,e,r,n,o){e.positions.set(t,r.pointPosition*n),e.globalFeatureIds[r.pointPosition]=r.feature,e.featureIds[r.pointPosition]=r.pointFeature,K(e,o,r.pointPosition,1),r.pointPosition++}function J(t,e,r,n,o){var i,s=M(t);try{for(s.s();!(i=s.n()).done;){D(i.value,e,r,n,o)}}catch(t){s.e(t)}finally{s.f()}}function z(t,e,r,n,o){e.pathIndices[r.linePath]=r.linePosition,r.linePath++,q(e.positions,t,r.linePosition,n);var i=t.length;K(e,o,r.linePosition,i),e.globalFeatureIds.set(new Uint32Array(i).fill(r.feature),r.linePosition),e.featureIds.set(new Uint32Array(i).fill(r.lineFeature),r.linePosition),r.linePosition+=i}function G(t,e,r,n,o){var i,s=M(t);try{for(s.s();!(i=s.n()).done;){z(i.value,e,r,n,o)}}catch(t){s.e(t)}finally{s.f()}}function Y(t,e,r,n,o){e.polygonIndices[r.polygonObject]=r.polygonPosition,r.polygonObject++;var i,s=M(t);try{for(s.s();!(i=s.n()).done;){var a=i.value;e.primitivePolygonIndices[r.polygonRing]=r.polygonPosition,r.polygonRing++,q(e.positions,a,r.polygonPosition,n);var u=a.length;K(e,o,r.polygonPosition,u),e.globalFeatureIds.set(new Uint32Array(u).fill(r.feature),r.polygonPosition),e.featureIds.set(new Uint32Array(u).fill(r.polygonFeature),r.polygonPosition),r.polygonPosition+=u}}catch(t){s.e(t)}finally{s.f()}}function V(t,e,r,n,o){var i,s=M(t);try{for(s.s();!(i=s.n()).done;){Y(i.value,e,r,n,o)}}catch(t){s.e(t)}finally{s.f()}}function K(t,e,r,n){for(var o in t.numericProps)o in e&&t.numericProps[o].set(new Array(n).fill(e[o]),r)}function $(t,e){var r={};for(var n in t)e.includes(n)||(r[n]=t[n]);return r}function q(t,e,r,n){var o,i=r*n,s=M(e);try{for(s.s();!(o=s.n()).done;){var a=o.value;t.set(a,i),i+=n}}catch(t){s.e(t)}finally{s.f()}}function X(t){var e;return(e=[]).concat.apply(e,I()(t))}function H(t,e){try{var r,n=JSON.parse(t);return null!==(r=e.json)&&void 0!==r&&r.table&&function t(e){if(Array.isArray(e))return e;if(e&&"object"===d()(e))for(var r=0,n=Object.values(e);r<n.length;r++){var o=n[r],i=t(o);if(i)return i}return null}(n)||n}catch(t){throw new Error("JSONLoader: failed to parse JSON")}}var W=function(){function t(e,r){if(l()(this,t),o()(this,"schema",void 0),o()(this,"options",void 0),o()(this,"length",0),o()(this,"rows",null),o()(this,"cursor",0),o()(this,"_headers",[]),this.options=r,this.schema=e,!Array.isArray(e))for(var n in this._headers=[],e)this._headers[e[n].index]=e[n].name}return f()(t,[{key:"rowCount",value:function(){return this.length}},{key:"addArrayRow",value:function(t,e){Number.isFinite(e)&&(this.cursor=e),this.rows=this.rows||new Array(100),this.rows[this.length]=t,this.length++}},{key:"addObjectRow",value:function(t,e){Number.isFinite(e)&&(this.cursor=e),this.rows=this.rows||new Array(100),this.rows[this.length]=t,this.length++}},{key:"getBatch",value:function(){var t=this.rows;return t?(t=t.slice(0,this.length),this.rows=null,{shape:this.options.shape,batchType:"data",data:t,length:this.length,schema:this.schema,cursor:this.cursor}):null}}]),t}();var Q=function(){function t(e,r){if(l()(this,t),o()(this,"schema",void 0),o()(this,"options",void 0),o()(this,"length",0),o()(this,"objectRows",null),o()(this,"arrayRows",null),o()(this,"cursor",0),o()(this,"_headers",[]),this.options=r,this.schema=e,!Array.isArray(e))for(var n in this._headers=[],e)this._headers[e[n].index]=e[n].name}return f()(t,[{key:"rowCount",value:function(){return this.length}},{key:"addArrayRow",value:function(t,e){switch(Number.isFinite(e)&&(this.cursor=e),this.options.shape){case"object-row-table":var r=function(t,e){if(!t)throw new Error("null row");if(!e)throw new Error("no headers");for(var r={},n=0;n<e.length;n++)r[e[n]]=t[n];return r}(t,this._headers);this.addObjectRow(r,e);break;case"array-row-table":this.arrayRows=this.arrayRows||new Array(100),this.arrayRows[this.length]=t,this.length++}}},{key:"addObjectRow",value:function(t,e){switch(Number.isFinite(e)&&(this.cursor=e),this.options.shape){case"array-row-table":var r=function(t,e){if(!t)throw new Error("null row");if(!e)throw new Error("no headers");for(var r=new Array(e.length),n=0;n<e.length;n++)r[n]=t[e[n]];return r}(t,this._headers);this.addArrayRow(r,e);break;case"object-row-table":this.objectRows=this.objectRows||new Array(100),this.objectRows[this.length]=t,this.length++}}},{key:"getBatch",value:function(){var t=this.arrayRows||this.objectRows;return t?(t=t.slice(0,this.length),this.arrayRows=null,this.objectRows=null,{shape:this.options.shape,batchType:"data",data:t,length:this.length,schema:this.schema,cursor:this.cursor}):null}}]),t}(),Z=r(15),tt=r.n(Z),et=function(){function t(e,r){l()(this,t),o()(this,"schema",void 0),o()(this,"length",0),o()(this,"allocated",0),o()(this,"columns",{}),this.schema=e,this._reallocateColumns()}return f()(t,[{key:"rowCount",value:function(){return this.length}},{key:"addArrayRow",value:function(t){this._reallocateColumns();var e=0;for(var r in this.columns)this.columns[r][this.length]=t[e++];this.length++}},{key:"addObjectRow",value:function(t){for(var e in this._reallocateColumns(),t)this.columns[e][this.length]=t[e];this.length++}},{key:"getBatch",value:function(){this._pruneColumns();var t=Array.isArray(this.schema)?this.columns:{};if(!Array.isArray(this.schema))for(var e in this.schema){var r=this.schema[e];t[r.name]=this.columns[r.index]}return this.columns={},{shape:"columnar-table",batchType:"data",data:t,schema:this.schema,length:this.length}}},{key:"_reallocateColumns",value:function(){if(!(this.length<this.allocated))for(var t in this.allocated=this.allocated>0?this.allocated*=2:100,this.columns={},this.schema){var e=this.schema[t],r=e.type||Float32Array,n=this.columns[e.index];if(n&&ArrayBuffer.isView(n)){var o=new r(this.allocated);o.set(n),this.columns[e.index]=o}else n?(n.length=this.allocated,this.columns[e.index]=n):this.columns[e.index]=new r(this.allocated)}}},{key:"_pruneColumns",value:function(){for(var t=0,e=Object.entries(this.columns);t<e.length;t++){var r=tt()(e[t],2),n=r[0],o=r[1];this.columns[n]=o.slice(0,this.length)}}}]),t}();function rt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function nt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?rt(Object(r),!0).forEach((function(e){o()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):rt(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var ot={shape:"array-row-table",batchSize:"auto",batchDebounceMs:0,limit:0,_limitMB:0},it=function(){function t(e,r){l()(this,t),o()(this,"schema",void 0),o()(this,"options",void 0),o()(this,"aggregator",null),o()(this,"batchCount",0),o()(this,"bytesUsed",0),o()(this,"isChunkComplete",!1),o()(this,"lastBatchEmittedMs",Date.now()),o()(this,"totalLength",0),o()(this,"totalBytes",0),o()(this,"rowBytes",0),this.schema=e,this.options=nt(nt({},ot),r)}return f()(t,[{key:"limitReached",value:function(){var t,e;return!!(Boolean(null===(t=this.options)||void 0===t?void 0:t.limit)&&this.totalLength>=this.options.limit)||!!(Boolean(null===(e=this.options)||void 0===e?void 0:e._limitMB)&&this.totalBytes/1e6>=this.options._limitMB)}},{key:"addRow",value:function(t){this.limitReached()||(this.totalLength++,this.rowBytes=this.rowBytes||this._estimateRowMB(t),this.totalBytes+=this.rowBytes,Array.isArray(t)?this.addArrayRow(t):this.addObjectRow(t))}},{key:"addArrayRow",value:function(t){if(!this.aggregator){var e=this._getTableBatchType();this.aggregator=new e(this.schema,this.options)}this.aggregator.addArrayRow(t)}},{key:"addObjectRow",value:function(t){if(!this.aggregator){var e=this._getTableBatchType();this.aggregator=new e(this.schema,this.options)}this.aggregator.addObjectRow(t)}},{key:"chunkComplete",value:function(t){t instanceof ArrayBuffer&&(this.bytesUsed+=t.byteLength),"string"==typeof t&&(this.bytesUsed+=t.length),this.isChunkComplete=!0}},{key:"getFullBatch",value:function(t){return this._isFull()?this._getBatch(t):null}},{key:"getFinalBatch",value:function(t){return this._getBatch(t)}},{key:"_estimateRowMB",value:function(t){return Array.isArray(t)?8*t.length:8*Object.keys(t).length}},{key:"_isFull",value:function(){if(!this.aggregator||0===this.aggregator.rowCount())return!1;if("auto"===this.options.batchSize){if(!this.isChunkComplete)return!1}else if(this.options.batchSize>this.aggregator.rowCount())return!1;return!(this.options.batchDebounceMs>Date.now()-this.lastBatchEmittedMs)&&(this.isChunkComplete=!1,this.lastBatchEmittedMs=Date.now(),!0)}},{key:"_getBatch",value:function(t){if(!this.aggregator)return null;null!=t&&t.bytesUsed&&(this.bytesUsed=t.bytesUsed);var e=this.aggregator.getBatch();return e.count=this.batchCount,e.bytesUsed=this.bytesUsed,Object.assign(e,t),this.batchCount++,this.aggregator=null,e}},{key:"_getTableBatchType",value:function(){switch(this.options.shape){case"row-table":return W;case"array-row-table":case"object-row-table":return Q;case"columnar-table":return et;case"arrow-table":if(!t.ArrowBatch)throw new Error("TableBatchBuilder");return t.ArrowBatch;default:throw new Error("TableBatchBuilder")}}}]),t}();function st(t){return at.apply(this,arguments)}function at(){return(at=E()(u.a.mark((function t(e){var r,n,o,i,s,a,c,l,h,f=arguments;return u.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=f.length>1&&void 0!==f[1]?f[1]:{},n=new TextDecoder(void 0,r),o=!0,i=!1,t.prev=4,a=L()(e);case 6:return t.next=8,A()(a.next());case 8:return c=t.sent,o=c.done,t.next=12,A()(c.value);case 12:if(l=t.sent,o){t.next=20;break}return h=l,t.next=17,"string"==typeof h?h:n.decode(h,{stream:!0});case 17:o=!0,t.next=6;break;case 20:t.next=26;break;case 22:t.prev=22,t.t0=t.catch(4),i=!0,s=t.t0;case 26:if(t.prev=26,t.prev=27,o||null==a.return){t.next=31;break}return t.next=31,A()(a.return());case 31:if(t.prev=31,!i){t.next=34;break}throw s;case 34:return t.finish(31);case 35:return t.finish(26);case 36:case"end":return t.stop()}}),t,null,[[4,22,26,36],[27,,31,35]])})))).apply(this,arguments)}o()(it,"ArrowBatch",void 0);var ut=r(8),ct=r.n(ut),lt=r(16),ht=r.n(lt),ft=r(17),pt=r.n(ft),dt=r(18),yt=r.n(dt),vt=r(11),gt=r.n(vt),bt=Number.MAX_SAFE_INTEGER,mt="debug"==={}.CDEBUG,wt={textNode:void 0,numberNode:""},xt=0,Ot={BEGIN:xt++,VALUE:xt++,OPEN_OBJECT:xt++,CLOSE_OBJECT:xt++,OPEN_ARRAY:xt++,CLOSE_ARRAY:xt++,TEXT_ESCAPE:xt++,STRING:xt++,BACKSLASH:xt++,END:xt++,OPEN_KEY:xt++,CLOSE_KEY:xt++,TRUE:xt++,TRUE2:xt++,TRUE3:xt++,FALSE:xt++,FALSE2:xt++,FALSE3:xt++,FALSE4:xt++,NULL:xt++,NULL2:xt++,NULL3:xt++,NUMBER_DECIMAL_POINT:xt++,NUMBER_DIGIT:xt++};for(var jt in Ot)Ot[Ot[jt]]=jt;xt=Ot;var _t=9,kt=10,At=13,Pt=32,Et=34,St=43,Lt=44,Ct=45,It=46,Nt=48,Rt=57,Mt=58,Bt=69,Ut=91,Tt=92,Ft=93,Dt=97,Jt=98,zt=101,Gt=102,Yt=108,Vt=110,Kt=114,$t=115,qt=116,Xt=117,Ht=123,Wt=125;var Qt=/[\\"\n]/g,Zt=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};l()(this,t),this._initialize(e)}return f()(t,[{key:"_initialize",value:function(t){this._clearBuffers(this),this.bufferCheckPosition=bt,this.q="",this.c="",this.p="",this.options=t||{},this.closed=!1,this.closedRoot=!1,this.sawRoot=!1,this.tag=null,this.error=null,this.state=xt.BEGIN,this.stack=new Array,this.position=this.column=0,this.line=1,this.slashed=!1,this.unicodeI=0,this.unicodeS=null,this.depth=0,"onready"in t&&(this.onready=t.onready),"onopenobject"in t&&(this.onopenobject=t.onopenobject),"onkey"in t&&(this.onkey=t.onkey),"oncloseobject"in t&&(this.oncloseobject=t.oncloseobject),"onopenarray"in t&&(this.onopenarray=t.onopenarray),"onclosearray"in t&&(this.onclosearray=t.onclosearray),"onvalue"in t&&(this.onvalue=t.onvalue),"onerror"in t&&(this.onerror=t.onerror),"onend"in t&&(this.onend=t.onend),"onchunkparsed"in t&&(this.onchunkparsed=t.onchunkparsed),te(this,"onready")}},{key:"_clearBuffers",value:function(){for(var t in wt)this[t]=wt[t]}},{key:"end",value:function(){return this.state===xt.VALUE&&0===this.depth||oe(this,"Unexpected end"),re(this),this.c="",this.closed=!0,te(this,"onend"),this._initialize(this.options),this}},{key:"resume",value:function(){return this.error=null,this}},{key:"close",value:function(){return this.write(null)}},{key:"write",value:function(t){if(this.error)throw this.error;if(this.closed)return oe(this,"Cannot write after close. Assign an onready handler.");if(null===t)return this.end();var e=0,r=t.charCodeAt(0),n=this.p;for(mt&&console.log("write -> ["+t+"]");r&&(n=r,this.c=r=t.charCodeAt(e++),n!==r?this.p=n:n=this.p,r);)switch(mt&&console.log(e,r,Ot[this.state]),this.position++,r===kt?(this.line++,this.column=0):this.column++,this.state){case xt.BEGIN:r===Ht?this.state=xt.OPEN_OBJECT:r===Ut?this.state=xt.OPEN_ARRAY:ie(r)||oe(this,"Non-whitespace before {[.");continue;case xt.OPEN_KEY:case xt.OPEN_OBJECT:if(ie(r))continue;if(this.state===xt.OPEN_KEY)this.stack.push(xt.CLOSE_KEY);else{if(r===Wt){te(this,"onopenobject"),this.depth++,te(this,"oncloseobject"),this.depth--,this.state=this.stack.pop()||xt.VALUE;continue}this.stack.push(xt.CLOSE_OBJECT)}r===Et?this.state=xt.STRING:oe(this,'Malformed object key should start with "');continue;case xt.CLOSE_KEY:case xt.CLOSE_OBJECT:if(ie(r))continue;this.state,xt.CLOSE_KEY;r===Mt?(this.state===xt.CLOSE_OBJECT?(this.stack.push(xt.CLOSE_OBJECT),re(this,"onopenobject"),this.depth++):re(this,"onkey"),this.state=xt.VALUE):r===Wt?(ee(this,"oncloseobject"),this.depth--,this.state=this.stack.pop()||xt.VALUE):r===Lt?(this.state===xt.CLOSE_OBJECT&&this.stack.push(xt.CLOSE_OBJECT),re(this),this.state=xt.OPEN_KEY):oe(this,"Bad object");continue;case xt.OPEN_ARRAY:case xt.VALUE:if(ie(r))continue;if(this.state===xt.OPEN_ARRAY){if(te(this,"onopenarray"),this.depth++,this.state=xt.VALUE,r===Ft){te(this,"onclosearray"),this.depth--,this.state=this.stack.pop()||xt.VALUE;continue}this.stack.push(xt.CLOSE_ARRAY)}r===Et?this.state=xt.STRING:r===Ht?this.state=xt.OPEN_OBJECT:r===Ut?this.state=xt.OPEN_ARRAY:r===qt?this.state=xt.TRUE:r===Gt?this.state=xt.FALSE:r===Vt?this.state=xt.NULL:r===Ct?this.numberNode+="-":Nt<=r&&r<=Rt?(this.numberNode+=String.fromCharCode(r),this.state=xt.NUMBER_DIGIT):oe(this,"Bad value");continue;case xt.CLOSE_ARRAY:if(r===Lt)this.stack.push(xt.CLOSE_ARRAY),re(this,"onvalue"),this.state=xt.VALUE;else if(r===Ft)ee(this,"onclosearray"),this.depth--,this.state=this.stack.pop()||xt.VALUE;else{if(ie(r))continue;oe(this,"Bad array")}continue;case xt.STRING:void 0===this.textNode&&(this.textNode="");var o=e-1,i=this.slashed,s=this.unicodeI;t:for(;;){for(mt&&console.log(e,r,Ot[this.state],i);s>0;)if(this.unicodeS+=String.fromCharCode(r),r=t.charCodeAt(e++),this.position++,4===s?(this.textNode+=String.fromCharCode(parseInt(this.unicodeS,16)),s=0,o=e-1):s++,!r)break t;if(r===Et&&!i){this.state=this.stack.pop()||xt.VALUE,this.textNode+=t.substring(o,e-1),this.position+=e-1-o;break}if(r===Tt&&!i&&(i=!0,this.textNode+=t.substring(o,e-1),this.position+=e-1-o,r=t.charCodeAt(e++),this.position++,!r))break;if(i){if(i=!1,r===Vt?this.textNode+="\n":r===Kt?this.textNode+="\r":r===qt?this.textNode+="\t":r===Gt?this.textNode+="\f":r===Jt?this.textNode+="\b":r===Xt?(s=1,this.unicodeS=""):this.textNode+=String.fromCharCode(r),r=t.charCodeAt(e++),this.position++,o=e-1,r)continue;break}Qt.lastIndex=e;var a=Qt.exec(t);if(null===a){e=t.length+1,this.textNode+=t.substring(o,e-1),this.position+=e-1-o;break}if(e=a.index+1,!(r=t.charCodeAt(a.index))){this.textNode+=t.substring(o,e-1),this.position+=e-1-o;break}}this.slashed=i,this.unicodeI=s;continue;case xt.TRUE:r===Kt?this.state=xt.TRUE2:oe(this,"Invalid true started with t"+r);continue;case xt.TRUE2:r===Xt?this.state=xt.TRUE3:oe(this,"Invalid true started with tr"+r);continue;case xt.TRUE3:r===zt?(te(this,"onvalue",!0),this.state=this.stack.pop()||xt.VALUE):oe(this,"Invalid true started with tru"+r);continue;case xt.FALSE:r===Dt?this.state=xt.FALSE2:oe(this,"Invalid false started with f"+r);continue;case xt.FALSE2:r===Yt?this.state=xt.FALSE3:oe(this,"Invalid false started with fa"+r);continue;case xt.FALSE3:r===$t?this.state=xt.FALSE4:oe(this,"Invalid false started with fal"+r);continue;case xt.FALSE4:r===zt?(te(this,"onvalue",!1),this.state=this.stack.pop()||xt.VALUE):oe(this,"Invalid false started with fals"+r);continue;case xt.NULL:r===Xt?this.state=xt.NULL2:oe(this,"Invalid null started with n"+r);continue;case xt.NULL2:r===Yt?this.state=xt.NULL3:oe(this,"Invalid null started with nu"+r);continue;case xt.NULL3:r===Yt?(te(this,"onvalue",null),this.state=this.stack.pop()||xt.VALUE):oe(this,"Invalid null started with nul"+r);continue;case xt.NUMBER_DECIMAL_POINT:r===It?(this.numberNode+=".",this.state=xt.NUMBER_DIGIT):oe(this,"Leading zero not followed by .");continue;case xt.NUMBER_DIGIT:Nt<=r&&r<=Rt?this.numberNode+=String.fromCharCode(r):r===It?(-1!==this.numberNode.indexOf(".")&&oe(this,"Invalid number has two dots"),this.numberNode+="."):r===zt||r===Bt?(-1===this.numberNode.indexOf("e")&&-1===this.numberNode.indexOf("E")||oe(this,"Invalid number has two exponential"),this.numberNode+="e"):r===St||r===Ct?(n!==zt&&n!==Bt&&oe(this,"Invalid symbol in number"),this.numberNode+=String.fromCharCode(r)):(ne(this),e--,this.state=this.stack.pop()||xt.VALUE);continue;default:oe(this,"Unknown state: "+this.state)}return this.position>=this.bufferCheckPosition&&function(t){var e=Math.max(bt,10),r=0;for(var n in wt){var o=void 0===t[n]?0:t[n].length;if(o>e)switch(n){case"text":closeText(t);break;default:oe(t,"Max buffer length exceeded: "+n)}r=Math.max(r,o)}t.bufferCheckPosition=bt-r+t.position}(this),te(this,"onchunkparsed"),this}}]),t}();function te(t,e,r){mt&&console.log("-- emit",e,r),t[e]&&t[e](r,t)}function ee(t,e,r){re(t),te(t,e,r)}function re(t,e){t.textNode=function(t,e){if(void 0===e)return e;t.trim&&(e=e.trim());t.normalize&&(e=e.replace(/\s+/g," "));return e}(t.options,t.textNode),void 0!==t.textNode&&te(t,e||"onvalue",t.textNode),t.textNode=void 0}function ne(t){t.numberNode&&te(t,"onvalue",parseFloat(t.numberNode)),t.numberNode=""}function oe(t,e){return re(t),e+="\nLine: "+t.line+"\nColumn: "+t.column+"\nChar: "+t.c,e=new Error(e),t.error=e,te(t,"onerror",e),t}function ie(t){return t===At||t===kt||t===Pt||t===_t}function se(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return ae(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ae(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,a=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return s=t.done,t},e:function(t){a=!0,i=t},f:function(){try{s||null==r.return||r.return()}finally{if(a)throw i}}}}function ae(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var ue=function(){function t(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(l()(this,t),o()(this,"path",void 0),this.path=["$"],r instanceof t)this.path=I()(r.path);else if(Array.isArray(r))(e=this.path).push.apply(e,I()(r));else if("string"==typeof r&&(this.path=r.split("."),"$"!==this.path[0]))throw new Error("JSONPaths must start with $")}return f()(t,[{key:"clone",value:function(){return new t(this)}},{key:"toString",value:function(){return this.path.join(".")}},{key:"push",value:function(t){this.path.push(t)}},{key:"pop",value:function(){return this.path.pop()}},{key:"set",value:function(t){this.path[this.path.length-1]=t}},{key:"equals",value:function(t){if(!this||!t||this.path.length!==t.path.length)return!1;for(var e=0;e<this.path.length;++e)if(this.path[e]!==t.path[e])return!1;return!0}},{key:"setFieldAtPath",value:function(t,e){var r=I()(this.path);r.shift();var n,o=r.pop(),i=se(r);try{for(i.s();!(n=i.n()).done;){t=t[n.value]}}catch(t){i.e(t)}finally{i.f()}t[o]=e}},{key:"getFieldAtPath",value:function(t){var e=I()(this.path);e.shift();var r,n=e.pop(),o=se(e);try{for(o.s();!(r=o.n()).done;){t=t[r.value]}}catch(t){o.e(t)}finally{o.f()}return t[n]}}]),t}();function ce(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return le(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return le(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,a=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return s=t.done,t},e:function(t){a=!0,i=t},f:function(){try{s||null==r.return||r.return()}finally{if(a)throw i}}}}function le(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function he(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=gt()(t);if(e){var o=gt()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return yt()(this,r)}}var fe=function(t){pt()(r,t);var e=he(r);function r(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};l()(this,r),t=e.call(this),o()(ct()(t),"jsonPaths",void 0),o()(ct()(t),"streamingJsonPath",null),o()(ct()(t),"streamingArray",null),o()(ct()(t),"topLevelObject",null);var i=n.jsonpaths||[];return t.jsonPaths=i.map((function(t){return new ue(t)})),t._extendParser(),t}return f()(r,[{key:"write",value:function(t){ht()(gt()(r.prototype),"write",this).call(this,t);var e=[];return this.streamingArray&&(e=I()(this.streamingArray),this.streamingArray.length=0),e}},{key:"getPartialResult",value:function(){return this.topLevelObject}},{key:"getStreamingJsonPath",value:function(){return this.streamingJsonPath}},{key:"getStreamingJsonPathAsString",value:function(){return this.streamingJsonPath&&this.streamingJsonPath.toString()}},{key:"getJsonPath",value:function(){return this.jsonpath}},{key:"_matchJSONPath",value:function(){var t=this.getJsonPath();if(0===this.jsonPaths.length)return!0;var e,r=ce(this.jsonPaths);try{for(r.s();!(e=r.n()).done;){if(e.value.equals(t))return!0}}catch(t){r.e(t)}finally{r.f()}return!1}},{key:"_extendParser",value:function(){var t=this;this.parser.onopenarray=function(){if(!t.streamingArray&&t._matchJSONPath())return t.streamingJsonPath=t.getJsonPath().clone(),t.streamingArray=[],void t._openArray(t.streamingArray);t._openArray()},this.parser.onopenobject=function(e){t.topLevelObject?t._openObject({}):(t.topLevelObject={},t._openObject(t.topLevelObject)),void 0!==e&&t.parser.onkey(e)}}}]),r}(function(){function t(){l()(this,t),o()(this,"jsonpath",void 0),o()(this,"_parser",void 0),this.reset(),this._initializeParser()}return f()(t,[{key:"reset",value:function(){this.result=void 0,this.previousStates=[],this.currentState=Object.freeze({container:[],key:null}),this.jsonpath=new ue}},{key:"write",value:function(t){this.parser.write(t)}},{key:"close",value:function(){this.parser.close()}},{key:"_pushOrSet",value:function(t){var e=this.currentState,r=e.container,n=e.key;null!==n?(r[n]=t,this.currentState.key=null):r.push(t)}},{key:"_openArray",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.jsonpath.push(null),this._pushOrSet(t),this.previousStates.push(this.currentState),this.currentState={container:t,isArray:!0,key:null}}},{key:"_closeArray",value:function(){this.jsonpath.pop(),this.currentState=this.previousStates.pop()}},{key:"_openObject",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.jsonpath.push(null),this._pushOrSet(t),this.previousStates.push(this.currentState),this.currentState={container:t,isArray:!1,key:null}}},{key:"_closeObject",value:function(){this.jsonpath.pop(),this.currentState=this.previousStates.pop()}},{key:"_initializeParser",value:function(){var t=this;this._parser=new Zt({onready:function(){t.jsonpath=new ue,t.previousStates.length=0,t.currentState.container.length=0},onopenobject:function(e){t._openObject({}),void 0!==e&&t.parser.onkey(e)},onkey:function(e){t.jsonpath.set(e),t.currentState.key=e},oncloseobject:function(){t._closeObject()},onopenarray:function(){t._openArray()},onclosearray:function(){t._closeArray()},onvalue:function(e){t._pushOrSet(e)},onerror:function(t){throw t},onend:function(){t.result=t.currentState.container.pop()}})}},{key:"parser",get:function(){return this._parser}}]),t}());function pe(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return de(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return de(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,a=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return s=t.done,t},e:function(t){a=!0,i=t},f:function(){try{s||null==r.return||r.return()}finally{if(a)throw i}}}}function de(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function ye(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function ve(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ye(Object(r),!0).forEach((function(e){o()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ye(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function ge(){return(ge=E()(u.a.mark((function t(e,r){var n,o,i,s,a,c,l,h,f,p,d,y,v,g,b,m,w,x,O,j,_,k,P,E,S,C,I;return u.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:o=st(e),i=r.metadata,s=r.json||{},a=s.jsonpaths,c=!0,null,l=(null==r||null===(n=r.json)||void 0===n?void 0:n.shape)||"row-table",h=new it(null,ve(ve({},r),{},{shape:l})),f=new fe({jsonpaths:a}),p=!0,d=!1,t.prev=10,v=L()(o);case 12:return t.next=14,A()(v.next());case 14:return g=t.sent,p=g.done,t.next=18,A()(g.value);case 18:if(b=t.sent,p){t.next=57;break}if(m=b,w=f.write(m),x=w.length>0&&f.getStreamingJsonPathAsString(),!(w.length>0&&c)){t.next=29;break}if(!i){t.next=28;break}return O={shape:l,batchType:"partial-result",data:[],length:0,bytesUsed:0,container:f.getPartialResult(),jsonpath:x},t.next=28,O;case 28:c=!1;case 29:j=pe(w),t.prev=30,j.s();case 32:if((_=j.n()).done){t.next=41;break}if(k=_.value,h.addRow(k),!(P=h.getFullBatch({jsonpath:x}))){t.next=39;break}return t.next=39,P;case 39:t.next=32;break;case 41:t.next=46;break;case 43:t.prev=43,t.t0=t.catch(30),j.e(t.t0);case 46:return t.prev=46,j.f(),t.finish(46);case 49:if(h.chunkComplete(m),!(E=h.getFullBatch({jsonpath:x}))){t.next=54;break}return t.next=54,E;case 54:p=!0,t.next=12;break;case 57:t.next=63;break;case 59:t.prev=59,t.t1=t.catch(10),d=!0,y=t.t1;case 63:if(t.prev=63,t.prev=64,p||null==v.return){t.next=68;break}return t.next=68,A()(v.return());case 68:if(t.prev=68,!d){t.next=71;break}throw y;case 71:return t.finish(68);case 72:return t.finish(63);case 73:if(S=f.getStreamingJsonPathAsString(),!(C=h.getFinalBatch({jsonpath:S}))){t.next=78;break}return t.next=78,C;case 78:if(!i){t.next=82;break}return I={shape:l,batchType:"final-result",container:f.getPartialResult(),jsonpath:f.getStreamingJsonPathAsString(),data:[],length:0},t.next=82,I;case 82:case"end":return t.stop()}}),t,null,[[10,59,63,73],[30,43,46,49],[64,,68,72]])})))).apply(this,arguments)}function be(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function me(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?be(Object(r),!0).forEach((function(e){o()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):be(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var we,xe={geojson:{shape:"object-row-table"},json:{jsonpaths:["$","$.features"]},gis:{format:"geojson"}},Oe=me(me({},{name:"GeoJSON",id:"geojson",module:"geojson",version:"3.1.0-alpha.5",worker:!0,extensions:["geojson"],mimeTypes:["application/geo+json"],category:"geometry",text:!0,options:xe}),{},{parse:function(t,e){return je.apply(this,arguments)},parseTextSync:_e,parseInBatches:function(t,e){(e=me(me({},xe),e)).json=me(me({},xe.geojson),e.geojson);var r=function(t,e){return ge.apply(this,arguments)}(t,e);switch(e.gis.format){case"binary":return function(t){return ke.apply(this,arguments)}(r);default:return r}}});function je(){return(je=s()(u.a.mark((function t(e,r){return u.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",_e((new TextDecoder).decode(e),r));case 1:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function _e(t,e){(e=me(me({},xe),e)).json=me(me({},xe.geojson),e.geojson),e.gis=e.gis||{};var r=H(t,e);switch(e.gis.format){case"binary":return U(r);default:return r}}function ke(){return(ke=E()(u.a.mark((function t(e){var r,n,o,i,s,a,c;return u.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=!0,n=!1,t.prev=2,i=L()(e);case 4:return t.next=6,A()(i.next());case 6:return s=t.sent,r=s.done,t.next=10,A()(s.value);case 10:if(a=t.sent,r){t.next=19;break}return(c=a).data=U(c.data),t.next=16,c;case 16:r=!0,t.next=4;break;case 19:t.next=25;break;case 21:t.prev=21,t.t0=t.catch(2),n=!0,o=t.t0;case 25:if(t.prev=25,t.prev=26,r||null==i.return){t.next=30;break}return t.next=30,A()(i.return());case 30:if(t.prev=30,!n){t.next=33;break}throw o;case 33:return t.finish(30);case 34:return t.finish(25);case 35:case"end":return t.stop()}}),t,null,[[2,21,25,35],[26,,30,34]])})))).apply(this,arguments)}we=Oe,"undefined"!=typeof self&&(g.onmessage=function(){var t=s()(u.a.mark((function t(e,r){var n,o,i,s,a;return u.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:t.t0=e,t.next="process"===t.t0?3:16;break;case 3:return t.prev=3,n=r.input,o=r.options,i=void 0===o?{}:o,t.next=7,j({loader:we,arrayBuffer:n,options:i,context:{parse:O}});case 7:s=t.sent,g.postMessage("done",{result:s}),t.next=15;break;case 11:t.prev=11,t.t1=t.catch(3),a=t.t1 instanceof Error?t.t1.message:"",g.postMessage("error",{error:a});case 15:return t.abrupt("break",16);case 16:case"end":return t.stop()}}),t,null,[[3,11]])})));return function(e,r){return t.apply(this,arguments)}}())}]);
|
|
2
2
|
//# sourceMappingURL=geojson-worker.js.map
|