@loaders.gl/flatgeobuf 3.1.0-alpha.5 → 3.1.0-beta.4
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/bundle.d.ts.map +1 -0
- package/dist/bundle.js +4346 -0
- package/dist/es5/flatgeobuf-loader.js +1 -1
- package/dist/es5/flatgeobuf-loader.js.map +1 -1
- package/dist/esm/flatgeobuf-loader.js +1 -1
- package/dist/esm/flatgeobuf-loader.js.map +1 -1
- package/dist/flatgeobuf-loader.d.ts +1 -0
- package/dist/flatgeobuf-loader.d.ts.map +1 -0
- package/dist/flatgeobuf-loader.js +20 -0
- package/dist/flatgeobuf-worker.js +4459 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +33 -0
- package/dist/lib/parse-flatgeobuf.d.ts +1 -0
- package/dist/lib/parse-flatgeobuf.d.ts.map +1 -0
- package/dist/lib/parse-flatgeobuf.js +31 -0
- package/dist/workers/flatgeobuf-worker.d.ts +1 -0
- package/dist/workers/flatgeobuf-worker.d.ts.map +1 -0
- package/dist/workers/flatgeobuf-worker.js +5 -0
- package/package.json +5 -6
- package/dist/dist.min.js +0 -2
- package/dist/dist.min.js.map +0 -1
- package/dist/flatgeobuf-worker.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAC,gBAAgB,IAAI,sBAAsB,EAAC,MAAM,qBAAqB,CAAC;AAC/E,OAAO,eAAe,EAAE,EAAC,wBAAwB,EAAC,MAAM,wBAAwB,CAAC;AAEjF,OAAO,EAAC,sBAAsB,EAAC,CAAC;AAEhC,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;CAM5B,CAAC;AAEF,eAAO,MAAM,0BAA0B,EAAE,gBAAmC,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
exports._typecheckFlatGeobufLoader = exports.FlatGeobufLoader = exports.FlatGeobufWorkerLoader = void 0;
|
|
23
|
+
const flatgeobuf_loader_1 = require("./flatgeobuf-loader");
|
|
24
|
+
Object.defineProperty(exports, "FlatGeobufWorkerLoader", { enumerable: true, get: function () { return flatgeobuf_loader_1.FlatGeobufLoader; } });
|
|
25
|
+
const parse_flatgeobuf_1 = __importStar(require("./lib/parse-flatgeobuf"));
|
|
26
|
+
exports.FlatGeobufLoader = {
|
|
27
|
+
...flatgeobuf_loader_1.FlatGeobufLoader,
|
|
28
|
+
parse: async (arrayBuffer, options) => (0, parse_flatgeobuf_1.default)(arrayBuffer, options),
|
|
29
|
+
parseSync: parse_flatgeobuf_1.default,
|
|
30
|
+
parseInBatchesFromStream: parse_flatgeobuf_1.parseFlatGeobufInBatches,
|
|
31
|
+
binary: true
|
|
32
|
+
};
|
|
33
|
+
exports._typecheckFlatGeobufLoader = exports.FlatGeobufLoader;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse-flatgeobuf.d.ts","sourceRoot":"","sources":["../../src/lib/parse-flatgeobuf.ts"],"names":[],"mappings":"AASA,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,KAAK,KAAA,EAAE,OAAO,KAAA,OAQrD;AAQD,wBAAgB,wBAAwB,CAAC,MAAM,KAAA,EAAE,OAAO,KAAA,OAGvD"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseFlatGeobufInBatches = void 0;
|
|
4
|
+
// import {deserialize} from 'flatgeobuf/lib/geojson/featurecollection';
|
|
5
|
+
const flatgeobuf_geojson_min_1 = require("flatgeobuf/dist/flatgeobuf-geojson.min");
|
|
6
|
+
/*
|
|
7
|
+
* Parse FlatGeobuf arrayBuffer and return GeoJSON.
|
|
8
|
+
*
|
|
9
|
+
* @param {arrayBuffer} _ A FlatGeobuf arrayBuffer
|
|
10
|
+
* @return {?Object} A GeoJSON geometry object
|
|
11
|
+
*/
|
|
12
|
+
function parseFlatGeobuf(input, options) {
|
|
13
|
+
if (input.byteLength === 0) {
|
|
14
|
+
return [];
|
|
15
|
+
}
|
|
16
|
+
const arr = new Uint8Array(input);
|
|
17
|
+
const { features } = (0, flatgeobuf_geojson_min_1.deserialize)(arr);
|
|
18
|
+
return features;
|
|
19
|
+
}
|
|
20
|
+
exports.default = parseFlatGeobuf;
|
|
21
|
+
/*
|
|
22
|
+
* Parse FlatGeobuf arrayBuffer and return GeoJSON.
|
|
23
|
+
*
|
|
24
|
+
* @param {ReadableStream} _ A FlatGeobuf arrayBuffer
|
|
25
|
+
* @return A GeoJSON geometry object iterator
|
|
26
|
+
*/
|
|
27
|
+
function parseFlatGeobufInBatches(stream, options) {
|
|
28
|
+
const iterator = (0, flatgeobuf_geojson_min_1.deserializeStream)(stream);
|
|
29
|
+
return iterator;
|
|
30
|
+
}
|
|
31
|
+
exports.parseFlatGeobufInBatches = parseFlatGeobufInBatches;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flatgeobuf-worker.d.ts","sourceRoot":"","sources":["../../src/workers/flatgeobuf-worker.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@loaders.gl/flatgeobuf",
|
|
3
3
|
"description": "Loader for FlatGeobuf",
|
|
4
|
-
"version": "3.1.0-
|
|
4
|
+
"version": "3.1.0-beta.4",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
@@ -28,16 +28,15 @@
|
|
|
28
28
|
],
|
|
29
29
|
"scripts": {
|
|
30
30
|
"pre-build": "npm run build-worker && npm run build-worker --env.dev && npm run build-bundle",
|
|
31
|
-
"
|
|
32
|
-
"build-worker": "
|
|
33
|
-
"build-bundle": "webpack --display=minimal --config ../../scripts/webpack/bundle.js"
|
|
31
|
+
"build-bundle": "esbuild src/bundle.ts --bundle --outfile=dist/bundle.js",
|
|
32
|
+
"build-worker": "esbuild src/workers/flatgeobuf-worker.ts --bundle --outfile=dist/flatgeobuf-worker.js"
|
|
34
33
|
},
|
|
35
34
|
"dependencies": {
|
|
36
|
-
"@loaders.gl/loader-utils": "3.1.0-
|
|
35
|
+
"@loaders.gl/loader-utils": "3.1.0-beta.4",
|
|
37
36
|
"flatgeobuf": "~3.1.0"
|
|
38
37
|
},
|
|
39
38
|
"devDependencies": {
|
|
40
39
|
"esm": "^3.2.25"
|
|
41
40
|
},
|
|
42
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "5c7c74215416b30fcea98f5cecc820c8a21023b3"
|
|
43
42
|
}
|
package/dist/dist.min.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var r=e();for(var n in r)("object"==typeof exports?exports:t)[n]=r[n]}}(window,(function(){return 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}return 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=1)}([function(t,e,r){!function(t,e){"use strict";class r{constructor(t,e){this.name=t,this.type=e}}var n;!function(t){t[t.Byte=0]="Byte",t[t.UByte=1]="UByte",t[t.Bool=2]="Bool",t[t.Short=3]="Short",t[t.UShort=4]="UShort",t[t.Int=5]="Int",t[t.UInt=6]="UInt",t[t.Long=7]="Long",t[t.ULong=8]="ULong",t[t.Float=9]="Float",t[t.Double=10]="Double",t[t.String=11]="String",t[t.Json=12]="Json",t[t.DateTime=13]="DateTime",t[t.Binary=14]="Binary"}(n||(n={}));var o=n;class i{constructor(t,e,r){this.geometryType=t,this.columns=e,this.featuresCount=r}}var s,a,u,l,c={SIZEOF_SHORT:2,SIZEOF_INT:4,FILE_IDENTIFIER_LENGTH:4,SIZE_PREFIX_LENGTH:4,Encoding:{UTF8_BYTES:1,UTF16_STRING:2}};c.int32=new Int32Array(2),c.float32=new Float32Array(c.int32.buffer),c.float64=new Float64Array(c.int32.buffer),c.isLittleEndian=1===new Uint16Array(new Uint8Array([1,0]).buffer)[0],c.Long=function(t,e){this.low=0|t,this.high=0|e},c.Long.create=function(t,e){return 0==t&&0==e?c.Long.ZERO:new c.Long(t,e)},c.Long.prototype.toFloat64=function(){return(this.low>>>0)+4294967296*this.high},c.Long.prototype.equals=function(t){return this.low==t.low&&this.high==t.high},c.Long.ZERO=new c.Long(0,0),c.Builder=function(t){if(t)e=t;else var e=1024;this.bb=c.ByteBuffer.allocate(e),this.space=e,this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1},c.Builder.prototype.clear=function(){this.bb.clear(),this.space=this.bb.capacity(),this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1},c.Builder.prototype.forceDefaults=function(t){this.force_defaults=t},c.Builder.prototype.dataBuffer=function(){return this.bb},c.Builder.prototype.asUint8Array=function(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())},c.Builder.prototype.prep=function(t,e){t>this.minalign&&(this.minalign=t);for(var r=1+~(this.bb.capacity()-this.space+e)&t-1;this.space<r+t+e;){var n=this.bb.capacity();this.bb=c.Builder.growByteBuffer(this.bb),this.space+=this.bb.capacity()-n}this.pad(r)},c.Builder.prototype.pad=function(t){for(var e=0;e<t;e++)this.bb.writeInt8(--this.space,0)},c.Builder.prototype.writeInt8=function(t){this.bb.writeInt8(this.space-=1,t)},c.Builder.prototype.writeInt16=function(t){this.bb.writeInt16(this.space-=2,t)},c.Builder.prototype.writeInt32=function(t){this.bb.writeInt32(this.space-=4,t)},c.Builder.prototype.writeInt64=function(t){this.bb.writeInt64(this.space-=8,t)},c.Builder.prototype.writeFloat32=function(t){this.bb.writeFloat32(this.space-=4,t)},c.Builder.prototype.writeFloat64=function(t){this.bb.writeFloat64(this.space-=8,t)},c.Builder.prototype.addInt8=function(t){this.prep(1,0),this.writeInt8(t)},c.Builder.prototype.addInt16=function(t){this.prep(2,0),this.writeInt16(t)},c.Builder.prototype.addInt32=function(t){this.prep(4,0),this.writeInt32(t)},c.Builder.prototype.addInt64=function(t){this.prep(8,0),this.writeInt64(t)},c.Builder.prototype.addFloat32=function(t){this.prep(4,0),this.writeFloat32(t)},c.Builder.prototype.addFloat64=function(t){this.prep(8,0),this.writeFloat64(t)},c.Builder.prototype.addFieldInt8=function(t,e,r){(this.force_defaults||e!=r)&&(this.addInt8(e),this.slot(t))},c.Builder.prototype.addFieldInt16=function(t,e,r){(this.force_defaults||e!=r)&&(this.addInt16(e),this.slot(t))},c.Builder.prototype.addFieldInt32=function(t,e,r){(this.force_defaults||e!=r)&&(this.addInt32(e),this.slot(t))},c.Builder.prototype.addFieldInt64=function(t,e,r){!this.force_defaults&&e.equals(r)||(this.addInt64(e),this.slot(t))},c.Builder.prototype.addFieldFloat32=function(t,e,r){(this.force_defaults||e!=r)&&(this.addFloat32(e),this.slot(t))},c.Builder.prototype.addFieldFloat64=function(t,e,r){(this.force_defaults||e!=r)&&(this.addFloat64(e),this.slot(t))},c.Builder.prototype.addFieldOffset=function(t,e,r){(this.force_defaults||e!=r)&&(this.addOffset(e),this.slot(t))},c.Builder.prototype.addFieldStruct=function(t,e,r){e!=r&&(this.nested(e),this.slot(t))},c.Builder.prototype.nested=function(t){if(t!=this.offset())throw new Error("FlatBuffers: struct must be serialized inline.")},c.Builder.prototype.notNested=function(){if(this.isNested)throw new Error("FlatBuffers: object serialization must not be nested.")},c.Builder.prototype.slot=function(t){this.vtable[t]=this.offset()},c.Builder.prototype.offset=function(){return this.bb.capacity()-this.space},c.Builder.growByteBuffer=function(t){var e=t.capacity();if(3221225472&e)throw new Error("FlatBuffers: cannot grow buffer beyond 2 gigabytes.");var r=e<<1,n=c.ByteBuffer.allocate(r);return n.setPosition(r-e),n.bytes().set(t.bytes(),r-e),n},c.Builder.prototype.addOffset=function(t){this.prep(c.SIZEOF_INT,0),this.writeInt32(this.offset()-t+c.SIZEOF_INT)},c.Builder.prototype.startObject=function(t){this.notNested(),null==this.vtable&&(this.vtable=[]),this.vtable_in_use=t;for(var e=0;e<t;e++)this.vtable[e]=0;this.isNested=!0,this.object_start=this.offset()},c.Builder.prototype.endObject=function(){if(null==this.vtable||!this.isNested)throw new Error("FlatBuffers: endObject called without startObject");this.addInt32(0);for(var t=this.offset(),e=this.vtable_in_use-1;e>=0&&0==this.vtable[e];e--);for(var r=e+1;e>=0;e--)this.addInt16(0!=this.vtable[e]?t-this.vtable[e]:0);this.addInt16(t-this.object_start);var n=(r+2)*c.SIZEOF_SHORT;this.addInt16(n);var o=0,i=this.space;t:for(e=0;e<this.vtables.length;e++){var s=this.bb.capacity()-this.vtables[e];if(n==this.bb.readInt16(s)){for(var a=c.SIZEOF_SHORT;a<n;a+=c.SIZEOF_SHORT)if(this.bb.readInt16(i+a)!=this.bb.readInt16(s+a))continue t;o=this.vtables[e];break}}return o?(this.space=this.bb.capacity()-t,this.bb.writeInt32(this.space,o-t)):(this.vtables.push(this.offset()),this.bb.writeInt32(this.bb.capacity()-t,this.offset()-t)),this.isNested=!1,t},c.Builder.prototype.finish=function(t,e,r){var n=r?c.SIZE_PREFIX_LENGTH:0;if(e){var o=e;if(this.prep(this.minalign,c.SIZEOF_INT+c.FILE_IDENTIFIER_LENGTH+n),o.length!=c.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: file identifier must be length "+c.FILE_IDENTIFIER_LENGTH);for(var i=c.FILE_IDENTIFIER_LENGTH-1;i>=0;i--)this.writeInt8(o.charCodeAt(i))}this.prep(this.minalign,c.SIZEOF_INT+n),this.addOffset(t),n&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)},c.Builder.prototype.finishSizePrefixed=function(t,e){this.finish(t,e,!0)},c.Builder.prototype.requiredField=function(t,e){var r=this.bb.capacity()-t,n=r-this.bb.readInt32(r);if(0==this.bb.readInt16(n+e))throw new Error("FlatBuffers: field "+e+" must be set")},c.Builder.prototype.startVector=function(t,e,r){this.notNested(),this.vector_num_elems=e,this.prep(c.SIZEOF_INT,t*e),this.prep(r,t*e)},c.Builder.prototype.endVector=function(){return this.writeInt32(this.vector_num_elems),this.offset()},c.Builder.prototype.createString=function(t){if(t instanceof Uint8Array)var e=t;else{e=[];for(var r=0;r<t.length;){var n,o=t.charCodeAt(r++);(n=o<55296||o>=56320?o:(o<<10)+t.charCodeAt(r++)+-56613888)<128?e.push(n):(n<2048?e.push(n>>6&31|192):(n<65536?e.push(n>>12&15|224):e.push(n>>18&7|240,n>>12&63|128),e.push(n>>6&63|128)),e.push(63&n|128))}}this.addInt8(0),this.startVector(1,e.length,1),this.bb.setPosition(this.space-=e.length),r=0;for(var i=this.space,s=this.bb.bytes();r<e.length;r++)s[i++]=e[r];return this.endVector()},c.Builder.prototype.createLong=function(t,e){return c.Long.create(t,e)},c.ByteBuffer=function(t){this.bytes_=t,this.position_=0},c.ByteBuffer.allocate=function(t){return new c.ByteBuffer(new Uint8Array(t))},c.ByteBuffer.prototype.clear=function(){this.position_=0},c.ByteBuffer.prototype.bytes=function(){return this.bytes_},c.ByteBuffer.prototype.position=function(){return this.position_},c.ByteBuffer.prototype.setPosition=function(t){this.position_=t},c.ByteBuffer.prototype.capacity=function(){return this.bytes_.length},c.ByteBuffer.prototype.readInt8=function(t){return this.readUint8(t)<<24>>24},c.ByteBuffer.prototype.readUint8=function(t){return this.bytes_[t]},c.ByteBuffer.prototype.readInt16=function(t){return this.readUint16(t)<<16>>16},c.ByteBuffer.prototype.readUint16=function(t){return this.bytes_[t]|this.bytes_[t+1]<<8},c.ByteBuffer.prototype.readInt32=function(t){return this.bytes_[t]|this.bytes_[t+1]<<8|this.bytes_[t+2]<<16|this.bytes_[t+3]<<24},c.ByteBuffer.prototype.readUint32=function(t){return this.readInt32(t)>>>0},c.ByteBuffer.prototype.readInt64=function(t){return new c.Long(this.readInt32(t),this.readInt32(t+4))},c.ByteBuffer.prototype.readUint64=function(t){return new c.Long(this.readUint32(t),this.readUint32(t+4))},c.ByteBuffer.prototype.readFloat32=function(t){return c.int32[0]=this.readInt32(t),c.float32[0]},c.ByteBuffer.prototype.readFloat64=function(t){return c.int32[c.isLittleEndian?0:1]=this.readInt32(t),c.int32[c.isLittleEndian?1:0]=this.readInt32(t+4),c.float64[0]},c.ByteBuffer.prototype.writeInt8=function(t,e){this.bytes_[t]=e},c.ByteBuffer.prototype.writeUint8=function(t,e){this.bytes_[t]=e},c.ByteBuffer.prototype.writeInt16=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8},c.ByteBuffer.prototype.writeUint16=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8},c.ByteBuffer.prototype.writeInt32=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8,this.bytes_[t+2]=e>>16,this.bytes_[t+3]=e>>24},c.ByteBuffer.prototype.writeUint32=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8,this.bytes_[t+2]=e>>16,this.bytes_[t+3]=e>>24},c.ByteBuffer.prototype.writeInt64=function(t,e){this.writeInt32(t,e.low),this.writeInt32(t+4,e.high)},c.ByteBuffer.prototype.writeUint64=function(t,e){this.writeUint32(t,e.low),this.writeUint32(t+4,e.high)},c.ByteBuffer.prototype.writeFloat32=function(t,e){c.float32[0]=e,this.writeInt32(t,c.int32[0])},c.ByteBuffer.prototype.writeFloat64=function(t,e){c.float64[0]=e,this.writeInt32(t,c.int32[c.isLittleEndian?0:1]),this.writeInt32(t+4,c.int32[c.isLittleEndian?1:0])},c.ByteBuffer.prototype.getBufferIdentifier=function(){if(this.bytes_.length<this.position_+c.SIZEOF_INT+c.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: ByteBuffer is too short to contain an identifier.");for(var t="",e=0;e<c.FILE_IDENTIFIER_LENGTH;e++)t+=String.fromCharCode(this.readInt8(this.position_+c.SIZEOF_INT+e));return t},c.ByteBuffer.prototype.__offset=function(t,e){var r=t-this.readInt32(t);return e<this.readInt16(r)?this.readInt16(r+e):0},c.ByteBuffer.prototype.__union=function(t,e){return t.bb_pos=e+this.readInt32(e),t.bb=this,t},c.ByteBuffer.prototype.__string=function(t,e){t+=this.readInt32(t);var r=this.readInt32(t),n="",o=0;if(t+=c.SIZEOF_INT,e===c.Encoding.UTF8_BYTES)return this.bytes_.subarray(t,t+r);for(;o<r;){var i,s=this.readUint8(t+o++);if(s<192)i=s;else{var a=this.readUint8(t+o++);if(s<224)i=(31&s)<<6|63&a;else{var u=this.readUint8(t+o++);i=s<240?(15&s)<<12|(63&a)<<6|63&u:(7&s)<<18|(63&a)<<12|(63&u)<<6|63&this.readUint8(t+o++)}}i<65536?n+=String.fromCharCode(i):(i-=65536,n+=String.fromCharCode(55296+(i>>10),56320+(1023&i)))}return n},c.ByteBuffer.prototype.__indirect=function(t){return t+this.readInt32(t)},c.ByteBuffer.prototype.__vector=function(t){return t+this.readInt32(t)+c.SIZEOF_INT},c.ByteBuffer.prototype.__vector_len=function(t){return this.readInt32(t+this.readInt32(t))},c.ByteBuffer.prototype.__has_identifier=function(t){if(t.length!=c.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: file identifier must be length "+c.FILE_IDENTIFIER_LENGTH);for(var e=0;e<c.FILE_IDENTIFIER_LENGTH;e++)if(t.charCodeAt(e)!=this.readInt8(this.position_+c.SIZEOF_INT+e))return!1;return!0},c.ByteBuffer.prototype.createLong=function(t,e){return c.Long.create(t,e)},function(t){t[t.Unknown=0]="Unknown",t[t.Point=1]="Point",t[t.LineString=2]="LineString",t[t.Polygon=3]="Polygon",t[t.MultiPoint=4]="MultiPoint",t[t.MultiLineString=5]="MultiLineString",t[t.MultiPolygon=6]="MultiPolygon",t[t.GeometryCollection=7]="GeometryCollection",t[t.CircularString=8]="CircularString",t[t.CompoundCurve=9]="CompoundCurve",t[t.CurvePolygon=10]="CurvePolygon",t[t.MultiCurve=11]="MultiCurve",t[t.MultiSurface=12]="MultiSurface",t[t.Curve=13]="Curve",t[t.Surface=14]="Surface",t[t.PolyhedralSurface=15]="PolyhedralSurface",t[t.TIN=16]="TIN",t[t.Triangle=17]="Triangle"}(s||(s={})),function(t){t[t.Byte=0]="Byte",t[t.UByte=1]="UByte",t[t.Bool=2]="Bool",t[t.Short=3]="Short",t[t.UShort=4]="UShort",t[t.Int=5]="Int",t[t.UInt=6]="UInt",t[t.Long=7]="Long",t[t.ULong=8]="ULong",t[t.Float=9]="Float",t[t.Double=10]="Double",t[t.String=11]="String",t[t.Json=12]="Json",t[t.DateTime=13]="DateTime",t[t.Binary=14]="Binary"}(a||(a={}));class f{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRoot(t,e){return(e||new f).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRoot(t,e){return t.setPosition(t.position()+c.SIZE_PREFIX_LENGTH),(e||new f).__init(t.readInt32(t.position())+t.position(),t)}name(t){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}type(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readUint8(this.bb_pos+t):a.Byte}static start(t){t.startObject(2)}static addName(t,e){t.addFieldOffset(0,e,0)}static addType(t,e){t.addFieldInt8(1,e,a.Byte)}static end(t){var e=t.endObject();return t.requiredField(e,4),e}static create(t,e,r){return f.start(t),f.addName(t,e),f.addType(t,r),f.end(t)}}class d{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRoot(t,e){return(e||new d).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRoot(t,e){return t.setPosition(t.position()+c.SIZE_PREFIX_LENGTH),(e||new d).__init(t.readInt32(t.position())+t.position(),t)}ends(t){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readUint32(this.bb.__vector(this.bb_pos+e)+4*t):0}endsLength(){var t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__vector_len(this.bb_pos+t):0}endsArray(){var t=this.bb.__offset(this.bb_pos,4);return t?new Uint32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}xy(t){var e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readFloat64(this.bb.__vector(this.bb_pos+e)+8*t):0}xyLength(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}xyArray(){var t=this.bb.__offset(this.bb_pos,6);return t?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}z(t){var e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readFloat64(this.bb.__vector(this.bb_pos+e)+8*t):0}zLength(){var t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}zArray(){var t=this.bb.__offset(this.bb_pos,8);return t?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}m(t){var e=this.bb.__offset(this.bb_pos,10);return e?this.bb.readFloat64(this.bb.__vector(this.bb_pos+e)+8*t):0}mLength(){var t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__vector_len(this.bb_pos+t):0}mArray(){var t=this.bb.__offset(this.bb_pos,10);return t?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}t(t){var e=this.bb.__offset(this.bb_pos,12);return e?this.bb.readFloat64(this.bb.__vector(this.bb_pos+e)+8*t):0}tLength(){var t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}tArray(){var t=this.bb.__offset(this.bb_pos,12);return t?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}tm(t){var e=this.bb.__offset(this.bb_pos,14);return e?this.bb.readUint64(this.bb.__vector(this.bb_pos+e)+8*t):this.bb.createLong(0,0)}tmLength(){var t=this.bb.__offset(this.bb_pos,14);return t?this.bb.__vector_len(this.bb_pos+t):0}type(){var t=this.bb.__offset(this.bb_pos,16);return t?this.bb.readUint8(this.bb_pos+t):s.Unknown}parts(t,e){var r=this.bb.__offset(this.bb_pos,18);return r?(e||new d).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*t),this.bb):null}partsLength(){var t=this.bb.__offset(this.bb_pos,18);return t?this.bb.__vector_len(this.bb_pos+t):0}static start(t){t.startObject(8)}static addEnds(t,e){t.addFieldOffset(0,e,0)}static createEndsVector(t,e){t.startVector(4,e.length,4);for(var r=e.length-1;r>=0;r--)t.addInt32(e[r]);return t.endVector()}static startEndsVector(t,e){t.startVector(4,e,4)}static addXy(t,e){t.addFieldOffset(1,e,0)}static createXyVector(t,e){t.startVector(8,e.length,8);for(var r=e.length-1;r>=0;r--)t.addFloat64(e[r]);return t.endVector()}static startXyVector(t,e){t.startVector(8,e,8)}static addZ(t,e){t.addFieldOffset(2,e,0)}static createZVector(t,e){t.startVector(8,e.length,8);for(var r=e.length-1;r>=0;r--)t.addFloat64(e[r]);return t.endVector()}static startZVector(t,e){t.startVector(8,e,8)}static addM(t,e){t.addFieldOffset(3,e,0)}static createMVector(t,e){t.startVector(8,e.length,8);for(var r=e.length-1;r>=0;r--)t.addFloat64(e[r]);return t.endVector()}static startMVector(t,e){t.startVector(8,e,8)}static addT(t,e){t.addFieldOffset(4,e,0)}static createTVector(t,e){t.startVector(8,e.length,8);for(var r=e.length-1;r>=0;r--)t.addFloat64(e[r]);return t.endVector()}static startTVector(t,e){t.startVector(8,e,8)}static addTm(t,e){t.addFieldOffset(5,e,0)}static createTmVector(t,e){t.startVector(8,e.length,8);for(var r=e.length-1;r>=0;r--)t.addInt64(e[r]);return t.endVector()}static startTmVector(t,e){t.startVector(8,e,8)}static addType(t,e){t.addFieldInt8(6,e,s.Unknown)}static addParts(t,e){t.addFieldOffset(7,e,0)}static createPartsVector(t,e){t.startVector(4,e.length,4);for(var r=e.length-1;r>=0;r--)t.addOffset(e[r]);return t.endVector()}static startPartsVector(t,e){t.startVector(4,e,4)}static end(t){return t.endObject()}static create(t,e,r,n,o,i,s,a,u){return d.start(t),d.addEnds(t,e),d.addXy(t,r),d.addZ(t,n),d.addM(t,o),d.addT(t,i),d.addTm(t,s),d.addType(t,a),d.addParts(t,u),d.end(t)}}class b{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRoot(t,e){return(e||new b).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRoot(t,e){return t.setPosition(t.position()+c.SIZE_PREFIX_LENGTH),(e||new b).__init(t.readInt32(t.position())+t.position(),t)}geometry(t){var e=this.bb.__offset(this.bb_pos,4);return e?(t||new d).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}properties(t){var e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readUint8(this.bb.__vector(this.bb_pos+e)+t):0}propertiesLength(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}propertiesArray(){var t=this.bb.__offset(this.bb_pos,6);return t?new Uint8Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}columns(t,e){var r=this.bb.__offset(this.bb_pos,8);return r?(e||new f).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*t),this.bb):null}columnsLength(){var t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}static start(t){t.startObject(3)}static addGeometry(t,e){t.addFieldOffset(0,e,0)}static addProperties(t,e){t.addFieldOffset(1,e,0)}static createPropertiesVector(t,e){t.startVector(1,e.length,1);for(var r=e.length-1;r>=0;r--)t.addInt8(e[r]);return t.endVector()}static startPropertiesVector(t,e){t.startVector(1,e,1)}static addColumns(t,e){t.addFieldOffset(2,e,0)}static createColumnsVector(t,e){t.startVector(4,e.length,4);for(var r=e.length-1;r>=0;r--)t.addOffset(e[r]);return t.endVector()}static startColumnsVector(t,e){t.startVector(4,e,4)}static end(t){return t.endObject()}static finishBuffer(t,e){t.finish(e)}static finishSizePrefixedBuffer(t,e){t.finish(e,void 0,!0)}static create(t,e,r,n){return b.start(t),b.addGeometry(t,e),b.addProperties(t,r),b.addColumns(t,n),b.end(t)}}!function(t){t[t.Unknown=0]="Unknown",t[t.Point=1]="Point",t[t.LineString=2]="LineString",t[t.Polygon=3]="Polygon",t[t.MultiPoint=4]="MultiPoint",t[t.MultiLineString=5]="MultiLineString",t[t.MultiPolygon=6]="MultiPolygon",t[t.GeometryCollection=7]="GeometryCollection",t[t.CircularString=8]="CircularString",t[t.CompoundCurve=9]="CompoundCurve",t[t.CurvePolygon=10]="CurvePolygon",t[t.MultiCurve=11]="MultiCurve",t[t.MultiSurface=12]="MultiSurface",t[t.Curve=13]="Curve",t[t.Surface=14]="Surface",t[t.PolyhedralSurface=15]="PolyhedralSurface",t[t.TIN=16]="TIN",t[t.Triangle=17]="Triangle"}(u||(u={})),function(t){t[t.Byte=0]="Byte",t[t.UByte=1]="UByte",t[t.Bool=2]="Bool",t[t.Short=3]="Short",t[t.UShort=4]="UShort",t[t.Int=5]="Int",t[t.UInt=6]="UInt",t[t.Long=7]="Long",t[t.ULong=8]="ULong",t[t.Float=9]="Float",t[t.Double=10]="Double",t[t.String=11]="String",t[t.Json=12]="Json",t[t.DateTime=13]="DateTime",t[t.Binary=14]="Binary"}(l||(l={}));class h{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRoot(t,e){return(e||new h).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRoot(t,e){return t.setPosition(t.position()+c.SIZE_PREFIX_LENGTH),(e||new h).__init(t.readInt32(t.position())+t.position(),t)}name(t){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}type(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readUint8(this.bb_pos+t):l.Byte}static start(t){t.startObject(2)}static addName(t,e){t.addFieldOffset(0,e,0)}static addType(t,e){t.addFieldInt8(1,e,l.Byte)}static end(t){var e=t.endObject();return t.requiredField(e,4),e}static create(t,e,r){return h.start(t),h.addName(t,e),h.addType(t,r),h.end(t)}}class _{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRoot(t,e){return(e||new _).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRoot(t,e){return t.setPosition(t.position()+c.SIZE_PREFIX_LENGTH),(e||new _).__init(t.readInt32(t.position())+t.position(),t)}org(t){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}code(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt32(this.bb_pos+t):0}name(t){var e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__string(this.bb_pos+e,t):null}description(t){var e=this.bb.__offset(this.bb_pos,10);return e?this.bb.__string(this.bb_pos+e,t):null}wkt(t){var e=this.bb.__offset(this.bb_pos,12);return e?this.bb.__string(this.bb_pos+e,t):null}static start(t){t.startObject(5)}static addOrg(t,e){t.addFieldOffset(0,e,0)}static addCode(t,e){t.addFieldInt32(1,e,0)}static addName(t,e){t.addFieldOffset(2,e,0)}static addDescription(t,e){t.addFieldOffset(3,e,0)}static addWkt(t,e){t.addFieldOffset(4,e,0)}static end(t){return t.endObject()}static create(t,e,r,n,o,i){return _.start(t),_.addOrg(t,e),_.addCode(t,r),_.addName(t,n),_.addDescription(t,o),_.addWkt(t,i),_.end(t)}}class p{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRoot(t,e){return(e||new p).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRoot(t,e){return t.setPosition(t.position()+c.SIZE_PREFIX_LENGTH),(e||new p).__init(t.readInt32(t.position())+t.position(),t)}name(t){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}envelope(t){var e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readFloat64(this.bb.__vector(this.bb_pos+e)+8*t):0}envelopeLength(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}envelopeArray(){var t=this.bb.__offset(this.bb_pos,6);return t?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}geometryType(){var t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readUint8(this.bb_pos+t):u.Unknown}hasZ(){var t=this.bb.__offset(this.bb_pos,10);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}hasM(){var t=this.bb.__offset(this.bb_pos,12);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}hasT(){var t=this.bb.__offset(this.bb_pos,14);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}hasTM(){var t=this.bb.__offset(this.bb_pos,16);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}columns(t,e){var r=this.bb.__offset(this.bb_pos,18);return r?(e||new h).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*t),this.bb):null}columnsLength(){var t=this.bb.__offset(this.bb_pos,18);return t?this.bb.__vector_len(this.bb_pos+t):0}featuresCount(){var t=this.bb.__offset(this.bb_pos,20);return t?this.bb.readUint64(this.bb_pos+t):this.bb.createLong(0,0)}indexNodeSize(){var t=this.bb.__offset(this.bb_pos,22);return t?this.bb.readUint16(this.bb_pos+t):16}crs(t){var e=this.bb.__offset(this.bb_pos,24);return e?(t||new _).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}static start(t){t.startObject(11)}static addName(t,e){t.addFieldOffset(0,e,0)}static addEnvelope(t,e){t.addFieldOffset(1,e,0)}static createEnvelopeVector(t,e){t.startVector(8,e.length,8);for(var r=e.length-1;r>=0;r--)t.addFloat64(e[r]);return t.endVector()}static startEnvelopeVector(t,e){t.startVector(8,e,8)}static addGeometryType(t,e){t.addFieldInt8(2,e,u.Unknown)}static addHasZ(t,e){t.addFieldInt8(3,+e,0)}static addHasM(t,e){t.addFieldInt8(4,+e,0)}static addHasT(t,e){t.addFieldInt8(5,+e,0)}static addHasTM(t,e){t.addFieldInt8(6,+e,0)}static addColumns(t,e){t.addFieldOffset(7,e,0)}static createColumnsVector(t,e){t.startVector(4,e.length,4);for(var r=e.length-1;r>=0;r--)t.addOffset(e[r]);return t.endVector()}static startColumnsVector(t,e){t.startVector(4,e,4)}static addFeaturesCount(t,e){t.addFieldInt64(8,e,t.createLong(0,0))}static addIndexNodeSize(t,e){t.addFieldInt16(9,e,16)}static addCrs(t,e){t.addFieldOffset(10,e,0)}static end(t){return t.endObject()}static finishBuffer(t,e){t.finish(e)}static finishSizePrefixedBuffer(t,e){t.finish(e,void 0,!0)}static create(t,e,r,n,o,i,s,a,u,l,c,f){return p.start(t),p.addName(t,e),p.addEnvelope(t,r),p.addGeometryType(t,n),p.addHasZ(t,o),p.addHasM(t,i),p.addHasT(t,s),p.addHasTM(t,a),p.addColumns(t,u),p.addFeaturesCount(t,l),p.addIndexNodeSize(t,c),p.addCrs(t,f),p.end(t)}}function y(t){return t.reduce((t,e)=>Array.isArray(e)?t.concat(y(e)):t.concat(e),[])}function v(t){const e=[];for(let r=0;r<t.length;r+=2)e.push([t[r],t[r+1]]);return e}function m(t){return u[t]}function g(t){const e=t.coordinates;let r=null,n=null,o=null,i=m(t.type),s=0;switch(t.type){case"Point":r=e;break;case"MultiPoint":case"LineString":r=y(e);break;case"MultiLineString":case"Polygon":const i=e;r=y(i),i.length>1&&(n=i.map(t=>s+=t.length));break;case"MultiPolygon":o=e.map(t=>({type:"Polygon",coordinates:t})).map(g);break;case"GeometryCollection":o=t.geometries.map(g)}return{xy:r,ends:n,type:i,parts:o}}function w(t,e){if(e==u.GeometryCollection){const r=[];for(let e=0;e<t.partsLength();e++){const n=t.parts(e),o=n.type();r.push(w(n,o))}return{type:u[e],geometries:r}}if(e==u.MultiPolygon){const r=[];for(let e=0;e<t.partsLength();e++){const n=t.parts(e);r.push(w(n,u.Polygon))}return{type:u[e],coordinates:r.map(t=>t.coordinates)}}const r=function(t,e){const r=t.xyArray();switch(e){case u.Point:return Array.from(r);case u.MultiPoint:case u.LineString:return v(r);case u.MultiLineString:case u.Polygon:return function(t,e){if(!e||0===e.length)return[v(t)];let r=0;return Array.from(e).map(e=>t.slice(r,r=e<<1)).map(t=>v(t))}(r,t.endsArray())}}(t,e);return{type:u[e],coordinates:r}}function S(t,e){const r=e.columns;let n;n=w(t.geometry(),e.geometryType);const i=function(t,e){if(!e||0===e.length)return;const r=t.propertiesArray(),n=new DataView(r.buffer,r.byteOffset),i=t.propertiesLength();let s=0;const a={};for(;s<i;){const t=n.getUint16(s,!0);s+=2;const i=e[t];switch(i.type){case o.Bool:a[i.name]=!!n.getUint8(s),s+=1;break;case o.Byte:a[i.name]=n.getInt8(s),s+=1;break;case o.UByte:a[i.name]=n.getUint8(s),s+=1;break;case o.Short:a[i.name]=n.getInt16(s,!0),s+=2;break;case o.UShort:a[i.name]=n.getUint16(s,!0),s+=2;break;case o.Int:a[i.name]=n.getInt32(s,!0),s+=4;break;case o.UInt:a[i.name]=n.getUint32(s,!0),s+=4;break;case o.Long:a[i.name]=Number(n.getBigInt64(s,!0)),s+=8;break;case o.ULong:a[i.name]=Number(n.getBigUint64(s,!0)),s+=8;break;case o.Double:a[i.name]=n.getFloat64(s,!0),s+=8;break;case o.DateTime:case o.String:{const t=n.getUint32(s,!0);s+=4;const e=new TextDecoder;a[i.name]=e.decode(r.subarray(s,s+t)),s+=t;break}default:throw new Error("Unknown type "+i.type)}}return a}(t,r),s={type:"Feature",geometry:n};return i&&(s.properties=i),s}function I(t){var e;if("undefined"!=typeof Symbol){if(Symbol.asyncIterator&&null!=(e=t[Symbol.asyncIterator]))return e.call(t);if(Symbol.iterator&&null!=(e=t[Symbol.iterator]))return e.call(t)}throw new TypeError("Object is not async iterable")}function B(t){this.wrapped=t}function T(t){var e,r;function n(e,r){try{var i=t[e](r),s=i.value,a=s instanceof B;Promise.resolve(a?s.wrapped:s).then((function(t){a?n("return"===e?"return":"next",t):o(i.done?"return":"normal",t)}),(function(t){n("throw",t)}))}catch(t){o("throw",t)}}function o(t,o){switch(t){case"return":e.resolve({value:o,done:!0});break;case"throw":e.reject(o);break;default:e.resolve({value:o,done:!1})}(e=e.next)?n(e.key,e.arg):r=null}this._invoke=function(t,o){return new Promise((function(i,s){var a={key:t,arg:o,resolve:i,reject:s,next:null};r?r=r.next=a:(e=r=a,n(t,o))}))},"function"!=typeof t.return&&(this.return=void 0)}function E(t){return function(){return new T(t.apply(this,arguments))}}function R(t){return new B(t)}"function"==typeof Symbol&&Symbol.asyncIterator&&(T.prototype[Symbol.asyncIterator]=function(){return this}),T.prototype.next=function(t){return this._invoke("next",t)},T.prototype.throw=function(t){return this._invoke("throw",t)},T.prototype.return=function(t){return this._invoke("return",t)};var P=new Uint8Array(0);function F(t,e){if(!t.length)return e;if(!e.length)return t;var r=new Uint8Array(t.length+e.length);return r.set(t),r.set(e,t.length),r}function O(t){this._source=t,this._array=P,this._index=0}function C(t,e){e=Math.min(Math.max(+e,2),65535);let r=t,n=r;do{r=Math.ceil(r/e),n+=r}while(1!==r);return 40*n}function A(t,e){if(e<2)throw new Error("Node size must be at least 2");if(0===t)throw new Error("Number of items must be greater than 0");let r=t,n=r;const o=[r];do{r=Math.ceil(r/e),n+=r,o.push(r)}while(1!==r);const i=[];r=n;for(let t of o)i.push(r-t),r-=t;i.reverse(),o.reverse();const s=[];for(let t=0;t<o.length;t++)s.push([i[t],i[t]+o[t]]);return s.reverse(),s}function q(t,e,r,n){return L.apply(this,arguments)}function L(){return(L=E((function*(t,e,r,n){const{minX:o,minY:i,maxX:s,maxY:a}=r,u=A(t,e),[[l,c]]=u,f=[];for(f.push([0,u.length-1]);0!==f.length;){const[r,d]=f.pop(),b=r>=c-t,[,h]=u[d],_=Math.min(r+e,h),p=_-r,y=yield R(n(40*r,40*p)),v=new Float64Array(y),m=new Uint32Array(y);for(let t=r;t<_;t++){const e=5*(t-r);if(s<v[e+0])continue;if(a<v[e+1])continue;if(o>v[e+2])continue;if(i>v[e+3])continue;const n=m[8+(e<<1)];b?yield[n,t-l]:f.push([n,d-1])}f.sort((t,e)=>e[0]-t[0])}}))).apply(this,arguments)}O.prototype.read=function(){var t=this,e=t._array.subarray(t._index);return t._source.read().then((function(r){return t._array=P,t._index=0,r.done?e.length>0?{done:!1,value:e}:{done:!0,value:void 0}:{done:!1,value:F(e,r.value)}}))},O.prototype.slice=function(t){if((t|=0)<0)throw new Error("invalid length");var e=this,r=this._array.length-this._index;if(this._index+t<=this._array.length)return Promise.resolve(this._array.subarray(this._index,this._index+=t));var n=new Uint8Array(t);return n.set(this._array.subarray(this._index)),function o(){return e._source.read().then((function(i){return i.done?(e._array=P,e._index=0,r>0?n.subarray(0,r):null):r+i.value.length>=t?(e._array=i.value,e._index=t-r,n.set(i.value.subarray(0,t-r),r),n):(n.set(i.value,r),r+=i.value.length,o())}))}()},O.prototype.cancel=function(){return this._source.cancel()};const k=new Uint8Array([102,103,98,3,102,103,98,0]);function U(t,e,r,n){return j.apply(this,arguments)}function j(){return(j=E((function*(t,e,n,o){let s=0,a=new Uint8Array(yield R(t(8)));if(s+=8,!a.every((t,e)=>k[e]===t))throw new Error("Not a FlatGeobuf file");a=new Uint8Array(yield R(t(4))),s+=4;let u=new c.ByteBuffer(a);const l=u.readUint32(0);a=new Uint8Array(yield R(t(l))),s+=l,u=new c.ByteBuffer(a);const f=p.getRoot(u),d=f.featuresCount().toFloat64(),b=[];for(let t=0;t<f.columnsLength();t++){const e=f.columns(t);b.push(new r(e.name(),e.type()))}const h=new i(f.geometryType(),b,d),_=f.indexNodeSize();if(_>0){const r=C(d,_);if(n){const i=async(r,n)=>(await e(s+r),await t(n)),a=[];var y,v=!0,m=!1;try{for(var g,w,S=I(q(d,_,n,i));v=(g=yield R(S.next())).done,w=yield R(g.value),!v;v=!0){let[t]=w;a.push(t)}}catch(t){m=!0,y=t}finally{try{v||null==S.return||(yield R(S.return()))}finally{if(m)throw y}}s+=r;var B,T=!0,E=!1;try{for(var P,F,O=I(a);T=(P=yield R(O.next())).done,F=yield R(P.value),!T;T=!0){let r=F;yield R(e(s+r)),yield z(t,h,o)}}catch(t){E=!0,B=t}finally{try{T||null==O.return||(yield R(O.return()))}finally{if(E)throw B}}return}e?yield R(e(s+r)):yield R(t(r)),s+=r}let A;for(;A=yield R(z(t,h,o));)yield A}))).apply(this,arguments)}async function z(t,e,r){let n=new Uint8Array(await t(4));if(0===n.byteLength)return null;let o=new c.ByteBuffer(n);const i=o.readUint32(0);n=new Uint8Array(await t(i));const s=new Uint8Array(i+4);return s.set(n,4),o=new c.ByteBuffer(s),o.setPosition(4),r(b.getRoot(o),e)}function N(t){const e=function(t){const e=t.features[0],n=e.properties;let s=null;n&&(s=Object.keys(n).map(t=>new r(t,function(t){if("boolean"==typeof t)return o.Bool;if("number"==typeof t)return t%1==0?o.Int:o.Double;if("string"==typeof t)return o.String;if(null===t)return o.String;throw new Error(`Unknown type (value '${t}')`)}(n[t]))));const a=new Set;for(const r of t.features)a.add(e.geometry.type);return new i(m(e.geometry.type),s,t.features.length)}(t),n=function(t){const e=new c.Builder(0);let r=null;t.columns&&(r=p.createColumnsVector(e,t.columns.map(t=>function(t,e){const r=t.createString(e.name);return h.start(t),h.addName(t,r),h.addType(t,e.type),h.end(t)}(e,t))));const n=e.createString("L1");p.start(e),p.addFeaturesCount(e,new c.Long(t.featuresCount,0)),p.addGeometryType(e,t.geometryType),p.addIndexNodeSize(e,0),r&&p.addColumns(e,r),p.addName(e,n);const o=p.end(e);return e.finishSizePrefixed(o),e.asUint8Array()}(e),s=t.features.map(t=>function(t,e){const r=e.columns,n=new c.Builder(0),i=new Uint8Array(1e5);let s=0;if(r){const e=new DataView(i.buffer);for(let n=0;n<r.length;n++){const a=r[n],u=t.properties[a.name];if(null!==u)switch(e.setUint16(s,n,!0),s+=2,a.type){case o.Bool:e.setUint8(s,u),s+=1;break;case o.Short:e.setInt16(s,u,!0),s+=2;break;case o.UShort:e.setUint16(s,u,!0),s+=2;break;case o.Int:e.setInt32(s,u,!0),s+=4;break;case o.UInt:e.setUint32(s,u,!0),s+=4;break;case o.Long:e.setBigInt64(s,BigInt(u),!0),s+=8;break;case o.Long:e.setBigUint64(s,BigInt(u),!0),s+=8;break;case o.Double:e.setFloat64(s,u,!0),s+=8;break;case o.String:const t=u,r=(new TextEncoder).encode(t);e.setUint32(s,r.length,!0),s+=4,i.set(r,s),s+=r.length;break;default:throw new Error("Unknown type")}}}let a=null;s>0&&(a=b.createPropertiesVector(n,i.slice(0,s)));const u=function t(e,r){const{xy:n,ends:o,parts:i,type:s}=r;if(i){const r=i.map(r=>t(e,r)),n=d.createPartsVector(e,r);return d.start(e),d.addParts(e,n),d.end(e)}const a=d.createXyVector(e,n);let u=null;return o&&(u=d.createEndsVector(e,o)),d.start(e),u&&d.addEnds(e,u),d.addXy(e,a),d.addType(e,s),d.end(e)}(n,g(t.geometry));b.start(n),b.addGeometry(n,u),a&&b.addProperties(n,a);const l=b.end(n);return n.finishSizePrefixed(l),n.asUint8Array()}(t,e)),a=s.map(t=>t.length).reduce((t,e)=>t+e),u=new Uint8Array(k.length+n.length+a);u.set(n,k.length);let l=k.length+n.length;for(const t of s)u.set(t,l),l+=t.length;return u.set(k),u}function W(t){return{type:"FeatureCollection",features:function(t,e){if(!t.subarray(0,7).every((t,e)=>k[e]===t))throw new Error("Not a FlatGeobuf file");const n=new c.ByteBuffer(t),o=n.readUint32(k.length);n.setPosition(k.length+4);const s=p.getRoot(n),a=s.featuresCount().toFloat64(),u=[];for(let t=0;t<s.columnsLength();t++){const e=s.columns(t);u.push(new r(e.name(),e.type()))}const l=new i(s.geometryType(),u,0);let f=k.length+4+o;const d=s.indexNodeSize();d>0&&(f+=C(a,d));const h=[];for(;f<n.capacity();){const t=n.readUint32(f);n.setPosition(f+4);const r=b.getRoot(n);h.push(e(r,l)),f+=4+t}return h}(t,(t,e)=>S(t,e))}}function x(t,e){return function(t,e,r){let n=0;return U(async e=>{const r=await fetch(t,{headers:{Range:`bytes=${n}-${n+e-1}`}});return n+=e,await r.arrayBuffer()},async t=>{n=t},e,(t,e)=>S(t,e))}(t,e)}t.deserialize=function(t,r){return t instanceof Uint8Array?W(t):t instanceof e.ReadableStream?function(t,e){const r="function"==typeof(n=t).slice?n:new O("function"==typeof n.read?n:n.getReader());var n;return U(async t=>await r.slice(t),void 0,void 0,e)}(t,(t,e)=>S(t,e)):x(t,r)},t.serialize=function(t){return N(t)},Object.defineProperty(t,"__esModule",{value:!0})}(e,r(2))},function(t,e,r){const n=r(3);globalThis.loaders=globalThis.loaders||{},t.exports=Object.assign(globalThis.loaders,n)},function(t,e,r){"use strict";r.r(e),r.d(e,"ByteLengthQueuingStrategy",(function(){return He})),r.d(e,"CountQueuingStrategy",(function(){return Ze})),r.d(e,"ReadableStream",(function(){return je})),r.d(e,"TransformStream",(function(){return Xe})),r.d(e,"WritableStream",(function(){return st}));var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol:function(t){return"Symbol("+t+")"};function o(){}var i=Number.isNaN||function(t){return t!=t},s=o;function a(t){return"object"==typeof t&&null!==t||"function"==typeof t}function u(t){return t.slice()}function l(t){return!1!==function(t){if("number"!=typeof t)return!1;if(i(t))return!1;if(t<0)return!1;return!0}(t)&&t!==1/0}function c(t,e,r){if("function"!=typeof t)throw new TypeError("Argument is not a function");return Function.prototype.apply.call(t,e,r)}function f(t,e,r,n){var o=t[e];if(void 0!==o){if("function"!=typeof o)throw new TypeError(o+" is not a method");switch(r){case 0:return function(){return b(o,t,n)};case 1:return function(e){var r=[e].concat(n);return b(o,t,r)}}}return function(){return w(void 0)}}function d(t,e,r){var n=t[e];if(void 0!==n)return c(n,t,r)}function b(t,e,r){try{return w(c(t,e,r))}catch(t){return S(t)}}function h(t){if(t=Number(t),i(t)||t<0)throw new RangeError("highWaterMark property of a queuing strategy must be non-negative and non-NaN");return t}function _(t){if(void 0===t)return function(){return 1};if("function"!=typeof t)throw new TypeError("size property of a queuing strategy must be a function");return function(e){return t(e)}}var p=Promise,y=Promise.prototype.then,v=Promise.resolve.bind(p),m=Promise.reject.bind(p);function g(t){return new p(t)}function w(t){return v(t)}function S(t){return m(t)}function I(t,e,r){return y.call(t,e,r)}function B(t,e,r){I(I(t,e,r),void 0,s)}function T(t,e){B(t,e)}function E(t,e){B(t,void 0,e)}function R(t,e,r){return I(t,e,r)}function P(t){I(t,void 0,s)}var F=function(){function t(){this._cursor=0,this._size=0,this._front={_elements:[],_next:void 0},this._back=this._front,this._cursor=0,this._size=0}return Object.defineProperty(t.prototype,"length",{get:function(){return this._size},enumerable:!0,configurable:!0}),t.prototype.push=function(t){var e=this._back,r=e;16383===e._elements.length&&(r={_elements:[],_next:void 0}),e._elements.push(t),r!==e&&(this._back=r,e._next=r),++this._size},t.prototype.shift=function(){var t=this._front,e=t,r=this._cursor,n=r+1,o=t._elements,i=o[r];return 16384===n&&(e=t._next,n=0),--this._size,this._cursor=n,t!==e&&(this._front=e),o[r]=void 0,i},t.prototype.forEach=function(t){for(var e=this._cursor,r=this._front,n=r._elements;!(e===n.length&&void 0===r._next||e===n.length&&(e=0,0===(n=(r=r._next)._elements).length));)t(n[e]),++e},t.prototype.peek=function(){var t=this._front,e=this._cursor;return t._elements[e]},t}();function O(t,e,r){var n=null;!0===r&&(n=Object.prototype);var o=Object.create(n);return o.value=t,o.done=e,o}function C(t,e){t._forAuthorCode=!0,t._ownerReadableStream=e,e._reader=t,"readable"===e._state?k(t):"closed"===e._state?function(t){k(t),z(t)}(t):U(t,e._storedError)}function A(t,e){return Ve(t._ownerReadableStream,e)}function q(t){"readable"===t._ownerReadableStream._state?j(t,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")):function(t,e){U(t,e)}(t,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")),t._ownerReadableStream._reader=void 0,t._ownerReadableStream=void 0}function L(t){return new TypeError("Cannot "+t+" a stream using a released reader")}function k(t){t._closedPromise=g((function(e,r){t._closedPromise_resolve=e,t._closedPromise_reject=r}))}function U(t,e){k(t),j(t,e)}function j(t,e){P(t._closedPromise),t._closedPromise_reject(e),t._closedPromise_resolve=void 0,t._closedPromise_reject=void 0}function z(t){t._closedPromise_resolve(void 0),t._closedPromise_resolve=void 0,t._closedPromise_reject=void 0}var N=n("[[CancelSteps]]"),W=n("[[PullSteps]]");function x(t,e){void 0===e&&(e=!1);var r=new X(t);return r._forAuthorCode=e,r}function V(t){return g((function(e,r){var n={_resolve:e,_reject:r};t._reader._readRequests.push(n)}))}function M(t,e,r){var n=t._reader;n._readRequests.shift()._resolve(O(e,r,n._forAuthorCode))}function D(t){return t._reader._readRequests.length}function G(t){var e=t._reader;return void 0!==e&&!!Y(e)}var H,Z,X=function(){function t(t){if(!1===We(t))throw new TypeError("ReadableStreamDefaultReader can only be constructed with a ReadableStream instance");if(!0===xe(t))throw new TypeError("This stream has already been locked for exclusive reading by another reader");C(this,t),this._readRequests=new F}return Object.defineProperty(t.prototype,"closed",{get:function(){return Y(this)?this._closedPromise:S($("closed"))},enumerable:!0,configurable:!0}),t.prototype.cancel=function(t){return Y(this)?void 0===this._ownerReadableStream?S(L("cancel")):A(this,t):S($("cancel"))},t.prototype.read=function(){return Y(this)?void 0===this._ownerReadableStream?S(L("read from")):J(this):S($("read"))},t.prototype.releaseLock=function(){if(!Y(this))throw $("releaseLock");if(void 0!==this._ownerReadableStream){if(this._readRequests.length>0)throw new TypeError("Tried to release a reader lock when that reader has pending read() calls un-settled");q(this)}},t}();function Y(t){return!!a(t)&&!!Object.prototype.hasOwnProperty.call(t,"_readRequests")}function J(t){var e=t._ownerReadableStream;return e._disturbed=!0,"closed"===e._state?w(O(void 0,!0,t._forAuthorCode)):"errored"===e._state?S(e._storedError):e._readableStreamController[W]()}function $(t){return new TypeError("ReadableStreamDefaultReader.prototype."+t+" can only be used on a ReadableStreamDefaultReader")}"symbol"==typeof n.asyncIterator&&((H={})[n.asyncIterator]=function(){return this},Z=H,Object.defineProperty(Z,n.asyncIterator,{enumerable:!1}));var Q={next:function(){if(!1===K(this))return S(tt("next"));var t=this._asyncIteratorReader;return void 0===t._ownerReadableStream?S(L("iterate")):R(J(t),(function(e){var r=e.done;return r&&q(t),O(e.value,r,!0)}))},return:function(t){if(!1===K(this))return S(tt("next"));var e=this._asyncIteratorReader;if(void 0===e._ownerReadableStream)return S(L("finish iterating"));if(e._readRequests.length>0)return S(new TypeError("Tried to release a reader lock when that reader has pending read() calls un-settled"));if(!1===this._preventCancel){var r=A(e,t);return q(e),R(r,(function(){return O(t,!0,!0)}))}return q(e),w(O(t,!0,!0))}};function K(t){return!!a(t)&&!!Object.prototype.hasOwnProperty.call(t,"_asyncIteratorReader")}function tt(t){return new TypeError("ReadableStreamAsyncIterator."+t+" can only be used on a ReadableSteamAsyncIterator")}function et(t){var e=t._queue.shift();return t._queueTotalSize-=e.size,t._queueTotalSize<0&&(t._queueTotalSize=0),e.value}function rt(t,e,r){if(!l(r=Number(r)))throw new RangeError("Size must be a finite, non-NaN, non-negative number.");t._queue.push({value:e,size:r}),t._queueTotalSize+=r}function nt(t){t._queue=new F,t._queueTotalSize=0}void 0!==Z&&Object.setPrototypeOf(Q,Z),Object.defineProperty(Q,"next",{enumerable:!1}),Object.defineProperty(Q,"return",{enumerable:!1});var ot=n("[[AbortSteps]]"),it=n("[[ErrorSteps]]"),st=function(){function t(t,e){void 0===t&&(t={}),void 0===e&&(e={}),ut(this);var r=e.size,n=e.highWaterMark;if(void 0!==t.type)throw new RangeError("Invalid type is specified");var o=_(r);void 0===n&&(n=1),function(t,e,r,n){var o=Object.create(Et.prototype);var i=f(e,"write",1,[o]),s=f(e,"close",0,[]),a=f(e,"abort",1,[]);Rt(t,o,(function(){return d(e,"start",[o])}),i,s,a,r,n)}(this,t,n=h(n),o)}return Object.defineProperty(t.prototype,"locked",{get:function(){if(!1===lt(this))throw Lt("locked");return ct(this)},enumerable:!0,configurable:!0}),t.prototype.abort=function(t){return!1===lt(this)?S(Lt("abort")):!0===ct(this)?S(new TypeError("Cannot abort a stream that already has a writer")):ft(this,t)},t.prototype.close=function(){return!1===lt(this)?S(Lt("close")):!0===ct(this)?S(new TypeError("Cannot close a stream that already has a writer")):!0===pt(this)?S(new TypeError("Cannot close an already-closing stream")):dt(this)},t.prototype.getWriter=function(){if(!1===lt(this))throw Lt("getWriter");return at(this)},t}();function at(t){return new mt(t)}function ut(t){t._state="writable",t._storedError=void 0,t._writer=void 0,t._writableStreamController=void 0,t._writeRequests=new F,t._inFlightWriteRequest=void 0,t._closeRequest=void 0,t._inFlightCloseRequest=void 0,t._pendingAbortRequest=void 0,t._backpressure=!1}function lt(t){return!!a(t)&&!!Object.prototype.hasOwnProperty.call(t,"_writableStreamController")}function ct(t){return void 0!==t._writer}function ft(t,e){var r=t._state;if("closed"===r||"errored"===r)return w(void 0);if(void 0!==t._pendingAbortRequest)return t._pendingAbortRequest._promise;var n=!1;"erroring"===r&&(n=!0,e=void 0);var o=g((function(r,o){t._pendingAbortRequest={_promise:void 0,_resolve:r,_reject:o,_reason:e,_wasAlreadyErroring:n}}));return t._pendingAbortRequest._promise=o,!1===n&&ht(t,e),o}function dt(t){var e=t._state;if("closed"===e||"errored"===e)return S(new TypeError("The stream (in "+e+" state) is not in the writable state and cannot be closed"));var r,n=g((function(e,r){var n={_resolve:e,_reject:r};t._closeRequest=n})),o=t._writer;return void 0!==o&&!0===t._backpressure&&"writable"===e&&Gt(o),rt(r=t._writableStreamController,"close",0),Ot(r),n}function bt(t,e){"writable"!==t._state?_t(t):ht(t,e)}function ht(t,e){var r=t._writableStreamController;t._state="erroring",t._storedError=e;var n=t._writer;void 0!==n&&It(n,e),!1===function(t){if(void 0===t._inFlightWriteRequest&&void 0===t._inFlightCloseRequest)return!1;return!0}(t)&&!0===r._started&&_t(t)}function _t(t){t._state="errored",t._writableStreamController[it]();var e=t._storedError;if(t._writeRequests.forEach((function(t){t._reject(e)})),t._writeRequests=new F,void 0!==t._pendingAbortRequest){var r=t._pendingAbortRequest;if(t._pendingAbortRequest=void 0,!0===r._wasAlreadyErroring)return r._reject(e),void yt(t);B(t._writableStreamController[ot](r._reason),(function(){r._resolve(),yt(t)}),(function(e){r._reject(e),yt(t)}))}else yt(t)}function pt(t){return void 0!==t._closeRequest||void 0!==t._inFlightCloseRequest}function yt(t){void 0!==t._closeRequest&&(t._closeRequest._reject(t._storedError),t._closeRequest=void 0);var e=t._writer;void 0!==e&&Nt(e,t._storedError)}function vt(t,e){var r=t._writer;void 0!==r&&e!==t._backpressure&&(!0===e?function(t){xt(t)}(r):Gt(r)),t._backpressure=e}var mt=function(){function t(t){if(!1===lt(t))throw new TypeError("WritableStreamDefaultWriter can only be constructed with a WritableStream instance");if(!0===ct(t))throw new TypeError("This stream has already been locked for exclusive writing by another writer");this._ownerWritableStream=t,t._writer=this;var e,r=t._state;if("writable"===r)!1===pt(t)&&!0===t._backpressure?xt(this):Mt(this),jt(this);else if("erroring"===r)Vt(this,t._storedError),jt(this);else if("closed"===r)Mt(this),jt(e=this),Wt(e);else{var n=t._storedError;Vt(this,n),zt(this,n)}}return Object.defineProperty(t.prototype,"closed",{get:function(){return!1===gt(this)?S(kt("closed")):this._closedPromise},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"desiredSize",{get:function(){if(!1===gt(this))throw kt("desiredSize");if(void 0===this._ownerWritableStream)throw Ut("desiredSize");return function(t){var e=t._ownerWritableStream,r=e._state;if("errored"===r||"erroring"===r)return null;if("closed"===r)return 0;return Ft(e._writableStreamController)}(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ready",{get:function(){return!1===gt(this)?S(kt("ready")):this._readyPromise},enumerable:!0,configurable:!0}),t.prototype.abort=function(t){return!1===gt(this)?S(kt("abort")):void 0===this._ownerWritableStream?S(Ut("abort")):function(t,e){return ft(t._ownerWritableStream,e)}(this,t)},t.prototype.close=function(){if(!1===gt(this))return S(kt("close"));var t=this._ownerWritableStream;return void 0===t?S(Ut("close")):!0===pt(t)?S(new TypeError("Cannot close an already-closing stream")):wt(this)},t.prototype.releaseLock=function(){if(!1===gt(this))throw kt("releaseLock");void 0!==this._ownerWritableStream&&Bt(this)},t.prototype.write=function(t){return!1===gt(this)?S(kt("write")):void 0===this._ownerWritableStream?S(Ut("write to")):Tt(this,t)},t}();function gt(t){return!!a(t)&&!!Object.prototype.hasOwnProperty.call(t,"_ownerWritableStream")}function wt(t){return dt(t._ownerWritableStream)}function St(t,e){"pending"===t._closedPromiseState?Nt(t,e):function(t,e){zt(t,e)}(t,e)}function It(t,e){"pending"===t._readyPromiseState?Dt(t,e):function(t,e){Vt(t,e)}(t,e)}function Bt(t){var e=t._ownerWritableStream,r=new TypeError("Writer was released and can no longer be used to monitor the stream's closedness");It(t,r),St(t,r),e._writer=void 0,t._ownerWritableStream=void 0}function Tt(t,e){var r=t._ownerWritableStream,n=r._writableStreamController,o=function(t,e){try{return t._strategySizeAlgorithm(e)}catch(e){return Ct(t,e),1}}(n,e);if(r!==t._ownerWritableStream)return S(Ut("write to"));var i=r._state;if("errored"===i)return S(r._storedError);if(!0===pt(r)||"closed"===i)return S(new TypeError("The stream is closing or closed and cannot be written to"));if("erroring"===i)return S(r._storedError);var s=function(t){return g((function(e,r){var n={_resolve:e,_reject:r};t._writeRequests.push(n)}))}(r);return function(t,e,r){var n={chunk:e};try{rt(t,n,r)}catch(e){return void Ct(t,e)}var o=t._controlledWritableStream;if(!1===pt(o)&&"writable"===o._state){var i=At(t);vt(o,i)}Ot(t)}(n,e,o),s}var Et=function(){function t(){throw new TypeError("WritableStreamDefaultController cannot be constructed explicitly")}return t.prototype.error=function(t){if(!1===function(t){if(!a(t))return!1;if(!Object.prototype.hasOwnProperty.call(t,"_controlledWritableStream"))return!1;return!0}(this))throw new TypeError("WritableStreamDefaultController.prototype.error can only be used on a WritableStreamDefaultController");"writable"===this._controlledWritableStream._state&&qt(this,t)},t.prototype[ot]=function(t){var e=this._abortAlgorithm(t);return Pt(this),e},t.prototype[it]=function(){nt(this)},t}();function Rt(t,e,r,n,o,i,s,a){e._controlledWritableStream=t,t._writableStreamController=e,e._queue=void 0,e._queueTotalSize=void 0,nt(e),e._started=!1,e._strategySizeAlgorithm=a,e._strategyHWM=s,e._writeAlgorithm=n,e._closeAlgorithm=o,e._abortAlgorithm=i;var u=At(e);vt(t,u),B(w(r()),(function(){e._started=!0,Ot(e)}),(function(r){e._started=!0,bt(t,r)}))}function Pt(t){t._writeAlgorithm=void 0,t._closeAlgorithm=void 0,t._abortAlgorithm=void 0,t._strategySizeAlgorithm=void 0}function Ft(t){return t._strategyHWM-t._queueTotalSize}function Ot(t){var e=t._controlledWritableStream;if(!1!==t._started&&void 0===e._inFlightWriteRequest)if("erroring"!==e._state){if(0!==t._queue.length){var r=t._queue.peek().value;"close"===r?function(t){var e=t._controlledWritableStream;(function(t){t._inFlightCloseRequest=t._closeRequest,t._closeRequest=void 0})(e),et(t);var r=t._closeAlgorithm();Pt(t),B(r,(function(){!function(t){t._inFlightCloseRequest._resolve(void 0),t._inFlightCloseRequest=void 0,"erroring"===t._state&&(t._storedError=void 0,void 0!==t._pendingAbortRequest&&(t._pendingAbortRequest._resolve(),t._pendingAbortRequest=void 0)),t._state="closed";var e=t._writer;void 0!==e&&Wt(e)}(e)}),(function(t){!function(t,e){t._inFlightCloseRequest._reject(e),t._inFlightCloseRequest=void 0,void 0!==t._pendingAbortRequest&&(t._pendingAbortRequest._reject(e),t._pendingAbortRequest=void 0),bt(t,e)}(e,t)}))}(t):function(t,e){var r=t._controlledWritableStream;(function(t){t._inFlightWriteRequest=t._writeRequests.shift()})(r),B(t._writeAlgorithm(e),(function(){!function(t){t._inFlightWriteRequest._resolve(void 0),t._inFlightWriteRequest=void 0}(r);var e=r._state;if(et(t),!1===pt(r)&&"writable"===e){var n=At(t);vt(r,n)}Ot(t)}),(function(e){"writable"===r._state&&Pt(t),function(t,e){t._inFlightWriteRequest._reject(e),t._inFlightWriteRequest=void 0,bt(t,e)}(r,e)}))}(t,r.chunk)}}else _t(e)}function Ct(t,e){"writable"===t._controlledWritableStream._state&&qt(t,e)}function At(t){return Ft(t)<=0}function qt(t,e){var r=t._controlledWritableStream;Pt(t),ht(r,e)}function Lt(t){return new TypeError("WritableStream.prototype."+t+" can only be used on a WritableStream")}function kt(t){return new TypeError("WritableStreamDefaultWriter.prototype."+t+" can only be used on a WritableStreamDefaultWriter")}function Ut(t){return new TypeError("Cannot "+t+" a stream using a released writer")}function jt(t){t._closedPromise=g((function(e,r){t._closedPromise_resolve=e,t._closedPromise_reject=r,t._closedPromiseState="pending"}))}function zt(t,e){jt(t),Nt(t,e)}function Nt(t,e){P(t._closedPromise),t._closedPromise_reject(e),t._closedPromise_resolve=void 0,t._closedPromise_reject=void 0,t._closedPromiseState="rejected"}function Wt(t){t._closedPromise_resolve(void 0),t._closedPromise_resolve=void 0,t._closedPromise_reject=void 0,t._closedPromiseState="resolved"}function xt(t){t._readyPromise=g((function(e,r){t._readyPromise_resolve=e,t._readyPromise_reject=r})),t._readyPromiseState="pending"}function Vt(t,e){xt(t),Dt(t,e)}function Mt(t){xt(t),Gt(t)}function Dt(t,e){P(t._readyPromise),t._readyPromise_reject(e),t._readyPromise_resolve=void 0,t._readyPromise_reject=void 0,t._readyPromiseState="rejected"}function Gt(t){t._readyPromise_resolve(void 0),t._readyPromise_resolve=void 0,t._readyPromise_reject=void 0,t._readyPromiseState="fulfilled"}function Ht(t){if("object"!=typeof t||null===t)return!1;try{return"boolean"==typeof t.aborted}catch(t){return!1}}var Zt="undefined"!=typeof DOMException?DOMException:void 0;var Xt,Yt=function(t){if("function"!=typeof t&&"object"!=typeof t)return!1;try{return new t,!0}catch(t){return!1}}(Zt)?Zt:((Xt=function(t,e){this.message=t||"",this.name=e||"Error",Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}).prototype=Object.create(Error.prototype),Object.defineProperty(Xt.prototype,"constructor",{value:Xt,writable:!0,configurable:!0}),Xt);function Jt(t,e,r,n,i,s){var a=x(t),u=at(e);t._disturbed=!0;var l=!1,c=w(void 0);return g((function(f,d){var b,h,_,p;if(void 0!==s){if(b=function(){var r=new Yt("Aborted","AbortError"),o=[];!1===n&&o.push((function(){return"writable"===e._state?ft(e,r):w(void 0)})),!1===i&&o.push((function(){return"readable"===t._state?Ve(t,r):w(void 0)})),R((function(){return Promise.all(o.map((function(t){return t()})))}),!0,r)},!0===s.aborted)return void b();s.addEventListener("abort",b)}if(m(t,a._closedPromise,(function(t){!1===n?R((function(){return ft(e,t)}),!0,t):F(!0,t)})),m(e,u._closedPromise,(function(e){!1===i?R((function(){return Ve(t,e)}),!0,e):F(!0,e)})),h=t,_=a._closedPromise,p=function(){!1===r?R((function(){return function(t){var e=t._ownerWritableStream,r=e._state;return!0===pt(e)||"closed"===r?w(void 0):"errored"===r?S(e._storedError):wt(t)}(u)})):F()},"closed"===h._state?p():T(_,p),!0===pt(e)||"closed"===e._state){var y=new TypeError("the destination writable stream closed before all data could be piped to it");!1===i?R((function(){return Ve(t,y)}),!0,y):F(!0,y)}function v(){var t=c;return I(c,(function(){return t!==c?v():void 0}))}function m(t,e,r){"errored"===t._state?r(t._storedError):E(e,r)}function R(t,r,n){function o(){B(t(),(function(){return O(r,n)}),(function(t){return O(!0,t)}))}!0!==l&&(l=!0,"writable"===e._state&&!1===pt(e)?T(v(),o):o())}function F(t,r){!0!==l&&(l=!0,"writable"===e._state&&!1===pt(e)?T(v(),(function(){return O(t,r)})):O(t,r))}function O(t,e){Bt(u),q(a),void 0!==s&&s.removeEventListener("abort",b),t?d(e):f(void 0)}P(g((function(t,e){!function r(n){n?t():I(!0===l?w(!0):I(u._readyPromise,(function(){return I(J(a),(function(t){return!0===t.done||(c=I(Tt(u,t.value),void 0,o),!1)}))})),r,e)}(!1)})))}))}var $t=function(){function t(){throw new TypeError}return Object.defineProperty(t.prototype,"desiredSize",{get:function(){if(!1===Qt(this))throw ue("desiredSize");return ie(this)},enumerable:!0,configurable:!0}),t.prototype.close=function(){if(!1===Qt(this))throw ue("close");if(!1===se(this))throw new TypeError("The stream is not in a state that permits close");re(this)},t.prototype.enqueue=function(t){if(!1===Qt(this))throw ue("enqueue");if(!1===se(this))throw new TypeError("The stream is not in a state that permits enqueue");return ne(this,t)},t.prototype.error=function(t){if(!1===Qt(this))throw ue("error");oe(this,t)},t.prototype[N]=function(t){nt(this);var e=this._cancelAlgorithm(t);return ee(this),e},t.prototype[W]=function(){var t=this._controlledReadableStream;if(this._queue.length>0){var e=et(this);return!0===this._closeRequested&&0===this._queue.length?(ee(this),Me(t)):Kt(this),w(O(e,!1,t._reader._forAuthorCode))}var r=V(t);return Kt(this),r},t}();function Qt(t){return!!a(t)&&!!Object.prototype.hasOwnProperty.call(t,"_controlledReadableStream")}function Kt(t){!1!==te(t)&&(!0!==t._pulling?(t._pulling=!0,B(t._pullAlgorithm(),(function(){t._pulling=!1,!0===t._pullAgain&&(t._pullAgain=!1,Kt(t))}),(function(e){oe(t,e)}))):t._pullAgain=!0)}function te(t){var e=t._controlledReadableStream;return!1!==se(t)&&(!1!==t._started&&(!0===xe(e)&&D(e)>0||ie(t)>0))}function ee(t){t._pullAlgorithm=void 0,t._cancelAlgorithm=void 0,t._strategySizeAlgorithm=void 0}function re(t){var e=t._controlledReadableStream;t._closeRequested=!0,0===t._queue.length&&(ee(t),Me(e))}function ne(t,e){var r=t._controlledReadableStream;if(!0===xe(r)&&D(r)>0)M(r,e,!1);else{var n=void 0;try{n=t._strategySizeAlgorithm(e)}catch(e){throw oe(t,e),e}try{rt(t,e,n)}catch(e){throw oe(t,e),e}}Kt(t)}function oe(t,e){var r=t._controlledReadableStream;"readable"===r._state&&(nt(t),ee(t),De(r,e))}function ie(t){var e=t._controlledReadableStream._state;return"errored"===e?null:"closed"===e?0:t._strategyHWM-t._queueTotalSize}function se(t){var e=t._controlledReadableStream._state;return!1===t._closeRequested&&"readable"===e}function ae(t,e,r,n,o,i,s){e._controlledReadableStream=t,e._queue=void 0,e._queueTotalSize=void 0,nt(e),e._started=!1,e._closeRequested=!1,e._pullAgain=!1,e._pulling=!1,e._strategySizeAlgorithm=s,e._strategyHWM=i,e._pullAlgorithm=n,e._cancelAlgorithm=o,t._readableStreamController=e,B(w(r()),(function(){e._started=!0,Kt(e)}),(function(t){oe(e,t)}))}function ue(t){return new TypeError("ReadableStreamDefaultController.prototype."+t+" can only be used on a ReadableStreamDefaultController")}var le=Number.isInteger||function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t},ce=function(){function t(){throw new TypeError("ReadableStreamBYOBRequest cannot be used directly")}return Object.defineProperty(t.prototype,"view",{get:function(){if(!1===be(this))throw Fe("view");return this._view},enumerable:!0,configurable:!0}),t.prototype.respond=function(t){if(!1===be(this))throw Fe("respond");if(void 0===this._associatedReadableByteStreamController)throw new TypeError("This BYOB request has been invalidated");this._view.buffer,function(t,e){if(!1===l(e=Number(e)))throw new RangeError("bytesWritten must be a finite");Ie(t,e)}(this._associatedReadableByteStreamController,t)},t.prototype.respondWithNewView=function(t){if(!1===be(this))throw Fe("respond");if(void 0===this._associatedReadableByteStreamController)throw new TypeError("This BYOB request has been invalidated");if(!ArrayBuffer.isView(t))throw new TypeError("You can only respond with array buffer views");t.buffer,function(t,e){var r=t._pendingPullIntos.peek();if(r.byteOffset+r.bytesFilled!==e.byteOffset)throw new RangeError("The region specified by view does not match byobRequest");if(r.byteLength!==e.byteLength)throw new RangeError("The buffer of view has different capacity than byobRequest");r.buffer=e.buffer,Ie(t,e.byteLength)}(this._associatedReadableByteStreamController,t)},t}(),fe=function(){function t(){throw new TypeError("ReadableByteStreamController constructor cannot be used directly")}return Object.defineProperty(t.prototype,"byobRequest",{get:function(){if(!1===de(this))throw Oe("byobRequest");if(void 0===this._byobRequest&&this._pendingPullIntos.length>0){var t=this._pendingPullIntos.peek(),e=new Uint8Array(t.buffer,t.byteOffset+t.bytesFilled,t.byteLength-t.bytesFilled),r=Object.create(ce.prototype);!function(t,e,r){t._associatedReadableByteStreamController=e,t._view=r}(r,this,e),this._byobRequest=r}return this._byobRequest},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"desiredSize",{get:function(){if(!1===de(this))throw Oe("desiredSize");return Re(this)},enumerable:!0,configurable:!0}),t.prototype.close=function(){if(!1===de(this))throw Oe("close");if(!0===this._closeRequested)throw new TypeError("The stream has already been closed; do not close it again!");var t=this._controlledReadableByteStream._state;if("readable"!==t)throw new TypeError("The stream (in "+t+" state) is not in the readable state and cannot be closed");!function(t){var e=t._controlledReadableByteStream;if(t._queueTotalSize>0)return void(t._closeRequested=!0);if(t._pendingPullIntos.length>0){if(t._pendingPullIntos.peek().bytesFilled>0){var r=new TypeError("Insufficient bytes to fill elements in the given buffer");throw Ee(t,r),r}}Te(t),Me(e)}(this)},t.prototype.enqueue=function(t){if(!1===de(this))throw Oe("enqueue");if(!0===this._closeRequested)throw new TypeError("stream is closed or draining");var e=this._controlledReadableByteStream._state;if("readable"!==e)throw new TypeError("The stream (in "+e+" state) is not in the readable state and cannot be enqueued to");if(!ArrayBuffer.isView(t))throw new TypeError("You can only enqueue array buffer views when using a ReadableByteStreamController");t.buffer,function(t,e){var r=t._controlledReadableByteStream,n=e.buffer,o=e.byteOffset,i=e.byteLength,s=n;if(!0===G(r))if(0===D(r))ye(t,s,o,i);else{var a=new Uint8Array(s,o,i);M(r,a,!1)}else!0===qe(r)?(ye(t,s,o,i),Se(t)):ye(t,s,o,i);he(t)}(this,t)},t.prototype.error=function(t){if(!1===de(this))throw Oe("error");Ee(this,t)},t.prototype[N]=function(t){this._pendingPullIntos.length>0&&(this._pendingPullIntos.peek().bytesFilled=0);nt(this);var e=this._cancelAlgorithm(t);return Te(this),e},t.prototype[W]=function(){var t=this._controlledReadableByteStream;if(this._queueTotalSize>0){var e=this._queue.shift();this._queueTotalSize-=e.byteLength,ge(this);var r=void 0;try{r=new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}catch(t){return S(t)}return w(O(r,!1,t._reader._forAuthorCode))}var n=this._autoAllocateChunkSize;if(void 0!==n){var o=void 0;try{o=new ArrayBuffer(n)}catch(t){return S(t)}var i={buffer:o,byteOffset:0,byteLength:n,bytesFilled:0,elementSize:1,ctor:Uint8Array,readerType:"default"};this._pendingPullIntos.push(i)}var s=V(t);return he(this),s},t}();function de(t){return!!a(t)&&!!Object.prototype.hasOwnProperty.call(t,"_controlledReadableByteStream")}function be(t){return!!a(t)&&!!Object.prototype.hasOwnProperty.call(t,"_associatedReadableByteStreamController")}function he(t){!1!==function(t){var e=t._controlledReadableByteStream;if("readable"!==e._state)return!1;if(!0===t._closeRequested)return!1;if(!1===t._started)return!1;if(!0===G(e)&&D(e)>0)return!0;if(!0===qe(e)&&Ae(e)>0)return!0;if(Re(t)>0)return!0;return!1}(t)&&(!0!==t._pulling?(t._pulling=!0,B(t._pullAlgorithm(),(function(){t._pulling=!1,!0===t._pullAgain&&(t._pullAgain=!1,he(t))}),(function(e){Ee(t,e)}))):t._pullAgain=!0)}function _e(t,e){var r=!1;"closed"===t._state&&(r=!0);var n=pe(e);"default"===e.readerType?M(t,n,r):function(t,e,r){var n=t._reader;n._readIntoRequests.shift()._resolve(O(e,r,n._forAuthorCode))}(t,n,r)}function pe(t){var e=t.bytesFilled,r=t.elementSize;return new t.ctor(t.buffer,t.byteOffset,e/r)}function ye(t,e,r,n){t._queue.push({buffer:e,byteOffset:r,byteLength:n}),t._queueTotalSize+=n}function ve(t,e){var r=e.elementSize,n=e.bytesFilled-e.bytesFilled%r,o=Math.min(t._queueTotalSize,e.byteLength-e.bytesFilled),i=e.bytesFilled+o,s=i-i%r,a=o,u=!1;s>n&&(a=s-e.bytesFilled,u=!0);for(var l,c,f,d,b,h=t._queue;a>0;){var _=h.peek(),p=Math.min(a,_.byteLength),y=e.byteOffset+e.bytesFilled;l=e.buffer,c=y,f=_.buffer,d=_.byteOffset,b=p,new Uint8Array(l).set(new Uint8Array(f,d,b),c),_.byteLength===p?h.shift():(_.byteOffset+=p,_.byteLength-=p),t._queueTotalSize-=p,me(t,p,e),a-=p}return u}function me(t,e,r){we(t),r.bytesFilled+=e}function ge(t){0===t._queueTotalSize&&!0===t._closeRequested?(Te(t),Me(t._controlledReadableByteStream)):he(t)}function we(t){void 0!==t._byobRequest&&(t._byobRequest._associatedReadableByteStreamController=void 0,t._byobRequest._view=void 0,t._byobRequest=void 0)}function Se(t){for(;t._pendingPullIntos.length>0;){if(0===t._queueTotalSize)return;var e=t._pendingPullIntos.peek();!0===ve(t,e)&&(Be(t),_e(t._controlledReadableByteStream,e))}}function Ie(t,e){var r=t._pendingPullIntos.peek();if("closed"===t._controlledReadableByteStream._state){if(0!==e)throw new TypeError("bytesWritten must be 0 when calling respond() on a closed stream");!function(t,e){e.buffer=e.buffer;var r=t._controlledReadableByteStream;if(!0===qe(r))for(;Ae(r)>0;){_e(r,Be(t))}}(t,r)}else!function(t,e,r){if(r.bytesFilled+e>r.byteLength)throw new RangeError("bytesWritten out of range");if(me(t,e,r),!(r.bytesFilled<r.elementSize)){Be(t);var n=r.bytesFilled%r.elementSize;if(n>0){var o=r.byteOffset+r.bytesFilled,i=r.buffer.slice(o-n,o);ye(t,i,0,i.byteLength)}r.buffer=r.buffer,r.bytesFilled-=n,_e(t._controlledReadableByteStream,r),Se(t)}}(t,e,r);he(t)}function Be(t){var e=t._pendingPullIntos.shift();return we(t),e}function Te(t){t._pullAlgorithm=void 0,t._cancelAlgorithm=void 0}function Ee(t,e){var r=t._controlledReadableByteStream;"readable"===r._state&&(!function(t){we(t),t._pendingPullIntos=new F}(t),nt(t),Te(t),De(r,e))}function Re(t){var e=t._controlledReadableByteStream._state;return"errored"===e?null:"closed"===e?0:t._strategyHWM-t._queueTotalSize}function Pe(t,e,r){var n=Object.create(fe.prototype);var o=f(e,"pull",0,[n]),i=f(e,"cancel",1,[]),s=e.autoAllocateChunkSize;if(void 0!==s&&(s=Number(s),!1===le(s)||s<=0))throw new RangeError("autoAllocateChunkSize must be a positive integer");!function(t,e,r,n,o,i,s){e._controlledReadableByteStream=t,e._pullAgain=!1,e._pulling=!1,e._byobRequest=void 0,e._queue=e._queueTotalSize=void 0,nt(e),e._closeRequested=!1,e._started=!1,e._strategyHWM=h(i),e._pullAlgorithm=n,e._cancelAlgorithm=o,e._autoAllocateChunkSize=s,e._pendingPullIntos=new F,t._readableStreamController=e,B(w(r()),(function(){e._started=!0,he(e)}),(function(t){Ee(e,t)}))}(t,n,(function(){return d(e,"start",[n])}),o,i,r,s)}function Fe(t){return new TypeError("ReadableStreamBYOBRequest.prototype."+t+" can only be used on a ReadableStreamBYOBRequest")}function Oe(t){return new TypeError("ReadableByteStreamController.prototype."+t+" can only be used on a ReadableByteStreamController")}function Ce(t){return g((function(e,r){var n={_resolve:e,_reject:r};t._reader._readIntoRequests.push(n)}))}function Ae(t){return t._reader._readIntoRequests.length}function qe(t){var e=t._reader;return void 0!==e&&!!ke(e)}var Le=function(){function t(t){if(!We(t))throw new TypeError("ReadableStreamBYOBReader can only be constructed with a ReadableStream instance given a byte source");if(!1===de(t._readableStreamController))throw new TypeError("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source");if(xe(t))throw new TypeError("This stream has already been locked for exclusive reading by another reader");C(this,t),this._readIntoRequests=new F}return Object.defineProperty(t.prototype,"closed",{get:function(){return ke(this)?this._closedPromise:S(Ue("closed"))},enumerable:!0,configurable:!0}),t.prototype.cancel=function(t){return ke(this)?void 0===this._ownerReadableStream?S(L("cancel")):A(this,t):S(Ue("cancel"))},t.prototype.read=function(t){return ke(this)?void 0===this._ownerReadableStream?S(L("read from")):ArrayBuffer.isView(t)?(t.buffer,0===t.byteLength?S(new TypeError("view must have non-zero byteLength")):function(t,e){var r=t._ownerReadableStream;if(r._disturbed=!0,"errored"===r._state)return S(r._storedError);return function(t,e){var r=t._controlledReadableByteStream,n=1;e.constructor!==DataView&&(n=e.constructor.BYTES_PER_ELEMENT);var o=e.constructor,i={buffer:e.buffer,byteOffset:e.byteOffset,byteLength:e.byteLength,bytesFilled:0,elementSize:n,ctor:o,readerType:"byob"};if(t._pendingPullIntos.length>0)return t._pendingPullIntos.push(i),Ce(r);if("closed"===r._state)return w(O(new o(i.buffer,i.byteOffset,0),!0,r._reader._forAuthorCode));if(t._queueTotalSize>0){if(!0===ve(t,i)){var s=pe(i);return ge(t),w(O(s,!1,r._reader._forAuthorCode))}if(!0===t._closeRequested){var a=new TypeError("Insufficient bytes to fill elements in the given buffer");return Ee(t,a),S(a)}}t._pendingPullIntos.push(i);var u=Ce(r);return he(t),u}(r._readableStreamController,e)}(this,t)):S(new TypeError("view must be an array buffer view")):S(Ue("read"))},t.prototype.releaseLock=function(){if(!ke(this))throw Ue("releaseLock");if(void 0!==this._ownerReadableStream){if(this._readIntoRequests.length>0)throw new TypeError("Tried to release a reader lock when that reader has pending read() calls un-settled");q(this)}},t}();function ke(t){return!!a(t)&&!!Object.prototype.hasOwnProperty.call(t,"_readIntoRequests")}function Ue(t){return new TypeError("ReadableStreamBYOBReader.prototype."+t+" can only be used on a ReadableStreamBYOBReader")}var je=function(){function t(t,e){void 0===t&&(t={}),void 0===e&&(e={}),Ne(this);var r=e.size,n=e.highWaterMark,o=t.type;if("bytes"===String(o)){if(void 0!==r)throw new RangeError("The strategy for a byte stream cannot have a size function");void 0===n&&(n=0),Pe(this,t,n=h(n))}else{if(void 0!==o)throw new RangeError("Invalid type is specified");var i=_(r);void 0===n&&(n=1),function(t,e,r,n){var o=Object.create($t.prototype),i=f(e,"pull",0,[o]),s=f(e,"cancel",1,[]);ae(t,o,(function(){return d(e,"start",[o])}),i,s,r,n)}(this,t,n=h(n),i)}}return Object.defineProperty(t.prototype,"locked",{get:function(){if(!1===We(this))throw Ge("locked");return xe(this)},enumerable:!0,configurable:!0}),t.prototype.cancel=function(t){return!1===We(this)?S(Ge("cancel")):!0===xe(this)?S(new TypeError("Cannot cancel a stream that already has a reader")):Ve(this,t)},t.prototype.getReader=function(t){var e=(void 0===t?{}:t).mode;if(!1===We(this))throw Ge("getReader");if(void 0===e)return x(this,!0);if("byob"===(e=String(e)))return function(t,e){void 0===e&&(e=!1);var r=new Le(t);return r._forAuthorCode=e,r}(this,!0);throw new RangeError("Invalid mode is specified")},t.prototype.pipeThrough=function(t,e){var r=t.writable,n=t.readable,o=void 0===e?{}:e,i=o.preventClose,s=o.preventAbort,a=o.preventCancel,u=o.signal;if(!1===We(this))throw Ge("pipeThrough");if(!1===lt(r))throw new TypeError("writable argument to pipeThrough must be a WritableStream");if(!1===We(n))throw new TypeError("readable argument to pipeThrough must be a ReadableStream");if(i=Boolean(i),s=Boolean(s),a=Boolean(a),void 0!==u&&!Ht(u))throw new TypeError("ReadableStream.prototype.pipeThrough's signal option must be an AbortSignal");if(!0===xe(this))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");if(!0===ct(r))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream");return P(Jt(this,r,i,s,a,u)),n},t.prototype.pipeTo=function(t,e){var r=void 0===e?{}:e,n=r.preventClose,o=r.preventAbort,i=r.preventCancel,s=r.signal;return!1===We(this)?S(Ge("pipeTo")):!1===lt(t)?S(new TypeError("ReadableStream.prototype.pipeTo's first argument must be a WritableStream")):(n=Boolean(n),o=Boolean(o),i=Boolean(i),void 0===s||Ht(s)?!0===xe(this)?S(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")):!0===ct(t)?S(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")):Jt(this,t,n,o,i,s):S(new TypeError("ReadableStream.prototype.pipeTo's signal option must be an AbortSignal")))},t.prototype.tee=function(){if(!1===We(this))throw Ge("tee");var t=function(t,e){var r,n,o,i,s,a=x(t),l=!1,c=!1,f=!1,d=g((function(t){s=t}));function b(){return!0===l||(l=!0,P(R(J(a),(function(t){if(l=!1,!0===t.done)return!1===c&&re(o._readableStreamController),void(!1===f&&re(i._readableStreamController));var e=t.value,r=e,n=e;!1===c&&ne(o._readableStreamController,r),!1===f&&ne(i._readableStreamController,n)})))),w(void 0)}function h(){}return o=ze(h,b,(function(e){if(c=!0,r=e,!0===f){var o=u([r,n]),i=Ve(t,o);s(i)}return d})),i=ze(h,b,(function(e){if(f=!0,n=e,!0===c){var o=u([r,n]),i=Ve(t,o);s(i)}return d})),E(a._closedPromise,(function(t){oe(o._readableStreamController,t),oe(i._readableStreamController,t)})),[o,i]}(this);return u(t)},t.prototype.getIterator=function(t){var e=(void 0===t?{}:t).preventCancel,r=void 0!==e&&e;if(!1===We(this))throw Ge("getIterator");return function(t,e){void 0===e&&(e=!1);var r=x(t),n=Object.create(Q);return n._asyncIteratorReader=r,n._preventCancel=Boolean(e),n}(this,r)},t}();function ze(t,e,r,n,o){void 0===n&&(n=1),void 0===o&&(o=function(){return 1});var i=Object.create(je.prototype);return Ne(i),ae(i,Object.create($t.prototype),t,e,r,n,o),i}function Ne(t){t._state="readable",t._reader=void 0,t._storedError=void 0,t._disturbed=!1}function We(t){return!!a(t)&&!!Object.prototype.hasOwnProperty.call(t,"_readableStreamController")}function xe(t){return void 0!==t._reader}function Ve(t,e){return t._disturbed=!0,"closed"===t._state?w(void 0):"errored"===t._state?S(t._storedError):(Me(t),R(t._readableStreamController[N](e),o))}function Me(t){t._state="closed";var e=t._reader;void 0!==e&&(Y(e)&&(e._readRequests.forEach((function(t){t._resolve(O(void 0,!0,e._forAuthorCode))})),e._readRequests=new F),z(e))}function De(t,e){t._state="errored",t._storedError=e;var r=t._reader;void 0!==r&&(Y(r)?(r._readRequests.forEach((function(t){t._reject(e)})),r._readRequests=new F):(r._readIntoRequests.forEach((function(t){t._reject(e)})),r._readIntoRequests=new F),j(r,e))}function Ge(t){return new TypeError("ReadableStream.prototype."+t+" can only be used on a ReadableStream")}"symbol"==typeof n.asyncIterator&&Object.defineProperty(je.prototype,n.asyncIterator,{value:je.prototype.getIterator,enumerable:!1,writable:!0,configurable:!0});var He=function(){function t(t){var e=t.highWaterMark;this.highWaterMark=e}return t.prototype.size=function(t){return t.byteLength},t}(),Ze=function(){function t(t){var e=t.highWaterMark;this.highWaterMark=e}return t.prototype.size=function(){return 1},t}(),Xe=function(){function t(t,e,r){void 0===t&&(t={}),void 0===e&&(e={}),void 0===r&&(r={});var n=e.size,o=e.highWaterMark,i=r.size,s=r.highWaterMark;if(void 0!==t.writableType)throw new RangeError("Invalid writable type specified");var a=_(n);if(void 0===o&&(o=1),o=h(o),void 0!==t.readableType)throw new RangeError("Invalid readable type specified");var u,l=_(i);void 0===s&&(s=0),s=h(s),function(t,e,r,n,o,i){function s(){return e}t._writable=function(t,e,r,n,o,i){void 0===o&&(o=1),void 0===i&&(i=function(){return 1});var s=Object.create(st.prototype);return ut(s),Rt(s,Object.create(Et.prototype),t,e,r,n,o,i),s}(s,(function(e){return function(t,e){var r=t._transformStreamController;if(!0===t._backpressure){return R(t._backpressureChangePromise,(function(){var n=t._writable;if("erroring"===n._state)throw n._storedError;return nr(r,e)}))}return nr(r,e)}(t,e)}),(function(){return function(t){var e=t._readable,r=t._transformStreamController,n=r._flushAlgorithm();return er(r),R(n,(function(){if("errored"===e._state)throw e._storedError;var t=e._readableStreamController;!0===se(t)&&re(t)}),(function(r){throw Je(t,r),e._storedError}))}(t)}),(function(e){return function(t,e){return Je(t,e),w(void 0)}(t,e)}),r,n),t._readable=ze(s,(function(){return function(t){return Qe(t,!1),t._backpressureChangePromise}(t)}),(function(e){return $e(t,e),w(void 0)}),o,i),t._backpressure=void 0,t._backpressureChangePromise=void 0,t._backpressureChangePromise_resolve=void 0,Qe(t,!0),t._transformStreamController=void 0}(this,g((function(t){u=t})),o,a,s,l),function(t,e){var r=Object.create(Ke.prototype),n=function(t){try{return rr(r,t),w(void 0)}catch(t){return S(t)}},o=e.transform;if(void 0!==o){if("function"!=typeof o)throw new TypeError("transform is not a method");n=function(t){return b(o,e,[t,r])}}var i=f(e,"flush",0,[r]);!function(t,e,r,n){e._controlledTransformStream=t,t._transformStreamController=e,e._transformAlgorithm=r,e._flushAlgorithm=n}(t,r,n,i)}(this,t);var c=d(t,"start",[this._transformStreamController]);u(c)}return Object.defineProperty(t.prototype,"readable",{get:function(){if(!1===Ye(this))throw ir("readable");return this._readable},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"writable",{get:function(){if(!1===Ye(this))throw ir("writable");return this._writable},enumerable:!0,configurable:!0}),t}();function Ye(t){return!!a(t)&&!!Object.prototype.hasOwnProperty.call(t,"_transformStreamController")}function Je(t,e){oe(t._readable._readableStreamController,e),$e(t,e)}function $e(t,e){er(t._transformStreamController),Ct(t._writable._writableStreamController,e),!0===t._backpressure&&Qe(t,!1)}function Qe(t,e){void 0!==t._backpressureChangePromise&&t._backpressureChangePromise_resolve(),t._backpressureChangePromise=g((function(e){t._backpressureChangePromise_resolve=e})),t._backpressure=e}var Ke=function(){function t(){throw new TypeError("TransformStreamDefaultController instances cannot be created directly")}return Object.defineProperty(t.prototype,"desiredSize",{get:function(){if(!1===tr(this))throw or("desiredSize");return ie(this._controlledTransformStream._readable._readableStreamController)},enumerable:!0,configurable:!0}),t.prototype.enqueue=function(t){if(!1===tr(this))throw or("enqueue");rr(this,t)},t.prototype.error=function(t){if(!1===tr(this))throw or("error");var e;e=t,Je(this._controlledTransformStream,e)},t.prototype.terminate=function(){if(!1===tr(this))throw or("terminate");!function(t){var e=t._controlledTransformStream,r=e._readable._readableStreamController;!0===se(r)&&re(r);var n=new TypeError("TransformStream terminated");$e(e,n)}(this)},t}();function tr(t){return!!a(t)&&!!Object.prototype.hasOwnProperty.call(t,"_controlledTransformStream")}function er(t){t._transformAlgorithm=void 0,t._flushAlgorithm=void 0}function rr(t,e){var r=t._controlledTransformStream,n=r._readable._readableStreamController;if(!1===se(n))throw new TypeError("Readable side is not in a state that permits enqueue");try{ne(n,e)}catch(t){throw $e(r,t),r._readable._storedError}(function(t){return!0!==te(t)})(n)!==r._backpressure&&Qe(r,!0)}function nr(t,e){return R(t._transformAlgorithm(e),void 0,(function(e){throw Je(t._controlledTransformStream,e),e}))}function or(t){return new TypeError("TransformStreamDefaultController.prototype."+t+" can only be used on a TransformStreamDefaultController")}function ir(t){return new TypeError("TransformStream.prototype."+t+" can only be used on a TransformStream")}},function(t,e,r){"use strict";r.r(e),r.d(e,"FlatGeobufWorkerLoader",(function(){return n})),r.d(e,"FlatGeobufLoader",(function(){return s})),r.d(e,"_typecheckFlatGeobufLoader",(function(){return a}));const n={id:"flatgeobuf",name:"FlatGeobuf",module:"flatgeobuf",version:"3.1.0-alpha.5",worker:!0,extensions:["fgb"],mimeTypes:["application/octet-stream"],category:"geometry",options:{flatgeobuf:{}}};var o=r(0);function i(t,e){if(0===t.byteLength)return[];const r=new Uint8Array(t),{features:n}=Object(o.deserialize)(r);return n}const s={...n,parse:async(t,e)=>i(t),parseSync:i,parseInBatchesFromStream:function(t,e){return Object(o.deserializeStream)(t)},binary:!0},a=s}])}));
|
|
2
|
-
//# sourceMappingURL=dist.min.js.map
|