You're Invited: Meet the Socket team at BSidesSF and RSAC - April 27 - May 1.RSVP
Socket
Sign inDemoInstall
Socket

@loaders.gl/flatgeobuf

Package Overview
Dependencies
Maintainers
7
Versions
236
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@loaders.gl/flatgeobuf - npm Package Compare versions

Comparing version

to
3.0.0-alpha.21

2

dist/dist.es5.min.js

@@ -1,2 +0,2 @@

!function(t){var e={};function r(i){if(e[i])return e[i].exports;var s=e[i]={i:i,l:!1,exports:{}};return t[i].call(s.exports,s,s.exports,r),s.l=!0,s.exports}r.m=t,r.c=e,r.d=function(t,e,i){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},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 i=Object.create(null);if(r.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var s in t)r.d(i,s,function(e){return t[e]}.bind(null,s));return i},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=0)}([function(t,e,r){"use strict";(function(e){var i=r(2),s="undefined"==typeof window?e:window;s.loaders=s.loaders||{},t.exports=Object.assign(s.loaders,i)}).call(this,r(1))},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"FlatGeobufLoader",{enumerable:!0,get:function(){return i.FlatGeobufLoader}});var i=r(3)},function(t,e,r){"use strict";function i(t){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.FlatGeobufLoader=e.FlatGeobufWorkerLoader=void 0;var s=function(t,e){if(!e&&t&&t.__esModule)return t;if(null===t||"object"!==i(t)&&"function"!=typeof t)return{default:t};var r=n(e);if(r&&r.has(t))return r.get(t);var s={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in t)if("default"!==a&&Object.prototype.hasOwnProperty.call(t,a)){var b=o?Object.getOwnPropertyDescriptor(t,a):null;b&&(b.get||b.set)?Object.defineProperty(s,a,b):s[a]=t[a]}s.default=t,r&&r.set(t,s);return s}(r(4));function n(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,r=new WeakMap;return(n=function(t){return t?r:e})(t)}function o(t,e,r,i,s,n,o){try{var a=t[n](o),b=a.value}catch(t){return void r(t)}a.done?e(b):Promise.resolve(b).then(i,s)}function a(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,i)}return r}function b(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?a(Object(r),!0).forEach((function(e){d(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function d(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var u={id:"flatgeobuf",name:"FlatGeobuf",module:"flatgeobuf",version:"3.0.0-alpha.20",worker:!0,extensions:["fgb"],category:"geometry",options:{flatgeobuf:{}}};e.FlatGeobufWorkerLoader=u;var h,f,c=b(b({},u),{},{parse:(h=regeneratorRuntime.mark((function t(e,r){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,s.default)(e,r));case 1:case"end":return t.stop()}}),t)})),f=function(){var t=this,e=arguments;return new Promise((function(r,i){var s=h.apply(t,e);function n(t){o(s,r,i,n,a,"next",t)}function a(t){o(s,r,i,n,a,"throw",t)}n(void 0)}))},function(t,e){return f.apply(this,arguments)}),parseSync:s.default,parseInBatchesFromStream:s.parseFlatGeobufInBatches,binary:!0});e.FlatGeobufLoader=c},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){if(0===t.byteLength)return[];var r=new Uint8Array(t);return(0,i.deserialize)(r).features},e.parseFlatGeobufInBatches=function(t,e){return(0,i.deserializeStream)(t)};var i=r(5)},function(t,e,r){!function(t){"use strict";class e{constructor(t,e,r,i,s,n,o,a,b,d){this.name=t,this.type=e,this.title=r,this.description=i,this.width=s,this.precision=n,this.scale=o,this.nullable=a,this.unique=b,this.primary_key=d}}var r,i,s,n,o={SIZEOF_SHORT:2,SIZEOF_INT:4,FILE_IDENTIFIER_LENGTH:4,SIZE_PREFIX_LENGTH:4,Encoding:{UTF8_BYTES:1,UTF16_STRING:2}};o.int32=new Int32Array(2),o.float32=new Float32Array(o.int32.buffer),o.float64=new Float64Array(o.int32.buffer),o.isLittleEndian=1===new Uint16Array(new Uint8Array([1,0]).buffer)[0],o.Long=function(t,e){this.low=0|t,this.high=0|e},o.Long.create=function(t,e){return 0==t&&0==e?o.Long.ZERO:new o.Long(t,e)},o.Long.prototype.toFloat64=function(){return(this.low>>>0)+4294967296*this.high},o.Long.prototype.equals=function(t){return this.low==t.low&&this.high==t.high},o.Long.ZERO=new o.Long(0,0),o.Builder=function(t){if(t)e=t;else var e=1024;this.bb=o.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},o.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},o.Builder.prototype.forceDefaults=function(t){this.force_defaults=t},o.Builder.prototype.dataBuffer=function(){return this.bb},o.Builder.prototype.asUint8Array=function(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())},o.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 i=this.bb.capacity();this.bb=o.Builder.growByteBuffer(this.bb),this.space+=this.bb.capacity()-i}this.pad(r)},o.Builder.prototype.pad=function(t){for(var e=0;e<t;e++)this.bb.writeInt8(--this.space,0)},o.Builder.prototype.writeInt8=function(t){this.bb.writeInt8(this.space-=1,t)},o.Builder.prototype.writeInt16=function(t){this.bb.writeInt16(this.space-=2,t)},o.Builder.prototype.writeInt32=function(t){this.bb.writeInt32(this.space-=4,t)},o.Builder.prototype.writeInt64=function(t){this.bb.writeInt64(this.space-=8,t)},o.Builder.prototype.writeFloat32=function(t){this.bb.writeFloat32(this.space-=4,t)},o.Builder.prototype.writeFloat64=function(t){this.bb.writeFloat64(this.space-=8,t)},o.Builder.prototype.addInt8=function(t){this.prep(1,0),this.writeInt8(t)},o.Builder.prototype.addInt16=function(t){this.prep(2,0),this.writeInt16(t)},o.Builder.prototype.addInt32=function(t){this.prep(4,0),this.writeInt32(t)},o.Builder.prototype.addInt64=function(t){this.prep(8,0),this.writeInt64(t)},o.Builder.prototype.addFloat32=function(t){this.prep(4,0),this.writeFloat32(t)},o.Builder.prototype.addFloat64=function(t){this.prep(8,0),this.writeFloat64(t)},o.Builder.prototype.addFieldInt8=function(t,e,r){(this.force_defaults||e!=r)&&(this.addInt8(e),this.slot(t))},o.Builder.prototype.addFieldInt16=function(t,e,r){(this.force_defaults||e!=r)&&(this.addInt16(e),this.slot(t))},o.Builder.prototype.addFieldInt32=function(t,e,r){(this.force_defaults||e!=r)&&(this.addInt32(e),this.slot(t))},o.Builder.prototype.addFieldInt64=function(t,e,r){!this.force_defaults&&e.equals(r)||(this.addInt64(e),this.slot(t))},o.Builder.prototype.addFieldFloat32=function(t,e,r){(this.force_defaults||e!=r)&&(this.addFloat32(e),this.slot(t))},o.Builder.prototype.addFieldFloat64=function(t,e,r){(this.force_defaults||e!=r)&&(this.addFloat64(e),this.slot(t))},o.Builder.prototype.addFieldOffset=function(t,e,r){(this.force_defaults||e!=r)&&(this.addOffset(e),this.slot(t))},o.Builder.prototype.addFieldStruct=function(t,e,r){e!=r&&(this.nested(e),this.slot(t))},o.Builder.prototype.nested=function(t){if(t!=this.offset())throw new Error("FlatBuffers: struct must be serialized inline.")},o.Builder.prototype.notNested=function(){if(this.isNested)throw new Error("FlatBuffers: object serialization must not be nested.")},o.Builder.prototype.slot=function(t){this.vtable[t]=this.offset()},o.Builder.prototype.offset=function(){return this.bb.capacity()-this.space},o.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,i=o.ByteBuffer.allocate(r);return i.setPosition(r-e),i.bytes().set(t.bytes(),r-e),i},o.Builder.prototype.addOffset=function(t){this.prep(o.SIZEOF_INT,0),this.writeInt32(this.offset()-t+o.SIZEOF_INT)},o.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()},o.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 i=(r+2)*o.SIZEOF_SHORT;this.addInt16(i);var s=0,n=this.space;t:for(e=0;e<this.vtables.length;e++){var a=this.bb.capacity()-this.vtables[e];if(i==this.bb.readInt16(a)){for(var b=o.SIZEOF_SHORT;b<i;b+=o.SIZEOF_SHORT)if(this.bb.readInt16(n+b)!=this.bb.readInt16(a+b))continue t;s=this.vtables[e];break}}return s?(this.space=this.bb.capacity()-t,this.bb.writeInt32(this.space,s-t)):(this.vtables.push(this.offset()),this.bb.writeInt32(this.bb.capacity()-t,this.offset()-t)),this.isNested=!1,t},o.Builder.prototype.finish=function(t,e,r){var i=r?o.SIZE_PREFIX_LENGTH:0;if(e){var s=e;if(this.prep(this.minalign,o.SIZEOF_INT+o.FILE_IDENTIFIER_LENGTH+i),s.length!=o.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: file identifier must be length "+o.FILE_IDENTIFIER_LENGTH);for(var n=o.FILE_IDENTIFIER_LENGTH-1;n>=0;n--)this.writeInt8(s.charCodeAt(n))}this.prep(this.minalign,o.SIZEOF_INT+i),this.addOffset(t),i&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)},o.Builder.prototype.finishSizePrefixed=function(t,e){this.finish(t,e,!0)},o.Builder.prototype.requiredField=function(t,e){var r=this.bb.capacity()-t,i=r-this.bb.readInt32(r);if(0==this.bb.readInt16(i+e))throw new Error("FlatBuffers: field "+e+" must be set")},o.Builder.prototype.startVector=function(t,e,r){this.notNested(),this.vector_num_elems=e,this.prep(o.SIZEOF_INT,t*e),this.prep(r,t*e)},o.Builder.prototype.endVector=function(){return this.writeInt32(this.vector_num_elems),this.offset()},o.Builder.prototype.createString=function(t){if(t instanceof Uint8Array)var e=t;else{e=[];for(var r=0;r<t.length;){var i,s=t.charCodeAt(r++);(i=s<55296||s>=56320?s:(s<<10)+t.charCodeAt(r++)+-56613888)<128?e.push(i):(i<2048?e.push(i>>6&31|192):(i<65536?e.push(i>>12&15|224):e.push(i>>18&7|240,i>>12&63|128),e.push(i>>6&63|128)),e.push(63&i|128))}}this.addInt8(0),this.startVector(1,e.length,1),this.bb.setPosition(this.space-=e.length),r=0;for(var n=this.space,o=this.bb.bytes();r<e.length;r++)o[n++]=e[r];return this.endVector()},o.Builder.prototype.createLong=function(t,e){return o.Long.create(t,e)},o.ByteBuffer=function(t){this.bytes_=t,this.position_=0},o.ByteBuffer.allocate=function(t){return new o.ByteBuffer(new Uint8Array(t))},o.ByteBuffer.prototype.clear=function(){this.position_=0},o.ByteBuffer.prototype.bytes=function(){return this.bytes_},o.ByteBuffer.prototype.position=function(){return this.position_},o.ByteBuffer.prototype.setPosition=function(t){this.position_=t},o.ByteBuffer.prototype.capacity=function(){return this.bytes_.length},o.ByteBuffer.prototype.readInt8=function(t){return this.readUint8(t)<<24>>24},o.ByteBuffer.prototype.readUint8=function(t){return this.bytes_[t]},o.ByteBuffer.prototype.readInt16=function(t){return this.readUint16(t)<<16>>16},o.ByteBuffer.prototype.readUint16=function(t){return this.bytes_[t]|this.bytes_[t+1]<<8},o.ByteBuffer.prototype.readInt32=function(t){return this.bytes_[t]|this.bytes_[t+1]<<8|this.bytes_[t+2]<<16|this.bytes_[t+3]<<24},o.ByteBuffer.prototype.readUint32=function(t){return this.readInt32(t)>>>0},o.ByteBuffer.prototype.readInt64=function(t){return new o.Long(this.readInt32(t),this.readInt32(t+4))},o.ByteBuffer.prototype.readUint64=function(t){return new o.Long(this.readUint32(t),this.readUint32(t+4))},o.ByteBuffer.prototype.readFloat32=function(t){return o.int32[0]=this.readInt32(t),o.float32[0]},o.ByteBuffer.prototype.readFloat64=function(t){return o.int32[o.isLittleEndian?0:1]=this.readInt32(t),o.int32[o.isLittleEndian?1:0]=this.readInt32(t+4),o.float64[0]},o.ByteBuffer.prototype.writeInt8=function(t,e){this.bytes_[t]=e},o.ByteBuffer.prototype.writeUint8=function(t,e){this.bytes_[t]=e},o.ByteBuffer.prototype.writeInt16=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8},o.ByteBuffer.prototype.writeUint16=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8},o.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},o.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},o.ByteBuffer.prototype.writeInt64=function(t,e){this.writeInt32(t,e.low),this.writeInt32(t+4,e.high)},o.ByteBuffer.prototype.writeUint64=function(t,e){this.writeUint32(t,e.low),this.writeUint32(t+4,e.high)},o.ByteBuffer.prototype.writeFloat32=function(t,e){o.float32[0]=e,this.writeInt32(t,o.int32[0])},o.ByteBuffer.prototype.writeFloat64=function(t,e){o.float64[0]=e,this.writeInt32(t,o.int32[o.isLittleEndian?0:1]),this.writeInt32(t+4,o.int32[o.isLittleEndian?1:0])},o.ByteBuffer.prototype.getBufferIdentifier=function(){if(this.bytes_.length<this.position_+o.SIZEOF_INT+o.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: ByteBuffer is too short to contain an identifier.");for(var t="",e=0;e<o.FILE_IDENTIFIER_LENGTH;e++)t+=String.fromCharCode(this.readInt8(this.position_+o.SIZEOF_INT+e));return t},o.ByteBuffer.prototype.__offset=function(t,e){var r=t-this.readInt32(t);return e<this.readInt16(r)?this.readInt16(r+e):0},o.ByteBuffer.prototype.__union=function(t,e){return t.bb_pos=e+this.readInt32(e),t.bb=this,t},o.ByteBuffer.prototype.__string=function(t,e){t+=this.readInt32(t);var r=this.readInt32(t),i="",s=0;if(t+=o.SIZEOF_INT,e===o.Encoding.UTF8_BYTES)return this.bytes_.subarray(t,t+r);for(;s<r;){var n,a=this.readUint8(t+s++);if(a<192)n=a;else{var b=this.readUint8(t+s++);if(a<224)n=(31&a)<<6|63&b;else{var d=this.readUint8(t+s++);n=a<240?(15&a)<<12|(63&b)<<6|63&d:(7&a)<<18|(63&b)<<12|(63&d)<<6|63&this.readUint8(t+s++)}}n<65536?i+=String.fromCharCode(n):(n-=65536,i+=String.fromCharCode(55296+(n>>10),56320+(1023&n)))}return i},o.ByteBuffer.prototype.__indirect=function(t){return t+this.readInt32(t)},o.ByteBuffer.prototype.__vector=function(t){return t+this.readInt32(t)+o.SIZEOF_INT},o.ByteBuffer.prototype.__vector_len=function(t){return this.readInt32(t+this.readInt32(t))},o.ByteBuffer.prototype.__has_identifier=function(t){if(t.length!=o.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: file identifier must be length "+o.FILE_IDENTIFIER_LENGTH);for(var e=0;e<o.FILE_IDENTIFIER_LENGTH;e++)if(t.charCodeAt(e)!=this.readInt8(this.position_+o.SIZEOF_INT+e))return!1;return!0},o.ByteBuffer.prototype.createLong=function(t,e){return o.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"}(r||(r={})),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"}(i||(i={}));class a{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 a).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRoot(t,e){return t.setPosition(t.position()+o.SIZE_PREFIX_LENGTH),(e||new a).__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):i.Byte}title(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}width(){var t=this.bb.__offset(this.bb_pos,12);return t?this.bb.readInt32(this.bb_pos+t):-1}precision(){var t=this.bb.__offset(this.bb_pos,14);return t?this.bb.readInt32(this.bb_pos+t):-1}scale(){var t=this.bb.__offset(this.bb_pos,16);return t?this.bb.readInt32(this.bb_pos+t):-1}nullable(){var t=this.bb.__offset(this.bb_pos,18);return!t||!!this.bb.readInt8(this.bb_pos+t)}unique(){var t=this.bb.__offset(this.bb_pos,20);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}primaryKey(){var t=this.bb.__offset(this.bb_pos,22);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}metadata(t){var e=this.bb.__offset(this.bb_pos,24);return e?this.bb.__string(this.bb_pos+e,t):null}static start(t){t.startObject(11)}static addName(t,e){t.addFieldOffset(0,e,0)}static addType(t,e){t.addFieldInt8(1,e,i.Byte)}static addTitle(t,e){t.addFieldOffset(2,e,0)}static addDescription(t,e){t.addFieldOffset(3,e,0)}static addWidth(t,e){t.addFieldInt32(4,e,-1)}static addPrecision(t,e){t.addFieldInt32(5,e,-1)}static addScale(t,e){t.addFieldInt32(6,e,-1)}static addNullable(t,e){t.addFieldInt8(7,+e,1)}static addUnique(t,e){t.addFieldInt8(8,+e,0)}static addPrimaryKey(t,e){t.addFieldInt8(9,+e,0)}static addMetadata(t,e){t.addFieldOffset(10,e,0)}static end(t){var e=t.endObject();return t.requiredField(e,4),e}static create(t,e,r,i,s,n,o,b,d,u,h,f){return a.start(t),a.addName(t,e),a.addType(t,r),a.addTitle(t,i),a.addDescription(t,s),a.addWidth(t,n),a.addPrecision(t,o),a.addScale(t,b),a.addNullable(t,d),a.addUnique(t,u),a.addPrimaryKey(t,h),a.addMetadata(t,f),a.end(t)}}class b{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRoot(t,e){return(e||new b).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRoot(t,e){return t.setPosition(t.position()+o.SIZE_PREFIX_LENGTH),(e||new b).__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}codeString(t){var e=this.bb.__offset(this.bb_pos,14);return e?this.bb.__string(this.bb_pos+e,t):null}static start(t){t.startObject(6)}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 addCodeString(t,e){t.addFieldOffset(5,e,0)}static end(t){return t.endObject()}static create(t,e,r,i,s,n,o){return b.start(t),b.addOrg(t,e),b.addCode(t,r),b.addName(t,i),b.addDescription(t,s),b.addWkt(t,n),b.addCodeString(t,o),b.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()+o.SIZE_PREFIX_LENGTH),(e||new d).__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):r.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 a).__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 b).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}title(t){var e=this.bb.__offset(this.bb_pos,26);return e?this.bb.__string(this.bb_pos+e,t):null}description(t){var e=this.bb.__offset(this.bb_pos,28);return e?this.bb.__string(this.bb_pos+e,t):null}metadata(t){var e=this.bb.__offset(this.bb_pos,30);return e?this.bb.__string(this.bb_pos+e,t):null}static start(t){t.startObject(14)}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,r.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 addTitle(t,e){t.addFieldOffset(11,e,0)}static addDescription(t,e){t.addFieldOffset(12,e,0)}static addMetadata(t,e){t.addFieldOffset(13,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,i,s,n,o,a,b,u,h,f,c,l,_){return d.start(t),d.addName(t,e),d.addEnvelope(t,r),d.addGeometryType(t,i),d.addHasZ(t,s),d.addHasM(t,n),d.addHasT(t,o),d.addHasTM(t,a),d.addColumns(t,b),d.addFeaturesCount(t,u),d.addIndexNodeSize(t,h),d.addCrs(t,f),d.addTitle(t,c),d.addDescription(t,l),d.addMetadata(t,_),d.end(t)}}class u{constructor(t,e,r,i,s,n){this.org=t,this.code=e,this.name=r,this.description=i,this.wkt=s,this.code_string=n}}class h{constructor(t,e,r,i,s,n,o,a){this.geometryType=t,this.columns=e,this.featuresCount=r,this.indexNodeSize=i,this.crs=s,this.title=n,this.description=o,this.metadata=a}static fromByteBuffer(t){const r=d.getRoot(t),i=r.featuresCount().toFloat64(),s=r.indexNodeSize(),n=[];for(let t=0;t<r.columnsLength();t++){const i=r.columns(t);if(!i)throw new Error("Column unexpectedly missing");if(!i.name())throw new Error("Column name unexpectedly missing");n.push(new e(i.name(),i.type(),i.title(),i.description(),i.width(),i.precision(),i.scale(),i.nullable(),i.unique(),i.primaryKey()))}const o=r.crs(),a=o?new u(o.org(),o.code(),o.name(),o.description(),o.wkt(),o.codeString()):null;return new h(r.geometryType(),n,i,s,a,r.title(),r.description(),r.metadata())}}!function(t){t[t.Unknown=0]="Unknown",t[t.Point=1]="Point",t[t.LineString=2]="LineString",t[t.Polygon=3]="Polygon",t[t.MultiPoint=4]="MultiPoint",t[t.MultiLineString=5]="MultiLineString",t[t.MultiPolygon=6]="MultiPolygon",t[t.GeometryCollection=7]="GeometryCollection",t[t.CircularString=8]="CircularString",t[t.CompoundCurve=9]="CompoundCurve",t[t.CurvePolygon=10]="CurvePolygon",t[t.MultiCurve=11]="MultiCurve",t[t.MultiSurface=12]="MultiSurface",t[t.Curve=13]="Curve",t[t.Surface=14]="Surface",t[t.PolyhedralSurface=15]="PolyhedralSurface",t[t.TIN=16]="TIN",t[t.Triangle=17]="Triangle"}(s||(s={})),function(t){t[t.Byte=0]="Byte",t[t.UByte=1]="UByte",t[t.Bool=2]="Bool",t[t.Short=3]="Short",t[t.UShort=4]="UShort",t[t.Int=5]="Int",t[t.UInt=6]="UInt",t[t.Long=7]="Long",t[t.ULong=8]="ULong",t[t.Float=9]="Float",t[t.Double=10]="Double",t[t.String=11]="String",t[t.Json=12]="Json",t[t.DateTime=13]="DateTime",t[t.Binary=14]="Binary"}(n||(n={}));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()+o.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):n.Byte}title(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}width(){var t=this.bb.__offset(this.bb_pos,12);return t?this.bb.readInt32(this.bb_pos+t):-1}precision(){var t=this.bb.__offset(this.bb_pos,14);return t?this.bb.readInt32(this.bb_pos+t):-1}scale(){var t=this.bb.__offset(this.bb_pos,16);return t?this.bb.readInt32(this.bb_pos+t):-1}nullable(){var t=this.bb.__offset(this.bb_pos,18);return!t||!!this.bb.readInt8(this.bb_pos+t)}unique(){var t=this.bb.__offset(this.bb_pos,20);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}primaryKey(){var t=this.bb.__offset(this.bb_pos,22);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}metadata(t){var e=this.bb.__offset(this.bb_pos,24);return e?this.bb.__string(this.bb_pos+e,t):null}static start(t){t.startObject(11)}static addName(t,e){t.addFieldOffset(0,e,0)}static addType(t,e){t.addFieldInt8(1,e,n.Byte)}static addTitle(t,e){t.addFieldOffset(2,e,0)}static addDescription(t,e){t.addFieldOffset(3,e,0)}static addWidth(t,e){t.addFieldInt32(4,e,-1)}static addPrecision(t,e){t.addFieldInt32(5,e,-1)}static addScale(t,e){t.addFieldInt32(6,e,-1)}static addNullable(t,e){t.addFieldInt8(7,+e,1)}static addUnique(t,e){t.addFieldInt8(8,+e,0)}static addPrimaryKey(t,e){t.addFieldInt8(9,+e,0)}static addMetadata(t,e){t.addFieldOffset(10,e,0)}static end(t){var e=t.endObject();return t.requiredField(e,4),e}static create(t,e,r,i,s,n,o,a,b,d,u,h){return f.start(t),f.addName(t,e),f.addType(t,r),f.addTitle(t,i),f.addDescription(t,s),f.addWidth(t,n),f.addPrecision(t,o),f.addScale(t,a),f.addNullable(t,b),f.addUnique(t,d),f.addPrimaryKey(t,u),f.addMetadata(t,h),f.end(t)}}class c{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 c).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRoot(t,e){return t.setPosition(t.position()+o.SIZE_PREFIX_LENGTH),(e||new c).__init(t.readInt32(t.position())+t.position(),t)}ends(t){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readUint32(this.bb.__vector(this.bb_pos+e)+4*t):0}endsLength(){var t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__vector_len(this.bb_pos+t):0}endsArray(){var t=this.bb.__offset(this.bb_pos,4);return t?new Uint32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}xy(t){var e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readFloat64(this.bb.__vector(this.bb_pos+e)+8*t):0}xyLength(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}xyArray(){var t=this.bb.__offset(this.bb_pos,6);return t?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}z(t){var e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readFloat64(this.bb.__vector(this.bb_pos+e)+8*t):0}zLength(){var t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}zArray(){var t=this.bb.__offset(this.bb_pos,8);return t?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}m(t){var e=this.bb.__offset(this.bb_pos,10);return e?this.bb.readFloat64(this.bb.__vector(this.bb_pos+e)+8*t):0}mLength(){var t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__vector_len(this.bb_pos+t):0}mArray(){var t=this.bb.__offset(this.bb_pos,10);return t?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}t(t){var e=this.bb.__offset(this.bb_pos,12);return e?this.bb.readFloat64(this.bb.__vector(this.bb_pos+e)+8*t):0}tLength(){var t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}tArray(){var t=this.bb.__offset(this.bb_pos,12);return t?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}tm(t){var e=this.bb.__offset(this.bb_pos,14);return e?this.bb.readUint64(this.bb.__vector(this.bb_pos+e)+8*t):this.bb.createLong(0,0)}tmLength(){var t=this.bb.__offset(this.bb_pos,14);return t?this.bb.__vector_len(this.bb_pos+t):0}type(){var t=this.bb.__offset(this.bb_pos,16);return t?this.bb.readUint8(this.bb_pos+t):s.Unknown}parts(t,e){var r=this.bb.__offset(this.bb_pos,18);return r?(e||new c).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*t),this.bb):null}partsLength(){var t=this.bb.__offset(this.bb_pos,18);return t?this.bb.__vector_len(this.bb_pos+t):0}static start(t){t.startObject(8)}static addEnds(t,e){t.addFieldOffset(0,e,0)}static createEndsVector(t,e){t.startVector(4,e.length,4);for(var r=e.length-1;r>=0;r--)t.addInt32(e[r]);return t.endVector()}static startEndsVector(t,e){t.startVector(4,e,4)}static addXy(t,e){t.addFieldOffset(1,e,0)}static createXyVector(t,e){t.startVector(8,e.length,8);for(var r=e.length-1;r>=0;r--)t.addFloat64(e[r]);return t.endVector()}static startXyVector(t,e){t.startVector(8,e,8)}static addZ(t,e){t.addFieldOffset(2,e,0)}static createZVector(t,e){t.startVector(8,e.length,8);for(var r=e.length-1;r>=0;r--)t.addFloat64(e[r]);return t.endVector()}static startZVector(t,e){t.startVector(8,e,8)}static addM(t,e){t.addFieldOffset(3,e,0)}static createMVector(t,e){t.startVector(8,e.length,8);for(var r=e.length-1;r>=0;r--)t.addFloat64(e[r]);return t.endVector()}static startMVector(t,e){t.startVector(8,e,8)}static addT(t,e){t.addFieldOffset(4,e,0)}static createTVector(t,e){t.startVector(8,e.length,8);for(var r=e.length-1;r>=0;r--)t.addFloat64(e[r]);return t.endVector()}static startTVector(t,e){t.startVector(8,e,8)}static addTm(t,e){t.addFieldOffset(5,e,0)}static createTmVector(t,e){t.startVector(8,e.length,8);for(var r=e.length-1;r>=0;r--)t.addInt64(e[r]);return t.endVector()}static startTmVector(t,e){t.startVector(8,e,8)}static addType(t,e){t.addFieldInt8(6,e,s.Unknown)}static addParts(t,e){t.addFieldOffset(7,e,0)}static createPartsVector(t,e){t.startVector(4,e.length,4);for(var r=e.length-1;r>=0;r--)t.addOffset(e[r]);return t.endVector()}static startPartsVector(t,e){t.startVector(4,e,4)}static end(t){return t.endObject()}static create(t,e,r,i,s,n,o,a,b){return c.start(t),c.addEnds(t,e),c.addXy(t,r),c.addZ(t,i),c.addM(t,s),c.addT(t,n),c.addTm(t,o),c.addType(t,a),c.addParts(t,b),c.end(t)}}class l{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 l).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRoot(t,e){return t.setPosition(t.position()+o.SIZE_PREFIX_LENGTH),(e||new l).__init(t.readInt32(t.position())+t.position(),t)}geometry(t){var e=this.bb.__offset(this.bb_pos,4);return e?(t||new c).__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,i){return l.start(t),l.addGeometry(t,e),l.addProperties(t,r),l.addColumns(t,i),l.end(t)}}function _(t,e){const{xy:r,z:i,ends:s,parts:n,type:o}=e;if(n){const e=n.map(e=>_(t,e)),r=c.createPartsVector(t,e);return c.start(t),c.addParts(t,r),c.end(t)}const a=c.createXyVector(t,r);let b,d;return i&&(b=c.createZVector(t,i)),s&&(d=c.createEndsVector(t,s)),c.start(t),d&&c.addEnds(t,d),c.addXy(t,a),b&&c.addZ(t,b),c.addType(t,o),c.end(t)}function p(t,e,r){if(0!==t.length)if(Array.isArray(t[0]))for(const i of t)p(i,e,r);else 2===t.length?e.push(...t):(e.push(t[0],t[1]),r.push(t[2]))}function y(t,e){const r=[];for(let i=0;i<t.length;i+=2){const s=[t[i],t[i+1]];e&&s.push(e[i>>1]),r.push(s)}return r}function g(t){return t?r[t]:r.Unknown}function v(t){const e=t.coordinates,r=[],i=[];let s,n;const o=g(t.type);let a=0;switch(t.type){case"Point":p(e,r,i);break;case"MultiPoint":case"LineString":p(e,r,i);break;case"MultiLineString":case"Polygon":{const t=e;p(t,r,i),t.length>1&&(s=t.map(t=>a+=t.length));break}case"MultiPolygon":n=e.map(t=>({type:"Polygon",coordinates:t})).map(v);break;case"GeometryCollection":t.geometries&&(n=t.geometries.map(v))}return{xy:r,z:i.length>0?i:void 0,ends:s,type:o,parts:n}}function w(t,e){if(e===r.GeometryCollection){const i=[];for(let e=0;e<t.partsLength();e++){const r=t.parts(e),s=r.type();i.push(w(r,s))}return{type:r[e],geometries:i}}if(e===r.MultiPolygon){const i=[];for(let e=0;e<t.partsLength();e++)i.push(w(t.parts(e),r.Polygon));return{type:r[e],coordinates:i.map(t=>t.coordinates)}}const i=function(t,e){const i=t.xyArray(),s=t.zArray();switch(e){case r.Point:{const t=Array.from(i);return s&&t.push(s[0]),t}case r.MultiPoint:case r.LineString:return y(i,s);case r.MultiLineString:case r.Polygon:return function(t,e,r){if(!r||0===r.length)return[y(t,e)];let i=0;const s=Array.from(r).map(e=>t.slice(i,i=e<<1));let n;return e&&(i=0,n=Array.from(r).map(t=>e.slice(i,i=t))),s.map((t,e)=>y(t,n?n[e]:void 0))}(i,s,t.endsArray())}}(t,e);return{type:r[e],coordinates:i}}const I=new TextEncoder,B=new TextDecoder;function m(t,e,r){const s=r.columns,n=new o.Builder;let a=0,b=1024,d=new Uint8Array(b),u=new DataView(d.buffer);const h=function(t){if(a+t<b)return;b*=2;const e=new Uint8Array(b);e.set(d),d=e,u=new DataView(d.buffer,a)};if(s)for(let t=0;t<s.length;t++){const r=s[t],n=e[r.name];if(null!==n)switch(u.setUint16(a,t,!0),a+=2,r.type){case i.Bool:h(1),u.setUint8(a,n),a+=1;break;case i.Short:h(2),u.setInt16(a,n,!0),a+=2;break;case i.UShort:h(2),u.setUint16(a,n,!0),a+=2;break;case i.Int:h(4),u.setInt32(a,n,!0),a+=4;break;case i.UInt:h(4),u.setUint32(a,n,!0),a+=4;break;case i.Long:h(8),u.setBigInt64(a,BigInt(n),!0),a+=8;break;case i.Double:h(8),u.setFloat64(a,n,!0),a+=8;break;case i.DateTime:case i.String:{const t=I.encode(n);h(4),u.setUint32(a,t.length,!0),a+=4,h(t.length),d.set(t,a),a+=t.length;break}default:throw new Error("Unknown type "+r.type)}}let f=null;a>0&&(f=l.createPropertiesVector(n,d.slice(0,a)));const c=_(n,t);l.start(n),l.addGeometry(n,c),f&&l.addProperties(n,f);const p=l.end(n);return n.finishSizePrefixed(p),n.asUint8Array()}function F(t,e){const r=e.columns,s={type:"Feature",geometry:w(t.geometry(),e.geometryType)};return r&&r.length>0&&(s.properties=function(t,e){const r={};if(!e||0===e.length)return r;const s=t.propertiesArray();if(!s)return r;const n=new DataView(s.buffer,s.byteOffset),o=t.propertiesLength();let a=0;for(;a<o;){const t=n.getUint16(a,!0);a+=2;const o=e[t],b=o.name;switch(o.type){case i.Bool:r[b]=!!n.getUint8(a),a+=1;break;case i.Byte:r[b]=n.getInt8(a),a+=1;break;case i.UByte:r[b]=n.getUint8(a),a+=1;break;case i.Short:r[b]=n.getInt16(a,!0),a+=2;break;case i.UShort:r[b]=n.getUint16(a,!0),a+=2;break;case i.Int:r[b]=n.getInt32(a,!0),a+=4;break;case i.UInt:r[b]=n.getUint32(a,!0),a+=4;break;case i.Long:r[b]=Number(n.getBigInt64(a,!0)),a+=8;break;case i.ULong:r[b]=Number(n.getBigUint64(a,!0)),a+=8;break;case i.Double:r[b]=n.getFloat64(a,!0),a+=8;break;case i.DateTime:case i.String:{const t=n.getUint32(a,!0);a+=4,r[b]=B.decode(s.subarray(a,a+t)),a+=t;break}default:throw new Error("Unknown type "+o.type)}}return r}(t,r)),s}var E,S=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 U(t){this._source=t,this._array=S,this._index=0}U.prototype.read=function(){var t=this,e=t._array.subarray(t._index);return t._source.read().then((function(r){return t._array=S,t._index=0,r.done?e.length>0?{done:!1,value:e}:{done:!0,value:void 0}:{done:!1,value:O(e,r.value)}}))},U.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 i=new Uint8Array(t);return i.set(this._array.subarray(this._index)),function s(){return e._source.read().then((function(n){return n.done?(e._array=S,e._index=0,r>0?i.subarray(0,r):null):r+n.value.length>=t?(e._array=n.value,e._index=t-r,i.set(n.value.subarray(0,t-r),r),i):(i.set(n.value,r),r+=n.value.length,s())}))}()},U.prototype.cancel=function(){return this._source.cancel()},function(t){t[t.Debug=0]="Debug",t[t.Info=1]="Info",t[t.Warn=2]="Warn",t[t.Error=3]="Error"}(E||(E={}));class P{static debug(...t){this.log(E.Debug,...t)}static info(...t){this.log(E.Info,...t)}static warn(...t){this.log(E.Warn,...t)}static error(...t){this.log(E.Error,...t)}static log(t,...e){if(!(this.logLevel>t))switch(t){case E.Debug:console.debug(...e);break;case E.Info:console.info(...e);break;case E.Warn:console.warn(...e);break;case E.Error:console.error(...e)}}}function L(t,e){e=Math.min(Math.max(+e,2),65535);let r=t,i=r;do{r=Math.ceil(r/e),i+=r}while(1!==r);return 40*i}function T(t,e){if(0!=(4293918720&t))throw Error("integer is too large to be safely represented");return e+t*2**32}P.logLevel=E.Info;const N=new Uint8Array([102,103,98,3,102,103,98,0]);class C{constructor(t,e,r,i){this.headerClient=t,this.header=e,this.headerLength=r,this.indexLength=i}static async open(t){let e=new V(t);const r=(()=>{let t,e=0;for(t=0;t<3;t++)e+=16**t*40;return e})(),i=2024+r;P.debug(`fetching header. minReqLength: ${i} (assumedHeaderLength: 2024, assumedIndexLength: ${r})`);{let t=new Uint8Array(await e.getRange(0,8,i,"header"));if(!t.every((t,e)=>N[e]===t))throw P.error(`bytes: ${t} != ${N}`),new Error("Not a FlatGeobuf file");P.debug("magic bytes look good")}let s;{let t=await e.getRange(8,4,i,"header");if(s=new DataView(t).getUint32(0,!0),s>10485760||s<8)throw new Error("Invalid header size");P.debug("headerLength: "+s)}const n=await e.getRange(12,s,i,"header"),a=new o.ByteBuffer(new Uint8Array(n)),b=h.fromByteBuffer(a),d=L(b.featuresCount,b.indexNodeSize);return P.debug("completed: opening http reader"),new C(e,b,s,d)}async*selectBbox(t){const e=this.lengthBeforeTree();let r=this.headerClient;P.debug("starting: selectBbox, traversing index. lengthBeforeTree: "+e),yield*async function*(t,e,r,i){class s{constructor(t,e){this._level=e,this.nodes=t}level(){return this._level}startNode(){return this.nodes[0]}endNode(){return this.nodes[1]}extendEndNodeToNewOffset(t){console.assert(t>this.nodes[1]),this.nodes[1]=t}toString(){return`[NodeRange level: ${this._level}, nodes: ${this.nodes[0]}-${this.nodes[1]}]`}}const{minX:n,minY:o,maxX:a,maxY:b}=r,d=function(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,i=r;const s=[r];do{r=Math.ceil(r/e),i+=r,s.push(r)}while(1!==r);const n=[];r=i;for(const t of s)n.push(r-t),r-=t;n.reverse(),s.reverse();const o=[];for(let t=0;t<s.length;t++)o.push([n[t],n[t]+s[t]]);return o.reverse(),o}(t,e),u=d[0][0],h=[(()=>{const t=d.length-1;return new s([0,1],t)})()];for(P.debug(`starting stream search with queue: ${h}, numItems: ${t}, nodeSize: ${e}, levelBounds: ${d}`);0!=h.length;){const t=h.shift();P.debug(`popped node: ${t}, queueLength: ${h.length}`);let r=t.startNode();const f=r>=u,[,c]=d[t.level()],l=Math.min(t.endNode()+e,c),_=l-r,p=await i(40*r,40*_),y=new Float64Array(p),g=new Uint32Array(p);for(let e=r;e<l;e++){const i=5*(e-r);if(a<y[i+0])continue;if(b<y[i+1])continue;if(n>y[i+2])continue;if(o>y[i+3])continue;const d=g[8+(i<<1)],c=T(g[9+(i<<1)],d);if(f){P.debug("yielding feature"),yield[c,e-u];continue}const l=6553.6,_=h[h.length-1];if(void 0!==_&&_.level()==t.level()-1&&c<_.endNode()+l){P.debug(`Extending existing node: ${_}, newOffset: ${_.endNode()} -> ${c}`),_.extendEndNodeToNewOffset(c);continue}let p=(()=>{let e=t.level()-1;return new s([c,c+1],e)})();void 0!==_&&_.level()==t.level()-1?P.debug(`pushing new node at offset: ${c} rather than merging with distant ${_}`):P.debug(`pushing new level for ${p} onto queue with tail: ${_}`),h.push(p)}}}(this.header.featuresCount,this.header.indexNodeSize,t,(async function(t,i){return r.getRange(e+t,i,0,"index")}))}lengthBeforeTree(){return N.length+4+this.headerLength}lengthBeforeFeatures(){return this.lengthBeforeTree()+this.indexLength}featureClient(){return void 0===this._featureClient&&(this._featureClient=this.headerClient.clone()),this._featureClient}async readFeature(t){const e=131072;let r,i=t+this.lengthBeforeFeatures();{const t=await this.featureClient().getRange(i,4,e,"feature length");r=new DataView(t).getUint32(0,!0)}P.debug(`featureOffset: ${i}, featureLength: ${r}`);let s=await this.featureClient().getRange(i+4,r,e,"feature data"),n=new Uint8Array(s);const a=new Uint8Array(r+4);a.set(n,4);const b=new o.ByteBuffer(a);return b.setPosition(4),l.getRoot(b)}}class V{constructor(t){this.buffer=new ArrayBuffer(0),this.head=0,this.httpClient="string"==typeof t?new x(t):t}clone(){let t=new V(this.httpClient);return t.buffer=this.buffer.slice(0),t.head=this.head,t}async getRange(t,e,r,i){P.debug(`need Range: ${t}-${t+e-1}`);const s=t-this.head,n=s+e;if(s>=0&&n<this.buffer.byteLength)return P.debug(`slicing existing Range: ${s}-${n-1}`),this.buffer.slice(s,n);let o=Math.max(e,r);return this.buffer=await this.httpClient.getRange(t,o,i),this.head=t,this.buffer.slice(0,e)}}class x{constructor(t){this.requestsEverMade=0,this.bytesEverRequested=0,this.url=t}async getRange(t,e,r){this.requestsEverMade+=1,this.bytesEverRequested+=e;let i=`bytes=${t}-${t+e-1}`;return P.debug(`request: #${this.requestsEverMade}, purpose: ${r}), bytes: (this_request: ${e}, ever: ${this.bytesEverRequested}), Range: ${i}`),(await fetch(this.url,{headers:{Range:i}})).arrayBuffer()}}async function M(t,e,r){let i=new Uint8Array(await t(4,"feature length"));if(0===i.byteLength)return;let s=new o.ByteBuffer(i);const n=s.readUint32(0);i=new Uint8Array(await t(n,"feature data"));const a=new Uint8Array(n+4);return a.set(i,4),s=new o.ByteBuffer(a),s.setPosition(4),r(l.getRoot(s),e)}function R(t){const e=new o.Builder;let r=null;t.columns&&(r=d.createColumnsVector(e,t.columns.map(t=>function(t,e){const r=t.createString(e.name);return a.start(t),a.addName(t,r),a.addType(t,e.type),a.end(t)}(e,t))));const i=e.createString("L1");d.start(e),d.addFeaturesCount(e,new o.Long(t.featuresCount,0)),d.addGeometryType(e,t.geometryType),d.addIndexNodeSize(e,0),r&&d.addColumns(e,r),d.addName(e,i);const s=d.end(e);return e.finishSizePrefixed(s),e.asUint8Array()}t.deserialize=function(t,e,r){return t instanceof Uint8Array?function(t,e){return{type:"FeatureCollection",features:function(t,e,r){if(!t.subarray(0,7).every((t,e)=>N[e]===t))throw new Error("Not a FlatGeobuf file");const i=new o.ByteBuffer(t),s=i.readUint32(N.length);i.setPosition(N.length+4);const n=h.fromByteBuffer(i);r&&r(n);let a=N.length+4+s;const{indexNodeSize:b,featuresCount:d}=n;b>0&&(a+=L(d,b));const u=[];for(;a<i.capacity();){const t=i.readUint32(a);i.setPosition(a+4);const r=l.getRoot(i);u.push(e(r,n)),a+=4+t}return u}(t,F,e)}}(t,r):t instanceof ReadableStream?function(t,e){return async function*(t,e,r){const i="function"==typeof(s=t).slice?s:new U("function"==typeof s.read?s:s.getReader());var s;const n=async t=>await i.slice(t);let a=new Uint8Array(await n(8));if(!a.every((t,e)=>N[e]===t))throw new Error("Not a FlatGeobuf file");a=new Uint8Array(await n(4));let b=new o.ByteBuffer(a);const d=b.readUint32(0);a=new Uint8Array(await n(d)),b=new o.ByteBuffer(a);const u=h.fromByteBuffer(b);r&&r(u);const{indexNodeSize:f,featuresCount:c}=u;if(f>0){const t=L(c,f);await n(t)}let l;for(;l=await M(n,u,e);)yield l}(t,F,e)}(t,r):function(t,e,r){return async function*(t,e,r,i){const s=await C.open(t);P.debug("opened reader"),i&&i(s.header);for await(let t of s.selectBbox(e)){let e=await s.readFeature(t[0]);yield r(e,s.header)}}(t,e,F,r)}(t,e,r)},t.serialize=function(t){return function(t){const r=function(t){const r=t.features[0],s=r.properties;let n=null;return s&&(n=Object.keys(s).map(t=>new e(t,function(t){if("boolean"==typeof t)return i.Bool;if("number"==typeof t)return t%1==0?i.Int:i.Double;if("string"==typeof t)return i.String;if(null===t)return i.String;throw new Error(`Unknown type (value '${t}')`)}(s[t]),null,null,-1,-1,-1,!0,!1,!1))),new h(g(r.geometry.type),n,t.features.length,0,null,null,null,null)}(t),s=R(r),n=t.features.map(t=>m(v(t.geometry),t.properties,r)),o=n.map(t=>t.length).reduce((t,e)=>t+e),a=new Uint8Array(N.length+s.length+o);a.set(s,N.length);let b=N.length+s.length;for(const t of n)a.set(t,b),b+=t.length;return a.set(N),a}(t)},Object.defineProperty(t,"__esModule",{value:!0})}(e)}]);
!function(t){var e={};function r(i){if(e[i])return e[i].exports;var s=e[i]={i:i,l:!1,exports:{}};return t[i].call(s.exports,s,s.exports,r),s.l=!0,s.exports}r.m=t,r.c=e,r.d=function(t,e,i){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},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 i=Object.create(null);if(r.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var s in t)r.d(i,s,function(e){return t[e]}.bind(null,s));return i},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=0)}([function(t,e,r){"use strict";(function(e){var i=r(2),s="undefined"==typeof window?e:window;s.loaders=s.loaders||{},t.exports=Object.assign(s.loaders,i)}).call(this,r(1))},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"FlatGeobufLoader",{enumerable:!0,get:function(){return i.FlatGeobufLoader}});var i=r(3)},function(t,e,r){"use strict";function i(t){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.FlatGeobufLoader=e.FlatGeobufWorkerLoader=void 0;var s=function(t,e){if(!e&&t&&t.__esModule)return t;if(null===t||"object"!==i(t)&&"function"!=typeof t)return{default:t};var r=n(e);if(r&&r.has(t))return r.get(t);var s={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in t)if("default"!==a&&Object.prototype.hasOwnProperty.call(t,a)){var b=o?Object.getOwnPropertyDescriptor(t,a):null;b&&(b.get||b.set)?Object.defineProperty(s,a,b):s[a]=t[a]}s.default=t,r&&r.set(t,s);return s}(r(4));function n(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,r=new WeakMap;return(n=function(t){return t?r:e})(t)}function o(t,e,r,i,s,n,o){try{var a=t[n](o),b=a.value}catch(t){return void r(t)}a.done?e(b):Promise.resolve(b).then(i,s)}function a(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,i)}return r}function b(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?a(Object(r),!0).forEach((function(e){d(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function d(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var u={id:"flatgeobuf",name:"FlatGeobuf",module:"flatgeobuf",version:"3.0.0-alpha.21",worker:!0,extensions:["fgb"],category:"geometry",options:{flatgeobuf:{}}};e.FlatGeobufWorkerLoader=u;var h,f,c=b(b({},u),{},{parse:(h=regeneratorRuntime.mark((function t(e,r){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,s.default)(e,r));case 1:case"end":return t.stop()}}),t)})),f=function(){var t=this,e=arguments;return new Promise((function(r,i){var s=h.apply(t,e);function n(t){o(s,r,i,n,a,"next",t)}function a(t){o(s,r,i,n,a,"throw",t)}n(void 0)}))},function(t,e){return f.apply(this,arguments)}),parseSync:s.default,parseInBatchesFromStream:s.parseFlatGeobufInBatches,binary:!0});e.FlatGeobufLoader=c},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){if(0===t.byteLength)return[];var r=new Uint8Array(t);return(0,i.deserialize)(r).features},e.parseFlatGeobufInBatches=function(t,e){return(0,i.deserializeStream)(t)};var i=r(5)},function(t,e,r){!function(t){"use strict";class e{constructor(t,e,r,i,s,n,o,a,b,d){this.name=t,this.type=e,this.title=r,this.description=i,this.width=s,this.precision=n,this.scale=o,this.nullable=a,this.unique=b,this.primary_key=d}}var r,i,s,n,o={SIZEOF_SHORT:2,SIZEOF_INT:4,FILE_IDENTIFIER_LENGTH:4,SIZE_PREFIX_LENGTH:4,Encoding:{UTF8_BYTES:1,UTF16_STRING:2}};o.int32=new Int32Array(2),o.float32=new Float32Array(o.int32.buffer),o.float64=new Float64Array(o.int32.buffer),o.isLittleEndian=1===new Uint16Array(new Uint8Array([1,0]).buffer)[0],o.Long=function(t,e){this.low=0|t,this.high=0|e},o.Long.create=function(t,e){return 0==t&&0==e?o.Long.ZERO:new o.Long(t,e)},o.Long.prototype.toFloat64=function(){return(this.low>>>0)+4294967296*this.high},o.Long.prototype.equals=function(t){return this.low==t.low&&this.high==t.high},o.Long.ZERO=new o.Long(0,0),o.Builder=function(t){if(t)e=t;else var e=1024;this.bb=o.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},o.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},o.Builder.prototype.forceDefaults=function(t){this.force_defaults=t},o.Builder.prototype.dataBuffer=function(){return this.bb},o.Builder.prototype.asUint8Array=function(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())},o.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 i=this.bb.capacity();this.bb=o.Builder.growByteBuffer(this.bb),this.space+=this.bb.capacity()-i}this.pad(r)},o.Builder.prototype.pad=function(t){for(var e=0;e<t;e++)this.bb.writeInt8(--this.space,0)},o.Builder.prototype.writeInt8=function(t){this.bb.writeInt8(this.space-=1,t)},o.Builder.prototype.writeInt16=function(t){this.bb.writeInt16(this.space-=2,t)},o.Builder.prototype.writeInt32=function(t){this.bb.writeInt32(this.space-=4,t)},o.Builder.prototype.writeInt64=function(t){this.bb.writeInt64(this.space-=8,t)},o.Builder.prototype.writeFloat32=function(t){this.bb.writeFloat32(this.space-=4,t)},o.Builder.prototype.writeFloat64=function(t){this.bb.writeFloat64(this.space-=8,t)},o.Builder.prototype.addInt8=function(t){this.prep(1,0),this.writeInt8(t)},o.Builder.prototype.addInt16=function(t){this.prep(2,0),this.writeInt16(t)},o.Builder.prototype.addInt32=function(t){this.prep(4,0),this.writeInt32(t)},o.Builder.prototype.addInt64=function(t){this.prep(8,0),this.writeInt64(t)},o.Builder.prototype.addFloat32=function(t){this.prep(4,0),this.writeFloat32(t)},o.Builder.prototype.addFloat64=function(t){this.prep(8,0),this.writeFloat64(t)},o.Builder.prototype.addFieldInt8=function(t,e,r){(this.force_defaults||e!=r)&&(this.addInt8(e),this.slot(t))},o.Builder.prototype.addFieldInt16=function(t,e,r){(this.force_defaults||e!=r)&&(this.addInt16(e),this.slot(t))},o.Builder.prototype.addFieldInt32=function(t,e,r){(this.force_defaults||e!=r)&&(this.addInt32(e),this.slot(t))},o.Builder.prototype.addFieldInt64=function(t,e,r){!this.force_defaults&&e.equals(r)||(this.addInt64(e),this.slot(t))},o.Builder.prototype.addFieldFloat32=function(t,e,r){(this.force_defaults||e!=r)&&(this.addFloat32(e),this.slot(t))},o.Builder.prototype.addFieldFloat64=function(t,e,r){(this.force_defaults||e!=r)&&(this.addFloat64(e),this.slot(t))},o.Builder.prototype.addFieldOffset=function(t,e,r){(this.force_defaults||e!=r)&&(this.addOffset(e),this.slot(t))},o.Builder.prototype.addFieldStruct=function(t,e,r){e!=r&&(this.nested(e),this.slot(t))},o.Builder.prototype.nested=function(t){if(t!=this.offset())throw new Error("FlatBuffers: struct must be serialized inline.")},o.Builder.prototype.notNested=function(){if(this.isNested)throw new Error("FlatBuffers: object serialization must not be nested.")},o.Builder.prototype.slot=function(t){this.vtable[t]=this.offset()},o.Builder.prototype.offset=function(){return this.bb.capacity()-this.space},o.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,i=o.ByteBuffer.allocate(r);return i.setPosition(r-e),i.bytes().set(t.bytes(),r-e),i},o.Builder.prototype.addOffset=function(t){this.prep(o.SIZEOF_INT,0),this.writeInt32(this.offset()-t+o.SIZEOF_INT)},o.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()},o.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 i=(r+2)*o.SIZEOF_SHORT;this.addInt16(i);var s=0,n=this.space;t:for(e=0;e<this.vtables.length;e++){var a=this.bb.capacity()-this.vtables[e];if(i==this.bb.readInt16(a)){for(var b=o.SIZEOF_SHORT;b<i;b+=o.SIZEOF_SHORT)if(this.bb.readInt16(n+b)!=this.bb.readInt16(a+b))continue t;s=this.vtables[e];break}}return s?(this.space=this.bb.capacity()-t,this.bb.writeInt32(this.space,s-t)):(this.vtables.push(this.offset()),this.bb.writeInt32(this.bb.capacity()-t,this.offset()-t)),this.isNested=!1,t},o.Builder.prototype.finish=function(t,e,r){var i=r?o.SIZE_PREFIX_LENGTH:0;if(e){var s=e;if(this.prep(this.minalign,o.SIZEOF_INT+o.FILE_IDENTIFIER_LENGTH+i),s.length!=o.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: file identifier must be length "+o.FILE_IDENTIFIER_LENGTH);for(var n=o.FILE_IDENTIFIER_LENGTH-1;n>=0;n--)this.writeInt8(s.charCodeAt(n))}this.prep(this.minalign,o.SIZEOF_INT+i),this.addOffset(t),i&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)},o.Builder.prototype.finishSizePrefixed=function(t,e){this.finish(t,e,!0)},o.Builder.prototype.requiredField=function(t,e){var r=this.bb.capacity()-t,i=r-this.bb.readInt32(r);if(0==this.bb.readInt16(i+e))throw new Error("FlatBuffers: field "+e+" must be set")},o.Builder.prototype.startVector=function(t,e,r){this.notNested(),this.vector_num_elems=e,this.prep(o.SIZEOF_INT,t*e),this.prep(r,t*e)},o.Builder.prototype.endVector=function(){return this.writeInt32(this.vector_num_elems),this.offset()},o.Builder.prototype.createString=function(t){if(t instanceof Uint8Array)var e=t;else{e=[];for(var r=0;r<t.length;){var i,s=t.charCodeAt(r++);(i=s<55296||s>=56320?s:(s<<10)+t.charCodeAt(r++)+-56613888)<128?e.push(i):(i<2048?e.push(i>>6&31|192):(i<65536?e.push(i>>12&15|224):e.push(i>>18&7|240,i>>12&63|128),e.push(i>>6&63|128)),e.push(63&i|128))}}this.addInt8(0),this.startVector(1,e.length,1),this.bb.setPosition(this.space-=e.length),r=0;for(var n=this.space,o=this.bb.bytes();r<e.length;r++)o[n++]=e[r];return this.endVector()},o.Builder.prototype.createLong=function(t,e){return o.Long.create(t,e)},o.ByteBuffer=function(t){this.bytes_=t,this.position_=0},o.ByteBuffer.allocate=function(t){return new o.ByteBuffer(new Uint8Array(t))},o.ByteBuffer.prototype.clear=function(){this.position_=0},o.ByteBuffer.prototype.bytes=function(){return this.bytes_},o.ByteBuffer.prototype.position=function(){return this.position_},o.ByteBuffer.prototype.setPosition=function(t){this.position_=t},o.ByteBuffer.prototype.capacity=function(){return this.bytes_.length},o.ByteBuffer.prototype.readInt8=function(t){return this.readUint8(t)<<24>>24},o.ByteBuffer.prototype.readUint8=function(t){return this.bytes_[t]},o.ByteBuffer.prototype.readInt16=function(t){return this.readUint16(t)<<16>>16},o.ByteBuffer.prototype.readUint16=function(t){return this.bytes_[t]|this.bytes_[t+1]<<8},o.ByteBuffer.prototype.readInt32=function(t){return this.bytes_[t]|this.bytes_[t+1]<<8|this.bytes_[t+2]<<16|this.bytes_[t+3]<<24},o.ByteBuffer.prototype.readUint32=function(t){return this.readInt32(t)>>>0},o.ByteBuffer.prototype.readInt64=function(t){return new o.Long(this.readInt32(t),this.readInt32(t+4))},o.ByteBuffer.prototype.readUint64=function(t){return new o.Long(this.readUint32(t),this.readUint32(t+4))},o.ByteBuffer.prototype.readFloat32=function(t){return o.int32[0]=this.readInt32(t),o.float32[0]},o.ByteBuffer.prototype.readFloat64=function(t){return o.int32[o.isLittleEndian?0:1]=this.readInt32(t),o.int32[o.isLittleEndian?1:0]=this.readInt32(t+4),o.float64[0]},o.ByteBuffer.prototype.writeInt8=function(t,e){this.bytes_[t]=e},o.ByteBuffer.prototype.writeUint8=function(t,e){this.bytes_[t]=e},o.ByteBuffer.prototype.writeInt16=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8},o.ByteBuffer.prototype.writeUint16=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8},o.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},o.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},o.ByteBuffer.prototype.writeInt64=function(t,e){this.writeInt32(t,e.low),this.writeInt32(t+4,e.high)},o.ByteBuffer.prototype.writeUint64=function(t,e){this.writeUint32(t,e.low),this.writeUint32(t+4,e.high)},o.ByteBuffer.prototype.writeFloat32=function(t,e){o.float32[0]=e,this.writeInt32(t,o.int32[0])},o.ByteBuffer.prototype.writeFloat64=function(t,e){o.float64[0]=e,this.writeInt32(t,o.int32[o.isLittleEndian?0:1]),this.writeInt32(t+4,o.int32[o.isLittleEndian?1:0])},o.ByteBuffer.prototype.getBufferIdentifier=function(){if(this.bytes_.length<this.position_+o.SIZEOF_INT+o.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: ByteBuffer is too short to contain an identifier.");for(var t="",e=0;e<o.FILE_IDENTIFIER_LENGTH;e++)t+=String.fromCharCode(this.readInt8(this.position_+o.SIZEOF_INT+e));return t},o.ByteBuffer.prototype.__offset=function(t,e){var r=t-this.readInt32(t);return e<this.readInt16(r)?this.readInt16(r+e):0},o.ByteBuffer.prototype.__union=function(t,e){return t.bb_pos=e+this.readInt32(e),t.bb=this,t},o.ByteBuffer.prototype.__string=function(t,e){t+=this.readInt32(t);var r=this.readInt32(t),i="",s=0;if(t+=o.SIZEOF_INT,e===o.Encoding.UTF8_BYTES)return this.bytes_.subarray(t,t+r);for(;s<r;){var n,a=this.readUint8(t+s++);if(a<192)n=a;else{var b=this.readUint8(t+s++);if(a<224)n=(31&a)<<6|63&b;else{var d=this.readUint8(t+s++);n=a<240?(15&a)<<12|(63&b)<<6|63&d:(7&a)<<18|(63&b)<<12|(63&d)<<6|63&this.readUint8(t+s++)}}n<65536?i+=String.fromCharCode(n):(n-=65536,i+=String.fromCharCode(55296+(n>>10),56320+(1023&n)))}return i},o.ByteBuffer.prototype.__indirect=function(t){return t+this.readInt32(t)},o.ByteBuffer.prototype.__vector=function(t){return t+this.readInt32(t)+o.SIZEOF_INT},o.ByteBuffer.prototype.__vector_len=function(t){return this.readInt32(t+this.readInt32(t))},o.ByteBuffer.prototype.__has_identifier=function(t){if(t.length!=o.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: file identifier must be length "+o.FILE_IDENTIFIER_LENGTH);for(var e=0;e<o.FILE_IDENTIFIER_LENGTH;e++)if(t.charCodeAt(e)!=this.readInt8(this.position_+o.SIZEOF_INT+e))return!1;return!0},o.ByteBuffer.prototype.createLong=function(t,e){return o.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"}(r||(r={})),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"}(i||(i={}));class a{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 a).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRoot(t,e){return t.setPosition(t.position()+o.SIZE_PREFIX_LENGTH),(e||new a).__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):i.Byte}title(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}width(){var t=this.bb.__offset(this.bb_pos,12);return t?this.bb.readInt32(this.bb_pos+t):-1}precision(){var t=this.bb.__offset(this.bb_pos,14);return t?this.bb.readInt32(this.bb_pos+t):-1}scale(){var t=this.bb.__offset(this.bb_pos,16);return t?this.bb.readInt32(this.bb_pos+t):-1}nullable(){var t=this.bb.__offset(this.bb_pos,18);return!t||!!this.bb.readInt8(this.bb_pos+t)}unique(){var t=this.bb.__offset(this.bb_pos,20);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}primaryKey(){var t=this.bb.__offset(this.bb_pos,22);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}metadata(t){var e=this.bb.__offset(this.bb_pos,24);return e?this.bb.__string(this.bb_pos+e,t):null}static start(t){t.startObject(11)}static addName(t,e){t.addFieldOffset(0,e,0)}static addType(t,e){t.addFieldInt8(1,e,i.Byte)}static addTitle(t,e){t.addFieldOffset(2,e,0)}static addDescription(t,e){t.addFieldOffset(3,e,0)}static addWidth(t,e){t.addFieldInt32(4,e,-1)}static addPrecision(t,e){t.addFieldInt32(5,e,-1)}static addScale(t,e){t.addFieldInt32(6,e,-1)}static addNullable(t,e){t.addFieldInt8(7,+e,1)}static addUnique(t,e){t.addFieldInt8(8,+e,0)}static addPrimaryKey(t,e){t.addFieldInt8(9,+e,0)}static addMetadata(t,e){t.addFieldOffset(10,e,0)}static end(t){var e=t.endObject();return t.requiredField(e,4),e}static create(t,e,r,i,s,n,o,b,d,u,h,f){return a.start(t),a.addName(t,e),a.addType(t,r),a.addTitle(t,i),a.addDescription(t,s),a.addWidth(t,n),a.addPrecision(t,o),a.addScale(t,b),a.addNullable(t,d),a.addUnique(t,u),a.addPrimaryKey(t,h),a.addMetadata(t,f),a.end(t)}}class b{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRoot(t,e){return(e||new b).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRoot(t,e){return t.setPosition(t.position()+o.SIZE_PREFIX_LENGTH),(e||new b).__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}codeString(t){var e=this.bb.__offset(this.bb_pos,14);return e?this.bb.__string(this.bb_pos+e,t):null}static start(t){t.startObject(6)}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 addCodeString(t,e){t.addFieldOffset(5,e,0)}static end(t){return t.endObject()}static create(t,e,r,i,s,n,o){return b.start(t),b.addOrg(t,e),b.addCode(t,r),b.addName(t,i),b.addDescription(t,s),b.addWkt(t,n),b.addCodeString(t,o),b.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()+o.SIZE_PREFIX_LENGTH),(e||new d).__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):r.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 a).__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 b).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}title(t){var e=this.bb.__offset(this.bb_pos,26);return e?this.bb.__string(this.bb_pos+e,t):null}description(t){var e=this.bb.__offset(this.bb_pos,28);return e?this.bb.__string(this.bb_pos+e,t):null}metadata(t){var e=this.bb.__offset(this.bb_pos,30);return e?this.bb.__string(this.bb_pos+e,t):null}static start(t){t.startObject(14)}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,r.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 addTitle(t,e){t.addFieldOffset(11,e,0)}static addDescription(t,e){t.addFieldOffset(12,e,0)}static addMetadata(t,e){t.addFieldOffset(13,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,i,s,n,o,a,b,u,h,f,c,l,_){return d.start(t),d.addName(t,e),d.addEnvelope(t,r),d.addGeometryType(t,i),d.addHasZ(t,s),d.addHasM(t,n),d.addHasT(t,o),d.addHasTM(t,a),d.addColumns(t,b),d.addFeaturesCount(t,u),d.addIndexNodeSize(t,h),d.addCrs(t,f),d.addTitle(t,c),d.addDescription(t,l),d.addMetadata(t,_),d.end(t)}}class u{constructor(t,e,r,i,s,n){this.org=t,this.code=e,this.name=r,this.description=i,this.wkt=s,this.code_string=n}}class h{constructor(t,e,r,i,s,n,o,a){this.geometryType=t,this.columns=e,this.featuresCount=r,this.indexNodeSize=i,this.crs=s,this.title=n,this.description=o,this.metadata=a}static fromByteBuffer(t){const r=d.getRoot(t),i=r.featuresCount().toFloat64(),s=r.indexNodeSize(),n=[];for(let t=0;t<r.columnsLength();t++){const i=r.columns(t);if(!i)throw new Error("Column unexpectedly missing");if(!i.name())throw new Error("Column name unexpectedly missing");n.push(new e(i.name(),i.type(),i.title(),i.description(),i.width(),i.precision(),i.scale(),i.nullable(),i.unique(),i.primaryKey()))}const o=r.crs(),a=o?new u(o.org(),o.code(),o.name(),o.description(),o.wkt(),o.codeString()):null;return new h(r.geometryType(),n,i,s,a,r.title(),r.description(),r.metadata())}}!function(t){t[t.Unknown=0]="Unknown",t[t.Point=1]="Point",t[t.LineString=2]="LineString",t[t.Polygon=3]="Polygon",t[t.MultiPoint=4]="MultiPoint",t[t.MultiLineString=5]="MultiLineString",t[t.MultiPolygon=6]="MultiPolygon",t[t.GeometryCollection=7]="GeometryCollection",t[t.CircularString=8]="CircularString",t[t.CompoundCurve=9]="CompoundCurve",t[t.CurvePolygon=10]="CurvePolygon",t[t.MultiCurve=11]="MultiCurve",t[t.MultiSurface=12]="MultiSurface",t[t.Curve=13]="Curve",t[t.Surface=14]="Surface",t[t.PolyhedralSurface=15]="PolyhedralSurface",t[t.TIN=16]="TIN",t[t.Triangle=17]="Triangle"}(s||(s={})),function(t){t[t.Byte=0]="Byte",t[t.UByte=1]="UByte",t[t.Bool=2]="Bool",t[t.Short=3]="Short",t[t.UShort=4]="UShort",t[t.Int=5]="Int",t[t.UInt=6]="UInt",t[t.Long=7]="Long",t[t.ULong=8]="ULong",t[t.Float=9]="Float",t[t.Double=10]="Double",t[t.String=11]="String",t[t.Json=12]="Json",t[t.DateTime=13]="DateTime",t[t.Binary=14]="Binary"}(n||(n={}));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()+o.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):n.Byte}title(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}width(){var t=this.bb.__offset(this.bb_pos,12);return t?this.bb.readInt32(this.bb_pos+t):-1}precision(){var t=this.bb.__offset(this.bb_pos,14);return t?this.bb.readInt32(this.bb_pos+t):-1}scale(){var t=this.bb.__offset(this.bb_pos,16);return t?this.bb.readInt32(this.bb_pos+t):-1}nullable(){var t=this.bb.__offset(this.bb_pos,18);return!t||!!this.bb.readInt8(this.bb_pos+t)}unique(){var t=this.bb.__offset(this.bb_pos,20);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}primaryKey(){var t=this.bb.__offset(this.bb_pos,22);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}metadata(t){var e=this.bb.__offset(this.bb_pos,24);return e?this.bb.__string(this.bb_pos+e,t):null}static start(t){t.startObject(11)}static addName(t,e){t.addFieldOffset(0,e,0)}static addType(t,e){t.addFieldInt8(1,e,n.Byte)}static addTitle(t,e){t.addFieldOffset(2,e,0)}static addDescription(t,e){t.addFieldOffset(3,e,0)}static addWidth(t,e){t.addFieldInt32(4,e,-1)}static addPrecision(t,e){t.addFieldInt32(5,e,-1)}static addScale(t,e){t.addFieldInt32(6,e,-1)}static addNullable(t,e){t.addFieldInt8(7,+e,1)}static addUnique(t,e){t.addFieldInt8(8,+e,0)}static addPrimaryKey(t,e){t.addFieldInt8(9,+e,0)}static addMetadata(t,e){t.addFieldOffset(10,e,0)}static end(t){var e=t.endObject();return t.requiredField(e,4),e}static create(t,e,r,i,s,n,o,a,b,d,u,h){return f.start(t),f.addName(t,e),f.addType(t,r),f.addTitle(t,i),f.addDescription(t,s),f.addWidth(t,n),f.addPrecision(t,o),f.addScale(t,a),f.addNullable(t,b),f.addUnique(t,d),f.addPrimaryKey(t,u),f.addMetadata(t,h),f.end(t)}}class c{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 c).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRoot(t,e){return t.setPosition(t.position()+o.SIZE_PREFIX_LENGTH),(e||new c).__init(t.readInt32(t.position())+t.position(),t)}ends(t){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readUint32(this.bb.__vector(this.bb_pos+e)+4*t):0}endsLength(){var t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__vector_len(this.bb_pos+t):0}endsArray(){var t=this.bb.__offset(this.bb_pos,4);return t?new Uint32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}xy(t){var e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readFloat64(this.bb.__vector(this.bb_pos+e)+8*t):0}xyLength(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}xyArray(){var t=this.bb.__offset(this.bb_pos,6);return t?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}z(t){var e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readFloat64(this.bb.__vector(this.bb_pos+e)+8*t):0}zLength(){var t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}zArray(){var t=this.bb.__offset(this.bb_pos,8);return t?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}m(t){var e=this.bb.__offset(this.bb_pos,10);return e?this.bb.readFloat64(this.bb.__vector(this.bb_pos+e)+8*t):0}mLength(){var t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__vector_len(this.bb_pos+t):0}mArray(){var t=this.bb.__offset(this.bb_pos,10);return t?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}t(t){var e=this.bb.__offset(this.bb_pos,12);return e?this.bb.readFloat64(this.bb.__vector(this.bb_pos+e)+8*t):0}tLength(){var t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}tArray(){var t=this.bb.__offset(this.bb_pos,12);return t?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}tm(t){var e=this.bb.__offset(this.bb_pos,14);return e?this.bb.readUint64(this.bb.__vector(this.bb_pos+e)+8*t):this.bb.createLong(0,0)}tmLength(){var t=this.bb.__offset(this.bb_pos,14);return t?this.bb.__vector_len(this.bb_pos+t):0}type(){var t=this.bb.__offset(this.bb_pos,16);return t?this.bb.readUint8(this.bb_pos+t):s.Unknown}parts(t,e){var r=this.bb.__offset(this.bb_pos,18);return r?(e||new c).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*t),this.bb):null}partsLength(){var t=this.bb.__offset(this.bb_pos,18);return t?this.bb.__vector_len(this.bb_pos+t):0}static start(t){t.startObject(8)}static addEnds(t,e){t.addFieldOffset(0,e,0)}static createEndsVector(t,e){t.startVector(4,e.length,4);for(var r=e.length-1;r>=0;r--)t.addInt32(e[r]);return t.endVector()}static startEndsVector(t,e){t.startVector(4,e,4)}static addXy(t,e){t.addFieldOffset(1,e,0)}static createXyVector(t,e){t.startVector(8,e.length,8);for(var r=e.length-1;r>=0;r--)t.addFloat64(e[r]);return t.endVector()}static startXyVector(t,e){t.startVector(8,e,8)}static addZ(t,e){t.addFieldOffset(2,e,0)}static createZVector(t,e){t.startVector(8,e.length,8);for(var r=e.length-1;r>=0;r--)t.addFloat64(e[r]);return t.endVector()}static startZVector(t,e){t.startVector(8,e,8)}static addM(t,e){t.addFieldOffset(3,e,0)}static createMVector(t,e){t.startVector(8,e.length,8);for(var r=e.length-1;r>=0;r--)t.addFloat64(e[r]);return t.endVector()}static startMVector(t,e){t.startVector(8,e,8)}static addT(t,e){t.addFieldOffset(4,e,0)}static createTVector(t,e){t.startVector(8,e.length,8);for(var r=e.length-1;r>=0;r--)t.addFloat64(e[r]);return t.endVector()}static startTVector(t,e){t.startVector(8,e,8)}static addTm(t,e){t.addFieldOffset(5,e,0)}static createTmVector(t,e){t.startVector(8,e.length,8);for(var r=e.length-1;r>=0;r--)t.addInt64(e[r]);return t.endVector()}static startTmVector(t,e){t.startVector(8,e,8)}static addType(t,e){t.addFieldInt8(6,e,s.Unknown)}static addParts(t,e){t.addFieldOffset(7,e,0)}static createPartsVector(t,e){t.startVector(4,e.length,4);for(var r=e.length-1;r>=0;r--)t.addOffset(e[r]);return t.endVector()}static startPartsVector(t,e){t.startVector(4,e,4)}static end(t){return t.endObject()}static create(t,e,r,i,s,n,o,a,b){return c.start(t),c.addEnds(t,e),c.addXy(t,r),c.addZ(t,i),c.addM(t,s),c.addT(t,n),c.addTm(t,o),c.addType(t,a),c.addParts(t,b),c.end(t)}}class l{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 l).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRoot(t,e){return t.setPosition(t.position()+o.SIZE_PREFIX_LENGTH),(e||new l).__init(t.readInt32(t.position())+t.position(),t)}geometry(t){var e=this.bb.__offset(this.bb_pos,4);return e?(t||new c).__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,i){return l.start(t),l.addGeometry(t,e),l.addProperties(t,r),l.addColumns(t,i),l.end(t)}}function _(t,e){const{xy:r,z:i,ends:s,parts:n,type:o}=e;if(n){const e=n.map(e=>_(t,e)),r=c.createPartsVector(t,e);return c.start(t),c.addParts(t,r),c.end(t)}const a=c.createXyVector(t,r);let b,d;return i&&(b=c.createZVector(t,i)),s&&(d=c.createEndsVector(t,s)),c.start(t),d&&c.addEnds(t,d),c.addXy(t,a),b&&c.addZ(t,b),c.addType(t,o),c.end(t)}function p(t,e,r){if(0!==t.length)if(Array.isArray(t[0]))for(const i of t)p(i,e,r);else 2===t.length?e.push(...t):(e.push(t[0],t[1]),r.push(t[2]))}function y(t,e){const r=[];for(let i=0;i<t.length;i+=2){const s=[t[i],t[i+1]];e&&s.push(e[i>>1]),r.push(s)}return r}function g(t){return t?r[t]:r.Unknown}function v(t){const e=t.coordinates,r=[],i=[];let s,n;const o=g(t.type);let a=0;switch(t.type){case"Point":p(e,r,i);break;case"MultiPoint":case"LineString":p(e,r,i);break;case"MultiLineString":case"Polygon":{const t=e;p(t,r,i),t.length>1&&(s=t.map(t=>a+=t.length));break}case"MultiPolygon":n=e.map(t=>({type:"Polygon",coordinates:t})).map(v);break;case"GeometryCollection":t.geometries&&(n=t.geometries.map(v))}return{xy:r,z:i.length>0?i:void 0,ends:s,type:o,parts:n}}function w(t,e){if(e===r.GeometryCollection){const i=[];for(let e=0;e<t.partsLength();e++){const r=t.parts(e),s=r.type();i.push(w(r,s))}return{type:r[e],geometries:i}}if(e===r.MultiPolygon){const i=[];for(let e=0;e<t.partsLength();e++)i.push(w(t.parts(e),r.Polygon));return{type:r[e],coordinates:i.map(t=>t.coordinates)}}const i=function(t,e){const i=t.xyArray(),s=t.zArray();switch(e){case r.Point:{const t=Array.from(i);return s&&t.push(s[0]),t}case r.MultiPoint:case r.LineString:return y(i,s);case r.MultiLineString:case r.Polygon:return function(t,e,r){if(!r||0===r.length)return[y(t,e)];let i=0;const s=Array.from(r).map(e=>t.slice(i,i=e<<1));let n;return e&&(i=0,n=Array.from(r).map(t=>e.slice(i,i=t))),s.map((t,e)=>y(t,n?n[e]:void 0))}(i,s,t.endsArray())}}(t,e);return{type:r[e],coordinates:i}}const I=new TextEncoder,B=new TextDecoder;function m(t,e,r){const s=r.columns,n=new o.Builder;let a=0,b=1024,d=new Uint8Array(b),u=new DataView(d.buffer);const h=function(t){if(a+t<b)return;b*=2;const e=new Uint8Array(b);e.set(d),d=e,u=new DataView(d.buffer,a)};if(s)for(let t=0;t<s.length;t++){const r=s[t],n=e[r.name];if(null!==n)switch(u.setUint16(a,t,!0),a+=2,r.type){case i.Bool:h(1),u.setUint8(a,n),a+=1;break;case i.Short:h(2),u.setInt16(a,n,!0),a+=2;break;case i.UShort:h(2),u.setUint16(a,n,!0),a+=2;break;case i.Int:h(4),u.setInt32(a,n,!0),a+=4;break;case i.UInt:h(4),u.setUint32(a,n,!0),a+=4;break;case i.Long:h(8),u.setBigInt64(a,BigInt(n),!0),a+=8;break;case i.Double:h(8),u.setFloat64(a,n,!0),a+=8;break;case i.DateTime:case i.String:{const t=I.encode(n);h(4),u.setUint32(a,t.length,!0),a+=4,h(t.length),d.set(t,a),a+=t.length;break}default:throw new Error("Unknown type "+r.type)}}let f=null;a>0&&(f=l.createPropertiesVector(n,d.slice(0,a)));const c=_(n,t);l.start(n),l.addGeometry(n,c),f&&l.addProperties(n,f);const p=l.end(n);return n.finishSizePrefixed(p),n.asUint8Array()}function F(t,e){const r=e.columns,s={type:"Feature",geometry:w(t.geometry(),e.geometryType)};return r&&r.length>0&&(s.properties=function(t,e){const r={};if(!e||0===e.length)return r;const s=t.propertiesArray();if(!s)return r;const n=new DataView(s.buffer,s.byteOffset),o=t.propertiesLength();let a=0;for(;a<o;){const t=n.getUint16(a,!0);a+=2;const o=e[t],b=o.name;switch(o.type){case i.Bool:r[b]=!!n.getUint8(a),a+=1;break;case i.Byte:r[b]=n.getInt8(a),a+=1;break;case i.UByte:r[b]=n.getUint8(a),a+=1;break;case i.Short:r[b]=n.getInt16(a,!0),a+=2;break;case i.UShort:r[b]=n.getUint16(a,!0),a+=2;break;case i.Int:r[b]=n.getInt32(a,!0),a+=4;break;case i.UInt:r[b]=n.getUint32(a,!0),a+=4;break;case i.Long:r[b]=Number(n.getBigInt64(a,!0)),a+=8;break;case i.ULong:r[b]=Number(n.getBigUint64(a,!0)),a+=8;break;case i.Double:r[b]=n.getFloat64(a,!0),a+=8;break;case i.DateTime:case i.String:{const t=n.getUint32(a,!0);a+=4,r[b]=B.decode(s.subarray(a,a+t)),a+=t;break}default:throw new Error("Unknown type "+o.type)}}return r}(t,r)),s}var E,S=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 U(t){this._source=t,this._array=S,this._index=0}U.prototype.read=function(){var t=this,e=t._array.subarray(t._index);return t._source.read().then((function(r){return t._array=S,t._index=0,r.done?e.length>0?{done:!1,value:e}:{done:!0,value:void 0}:{done:!1,value:O(e,r.value)}}))},U.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 i=new Uint8Array(t);return i.set(this._array.subarray(this._index)),function s(){return e._source.read().then((function(n){return n.done?(e._array=S,e._index=0,r>0?i.subarray(0,r):null):r+n.value.length>=t?(e._array=n.value,e._index=t-r,i.set(n.value.subarray(0,t-r),r),i):(i.set(n.value,r),r+=n.value.length,s())}))}()},U.prototype.cancel=function(){return this._source.cancel()},function(t){t[t.Debug=0]="Debug",t[t.Info=1]="Info",t[t.Warn=2]="Warn",t[t.Error=3]="Error"}(E||(E={}));class P{static debug(...t){this.log(E.Debug,...t)}static info(...t){this.log(E.Info,...t)}static warn(...t){this.log(E.Warn,...t)}static error(...t){this.log(E.Error,...t)}static log(t,...e){if(!(this.logLevel>t))switch(t){case E.Debug:console.debug(...e);break;case E.Info:console.info(...e);break;case E.Warn:console.warn(...e);break;case E.Error:console.error(...e)}}}function L(t,e){e=Math.min(Math.max(+e,2),65535);let r=t,i=r;do{r=Math.ceil(r/e),i+=r}while(1!==r);return 40*i}function T(t,e){if(0!=(4293918720&t))throw Error("integer is too large to be safely represented");return e+t*2**32}P.logLevel=E.Info;const N=new Uint8Array([102,103,98,3,102,103,98,0]);class C{constructor(t,e,r,i){this.headerClient=t,this.header=e,this.headerLength=r,this.indexLength=i}static async open(t){let e=new V(t);const r=(()=>{let t,e=0;for(t=0;t<3;t++)e+=16**t*40;return e})(),i=2024+r;P.debug(`fetching header. minReqLength: ${i} (assumedHeaderLength: 2024, assumedIndexLength: ${r})`);{let t=new Uint8Array(await e.getRange(0,8,i,"header"));if(!t.every((t,e)=>N[e]===t))throw P.error(`bytes: ${t} != ${N}`),new Error("Not a FlatGeobuf file");P.debug("magic bytes look good")}let s;{let t=await e.getRange(8,4,i,"header");if(s=new DataView(t).getUint32(0,!0),s>10485760||s<8)throw new Error("Invalid header size");P.debug("headerLength: "+s)}const n=await e.getRange(12,s,i,"header"),a=new o.ByteBuffer(new Uint8Array(n)),b=h.fromByteBuffer(a),d=L(b.featuresCount,b.indexNodeSize);return P.debug("completed: opening http reader"),new C(e,b,s,d)}async*selectBbox(t){const e=this.lengthBeforeTree();let r=this.headerClient;P.debug("starting: selectBbox, traversing index. lengthBeforeTree: "+e),yield*async function*(t,e,r,i){class s{constructor(t,e){this._level=e,this.nodes=t}level(){return this._level}startNode(){return this.nodes[0]}endNode(){return this.nodes[1]}extendEndNodeToNewOffset(t){console.assert(t>this.nodes[1]),this.nodes[1]=t}toString(){return`[NodeRange level: ${this._level}, nodes: ${this.nodes[0]}-${this.nodes[1]}]`}}const{minX:n,minY:o,maxX:a,maxY:b}=r,d=function(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,i=r;const s=[r];do{r=Math.ceil(r/e),i+=r,s.push(r)}while(1!==r);const n=[];r=i;for(const t of s)n.push(r-t),r-=t;n.reverse(),s.reverse();const o=[];for(let t=0;t<s.length;t++)o.push([n[t],n[t]+s[t]]);return o.reverse(),o}(t,e),u=d[0][0],h=[(()=>{const t=d.length-1;return new s([0,1],t)})()];for(P.debug(`starting stream search with queue: ${h}, numItems: ${t}, nodeSize: ${e}, levelBounds: ${d}`);0!=h.length;){const t=h.shift();P.debug(`popped node: ${t}, queueLength: ${h.length}`);let r=t.startNode();const f=r>=u,[,c]=d[t.level()],l=Math.min(t.endNode()+e,c),_=l-r,p=await i(40*r,40*_),y=new Float64Array(p),g=new Uint32Array(p);for(let e=r;e<l;e++){const i=5*(e-r);if(a<y[i+0])continue;if(b<y[i+1])continue;if(n>y[i+2])continue;if(o>y[i+3])continue;const d=g[8+(i<<1)],c=T(g[9+(i<<1)],d);if(f){P.debug("yielding feature"),yield[c,e-u];continue}const l=6553.6,_=h[h.length-1];if(void 0!==_&&_.level()==t.level()-1&&c<_.endNode()+l){P.debug(`Extending existing node: ${_}, newOffset: ${_.endNode()} -> ${c}`),_.extendEndNodeToNewOffset(c);continue}let p=(()=>{let e=t.level()-1;return new s([c,c+1],e)})();void 0!==_&&_.level()==t.level()-1?P.debug(`pushing new node at offset: ${c} rather than merging with distant ${_}`):P.debug(`pushing new level for ${p} onto queue with tail: ${_}`),h.push(p)}}}(this.header.featuresCount,this.header.indexNodeSize,t,(async function(t,i){return r.getRange(e+t,i,0,"index")}))}lengthBeforeTree(){return N.length+4+this.headerLength}lengthBeforeFeatures(){return this.lengthBeforeTree()+this.indexLength}featureClient(){return void 0===this._featureClient&&(this._featureClient=this.headerClient.clone()),this._featureClient}async readFeature(t){const e=131072;let r,i=t+this.lengthBeforeFeatures();{const t=await this.featureClient().getRange(i,4,e,"feature length");r=new DataView(t).getUint32(0,!0)}P.debug(`featureOffset: ${i}, featureLength: ${r}`);let s=await this.featureClient().getRange(i+4,r,e,"feature data"),n=new Uint8Array(s);const a=new Uint8Array(r+4);a.set(n,4);const b=new o.ByteBuffer(a);return b.setPosition(4),l.getRoot(b)}}class V{constructor(t){this.buffer=new ArrayBuffer(0),this.head=0,this.httpClient="string"==typeof t?new x(t):t}clone(){let t=new V(this.httpClient);return t.buffer=this.buffer.slice(0),t.head=this.head,t}async getRange(t,e,r,i){P.debug(`need Range: ${t}-${t+e-1}`);const s=t-this.head,n=s+e;if(s>=0&&n<this.buffer.byteLength)return P.debug(`slicing existing Range: ${s}-${n-1}`),this.buffer.slice(s,n);let o=Math.max(e,r);return this.buffer=await this.httpClient.getRange(t,o,i),this.head=t,this.buffer.slice(0,e)}}class x{constructor(t){this.requestsEverMade=0,this.bytesEverRequested=0,this.url=t}async getRange(t,e,r){this.requestsEverMade+=1,this.bytesEverRequested+=e;let i=`bytes=${t}-${t+e-1}`;return P.debug(`request: #${this.requestsEverMade}, purpose: ${r}), bytes: (this_request: ${e}, ever: ${this.bytesEverRequested}), Range: ${i}`),(await fetch(this.url,{headers:{Range:i}})).arrayBuffer()}}async function M(t,e,r){let i=new Uint8Array(await t(4,"feature length"));if(0===i.byteLength)return;let s=new o.ByteBuffer(i);const n=s.readUint32(0);i=new Uint8Array(await t(n,"feature data"));const a=new Uint8Array(n+4);return a.set(i,4),s=new o.ByteBuffer(a),s.setPosition(4),r(l.getRoot(s),e)}function R(t){const e=new o.Builder;let r=null;t.columns&&(r=d.createColumnsVector(e,t.columns.map(t=>function(t,e){const r=t.createString(e.name);return a.start(t),a.addName(t,r),a.addType(t,e.type),a.end(t)}(e,t))));const i=e.createString("L1");d.start(e),d.addFeaturesCount(e,new o.Long(t.featuresCount,0)),d.addGeometryType(e,t.geometryType),d.addIndexNodeSize(e,0),r&&d.addColumns(e,r),d.addName(e,i);const s=d.end(e);return e.finishSizePrefixed(s),e.asUint8Array()}t.deserialize=function(t,e,r){return t instanceof Uint8Array?function(t,e){return{type:"FeatureCollection",features:function(t,e,r){if(!t.subarray(0,7).every((t,e)=>N[e]===t))throw new Error("Not a FlatGeobuf file");const i=new o.ByteBuffer(t),s=i.readUint32(N.length);i.setPosition(N.length+4);const n=h.fromByteBuffer(i);r&&r(n);let a=N.length+4+s;const{indexNodeSize:b,featuresCount:d}=n;b>0&&(a+=L(d,b));const u=[];for(;a<i.capacity();){const t=i.readUint32(a);i.setPosition(a+4);const r=l.getRoot(i);u.push(e(r,n)),a+=4+t}return u}(t,F,e)}}(t,r):t instanceof ReadableStream?function(t,e){return async function*(t,e,r){const i="function"==typeof(s=t).slice?s:new U("function"==typeof s.read?s:s.getReader());var s;const n=async t=>await i.slice(t);let a=new Uint8Array(await n(8));if(!a.every((t,e)=>N[e]===t))throw new Error("Not a FlatGeobuf file");a=new Uint8Array(await n(4));let b=new o.ByteBuffer(a);const d=b.readUint32(0);a=new Uint8Array(await n(d)),b=new o.ByteBuffer(a);const u=h.fromByteBuffer(b);r&&r(u);const{indexNodeSize:f,featuresCount:c}=u;if(f>0){const t=L(c,f);await n(t)}let l;for(;l=await M(n,u,e);)yield l}(t,F,e)}(t,r):function(t,e,r){return async function*(t,e,r,i){const s=await C.open(t);P.debug("opened reader"),i&&i(s.header);for await(let t of s.selectBbox(e)){let e=await s.readFeature(t[0]);yield r(e,s.header)}}(t,e,F,r)}(t,e,r)},t.serialize=function(t){return function(t){const r=function(t){const r=t.features[0],s=r.properties;let n=null;return s&&(n=Object.keys(s).map(t=>new e(t,function(t){if("boolean"==typeof t)return i.Bool;if("number"==typeof t)return t%1==0?i.Int:i.Double;if("string"==typeof t)return i.String;if(null===t)return i.String;throw new Error(`Unknown type (value '${t}')`)}(s[t]),null,null,-1,-1,-1,!0,!1,!1))),new h(g(r.geometry.type),n,t.features.length,0,null,null,null,null)}(t),s=R(r),n=t.features.map(t=>m(v(t.geometry),t.properties,r)),o=n.map(t=>t.length).reduce((t,e)=>t+e),a=new Uint8Array(N.length+s.length+o);a.set(s,N.length);let b=N.length+s.length;for(const t of n)a.set(t,b),b+=t.length;return a.set(N),a}(t)},Object.defineProperty(t,"__esModule",{value:!0})}(e)}]);
//# sourceMappingURL=dist.es5.min.js.map

@@ -1,2 +0,2 @@

!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var i=e();for(var r in i)("object"==typeof exports?exports:t)[r]=i[r]}}(window,(function(){return function(t){var e={};function i(r){if(e[r])return e[r].exports;var s=e[r]={i:r,l:!1,exports:{}};return t[r].call(s.exports,s,s.exports,i),s.l=!0,s.exports}return i.m=t,i.c=e,i.d=function(t,e,r){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(i.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var s in t)i.d(r,s,function(e){return t[e]}.bind(null,s));return r},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=1)}([function(t,e,i){!function(t){"use strict";class e{constructor(t,e,i,r,s,n,o,a,b,d){this.name=t,this.type=e,this.title=i,this.description=r,this.width=s,this.precision=n,this.scale=o,this.nullable=a,this.unique=b,this.primary_key=d}}var i,r,s,n,o={SIZEOF_SHORT:2,SIZEOF_INT:4,FILE_IDENTIFIER_LENGTH:4,SIZE_PREFIX_LENGTH:4,Encoding:{UTF8_BYTES:1,UTF16_STRING:2}};o.int32=new Int32Array(2),o.float32=new Float32Array(o.int32.buffer),o.float64=new Float64Array(o.int32.buffer),o.isLittleEndian=1===new Uint16Array(new Uint8Array([1,0]).buffer)[0],o.Long=function(t,e){this.low=0|t,this.high=0|e},o.Long.create=function(t,e){return 0==t&&0==e?o.Long.ZERO:new o.Long(t,e)},o.Long.prototype.toFloat64=function(){return(this.low>>>0)+4294967296*this.high},o.Long.prototype.equals=function(t){return this.low==t.low&&this.high==t.high},o.Long.ZERO=new o.Long(0,0),o.Builder=function(t){if(t)e=t;else var e=1024;this.bb=o.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},o.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},o.Builder.prototype.forceDefaults=function(t){this.force_defaults=t},o.Builder.prototype.dataBuffer=function(){return this.bb},o.Builder.prototype.asUint8Array=function(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())},o.Builder.prototype.prep=function(t,e){t>this.minalign&&(this.minalign=t);for(var i=1+~(this.bb.capacity()-this.space+e)&t-1;this.space<i+t+e;){var r=this.bb.capacity();this.bb=o.Builder.growByteBuffer(this.bb),this.space+=this.bb.capacity()-r}this.pad(i)},o.Builder.prototype.pad=function(t){for(var e=0;e<t;e++)this.bb.writeInt8(--this.space,0)},o.Builder.prototype.writeInt8=function(t){this.bb.writeInt8(this.space-=1,t)},o.Builder.prototype.writeInt16=function(t){this.bb.writeInt16(this.space-=2,t)},o.Builder.prototype.writeInt32=function(t){this.bb.writeInt32(this.space-=4,t)},o.Builder.prototype.writeInt64=function(t){this.bb.writeInt64(this.space-=8,t)},o.Builder.prototype.writeFloat32=function(t){this.bb.writeFloat32(this.space-=4,t)},o.Builder.prototype.writeFloat64=function(t){this.bb.writeFloat64(this.space-=8,t)},o.Builder.prototype.addInt8=function(t){this.prep(1,0),this.writeInt8(t)},o.Builder.prototype.addInt16=function(t){this.prep(2,0),this.writeInt16(t)},o.Builder.prototype.addInt32=function(t){this.prep(4,0),this.writeInt32(t)},o.Builder.prototype.addInt64=function(t){this.prep(8,0),this.writeInt64(t)},o.Builder.prototype.addFloat32=function(t){this.prep(4,0),this.writeFloat32(t)},o.Builder.prototype.addFloat64=function(t){this.prep(8,0),this.writeFloat64(t)},o.Builder.prototype.addFieldInt8=function(t,e,i){(this.force_defaults||e!=i)&&(this.addInt8(e),this.slot(t))},o.Builder.prototype.addFieldInt16=function(t,e,i){(this.force_defaults||e!=i)&&(this.addInt16(e),this.slot(t))},o.Builder.prototype.addFieldInt32=function(t,e,i){(this.force_defaults||e!=i)&&(this.addInt32(e),this.slot(t))},o.Builder.prototype.addFieldInt64=function(t,e,i){!this.force_defaults&&e.equals(i)||(this.addInt64(e),this.slot(t))},o.Builder.prototype.addFieldFloat32=function(t,e,i){(this.force_defaults||e!=i)&&(this.addFloat32(e),this.slot(t))},o.Builder.prototype.addFieldFloat64=function(t,e,i){(this.force_defaults||e!=i)&&(this.addFloat64(e),this.slot(t))},o.Builder.prototype.addFieldOffset=function(t,e,i){(this.force_defaults||e!=i)&&(this.addOffset(e),this.slot(t))},o.Builder.prototype.addFieldStruct=function(t,e,i){e!=i&&(this.nested(e),this.slot(t))},o.Builder.prototype.nested=function(t){if(t!=this.offset())throw new Error("FlatBuffers: struct must be serialized inline.")},o.Builder.prototype.notNested=function(){if(this.isNested)throw new Error("FlatBuffers: object serialization must not be nested.")},o.Builder.prototype.slot=function(t){this.vtable[t]=this.offset()},o.Builder.prototype.offset=function(){return this.bb.capacity()-this.space},o.Builder.growByteBuffer=function(t){var e=t.capacity();if(3221225472&e)throw new Error("FlatBuffers: cannot grow buffer beyond 2 gigabytes.");var i=e<<1,r=o.ByteBuffer.allocate(i);return r.setPosition(i-e),r.bytes().set(t.bytes(),i-e),r},o.Builder.prototype.addOffset=function(t){this.prep(o.SIZEOF_INT,0),this.writeInt32(this.offset()-t+o.SIZEOF_INT)},o.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()},o.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 i=e+1;e>=0;e--)this.addInt16(0!=this.vtable[e]?t-this.vtable[e]:0);this.addInt16(t-this.object_start);var r=(i+2)*o.SIZEOF_SHORT;this.addInt16(r);var s=0,n=this.space;t:for(e=0;e<this.vtables.length;e++){var a=this.bb.capacity()-this.vtables[e];if(r==this.bb.readInt16(a)){for(var b=o.SIZEOF_SHORT;b<r;b+=o.SIZEOF_SHORT)if(this.bb.readInt16(n+b)!=this.bb.readInt16(a+b))continue t;s=this.vtables[e];break}}return s?(this.space=this.bb.capacity()-t,this.bb.writeInt32(this.space,s-t)):(this.vtables.push(this.offset()),this.bb.writeInt32(this.bb.capacity()-t,this.offset()-t)),this.isNested=!1,t},o.Builder.prototype.finish=function(t,e,i){var r=i?o.SIZE_PREFIX_LENGTH:0;if(e){var s=e;if(this.prep(this.minalign,o.SIZEOF_INT+o.FILE_IDENTIFIER_LENGTH+r),s.length!=o.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: file identifier must be length "+o.FILE_IDENTIFIER_LENGTH);for(var n=o.FILE_IDENTIFIER_LENGTH-1;n>=0;n--)this.writeInt8(s.charCodeAt(n))}this.prep(this.minalign,o.SIZEOF_INT+r),this.addOffset(t),r&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)},o.Builder.prototype.finishSizePrefixed=function(t,e){this.finish(t,e,!0)},o.Builder.prototype.requiredField=function(t,e){var i=this.bb.capacity()-t,r=i-this.bb.readInt32(i);if(0==this.bb.readInt16(r+e))throw new Error("FlatBuffers: field "+e+" must be set")},o.Builder.prototype.startVector=function(t,e,i){this.notNested(),this.vector_num_elems=e,this.prep(o.SIZEOF_INT,t*e),this.prep(i,t*e)},o.Builder.prototype.endVector=function(){return this.writeInt32(this.vector_num_elems),this.offset()},o.Builder.prototype.createString=function(t){if(t instanceof Uint8Array)var e=t;else{e=[];for(var i=0;i<t.length;){var r,s=t.charCodeAt(i++);(r=s<55296||s>=56320?s:(s<<10)+t.charCodeAt(i++)+-56613888)<128?e.push(r):(r<2048?e.push(r>>6&31|192):(r<65536?e.push(r>>12&15|224):e.push(r>>18&7|240,r>>12&63|128),e.push(r>>6&63|128)),e.push(63&r|128))}}this.addInt8(0),this.startVector(1,e.length,1),this.bb.setPosition(this.space-=e.length),i=0;for(var n=this.space,o=this.bb.bytes();i<e.length;i++)o[n++]=e[i];return this.endVector()},o.Builder.prototype.createLong=function(t,e){return o.Long.create(t,e)},o.ByteBuffer=function(t){this.bytes_=t,this.position_=0},o.ByteBuffer.allocate=function(t){return new o.ByteBuffer(new Uint8Array(t))},o.ByteBuffer.prototype.clear=function(){this.position_=0},o.ByteBuffer.prototype.bytes=function(){return this.bytes_},o.ByteBuffer.prototype.position=function(){return this.position_},o.ByteBuffer.prototype.setPosition=function(t){this.position_=t},o.ByteBuffer.prototype.capacity=function(){return this.bytes_.length},o.ByteBuffer.prototype.readInt8=function(t){return this.readUint8(t)<<24>>24},o.ByteBuffer.prototype.readUint8=function(t){return this.bytes_[t]},o.ByteBuffer.prototype.readInt16=function(t){return this.readUint16(t)<<16>>16},o.ByteBuffer.prototype.readUint16=function(t){return this.bytes_[t]|this.bytes_[t+1]<<8},o.ByteBuffer.prototype.readInt32=function(t){return this.bytes_[t]|this.bytes_[t+1]<<8|this.bytes_[t+2]<<16|this.bytes_[t+3]<<24},o.ByteBuffer.prototype.readUint32=function(t){return this.readInt32(t)>>>0},o.ByteBuffer.prototype.readInt64=function(t){return new o.Long(this.readInt32(t),this.readInt32(t+4))},o.ByteBuffer.prototype.readUint64=function(t){return new o.Long(this.readUint32(t),this.readUint32(t+4))},o.ByteBuffer.prototype.readFloat32=function(t){return o.int32[0]=this.readInt32(t),o.float32[0]},o.ByteBuffer.prototype.readFloat64=function(t){return o.int32[o.isLittleEndian?0:1]=this.readInt32(t),o.int32[o.isLittleEndian?1:0]=this.readInt32(t+4),o.float64[0]},o.ByteBuffer.prototype.writeInt8=function(t,e){this.bytes_[t]=e},o.ByteBuffer.prototype.writeUint8=function(t,e){this.bytes_[t]=e},o.ByteBuffer.prototype.writeInt16=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8},o.ByteBuffer.prototype.writeUint16=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8},o.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},o.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},o.ByteBuffer.prototype.writeInt64=function(t,e){this.writeInt32(t,e.low),this.writeInt32(t+4,e.high)},o.ByteBuffer.prototype.writeUint64=function(t,e){this.writeUint32(t,e.low),this.writeUint32(t+4,e.high)},o.ByteBuffer.prototype.writeFloat32=function(t,e){o.float32[0]=e,this.writeInt32(t,o.int32[0])},o.ByteBuffer.prototype.writeFloat64=function(t,e){o.float64[0]=e,this.writeInt32(t,o.int32[o.isLittleEndian?0:1]),this.writeInt32(t+4,o.int32[o.isLittleEndian?1:0])},o.ByteBuffer.prototype.getBufferIdentifier=function(){if(this.bytes_.length<this.position_+o.SIZEOF_INT+o.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: ByteBuffer is too short to contain an identifier.");for(var t="",e=0;e<o.FILE_IDENTIFIER_LENGTH;e++)t+=String.fromCharCode(this.readInt8(this.position_+o.SIZEOF_INT+e));return t},o.ByteBuffer.prototype.__offset=function(t,e){var i=t-this.readInt32(t);return e<this.readInt16(i)?this.readInt16(i+e):0},o.ByteBuffer.prototype.__union=function(t,e){return t.bb_pos=e+this.readInt32(e),t.bb=this,t},o.ByteBuffer.prototype.__string=function(t,e){t+=this.readInt32(t);var i=this.readInt32(t),r="",s=0;if(t+=o.SIZEOF_INT,e===o.Encoding.UTF8_BYTES)return this.bytes_.subarray(t,t+i);for(;s<i;){var n,a=this.readUint8(t+s++);if(a<192)n=a;else{var b=this.readUint8(t+s++);if(a<224)n=(31&a)<<6|63&b;else{var d=this.readUint8(t+s++);n=a<240?(15&a)<<12|(63&b)<<6|63&d:(7&a)<<18|(63&b)<<12|(63&d)<<6|63&this.readUint8(t+s++)}}n<65536?r+=String.fromCharCode(n):(n-=65536,r+=String.fromCharCode(55296+(n>>10),56320+(1023&n)))}return r},o.ByteBuffer.prototype.__indirect=function(t){return t+this.readInt32(t)},o.ByteBuffer.prototype.__vector=function(t){return t+this.readInt32(t)+o.SIZEOF_INT},o.ByteBuffer.prototype.__vector_len=function(t){return this.readInt32(t+this.readInt32(t))},o.ByteBuffer.prototype.__has_identifier=function(t){if(t.length!=o.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: file identifier must be length "+o.FILE_IDENTIFIER_LENGTH);for(var e=0;e<o.FILE_IDENTIFIER_LENGTH;e++)if(t.charCodeAt(e)!=this.readInt8(this.position_+o.SIZEOF_INT+e))return!1;return!0},o.ByteBuffer.prototype.createLong=function(t,e){return o.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"}(i||(i={})),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"}(r||(r={}));class a{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 a).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRoot(t,e){return t.setPosition(t.position()+o.SIZE_PREFIX_LENGTH),(e||new a).__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):r.Byte}title(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}width(){var t=this.bb.__offset(this.bb_pos,12);return t?this.bb.readInt32(this.bb_pos+t):-1}precision(){var t=this.bb.__offset(this.bb_pos,14);return t?this.bb.readInt32(this.bb_pos+t):-1}scale(){var t=this.bb.__offset(this.bb_pos,16);return t?this.bb.readInt32(this.bb_pos+t):-1}nullable(){var t=this.bb.__offset(this.bb_pos,18);return!t||!!this.bb.readInt8(this.bb_pos+t)}unique(){var t=this.bb.__offset(this.bb_pos,20);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}primaryKey(){var t=this.bb.__offset(this.bb_pos,22);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}metadata(t){var e=this.bb.__offset(this.bb_pos,24);return e?this.bb.__string(this.bb_pos+e,t):null}static start(t){t.startObject(11)}static addName(t,e){t.addFieldOffset(0,e,0)}static addType(t,e){t.addFieldInt8(1,e,r.Byte)}static addTitle(t,e){t.addFieldOffset(2,e,0)}static addDescription(t,e){t.addFieldOffset(3,e,0)}static addWidth(t,e){t.addFieldInt32(4,e,-1)}static addPrecision(t,e){t.addFieldInt32(5,e,-1)}static addScale(t,e){t.addFieldInt32(6,e,-1)}static addNullable(t,e){t.addFieldInt8(7,+e,1)}static addUnique(t,e){t.addFieldInt8(8,+e,0)}static addPrimaryKey(t,e){t.addFieldInt8(9,+e,0)}static addMetadata(t,e){t.addFieldOffset(10,e,0)}static end(t){var e=t.endObject();return t.requiredField(e,4),e}static create(t,e,i,r,s,n,o,b,d,h,u,f){return a.start(t),a.addName(t,e),a.addType(t,i),a.addTitle(t,r),a.addDescription(t,s),a.addWidth(t,n),a.addPrecision(t,o),a.addScale(t,b),a.addNullable(t,d),a.addUnique(t,h),a.addPrimaryKey(t,u),a.addMetadata(t,f),a.end(t)}}class b{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRoot(t,e){return(e||new b).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRoot(t,e){return t.setPosition(t.position()+o.SIZE_PREFIX_LENGTH),(e||new b).__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}codeString(t){var e=this.bb.__offset(this.bb_pos,14);return e?this.bb.__string(this.bb_pos+e,t):null}static start(t){t.startObject(6)}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 addCodeString(t,e){t.addFieldOffset(5,e,0)}static end(t){return t.endObject()}static create(t,e,i,r,s,n,o){return b.start(t),b.addOrg(t,e),b.addCode(t,i),b.addName(t,r),b.addDescription(t,s),b.addWkt(t,n),b.addCodeString(t,o),b.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()+o.SIZE_PREFIX_LENGTH),(e||new d).__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):i.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 i=this.bb.__offset(this.bb_pos,18);return i?(e||new a).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+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 b).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}title(t){var e=this.bb.__offset(this.bb_pos,26);return e?this.bb.__string(this.bb_pos+e,t):null}description(t){var e=this.bb.__offset(this.bb_pos,28);return e?this.bb.__string(this.bb_pos+e,t):null}metadata(t){var e=this.bb.__offset(this.bb_pos,30);return e?this.bb.__string(this.bb_pos+e,t):null}static start(t){t.startObject(14)}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 i=e.length-1;i>=0;i--)t.addFloat64(e[i]);return t.endVector()}static startEnvelopeVector(t,e){t.startVector(8,e,8)}static addGeometryType(t,e){t.addFieldInt8(2,e,i.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 i=e.length-1;i>=0;i--)t.addOffset(e[i]);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 addTitle(t,e){t.addFieldOffset(11,e,0)}static addDescription(t,e){t.addFieldOffset(12,e,0)}static addMetadata(t,e){t.addFieldOffset(13,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,i,r,s,n,o,a,b,h,u,f,c,l,_){return d.start(t),d.addName(t,e),d.addEnvelope(t,i),d.addGeometryType(t,r),d.addHasZ(t,s),d.addHasM(t,n),d.addHasT(t,o),d.addHasTM(t,a),d.addColumns(t,b),d.addFeaturesCount(t,h),d.addIndexNodeSize(t,u),d.addCrs(t,f),d.addTitle(t,c),d.addDescription(t,l),d.addMetadata(t,_),d.end(t)}}class h{constructor(t,e,i,r,s,n){this.org=t,this.code=e,this.name=i,this.description=r,this.wkt=s,this.code_string=n}}class u{constructor(t,e,i,r,s,n,o,a){this.geometryType=t,this.columns=e,this.featuresCount=i,this.indexNodeSize=r,this.crs=s,this.title=n,this.description=o,this.metadata=a}static fromByteBuffer(t){const i=d.getRoot(t),r=i.featuresCount().toFloat64(),s=i.indexNodeSize(),n=[];for(let t=0;t<i.columnsLength();t++){const r=i.columns(t);if(!r)throw new Error("Column unexpectedly missing");if(!r.name())throw new Error("Column name unexpectedly missing");n.push(new e(r.name(),r.type(),r.title(),r.description(),r.width(),r.precision(),r.scale(),r.nullable(),r.unique(),r.primaryKey()))}const o=i.crs(),a=o?new h(o.org(),o.code(),o.name(),o.description(),o.wkt(),o.codeString()):null;return new u(i.geometryType(),n,r,s,a,i.title(),i.description(),i.metadata())}}!function(t){t[t.Unknown=0]="Unknown",t[t.Point=1]="Point",t[t.LineString=2]="LineString",t[t.Polygon=3]="Polygon",t[t.MultiPoint=4]="MultiPoint",t[t.MultiLineString=5]="MultiLineString",t[t.MultiPolygon=6]="MultiPolygon",t[t.GeometryCollection=7]="GeometryCollection",t[t.CircularString=8]="CircularString",t[t.CompoundCurve=9]="CompoundCurve",t[t.CurvePolygon=10]="CurvePolygon",t[t.MultiCurve=11]="MultiCurve",t[t.MultiSurface=12]="MultiSurface",t[t.Curve=13]="Curve",t[t.Surface=14]="Surface",t[t.PolyhedralSurface=15]="PolyhedralSurface",t[t.TIN=16]="TIN",t[t.Triangle=17]="Triangle"}(s||(s={})),function(t){t[t.Byte=0]="Byte",t[t.UByte=1]="UByte",t[t.Bool=2]="Bool",t[t.Short=3]="Short",t[t.UShort=4]="UShort",t[t.Int=5]="Int",t[t.UInt=6]="UInt",t[t.Long=7]="Long",t[t.ULong=8]="ULong",t[t.Float=9]="Float",t[t.Double=10]="Double",t[t.String=11]="String",t[t.Json=12]="Json",t[t.DateTime=13]="DateTime",t[t.Binary=14]="Binary"}(n||(n={}));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()+o.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):n.Byte}title(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}width(){var t=this.bb.__offset(this.bb_pos,12);return t?this.bb.readInt32(this.bb_pos+t):-1}precision(){var t=this.bb.__offset(this.bb_pos,14);return t?this.bb.readInt32(this.bb_pos+t):-1}scale(){var t=this.bb.__offset(this.bb_pos,16);return t?this.bb.readInt32(this.bb_pos+t):-1}nullable(){var t=this.bb.__offset(this.bb_pos,18);return!t||!!this.bb.readInt8(this.bb_pos+t)}unique(){var t=this.bb.__offset(this.bb_pos,20);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}primaryKey(){var t=this.bb.__offset(this.bb_pos,22);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}metadata(t){var e=this.bb.__offset(this.bb_pos,24);return e?this.bb.__string(this.bb_pos+e,t):null}static start(t){t.startObject(11)}static addName(t,e){t.addFieldOffset(0,e,0)}static addType(t,e){t.addFieldInt8(1,e,n.Byte)}static addTitle(t,e){t.addFieldOffset(2,e,0)}static addDescription(t,e){t.addFieldOffset(3,e,0)}static addWidth(t,e){t.addFieldInt32(4,e,-1)}static addPrecision(t,e){t.addFieldInt32(5,e,-1)}static addScale(t,e){t.addFieldInt32(6,e,-1)}static addNullable(t,e){t.addFieldInt8(7,+e,1)}static addUnique(t,e){t.addFieldInt8(8,+e,0)}static addPrimaryKey(t,e){t.addFieldInt8(9,+e,0)}static addMetadata(t,e){t.addFieldOffset(10,e,0)}static end(t){var e=t.endObject();return t.requiredField(e,4),e}static create(t,e,i,r,s,n,o,a,b,d,h,u){return f.start(t),f.addName(t,e),f.addType(t,i),f.addTitle(t,r),f.addDescription(t,s),f.addWidth(t,n),f.addPrecision(t,o),f.addScale(t,a),f.addNullable(t,b),f.addUnique(t,d),f.addPrimaryKey(t,h),f.addMetadata(t,u),f.end(t)}}class c{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 c).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRoot(t,e){return t.setPosition(t.position()+o.SIZE_PREFIX_LENGTH),(e||new c).__init(t.readInt32(t.position())+t.position(),t)}ends(t){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readUint32(this.bb.__vector(this.bb_pos+e)+4*t):0}endsLength(){var t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__vector_len(this.bb_pos+t):0}endsArray(){var t=this.bb.__offset(this.bb_pos,4);return t?new Uint32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}xy(t){var e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readFloat64(this.bb.__vector(this.bb_pos+e)+8*t):0}xyLength(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}xyArray(){var t=this.bb.__offset(this.bb_pos,6);return t?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}z(t){var e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readFloat64(this.bb.__vector(this.bb_pos+e)+8*t):0}zLength(){var t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}zArray(){var t=this.bb.__offset(this.bb_pos,8);return t?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}m(t){var e=this.bb.__offset(this.bb_pos,10);return e?this.bb.readFloat64(this.bb.__vector(this.bb_pos+e)+8*t):0}mLength(){var t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__vector_len(this.bb_pos+t):0}mArray(){var t=this.bb.__offset(this.bb_pos,10);return t?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}t(t){var e=this.bb.__offset(this.bb_pos,12);return e?this.bb.readFloat64(this.bb.__vector(this.bb_pos+e)+8*t):0}tLength(){var t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}tArray(){var t=this.bb.__offset(this.bb_pos,12);return t?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}tm(t){var e=this.bb.__offset(this.bb_pos,14);return e?this.bb.readUint64(this.bb.__vector(this.bb_pos+e)+8*t):this.bb.createLong(0,0)}tmLength(){var t=this.bb.__offset(this.bb_pos,14);return t?this.bb.__vector_len(this.bb_pos+t):0}type(){var t=this.bb.__offset(this.bb_pos,16);return t?this.bb.readUint8(this.bb_pos+t):s.Unknown}parts(t,e){var i=this.bb.__offset(this.bb_pos,18);return i?(e||new c).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+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 i=e.length-1;i>=0;i--)t.addInt32(e[i]);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 i=e.length-1;i>=0;i--)t.addFloat64(e[i]);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 i=e.length-1;i>=0;i--)t.addFloat64(e[i]);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 i=e.length-1;i>=0;i--)t.addFloat64(e[i]);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 i=e.length-1;i>=0;i--)t.addFloat64(e[i]);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 i=e.length-1;i>=0;i--)t.addInt64(e[i]);return t.endVector()}static startTmVector(t,e){t.startVector(8,e,8)}static addType(t,e){t.addFieldInt8(6,e,s.Unknown)}static addParts(t,e){t.addFieldOffset(7,e,0)}static createPartsVector(t,e){t.startVector(4,e.length,4);for(var i=e.length-1;i>=0;i--)t.addOffset(e[i]);return t.endVector()}static startPartsVector(t,e){t.startVector(4,e,4)}static end(t){return t.endObject()}static create(t,e,i,r,s,n,o,a,b){return c.start(t),c.addEnds(t,e),c.addXy(t,i),c.addZ(t,r),c.addM(t,s),c.addT(t,n),c.addTm(t,o),c.addType(t,a),c.addParts(t,b),c.end(t)}}class l{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 l).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRoot(t,e){return t.setPosition(t.position()+o.SIZE_PREFIX_LENGTH),(e||new l).__init(t.readInt32(t.position())+t.position(),t)}geometry(t){var e=this.bb.__offset(this.bb_pos,4);return e?(t||new c).__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 i=this.bb.__offset(this.bb_pos,8);return i?(e||new f).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+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 i=e.length-1;i>=0;i--)t.addInt8(e[i]);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 i=e.length-1;i>=0;i--)t.addOffset(e[i]);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,i,r){return l.start(t),l.addGeometry(t,e),l.addProperties(t,i),l.addColumns(t,r),l.end(t)}}function _(t,e){const{xy:i,z:r,ends:s,parts:n,type:o}=e;if(n){const e=n.map(e=>_(t,e)),i=c.createPartsVector(t,e);return c.start(t),c.addParts(t,i),c.end(t)}const a=c.createXyVector(t,i);let b,d;return r&&(b=c.createZVector(t,r)),s&&(d=c.createEndsVector(t,s)),c.start(t),d&&c.addEnds(t,d),c.addXy(t,a),b&&c.addZ(t,b),c.addType(t,o),c.end(t)}function p(t,e,i){if(0!==t.length)if(Array.isArray(t[0]))for(const r of t)p(r,e,i);else 2===t.length?e.push(...t):(e.push(t[0],t[1]),i.push(t[2]))}function y(t,e){const i=[];for(let r=0;r<t.length;r+=2){const s=[t[r],t[r+1]];e&&s.push(e[r>>1]),i.push(s)}return i}function g(t){return t?i[t]:i.Unknown}function v(t){const e=t.coordinates,i=[],r=[];let s,n;const o=g(t.type);let a=0;switch(t.type){case"Point":p(e,i,r);break;case"MultiPoint":case"LineString":p(e,i,r);break;case"MultiLineString":case"Polygon":{const t=e;p(t,i,r),t.length>1&&(s=t.map(t=>a+=t.length));break}case"MultiPolygon":n=e.map(t=>({type:"Polygon",coordinates:t})).map(v);break;case"GeometryCollection":t.geometries&&(n=t.geometries.map(v))}return{xy:i,z:r.length>0?r:void 0,ends:s,type:o,parts:n}}function w(t,e){if(e===i.GeometryCollection){const r=[];for(let e=0;e<t.partsLength();e++){const i=t.parts(e),s=i.type();r.push(w(i,s))}return{type:i[e],geometries:r}}if(e===i.MultiPolygon){const r=[];for(let e=0;e<t.partsLength();e++)r.push(w(t.parts(e),i.Polygon));return{type:i[e],coordinates:r.map(t=>t.coordinates)}}const r=function(t,e){const r=t.xyArray(),s=t.zArray();switch(e){case i.Point:{const t=Array.from(r);return s&&t.push(s[0]),t}case i.MultiPoint:case i.LineString:return y(r,s);case i.MultiLineString:case i.Polygon:return function(t,e,i){if(!i||0===i.length)return[y(t,e)];let r=0;const s=Array.from(i).map(e=>t.slice(r,r=e<<1));let n;return e&&(r=0,n=Array.from(i).map(t=>e.slice(r,r=t))),s.map((t,e)=>y(t,n?n[e]:void 0))}(r,s,t.endsArray())}}(t,e);return{type:i[e],coordinates:r}}const I=new TextEncoder,B=new TextDecoder;function m(t,e,i){const s=i.columns,n=new o.Builder;let a=0,b=1024,d=new Uint8Array(b),h=new DataView(d.buffer);const u=function(t){if(a+t<b)return;b*=2;const e=new Uint8Array(b);e.set(d),d=e,h=new DataView(d.buffer,a)};if(s)for(let t=0;t<s.length;t++){const i=s[t],n=e[i.name];if(null!==n)switch(h.setUint16(a,t,!0),a+=2,i.type){case r.Bool:u(1),h.setUint8(a,n),a+=1;break;case r.Short:u(2),h.setInt16(a,n,!0),a+=2;break;case r.UShort:u(2),h.setUint16(a,n,!0),a+=2;break;case r.Int:u(4),h.setInt32(a,n,!0),a+=4;break;case r.UInt:u(4),h.setUint32(a,n,!0),a+=4;break;case r.Long:u(8),h.setBigInt64(a,BigInt(n),!0),a+=8;break;case r.Double:u(8),h.setFloat64(a,n,!0),a+=8;break;case r.DateTime:case r.String:{const t=I.encode(n);u(4),h.setUint32(a,t.length,!0),a+=4,u(t.length),d.set(t,a),a+=t.length;break}default:throw new Error("Unknown type "+i.type)}}let f=null;a>0&&(f=l.createPropertiesVector(n,d.slice(0,a)));const c=_(n,t);l.start(n),l.addGeometry(n,c),f&&l.addProperties(n,f);const p=l.end(n);return n.finishSizePrefixed(p),n.asUint8Array()}function F(t,e){const i=e.columns,s={type:"Feature",geometry:w(t.geometry(),e.geometryType)};return i&&i.length>0&&(s.properties=function(t,e){const i={};if(!e||0===e.length)return i;const s=t.propertiesArray();if(!s)return i;const n=new DataView(s.buffer,s.byteOffset),o=t.propertiesLength();let a=0;for(;a<o;){const t=n.getUint16(a,!0);a+=2;const o=e[t],b=o.name;switch(o.type){case r.Bool:i[b]=!!n.getUint8(a),a+=1;break;case r.Byte:i[b]=n.getInt8(a),a+=1;break;case r.UByte:i[b]=n.getUint8(a),a+=1;break;case r.Short:i[b]=n.getInt16(a,!0),a+=2;break;case r.UShort:i[b]=n.getUint16(a,!0),a+=2;break;case r.Int:i[b]=n.getInt32(a,!0),a+=4;break;case r.UInt:i[b]=n.getUint32(a,!0),a+=4;break;case r.Long:i[b]=Number(n.getBigInt64(a,!0)),a+=8;break;case r.ULong:i[b]=Number(n.getBigUint64(a,!0)),a+=8;break;case r.Double:i[b]=n.getFloat64(a,!0),a+=8;break;case r.DateTime:case r.String:{const t=n.getUint32(a,!0);a+=4,i[b]=B.decode(s.subarray(a,a+t)),a+=t;break}default:throw new Error("Unknown type "+o.type)}}return i}(t,i)),s}var E,S=new Uint8Array(0);function U(t,e){if(!t.length)return e;if(!e.length)return t;var i=new Uint8Array(t.length+e.length);return i.set(t),i.set(e,t.length),i}function T(t){this._source=t,this._array=S,this._index=0}T.prototype.read=function(){var t=this,e=t._array.subarray(t._index);return t._source.read().then((function(i){return t._array=S,t._index=0,i.done?e.length>0?{done:!1,value:e}:{done:!0,value:void 0}:{done:!1,value:U(e,i.value)}}))},T.prototype.slice=function(t){if((t|=0)<0)throw new Error("invalid length");var e=this,i=this._array.length-this._index;if(this._index+t<=this._array.length)return Promise.resolve(this._array.subarray(this._index,this._index+=t));var r=new Uint8Array(t);return r.set(this._array.subarray(this._index)),function s(){return e._source.read().then((function(n){return n.done?(e._array=S,e._index=0,i>0?r.subarray(0,i):null):i+n.value.length>=t?(e._array=n.value,e._index=t-i,r.set(n.value.subarray(0,t-i),i),r):(r.set(n.value,i),i+=n.value.length,s())}))}()},T.prototype.cancel=function(){return this._source.cancel()},function(t){t[t.Debug=0]="Debug",t[t.Info=1]="Info",t[t.Warn=2]="Warn",t[t.Error=3]="Error"}(E||(E={}));class L{static debug(...t){this.log(E.Debug,...t)}static info(...t){this.log(E.Info,...t)}static warn(...t){this.log(E.Warn,...t)}static error(...t){this.log(E.Error,...t)}static log(t,...e){if(!(this.logLevel>t))switch(t){case E.Debug:console.debug(...e);break;case E.Info:console.info(...e);break;case E.Warn:console.warn(...e);break;case E.Error:console.error(...e)}}}function O(t,e){e=Math.min(Math.max(+e,2),65535);let i=t,r=i;do{i=Math.ceil(i/e),r+=i}while(1!==i);return 40*r}function N(t,e){if(0!=(4293918720&t))throw Error("integer is too large to be safely represented");return e+t*2**32}L.logLevel=E.Info;const P=new Uint8Array([102,103,98,3,102,103,98,0]);class C{constructor(t,e,i,r){this.headerClient=t,this.header=e,this.headerLength=i,this.indexLength=r}static async open(t){let e=new x(t);const i=(()=>{let t,e=0;for(t=0;t<3;t++)e+=16**t*40;return e})(),r=2024+i;L.debug(`fetching header. minReqLength: ${r} (assumedHeaderLength: 2024, assumedIndexLength: ${i})`);{let t=new Uint8Array(await e.getRange(0,8,r,"header"));if(!t.every((t,e)=>P[e]===t))throw L.error(`bytes: ${t} != ${P}`),new Error("Not a FlatGeobuf file");L.debug("magic bytes look good")}let s;{let t=await e.getRange(8,4,r,"header");if(s=new DataView(t).getUint32(0,!0),s>10485760||s<8)throw new Error("Invalid header size");L.debug("headerLength: "+s)}const n=await e.getRange(12,s,r,"header"),a=new o.ByteBuffer(new Uint8Array(n)),b=u.fromByteBuffer(a),d=O(b.featuresCount,b.indexNodeSize);return L.debug("completed: opening http reader"),new C(e,b,s,d)}async*selectBbox(t){const e=this.lengthBeforeTree();let i=this.headerClient;L.debug("starting: selectBbox, traversing index. lengthBeforeTree: "+e),yield*async function*(t,e,i,r){class s{constructor(t,e){this._level=e,this.nodes=t}level(){return this._level}startNode(){return this.nodes[0]}endNode(){return this.nodes[1]}extendEndNodeToNewOffset(t){console.assert(t>this.nodes[1]),this.nodes[1]=t}toString(){return`[NodeRange level: ${this._level}, nodes: ${this.nodes[0]}-${this.nodes[1]}]`}}const{minX:n,minY:o,maxX:a,maxY:b}=i,d=function(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 i=t,r=i;const s=[i];do{i=Math.ceil(i/e),r+=i,s.push(i)}while(1!==i);const n=[];i=r;for(const t of s)n.push(i-t),i-=t;n.reverse(),s.reverse();const o=[];for(let t=0;t<s.length;t++)o.push([n[t],n[t]+s[t]]);return o.reverse(),o}(t,e),h=d[0][0],u=[(()=>{const t=d.length-1;return new s([0,1],t)})()];for(L.debug(`starting stream search with queue: ${u}, numItems: ${t}, nodeSize: ${e}, levelBounds: ${d}`);0!=u.length;){const t=u.shift();L.debug(`popped node: ${t}, queueLength: ${u.length}`);let i=t.startNode();const f=i>=h,[,c]=d[t.level()],l=Math.min(t.endNode()+e,c),_=l-i,p=await r(40*i,40*_),y=new Float64Array(p),g=new Uint32Array(p);for(let e=i;e<l;e++){const r=5*(e-i);if(a<y[r+0])continue;if(b<y[r+1])continue;if(n>y[r+2])continue;if(o>y[r+3])continue;const d=g[8+(r<<1)],c=N(g[9+(r<<1)],d);if(f){L.debug("yielding feature"),yield[c,e-h];continue}const l=6553.6,_=u[u.length-1];if(void 0!==_&&_.level()==t.level()-1&&c<_.endNode()+l){L.debug(`Extending existing node: ${_}, newOffset: ${_.endNode()} -> ${c}`),_.extendEndNodeToNewOffset(c);continue}let p=(()=>{let e=t.level()-1;return new s([c,c+1],e)})();void 0!==_&&_.level()==t.level()-1?L.debug(`pushing new node at offset: ${c} rather than merging with distant ${_}`):L.debug(`pushing new level for ${p} onto queue with tail: ${_}`),u.push(p)}}}(this.header.featuresCount,this.header.indexNodeSize,t,(async function(t,r){return i.getRange(e+t,r,0,"index")}))}lengthBeforeTree(){return P.length+4+this.headerLength}lengthBeforeFeatures(){return this.lengthBeforeTree()+this.indexLength}featureClient(){return void 0===this._featureClient&&(this._featureClient=this.headerClient.clone()),this._featureClient}async readFeature(t){const e=131072;let i,r=t+this.lengthBeforeFeatures();{const t=await this.featureClient().getRange(r,4,e,"feature length");i=new DataView(t).getUint32(0,!0)}L.debug(`featureOffset: ${r}, featureLength: ${i}`);let s=await this.featureClient().getRange(r+4,i,e,"feature data"),n=new Uint8Array(s);const a=new Uint8Array(i+4);a.set(n,4);const b=new o.ByteBuffer(a);return b.setPosition(4),l.getRoot(b)}}class x{constructor(t){this.buffer=new ArrayBuffer(0),this.head=0,this.httpClient="string"==typeof t?new V(t):t}clone(){let t=new x(this.httpClient);return t.buffer=this.buffer.slice(0),t.head=this.head,t}async getRange(t,e,i,r){L.debug(`need Range: ${t}-${t+e-1}`);const s=t-this.head,n=s+e;if(s>=0&&n<this.buffer.byteLength)return L.debug(`slicing existing Range: ${s}-${n-1}`),this.buffer.slice(s,n);let o=Math.max(e,i);return this.buffer=await this.httpClient.getRange(t,o,r),this.head=t,this.buffer.slice(0,e)}}class V{constructor(t){this.requestsEverMade=0,this.bytesEverRequested=0,this.url=t}async getRange(t,e,i){this.requestsEverMade+=1,this.bytesEverRequested+=e;let r=`bytes=${t}-${t+e-1}`;return L.debug(`request: #${this.requestsEverMade}, purpose: ${i}), bytes: (this_request: ${e}, ever: ${this.bytesEverRequested}), Range: ${r}`),(await fetch(this.url,{headers:{Range:r}})).arrayBuffer()}}async function R(t,e,i){let r=new Uint8Array(await t(4,"feature length"));if(0===r.byteLength)return;let s=new o.ByteBuffer(r);const n=s.readUint32(0);r=new Uint8Array(await t(n,"feature data"));const a=new Uint8Array(n+4);return a.set(r,4),s=new o.ByteBuffer(a),s.setPosition(4),i(l.getRoot(s),e)}function A(t){const e=new o.Builder;let i=null;t.columns&&(i=d.createColumnsVector(e,t.columns.map(t=>function(t,e){const i=t.createString(e.name);return a.start(t),a.addName(t,i),a.addType(t,e.type),a.end(t)}(e,t))));const r=e.createString("L1");d.start(e),d.addFeaturesCount(e,new o.Long(t.featuresCount,0)),d.addGeometryType(e,t.geometryType),d.addIndexNodeSize(e,0),i&&d.addColumns(e,i),d.addName(e,r);const s=d.end(e);return e.finishSizePrefixed(s),e.asUint8Array()}t.deserialize=function(t,e,i){return t instanceof Uint8Array?function(t,e){return{type:"FeatureCollection",features:function(t,e,i){if(!t.subarray(0,7).every((t,e)=>P[e]===t))throw new Error("Not a FlatGeobuf file");const r=new o.ByteBuffer(t),s=r.readUint32(P.length);r.setPosition(P.length+4);const n=u.fromByteBuffer(r);i&&i(n);let a=P.length+4+s;const{indexNodeSize:b,featuresCount:d}=n;b>0&&(a+=O(d,b));const h=[];for(;a<r.capacity();){const t=r.readUint32(a);r.setPosition(a+4);const i=l.getRoot(r);h.push(e(i,n)),a+=4+t}return h}(t,F,e)}}(t,i):t instanceof ReadableStream?function(t,e){return async function*(t,e,i){const r="function"==typeof(s=t).slice?s:new T("function"==typeof s.read?s:s.getReader());var s;const n=async t=>await r.slice(t);let a=new Uint8Array(await n(8));if(!a.every((t,e)=>P[e]===t))throw new Error("Not a FlatGeobuf file");a=new Uint8Array(await n(4));let b=new o.ByteBuffer(a);const d=b.readUint32(0);a=new Uint8Array(await n(d)),b=new o.ByteBuffer(a);const h=u.fromByteBuffer(b);i&&i(h);const{indexNodeSize:f,featuresCount:c}=h;if(f>0){const t=O(c,f);await n(t)}let l;for(;l=await R(n,h,e);)yield l}(t,F,e)}(t,i):function(t,e,i){return async function*(t,e,i,r){const s=await C.open(t);L.debug("opened reader"),r&&r(s.header);for await(let t of s.selectBbox(e)){let e=await s.readFeature(t[0]);yield i(e,s.header)}}(t,e,F,i)}(t,e,i)},t.serialize=function(t){return function(t){const i=function(t){const i=t.features[0],s=i.properties;let n=null;return s&&(n=Object.keys(s).map(t=>new e(t,function(t){if("boolean"==typeof t)return r.Bool;if("number"==typeof t)return t%1==0?r.Int:r.Double;if("string"==typeof t)return r.String;if(null===t)return r.String;throw new Error(`Unknown type (value '${t}')`)}(s[t]),null,null,-1,-1,-1,!0,!1,!1))),new u(g(i.geometry.type),n,t.features.length,0,null,null,null,null)}(t),s=A(i),n=t.features.map(t=>m(v(t.geometry),t.properties,i)),o=n.map(t=>t.length).reduce((t,e)=>t+e),a=new Uint8Array(P.length+s.length+o);a.set(s,P.length);let b=P.length+s.length;for(const t of n)a.set(t,b),b+=t.length;return a.set(P),a}(t)},Object.defineProperty(t,"__esModule",{value:!0})}(e)},function(t,e,i){(function(e){const r=i(3),s="undefined"==typeof window?e:window;s.loaders=s.loaders||{},t.exports=Object.assign(s.loaders,r)}).call(this,i(2))},function(t,e){var i;i=function(){return this}();try{i=i||new Function("return this")()}catch(t){"object"==typeof window&&(i=window)}t.exports=i},function(t,e,i){"use strict";i.r(e),i.d(e,"FlatGeobufLoader",(function(){return n}));var r=i(0);function s(t,e){if(0===t.byteLength)return[];const i=new Uint8Array(t),{features:s}=Object(r.deserialize)(i);return s}const n={...{id:"flatgeobuf",name:"FlatGeobuf",module:"flatgeobuf",version:"3.0.0-alpha.20",worker:!0,extensions:["fgb"],category:"geometry",options:{flatgeobuf:{}}},parse:async(t,e)=>s(t),parseSync:s,parseInBatchesFromStream:function(t,e){return Object(r.deserializeStream)(t)},binary:!0}}])}));
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var i=e();for(var r in i)("object"==typeof exports?exports:t)[r]=i[r]}}(window,(function(){return function(t){var e={};function i(r){if(e[r])return e[r].exports;var s=e[r]={i:r,l:!1,exports:{}};return t[r].call(s.exports,s,s.exports,i),s.l=!0,s.exports}return i.m=t,i.c=e,i.d=function(t,e,r){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(i.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var s in t)i.d(r,s,function(e){return t[e]}.bind(null,s));return r},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=1)}([function(t,e,i){!function(t){"use strict";class e{constructor(t,e,i,r,s,n,o,a,b,d){this.name=t,this.type=e,this.title=i,this.description=r,this.width=s,this.precision=n,this.scale=o,this.nullable=a,this.unique=b,this.primary_key=d}}var i,r,s,n,o={SIZEOF_SHORT:2,SIZEOF_INT:4,FILE_IDENTIFIER_LENGTH:4,SIZE_PREFIX_LENGTH:4,Encoding:{UTF8_BYTES:1,UTF16_STRING:2}};o.int32=new Int32Array(2),o.float32=new Float32Array(o.int32.buffer),o.float64=new Float64Array(o.int32.buffer),o.isLittleEndian=1===new Uint16Array(new Uint8Array([1,0]).buffer)[0],o.Long=function(t,e){this.low=0|t,this.high=0|e},o.Long.create=function(t,e){return 0==t&&0==e?o.Long.ZERO:new o.Long(t,e)},o.Long.prototype.toFloat64=function(){return(this.low>>>0)+4294967296*this.high},o.Long.prototype.equals=function(t){return this.low==t.low&&this.high==t.high},o.Long.ZERO=new o.Long(0,0),o.Builder=function(t){if(t)e=t;else var e=1024;this.bb=o.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},o.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},o.Builder.prototype.forceDefaults=function(t){this.force_defaults=t},o.Builder.prototype.dataBuffer=function(){return this.bb},o.Builder.prototype.asUint8Array=function(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())},o.Builder.prototype.prep=function(t,e){t>this.minalign&&(this.minalign=t);for(var i=1+~(this.bb.capacity()-this.space+e)&t-1;this.space<i+t+e;){var r=this.bb.capacity();this.bb=o.Builder.growByteBuffer(this.bb),this.space+=this.bb.capacity()-r}this.pad(i)},o.Builder.prototype.pad=function(t){for(var e=0;e<t;e++)this.bb.writeInt8(--this.space,0)},o.Builder.prototype.writeInt8=function(t){this.bb.writeInt8(this.space-=1,t)},o.Builder.prototype.writeInt16=function(t){this.bb.writeInt16(this.space-=2,t)},o.Builder.prototype.writeInt32=function(t){this.bb.writeInt32(this.space-=4,t)},o.Builder.prototype.writeInt64=function(t){this.bb.writeInt64(this.space-=8,t)},o.Builder.prototype.writeFloat32=function(t){this.bb.writeFloat32(this.space-=4,t)},o.Builder.prototype.writeFloat64=function(t){this.bb.writeFloat64(this.space-=8,t)},o.Builder.prototype.addInt8=function(t){this.prep(1,0),this.writeInt8(t)},o.Builder.prototype.addInt16=function(t){this.prep(2,0),this.writeInt16(t)},o.Builder.prototype.addInt32=function(t){this.prep(4,0),this.writeInt32(t)},o.Builder.prototype.addInt64=function(t){this.prep(8,0),this.writeInt64(t)},o.Builder.prototype.addFloat32=function(t){this.prep(4,0),this.writeFloat32(t)},o.Builder.prototype.addFloat64=function(t){this.prep(8,0),this.writeFloat64(t)},o.Builder.prototype.addFieldInt8=function(t,e,i){(this.force_defaults||e!=i)&&(this.addInt8(e),this.slot(t))},o.Builder.prototype.addFieldInt16=function(t,e,i){(this.force_defaults||e!=i)&&(this.addInt16(e),this.slot(t))},o.Builder.prototype.addFieldInt32=function(t,e,i){(this.force_defaults||e!=i)&&(this.addInt32(e),this.slot(t))},o.Builder.prototype.addFieldInt64=function(t,e,i){!this.force_defaults&&e.equals(i)||(this.addInt64(e),this.slot(t))},o.Builder.prototype.addFieldFloat32=function(t,e,i){(this.force_defaults||e!=i)&&(this.addFloat32(e),this.slot(t))},o.Builder.prototype.addFieldFloat64=function(t,e,i){(this.force_defaults||e!=i)&&(this.addFloat64(e),this.slot(t))},o.Builder.prototype.addFieldOffset=function(t,e,i){(this.force_defaults||e!=i)&&(this.addOffset(e),this.slot(t))},o.Builder.prototype.addFieldStruct=function(t,e,i){e!=i&&(this.nested(e),this.slot(t))},o.Builder.prototype.nested=function(t){if(t!=this.offset())throw new Error("FlatBuffers: struct must be serialized inline.")},o.Builder.prototype.notNested=function(){if(this.isNested)throw new Error("FlatBuffers: object serialization must not be nested.")},o.Builder.prototype.slot=function(t){this.vtable[t]=this.offset()},o.Builder.prototype.offset=function(){return this.bb.capacity()-this.space},o.Builder.growByteBuffer=function(t){var e=t.capacity();if(3221225472&e)throw new Error("FlatBuffers: cannot grow buffer beyond 2 gigabytes.");var i=e<<1,r=o.ByteBuffer.allocate(i);return r.setPosition(i-e),r.bytes().set(t.bytes(),i-e),r},o.Builder.prototype.addOffset=function(t){this.prep(o.SIZEOF_INT,0),this.writeInt32(this.offset()-t+o.SIZEOF_INT)},o.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()},o.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 i=e+1;e>=0;e--)this.addInt16(0!=this.vtable[e]?t-this.vtable[e]:0);this.addInt16(t-this.object_start);var r=(i+2)*o.SIZEOF_SHORT;this.addInt16(r);var s=0,n=this.space;t:for(e=0;e<this.vtables.length;e++){var a=this.bb.capacity()-this.vtables[e];if(r==this.bb.readInt16(a)){for(var b=o.SIZEOF_SHORT;b<r;b+=o.SIZEOF_SHORT)if(this.bb.readInt16(n+b)!=this.bb.readInt16(a+b))continue t;s=this.vtables[e];break}}return s?(this.space=this.bb.capacity()-t,this.bb.writeInt32(this.space,s-t)):(this.vtables.push(this.offset()),this.bb.writeInt32(this.bb.capacity()-t,this.offset()-t)),this.isNested=!1,t},o.Builder.prototype.finish=function(t,e,i){var r=i?o.SIZE_PREFIX_LENGTH:0;if(e){var s=e;if(this.prep(this.minalign,o.SIZEOF_INT+o.FILE_IDENTIFIER_LENGTH+r),s.length!=o.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: file identifier must be length "+o.FILE_IDENTIFIER_LENGTH);for(var n=o.FILE_IDENTIFIER_LENGTH-1;n>=0;n--)this.writeInt8(s.charCodeAt(n))}this.prep(this.minalign,o.SIZEOF_INT+r),this.addOffset(t),r&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)},o.Builder.prototype.finishSizePrefixed=function(t,e){this.finish(t,e,!0)},o.Builder.prototype.requiredField=function(t,e){var i=this.bb.capacity()-t,r=i-this.bb.readInt32(i);if(0==this.bb.readInt16(r+e))throw new Error("FlatBuffers: field "+e+" must be set")},o.Builder.prototype.startVector=function(t,e,i){this.notNested(),this.vector_num_elems=e,this.prep(o.SIZEOF_INT,t*e),this.prep(i,t*e)},o.Builder.prototype.endVector=function(){return this.writeInt32(this.vector_num_elems),this.offset()},o.Builder.prototype.createString=function(t){if(t instanceof Uint8Array)var e=t;else{e=[];for(var i=0;i<t.length;){var r,s=t.charCodeAt(i++);(r=s<55296||s>=56320?s:(s<<10)+t.charCodeAt(i++)+-56613888)<128?e.push(r):(r<2048?e.push(r>>6&31|192):(r<65536?e.push(r>>12&15|224):e.push(r>>18&7|240,r>>12&63|128),e.push(r>>6&63|128)),e.push(63&r|128))}}this.addInt8(0),this.startVector(1,e.length,1),this.bb.setPosition(this.space-=e.length),i=0;for(var n=this.space,o=this.bb.bytes();i<e.length;i++)o[n++]=e[i];return this.endVector()},o.Builder.prototype.createLong=function(t,e){return o.Long.create(t,e)},o.ByteBuffer=function(t){this.bytes_=t,this.position_=0},o.ByteBuffer.allocate=function(t){return new o.ByteBuffer(new Uint8Array(t))},o.ByteBuffer.prototype.clear=function(){this.position_=0},o.ByteBuffer.prototype.bytes=function(){return this.bytes_},o.ByteBuffer.prototype.position=function(){return this.position_},o.ByteBuffer.prototype.setPosition=function(t){this.position_=t},o.ByteBuffer.prototype.capacity=function(){return this.bytes_.length},o.ByteBuffer.prototype.readInt8=function(t){return this.readUint8(t)<<24>>24},o.ByteBuffer.prototype.readUint8=function(t){return this.bytes_[t]},o.ByteBuffer.prototype.readInt16=function(t){return this.readUint16(t)<<16>>16},o.ByteBuffer.prototype.readUint16=function(t){return this.bytes_[t]|this.bytes_[t+1]<<8},o.ByteBuffer.prototype.readInt32=function(t){return this.bytes_[t]|this.bytes_[t+1]<<8|this.bytes_[t+2]<<16|this.bytes_[t+3]<<24},o.ByteBuffer.prototype.readUint32=function(t){return this.readInt32(t)>>>0},o.ByteBuffer.prototype.readInt64=function(t){return new o.Long(this.readInt32(t),this.readInt32(t+4))},o.ByteBuffer.prototype.readUint64=function(t){return new o.Long(this.readUint32(t),this.readUint32(t+4))},o.ByteBuffer.prototype.readFloat32=function(t){return o.int32[0]=this.readInt32(t),o.float32[0]},o.ByteBuffer.prototype.readFloat64=function(t){return o.int32[o.isLittleEndian?0:1]=this.readInt32(t),o.int32[o.isLittleEndian?1:0]=this.readInt32(t+4),o.float64[0]},o.ByteBuffer.prototype.writeInt8=function(t,e){this.bytes_[t]=e},o.ByteBuffer.prototype.writeUint8=function(t,e){this.bytes_[t]=e},o.ByteBuffer.prototype.writeInt16=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8},o.ByteBuffer.prototype.writeUint16=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8},o.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},o.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},o.ByteBuffer.prototype.writeInt64=function(t,e){this.writeInt32(t,e.low),this.writeInt32(t+4,e.high)},o.ByteBuffer.prototype.writeUint64=function(t,e){this.writeUint32(t,e.low),this.writeUint32(t+4,e.high)},o.ByteBuffer.prototype.writeFloat32=function(t,e){o.float32[0]=e,this.writeInt32(t,o.int32[0])},o.ByteBuffer.prototype.writeFloat64=function(t,e){o.float64[0]=e,this.writeInt32(t,o.int32[o.isLittleEndian?0:1]),this.writeInt32(t+4,o.int32[o.isLittleEndian?1:0])},o.ByteBuffer.prototype.getBufferIdentifier=function(){if(this.bytes_.length<this.position_+o.SIZEOF_INT+o.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: ByteBuffer is too short to contain an identifier.");for(var t="",e=0;e<o.FILE_IDENTIFIER_LENGTH;e++)t+=String.fromCharCode(this.readInt8(this.position_+o.SIZEOF_INT+e));return t},o.ByteBuffer.prototype.__offset=function(t,e){var i=t-this.readInt32(t);return e<this.readInt16(i)?this.readInt16(i+e):0},o.ByteBuffer.prototype.__union=function(t,e){return t.bb_pos=e+this.readInt32(e),t.bb=this,t},o.ByteBuffer.prototype.__string=function(t,e){t+=this.readInt32(t);var i=this.readInt32(t),r="",s=0;if(t+=o.SIZEOF_INT,e===o.Encoding.UTF8_BYTES)return this.bytes_.subarray(t,t+i);for(;s<i;){var n,a=this.readUint8(t+s++);if(a<192)n=a;else{var b=this.readUint8(t+s++);if(a<224)n=(31&a)<<6|63&b;else{var d=this.readUint8(t+s++);n=a<240?(15&a)<<12|(63&b)<<6|63&d:(7&a)<<18|(63&b)<<12|(63&d)<<6|63&this.readUint8(t+s++)}}n<65536?r+=String.fromCharCode(n):(n-=65536,r+=String.fromCharCode(55296+(n>>10),56320+(1023&n)))}return r},o.ByteBuffer.prototype.__indirect=function(t){return t+this.readInt32(t)},o.ByteBuffer.prototype.__vector=function(t){return t+this.readInt32(t)+o.SIZEOF_INT},o.ByteBuffer.prototype.__vector_len=function(t){return this.readInt32(t+this.readInt32(t))},o.ByteBuffer.prototype.__has_identifier=function(t){if(t.length!=o.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: file identifier must be length "+o.FILE_IDENTIFIER_LENGTH);for(var e=0;e<o.FILE_IDENTIFIER_LENGTH;e++)if(t.charCodeAt(e)!=this.readInt8(this.position_+o.SIZEOF_INT+e))return!1;return!0},o.ByteBuffer.prototype.createLong=function(t,e){return o.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"}(i||(i={})),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"}(r||(r={}));class a{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 a).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRoot(t,e){return t.setPosition(t.position()+o.SIZE_PREFIX_LENGTH),(e||new a).__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):r.Byte}title(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}width(){var t=this.bb.__offset(this.bb_pos,12);return t?this.bb.readInt32(this.bb_pos+t):-1}precision(){var t=this.bb.__offset(this.bb_pos,14);return t?this.bb.readInt32(this.bb_pos+t):-1}scale(){var t=this.bb.__offset(this.bb_pos,16);return t?this.bb.readInt32(this.bb_pos+t):-1}nullable(){var t=this.bb.__offset(this.bb_pos,18);return!t||!!this.bb.readInt8(this.bb_pos+t)}unique(){var t=this.bb.__offset(this.bb_pos,20);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}primaryKey(){var t=this.bb.__offset(this.bb_pos,22);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}metadata(t){var e=this.bb.__offset(this.bb_pos,24);return e?this.bb.__string(this.bb_pos+e,t):null}static start(t){t.startObject(11)}static addName(t,e){t.addFieldOffset(0,e,0)}static addType(t,e){t.addFieldInt8(1,e,r.Byte)}static addTitle(t,e){t.addFieldOffset(2,e,0)}static addDescription(t,e){t.addFieldOffset(3,e,0)}static addWidth(t,e){t.addFieldInt32(4,e,-1)}static addPrecision(t,e){t.addFieldInt32(5,e,-1)}static addScale(t,e){t.addFieldInt32(6,e,-1)}static addNullable(t,e){t.addFieldInt8(7,+e,1)}static addUnique(t,e){t.addFieldInt8(8,+e,0)}static addPrimaryKey(t,e){t.addFieldInt8(9,+e,0)}static addMetadata(t,e){t.addFieldOffset(10,e,0)}static end(t){var e=t.endObject();return t.requiredField(e,4),e}static create(t,e,i,r,s,n,o,b,d,h,u,f){return a.start(t),a.addName(t,e),a.addType(t,i),a.addTitle(t,r),a.addDescription(t,s),a.addWidth(t,n),a.addPrecision(t,o),a.addScale(t,b),a.addNullable(t,d),a.addUnique(t,h),a.addPrimaryKey(t,u),a.addMetadata(t,f),a.end(t)}}class b{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRoot(t,e){return(e||new b).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRoot(t,e){return t.setPosition(t.position()+o.SIZE_PREFIX_LENGTH),(e||new b).__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}codeString(t){var e=this.bb.__offset(this.bb_pos,14);return e?this.bb.__string(this.bb_pos+e,t):null}static start(t){t.startObject(6)}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 addCodeString(t,e){t.addFieldOffset(5,e,0)}static end(t){return t.endObject()}static create(t,e,i,r,s,n,o){return b.start(t),b.addOrg(t,e),b.addCode(t,i),b.addName(t,r),b.addDescription(t,s),b.addWkt(t,n),b.addCodeString(t,o),b.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()+o.SIZE_PREFIX_LENGTH),(e||new d).__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):i.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 i=this.bb.__offset(this.bb_pos,18);return i?(e||new a).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+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 b).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}title(t){var e=this.bb.__offset(this.bb_pos,26);return e?this.bb.__string(this.bb_pos+e,t):null}description(t){var e=this.bb.__offset(this.bb_pos,28);return e?this.bb.__string(this.bb_pos+e,t):null}metadata(t){var e=this.bb.__offset(this.bb_pos,30);return e?this.bb.__string(this.bb_pos+e,t):null}static start(t){t.startObject(14)}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 i=e.length-1;i>=0;i--)t.addFloat64(e[i]);return t.endVector()}static startEnvelopeVector(t,e){t.startVector(8,e,8)}static addGeometryType(t,e){t.addFieldInt8(2,e,i.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 i=e.length-1;i>=0;i--)t.addOffset(e[i]);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 addTitle(t,e){t.addFieldOffset(11,e,0)}static addDescription(t,e){t.addFieldOffset(12,e,0)}static addMetadata(t,e){t.addFieldOffset(13,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,i,r,s,n,o,a,b,h,u,f,c,l,_){return d.start(t),d.addName(t,e),d.addEnvelope(t,i),d.addGeometryType(t,r),d.addHasZ(t,s),d.addHasM(t,n),d.addHasT(t,o),d.addHasTM(t,a),d.addColumns(t,b),d.addFeaturesCount(t,h),d.addIndexNodeSize(t,u),d.addCrs(t,f),d.addTitle(t,c),d.addDescription(t,l),d.addMetadata(t,_),d.end(t)}}class h{constructor(t,e,i,r,s,n){this.org=t,this.code=e,this.name=i,this.description=r,this.wkt=s,this.code_string=n}}class u{constructor(t,e,i,r,s,n,o,a){this.geometryType=t,this.columns=e,this.featuresCount=i,this.indexNodeSize=r,this.crs=s,this.title=n,this.description=o,this.metadata=a}static fromByteBuffer(t){const i=d.getRoot(t),r=i.featuresCount().toFloat64(),s=i.indexNodeSize(),n=[];for(let t=0;t<i.columnsLength();t++){const r=i.columns(t);if(!r)throw new Error("Column unexpectedly missing");if(!r.name())throw new Error("Column name unexpectedly missing");n.push(new e(r.name(),r.type(),r.title(),r.description(),r.width(),r.precision(),r.scale(),r.nullable(),r.unique(),r.primaryKey()))}const o=i.crs(),a=o?new h(o.org(),o.code(),o.name(),o.description(),o.wkt(),o.codeString()):null;return new u(i.geometryType(),n,r,s,a,i.title(),i.description(),i.metadata())}}!function(t){t[t.Unknown=0]="Unknown",t[t.Point=1]="Point",t[t.LineString=2]="LineString",t[t.Polygon=3]="Polygon",t[t.MultiPoint=4]="MultiPoint",t[t.MultiLineString=5]="MultiLineString",t[t.MultiPolygon=6]="MultiPolygon",t[t.GeometryCollection=7]="GeometryCollection",t[t.CircularString=8]="CircularString",t[t.CompoundCurve=9]="CompoundCurve",t[t.CurvePolygon=10]="CurvePolygon",t[t.MultiCurve=11]="MultiCurve",t[t.MultiSurface=12]="MultiSurface",t[t.Curve=13]="Curve",t[t.Surface=14]="Surface",t[t.PolyhedralSurface=15]="PolyhedralSurface",t[t.TIN=16]="TIN",t[t.Triangle=17]="Triangle"}(s||(s={})),function(t){t[t.Byte=0]="Byte",t[t.UByte=1]="UByte",t[t.Bool=2]="Bool",t[t.Short=3]="Short",t[t.UShort=4]="UShort",t[t.Int=5]="Int",t[t.UInt=6]="UInt",t[t.Long=7]="Long",t[t.ULong=8]="ULong",t[t.Float=9]="Float",t[t.Double=10]="Double",t[t.String=11]="String",t[t.Json=12]="Json",t[t.DateTime=13]="DateTime",t[t.Binary=14]="Binary"}(n||(n={}));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()+o.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):n.Byte}title(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}width(){var t=this.bb.__offset(this.bb_pos,12);return t?this.bb.readInt32(this.bb_pos+t):-1}precision(){var t=this.bb.__offset(this.bb_pos,14);return t?this.bb.readInt32(this.bb_pos+t):-1}scale(){var t=this.bb.__offset(this.bb_pos,16);return t?this.bb.readInt32(this.bb_pos+t):-1}nullable(){var t=this.bb.__offset(this.bb_pos,18);return!t||!!this.bb.readInt8(this.bb_pos+t)}unique(){var t=this.bb.__offset(this.bb_pos,20);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}primaryKey(){var t=this.bb.__offset(this.bb_pos,22);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}metadata(t){var e=this.bb.__offset(this.bb_pos,24);return e?this.bb.__string(this.bb_pos+e,t):null}static start(t){t.startObject(11)}static addName(t,e){t.addFieldOffset(0,e,0)}static addType(t,e){t.addFieldInt8(1,e,n.Byte)}static addTitle(t,e){t.addFieldOffset(2,e,0)}static addDescription(t,e){t.addFieldOffset(3,e,0)}static addWidth(t,e){t.addFieldInt32(4,e,-1)}static addPrecision(t,e){t.addFieldInt32(5,e,-1)}static addScale(t,e){t.addFieldInt32(6,e,-1)}static addNullable(t,e){t.addFieldInt8(7,+e,1)}static addUnique(t,e){t.addFieldInt8(8,+e,0)}static addPrimaryKey(t,e){t.addFieldInt8(9,+e,0)}static addMetadata(t,e){t.addFieldOffset(10,e,0)}static end(t){var e=t.endObject();return t.requiredField(e,4),e}static create(t,e,i,r,s,n,o,a,b,d,h,u){return f.start(t),f.addName(t,e),f.addType(t,i),f.addTitle(t,r),f.addDescription(t,s),f.addWidth(t,n),f.addPrecision(t,o),f.addScale(t,a),f.addNullable(t,b),f.addUnique(t,d),f.addPrimaryKey(t,h),f.addMetadata(t,u),f.end(t)}}class c{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 c).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRoot(t,e){return t.setPosition(t.position()+o.SIZE_PREFIX_LENGTH),(e||new c).__init(t.readInt32(t.position())+t.position(),t)}ends(t){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readUint32(this.bb.__vector(this.bb_pos+e)+4*t):0}endsLength(){var t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__vector_len(this.bb_pos+t):0}endsArray(){var t=this.bb.__offset(this.bb_pos,4);return t?new Uint32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}xy(t){var e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readFloat64(this.bb.__vector(this.bb_pos+e)+8*t):0}xyLength(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}xyArray(){var t=this.bb.__offset(this.bb_pos,6);return t?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}z(t){var e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readFloat64(this.bb.__vector(this.bb_pos+e)+8*t):0}zLength(){var t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}zArray(){var t=this.bb.__offset(this.bb_pos,8);return t?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}m(t){var e=this.bb.__offset(this.bb_pos,10);return e?this.bb.readFloat64(this.bb.__vector(this.bb_pos+e)+8*t):0}mLength(){var t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__vector_len(this.bb_pos+t):0}mArray(){var t=this.bb.__offset(this.bb_pos,10);return t?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}t(t){var e=this.bb.__offset(this.bb_pos,12);return e?this.bb.readFloat64(this.bb.__vector(this.bb_pos+e)+8*t):0}tLength(){var t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}tArray(){var t=this.bb.__offset(this.bb_pos,12);return t?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}tm(t){var e=this.bb.__offset(this.bb_pos,14);return e?this.bb.readUint64(this.bb.__vector(this.bb_pos+e)+8*t):this.bb.createLong(0,0)}tmLength(){var t=this.bb.__offset(this.bb_pos,14);return t?this.bb.__vector_len(this.bb_pos+t):0}type(){var t=this.bb.__offset(this.bb_pos,16);return t?this.bb.readUint8(this.bb_pos+t):s.Unknown}parts(t,e){var i=this.bb.__offset(this.bb_pos,18);return i?(e||new c).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+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 i=e.length-1;i>=0;i--)t.addInt32(e[i]);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 i=e.length-1;i>=0;i--)t.addFloat64(e[i]);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 i=e.length-1;i>=0;i--)t.addFloat64(e[i]);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 i=e.length-1;i>=0;i--)t.addFloat64(e[i]);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 i=e.length-1;i>=0;i--)t.addFloat64(e[i]);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 i=e.length-1;i>=0;i--)t.addInt64(e[i]);return t.endVector()}static startTmVector(t,e){t.startVector(8,e,8)}static addType(t,e){t.addFieldInt8(6,e,s.Unknown)}static addParts(t,e){t.addFieldOffset(7,e,0)}static createPartsVector(t,e){t.startVector(4,e.length,4);for(var i=e.length-1;i>=0;i--)t.addOffset(e[i]);return t.endVector()}static startPartsVector(t,e){t.startVector(4,e,4)}static end(t){return t.endObject()}static create(t,e,i,r,s,n,o,a,b){return c.start(t),c.addEnds(t,e),c.addXy(t,i),c.addZ(t,r),c.addM(t,s),c.addT(t,n),c.addTm(t,o),c.addType(t,a),c.addParts(t,b),c.end(t)}}class l{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 l).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRoot(t,e){return t.setPosition(t.position()+o.SIZE_PREFIX_LENGTH),(e||new l).__init(t.readInt32(t.position())+t.position(),t)}geometry(t){var e=this.bb.__offset(this.bb_pos,4);return e?(t||new c).__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 i=this.bb.__offset(this.bb_pos,8);return i?(e||new f).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+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 i=e.length-1;i>=0;i--)t.addInt8(e[i]);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 i=e.length-1;i>=0;i--)t.addOffset(e[i]);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,i,r){return l.start(t),l.addGeometry(t,e),l.addProperties(t,i),l.addColumns(t,r),l.end(t)}}function _(t,e){const{xy:i,z:r,ends:s,parts:n,type:o}=e;if(n){const e=n.map(e=>_(t,e)),i=c.createPartsVector(t,e);return c.start(t),c.addParts(t,i),c.end(t)}const a=c.createXyVector(t,i);let b,d;return r&&(b=c.createZVector(t,r)),s&&(d=c.createEndsVector(t,s)),c.start(t),d&&c.addEnds(t,d),c.addXy(t,a),b&&c.addZ(t,b),c.addType(t,o),c.end(t)}function p(t,e,i){if(0!==t.length)if(Array.isArray(t[0]))for(const r of t)p(r,e,i);else 2===t.length?e.push(...t):(e.push(t[0],t[1]),i.push(t[2]))}function y(t,e){const i=[];for(let r=0;r<t.length;r+=2){const s=[t[r],t[r+1]];e&&s.push(e[r>>1]),i.push(s)}return i}function g(t){return t?i[t]:i.Unknown}function v(t){const e=t.coordinates,i=[],r=[];let s,n;const o=g(t.type);let a=0;switch(t.type){case"Point":p(e,i,r);break;case"MultiPoint":case"LineString":p(e,i,r);break;case"MultiLineString":case"Polygon":{const t=e;p(t,i,r),t.length>1&&(s=t.map(t=>a+=t.length));break}case"MultiPolygon":n=e.map(t=>({type:"Polygon",coordinates:t})).map(v);break;case"GeometryCollection":t.geometries&&(n=t.geometries.map(v))}return{xy:i,z:r.length>0?r:void 0,ends:s,type:o,parts:n}}function w(t,e){if(e===i.GeometryCollection){const r=[];for(let e=0;e<t.partsLength();e++){const i=t.parts(e),s=i.type();r.push(w(i,s))}return{type:i[e],geometries:r}}if(e===i.MultiPolygon){const r=[];for(let e=0;e<t.partsLength();e++)r.push(w(t.parts(e),i.Polygon));return{type:i[e],coordinates:r.map(t=>t.coordinates)}}const r=function(t,e){const r=t.xyArray(),s=t.zArray();switch(e){case i.Point:{const t=Array.from(r);return s&&t.push(s[0]),t}case i.MultiPoint:case i.LineString:return y(r,s);case i.MultiLineString:case i.Polygon:return function(t,e,i){if(!i||0===i.length)return[y(t,e)];let r=0;const s=Array.from(i).map(e=>t.slice(r,r=e<<1));let n;return e&&(r=0,n=Array.from(i).map(t=>e.slice(r,r=t))),s.map((t,e)=>y(t,n?n[e]:void 0))}(r,s,t.endsArray())}}(t,e);return{type:i[e],coordinates:r}}const I=new TextEncoder,B=new TextDecoder;function m(t,e,i){const s=i.columns,n=new o.Builder;let a=0,b=1024,d=new Uint8Array(b),h=new DataView(d.buffer);const u=function(t){if(a+t<b)return;b*=2;const e=new Uint8Array(b);e.set(d),d=e,h=new DataView(d.buffer,a)};if(s)for(let t=0;t<s.length;t++){const i=s[t],n=e[i.name];if(null!==n)switch(h.setUint16(a,t,!0),a+=2,i.type){case r.Bool:u(1),h.setUint8(a,n),a+=1;break;case r.Short:u(2),h.setInt16(a,n,!0),a+=2;break;case r.UShort:u(2),h.setUint16(a,n,!0),a+=2;break;case r.Int:u(4),h.setInt32(a,n,!0),a+=4;break;case r.UInt:u(4),h.setUint32(a,n,!0),a+=4;break;case r.Long:u(8),h.setBigInt64(a,BigInt(n),!0),a+=8;break;case r.Double:u(8),h.setFloat64(a,n,!0),a+=8;break;case r.DateTime:case r.String:{const t=I.encode(n);u(4),h.setUint32(a,t.length,!0),a+=4,u(t.length),d.set(t,a),a+=t.length;break}default:throw new Error("Unknown type "+i.type)}}let f=null;a>0&&(f=l.createPropertiesVector(n,d.slice(0,a)));const c=_(n,t);l.start(n),l.addGeometry(n,c),f&&l.addProperties(n,f);const p=l.end(n);return n.finishSizePrefixed(p),n.asUint8Array()}function F(t,e){const i=e.columns,s={type:"Feature",geometry:w(t.geometry(),e.geometryType)};return i&&i.length>0&&(s.properties=function(t,e){const i={};if(!e||0===e.length)return i;const s=t.propertiesArray();if(!s)return i;const n=new DataView(s.buffer,s.byteOffset),o=t.propertiesLength();let a=0;for(;a<o;){const t=n.getUint16(a,!0);a+=2;const o=e[t],b=o.name;switch(o.type){case r.Bool:i[b]=!!n.getUint8(a),a+=1;break;case r.Byte:i[b]=n.getInt8(a),a+=1;break;case r.UByte:i[b]=n.getUint8(a),a+=1;break;case r.Short:i[b]=n.getInt16(a,!0),a+=2;break;case r.UShort:i[b]=n.getUint16(a,!0),a+=2;break;case r.Int:i[b]=n.getInt32(a,!0),a+=4;break;case r.UInt:i[b]=n.getUint32(a,!0),a+=4;break;case r.Long:i[b]=Number(n.getBigInt64(a,!0)),a+=8;break;case r.ULong:i[b]=Number(n.getBigUint64(a,!0)),a+=8;break;case r.Double:i[b]=n.getFloat64(a,!0),a+=8;break;case r.DateTime:case r.String:{const t=n.getUint32(a,!0);a+=4,i[b]=B.decode(s.subarray(a,a+t)),a+=t;break}default:throw new Error("Unknown type "+o.type)}}return i}(t,i)),s}var E,S=new Uint8Array(0);function U(t,e){if(!t.length)return e;if(!e.length)return t;var i=new Uint8Array(t.length+e.length);return i.set(t),i.set(e,t.length),i}function T(t){this._source=t,this._array=S,this._index=0}T.prototype.read=function(){var t=this,e=t._array.subarray(t._index);return t._source.read().then((function(i){return t._array=S,t._index=0,i.done?e.length>0?{done:!1,value:e}:{done:!0,value:void 0}:{done:!1,value:U(e,i.value)}}))},T.prototype.slice=function(t){if((t|=0)<0)throw new Error("invalid length");var e=this,i=this._array.length-this._index;if(this._index+t<=this._array.length)return Promise.resolve(this._array.subarray(this._index,this._index+=t));var r=new Uint8Array(t);return r.set(this._array.subarray(this._index)),function s(){return e._source.read().then((function(n){return n.done?(e._array=S,e._index=0,i>0?r.subarray(0,i):null):i+n.value.length>=t?(e._array=n.value,e._index=t-i,r.set(n.value.subarray(0,t-i),i),r):(r.set(n.value,i),i+=n.value.length,s())}))}()},T.prototype.cancel=function(){return this._source.cancel()},function(t){t[t.Debug=0]="Debug",t[t.Info=1]="Info",t[t.Warn=2]="Warn",t[t.Error=3]="Error"}(E||(E={}));class L{static debug(...t){this.log(E.Debug,...t)}static info(...t){this.log(E.Info,...t)}static warn(...t){this.log(E.Warn,...t)}static error(...t){this.log(E.Error,...t)}static log(t,...e){if(!(this.logLevel>t))switch(t){case E.Debug:console.debug(...e);break;case E.Info:console.info(...e);break;case E.Warn:console.warn(...e);break;case E.Error:console.error(...e)}}}function O(t,e){e=Math.min(Math.max(+e,2),65535);let i=t,r=i;do{i=Math.ceil(i/e),r+=i}while(1!==i);return 40*r}function N(t,e){if(0!=(4293918720&t))throw Error("integer is too large to be safely represented");return e+t*2**32}L.logLevel=E.Info;const P=new Uint8Array([102,103,98,3,102,103,98,0]);class C{constructor(t,e,i,r){this.headerClient=t,this.header=e,this.headerLength=i,this.indexLength=r}static async open(t){let e=new x(t);const i=(()=>{let t,e=0;for(t=0;t<3;t++)e+=16**t*40;return e})(),r=2024+i;L.debug(`fetching header. minReqLength: ${r} (assumedHeaderLength: 2024, assumedIndexLength: ${i})`);{let t=new Uint8Array(await e.getRange(0,8,r,"header"));if(!t.every((t,e)=>P[e]===t))throw L.error(`bytes: ${t} != ${P}`),new Error("Not a FlatGeobuf file");L.debug("magic bytes look good")}let s;{let t=await e.getRange(8,4,r,"header");if(s=new DataView(t).getUint32(0,!0),s>10485760||s<8)throw new Error("Invalid header size");L.debug("headerLength: "+s)}const n=await e.getRange(12,s,r,"header"),a=new o.ByteBuffer(new Uint8Array(n)),b=u.fromByteBuffer(a),d=O(b.featuresCount,b.indexNodeSize);return L.debug("completed: opening http reader"),new C(e,b,s,d)}async*selectBbox(t){const e=this.lengthBeforeTree();let i=this.headerClient;L.debug("starting: selectBbox, traversing index. lengthBeforeTree: "+e),yield*async function*(t,e,i,r){class s{constructor(t,e){this._level=e,this.nodes=t}level(){return this._level}startNode(){return this.nodes[0]}endNode(){return this.nodes[1]}extendEndNodeToNewOffset(t){console.assert(t>this.nodes[1]),this.nodes[1]=t}toString(){return`[NodeRange level: ${this._level}, nodes: ${this.nodes[0]}-${this.nodes[1]}]`}}const{minX:n,minY:o,maxX:a,maxY:b}=i,d=function(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 i=t,r=i;const s=[i];do{i=Math.ceil(i/e),r+=i,s.push(i)}while(1!==i);const n=[];i=r;for(const t of s)n.push(i-t),i-=t;n.reverse(),s.reverse();const o=[];for(let t=0;t<s.length;t++)o.push([n[t],n[t]+s[t]]);return o.reverse(),o}(t,e),h=d[0][0],u=[(()=>{const t=d.length-1;return new s([0,1],t)})()];for(L.debug(`starting stream search with queue: ${u}, numItems: ${t}, nodeSize: ${e}, levelBounds: ${d}`);0!=u.length;){const t=u.shift();L.debug(`popped node: ${t}, queueLength: ${u.length}`);let i=t.startNode();const f=i>=h,[,c]=d[t.level()],l=Math.min(t.endNode()+e,c),_=l-i,p=await r(40*i,40*_),y=new Float64Array(p),g=new Uint32Array(p);for(let e=i;e<l;e++){const r=5*(e-i);if(a<y[r+0])continue;if(b<y[r+1])continue;if(n>y[r+2])continue;if(o>y[r+3])continue;const d=g[8+(r<<1)],c=N(g[9+(r<<1)],d);if(f){L.debug("yielding feature"),yield[c,e-h];continue}const l=6553.6,_=u[u.length-1];if(void 0!==_&&_.level()==t.level()-1&&c<_.endNode()+l){L.debug(`Extending existing node: ${_}, newOffset: ${_.endNode()} -> ${c}`),_.extendEndNodeToNewOffset(c);continue}let p=(()=>{let e=t.level()-1;return new s([c,c+1],e)})();void 0!==_&&_.level()==t.level()-1?L.debug(`pushing new node at offset: ${c} rather than merging with distant ${_}`):L.debug(`pushing new level for ${p} onto queue with tail: ${_}`),u.push(p)}}}(this.header.featuresCount,this.header.indexNodeSize,t,(async function(t,r){return i.getRange(e+t,r,0,"index")}))}lengthBeforeTree(){return P.length+4+this.headerLength}lengthBeforeFeatures(){return this.lengthBeforeTree()+this.indexLength}featureClient(){return void 0===this._featureClient&&(this._featureClient=this.headerClient.clone()),this._featureClient}async readFeature(t){const e=131072;let i,r=t+this.lengthBeforeFeatures();{const t=await this.featureClient().getRange(r,4,e,"feature length");i=new DataView(t).getUint32(0,!0)}L.debug(`featureOffset: ${r}, featureLength: ${i}`);let s=await this.featureClient().getRange(r+4,i,e,"feature data"),n=new Uint8Array(s);const a=new Uint8Array(i+4);a.set(n,4);const b=new o.ByteBuffer(a);return b.setPosition(4),l.getRoot(b)}}class x{constructor(t){this.buffer=new ArrayBuffer(0),this.head=0,this.httpClient="string"==typeof t?new V(t):t}clone(){let t=new x(this.httpClient);return t.buffer=this.buffer.slice(0),t.head=this.head,t}async getRange(t,e,i,r){L.debug(`need Range: ${t}-${t+e-1}`);const s=t-this.head,n=s+e;if(s>=0&&n<this.buffer.byteLength)return L.debug(`slicing existing Range: ${s}-${n-1}`),this.buffer.slice(s,n);let o=Math.max(e,i);return this.buffer=await this.httpClient.getRange(t,o,r),this.head=t,this.buffer.slice(0,e)}}class V{constructor(t){this.requestsEverMade=0,this.bytesEverRequested=0,this.url=t}async getRange(t,e,i){this.requestsEverMade+=1,this.bytesEverRequested+=e;let r=`bytes=${t}-${t+e-1}`;return L.debug(`request: #${this.requestsEverMade}, purpose: ${i}), bytes: (this_request: ${e}, ever: ${this.bytesEverRequested}), Range: ${r}`),(await fetch(this.url,{headers:{Range:r}})).arrayBuffer()}}async function R(t,e,i){let r=new Uint8Array(await t(4,"feature length"));if(0===r.byteLength)return;let s=new o.ByteBuffer(r);const n=s.readUint32(0);r=new Uint8Array(await t(n,"feature data"));const a=new Uint8Array(n+4);return a.set(r,4),s=new o.ByteBuffer(a),s.setPosition(4),i(l.getRoot(s),e)}function A(t){const e=new o.Builder;let i=null;t.columns&&(i=d.createColumnsVector(e,t.columns.map(t=>function(t,e){const i=t.createString(e.name);return a.start(t),a.addName(t,i),a.addType(t,e.type),a.end(t)}(e,t))));const r=e.createString("L1");d.start(e),d.addFeaturesCount(e,new o.Long(t.featuresCount,0)),d.addGeometryType(e,t.geometryType),d.addIndexNodeSize(e,0),i&&d.addColumns(e,i),d.addName(e,r);const s=d.end(e);return e.finishSizePrefixed(s),e.asUint8Array()}t.deserialize=function(t,e,i){return t instanceof Uint8Array?function(t,e){return{type:"FeatureCollection",features:function(t,e,i){if(!t.subarray(0,7).every((t,e)=>P[e]===t))throw new Error("Not a FlatGeobuf file");const r=new o.ByteBuffer(t),s=r.readUint32(P.length);r.setPosition(P.length+4);const n=u.fromByteBuffer(r);i&&i(n);let a=P.length+4+s;const{indexNodeSize:b,featuresCount:d}=n;b>0&&(a+=O(d,b));const h=[];for(;a<r.capacity();){const t=r.readUint32(a);r.setPosition(a+4);const i=l.getRoot(r);h.push(e(i,n)),a+=4+t}return h}(t,F,e)}}(t,i):t instanceof ReadableStream?function(t,e){return async function*(t,e,i){const r="function"==typeof(s=t).slice?s:new T("function"==typeof s.read?s:s.getReader());var s;const n=async t=>await r.slice(t);let a=new Uint8Array(await n(8));if(!a.every((t,e)=>P[e]===t))throw new Error("Not a FlatGeobuf file");a=new Uint8Array(await n(4));let b=new o.ByteBuffer(a);const d=b.readUint32(0);a=new Uint8Array(await n(d)),b=new o.ByteBuffer(a);const h=u.fromByteBuffer(b);i&&i(h);const{indexNodeSize:f,featuresCount:c}=h;if(f>0){const t=O(c,f);await n(t)}let l;for(;l=await R(n,h,e);)yield l}(t,F,e)}(t,i):function(t,e,i){return async function*(t,e,i,r){const s=await C.open(t);L.debug("opened reader"),r&&r(s.header);for await(let t of s.selectBbox(e)){let e=await s.readFeature(t[0]);yield i(e,s.header)}}(t,e,F,i)}(t,e,i)},t.serialize=function(t){return function(t){const i=function(t){const i=t.features[0],s=i.properties;let n=null;return s&&(n=Object.keys(s).map(t=>new e(t,function(t){if("boolean"==typeof t)return r.Bool;if("number"==typeof t)return t%1==0?r.Int:r.Double;if("string"==typeof t)return r.String;if(null===t)return r.String;throw new Error(`Unknown type (value '${t}')`)}(s[t]),null,null,-1,-1,-1,!0,!1,!1))),new u(g(i.geometry.type),n,t.features.length,0,null,null,null,null)}(t),s=A(i),n=t.features.map(t=>m(v(t.geometry),t.properties,i)),o=n.map(t=>t.length).reduce((t,e)=>t+e),a=new Uint8Array(P.length+s.length+o);a.set(s,P.length);let b=P.length+s.length;for(const t of n)a.set(t,b),b+=t.length;return a.set(P),a}(t)},Object.defineProperty(t,"__esModule",{value:!0})}(e)},function(t,e,i){(function(e){const r=i(3),s="undefined"==typeof window?e:window;s.loaders=s.loaders||{},t.exports=Object.assign(s.loaders,r)}).call(this,i(2))},function(t,e){var i;i=function(){return this}();try{i=i||new Function("return this")()}catch(t){"object"==typeof window&&(i=window)}t.exports=i},function(t,e,i){"use strict";i.r(e),i.d(e,"FlatGeobufLoader",(function(){return n}));var r=i(0);function s(t,e){if(0===t.byteLength)return[];const i=new Uint8Array(t),{features:s}=Object(r.deserialize)(i);return s}const n={...{id:"flatgeobuf",name:"FlatGeobuf",module:"flatgeobuf",version:"3.0.0-alpha.21",worker:!0,extensions:["fgb"],category:"geometry",options:{flatgeobuf:{}}},parse:async(t,e)=>s(t),parseSync:s,parseInBatchesFromStream:function(t,e){return Object(r.deserializeStream)(t)},binary:!0}}])}));
//# sourceMappingURL=dist.min.js.map

@@ -28,3 +28,3 @@ "use strict";

var VERSION = typeof "3.0.0-alpha.20" !== 'undefined' ? "3.0.0-alpha.20" : 'latest';
var VERSION = typeof "3.0.0-alpha.21" !== 'undefined' ? "3.0.0-alpha.21" : 'latest';
var FlatGeobufWorkerLoader = {

@@ -31,0 +31,0 @@ id: 'flatgeobuf',

@@ -10,3 +10,3 @@ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";

import parseFlatGeobuf, { parseFlatGeobufInBatches } from './lib/parse-flatgeobuf';
var VERSION = typeof "3.0.0-alpha.20" !== 'undefined' ? "3.0.0-alpha.20" : 'latest';
var VERSION = typeof "3.0.0-alpha.21" !== 'undefined' ? "3.0.0-alpha.21" : 'latest';
export var FlatGeobufWorkerLoader = {

@@ -13,0 +13,0 @@ id: 'flatgeobuf',

{
"name": "@loaders.gl/flatgeobuf",
"description": "Loader for FlatGeobuf",
"version": "3.0.0-alpha.20",
"version": "3.0.0-alpha.21",
"license": "MIT",

@@ -34,3 +34,3 @@ "publishConfig": {

"dependencies": {
"@loaders.gl/loader-utils": "3.0.0-alpha.20",
"@loaders.gl/loader-utils": "3.0.0-alpha.21",
"flatgeobuf": "^3.1.0"

@@ -41,3 +41,3 @@ },

},
"gitHead": "a21d85019d34c9045feae797e22ee7ce7f34d648"
"gitHead": "c1f7d7bec911c704a190dbcf6b392a07a555771b"
}

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet