@loaders.gl/flatgeobuf 3.0.13 → 3.0.14

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.
@@ -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=9)}([function(t,e,r){t.exports=r(7)},function(t,e){function r(t,e,r,n,o,i,a){try{var s=t[i](a),u=s.value}catch(t){return void r(t)}s.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 a=t.apply(e,n);function s(t){r(a,o,i,s,u,"next",t)}function u(t){r(a,o,i,s,u,"throw",t)}s(void 0)}))}},t.exports.default=t.exports,t.exports.__esModule=!0},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){!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 a,s,u,c,l={SIZEOF_SHORT:2,SIZEOF_INT:4,FILE_IDENTIFIER_LENGTH:4,SIZE_PREFIX_LENGTH:4,Encoding:{UTF8_BYTES:1,UTF16_STRING:2}};l.int32=new Int32Array(2),l.float32=new Float32Array(l.int32.buffer),l.float64=new Float64Array(l.int32.buffer),l.isLittleEndian=1===new Uint16Array(new Uint8Array([1,0]).buffer)[0],l.Long=function(t,e){this.low=0|t,this.high=0|e},l.Long.create=function(t,e){return 0==t&&0==e?l.Long.ZERO:new l.Long(t,e)},l.Long.prototype.toFloat64=function(){return(this.low>>>0)+4294967296*this.high},l.Long.prototype.equals=function(t){return this.low==t.low&&this.high==t.high},l.Long.ZERO=new l.Long(0,0),l.Builder=function(t){if(t)e=t;else var e=1024;this.bb=l.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},l.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},l.Builder.prototype.forceDefaults=function(t){this.force_defaults=t},l.Builder.prototype.dataBuffer=function(){return this.bb},l.Builder.prototype.asUint8Array=function(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())},l.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=l.Builder.growByteBuffer(this.bb),this.space+=this.bb.capacity()-n}this.pad(r)},l.Builder.prototype.pad=function(t){for(var e=0;e<t;e++)this.bb.writeInt8(--this.space,0)},l.Builder.prototype.writeInt8=function(t){this.bb.writeInt8(this.space-=1,t)},l.Builder.prototype.writeInt16=function(t){this.bb.writeInt16(this.space-=2,t)},l.Builder.prototype.writeInt32=function(t){this.bb.writeInt32(this.space-=4,t)},l.Builder.prototype.writeInt64=function(t){this.bb.writeInt64(this.space-=8,t)},l.Builder.prototype.writeFloat32=function(t){this.bb.writeFloat32(this.space-=4,t)},l.Builder.prototype.writeFloat64=function(t){this.bb.writeFloat64(this.space-=8,t)},l.Builder.prototype.addInt8=function(t){this.prep(1,0),this.writeInt8(t)},l.Builder.prototype.addInt16=function(t){this.prep(2,0),this.writeInt16(t)},l.Builder.prototype.addInt32=function(t){this.prep(4,0),this.writeInt32(t)},l.Builder.prototype.addInt64=function(t){this.prep(8,0),this.writeInt64(t)},l.Builder.prototype.addFloat32=function(t){this.prep(4,0),this.writeFloat32(t)},l.Builder.prototype.addFloat64=function(t){this.prep(8,0),this.writeFloat64(t)},l.Builder.prototype.addFieldInt8=function(t,e,r){(this.force_defaults||e!=r)&&(this.addInt8(e),this.slot(t))},l.Builder.prototype.addFieldInt16=function(t,e,r){(this.force_defaults||e!=r)&&(this.addInt16(e),this.slot(t))},l.Builder.prototype.addFieldInt32=function(t,e,r){(this.force_defaults||e!=r)&&(this.addInt32(e),this.slot(t))},l.Builder.prototype.addFieldInt64=function(t,e,r){!this.force_defaults&&e.equals(r)||(this.addInt64(e),this.slot(t))},l.Builder.prototype.addFieldFloat32=function(t,e,r){(this.force_defaults||e!=r)&&(this.addFloat32(e),this.slot(t))},l.Builder.prototype.addFieldFloat64=function(t,e,r){(this.force_defaults||e!=r)&&(this.addFloat64(e),this.slot(t))},l.Builder.prototype.addFieldOffset=function(t,e,r){(this.force_defaults||e!=r)&&(this.addOffset(e),this.slot(t))},l.Builder.prototype.addFieldStruct=function(t,e,r){e!=r&&(this.nested(e),this.slot(t))},l.Builder.prototype.nested=function(t){if(t!=this.offset())throw new Error("FlatBuffers: struct must be serialized inline.")},l.Builder.prototype.notNested=function(){if(this.isNested)throw new Error("FlatBuffers: object serialization must not be nested.")},l.Builder.prototype.slot=function(t){this.vtable[t]=this.offset()},l.Builder.prototype.offset=function(){return this.bb.capacity()-this.space},l.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=l.ByteBuffer.allocate(r);return n.setPosition(r-e),n.bytes().set(t.bytes(),r-e),n},l.Builder.prototype.addOffset=function(t){this.prep(l.SIZEOF_INT,0),this.writeInt32(this.offset()-t+l.SIZEOF_INT)},l.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()},l.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)*l.SIZEOF_SHORT;this.addInt16(n);var o=0,i=this.space;t:for(e=0;e<this.vtables.length;e++){var a=this.bb.capacity()-this.vtables[e];if(n==this.bb.readInt16(a)){for(var s=l.SIZEOF_SHORT;s<n;s+=l.SIZEOF_SHORT)if(this.bb.readInt16(i+s)!=this.bb.readInt16(a+s))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},l.Builder.prototype.finish=function(t,e,r){var n=r?l.SIZE_PREFIX_LENGTH:0;if(e){var o=e;if(this.prep(this.minalign,l.SIZEOF_INT+l.FILE_IDENTIFIER_LENGTH+n),o.length!=l.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: file identifier must be length "+l.FILE_IDENTIFIER_LENGTH);for(var i=l.FILE_IDENTIFIER_LENGTH-1;i>=0;i--)this.writeInt8(o.charCodeAt(i))}this.prep(this.minalign,l.SIZEOF_INT+n),this.addOffset(t),n&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)},l.Builder.prototype.finishSizePrefixed=function(t,e){this.finish(t,e,!0)},l.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")},l.Builder.prototype.startVector=function(t,e,r){this.notNested(),this.vector_num_elems=e,this.prep(l.SIZEOF_INT,t*e),this.prep(r,t*e)},l.Builder.prototype.endVector=function(){return this.writeInt32(this.vector_num_elems),this.offset()},l.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,a=this.bb.bytes();r<e.length;r++)a[i++]=e[r];return this.endVector()},l.Builder.prototype.createLong=function(t,e){return l.Long.create(t,e)},l.ByteBuffer=function(t){this.bytes_=t,this.position_=0},l.ByteBuffer.allocate=function(t){return new l.ByteBuffer(new Uint8Array(t))},l.ByteBuffer.prototype.clear=function(){this.position_=0},l.ByteBuffer.prototype.bytes=function(){return this.bytes_},l.ByteBuffer.prototype.position=function(){return this.position_},l.ByteBuffer.prototype.setPosition=function(t){this.position_=t},l.ByteBuffer.prototype.capacity=function(){return this.bytes_.length},l.ByteBuffer.prototype.readInt8=function(t){return this.readUint8(t)<<24>>24},l.ByteBuffer.prototype.readUint8=function(t){return this.bytes_[t]},l.ByteBuffer.prototype.readInt16=function(t){return this.readUint16(t)<<16>>16},l.ByteBuffer.prototype.readUint16=function(t){return this.bytes_[t]|this.bytes_[t+1]<<8},l.ByteBuffer.prototype.readInt32=function(t){return this.bytes_[t]|this.bytes_[t+1]<<8|this.bytes_[t+2]<<16|this.bytes_[t+3]<<24},l.ByteBuffer.prototype.readUint32=function(t){return this.readInt32(t)>>>0},l.ByteBuffer.prototype.readInt64=function(t){return new l.Long(this.readInt32(t),this.readInt32(t+4))},l.ByteBuffer.prototype.readUint64=function(t){return new l.Long(this.readUint32(t),this.readUint32(t+4))},l.ByteBuffer.prototype.readFloat32=function(t){return l.int32[0]=this.readInt32(t),l.float32[0]},l.ByteBuffer.prototype.readFloat64=function(t){return l.int32[l.isLittleEndian?0:1]=this.readInt32(t),l.int32[l.isLittleEndian?1:0]=this.readInt32(t+4),l.float64[0]},l.ByteBuffer.prototype.writeInt8=function(t,e){this.bytes_[t]=e},l.ByteBuffer.prototype.writeUint8=function(t,e){this.bytes_[t]=e},l.ByteBuffer.prototype.writeInt16=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8},l.ByteBuffer.prototype.writeUint16=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8},l.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},l.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},l.ByteBuffer.prototype.writeInt64=function(t,e){this.writeInt32(t,e.low),this.writeInt32(t+4,e.high)},l.ByteBuffer.prototype.writeUint64=function(t,e){this.writeUint32(t,e.low),this.writeUint32(t+4,e.high)},l.ByteBuffer.prototype.writeFloat32=function(t,e){l.float32[0]=e,this.writeInt32(t,l.int32[0])},l.ByteBuffer.prototype.writeFloat64=function(t,e){l.float64[0]=e,this.writeInt32(t,l.int32[l.isLittleEndian?0:1]),this.writeInt32(t+4,l.int32[l.isLittleEndian?1:0])},l.ByteBuffer.prototype.getBufferIdentifier=function(){if(this.bytes_.length<this.position_+l.SIZEOF_INT+l.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: ByteBuffer is too short to contain an identifier.");for(var t="",e=0;e<l.FILE_IDENTIFIER_LENGTH;e++)t+=String.fromCharCode(this.readInt8(this.position_+l.SIZEOF_INT+e));return t},l.ByteBuffer.prototype.__offset=function(t,e){var r=t-this.readInt32(t);return e<this.readInt16(r)?this.readInt16(r+e):0},l.ByteBuffer.prototype.__union=function(t,e){return t.bb_pos=e+this.readInt32(e),t.bb=this,t},l.ByteBuffer.prototype.__string=function(t,e){t+=this.readInt32(t);var r=this.readInt32(t),n="",o=0;if(t+=l.SIZEOF_INT,e===l.Encoding.UTF8_BYTES)return this.bytes_.subarray(t,t+r);for(;o<r;){var i,a=this.readUint8(t+o++);if(a<192)i=a;else{var s=this.readUint8(t+o++);if(a<224)i=(31&a)<<6|63&s;else{var u=this.readUint8(t+o++);i=a<240?(15&a)<<12|(63&s)<<6|63&u:(7&a)<<18|(63&s)<<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},l.ByteBuffer.prototype.__indirect=function(t){return t+this.readInt32(t)},l.ByteBuffer.prototype.__vector=function(t){return t+this.readInt32(t)+l.SIZEOF_INT},l.ByteBuffer.prototype.__vector_len=function(t){return this.readInt32(t+this.readInt32(t))},l.ByteBuffer.prototype.__has_identifier=function(t){if(t.length!=l.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: file identifier must be length "+l.FILE_IDENTIFIER_LENGTH);for(var e=0;e<l.FILE_IDENTIFIER_LENGTH;e++)if(t.charCodeAt(e)!=this.readInt8(this.position_+l.SIZEOF_INT+e))return!1;return!0},l.ByteBuffer.prototype.createLong=function(t,e){return l.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"}(a||(a={})),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"}(s||(s={}));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()+l.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):s.Byte}static start(t){t.startObject(2)}static addName(t,e){t.addFieldOffset(0,e,0)}static addType(t,e){t.addFieldInt8(1,e,s.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()+l.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):a.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,a.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,a,s,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,a),d.addType(t,s),d.addParts(t,u),d.end(t)}}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()+l.SIZE_PREFIX_LENGTH),(e||new h).__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 h.start(t),h.addGeometry(t,e),h.addProperties(t,r),h.addColumns(t,n),h.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"}(c||(c={}));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()+l.SIZE_PREFIX_LENGTH),(e||new b).__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):c.Byte}static start(t){t.startObject(2)}static addName(t,e){t.addFieldOffset(0,e,0)}static addType(t,e){t.addFieldInt8(1,e,c.Byte)}static end(t){var e=t.endObject();return t.requiredField(e,4),e}static create(t,e,r){return b.start(t),b.addName(t,e),b.addType(t,r),b.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()+l.SIZE_PREFIX_LENGTH),(e||new p).__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 p.start(t),p.addOrg(t,e),p.addCode(t,r),p.addName(t,n),p.addDescription(t,o),p.addWkt(t,i),p.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()+l.SIZE_PREFIX_LENGTH),(e||new _).__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 b).__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 p).__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,a,s,u,c,l,f){return _.start(t),_.addName(t,e),_.addEnvelope(t,r),_.addGeometryType(t,n),_.addHasZ(t,o),_.addHasM(t,i),_.addHasT(t,a),_.addHasTM(t,s),_.addColumns(t,u),_.addFeaturesCount(t,c),_.addIndexNodeSize(t,l),_.addCrs(t,f),_.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),a=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=>a+=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 a=0;const s={};for(;a<i;){const t=n.getUint16(a,!0);a+=2;const i=e[t];switch(i.type){case o.Bool:s[i.name]=!!n.getUint8(a),a+=1;break;case o.Byte:s[i.name]=n.getInt8(a),a+=1;break;case o.UByte:s[i.name]=n.getUint8(a),a+=1;break;case o.Short:s[i.name]=n.getInt16(a,!0),a+=2;break;case o.UShort:s[i.name]=n.getUint16(a,!0),a+=2;break;case o.Int:s[i.name]=n.getInt32(a,!0),a+=4;break;case o.UInt:s[i.name]=n.getUint32(a,!0),a+=4;break;case o.Long:s[i.name]=Number(n.getBigInt64(a,!0)),a+=8;break;case o.ULong:s[i.name]=Number(n.getBigUint64(a,!0)),a+=8;break;case o.Double:s[i.name]=n.getFloat64(a,!0),a+=8;break;case o.DateTime:case o.String:{const t=n.getUint32(a,!0);a+=4;const e=new TextDecoder;s[i.name]=e.decode(r.subarray(a,a+t)),a+=t;break}default:throw new Error("Unknown type "+i.type)}}return s}(t,r),a={type:"Feature",geometry:n};return i&&(a.properties=i),a}function E(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 I(t){this.wrapped=t}function B(t){var e,r;function n(e,r){try{var i=t[e](r),a=i.value,s=a instanceof I;Promise.resolve(s?a.wrapped:a).then((function(t){s?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,a){var s={key:t,arg:o,resolve:i,reject:a,next:null};r?r=r.next=s:(e=r=s,n(t,o))}))},"function"!=typeof t.return&&(this.return=void 0)}function T(t){return function(){return new B(t.apply(this,arguments))}}function R(t){return new I(t)}"function"==typeof Symbol&&Symbol.asyncIterator&&(B.prototype[Symbol.asyncIterator]=function(){return this}),B.prototype.next=function(t){return this._invoke("next",t)},B.prototype.throw=function(t){return this._invoke("throw",t)},B.prototype.return=function(t){return this._invoke("return",t)};var P=new Uint8Array(0);function O(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 F(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 L(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 a=[];for(let t=0;t<o.length;t++)a.push([i[t],i[t]+o[t]]);return a.reverse(),a}function j(t,e,r,n){return A.apply(this,arguments)}function A(){return(A=T((function*(t,e,r,n){const{minX:o,minY:i,maxX:a,maxY:s}=r,u=L(t,e),[[c,l]]=u,f=[];for(f.push([0,u.length-1]);0!==f.length;){const[r,d]=f.pop(),h=r>=l-t,[,b]=u[d],p=Math.min(r+e,b),_=p-r,y=yield R(n(40*r,40*_)),v=new Float64Array(y),m=new Uint32Array(y);for(let t=r;t<p;t++){const e=5*(t-r);if(a<v[e+0])continue;if(s<v[e+1])continue;if(o>v[e+2])continue;if(i>v[e+3])continue;const n=m[8+(e<<1)];h?yield[n,t-c]:f.push([n,d-1])}f.sort((t,e)=>e[0]-t[0])}}))).apply(this,arguments)}F.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:O(e,r.value)}}))},F.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())}))}()},F.prototype.cancel=function(){return this._source.cancel()};const k=new Uint8Array([102,103,98,3,102,103,98,0]);function q(t,e,r,n){return x.apply(this,arguments)}function x(){return(x=T((function*(t,e,n,o){let a=0,s=new Uint8Array(yield R(t(8)));if(a+=8,!s.every((t,e)=>k[e]===t))throw new Error("Not a FlatGeobuf file");s=new Uint8Array(yield R(t(4))),a+=4;let u=new l.ByteBuffer(s);const c=u.readUint32(0);s=new Uint8Array(yield R(t(c))),a+=c,u=new l.ByteBuffer(s);const f=_.getRoot(u),d=f.featuresCount().toFloat64(),h=[];for(let t=0;t<f.columnsLength();t++){const e=f.columns(t);h.push(new r(e.name(),e.type()))}const b=new i(f.geometryType(),h,d),p=f.indexNodeSize();if(p>0){const r=C(d,p);if(n){const i=async(r,n)=>(await e(a+r),await t(n)),s=[];var y,v=!0,m=!1;try{for(var g,w,S=E(j(d,p,n,i));v=(g=yield R(S.next())).done,w=yield R(g.value),!v;v=!0){let[t]=w;s.push(t)}}catch(t){m=!0,y=t}finally{try{v||null==S.return||(yield R(S.return()))}finally{if(m)throw y}}a+=r;var I,B=!0,T=!1;try{for(var P,O,F=E(s);B=(P=yield R(F.next())).done,O=yield R(P.value),!B;B=!0){let r=O;yield R(e(a+r)),yield U(t,b,o)}}catch(t){T=!0,I=t}finally{try{B||null==F.return||(yield R(F.return()))}finally{if(T)throw I}}return}e?yield R(e(a+r)):yield R(t(r)),a+=r}let L;for(;L=yield R(U(t,b,o));)yield L}))).apply(this,arguments)}async function U(t,e,r){let n=new Uint8Array(await t(4));if(0===n.byteLength)return null;let o=new l.ByteBuffer(n);const i=o.readUint32(0);n=new Uint8Array(await t(i));const a=new Uint8Array(i+4);return a.set(n,4),o=new l.ByteBuffer(a),o.setPosition(4),r(h.getRoot(o),e)}function N(t){const e=function(t){const e=t.features[0],n=e.properties;let a=null;n&&(a=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 s=new Set;for(const r of t.features)s.add(e.geometry.type);return new i(m(e.geometry.type),a,t.features.length)}(t),n=function(t){const e=new l.Builder(0);let r=null;t.columns&&(r=_.createColumnsVector(e,t.columns.map(t=>function(t,e){const r=t.createString(e.name);return b.start(t),b.addName(t,r),b.addType(t,e.type),b.end(t)}(e,t))));const n=e.createString("L1");_.start(e),_.addFeaturesCount(e,new l.Long(t.featuresCount,0)),_.addGeometryType(e,t.geometryType),_.addIndexNodeSize(e,0),r&&_.addColumns(e,r),_.addName(e,n);const o=_.end(e);return e.finishSizePrefixed(o),e.asUint8Array()}(e),a=t.features.map(t=>function(t,e){const r=e.columns,n=new l.Builder(0),i=new Uint8Array(1e5);let a=0;if(r){const e=new DataView(i.buffer);for(let n=0;n<r.length;n++){const s=r[n],u=t.properties[s.name];if(null!==u)switch(e.setUint16(a,n,!0),a+=2,s.type){case o.Bool:e.setUint8(a,u),a+=1;break;case o.Short:e.setInt16(a,u,!0),a+=2;break;case o.UShort:e.setUint16(a,u,!0),a+=2;break;case o.Int:e.setInt32(a,u,!0),a+=4;break;case o.UInt:e.setUint32(a,u,!0),a+=4;break;case o.Long:e.setBigInt64(a,BigInt(u),!0),a+=8;break;case o.Long:e.setBigUint64(a,BigInt(u),!0),a+=8;break;case o.Double:e.setFloat64(a,u,!0),a+=8;break;case o.String:const t=u,r=(new TextEncoder).encode(t);e.setUint32(a,r.length,!0),a+=4,i.set(r,a),a+=r.length;break;default:throw new Error("Unknown type")}}}let s=null;a>0&&(s=h.createPropertiesVector(n,i.slice(0,a)));const u=function t(e,r){const{xy:n,ends:o,parts:i,type:a}=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 s=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,s),d.addType(e,a),d.end(e)}(n,g(t.geometry));h.start(n),h.addGeometry(n,u),s&&h.addProperties(n,s);const c=h.end(n);return n.finishSizePrefixed(c),n.asUint8Array()}(t,e)),s=a.map(t=>t.length).reduce((t,e)=>t+e),u=new Uint8Array(k.length+n.length+s);u.set(n,k.length);let c=k.length+n.length;for(const t of a)u.set(t,c),c+=t.length;return u.set(k),u}function z(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 l.ByteBuffer(t),o=n.readUint32(k.length);n.setPosition(k.length+4);const a=_.getRoot(n),s=a.featuresCount().toFloat64(),u=[];for(let t=0;t<a.columnsLength();t++){const e=a.columns(t);u.push(new r(e.name(),e.type()))}const c=new i(a.geometryType(),u,0);let f=k.length+4+o;const d=a.indexNodeSize();d>0&&(f+=C(s,d));const b=[];for(;f<n.capacity();){const t=n.readUint32(f);n.setPosition(f+4);const r=h.getRoot(n);b.push(e(r,c)),f+=4+t}return b}(t,(t,e)=>S(t,e))}}function M(t,e){return function(t,e,r){let n=0;return q(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?z(t):t instanceof e.ReadableStream?function(t,e){const r="function"==typeof(n=t).slice?n:new F("function"==typeof n.read?n:n.getReader());var n;return q(async t=>await r.slice(t),void 0,void 0,e)}(t,(t,e)=>S(t,e)):M(t,r)},t.serialize=function(t){return N(t)},Object.defineProperty(t,"__esModule",{value:!0})}(e,r(8))},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){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,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",a=n.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var o=e&&e.prototype instanceof f?e:f,i=Object.create(o.prototype),a=new E(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 B()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var s=g(a,r);if(s){if(s===l)continue;return s}}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,a),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 f(){}function d(){}function h(){}var b={};b[o]=function(){return this};var p=Object.getPrototypeOf,_=p&&p(p(I([])));_&&_!==e&&r.call(_,o)&&(b=_);var y=h.prototype=f.prototype=Object.create(b);function v(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function m(t,e){var n;this._invoke=function(o,i){function a(){return new e((function(n,a){!function n(o,i,a,s){var u=c(t[o],t,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==typeof f&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(f).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,s)}))}s(u.arg)}(o,i,n,a)}))}return n=n?n.then(a,a):a()}}function g(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,g(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 w(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 S(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function E(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(w,this),this.reset(!0)}function I(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:B}}function B(){return{value:void 0,done:!0}}return d.prototype=y.constructor=h,h.constructor=d,d.displayName=s(h,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,h):(t.__proto__=h,s(t,a,"GeneratorFunction")),t.prototype=Object.create(y),t},t.awrap=function(t){return{__await:t}},v(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 a=new m(u(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},v(y),s(y,a,"Generator"),y[o]=function(){return this},y.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=I,E.prototype={constructor:E,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(S),!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 a.type="throw",a.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],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){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 a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,l):this.complete(a)},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),S(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;S(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:I(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){"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 xe})),r.d(e,"TransformStream",(function(){return Ye})),r.d(e,"WritableStream",(function(){return at}));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},a=o;function s(t){return"object"==typeof t&&null!==t||"function"==typeof t}function u(t){return t.slice()}function c(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 l(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 h(o,t,n)};case 1:return function(e){var r=[e].concat(n);return h(o,t,r)}}}return function(){return w(void 0)}}function d(t,e,r){var n=t[e];if(void 0!==n)return l(n,t,r)}function h(t,e,r){try{return w(l(t,e,r))}catch(t){return S(t)}}function b(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 p(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 _=Promise,y=Promise.prototype.then,v=Promise.resolve.bind(_),m=Promise.reject.bind(_);function g(t){return new _(t)}function w(t){return v(t)}function S(t){return m(t)}function E(t,e,r){return y.call(t,e,r)}function I(t,e,r){E(E(t,e,r),void 0,a)}function B(t,e){I(t,e)}function T(t,e){I(t,void 0,e)}function R(t,e,r){return E(t,e,r)}function P(t){E(t,void 0,a)}var O=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 F(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),U(t)}(t):q(t,e._storedError)}function L(t,e){return We(t._ownerReadableStream,e)}function j(t){"readable"===t._ownerReadableStream._state?x(t,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")):function(t,e){q(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 A(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 q(t,e){k(t),x(t,e)}function x(t,e){P(t._closedPromise),t._closedPromise_reject(e),t._closedPromise_resolve=void 0,t._closedPromise_reject=void 0}function U(t){t._closedPromise_resolve(void 0),t._closedPromise_resolve=void 0,t._closedPromise_reject=void 0}var N=n("[[CancelSteps]]"),z=n("[[PullSteps]]");function M(t,e){void 0===e&&(e=!1);var r=new Y(t);return r._forAuthorCode=e,r}function W(t){return g((function(e,r){var n={_resolve:e,_reject:r};t._reader._readRequests.push(n)}))}function V(t,e,r){var n=t._reader;n._readRequests.shift()._resolve(F(e,r,n._forAuthorCode))}function D(t){return t._reader._readRequests.length}function G(t){var e=t._reader;return void 0!==e&&!!X(e)}var H,Z,Y=function(){function t(t){if(!1===ze(t))throw new TypeError("ReadableStreamDefaultReader can only be constructed with a ReadableStream instance");if(!0===Me(t))throw new TypeError("This stream has already been locked for exclusive reading by another reader");C(this,t),this._readRequests=new O}return Object.defineProperty(t.prototype,"closed",{get:function(){return X(this)?this._closedPromise:S($("closed"))},enumerable:!0,configurable:!0}),t.prototype.cancel=function(t){return X(this)?void 0===this._ownerReadableStream?S(A("cancel")):L(this,t):S($("cancel"))},t.prototype.read=function(){return X(this)?void 0===this._ownerReadableStream?S(A("read from")):J(this):S($("read"))},t.prototype.releaseLock=function(){if(!X(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");j(this)}},t}();function X(t){return!!s(t)&&!!Object.prototype.hasOwnProperty.call(t,"_readRequests")}function J(t){var e=t._ownerReadableStream;return e._disturbed=!0,"closed"===e._state?w(F(void 0,!0,t._forAuthorCode)):"errored"===e._state?S(e._storedError):e._readableStreamController[z]()}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(A("iterate")):R(J(t),(function(e){var r=e.done;return r&&j(t),F(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(A("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=L(e,t);return j(e),R(r,(function(){return F(t,!0,!0)}))}return j(e),w(F(t,!0,!0))}};function K(t){return!!s(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(!c(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 O,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]]"),at=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=p(r);void 0===n&&(n=1),function(t,e,r,n){var o=Object.create(Tt.prototype);var i=f(e,"write",1,[o]),a=f(e,"close",0,[]),s=f(e,"abort",1,[]);Rt(t,o,(function(){return d(e,"start",[o])}),i,a,s,r,n)}(this,t,n=b(n),o)}return Object.defineProperty(t.prototype,"locked",{get:function(){if(!1===ct(this))throw At("locked");return lt(this)},enumerable:!0,configurable:!0}),t.prototype.abort=function(t){return!1===ct(this)?S(At("abort")):!0===lt(this)?S(new TypeError("Cannot abort a stream that already has a writer")):ft(this,t)},t.prototype.close=function(){return!1===ct(this)?S(At("close")):!0===lt(this)?S(new TypeError("Cannot close a stream that already has a writer")):!0===_t(this)?S(new TypeError("Cannot close an already-closing stream")):dt(this)},t.prototype.getWriter=function(){if(!1===ct(this))throw At("getWriter");return st(this)},t}();function st(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 O,t._inFlightWriteRequest=void 0,t._closeRequest=void 0,t._inFlightCloseRequest=void 0,t._pendingAbortRequest=void 0,t._backpressure=!1}function ct(t){return!!s(t)&&!!Object.prototype.hasOwnProperty.call(t,"_writableStreamController")}function lt(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&&bt(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),Ft(r),n}function ht(t,e){"writable"!==t._state?pt(t):bt(t,e)}function bt(t,e){var r=t._writableStreamController;t._state="erroring",t._storedError=e;var n=t._writer;void 0!==n&&Et(n,e),!1===function(t){if(void 0===t._inFlightWriteRequest&&void 0===t._inFlightCloseRequest)return!1;return!0}(t)&&!0===r._started&&pt(t)}function pt(t){t._state="errored",t._writableStreamController[it]();var e=t._storedError;if(t._writeRequests.forEach((function(t){t._reject(e)})),t._writeRequests=new O,void 0!==t._pendingAbortRequest){var r=t._pendingAbortRequest;if(t._pendingAbortRequest=void 0,!0===r._wasAlreadyErroring)return r._reject(e),void yt(t);I(t._writableStreamController[ot](r._reason),(function(){r._resolve(),yt(t)}),(function(e){r._reject(e),yt(t)}))}else yt(t)}function _t(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){Mt(t)}(r):Gt(r)),t._backpressure=e}var mt=function(){function t(t){if(!1===ct(t))throw new TypeError("WritableStreamDefaultWriter can only be constructed with a WritableStream instance");if(!0===lt(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===_t(t)&&!0===t._backpressure?Mt(this):Vt(this),xt(this);else if("erroring"===r)Wt(this,t._storedError),xt(this);else if("closed"===r)Vt(this),xt(e=this),zt(e);else{var n=t._storedError;Wt(this,n),Ut(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 qt("desiredSize");return function(t){var e=t._ownerWritableStream,r=e._state;if("errored"===r||"erroring"===r)return null;if("closed"===r)return 0;return Ot(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(qt("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(qt("close")):!0===_t(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&&It(this)},t.prototype.write=function(t){return!1===gt(this)?S(kt("write")):void 0===this._ownerWritableStream?S(qt("write to")):Bt(this,t)},t}();function gt(t){return!!s(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){Ut(t,e)}(t,e)}function Et(t,e){"pending"===t._readyPromiseState?Dt(t,e):function(t,e){Wt(t,e)}(t,e)}function It(t){var e=t._ownerWritableStream,r=new TypeError("Writer was released and can no longer be used to monitor the stream's closedness");Et(t,r),St(t,r),e._writer=void 0,t._ownerWritableStream=void 0}function Bt(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(qt("write to"));var i=r._state;if("errored"===i)return S(r._storedError);if(!0===_t(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 a=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===_t(o)&&"writable"===o._state){var i=Lt(t);vt(o,i)}Ft(t)}(n,e,o),a}var Tt=function(){function t(){throw new TypeError("WritableStreamDefaultController cannot be constructed explicitly")}return t.prototype.error=function(t){if(!1===function(t){if(!s(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&&jt(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,a,s){e._controlledWritableStream=t,t._writableStreamController=e,e._queue=void 0,e._queueTotalSize=void 0,nt(e),e._started=!1,e._strategySizeAlgorithm=s,e._strategyHWM=a,e._writeAlgorithm=n,e._closeAlgorithm=o,e._abortAlgorithm=i;var u=Lt(e);vt(t,u),I(w(r()),(function(){e._started=!0,Ft(e)}),(function(r){e._started=!0,ht(t,r)}))}function Pt(t){t._writeAlgorithm=void 0,t._closeAlgorithm=void 0,t._abortAlgorithm=void 0,t._strategySizeAlgorithm=void 0}function Ot(t){return t._strategyHWM-t._queueTotalSize}function Ft(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),I(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&&zt(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),ht(t,e)}(e,t)}))}(t):function(t,e){var r=t._controlledWritableStream;(function(t){t._inFlightWriteRequest=t._writeRequests.shift()})(r),I(t._writeAlgorithm(e),(function(){!function(t){t._inFlightWriteRequest._resolve(void 0),t._inFlightWriteRequest=void 0}(r);var e=r._state;if(et(t),!1===_t(r)&&"writable"===e){var n=Lt(t);vt(r,n)}Ft(t)}),(function(e){"writable"===r._state&&Pt(t),function(t,e){t._inFlightWriteRequest._reject(e),t._inFlightWriteRequest=void 0,ht(t,e)}(r,e)}))}(t,r.chunk)}}else pt(e)}function Ct(t,e){"writable"===t._controlledWritableStream._state&&jt(t,e)}function Lt(t){return Ot(t)<=0}function jt(t,e){var r=t._controlledWritableStream;Pt(t),bt(r,e)}function At(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 qt(t){return new TypeError("Cannot "+t+" a stream using a released writer")}function xt(t){t._closedPromise=g((function(e,r){t._closedPromise_resolve=e,t._closedPromise_reject=r,t._closedPromiseState="pending"}))}function Ut(t,e){xt(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 zt(t){t._closedPromise_resolve(void 0),t._closedPromise_resolve=void 0,t._closedPromise_reject=void 0,t._closedPromiseState="resolved"}function Mt(t){t._readyPromise=g((function(e,r){t._readyPromise_resolve=e,t._readyPromise_reject=r})),t._readyPromiseState="pending"}function Wt(t,e){Mt(t),Dt(t,e)}function Vt(t){Mt(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 Yt,Xt=function(t){if("function"!=typeof t&&"object"!=typeof t)return!1;try{return new t,!0}catch(t){return!1}}(Zt)?Zt:((Yt=function(t,e){this.message=t||"",this.name=e||"Error",Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}).prototype=Object.create(Error.prototype),Object.defineProperty(Yt.prototype,"constructor",{value:Yt,writable:!0,configurable:!0}),Yt);function Jt(t,e,r,n,i,a){var s=M(t),u=st(e);t._disturbed=!0;var c=!1,l=w(void 0);return g((function(f,d){var h,b,p,_;if(void 0!==a){if(h=function(){var r=new Xt("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?We(t,r):w(void 0)})),R((function(){return Promise.all(o.map((function(t){return t()})))}),!0,r)},!0===a.aborted)return void h();a.addEventListener("abort",h)}if(m(t,s._closedPromise,(function(t){!1===n?R((function(){return ft(e,t)}),!0,t):O(!0,t)})),m(e,u._closedPromise,(function(e){!1===i?R((function(){return We(t,e)}),!0,e):O(!0,e)})),b=t,p=s._closedPromise,_=function(){!1===r?R((function(){return function(t){var e=t._ownerWritableStream,r=e._state;return!0===_t(e)||"closed"===r?w(void 0):"errored"===r?S(e._storedError):wt(t)}(u)})):O()},"closed"===b._state?_():B(p,_),!0===_t(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 We(t,y)}),!0,y):O(!0,y)}function v(){var t=l;return E(l,(function(){return t!==l?v():void 0}))}function m(t,e,r){"errored"===t._state?r(t._storedError):T(e,r)}function R(t,r,n){function o(){I(t(),(function(){return F(r,n)}),(function(t){return F(!0,t)}))}!0!==c&&(c=!0,"writable"===e._state&&!1===_t(e)?B(v(),o):o())}function O(t,r){!0!==c&&(c=!0,"writable"===e._state&&!1===_t(e)?B(v(),(function(){return F(t,r)})):F(t,r))}function F(t,e){It(u),j(s),void 0!==a&&a.removeEventListener("abort",h),t?d(e):f(void 0)}P(g((function(t,e){!function r(n){n?t():E(!0===c?w(!0):E(u._readyPromise,(function(){return E(J(s),(function(t){return!0===t.done||(l=E(Bt(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===ae(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===ae(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[z]=function(){var t=this._controlledReadableStream;if(this._queue.length>0){var e=et(this);return!0===this._closeRequested&&0===this._queue.length?(ee(this),Ve(t)):Kt(this),w(F(e,!1,t._reader._forAuthorCode))}var r=W(t);return Kt(this),r},t}();function Qt(t){return!!s(t)&&!!Object.prototype.hasOwnProperty.call(t,"_controlledReadableStream")}function Kt(t){!1!==te(t)&&(!0!==t._pulling?(t._pulling=!0,I(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!==ae(t)&&(!1!==t._started&&(!0===Me(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),Ve(e))}function ne(t,e){var r=t._controlledReadableStream;if(!0===Me(r)&&D(r)>0)V(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 ae(t){var e=t._controlledReadableStream._state;return!1===t._closeRequested&&"readable"===e}function se(t,e,r,n,o,i,a){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=a,e._strategyHWM=i,e._pullAlgorithm=n,e._cancelAlgorithm=o,t._readableStreamController=e,I(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 ce=Number.isInteger||function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t},le=function(){function t(){throw new TypeError("ReadableStreamBYOBRequest cannot be used directly")}return Object.defineProperty(t.prototype,"view",{get:function(){if(!1===he(this))throw Oe("view");return this._view},enumerable:!0,configurable:!0}),t.prototype.respond=function(t){if(!1===he(this))throw Oe("respond");if(void 0===this._associatedReadableByteStreamController)throw new TypeError("This BYOB request has been invalidated");this._view.buffer,function(t,e){if(!1===c(e=Number(e)))throw new RangeError("bytesWritten must be a finite");Ee(t,e)}(this._associatedReadableByteStreamController,t)},t.prototype.respondWithNewView=function(t){if(!1===he(this))throw Oe("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,Ee(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 Fe("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(le.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 Fe("desiredSize");return Re(this)},enumerable:!0,configurable:!0}),t.prototype.close=function(){if(!1===de(this))throw Fe("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 Te(t,r),r}}Be(t),Ve(e)}(this)},t.prototype.enqueue=function(t){if(!1===de(this))throw Fe("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,a=n;if(!0===G(r))if(0===D(r))ye(t,a,o,i);else{var s=new Uint8Array(a,o,i);V(r,s,!1)}else!0===je(r)?(ye(t,a,o,i),Se(t)):ye(t,a,o,i);be(t)}(this,t)},t.prototype.error=function(t){if(!1===de(this))throw Fe("error");Te(this,t)},t.prototype[N]=function(t){this._pendingPullIntos.length>0&&(this._pendingPullIntos.peek().bytesFilled=0);nt(this);var e=this._cancelAlgorithm(t);return Be(this),e},t.prototype[z]=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(F(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 a=W(t);return be(this),a},t}();function de(t){return!!s(t)&&!!Object.prototype.hasOwnProperty.call(t,"_controlledReadableByteStream")}function he(t){return!!s(t)&&!!Object.prototype.hasOwnProperty.call(t,"_associatedReadableByteStreamController")}function be(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===je(e)&&Le(e)>0)return!0;if(Re(t)>0)return!0;return!1}(t)&&(!0!==t._pulling?(t._pulling=!0,I(t._pullAlgorithm(),(function(){t._pulling=!1,!0===t._pullAgain&&(t._pullAgain=!1,be(t))}),(function(e){Te(t,e)}))):t._pullAgain=!0)}function pe(t,e){var r=!1;"closed"===t._state&&(r=!0);var n=_e(e);"default"===e.readerType?V(t,n,r):function(t,e,r){var n=t._reader;n._readIntoRequests.shift()._resolve(F(e,r,n._forAuthorCode))}(t,n,r)}function _e(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,a=i-i%r,s=o,u=!1;a>n&&(s=a-e.bytesFilled,u=!0);for(var c,l,f,d,h,b=t._queue;s>0;){var p=b.peek(),_=Math.min(s,p.byteLength),y=e.byteOffset+e.bytesFilled;c=e.buffer,l=y,f=p.buffer,d=p.byteOffset,h=_,new Uint8Array(c).set(new Uint8Array(f,d,h),l),p.byteLength===_?b.shift():(p.byteOffset+=_,p.byteLength-=_),t._queueTotalSize-=_,me(t,_,e),s-=_}return u}function me(t,e,r){we(t),r.bytesFilled+=e}function ge(t){0===t._queueTotalSize&&!0===t._closeRequested?(Be(t),Ve(t._controlledReadableByteStream)):be(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)&&(Ie(t),pe(t._controlledReadableByteStream,e))}}function Ee(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===je(r))for(;Le(r)>0;){pe(r,Ie(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)){Ie(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,pe(t._controlledReadableByteStream,r),Se(t)}}(t,e,r);be(t)}function Ie(t){var e=t._pendingPullIntos.shift();return we(t),e}function Be(t){t._pullAlgorithm=void 0,t._cancelAlgorithm=void 0}function Te(t,e){var r=t._controlledReadableByteStream;"readable"===r._state&&(!function(t){we(t),t._pendingPullIntos=new O}(t),nt(t),Be(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,[]),a=e.autoAllocateChunkSize;if(void 0!==a&&(a=Number(a),!1===ce(a)||a<=0))throw new RangeError("autoAllocateChunkSize must be a positive integer");!function(t,e,r,n,o,i,a){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=b(i),e._pullAlgorithm=n,e._cancelAlgorithm=o,e._autoAllocateChunkSize=a,e._pendingPullIntos=new O,t._readableStreamController=e,I(w(r()),(function(){e._started=!0,be(e)}),(function(t){Te(e,t)}))}(t,n,(function(){return d(e,"start",[n])}),o,i,r,a)}function Oe(t){return new TypeError("ReadableStreamBYOBRequest.prototype."+t+" can only be used on a ReadableStreamBYOBRequest")}function Fe(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 Le(t){return t._reader._readIntoRequests.length}function je(t){var e=t._reader;return void 0!==e&&!!ke(e)}var Ae=function(){function t(t){if(!ze(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(Me(t))throw new TypeError("This stream has already been locked for exclusive reading by another reader");C(this,t),this._readIntoRequests=new O}return Object.defineProperty(t.prototype,"closed",{get:function(){return ke(this)?this._closedPromise:S(qe("closed"))},enumerable:!0,configurable:!0}),t.prototype.cancel=function(t){return ke(this)?void 0===this._ownerReadableStream?S(A("cancel")):L(this,t):S(qe("cancel"))},t.prototype.read=function(t){return ke(this)?void 0===this._ownerReadableStream?S(A("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(F(new o(i.buffer,i.byteOffset,0),!0,r._reader._forAuthorCode));if(t._queueTotalSize>0){if(!0===ve(t,i)){var a=_e(i);return ge(t),w(F(a,!1,r._reader._forAuthorCode))}if(!0===t._closeRequested){var s=new TypeError("Insufficient bytes to fill elements in the given buffer");return Te(t,s),S(s)}}t._pendingPullIntos.push(i);var u=Ce(r);return be(t),u}(r._readableStreamController,e)}(this,t)):S(new TypeError("view must be an array buffer view")):S(qe("read"))},t.prototype.releaseLock=function(){if(!ke(this))throw qe("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");j(this)}},t}();function ke(t){return!!s(t)&&!!Object.prototype.hasOwnProperty.call(t,"_readIntoRequests")}function qe(t){return new TypeError("ReadableStreamBYOBReader.prototype."+t+" can only be used on a ReadableStreamBYOBReader")}var xe=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=b(n))}else{if(void 0!==o)throw new RangeError("Invalid type is specified");var i=p(r);void 0===n&&(n=1),function(t,e,r,n){var o=Object.create($t.prototype),i=f(e,"pull",0,[o]),a=f(e,"cancel",1,[]);se(t,o,(function(){return d(e,"start",[o])}),i,a,r,n)}(this,t,n=b(n),i)}}return Object.defineProperty(t.prototype,"locked",{get:function(){if(!1===ze(this))throw Ge("locked");return Me(this)},enumerable:!0,configurable:!0}),t.prototype.cancel=function(t){return!1===ze(this)?S(Ge("cancel")):!0===Me(this)?S(new TypeError("Cannot cancel a stream that already has a reader")):We(this,t)},t.prototype.getReader=function(t){var e=(void 0===t?{}:t).mode;if(!1===ze(this))throw Ge("getReader");if(void 0===e)return M(this,!0);if("byob"===(e=String(e)))return function(t,e){void 0===e&&(e=!1);var r=new Ae(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,a=o.preventAbort,s=o.preventCancel,u=o.signal;if(!1===ze(this))throw Ge("pipeThrough");if(!1===ct(r))throw new TypeError("writable argument to pipeThrough must be a WritableStream");if(!1===ze(n))throw new TypeError("readable argument to pipeThrough must be a ReadableStream");if(i=Boolean(i),a=Boolean(a),s=Boolean(s),void 0!==u&&!Ht(u))throw new TypeError("ReadableStream.prototype.pipeThrough's signal option must be an AbortSignal");if(!0===Me(this))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");if(!0===lt(r))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream");return P(Jt(this,r,i,a,s,u)),n},t.prototype.pipeTo=function(t,e){var r=void 0===e?{}:e,n=r.preventClose,o=r.preventAbort,i=r.preventCancel,a=r.signal;return!1===ze(this)?S(Ge("pipeTo")):!1===ct(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===a||Ht(a)?!0===Me(this)?S(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")):!0===lt(t)?S(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")):Jt(this,t,n,o,i,a):S(new TypeError("ReadableStream.prototype.pipeTo's signal option must be an AbortSignal")))},t.prototype.tee=function(){if(!1===ze(this))throw Ge("tee");var t=function(t,e){var r,n,o,i,a,s=M(t),c=!1,l=!1,f=!1,d=g((function(t){a=t}));function h(){return!0===c||(c=!0,P(R(J(s),(function(t){if(c=!1,!0===t.done)return!1===l&&re(o._readableStreamController),void(!1===f&&re(i._readableStreamController));var e=t.value,r=e,n=e;!1===l&&ne(o._readableStreamController,r),!1===f&&ne(i._readableStreamController,n)})))),w(void 0)}function b(){}return o=Ue(b,h,(function(e){if(l=!0,r=e,!0===f){var o=u([r,n]),i=We(t,o);a(i)}return d})),i=Ue(b,h,(function(e){if(f=!0,n=e,!0===l){var o=u([r,n]),i=We(t,o);a(i)}return d})),T(s._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===ze(this))throw Ge("getIterator");return function(t,e){void 0===e&&(e=!1);var r=M(t),n=Object.create(Q);return n._asyncIteratorReader=r,n._preventCancel=Boolean(e),n}(this,r)},t}();function Ue(t,e,r,n,o){void 0===n&&(n=1),void 0===o&&(o=function(){return 1});var i=Object.create(xe.prototype);return Ne(i),se(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 ze(t){return!!s(t)&&!!Object.prototype.hasOwnProperty.call(t,"_readableStreamController")}function Me(t){return void 0!==t._reader}function We(t,e){return t._disturbed=!0,"closed"===t._state?w(void 0):"errored"===t._state?S(t._storedError):(Ve(t),R(t._readableStreamController[N](e),o))}function Ve(t){t._state="closed";var e=t._reader;void 0!==e&&(X(e)&&(e._readRequests.forEach((function(t){t._resolve(F(void 0,!0,e._forAuthorCode))})),e._readRequests=new O),U(e))}function De(t,e){t._state="errored",t._storedError=e;var r=t._reader;void 0!==r&&(X(r)?(r._readRequests.forEach((function(t){t._reject(e)})),r._readRequests=new O):(r._readIntoRequests.forEach((function(t){t._reject(e)})),r._readIntoRequests=new O),x(r,e))}function Ge(t){return new TypeError("ReadableStream.prototype."+t+" can only be used on a ReadableStream")}"symbol"==typeof n.asyncIterator&&Object.defineProperty(xe.prototype,n.asyncIterator,{value:xe.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}(),Ye=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,a=r.highWaterMark;if(void 0!==t.writableType)throw new RangeError("Invalid writable type specified");var s=p(n);if(void 0===o&&(o=1),o=b(o),void 0!==t.readableType)throw new RangeError("Invalid readable type specified");var u,c=p(i);void 0===a&&(a=0),a=b(a),function(t,e,r,n,o,i){function a(){return e}t._writable=function(t,e,r,n,o,i){void 0===o&&(o=1),void 0===i&&(i=function(){return 1});var a=Object.create(at.prototype);return ut(a),Rt(a,Object.create(Tt.prototype),t,e,r,n,o,i),a}(a,(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===ae(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=Ue(a,(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,s,a,c),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 h(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 l=d(t,"start",[this._transformStreamController]);u(l)}return Object.defineProperty(t.prototype,"readable",{get:function(){if(!1===Xe(this))throw ir("readable");return this._readable},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"writable",{get:function(){if(!1===Xe(this))throw ir("writable");return this._writable},enumerable:!0,configurable:!0}),t}();function Xe(t){return!!s(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===ae(r)&&re(r);var n=new TypeError("TransformStream terminated");$e(e,n)}(this)},t}();function tr(t){return!!s(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===ae(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);var n=r(2),o=r.n(n),i=r(1),a=r.n(i),s=r(0),u=r.n(s),c=r(4),l=r.n(c),f=r(5),d=r.n(f),h=r(6),b=r.n(h);function p(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 _=new Map,y=function(){function t(){l()(this,t)}return d()(t,null,[{key:"onmessage",set:function(t){self.onmessage=function(e){if(v(e)){var r=e.data,n=r.type,o=r.payload;t(n,o)}}}},{key:"addEventListener",value:function(t){var e=_.get(t);e||(e=function(e){if(v(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=_.get(t);_.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(p(e))o.add(e);else if(p(e.buffer))o.add(e.buffer);else if(ArrayBuffer.isView(e));else if(r&&"object"===b()(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 v(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 g(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 w=0;function S(t,e){return new Promise((function(r,n){var o=w++;y.addEventListener((function t(e,i){if(i.id===o)switch(e){case"done":y.removeEventListener(t),r(i.result);break;case"error":y.removeEventListener(t),n(i.error)}}));var i={id:o,input:t,options:e};y.postMessage("process",i)}))}function E(t){return I.apply(this,arguments)}function I(){return(I=a()(u.a.mark((function t(e){var r,n,o,i,a,s,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}a=n,s=r.parseSync||r.parse,t.next=13;break;case 6:if(!r.parseTextSync){t.next=12;break}c=new TextDecoder,a=c.decode(n),s=r.parseTextSync,t.next=13;break;case 12:throw new Error("Could not load data with ".concat(r.name," loader"));case 13:return o=g(g({},o),{},{modules:r&&r.options&&r.options.modules||{},worker:!1}),t.next=16,s(a,g({},o),i,r);case 16:return t.abrupt("return",t.sent);case 17:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var B={id:"flatgeobuf",name:"FlatGeobuf",module:"flatgeobuf",version:"3.0.13",worker:!0,extensions:["fgb"],mimeTypes:["application/octet-stream"],category:"geometry",options:{flatgeobuf:{}}},T=r(3);function R(t,e){if(0===t.byteLength)return[];var r=new Uint8Array(t);return Object(T.deserialize)(r).features}function P(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 O(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?P(Object(r),!0).forEach((function(e){o()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):P(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var F,C,L=O(O({},B),{},{parse:(F=a()(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",R(e));case 1:case"end":return t.stop()}}),t)}))),function(t,e){return F.apply(this,arguments)}),parseSync:R,parseInBatchesFromStream:function(t,e){return Object(T.deserializeStream)(t)},binary:!0});C=L,"undefined"!=typeof self&&(y.onmessage=function(){var t=a()(u.a.mark((function t(e,r){var n,o,i,a,s;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,E({loader:C,arrayBuffer:n,options:i,context:{parse:S}});case 7:a=t.sent,y.postMessage("done",{result:a}),t.next=15;break;case 11:t.prev=11,t.t1=t.catch(3),s=t.t1 instanceof Error?t.t1.message:"",y.postMessage("error",{error:s});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=9)}([function(t,e,r){t.exports=r(7)},function(t,e){function r(t,e,r,n,o,i,a){try{var s=t[i](a),u=s.value}catch(t){return void r(t)}s.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 a=t.apply(e,n);function s(t){r(a,o,i,s,u,"next",t)}function u(t){r(a,o,i,s,u,"throw",t)}s(void 0)}))}},t.exports.default=t.exports,t.exports.__esModule=!0},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){!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 a,s,u,c,l={SIZEOF_SHORT:2,SIZEOF_INT:4,FILE_IDENTIFIER_LENGTH:4,SIZE_PREFIX_LENGTH:4,Encoding:{UTF8_BYTES:1,UTF16_STRING:2}};l.int32=new Int32Array(2),l.float32=new Float32Array(l.int32.buffer),l.float64=new Float64Array(l.int32.buffer),l.isLittleEndian=1===new Uint16Array(new Uint8Array([1,0]).buffer)[0],l.Long=function(t,e){this.low=0|t,this.high=0|e},l.Long.create=function(t,e){return 0==t&&0==e?l.Long.ZERO:new l.Long(t,e)},l.Long.prototype.toFloat64=function(){return(this.low>>>0)+4294967296*this.high},l.Long.prototype.equals=function(t){return this.low==t.low&&this.high==t.high},l.Long.ZERO=new l.Long(0,0),l.Builder=function(t){if(t)e=t;else var e=1024;this.bb=l.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},l.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},l.Builder.prototype.forceDefaults=function(t){this.force_defaults=t},l.Builder.prototype.dataBuffer=function(){return this.bb},l.Builder.prototype.asUint8Array=function(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())},l.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=l.Builder.growByteBuffer(this.bb),this.space+=this.bb.capacity()-n}this.pad(r)},l.Builder.prototype.pad=function(t){for(var e=0;e<t;e++)this.bb.writeInt8(--this.space,0)},l.Builder.prototype.writeInt8=function(t){this.bb.writeInt8(this.space-=1,t)},l.Builder.prototype.writeInt16=function(t){this.bb.writeInt16(this.space-=2,t)},l.Builder.prototype.writeInt32=function(t){this.bb.writeInt32(this.space-=4,t)},l.Builder.prototype.writeInt64=function(t){this.bb.writeInt64(this.space-=8,t)},l.Builder.prototype.writeFloat32=function(t){this.bb.writeFloat32(this.space-=4,t)},l.Builder.prototype.writeFloat64=function(t){this.bb.writeFloat64(this.space-=8,t)},l.Builder.prototype.addInt8=function(t){this.prep(1,0),this.writeInt8(t)},l.Builder.prototype.addInt16=function(t){this.prep(2,0),this.writeInt16(t)},l.Builder.prototype.addInt32=function(t){this.prep(4,0),this.writeInt32(t)},l.Builder.prototype.addInt64=function(t){this.prep(8,0),this.writeInt64(t)},l.Builder.prototype.addFloat32=function(t){this.prep(4,0),this.writeFloat32(t)},l.Builder.prototype.addFloat64=function(t){this.prep(8,0),this.writeFloat64(t)},l.Builder.prototype.addFieldInt8=function(t,e,r){(this.force_defaults||e!=r)&&(this.addInt8(e),this.slot(t))},l.Builder.prototype.addFieldInt16=function(t,e,r){(this.force_defaults||e!=r)&&(this.addInt16(e),this.slot(t))},l.Builder.prototype.addFieldInt32=function(t,e,r){(this.force_defaults||e!=r)&&(this.addInt32(e),this.slot(t))},l.Builder.prototype.addFieldInt64=function(t,e,r){!this.force_defaults&&e.equals(r)||(this.addInt64(e),this.slot(t))},l.Builder.prototype.addFieldFloat32=function(t,e,r){(this.force_defaults||e!=r)&&(this.addFloat32(e),this.slot(t))},l.Builder.prototype.addFieldFloat64=function(t,e,r){(this.force_defaults||e!=r)&&(this.addFloat64(e),this.slot(t))},l.Builder.prototype.addFieldOffset=function(t,e,r){(this.force_defaults||e!=r)&&(this.addOffset(e),this.slot(t))},l.Builder.prototype.addFieldStruct=function(t,e,r){e!=r&&(this.nested(e),this.slot(t))},l.Builder.prototype.nested=function(t){if(t!=this.offset())throw new Error("FlatBuffers: struct must be serialized inline.")},l.Builder.prototype.notNested=function(){if(this.isNested)throw new Error("FlatBuffers: object serialization must not be nested.")},l.Builder.prototype.slot=function(t){this.vtable[t]=this.offset()},l.Builder.prototype.offset=function(){return this.bb.capacity()-this.space},l.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=l.ByteBuffer.allocate(r);return n.setPosition(r-e),n.bytes().set(t.bytes(),r-e),n},l.Builder.prototype.addOffset=function(t){this.prep(l.SIZEOF_INT,0),this.writeInt32(this.offset()-t+l.SIZEOF_INT)},l.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()},l.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)*l.SIZEOF_SHORT;this.addInt16(n);var o=0,i=this.space;t:for(e=0;e<this.vtables.length;e++){var a=this.bb.capacity()-this.vtables[e];if(n==this.bb.readInt16(a)){for(var s=l.SIZEOF_SHORT;s<n;s+=l.SIZEOF_SHORT)if(this.bb.readInt16(i+s)!=this.bb.readInt16(a+s))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},l.Builder.prototype.finish=function(t,e,r){var n=r?l.SIZE_PREFIX_LENGTH:0;if(e){var o=e;if(this.prep(this.minalign,l.SIZEOF_INT+l.FILE_IDENTIFIER_LENGTH+n),o.length!=l.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: file identifier must be length "+l.FILE_IDENTIFIER_LENGTH);for(var i=l.FILE_IDENTIFIER_LENGTH-1;i>=0;i--)this.writeInt8(o.charCodeAt(i))}this.prep(this.minalign,l.SIZEOF_INT+n),this.addOffset(t),n&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)},l.Builder.prototype.finishSizePrefixed=function(t,e){this.finish(t,e,!0)},l.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")},l.Builder.prototype.startVector=function(t,e,r){this.notNested(),this.vector_num_elems=e,this.prep(l.SIZEOF_INT,t*e),this.prep(r,t*e)},l.Builder.prototype.endVector=function(){return this.writeInt32(this.vector_num_elems),this.offset()},l.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,a=this.bb.bytes();r<e.length;r++)a[i++]=e[r];return this.endVector()},l.Builder.prototype.createLong=function(t,e){return l.Long.create(t,e)},l.ByteBuffer=function(t){this.bytes_=t,this.position_=0},l.ByteBuffer.allocate=function(t){return new l.ByteBuffer(new Uint8Array(t))},l.ByteBuffer.prototype.clear=function(){this.position_=0},l.ByteBuffer.prototype.bytes=function(){return this.bytes_},l.ByteBuffer.prototype.position=function(){return this.position_},l.ByteBuffer.prototype.setPosition=function(t){this.position_=t},l.ByteBuffer.prototype.capacity=function(){return this.bytes_.length},l.ByteBuffer.prototype.readInt8=function(t){return this.readUint8(t)<<24>>24},l.ByteBuffer.prototype.readUint8=function(t){return this.bytes_[t]},l.ByteBuffer.prototype.readInt16=function(t){return this.readUint16(t)<<16>>16},l.ByteBuffer.prototype.readUint16=function(t){return this.bytes_[t]|this.bytes_[t+1]<<8},l.ByteBuffer.prototype.readInt32=function(t){return this.bytes_[t]|this.bytes_[t+1]<<8|this.bytes_[t+2]<<16|this.bytes_[t+3]<<24},l.ByteBuffer.prototype.readUint32=function(t){return this.readInt32(t)>>>0},l.ByteBuffer.prototype.readInt64=function(t){return new l.Long(this.readInt32(t),this.readInt32(t+4))},l.ByteBuffer.prototype.readUint64=function(t){return new l.Long(this.readUint32(t),this.readUint32(t+4))},l.ByteBuffer.prototype.readFloat32=function(t){return l.int32[0]=this.readInt32(t),l.float32[0]},l.ByteBuffer.prototype.readFloat64=function(t){return l.int32[l.isLittleEndian?0:1]=this.readInt32(t),l.int32[l.isLittleEndian?1:0]=this.readInt32(t+4),l.float64[0]},l.ByteBuffer.prototype.writeInt8=function(t,e){this.bytes_[t]=e},l.ByteBuffer.prototype.writeUint8=function(t,e){this.bytes_[t]=e},l.ByteBuffer.prototype.writeInt16=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8},l.ByteBuffer.prototype.writeUint16=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8},l.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},l.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},l.ByteBuffer.prototype.writeInt64=function(t,e){this.writeInt32(t,e.low),this.writeInt32(t+4,e.high)},l.ByteBuffer.prototype.writeUint64=function(t,e){this.writeUint32(t,e.low),this.writeUint32(t+4,e.high)},l.ByteBuffer.prototype.writeFloat32=function(t,e){l.float32[0]=e,this.writeInt32(t,l.int32[0])},l.ByteBuffer.prototype.writeFloat64=function(t,e){l.float64[0]=e,this.writeInt32(t,l.int32[l.isLittleEndian?0:1]),this.writeInt32(t+4,l.int32[l.isLittleEndian?1:0])},l.ByteBuffer.prototype.getBufferIdentifier=function(){if(this.bytes_.length<this.position_+l.SIZEOF_INT+l.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: ByteBuffer is too short to contain an identifier.");for(var t="",e=0;e<l.FILE_IDENTIFIER_LENGTH;e++)t+=String.fromCharCode(this.readInt8(this.position_+l.SIZEOF_INT+e));return t},l.ByteBuffer.prototype.__offset=function(t,e){var r=t-this.readInt32(t);return e<this.readInt16(r)?this.readInt16(r+e):0},l.ByteBuffer.prototype.__union=function(t,e){return t.bb_pos=e+this.readInt32(e),t.bb=this,t},l.ByteBuffer.prototype.__string=function(t,e){t+=this.readInt32(t);var r=this.readInt32(t),n="",o=0;if(t+=l.SIZEOF_INT,e===l.Encoding.UTF8_BYTES)return this.bytes_.subarray(t,t+r);for(;o<r;){var i,a=this.readUint8(t+o++);if(a<192)i=a;else{var s=this.readUint8(t+o++);if(a<224)i=(31&a)<<6|63&s;else{var u=this.readUint8(t+o++);i=a<240?(15&a)<<12|(63&s)<<6|63&u:(7&a)<<18|(63&s)<<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},l.ByteBuffer.prototype.__indirect=function(t){return t+this.readInt32(t)},l.ByteBuffer.prototype.__vector=function(t){return t+this.readInt32(t)+l.SIZEOF_INT},l.ByteBuffer.prototype.__vector_len=function(t){return this.readInt32(t+this.readInt32(t))},l.ByteBuffer.prototype.__has_identifier=function(t){if(t.length!=l.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: file identifier must be length "+l.FILE_IDENTIFIER_LENGTH);for(var e=0;e<l.FILE_IDENTIFIER_LENGTH;e++)if(t.charCodeAt(e)!=this.readInt8(this.position_+l.SIZEOF_INT+e))return!1;return!0},l.ByteBuffer.prototype.createLong=function(t,e){return l.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"}(a||(a={})),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"}(s||(s={}));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()+l.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):s.Byte}static start(t){t.startObject(2)}static addName(t,e){t.addFieldOffset(0,e,0)}static addType(t,e){t.addFieldInt8(1,e,s.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()+l.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):a.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,a.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,a,s,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,a),d.addType(t,s),d.addParts(t,u),d.end(t)}}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()+l.SIZE_PREFIX_LENGTH),(e||new h).__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 h.start(t),h.addGeometry(t,e),h.addProperties(t,r),h.addColumns(t,n),h.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"}(c||(c={}));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()+l.SIZE_PREFIX_LENGTH),(e||new b).__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):c.Byte}static start(t){t.startObject(2)}static addName(t,e){t.addFieldOffset(0,e,0)}static addType(t,e){t.addFieldInt8(1,e,c.Byte)}static end(t){var e=t.endObject();return t.requiredField(e,4),e}static create(t,e,r){return b.start(t),b.addName(t,e),b.addType(t,r),b.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()+l.SIZE_PREFIX_LENGTH),(e||new p).__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 p.start(t),p.addOrg(t,e),p.addCode(t,r),p.addName(t,n),p.addDescription(t,o),p.addWkt(t,i),p.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()+l.SIZE_PREFIX_LENGTH),(e||new _).__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 b).__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 p).__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,a,s,u,c,l,f){return _.start(t),_.addName(t,e),_.addEnvelope(t,r),_.addGeometryType(t,n),_.addHasZ(t,o),_.addHasM(t,i),_.addHasT(t,a),_.addHasTM(t,s),_.addColumns(t,u),_.addFeaturesCount(t,c),_.addIndexNodeSize(t,l),_.addCrs(t,f),_.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),a=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=>a+=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 a=0;const s={};for(;a<i;){const t=n.getUint16(a,!0);a+=2;const i=e[t];switch(i.type){case o.Bool:s[i.name]=!!n.getUint8(a),a+=1;break;case o.Byte:s[i.name]=n.getInt8(a),a+=1;break;case o.UByte:s[i.name]=n.getUint8(a),a+=1;break;case o.Short:s[i.name]=n.getInt16(a,!0),a+=2;break;case o.UShort:s[i.name]=n.getUint16(a,!0),a+=2;break;case o.Int:s[i.name]=n.getInt32(a,!0),a+=4;break;case o.UInt:s[i.name]=n.getUint32(a,!0),a+=4;break;case o.Long:s[i.name]=Number(n.getBigInt64(a,!0)),a+=8;break;case o.ULong:s[i.name]=Number(n.getBigUint64(a,!0)),a+=8;break;case o.Double:s[i.name]=n.getFloat64(a,!0),a+=8;break;case o.DateTime:case o.String:{const t=n.getUint32(a,!0);a+=4;const e=new TextDecoder;s[i.name]=e.decode(r.subarray(a,a+t)),a+=t;break}default:throw new Error("Unknown type "+i.type)}}return s}(t,r),a={type:"Feature",geometry:n};return i&&(a.properties=i),a}function E(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 I(t){this.wrapped=t}function B(t){var e,r;function n(e,r){try{var i=t[e](r),a=i.value,s=a instanceof I;Promise.resolve(s?a.wrapped:a).then((function(t){s?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,a){var s={key:t,arg:o,resolve:i,reject:a,next:null};r?r=r.next=s:(e=r=s,n(t,o))}))},"function"!=typeof t.return&&(this.return=void 0)}function T(t){return function(){return new B(t.apply(this,arguments))}}function R(t){return new I(t)}"function"==typeof Symbol&&Symbol.asyncIterator&&(B.prototype[Symbol.asyncIterator]=function(){return this}),B.prototype.next=function(t){return this._invoke("next",t)},B.prototype.throw=function(t){return this._invoke("throw",t)},B.prototype.return=function(t){return this._invoke("return",t)};var P=new Uint8Array(0);function O(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 F(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 L(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 a=[];for(let t=0;t<o.length;t++)a.push([i[t],i[t]+o[t]]);return a.reverse(),a}function j(t,e,r,n){return A.apply(this,arguments)}function A(){return(A=T((function*(t,e,r,n){const{minX:o,minY:i,maxX:a,maxY:s}=r,u=L(t,e),[[c,l]]=u,f=[];for(f.push([0,u.length-1]);0!==f.length;){const[r,d]=f.pop(),h=r>=l-t,[,b]=u[d],p=Math.min(r+e,b),_=p-r,y=yield R(n(40*r,40*_)),v=new Float64Array(y),m=new Uint32Array(y);for(let t=r;t<p;t++){const e=5*(t-r);if(a<v[e+0])continue;if(s<v[e+1])continue;if(o>v[e+2])continue;if(i>v[e+3])continue;const n=m[8+(e<<1)];h?yield[n,t-c]:f.push([n,d-1])}f.sort((t,e)=>e[0]-t[0])}}))).apply(this,arguments)}F.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:O(e,r.value)}}))},F.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())}))}()},F.prototype.cancel=function(){return this._source.cancel()};const k=new Uint8Array([102,103,98,3,102,103,98,0]);function q(t,e,r,n){return x.apply(this,arguments)}function x(){return(x=T((function*(t,e,n,o){let a=0,s=new Uint8Array(yield R(t(8)));if(a+=8,!s.every((t,e)=>k[e]===t))throw new Error("Not a FlatGeobuf file");s=new Uint8Array(yield R(t(4))),a+=4;let u=new l.ByteBuffer(s);const c=u.readUint32(0);s=new Uint8Array(yield R(t(c))),a+=c,u=new l.ByteBuffer(s);const f=_.getRoot(u),d=f.featuresCount().toFloat64(),h=[];for(let t=0;t<f.columnsLength();t++){const e=f.columns(t);h.push(new r(e.name(),e.type()))}const b=new i(f.geometryType(),h,d),p=f.indexNodeSize();if(p>0){const r=C(d,p);if(n){const i=async(r,n)=>(await e(a+r),await t(n)),s=[];var y,v=!0,m=!1;try{for(var g,w,S=E(j(d,p,n,i));v=(g=yield R(S.next())).done,w=yield R(g.value),!v;v=!0){let[t]=w;s.push(t)}}catch(t){m=!0,y=t}finally{try{v||null==S.return||(yield R(S.return()))}finally{if(m)throw y}}a+=r;var I,B=!0,T=!1;try{for(var P,O,F=E(s);B=(P=yield R(F.next())).done,O=yield R(P.value),!B;B=!0){let r=O;yield R(e(a+r)),yield U(t,b,o)}}catch(t){T=!0,I=t}finally{try{B||null==F.return||(yield R(F.return()))}finally{if(T)throw I}}return}e?yield R(e(a+r)):yield R(t(r)),a+=r}let L;for(;L=yield R(U(t,b,o));)yield L}))).apply(this,arguments)}async function U(t,e,r){let n=new Uint8Array(await t(4));if(0===n.byteLength)return null;let o=new l.ByteBuffer(n);const i=o.readUint32(0);n=new Uint8Array(await t(i));const a=new Uint8Array(i+4);return a.set(n,4),o=new l.ByteBuffer(a),o.setPosition(4),r(h.getRoot(o),e)}function N(t){const e=function(t){const e=t.features[0],n=e.properties;let a=null;n&&(a=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 s=new Set;for(const r of t.features)s.add(e.geometry.type);return new i(m(e.geometry.type),a,t.features.length)}(t),n=function(t){const e=new l.Builder(0);let r=null;t.columns&&(r=_.createColumnsVector(e,t.columns.map(t=>function(t,e){const r=t.createString(e.name);return b.start(t),b.addName(t,r),b.addType(t,e.type),b.end(t)}(e,t))));const n=e.createString("L1");_.start(e),_.addFeaturesCount(e,new l.Long(t.featuresCount,0)),_.addGeometryType(e,t.geometryType),_.addIndexNodeSize(e,0),r&&_.addColumns(e,r),_.addName(e,n);const o=_.end(e);return e.finishSizePrefixed(o),e.asUint8Array()}(e),a=t.features.map(t=>function(t,e){const r=e.columns,n=new l.Builder(0),i=new Uint8Array(1e5);let a=0;if(r){const e=new DataView(i.buffer);for(let n=0;n<r.length;n++){const s=r[n],u=t.properties[s.name];if(null!==u)switch(e.setUint16(a,n,!0),a+=2,s.type){case o.Bool:e.setUint8(a,u),a+=1;break;case o.Short:e.setInt16(a,u,!0),a+=2;break;case o.UShort:e.setUint16(a,u,!0),a+=2;break;case o.Int:e.setInt32(a,u,!0),a+=4;break;case o.UInt:e.setUint32(a,u,!0),a+=4;break;case o.Long:e.setBigInt64(a,BigInt(u),!0),a+=8;break;case o.Long:e.setBigUint64(a,BigInt(u),!0),a+=8;break;case o.Double:e.setFloat64(a,u,!0),a+=8;break;case o.String:const t=u,r=(new TextEncoder).encode(t);e.setUint32(a,r.length,!0),a+=4,i.set(r,a),a+=r.length;break;default:throw new Error("Unknown type")}}}let s=null;a>0&&(s=h.createPropertiesVector(n,i.slice(0,a)));const u=function t(e,r){const{xy:n,ends:o,parts:i,type:a}=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 s=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,s),d.addType(e,a),d.end(e)}(n,g(t.geometry));h.start(n),h.addGeometry(n,u),s&&h.addProperties(n,s);const c=h.end(n);return n.finishSizePrefixed(c),n.asUint8Array()}(t,e)),s=a.map(t=>t.length).reduce((t,e)=>t+e),u=new Uint8Array(k.length+n.length+s);u.set(n,k.length);let c=k.length+n.length;for(const t of a)u.set(t,c),c+=t.length;return u.set(k),u}function z(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 l.ByteBuffer(t),o=n.readUint32(k.length);n.setPosition(k.length+4);const a=_.getRoot(n),s=a.featuresCount().toFloat64(),u=[];for(let t=0;t<a.columnsLength();t++){const e=a.columns(t);u.push(new r(e.name(),e.type()))}const c=new i(a.geometryType(),u,0);let f=k.length+4+o;const d=a.indexNodeSize();d>0&&(f+=C(s,d));const b=[];for(;f<n.capacity();){const t=n.readUint32(f);n.setPosition(f+4);const r=h.getRoot(n);b.push(e(r,c)),f+=4+t}return b}(t,(t,e)=>S(t,e))}}function M(t,e){return function(t,e,r){let n=0;return q(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?z(t):t instanceof e.ReadableStream?function(t,e){const r="function"==typeof(n=t).slice?n:new F("function"==typeof n.read?n:n.getReader());var n;return q(async t=>await r.slice(t),void 0,void 0,e)}(t,(t,e)=>S(t,e)):M(t,r)},t.serialize=function(t){return N(t)},Object.defineProperty(t,"__esModule",{value:!0})}(e,r(8))},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){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,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",a=n.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var o=e&&e.prototype instanceof f?e:f,i=Object.create(o.prototype),a=new E(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 B()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var s=g(a,r);if(s){if(s===l)continue;return s}}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,a),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 f(){}function d(){}function h(){}var b={};b[o]=function(){return this};var p=Object.getPrototypeOf,_=p&&p(p(I([])));_&&_!==e&&r.call(_,o)&&(b=_);var y=h.prototype=f.prototype=Object.create(b);function v(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function m(t,e){var n;this._invoke=function(o,i){function a(){return new e((function(n,a){!function n(o,i,a,s){var u=c(t[o],t,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==typeof f&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(f).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,s)}))}s(u.arg)}(o,i,n,a)}))}return n=n?n.then(a,a):a()}}function g(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,g(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 w(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 S(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function E(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(w,this),this.reset(!0)}function I(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:B}}function B(){return{value:void 0,done:!0}}return d.prototype=y.constructor=h,h.constructor=d,d.displayName=s(h,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,h):(t.__proto__=h,s(t,a,"GeneratorFunction")),t.prototype=Object.create(y),t},t.awrap=function(t){return{__await:t}},v(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 a=new m(u(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},v(y),s(y,a,"Generator"),y[o]=function(){return this},y.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=I,E.prototype={constructor:E,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(S),!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 a.type="throw",a.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],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){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 a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,l):this.complete(a)},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),S(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;S(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:I(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){"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 xe})),r.d(e,"TransformStream",(function(){return Ye})),r.d(e,"WritableStream",(function(){return at}));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},a=o;function s(t){return"object"==typeof t&&null!==t||"function"==typeof t}function u(t){return t.slice()}function c(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 l(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 h(o,t,n)};case 1:return function(e){var r=[e].concat(n);return h(o,t,r)}}}return function(){return w(void 0)}}function d(t,e,r){var n=t[e];if(void 0!==n)return l(n,t,r)}function h(t,e,r){try{return w(l(t,e,r))}catch(t){return S(t)}}function b(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 p(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 _=Promise,y=Promise.prototype.then,v=Promise.resolve.bind(_),m=Promise.reject.bind(_);function g(t){return new _(t)}function w(t){return v(t)}function S(t){return m(t)}function E(t,e,r){return y.call(t,e,r)}function I(t,e,r){E(E(t,e,r),void 0,a)}function B(t,e){I(t,e)}function T(t,e){I(t,void 0,e)}function R(t,e,r){return E(t,e,r)}function P(t){E(t,void 0,a)}var O=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 F(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),U(t)}(t):q(t,e._storedError)}function L(t,e){return We(t._ownerReadableStream,e)}function j(t){"readable"===t._ownerReadableStream._state?x(t,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")):function(t,e){q(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 A(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 q(t,e){k(t),x(t,e)}function x(t,e){P(t._closedPromise),t._closedPromise_reject(e),t._closedPromise_resolve=void 0,t._closedPromise_reject=void 0}function U(t){t._closedPromise_resolve(void 0),t._closedPromise_resolve=void 0,t._closedPromise_reject=void 0}var N=n("[[CancelSteps]]"),z=n("[[PullSteps]]");function M(t,e){void 0===e&&(e=!1);var r=new Y(t);return r._forAuthorCode=e,r}function W(t){return g((function(e,r){var n={_resolve:e,_reject:r};t._reader._readRequests.push(n)}))}function V(t,e,r){var n=t._reader;n._readRequests.shift()._resolve(F(e,r,n._forAuthorCode))}function D(t){return t._reader._readRequests.length}function G(t){var e=t._reader;return void 0!==e&&!!X(e)}var H,Z,Y=function(){function t(t){if(!1===ze(t))throw new TypeError("ReadableStreamDefaultReader can only be constructed with a ReadableStream instance");if(!0===Me(t))throw new TypeError("This stream has already been locked for exclusive reading by another reader");C(this,t),this._readRequests=new O}return Object.defineProperty(t.prototype,"closed",{get:function(){return X(this)?this._closedPromise:S($("closed"))},enumerable:!0,configurable:!0}),t.prototype.cancel=function(t){return X(this)?void 0===this._ownerReadableStream?S(A("cancel")):L(this,t):S($("cancel"))},t.prototype.read=function(){return X(this)?void 0===this._ownerReadableStream?S(A("read from")):J(this):S($("read"))},t.prototype.releaseLock=function(){if(!X(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");j(this)}},t}();function X(t){return!!s(t)&&!!Object.prototype.hasOwnProperty.call(t,"_readRequests")}function J(t){var e=t._ownerReadableStream;return e._disturbed=!0,"closed"===e._state?w(F(void 0,!0,t._forAuthorCode)):"errored"===e._state?S(e._storedError):e._readableStreamController[z]()}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(A("iterate")):R(J(t),(function(e){var r=e.done;return r&&j(t),F(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(A("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=L(e,t);return j(e),R(r,(function(){return F(t,!0,!0)}))}return j(e),w(F(t,!0,!0))}};function K(t){return!!s(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(!c(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 O,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]]"),at=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=p(r);void 0===n&&(n=1),function(t,e,r,n){var o=Object.create(Tt.prototype);var i=f(e,"write",1,[o]),a=f(e,"close",0,[]),s=f(e,"abort",1,[]);Rt(t,o,(function(){return d(e,"start",[o])}),i,a,s,r,n)}(this,t,n=b(n),o)}return Object.defineProperty(t.prototype,"locked",{get:function(){if(!1===ct(this))throw At("locked");return lt(this)},enumerable:!0,configurable:!0}),t.prototype.abort=function(t){return!1===ct(this)?S(At("abort")):!0===lt(this)?S(new TypeError("Cannot abort a stream that already has a writer")):ft(this,t)},t.prototype.close=function(){return!1===ct(this)?S(At("close")):!0===lt(this)?S(new TypeError("Cannot close a stream that already has a writer")):!0===_t(this)?S(new TypeError("Cannot close an already-closing stream")):dt(this)},t.prototype.getWriter=function(){if(!1===ct(this))throw At("getWriter");return st(this)},t}();function st(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 O,t._inFlightWriteRequest=void 0,t._closeRequest=void 0,t._inFlightCloseRequest=void 0,t._pendingAbortRequest=void 0,t._backpressure=!1}function ct(t){return!!s(t)&&!!Object.prototype.hasOwnProperty.call(t,"_writableStreamController")}function lt(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&&bt(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),Ft(r),n}function ht(t,e){"writable"!==t._state?pt(t):bt(t,e)}function bt(t,e){var r=t._writableStreamController;t._state="erroring",t._storedError=e;var n=t._writer;void 0!==n&&Et(n,e),!1===function(t){if(void 0===t._inFlightWriteRequest&&void 0===t._inFlightCloseRequest)return!1;return!0}(t)&&!0===r._started&&pt(t)}function pt(t){t._state="errored",t._writableStreamController[it]();var e=t._storedError;if(t._writeRequests.forEach((function(t){t._reject(e)})),t._writeRequests=new O,void 0!==t._pendingAbortRequest){var r=t._pendingAbortRequest;if(t._pendingAbortRequest=void 0,!0===r._wasAlreadyErroring)return r._reject(e),void yt(t);I(t._writableStreamController[ot](r._reason),(function(){r._resolve(),yt(t)}),(function(e){r._reject(e),yt(t)}))}else yt(t)}function _t(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){Mt(t)}(r):Gt(r)),t._backpressure=e}var mt=function(){function t(t){if(!1===ct(t))throw new TypeError("WritableStreamDefaultWriter can only be constructed with a WritableStream instance");if(!0===lt(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===_t(t)&&!0===t._backpressure?Mt(this):Vt(this),xt(this);else if("erroring"===r)Wt(this,t._storedError),xt(this);else if("closed"===r)Vt(this),xt(e=this),zt(e);else{var n=t._storedError;Wt(this,n),Ut(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 qt("desiredSize");return function(t){var e=t._ownerWritableStream,r=e._state;if("errored"===r||"erroring"===r)return null;if("closed"===r)return 0;return Ot(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(qt("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(qt("close")):!0===_t(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&&It(this)},t.prototype.write=function(t){return!1===gt(this)?S(kt("write")):void 0===this._ownerWritableStream?S(qt("write to")):Bt(this,t)},t}();function gt(t){return!!s(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){Ut(t,e)}(t,e)}function Et(t,e){"pending"===t._readyPromiseState?Dt(t,e):function(t,e){Wt(t,e)}(t,e)}function It(t){var e=t._ownerWritableStream,r=new TypeError("Writer was released and can no longer be used to monitor the stream's closedness");Et(t,r),St(t,r),e._writer=void 0,t._ownerWritableStream=void 0}function Bt(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(qt("write to"));var i=r._state;if("errored"===i)return S(r._storedError);if(!0===_t(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 a=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===_t(o)&&"writable"===o._state){var i=Lt(t);vt(o,i)}Ft(t)}(n,e,o),a}var Tt=function(){function t(){throw new TypeError("WritableStreamDefaultController cannot be constructed explicitly")}return t.prototype.error=function(t){if(!1===function(t){if(!s(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&&jt(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,a,s){e._controlledWritableStream=t,t._writableStreamController=e,e._queue=void 0,e._queueTotalSize=void 0,nt(e),e._started=!1,e._strategySizeAlgorithm=s,e._strategyHWM=a,e._writeAlgorithm=n,e._closeAlgorithm=o,e._abortAlgorithm=i;var u=Lt(e);vt(t,u),I(w(r()),(function(){e._started=!0,Ft(e)}),(function(r){e._started=!0,ht(t,r)}))}function Pt(t){t._writeAlgorithm=void 0,t._closeAlgorithm=void 0,t._abortAlgorithm=void 0,t._strategySizeAlgorithm=void 0}function Ot(t){return t._strategyHWM-t._queueTotalSize}function Ft(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),I(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&&zt(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),ht(t,e)}(e,t)}))}(t):function(t,e){var r=t._controlledWritableStream;(function(t){t._inFlightWriteRequest=t._writeRequests.shift()})(r),I(t._writeAlgorithm(e),(function(){!function(t){t._inFlightWriteRequest._resolve(void 0),t._inFlightWriteRequest=void 0}(r);var e=r._state;if(et(t),!1===_t(r)&&"writable"===e){var n=Lt(t);vt(r,n)}Ft(t)}),(function(e){"writable"===r._state&&Pt(t),function(t,e){t._inFlightWriteRequest._reject(e),t._inFlightWriteRequest=void 0,ht(t,e)}(r,e)}))}(t,r.chunk)}}else pt(e)}function Ct(t,e){"writable"===t._controlledWritableStream._state&&jt(t,e)}function Lt(t){return Ot(t)<=0}function jt(t,e){var r=t._controlledWritableStream;Pt(t),bt(r,e)}function At(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 qt(t){return new TypeError("Cannot "+t+" a stream using a released writer")}function xt(t){t._closedPromise=g((function(e,r){t._closedPromise_resolve=e,t._closedPromise_reject=r,t._closedPromiseState="pending"}))}function Ut(t,e){xt(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 zt(t){t._closedPromise_resolve(void 0),t._closedPromise_resolve=void 0,t._closedPromise_reject=void 0,t._closedPromiseState="resolved"}function Mt(t){t._readyPromise=g((function(e,r){t._readyPromise_resolve=e,t._readyPromise_reject=r})),t._readyPromiseState="pending"}function Wt(t,e){Mt(t),Dt(t,e)}function Vt(t){Mt(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 Yt,Xt=function(t){if("function"!=typeof t&&"object"!=typeof t)return!1;try{return new t,!0}catch(t){return!1}}(Zt)?Zt:((Yt=function(t,e){this.message=t||"",this.name=e||"Error",Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}).prototype=Object.create(Error.prototype),Object.defineProperty(Yt.prototype,"constructor",{value:Yt,writable:!0,configurable:!0}),Yt);function Jt(t,e,r,n,i,a){var s=M(t),u=st(e);t._disturbed=!0;var c=!1,l=w(void 0);return g((function(f,d){var h,b,p,_;if(void 0!==a){if(h=function(){var r=new Xt("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?We(t,r):w(void 0)})),R((function(){return Promise.all(o.map((function(t){return t()})))}),!0,r)},!0===a.aborted)return void h();a.addEventListener("abort",h)}if(m(t,s._closedPromise,(function(t){!1===n?R((function(){return ft(e,t)}),!0,t):O(!0,t)})),m(e,u._closedPromise,(function(e){!1===i?R((function(){return We(t,e)}),!0,e):O(!0,e)})),b=t,p=s._closedPromise,_=function(){!1===r?R((function(){return function(t){var e=t._ownerWritableStream,r=e._state;return!0===_t(e)||"closed"===r?w(void 0):"errored"===r?S(e._storedError):wt(t)}(u)})):O()},"closed"===b._state?_():B(p,_),!0===_t(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 We(t,y)}),!0,y):O(!0,y)}function v(){var t=l;return E(l,(function(){return t!==l?v():void 0}))}function m(t,e,r){"errored"===t._state?r(t._storedError):T(e,r)}function R(t,r,n){function o(){I(t(),(function(){return F(r,n)}),(function(t){return F(!0,t)}))}!0!==c&&(c=!0,"writable"===e._state&&!1===_t(e)?B(v(),o):o())}function O(t,r){!0!==c&&(c=!0,"writable"===e._state&&!1===_t(e)?B(v(),(function(){return F(t,r)})):F(t,r))}function F(t,e){It(u),j(s),void 0!==a&&a.removeEventListener("abort",h),t?d(e):f(void 0)}P(g((function(t,e){!function r(n){n?t():E(!0===c?w(!0):E(u._readyPromise,(function(){return E(J(s),(function(t){return!0===t.done||(l=E(Bt(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===ae(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===ae(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[z]=function(){var t=this._controlledReadableStream;if(this._queue.length>0){var e=et(this);return!0===this._closeRequested&&0===this._queue.length?(ee(this),Ve(t)):Kt(this),w(F(e,!1,t._reader._forAuthorCode))}var r=W(t);return Kt(this),r},t}();function Qt(t){return!!s(t)&&!!Object.prototype.hasOwnProperty.call(t,"_controlledReadableStream")}function Kt(t){!1!==te(t)&&(!0!==t._pulling?(t._pulling=!0,I(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!==ae(t)&&(!1!==t._started&&(!0===Me(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),Ve(e))}function ne(t,e){var r=t._controlledReadableStream;if(!0===Me(r)&&D(r)>0)V(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 ae(t){var e=t._controlledReadableStream._state;return!1===t._closeRequested&&"readable"===e}function se(t,e,r,n,o,i,a){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=a,e._strategyHWM=i,e._pullAlgorithm=n,e._cancelAlgorithm=o,t._readableStreamController=e,I(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 ce=Number.isInteger||function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t},le=function(){function t(){throw new TypeError("ReadableStreamBYOBRequest cannot be used directly")}return Object.defineProperty(t.prototype,"view",{get:function(){if(!1===he(this))throw Oe("view");return this._view},enumerable:!0,configurable:!0}),t.prototype.respond=function(t){if(!1===he(this))throw Oe("respond");if(void 0===this._associatedReadableByteStreamController)throw new TypeError("This BYOB request has been invalidated");this._view.buffer,function(t,e){if(!1===c(e=Number(e)))throw new RangeError("bytesWritten must be a finite");Ee(t,e)}(this._associatedReadableByteStreamController,t)},t.prototype.respondWithNewView=function(t){if(!1===he(this))throw Oe("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,Ee(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 Fe("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(le.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 Fe("desiredSize");return Re(this)},enumerable:!0,configurable:!0}),t.prototype.close=function(){if(!1===de(this))throw Fe("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 Te(t,r),r}}Be(t),Ve(e)}(this)},t.prototype.enqueue=function(t){if(!1===de(this))throw Fe("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,a=n;if(!0===G(r))if(0===D(r))ye(t,a,o,i);else{var s=new Uint8Array(a,o,i);V(r,s,!1)}else!0===je(r)?(ye(t,a,o,i),Se(t)):ye(t,a,o,i);be(t)}(this,t)},t.prototype.error=function(t){if(!1===de(this))throw Fe("error");Te(this,t)},t.prototype[N]=function(t){this._pendingPullIntos.length>0&&(this._pendingPullIntos.peek().bytesFilled=0);nt(this);var e=this._cancelAlgorithm(t);return Be(this),e},t.prototype[z]=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(F(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 a=W(t);return be(this),a},t}();function de(t){return!!s(t)&&!!Object.prototype.hasOwnProperty.call(t,"_controlledReadableByteStream")}function he(t){return!!s(t)&&!!Object.prototype.hasOwnProperty.call(t,"_associatedReadableByteStreamController")}function be(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===je(e)&&Le(e)>0)return!0;if(Re(t)>0)return!0;return!1}(t)&&(!0!==t._pulling?(t._pulling=!0,I(t._pullAlgorithm(),(function(){t._pulling=!1,!0===t._pullAgain&&(t._pullAgain=!1,be(t))}),(function(e){Te(t,e)}))):t._pullAgain=!0)}function pe(t,e){var r=!1;"closed"===t._state&&(r=!0);var n=_e(e);"default"===e.readerType?V(t,n,r):function(t,e,r){var n=t._reader;n._readIntoRequests.shift()._resolve(F(e,r,n._forAuthorCode))}(t,n,r)}function _e(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,a=i-i%r,s=o,u=!1;a>n&&(s=a-e.bytesFilled,u=!0);for(var c,l,f,d,h,b=t._queue;s>0;){var p=b.peek(),_=Math.min(s,p.byteLength),y=e.byteOffset+e.bytesFilled;c=e.buffer,l=y,f=p.buffer,d=p.byteOffset,h=_,new Uint8Array(c).set(new Uint8Array(f,d,h),l),p.byteLength===_?b.shift():(p.byteOffset+=_,p.byteLength-=_),t._queueTotalSize-=_,me(t,_,e),s-=_}return u}function me(t,e,r){we(t),r.bytesFilled+=e}function ge(t){0===t._queueTotalSize&&!0===t._closeRequested?(Be(t),Ve(t._controlledReadableByteStream)):be(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)&&(Ie(t),pe(t._controlledReadableByteStream,e))}}function Ee(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===je(r))for(;Le(r)>0;){pe(r,Ie(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)){Ie(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,pe(t._controlledReadableByteStream,r),Se(t)}}(t,e,r);be(t)}function Ie(t){var e=t._pendingPullIntos.shift();return we(t),e}function Be(t){t._pullAlgorithm=void 0,t._cancelAlgorithm=void 0}function Te(t,e){var r=t._controlledReadableByteStream;"readable"===r._state&&(!function(t){we(t),t._pendingPullIntos=new O}(t),nt(t),Be(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,[]),a=e.autoAllocateChunkSize;if(void 0!==a&&(a=Number(a),!1===ce(a)||a<=0))throw new RangeError("autoAllocateChunkSize must be a positive integer");!function(t,e,r,n,o,i,a){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=b(i),e._pullAlgorithm=n,e._cancelAlgorithm=o,e._autoAllocateChunkSize=a,e._pendingPullIntos=new O,t._readableStreamController=e,I(w(r()),(function(){e._started=!0,be(e)}),(function(t){Te(e,t)}))}(t,n,(function(){return d(e,"start",[n])}),o,i,r,a)}function Oe(t){return new TypeError("ReadableStreamBYOBRequest.prototype."+t+" can only be used on a ReadableStreamBYOBRequest")}function Fe(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 Le(t){return t._reader._readIntoRequests.length}function je(t){var e=t._reader;return void 0!==e&&!!ke(e)}var Ae=function(){function t(t){if(!ze(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(Me(t))throw new TypeError("This stream has already been locked for exclusive reading by another reader");C(this,t),this._readIntoRequests=new O}return Object.defineProperty(t.prototype,"closed",{get:function(){return ke(this)?this._closedPromise:S(qe("closed"))},enumerable:!0,configurable:!0}),t.prototype.cancel=function(t){return ke(this)?void 0===this._ownerReadableStream?S(A("cancel")):L(this,t):S(qe("cancel"))},t.prototype.read=function(t){return ke(this)?void 0===this._ownerReadableStream?S(A("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(F(new o(i.buffer,i.byteOffset,0),!0,r._reader._forAuthorCode));if(t._queueTotalSize>0){if(!0===ve(t,i)){var a=_e(i);return ge(t),w(F(a,!1,r._reader._forAuthorCode))}if(!0===t._closeRequested){var s=new TypeError("Insufficient bytes to fill elements in the given buffer");return Te(t,s),S(s)}}t._pendingPullIntos.push(i);var u=Ce(r);return be(t),u}(r._readableStreamController,e)}(this,t)):S(new TypeError("view must be an array buffer view")):S(qe("read"))},t.prototype.releaseLock=function(){if(!ke(this))throw qe("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");j(this)}},t}();function ke(t){return!!s(t)&&!!Object.prototype.hasOwnProperty.call(t,"_readIntoRequests")}function qe(t){return new TypeError("ReadableStreamBYOBReader.prototype."+t+" can only be used on a ReadableStreamBYOBReader")}var xe=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=b(n))}else{if(void 0!==o)throw new RangeError("Invalid type is specified");var i=p(r);void 0===n&&(n=1),function(t,e,r,n){var o=Object.create($t.prototype),i=f(e,"pull",0,[o]),a=f(e,"cancel",1,[]);se(t,o,(function(){return d(e,"start",[o])}),i,a,r,n)}(this,t,n=b(n),i)}}return Object.defineProperty(t.prototype,"locked",{get:function(){if(!1===ze(this))throw Ge("locked");return Me(this)},enumerable:!0,configurable:!0}),t.prototype.cancel=function(t){return!1===ze(this)?S(Ge("cancel")):!0===Me(this)?S(new TypeError("Cannot cancel a stream that already has a reader")):We(this,t)},t.prototype.getReader=function(t){var e=(void 0===t?{}:t).mode;if(!1===ze(this))throw Ge("getReader");if(void 0===e)return M(this,!0);if("byob"===(e=String(e)))return function(t,e){void 0===e&&(e=!1);var r=new Ae(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,a=o.preventAbort,s=o.preventCancel,u=o.signal;if(!1===ze(this))throw Ge("pipeThrough");if(!1===ct(r))throw new TypeError("writable argument to pipeThrough must be a WritableStream");if(!1===ze(n))throw new TypeError("readable argument to pipeThrough must be a ReadableStream");if(i=Boolean(i),a=Boolean(a),s=Boolean(s),void 0!==u&&!Ht(u))throw new TypeError("ReadableStream.prototype.pipeThrough's signal option must be an AbortSignal");if(!0===Me(this))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");if(!0===lt(r))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream");return P(Jt(this,r,i,a,s,u)),n},t.prototype.pipeTo=function(t,e){var r=void 0===e?{}:e,n=r.preventClose,o=r.preventAbort,i=r.preventCancel,a=r.signal;return!1===ze(this)?S(Ge("pipeTo")):!1===ct(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===a||Ht(a)?!0===Me(this)?S(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")):!0===lt(t)?S(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")):Jt(this,t,n,o,i,a):S(new TypeError("ReadableStream.prototype.pipeTo's signal option must be an AbortSignal")))},t.prototype.tee=function(){if(!1===ze(this))throw Ge("tee");var t=function(t,e){var r,n,o,i,a,s=M(t),c=!1,l=!1,f=!1,d=g((function(t){a=t}));function h(){return!0===c||(c=!0,P(R(J(s),(function(t){if(c=!1,!0===t.done)return!1===l&&re(o._readableStreamController),void(!1===f&&re(i._readableStreamController));var e=t.value,r=e,n=e;!1===l&&ne(o._readableStreamController,r),!1===f&&ne(i._readableStreamController,n)})))),w(void 0)}function b(){}return o=Ue(b,h,(function(e){if(l=!0,r=e,!0===f){var o=u([r,n]),i=We(t,o);a(i)}return d})),i=Ue(b,h,(function(e){if(f=!0,n=e,!0===l){var o=u([r,n]),i=We(t,o);a(i)}return d})),T(s._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===ze(this))throw Ge("getIterator");return function(t,e){void 0===e&&(e=!1);var r=M(t),n=Object.create(Q);return n._asyncIteratorReader=r,n._preventCancel=Boolean(e),n}(this,r)},t}();function Ue(t,e,r,n,o){void 0===n&&(n=1),void 0===o&&(o=function(){return 1});var i=Object.create(xe.prototype);return Ne(i),se(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 ze(t){return!!s(t)&&!!Object.prototype.hasOwnProperty.call(t,"_readableStreamController")}function Me(t){return void 0!==t._reader}function We(t,e){return t._disturbed=!0,"closed"===t._state?w(void 0):"errored"===t._state?S(t._storedError):(Ve(t),R(t._readableStreamController[N](e),o))}function Ve(t){t._state="closed";var e=t._reader;void 0!==e&&(X(e)&&(e._readRequests.forEach((function(t){t._resolve(F(void 0,!0,e._forAuthorCode))})),e._readRequests=new O),U(e))}function De(t,e){t._state="errored",t._storedError=e;var r=t._reader;void 0!==r&&(X(r)?(r._readRequests.forEach((function(t){t._reject(e)})),r._readRequests=new O):(r._readIntoRequests.forEach((function(t){t._reject(e)})),r._readIntoRequests=new O),x(r,e))}function Ge(t){return new TypeError("ReadableStream.prototype."+t+" can only be used on a ReadableStream")}"symbol"==typeof n.asyncIterator&&Object.defineProperty(xe.prototype,n.asyncIterator,{value:xe.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}(),Ye=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,a=r.highWaterMark;if(void 0!==t.writableType)throw new RangeError("Invalid writable type specified");var s=p(n);if(void 0===o&&(o=1),o=b(o),void 0!==t.readableType)throw new RangeError("Invalid readable type specified");var u,c=p(i);void 0===a&&(a=0),a=b(a),function(t,e,r,n,o,i){function a(){return e}t._writable=function(t,e,r,n,o,i){void 0===o&&(o=1),void 0===i&&(i=function(){return 1});var a=Object.create(at.prototype);return ut(a),Rt(a,Object.create(Tt.prototype),t,e,r,n,o,i),a}(a,(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===ae(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=Ue(a,(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,s,a,c),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 h(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 l=d(t,"start",[this._transformStreamController]);u(l)}return Object.defineProperty(t.prototype,"readable",{get:function(){if(!1===Xe(this))throw ir("readable");return this._readable},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"writable",{get:function(){if(!1===Xe(this))throw ir("writable");return this._writable},enumerable:!0,configurable:!0}),t}();function Xe(t){return!!s(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===ae(r)&&re(r);var n=new TypeError("TransformStream terminated");$e(e,n)}(this)},t}();function tr(t){return!!s(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===ae(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);var n=r(2),o=r.n(n),i=r(1),a=r.n(i),s=r(0),u=r.n(s),c=r(4),l=r.n(c),f=r(5),d=r.n(f),h=r(6),b=r.n(h);function p(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 _=new Map,y=function(){function t(){l()(this,t)}return d()(t,null,[{key:"onmessage",set:function(t){self.onmessage=function(e){if(v(e)){var r=e.data,n=r.type,o=r.payload;t(n,o)}}}},{key:"addEventListener",value:function(t){var e=_.get(t);e||(e=function(e){if(v(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=_.get(t);_.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(p(e))o.add(e);else if(p(e.buffer))o.add(e.buffer);else if(ArrayBuffer.isView(e));else if(r&&"object"===b()(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 v(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 g(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 w=0;function S(t,e){return new Promise((function(r,n){var o=w++;y.addEventListener((function t(e,i){if(i.id===o)switch(e){case"done":y.removeEventListener(t),r(i.result);break;case"error":y.removeEventListener(t),n(i.error)}}));var i={id:o,input:t,options:e};y.postMessage("process",i)}))}function E(t){return I.apply(this,arguments)}function I(){return(I=a()(u.a.mark((function t(e){var r,n,o,i,a,s,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}a=n,s=r.parseSync||r.parse,t.next=13;break;case 6:if(!r.parseTextSync){t.next=12;break}c=new TextDecoder,a=c.decode(n),s=r.parseTextSync,t.next=13;break;case 12:throw new Error("Could not load data with ".concat(r.name," loader"));case 13:return o=g(g({},o),{},{modules:r&&r.options&&r.options.modules||{},worker:!1}),t.next=16,s(a,g({},o),i,r);case 16:return t.abrupt("return",t.sent);case 17:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var B={id:"flatgeobuf",name:"FlatGeobuf",module:"flatgeobuf",version:"3.0.14",worker:!0,extensions:["fgb"],mimeTypes:["application/octet-stream"],category:"geometry",options:{flatgeobuf:{}}},T=r(3);function R(t,e){if(0===t.byteLength)return[];var r=new Uint8Array(t);return Object(T.deserialize)(r).features}function P(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 O(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?P(Object(r),!0).forEach((function(e){o()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):P(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var F,C,L=O(O({},B),{},{parse:(F=a()(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",R(e));case 1:case"end":return t.stop()}}),t)}))),function(t,e){return F.apply(this,arguments)}),parseSync:R,parseInBatchesFromStream:function(t,e){return Object(T.deserializeStream)(t)},binary:!0});C=L,"undefined"!=typeof self&&(y.onmessage=function(){var t=a()(u.a.mark((function t(e,r){var n,o,i,a,s;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,E({loader:C,arrayBuffer:n,options:i,context:{parse:S}});case 7:a=t.sent,y.postMessage("done",{result:a}),t.next=15;break;case 11:t.prev=11,t.t1=t.catch(3),s=t.t1 instanceof Error?t.t1.message:"",y.postMessage("error",{error:s});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=flatgeobuf-worker.js.map