@duckdb/duckdb-wasm 1.10.0 → 1.11.1-dev.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +94 -47
- package/dist/duckdb-browser-blocking.cjs +25 -0
- package/dist/duckdb-browser-blocking.cjs.map +7 -0
- package/dist/duckdb-browser-blocking.d.ts +1 -0
- package/dist/duckdb-browser-blocking.mjs +25 -0
- package/dist/duckdb-browser-blocking.mjs.map +7 -0
- package/dist/duckdb-browser-coi.pthread.worker.js +27 -0
- package/dist/duckdb-browser-coi.pthread.worker.js.map +7 -0
- package/dist/duckdb-browser-coi.worker.js +35 -0
- package/dist/duckdb-browser-coi.worker.js.map +7 -0
- package/dist/duckdb-browser-eh.worker.js +33 -0
- package/dist/duckdb-browser-eh.worker.js.map +7 -0
- package/dist/duckdb-browser-mvp.worker.js +33 -0
- package/dist/duckdb-browser-mvp.worker.js.map +7 -0
- package/dist/duckdb-browser.cjs +2 -0
- package/dist/duckdb-browser.cjs.map +7 -0
- package/dist/duckdb-browser.d.ts +1 -0
- package/dist/duckdb-browser.mjs +2 -0
- package/dist/duckdb-browser.mjs.map +7 -0
- package/dist/{duckdb-next-coi.wasm → duckdb-coi.wasm} +0 -0
- package/dist/{duckdb.wasm → duckdb-eh.wasm} +0 -0
- package/dist/duckdb-mvp.wasm +0 -0
- package/dist/duckdb-node-blocking.cjs +37 -0
- package/dist/duckdb-node-blocking.cjs.map +7 -0
- package/dist/duckdb-node-blocking.d.ts +1 -0
- package/dist/duckdb-node-eh.worker.cjs +37 -0
- package/dist/duckdb-node-eh.worker.cjs.map +7 -0
- package/dist/duckdb-node-mvp.worker.cjs +36 -0
- package/dist/duckdb-node-mvp.worker.cjs.map +7 -0
- package/dist/duckdb-node.cjs +2 -0
- package/dist/duckdb-node.cjs.map +7 -0
- package/dist/duckdb-node.d.ts +1 -0
- package/dist/img/duckdb.svg +6 -0
- package/dist/img/duckdb_version_badge.svg +1 -0
- package/dist/img/duckdb_wasm.svg +14 -0
- package/dist/tests-browser.js +20661 -19449
- package/dist/tests-browser.js.map +4 -4
- package/dist/tests-node.cjs +17258 -0
- package/dist/tests-node.cjs.map +7 -0
- package/dist/types/src/bindings/bindings_base.d.ts +30 -8
- package/dist/types/src/bindings/{bindings_browser_next.d.ts → bindings_browser_coi.d.ts} +0 -0
- package/dist/types/src/bindings/{bindings_browser_next_coi.d.ts → bindings_browser_eh.d.ts} +0 -0
- package/dist/types/src/bindings/{bindings_browser.d.ts → bindings_browser_mvp.d.ts} +0 -0
- package/dist/types/src/bindings/bindings_interface.d.ts +13 -5
- package/dist/types/src/bindings/{bindings_node_next.d.ts → bindings_node_eh.d.ts} +0 -0
- package/dist/types/src/bindings/{bindings_node.d.ts → bindings_node_mvp.d.ts} +0 -0
- package/dist/types/src/bindings/config.d.ts +43 -2
- package/dist/types/src/bindings/connection.d.ts +7 -7
- package/dist/types/src/bindings/index.d.ts +1 -1
- package/dist/types/src/bindings/insert_options.d.ts +3 -3
- package/dist/types/src/bindings/progress.d.ts +9 -0
- package/dist/types/src/bindings/runtime.d.ts +41 -10
- package/dist/types/src/bindings/runtime_browser.d.ts +5 -3
- package/dist/types/src/bindings/runtime_node.d.ts +2 -1
- package/dist/types/src/bindings/udf_function.d.ts +14 -0
- package/dist/types/src/bindings/udf_runtime.d.ts +3 -0
- package/dist/types/src/bindings/web_file.d.ts +11 -0
- package/dist/types/src/index.d.ts +1 -0
- package/dist/types/src/json_typedef.d.ts +17 -0
- package/dist/types/src/log.d.ts +5 -2
- package/dist/types/src/parallel/async_bindings.d.ts +19 -6
- package/dist/types/src/parallel/async_bindings_interface.d.ts +6 -3
- package/dist/types/src/parallel/async_connection.d.ts +4 -6
- package/dist/types/src/parallel/worker_dispatcher.d.ts +2 -1
- package/dist/types/src/parallel/worker_request.d.ts +18 -7
- package/dist/types/src/platform.d.ts +6 -3
- package/dist/types/src/targets/duckdb-browser-blocking.d.ts +12 -0
- package/dist/types/src/targets/{duckdb-browser-async-next-coi.pthread.worker.d.ts → duckdb-browser-coi.pthread.worker.d.ts} +0 -0
- package/dist/types/src/targets/{duckdb-browser-async-next-coi.worker.d.ts → duckdb-browser-coi.worker.d.ts} +0 -0
- package/dist/types/src/targets/{duckdb-browser-async-next.worker.d.ts → duckdb-browser-eh.worker.d.ts} +0 -0
- package/dist/types/src/targets/{duckdb-browser-async.worker.d.ts → duckdb-browser-mvp.worker.d.ts} +0 -0
- package/dist/types/src/targets/duckdb-node-blocking.d.ts +13 -0
- package/dist/types/src/targets/{duckdb-node-async-next.worker.d.ts → duckdb-node-eh.worker.d.ts} +0 -0
- package/dist/types/src/targets/{duckdb-node-async.worker.d.ts → duckdb-node-mvp.worker.d.ts} +0 -0
- package/dist/types/src/targets/duckdb.d.ts +8 -0
- package/dist/types/src/utils/index.d.ts +1 -1
- package/dist/types/src/utils/s3_helper.d.ts +27 -0
- package/dist/types/src/worker.d.ts +1 -0
- package/package.json +108 -44
- package/dist/duckdb-browser-async-next-coi.d.ts +0 -1
- package/dist/duckdb-browser-async-next-coi.pthread.worker.js +0 -4
- package/dist/duckdb-browser-async-next-coi.pthread.worker.js.map +0 -7
- package/dist/duckdb-browser-async-next-coi.worker.js +0 -19
- package/dist/duckdb-browser-async-next-coi.worker.js.map +0 -7
- package/dist/duckdb-browser-async-next.d.ts +0 -1
- package/dist/duckdb-browser-async-next.worker.js +0 -19
- package/dist/duckdb-browser-async-next.worker.js.map +0 -7
- package/dist/duckdb-browser-async.d.ts +0 -1
- package/dist/duckdb-browser-async.js +0 -18
- package/dist/duckdb-browser-async.js.map +0 -7
- package/dist/duckdb-browser-async.worker.js +0 -19
- package/dist/duckdb-browser-async.worker.js.map +0 -7
- package/dist/duckdb-browser-sync-next.d.ts +0 -1
- package/dist/duckdb-browser-sync-next.js +0 -19
- package/dist/duckdb-browser-sync-next.js.map +0 -7
- package/dist/duckdb-browser-sync.d.ts +0 -1
- package/dist/duckdb-browser-sync.js +0 -19
- package/dist/duckdb-browser-sync.js.map +0 -7
- package/dist/duckdb-esm.d.ts +0 -1
- package/dist/duckdb-esm.js +0 -2
- package/dist/duckdb-esm.js.map +0 -7
- package/dist/duckdb-next.wasm +0 -0
- package/dist/duckdb-node-async-next.worker.js +0 -4
- package/dist/duckdb-node-async-next.worker.js.map +0 -7
- package/dist/duckdb-node-async.d.ts +0 -1
- package/dist/duckdb-node-async.js +0 -2
- package/dist/duckdb-node-async.js.map +0 -7
- package/dist/duckdb-node-async.worker.js +0 -3
- package/dist/duckdb-node-async.worker.js.map +0 -7
- package/dist/duckdb-node-sync-next.d.ts +0 -1
- package/dist/duckdb-node-sync-next.js +0 -4
- package/dist/duckdb-node-sync-next.js.map +0 -7
- package/dist/duckdb-node-sync.d.ts +0 -1
- package/dist/duckdb-node-sync.js +0 -3
- package/dist/duckdb-node-sync.js.map +0 -7
- package/dist/tests-node.js +0 -152
- package/dist/tests-node.js.map +0 -7
- package/dist/types/src/bindings/insert.d.ts +0 -7
- package/dist/types/src/flat_arrow.d.ts +0 -14
- package/dist/types/src/targets/duckdb-browser-async.d.ts +0 -4
- package/dist/types/src/targets/duckdb-browser-sync-next.d.ts +0 -6
- package/dist/types/src/targets/duckdb-browser-sync.d.ts +0 -6
- package/dist/types/src/targets/duckdb-esm.d.ts +0 -1
- package/dist/types/src/targets/duckdb-node-async.d.ts +0 -4
- package/dist/types/src/targets/duckdb-node-sync-next.d.ts +0 -6
- package/dist/types/src/targets/duckdb-node-sync.d.ts +0 -6
- package/dist/types/src/utils/ipc_buffer.d.ts +0 -4
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
var duckdb=(()=>{var Z_=Object.create;var Ss=Object.defineProperty;var eg=Object.getOwnPropertyDescriptor;var tg=Object.getOwnPropertyNames;var rg=Object.getPrototypeOf,ng=Object.prototype.hasOwnProperty;var Sd=r=>Ss(r,"__esModule",{value:!0});var B=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),ig=(r,e)=>{Sd(r);for(var t in e)Ss(r,t,{get:e[t],enumerable:!0})},sg=(r,e,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of tg(e))!ng.call(r,n)&&n!=="default"&&Ss(r,n,{get:()=>e[n],enumerable:!(t=eg(e,n))||t.enumerable});return r},qa=r=>sg(Sd(Ss(r!=null?Z_(rg(r)):{},"default",r&&r.__esModule&&"default"in r?{get:()=>r.default,enumerable:!0}:{value:r,enumerable:!0})),r);var vn=B(Ad=>{var b={};b.Offset;b.Table;b.SIZEOF_SHORT=2;b.SIZEOF_INT=4;b.FILE_IDENTIFIER_LENGTH=4;b.Encoding={UTF8_BYTES:1,UTF16_STRING:2};b.int32=new Int32Array(2);b.float32=new Float32Array(b.int32.buffer);b.float64=new Float64Array(b.int32.buffer);b.isLittleEndian=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1;b.Long=function(r,e){this.low=r|0,this.high=e|0};b.Long.create=function(r,e){return r==0&&e==0?b.Long.ZERO:new b.Long(r,e)};b.Long.prototype.toFloat64=function(){return(this.low>>>0)+this.high*4294967296};b.Long.prototype.equals=function(r){return this.low==r.low&&this.high==r.high};b.Long.ZERO=new b.Long(0,0);b.Builder=function(r){if(r)var e=r;else var e=1024;this.bb=b.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};b.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};b.Builder.prototype.forceDefaults=function(r){this.force_defaults=r};b.Builder.prototype.dataBuffer=function(){return this.bb};b.Builder.prototype.asUint8Array=function(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())};b.Builder.prototype.prep=function(r,e){r>this.minalign&&(this.minalign=r);for(var t=~(this.bb.capacity()-this.space+e)+1&r-1;this.space<t+r+e;){var n=this.bb.capacity();this.bb=b.Builder.growByteBuffer(this.bb),this.space+=this.bb.capacity()-n}this.pad(t)};b.Builder.prototype.pad=function(r){for(var e=0;e<r;e++)this.bb.writeInt8(--this.space,0)};b.Builder.prototype.writeInt8=function(r){this.bb.writeInt8(this.space-=1,r)};b.Builder.prototype.writeInt16=function(r){this.bb.writeInt16(this.space-=2,r)};b.Builder.prototype.writeInt32=function(r){this.bb.writeInt32(this.space-=4,r)};b.Builder.prototype.writeInt64=function(r){this.bb.writeInt64(this.space-=8,r)};b.Builder.prototype.writeFloat32=function(r){this.bb.writeFloat32(this.space-=4,r)};b.Builder.prototype.writeFloat64=function(r){this.bb.writeFloat64(this.space-=8,r)};b.Builder.prototype.addInt8=function(r){this.prep(1,0),this.writeInt8(r)};b.Builder.prototype.addInt16=function(r){this.prep(2,0),this.writeInt16(r)};b.Builder.prototype.addInt32=function(r){this.prep(4,0),this.writeInt32(r)};b.Builder.prototype.addInt64=function(r){this.prep(8,0),this.writeInt64(r)};b.Builder.prototype.addFloat32=function(r){this.prep(4,0),this.writeFloat32(r)};b.Builder.prototype.addFloat64=function(r){this.prep(8,0),this.writeFloat64(r)};b.Builder.prototype.addFieldInt8=function(r,e,t){(this.force_defaults||e!=t)&&(this.addInt8(e),this.slot(r))};b.Builder.prototype.addFieldInt16=function(r,e,t){(this.force_defaults||e!=t)&&(this.addInt16(e),this.slot(r))};b.Builder.prototype.addFieldInt32=function(r,e,t){(this.force_defaults||e!=t)&&(this.addInt32(e),this.slot(r))};b.Builder.prototype.addFieldInt64=function(r,e,t){(this.force_defaults||!e.equals(t))&&(this.addInt64(e),this.slot(r))};b.Builder.prototype.addFieldFloat32=function(r,e,t){(this.force_defaults||e!=t)&&(this.addFloat32(e),this.slot(r))};b.Builder.prototype.addFieldFloat64=function(r,e,t){(this.force_defaults||e!=t)&&(this.addFloat64(e),this.slot(r))};b.Builder.prototype.addFieldOffset=function(r,e,t){(this.force_defaults||e!=t)&&(this.addOffset(e),this.slot(r))};b.Builder.prototype.addFieldStruct=function(r,e,t){e!=t&&(this.nested(e),this.slot(r))};b.Builder.prototype.nested=function(r){if(r!=this.offset())throw new Error("FlatBuffers: struct must be serialized inline.")};b.Builder.prototype.notNested=function(){if(this.isNested)throw new Error("FlatBuffers: object serialization must not be nested.")};b.Builder.prototype.slot=function(r){this.vtable[r]=this.offset()};b.Builder.prototype.offset=function(){return this.bb.capacity()-this.space};b.Builder.growByteBuffer=function(r){var e=r.capacity();if(e&3221225472)throw new Error("FlatBuffers: cannot grow buffer beyond 2 gigabytes.");var t=e<<1,n=b.ByteBuffer.allocate(t);return n.setPosition(t-e),n.bytes().set(r.bytes(),t-e),n};b.Builder.prototype.addOffset=function(r){this.prep(b.SIZEOF_INT,0),this.writeInt32(this.offset()-r+b.SIZEOF_INT)};b.Builder.prototype.startObject=function(r){this.notNested(),this.vtable==null&&(this.vtable=[]),this.vtable_in_use=r;for(var e=0;e<r;e++)this.vtable[e]=0;this.isNested=!0,this.object_start=this.offset()};b.Builder.prototype.endObject=function(){if(this.vtable==null||!this.isNested)throw new Error("FlatBuffers: endObject called without startObject");this.addInt32(0);for(var r=this.offset(),e=this.vtable_in_use-1;e>=0&&this.vtable[e]==0;e--);for(var t=e+1;e>=0;e--)this.addInt16(this.vtable[e]!=0?r-this.vtable[e]:0);var n=2;this.addInt16(r-this.object_start);var i=(t+n)*b.SIZEOF_SHORT;this.addInt16(i);var o=0,a=this.space;e:for(e=0;e<this.vtables.length;e++){var u=this.bb.capacity()-this.vtables[e];if(i==this.bb.readInt16(u)){for(var f=b.SIZEOF_SHORT;f<i;f+=b.SIZEOF_SHORT)if(this.bb.readInt16(a+f)!=this.bb.readInt16(u+f))continue e;o=this.vtables[e];break}}return o?(this.space=this.bb.capacity()-r,this.bb.writeInt32(this.space,o-r)):(this.vtables.push(this.offset()),this.bb.writeInt32(this.bb.capacity()-r,this.offset()-r)),this.isNested=!1,r};b.Builder.prototype.finish=function(r,e){if(e){var t=e;if(this.prep(this.minalign,b.SIZEOF_INT+b.FILE_IDENTIFIER_LENGTH),t.length!=b.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: file identifier must be length "+b.FILE_IDENTIFIER_LENGTH);for(var n=b.FILE_IDENTIFIER_LENGTH-1;n>=0;n--)this.writeInt8(t.charCodeAt(n))}this.prep(this.minalign,b.SIZEOF_INT),this.addOffset(r),this.bb.setPosition(this.space)};b.Builder.prototype.requiredField=function(r,e){var t=this.bb.capacity()-r,n=t-this.bb.readInt32(t),i=this.bb.readInt16(n+e)!=0;if(!i)throw new Error("FlatBuffers: field "+e+" must be set")};b.Builder.prototype.startVector=function(r,e,t){this.notNested(),this.vector_num_elems=e,this.prep(b.SIZEOF_INT,r*e),this.prep(t,r*e)};b.Builder.prototype.endVector=function(){return this.writeInt32(this.vector_num_elems),this.offset()};b.Builder.prototype.createString=function(r){if(r instanceof Uint8Array)var e=r;else for(var e=[],t=0;t<r.length;){var n,i=r.charCodeAt(t++);if(i<55296||i>=56320)n=i;else{var o=r.charCodeAt(t++);n=(i<<10)+o+(65536-(55296<<10)-56320)}n<128?e.push(n):(n<2048?e.push(n>>6&31|192):(n<65536?e.push(n>>12&15|224):e.push(n>>18&7|240,n>>12&63|128),e.push(n>>6&63|128)),e.push(n&63|128))}this.addInt8(0),this.startVector(1,e.length,1),this.bb.setPosition(this.space-=e.length);for(var t=0,a=this.space,u=this.bb.bytes();t<e.length;t++)u[a++]=e[t];return this.endVector()};b.Builder.prototype.createLong=function(r,e){return b.Long.create(r,e)};b.ByteBuffer=function(r){this.bytes_=r,this.position_=0};b.ByteBuffer.allocate=function(r){return new b.ByteBuffer(new Uint8Array(r))};b.ByteBuffer.prototype.clear=function(){this.position_=0};b.ByteBuffer.prototype.bytes=function(){return this.bytes_};b.ByteBuffer.prototype.position=function(){return this.position_};b.ByteBuffer.prototype.setPosition=function(r){this.position_=r};b.ByteBuffer.prototype.capacity=function(){return this.bytes_.length};b.ByteBuffer.prototype.readInt8=function(r){return this.readUint8(r)<<24>>24};b.ByteBuffer.prototype.readUint8=function(r){return this.bytes_[r]};b.ByteBuffer.prototype.readInt16=function(r){return this.readUint16(r)<<16>>16};b.ByteBuffer.prototype.readUint16=function(r){return this.bytes_[r]|this.bytes_[r+1]<<8};b.ByteBuffer.prototype.readInt32=function(r){return this.bytes_[r]|this.bytes_[r+1]<<8|this.bytes_[r+2]<<16|this.bytes_[r+3]<<24};b.ByteBuffer.prototype.readUint32=function(r){return this.readInt32(r)>>>0};b.ByteBuffer.prototype.readInt64=function(r){return new b.Long(this.readInt32(r),this.readInt32(r+4))};b.ByteBuffer.prototype.readUint64=function(r){return new b.Long(this.readUint32(r),this.readUint32(r+4))};b.ByteBuffer.prototype.readFloat32=function(r){return b.int32[0]=this.readInt32(r),b.float32[0]};b.ByteBuffer.prototype.readFloat64=function(r){return b.int32[b.isLittleEndian?0:1]=this.readInt32(r),b.int32[b.isLittleEndian?1:0]=this.readInt32(r+4),b.float64[0]};b.ByteBuffer.prototype.writeInt8=function(r,e){this.bytes_[r]=e};b.ByteBuffer.prototype.writeUint8=function(r,e){this.bytes_[r]=e};b.ByteBuffer.prototype.writeInt16=function(r,e){this.bytes_[r]=e,this.bytes_[r+1]=e>>8};b.ByteBuffer.prototype.writeUint16=function(r,e){this.bytes_[r]=e,this.bytes_[r+1]=e>>8};b.ByteBuffer.prototype.writeInt32=function(r,e){this.bytes_[r]=e,this.bytes_[r+1]=e>>8,this.bytes_[r+2]=e>>16,this.bytes_[r+3]=e>>24};b.ByteBuffer.prototype.writeUint32=function(r,e){this.bytes_[r]=e,this.bytes_[r+1]=e>>8,this.bytes_[r+2]=e>>16,this.bytes_[r+3]=e>>24};b.ByteBuffer.prototype.writeInt64=function(r,e){this.writeInt32(r,e.low),this.writeInt32(r+4,e.high)};b.ByteBuffer.prototype.writeUint64=function(r,e){this.writeUint32(r,e.low),this.writeUint32(r+4,e.high)};b.ByteBuffer.prototype.writeFloat32=function(r,e){b.float32[0]=e,this.writeInt32(r,b.int32[0])};b.ByteBuffer.prototype.writeFloat64=function(r,e){b.float64[0]=e,this.writeInt32(r,b.int32[b.isLittleEndian?0:1]),this.writeInt32(r+4,b.int32[b.isLittleEndian?1:0])};b.ByteBuffer.prototype.getBufferIdentifier=function(){if(this.bytes_.length<this.position_+b.SIZEOF_INT+b.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: ByteBuffer is too short to contain an identifier.");for(var r="",e=0;e<b.FILE_IDENTIFIER_LENGTH;e++)r+=String.fromCharCode(this.readInt8(this.position_+b.SIZEOF_INT+e));return r};b.ByteBuffer.prototype.__offset=function(r,e){var t=r-this.readInt32(r);return e<this.readInt16(t)?this.readInt16(t+e):0};b.ByteBuffer.prototype.__union=function(r,e){return r.bb_pos=e+this.readInt32(e),r.bb=this,r};b.ByteBuffer.prototype.__string=function(r,e){r+=this.readInt32(r);var t=this.readInt32(r),n="",i=0;if(r+=b.SIZEOF_INT,e===b.Encoding.UTF8_BYTES)return this.bytes_.subarray(r,r+t);for(;i<t;){var o,a=this.readUint8(r+i++);if(a<192)o=a;else{var u=this.readUint8(r+i++);if(a<224)o=(a&31)<<6|u&63;else{var f=this.readUint8(r+i++);if(a<240)o=(a&15)<<12|(u&63)<<6|f&63;else{var s=this.readUint8(r+i++);o=(a&7)<<18|(u&63)<<12|(f&63)<<6|s&63}}}o<65536?n+=String.fromCharCode(o):(o-=65536,n+=String.fromCharCode((o>>10)+55296,(o&(1<<10)-1)+56320))}return n};b.ByteBuffer.prototype.__indirect=function(r){return r+this.readInt32(r)};b.ByteBuffer.prototype.__vector=function(r){return r+this.readInt32(r)+b.SIZEOF_INT};b.ByteBuffer.prototype.__vector_len=function(r){return this.readInt32(r+this.readInt32(r))};b.ByteBuffer.prototype.__has_identifier=function(r){if(r.length!=b.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: file identifier must be length "+b.FILE_IDENTIFIER_LENGTH);for(var e=0;e<b.FILE_IDENTIFIER_LENGTH;e++)if(r.charCodeAt(e)!=this.readInt8(this.position_+b.SIZEOF_INT+e))return!1;return!0};b.ByteBuffer.prototype.createLong=function(r,e){return b.Long.create(r,e)};Ad.flatbuffers=b});var Fd=B(Ya=>{"use strict";function nr(r,e,t){return e<=r&&r<=t}function Ds(r){if(r===void 0)return{};if(r===Object(r))return r;throw TypeError("Could not convert argument to dictionary")}function lg(r){for(var e=String(r),t=e.length,n=0,i=[];n<t;){var o=e.charCodeAt(n);if(o<55296||o>57343)i.push(o);else if(56320<=o&&o<=57343)i.push(65533);else if(55296<=o&&o<=56319)if(n===t-1)i.push(65533);else{var a=r.charCodeAt(n+1);if(56320<=a&&a<=57343){var u=o&1023,f=a&1023;i.push(65536+(u<<10)+f),n+=1}else i.push(65533)}n+=1}return i}function dg(r){for(var e="",t=0;t<r.length;++t){var n=r[t];n<=65535?e+=String.fromCharCode(n):(n-=65536,e+=String.fromCharCode((n>>10)+55296,(n&1023)+56320))}return e}var Os=-1;function za(r){this.tokens=[].slice.call(r)}za.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.shift():Os},prepend:function(r){if(Array.isArray(r))for(var e=r;e.length;)this.tokens.unshift(e.pop());else this.tokens.unshift(r)},push:function(r){if(Array.isArray(r))for(var e=r;e.length;)this.tokens.push(e.shift());else this.tokens.push(r)}};var wn=-1;function Wa(r,e){if(r)throw TypeError("Decoder error");return e||65533}var As="utf-8";function Fs(r,e){if(!(this instanceof Fs))return new Fs(r,e);if(r=r!==void 0?String(r).toLowerCase():As,r!==As)throw new Error("Encoding not supported. Only utf-8 is supported");e=Ds(e),this._streaming=!1,this._BOMseen=!1,this._decoder=null,this._fatal=Boolean(e.fatal),this._ignoreBOM=Boolean(e.ignoreBOM),Object.defineProperty(this,"encoding",{value:"utf-8"}),Object.defineProperty(this,"fatal",{value:this._fatal}),Object.defineProperty(this,"ignoreBOM",{value:this._ignoreBOM})}Fs.prototype={decode:function(e,t){var n;typeof e=="object"&&e instanceof ArrayBuffer?n=new Uint8Array(e):typeof e=="object"&&"buffer"in e&&e.buffer instanceof ArrayBuffer?n=new Uint8Array(e.buffer,e.byteOffset,e.byteLength):n=new Uint8Array(0),t=Ds(t),this._streaming||(this._decoder=new fg({fatal:this._fatal}),this._BOMseen=!1),this._streaming=Boolean(t.stream);for(var i=new za(n),o=[],a;!i.endOfStream()&&(a=this._decoder.handler(i,i.read()),a!==wn);)a!==null&&(Array.isArray(a)?o.push.apply(o,a):o.push(a));if(!this._streaming){do{if(a=this._decoder.handler(i,i.read()),a===wn)break;a!==null&&(Array.isArray(a)?o.push.apply(o,a):o.push(a))}while(!i.endOfStream());this._decoder=null}return o.length&&["utf-8"].indexOf(this.encoding)!==-1&&!this._ignoreBOM&&!this._BOMseen&&(o[0]===65279?(this._BOMseen=!0,o.shift()):this._BOMseen=!0),dg(o)}};function Ms(r,e){if(!(this instanceof Ms))return new Ms(r,e);if(r=r!==void 0?String(r).toLowerCase():As,r!==As)throw new Error("Encoding not supported. Only utf-8 is supported");e=Ds(e),this._streaming=!1,this._encoder=null,this._options={fatal:Boolean(e.fatal)},Object.defineProperty(this,"encoding",{value:"utf-8"})}Ms.prototype={encode:function(e,t){e=e?String(e):"",t=Ds(t),this._streaming||(this._encoder=new hg(this._options)),this._streaming=Boolean(t.stream);for(var n=[],i=new za(lg(e)),o;!i.endOfStream()&&(o=this._encoder.handler(i,i.read()),o!==wn);)Array.isArray(o)?n.push.apply(n,o):n.push(o);if(!this._streaming){for(;o=this._encoder.handler(i,i.read()),o!==wn;)Array.isArray(o)?n.push.apply(n,o):n.push(o);this._encoder=null}return new Uint8Array(n)}};function fg(r){var e=r.fatal,t=0,n=0,i=0,o=128,a=191;this.handler=function(u,f){if(f===Os&&i!==0)return i=0,Wa(e);if(f===Os)return wn;if(i===0){if(nr(f,0,127))return f;if(nr(f,194,223))i=1,t=f-192;else if(nr(f,224,239))f===224&&(o=160),f===237&&(a=159),i=2,t=f-224;else if(nr(f,240,244))f===240&&(o=144),f===244&&(a=143),i=3,t=f-240;else return Wa(e);return t=t<<6*i,null}if(!nr(f,o,a))return t=i=n=0,o=128,a=191,u.prepend(f),Wa(e);if(o=128,a=191,n+=1,t+=f-128<<6*(i-n),n!==i)return null;var s=t;return t=i=n=0,s}}function hg(r){var e=r.fatal;this.handler=function(t,n){if(n===Os)return wn;if(nr(n,0,127))return n;var i,o;nr(n,128,2047)?(i=1,o=192):nr(n,2048,65535)?(i=2,o=224):nr(n,65536,1114111)&&(i=3,o=240);for(var a=[(n>>6*i)+o];i>0;){var u=n>>6*(i-1);a.push(128|u&63),i-=1}return a}}Ya.TextEncoder=Ms;Ya.TextDecoder=Fs});var Xr=B(Tn=>{"use strict";Object.defineProperty(Tn,"__esModule",{value:!0});Tn.encodeUtf8=Tn.decodeUtf8=void 0;var Md=we(),Ud=Fd(),Us=typeof Buffer=="function"?Buffer:null,Vd=typeof TextDecoder=="function"&&typeof TextEncoder=="function";Tn.decodeUtf8=(r=>{if(Vd||!Us){let e=new r("utf-8");return t=>e.decode(t)}return e=>{let{buffer:t,byteOffset:n,length:i}=Md.toUint8Array(e);return Us.from(t,n,i).toString()}})(typeof TextDecoder!="undefined"?TextDecoder:Ud.TextDecoder);Tn.encodeUtf8=(r=>{if(Vd||!Us){let e=new r;return t=>e.encode(t)}return(e="")=>Md.toUint8Array(Us.from(e,"utf8"))})(typeof TextEncoder!="undefined"?TextEncoder:Ud.TextEncoder)});var In=B(Xe=>{"use strict";Object.defineProperty(Xe,"__esModule",{value:!0});Xe.AsyncQueue=Xe.ReadableInterop=Xe.ArrowJSON=Xe.ITERATOR_DONE=void 0;var Pd=Si();Xe.ITERATOR_DONE=Object.freeze({done:!0,value:void 0});var Nd=class{constructor(e){this._json=e}get schema(){return this._json.schema}get batches(){return this._json.batches||[]}get dictionaries(){return this._json.dictionaries||[]}};Xe.ArrowJSON=Nd;var Ha=class{tee(){return this._getDOMStream().tee()}pipe(e,t){return this._getNodeStream().pipe(e,t)}pipeTo(e,t){return this._getDOMStream().pipeTo(e,t)}pipeThrough(e,t){return this._getDOMStream().pipeThrough(e,t)}_getDOMStream(){return this._DOMStream||(this._DOMStream=this.toDOMStream())}_getNodeStream(){return this._nodeStream||(this._nodeStream=this.toNodeStream())}};Xe.ReadableInterop=Ha;var Rd=class extends Ha{constructor(){super();this._values=[],this.resolvers=[],this._closedPromise=new Promise(e=>this._closedPromiseResolve=e)}get closed(){return this._closedPromise}async cancel(e){await this.return(e)}write(e){this._ensureOpen()&&(this.resolvers.length<=0?this._values.push(e):this.resolvers.shift().resolve({done:!1,value:e}))}abort(e){this._closedPromiseResolve&&(this.resolvers.length<=0?this._error={error:e}:this.resolvers.shift().reject({done:!0,value:e}))}close(){if(this._closedPromiseResolve){let{resolvers:e}=this;for(;e.length>0;)e.shift().resolve(Xe.ITERATOR_DONE);this._closedPromiseResolve(),this._closedPromiseResolve=void 0}}[Symbol.asyncIterator](){return this}toDOMStream(e){return Pd.default.toDOMStream(this._closedPromiseResolve||this._error?this:this._values,e)}toNodeStream(e){return Pd.default.toNodeStream(this._closedPromiseResolve||this._error?this:this._values,e)}async throw(e){return await this.abort(e),Xe.ITERATOR_DONE}async return(e){return await this.close(),Xe.ITERATOR_DONE}async read(e){return(await this.next(e,"read")).value}async peek(e){return(await this.next(e,"peek")).value}next(...e){return this._values.length>0?Promise.resolve({done:!1,value:this._values.shift()}):this._error?Promise.reject({done:!0,value:this._error.error}):this._closedPromiseResolve?new Promise((t,n)=>{this.resolvers.push({resolve:t,reject:n})}):Promise.resolve(Xe.ITERATOR_DONE)}_ensureOpen(){if(this._closedPromiseResolve)return!0;throw new Error(`${this} is closed`)}};Xe.AsyncQueue=Rd});var Ye=B(F=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0});F.isReadableNodeStream=F.isWritableNodeStream=F.isReadableDOMStream=F.isWritableDOMStream=F.isFetchResponse=F.isFSReadStream=F.isFileHandle=F.isUnderlyingSink=F.isIteratorResult=F.isArrayLike=F.isArrowJSON=F.isAsyncIterable=F.isIterable=F.isObservable=F.isPromise=F.isObject=F.BigUint64ArrayAvailable=F.BigUint64Array=F.BigInt64ArrayAvailable=F.BigInt64Array=F.BigIntAvailable=F.BigInt=void 0;var Vs=In(),[pg,yg]=(()=>{let r=()=>{throw new Error("BigInt is not available in this environment")};function e(){throw r()}return e.asIntN=()=>{throw r()},e.asUintN=()=>{throw r()},typeof BigInt!="undefined"?[BigInt,!0]:[e,!1]})();F.BigInt=pg;F.BigIntAvailable=yg;var[bg,mg]=(()=>{let r=()=>{throw new Error("BigInt64Array is not available in this environment")};class e{static get BYTES_PER_ELEMENT(){return 8}static of(){throw r()}static from(){throw r()}constructor(){throw r()}}return typeof BigInt64Array!="undefined"?[BigInt64Array,!0]:[e,!1]})();F.BigInt64Array=bg;F.BigInt64ArrayAvailable=mg;var[_g,gg]=(()=>{let r=()=>{throw new Error("BigUint64Array is not available in this environment")};class e{static get BYTES_PER_ELEMENT(){return 8}static of(){throw r()}static from(){throw r()}constructor(){throw r()}}return typeof BigUint64Array!="undefined"?[BigUint64Array,!0]:[e,!1]})();F.BigUint64Array=_g;F.BigUint64ArrayAvailable=gg;var $a=r=>typeof r=="number",xd=r=>typeof r=="boolean",ke=r=>typeof r=="function";F.isObject=r=>r!=null&&Object(r)===r;F.isPromise=r=>F.isObject(r)&&ke(r.then);F.isObservable=r=>F.isObject(r)&&ke(r.subscribe);F.isIterable=r=>F.isObject(r)&&ke(r[Symbol.iterator]);F.isAsyncIterable=r=>F.isObject(r)&&ke(r[Symbol.asyncIterator]);F.isArrowJSON=r=>F.isObject(r)&&F.isObject(r.schema);F.isArrayLike=r=>F.isObject(r)&&$a(r.length);F.isIteratorResult=r=>F.isObject(r)&&"done"in r&&"value"in r;F.isUnderlyingSink=r=>F.isObject(r)&&ke(r.abort)&&ke(r.close)&&ke(r.start)&&ke(r.write);F.isFileHandle=r=>F.isObject(r)&&ke(r.stat)&&$a(r.fd);F.isFSReadStream=r=>F.isReadableNodeStream(r)&&$a(r.bytesRead);F.isFetchResponse=r=>F.isObject(r)&&F.isReadableDOMStream(r.body);F.isWritableDOMStream=r=>F.isObject(r)&&ke(r.abort)&&ke(r.getWriter)&&!(r instanceof Vs.ReadableInterop);F.isReadableDOMStream=r=>F.isObject(r)&&ke(r.cancel)&&ke(r.getReader)&&!(r instanceof Vs.ReadableInterop);F.isWritableNodeStream=r=>F.isObject(r)&&ke(r.end)&&ke(r.write)&&xd(r.writable)&&!(r instanceof Vs.ReadableInterop);F.isReadableNodeStream=r=>F.isObject(r)&&ke(r.read)&&ke(r.pipe)&&xd(r.readable)&&!(r instanceof Vs.ReadableInterop)});var we=B(D=>{"use strict";Object.defineProperty(D,"__esModule",{value:!0});D.compareArrayLike=D.rebaseValueOffsets=D.toUint8ClampedArrayAsyncIterator=D.toFloat64ArrayAsyncIterator=D.toFloat32ArrayAsyncIterator=D.toUint32ArrayAsyncIterator=D.toUint16ArrayAsyncIterator=D.toUint8ArrayAsyncIterator=D.toInt32ArrayAsyncIterator=D.toInt16ArrayAsyncIterator=D.toInt8ArrayAsyncIterator=D.toArrayBufferViewAsyncIterator=D.toUint8ClampedArrayIterator=D.toFloat64ArrayIterator=D.toFloat32ArrayIterator=D.toUint32ArrayIterator=D.toUint16ArrayIterator=D.toUint8ArrayIterator=D.toInt32ArrayIterator=D.toInt16ArrayIterator=D.toInt8ArrayIterator=D.toArrayBufferViewIterator=D.toUint8ClampedArray=D.toFloat64Array=D.toFloat32Array=D.toBigUint64Array=D.toUint32Array=D.toUint16Array=D.toUint8Array=D.toBigInt64Array=D.toInt32Array=D.toInt16Array=D.toInt8Array=D.toArrayBufferView=D.joinUint8Arrays=D.memcpy=void 0;var Bg=vn(),vg=Xr(),wg=Bg.flatbuffers.ByteBuffer,Zr=Ye(),Ja=typeof SharedArrayBuffer!="undefined"?SharedArrayBuffer:ArrayBuffer;function Tg(r){let e=r[0]?[r[0]]:[],t,n,i,o;for(let a,u,f=0,s=0,c=r.length;++f<c;){if(a=e[s],u=r[f],!a||!u||a.buffer!==u.buffer||u.byteOffset<a.byteOffset){u&&(e[++s]=u);continue}if({byteOffset:t,byteLength:i}=a,{byteOffset:n,byteLength:o}=u,t+i<n||n+o<t){u&&(e[++s]=u);continue}e[s]=new Uint8Array(a.buffer,t,n-t+o)}return e}function Ka(r,e,t=0,n=e.byteLength){let i=r.byteLength,o=new Uint8Array(r.buffer,r.byteOffset,i),a=new Uint8Array(e.buffer,e.byteOffset,Math.min(n,i));return o.set(a,t),r}D.memcpy=Ka;function Ig(r,e){let t=Tg(r),n=t.reduce((c,_)=>c+_.byteLength,0),i,o,a,u=0,f=-1,s=Math.min(e||1/0,n);for(let c=t.length;++f<c;){if(i=t[f],o=i.subarray(0,Math.min(i.length,s-u)),s<=u+o.length){o.length<i.length?t[f]=i.subarray(o.length):o.length===i.length&&f++,a?Ka(a,o,u):a=o;break}Ka(a||(a=new Uint8Array(s)),o,u),u+=o.length}return[a||new Uint8Array(0),t.slice(f),n-(a?a.byteLength:0)]}D.joinUint8Arrays=Ig;function Je(r,e){let t=Zr.isIteratorResult(e)?e.value:e;return t instanceof r?r===Uint8Array?new r(t.buffer,t.byteOffset,t.byteLength):t:t?(typeof t=="string"&&(t=vg.encodeUtf8(t)),t instanceof ArrayBuffer?new r(t):t instanceof Ja?new r(t):t instanceof wg?Je(r,t.bytes()):ArrayBuffer.isView(t)?t.byteLength<=0?new r(0):new r(t.buffer,t.byteOffset,t.byteLength/r.BYTES_PER_ELEMENT):r.from(t)):new r(0)}D.toArrayBufferView=Je;D.toInt8Array=r=>Je(Int8Array,r);D.toInt16Array=r=>Je(Int16Array,r);D.toInt32Array=r=>Je(Int32Array,r);D.toBigInt64Array=r=>Je(Zr.BigInt64Array,r);D.toUint8Array=r=>Je(Uint8Array,r);D.toUint16Array=r=>Je(Uint16Array,r);D.toUint32Array=r=>Je(Uint32Array,r);D.toBigUint64Array=r=>Je(Zr.BigUint64Array,r);D.toFloat32Array=r=>Je(Float32Array,r);D.toFloat64Array=r=>Je(Float64Array,r);D.toUint8ClampedArray=r=>Je(Uint8ClampedArray,r);var Ga=r=>(r.next(),r);function*Nt(r,e){let t=function*(i){yield i},n=typeof e=="string"||ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof Ja?t(e):Zr.isIterable(e)?e:t(e);return yield*Ga(function*(i){let o=null;do o=i.next(yield Je(r,o));while(!o.done)}(n[Symbol.iterator]())),new r}D.toArrayBufferViewIterator=Nt;D.toInt8ArrayIterator=r=>Nt(Int8Array,r);D.toInt16ArrayIterator=r=>Nt(Int16Array,r);D.toInt32ArrayIterator=r=>Nt(Int32Array,r);D.toUint8ArrayIterator=r=>Nt(Uint8Array,r);D.toUint16ArrayIterator=r=>Nt(Uint16Array,r);D.toUint32ArrayIterator=r=>Nt(Uint32Array,r);D.toFloat32ArrayIterator=r=>Nt(Float32Array,r);D.toFloat64ArrayIterator=r=>Nt(Float64Array,r);D.toUint8ClampedArrayIterator=r=>Nt(Uint8ClampedArray,r);async function*vt(r,e){if(Zr.isPromise(e))return yield*vt(r,await e);let t=async function*(o){yield await o},n=async function*(o){yield*Ga(function*(a){let u=null;do u=a.next(yield u&&u.value);while(!u.done)}(o[Symbol.iterator]()))},i=typeof e=="string"||ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof Ja?t(e):Zr.isIterable(e)?n(e):Zr.isAsyncIterable(e)?e:t(e);return yield*Ga(async function*(o){let a=null;do a=await o.next(yield Je(r,a));while(!a.done)}(i[Symbol.asyncIterator]())),new r}D.toArrayBufferViewAsyncIterator=vt;D.toInt8ArrayAsyncIterator=r=>vt(Int8Array,r);D.toInt16ArrayAsyncIterator=r=>vt(Int16Array,r);D.toInt32ArrayAsyncIterator=r=>vt(Int32Array,r);D.toUint8ArrayAsyncIterator=r=>vt(Uint8Array,r);D.toUint16ArrayAsyncIterator=r=>vt(Uint16Array,r);D.toUint32ArrayAsyncIterator=r=>vt(Uint32Array,r);D.toFloat32ArrayAsyncIterator=r=>vt(Float32Array,r);D.toFloat64ArrayAsyncIterator=r=>vt(Float64Array,r);D.toUint8ClampedArrayAsyncIterator=r=>vt(Uint8ClampedArray,r);function Sg(r,e,t){if(r!==0){t=t.slice(0,e+1);for(let n=-1;++n<=e;)t[n]+=r}return t}D.rebaseValueOffsets=Sg;function Dg(r,e){let t=0,n=r.length;if(n!==e.length)return!1;if(n>0)do if(r[t]!==e[t])return!1;while(++t<n);return!0}D.compareArrayLike=Dg});var Si=B(Xa=>{"use strict";Object.defineProperty(Xa,"__esModule",{value:!0});var Ke=we();Xa.default={fromIterable(r){return Ps(Og(r))},fromAsyncIterable(r){return Ps(Ag(r))},fromDOMStream(r){return Ps(Fg(r))},fromNodeStream(r){return Ps(Mg(r))},toDOMStream(r,e){throw new Error('"toDOMStream" not available in this environment')},toNodeStream(r,e){throw new Error('"toNodeStream" not available in this environment')}};var Ps=r=>(r.next(),r);function*Og(r){let e,t=!1,n=[],i,o,a,u=0;function f(){return o==="peek"?Ke.joinUint8Arrays(n,a)[0]:([i,n,u]=Ke.joinUint8Arrays(n,a),i)}({cmd:o,size:a}=yield null);let s=Ke.toUint8ArrayIterator(r)[Symbol.iterator]();try{do if({done:e,value:i}=isNaN(a-u)?s.next(void 0):s.next(a-u),!e&&i.byteLength>0&&(n.push(i),u+=i.byteLength),e||a<=u)do({cmd:o,size:a}=yield f());while(a<u);while(!e)}catch(c){(t=!0)&&typeof s.throw=="function"&&s.throw(c)}finally{t===!1&&typeof s.return=="function"&&s.return(null)}return null}async function*Ag(r){let e,t=!1,n=[],i,o,a,u=0;function f(){return o==="peek"?Ke.joinUint8Arrays(n,a)[0]:([i,n,u]=Ke.joinUint8Arrays(n,a),i)}({cmd:o,size:a}=yield null);let s=Ke.toUint8ArrayAsyncIterator(r)[Symbol.asyncIterator]();try{do if({done:e,value:i}=isNaN(a-u)?await s.next(void 0):await s.next(a-u),!e&&i.byteLength>0&&(n.push(i),u+=i.byteLength),e||a<=u)do({cmd:o,size:a}=yield f());while(a<u);while(!e)}catch(c){(t=!0)&&typeof s.throw=="function"&&await s.throw(c)}finally{t===!1&&typeof s.return=="function"&&await s.return(new Uint8Array(0))}return null}async function*Fg(r){let e=!1,t=!1,n=[],i,o,a,u=0;function f(){return o==="peek"?Ke.joinUint8Arrays(n,a)[0]:([i,n,u]=Ke.joinUint8Arrays(n,a),i)}({cmd:o,size:a}=yield null);let s=new jd(r);try{do if({done:e,value:i}=isNaN(a-u)?await s.read(void 0):await s.read(a-u),!e&&i.byteLength>0&&(n.push(Ke.toUint8Array(i)),u+=i.byteLength),e||a<=u)do({cmd:o,size:a}=yield f());while(a<u);while(!e)}catch(c){(t=!0)&&await s.cancel(c)}finally{t===!1?await s.cancel():r.locked&&s.releaseLock()}return null}var jd=class{constructor(e){this.source=e,this.byobReader=null,this.defaultReader=null;try{this.supportsBYOB=!!(this.reader=this.getBYOBReader())}catch{this.supportsBYOB=!(this.reader=this.getDefaultReader())}}get closed(){return this.reader?this.reader.closed.catch(()=>{}):Promise.resolve()}releaseLock(){this.reader&&this.reader.releaseLock(),this.reader=this.byobReader=this.defaultReader=null}async cancel(e){let{reader:t,source:n}=this;t&&await t.cancel(e).catch(()=>{}),n&&n.locked&&this.releaseLock()}async read(e){if(e===0)return{done:this.reader==null,value:new Uint8Array(0)};let t=!this.supportsBYOB||typeof e!="number"?await this.getDefaultReader().read():await this.readFromBYOBReader(e);return!t.done&&(t.value=Ke.toUint8Array(t)),t}getDefaultReader(){return this.byobReader&&this.releaseLock(),this.defaultReader||(this.defaultReader=this.source.getReader(),this.defaultReader.closed.catch(()=>{})),this.reader=this.defaultReader}getBYOBReader(){return this.defaultReader&&this.releaseLock(),this.byobReader||(this.byobReader=this.source.getReader({mode:"byob"}),this.byobReader.closed.catch(()=>{})),this.reader=this.byobReader}async readFromBYOBReader(e){return await Ed(this.getBYOBReader(),new ArrayBuffer(e),0,e)}};async function Ed(r,e,t,n){if(t>=n)return{done:!1,value:new Uint8Array(e,0,n)};let{done:i,value:o}=await r.read(new Uint8Array(e,t,n-t));return(t+=o.byteLength)<n&&!i?await Ed(r,o.buffer,t,n):{done:i,value:new Uint8Array(o.buffer,0,t)}}var Qa=(r,e)=>{let t=i=>n([e,i]),n;return[e,t,new Promise(i=>(n=i)&&r.once(e,t))]};async function*Mg(r){let e=[],t="error",n=!1,i=null,o,a,u=0,f=[],s;function c(){return o==="peek"?Ke.joinUint8Arrays(f,a)[0]:([s,f,u]=Ke.joinUint8Arrays(f,a),s)}if({cmd:o,size:a}=yield null,r.isTTY)return yield new Uint8Array(0),null;try{e[0]=Qa(r,"end"),e[1]=Qa(r,"error");do{if(e[2]=Qa(r,"readable"),[t,i]=await Promise.race(e.map(U=>U[2])),t==="error")break;if((n=t==="end")||(isFinite(a-u)?(s=Ke.toUint8Array(r.read(a-u)),s.byteLength<a-u&&(s=Ke.toUint8Array(r.read(void 0)))):s=Ke.toUint8Array(r.read(void 0)),s.byteLength>0&&(f.push(s),u+=s.byteLength)),n||a<=u)do({cmd:o,size:a}=yield c());while(a<u)}while(!n)}finally{await _(e,t==="error"?i:null)}return null;function _(U,J){return s=f=null,new Promise(async(Qe,Ft)=>{for(let[Bt,bn]of U)r.off(Bt,bn);try{let Bt=r.destroy;Bt&&Bt.call(r,J),J=void 0}catch(Bt){J=Bt||J}finally{J!=null?Ft(J):Qe()}})}}});var Be=B(Sn=>{"use strict";Object.defineProperty(Sn,"__esModule",{value:!0});Sn.Vector=Sn.AbstractVector=void 0;var Ns=class{};Sn.AbstractVector=Ns;Sn.Vector=Ns;Ns.prototype.data=null});var Dn=B(O=>{"use strict";Object.defineProperty(O,"__esModule",{value:!0});O.org=void 0;var te;(function(r){var e;(function(t){var n;(function(i){var o;(function(a){let u;(function(f){f[f.V1=0]="V1",f[f.V2=1]="V2",f[f.V3=2]="V3",f[f.V4=3]="V4"})(u=a.MetadataVersion||(a.MetadataVersion={}))})(o=i.flatbuf||(i.flatbuf={}))})(n=t.arrow||(t.arrow={}))})(e=r.apache||(r.apache={}))})(te=O.org||(O.org={}));(function(r){var e;(function(t){var n;(function(i){var o;(function(a){let u;(function(f){f[f.Sparse=0]="Sparse",f[f.Dense=1]="Dense"})(u=a.UnionMode||(a.UnionMode={}))})(o=i.flatbuf||(i.flatbuf={}))})(n=t.arrow||(t.arrow={}))})(e=r.apache||(r.apache={}))})(te=O.org||(O.org={}));(function(r){var e;(function(t){var n;(function(i){var o;(function(a){let u;(function(f){f[f.HALF=0]="HALF",f[f.SINGLE=1]="SINGLE",f[f.DOUBLE=2]="DOUBLE"})(u=a.Precision||(a.Precision={}))})(o=i.flatbuf||(i.flatbuf={}))})(n=t.arrow||(t.arrow={}))})(e=r.apache||(r.apache={}))})(te=O.org||(O.org={}));(function(r){var e;(function(t){var n;(function(i){var o;(function(a){let u;(function(f){f[f.DAY=0]="DAY",f[f.MILLISECOND=1]="MILLISECOND"})(u=a.DateUnit||(a.DateUnit={}))})(o=i.flatbuf||(i.flatbuf={}))})(n=t.arrow||(t.arrow={}))})(e=r.apache||(r.apache={}))})(te=O.org||(O.org={}));(function(r){var e;(function(t){var n;(function(i){var o;(function(a){let u;(function(f){f[f.SECOND=0]="SECOND",f[f.MILLISECOND=1]="MILLISECOND",f[f.MICROSECOND=2]="MICROSECOND",f[f.NANOSECOND=3]="NANOSECOND"})(u=a.TimeUnit||(a.TimeUnit={}))})(o=i.flatbuf||(i.flatbuf={}))})(n=t.arrow||(t.arrow={}))})(e=r.apache||(r.apache={}))})(te=O.org||(O.org={}));(function(r){var e;(function(t){var n;(function(i){var o;(function(a){let u;(function(f){f[f.YEAR_MONTH=0]="YEAR_MONTH",f[f.DAY_TIME=1]="DAY_TIME"})(u=a.IntervalUnit||(a.IntervalUnit={}))})(o=i.flatbuf||(i.flatbuf={}))})(n=t.arrow||(t.arrow={}))})(e=r.apache||(r.apache={}))})(te=O.org||(O.org={}));(function(r){var e;(function(t){var n;(function(i){var o;(function(a){let u;(function(f){f[f.NONE=0]="NONE",f[f.Null=1]="Null",f[f.Int=2]="Int",f[f.FloatingPoint=3]="FloatingPoint",f[f.Binary=4]="Binary",f[f.Utf8=5]="Utf8",f[f.Bool=6]="Bool",f[f.Decimal=7]="Decimal",f[f.Date=8]="Date",f[f.Time=9]="Time",f[f.Timestamp=10]="Timestamp",f[f.Interval=11]="Interval",f[f.List=12]="List",f[f.Struct_=13]="Struct_",f[f.Union=14]="Union",f[f.FixedSizeBinary=15]="FixedSizeBinary",f[f.FixedSizeList=16]="FixedSizeList",f[f.Map=17]="Map",f[f.Duration=18]="Duration",f[f.LargeBinary=19]="LargeBinary",f[f.LargeUtf8=20]="LargeUtf8",f[f.LargeList=21]="LargeList"})(u=a.Type||(a.Type={}))})(o=i.flatbuf||(i.flatbuf={}))})(n=t.arrow||(t.arrow={}))})(e=r.apache||(r.apache={}))})(te=O.org||(O.org={}));(function(r){var e;(function(t){var n;(function(i){var o;(function(a){let u;(function(f){f[f.Little=0]="Little",f[f.Big=1]="Big"})(u=a.Endianness||(a.Endianness={}))})(o=i.flatbuf||(i.flatbuf={}))})(n=t.arrow||(t.arrow={}))})(e=r.apache||(r.apache={}))})(te=O.org||(O.org={}));(function(r){var e;(function(t){var n;(function(i){var o;(function(a){class u{constructor(){this.bb=null,this.bb_pos=0}__init(s,c){return this.bb_pos=s,this.bb=c,this}static getRootAsNull(s,c){return(c||new u).__init(s.readInt32(s.position())+s.position(),s)}static startNull(s){s.startObject(0)}static endNull(s){return s.endObject()}static createNull(s){return u.startNull(s),u.endNull(s)}}a.Null=u})(o=i.flatbuf||(i.flatbuf={}))})(n=t.arrow||(t.arrow={}))})(e=r.apache||(r.apache={}))})(te=O.org||(O.org={}));(function(r){var e;(function(t){var n;(function(i){var o;(function(a){class u{constructor(){this.bb=null,this.bb_pos=0}__init(s,c){return this.bb_pos=s,this.bb=c,this}static getRootAsStruct_(s,c){return(c||new u).__init(s.readInt32(s.position())+s.position(),s)}static startStruct_(s){s.startObject(0)}static endStruct_(s){return s.endObject()}static createStruct_(s){return u.startStruct_(s),u.endStruct_(s)}}a.Struct_=u})(o=i.flatbuf||(i.flatbuf={}))})(n=t.arrow||(t.arrow={}))})(e=r.apache||(r.apache={}))})(te=O.org||(O.org={}));(function(r){var e;(function(t){var n;(function(i){var o;(function(a){class u{constructor(){this.bb=null,this.bb_pos=0}__init(s,c){return this.bb_pos=s,this.bb=c,this}static getRootAsList(s,c){return(c||new u).__init(s.readInt32(s.position())+s.position(),s)}static startList(s){s.startObject(0)}static endList(s){return s.endObject()}static createList(s){return u.startList(s),u.endList(s)}}a.List=u})(o=i.flatbuf||(i.flatbuf={}))})(n=t.arrow||(t.arrow={}))})(e=r.apache||(r.apache={}))})(te=O.org||(O.org={}));(function(r){var e;(function(t){var n;(function(i){var o;(function(a){class u{constructor(){this.bb=null,this.bb_pos=0}__init(s,c){return this.bb_pos=s,this.bb=c,this}static getRootAsLargeList(s,c){return(c||new u).__init(s.readInt32(s.position())+s.position(),s)}static startLargeList(s){s.startObject(0)}static endLargeList(s){return s.endObject()}static createLargeList(s){return u.startLargeList(s),u.endLargeList(s)}}a.LargeList=u})(o=i.flatbuf||(i.flatbuf={}))})(n=t.arrow||(t.arrow={}))})(e=r.apache||(r.apache={}))})(te=O.org||(O.org={}));(function(r){var e;(function(t){var n;(function(i){var o;(function(a){class u{constructor(){this.bb=null,this.bb_pos=0}__init(s,c){return this.bb_pos=s,this.bb=c,this}static getRootAsFixedSizeList(s,c){return(c||new u).__init(s.readInt32(s.position())+s.position(),s)}listSize(){let s=this.bb.__offset(this.bb_pos,4);return s?this.bb.readInt32(this.bb_pos+s):0}static startFixedSizeList(s){s.startObject(1)}static addListSize(s,c){s.addFieldInt32(0,c,0)}static endFixedSizeList(s){return s.endObject()}static createFixedSizeList(s,c){return u.startFixedSizeList(s),u.addListSize(s,c),u.endFixedSizeList(s)}}a.FixedSizeList=u})(o=i.flatbuf||(i.flatbuf={}))})(n=t.arrow||(t.arrow={}))})(e=r.apache||(r.apache={}))})(te=O.org||(O.org={}));(function(r){var e;(function(t){var n;(function(i){var o;(function(a){class u{constructor(){this.bb=null,this.bb_pos=0}__init(s,c){return this.bb_pos=s,this.bb=c,this}static getRootAsMap(s,c){return(c||new u).__init(s.readInt32(s.position())+s.position(),s)}keysSorted(){let s=this.bb.__offset(this.bb_pos,4);return s?!!this.bb.readInt8(this.bb_pos+s):!1}static startMap(s){s.startObject(1)}static addKeysSorted(s,c){s.addFieldInt8(0,+c,0)}static endMap(s){return s.endObject()}static createMap(s,c){return u.startMap(s),u.addKeysSorted(s,c),u.endMap(s)}}a.Map=u})(o=i.flatbuf||(i.flatbuf={}))})(n=t.arrow||(t.arrow={}))})(e=r.apache||(r.apache={}))})(te=O.org||(O.org={}));(function(r){var e;(function(t){var n;(function(i){var o;(function(a){class u{constructor(){this.bb=null,this.bb_pos=0}__init(s,c){return this.bb_pos=s,this.bb=c,this}static getRootAsUnion(s,c){return(c||new u).__init(s.readInt32(s.position())+s.position(),s)}mode(){let s=this.bb.__offset(this.bb_pos,4);return s?this.bb.readInt16(this.bb_pos+s):r.apache.arrow.flatbuf.UnionMode.Sparse}typeIds(s){let c=this.bb.__offset(this.bb_pos,6);return c?this.bb.readInt32(this.bb.__vector(this.bb_pos+c)+s*4):0}typeIdsLength(){let s=this.bb.__offset(this.bb_pos,6);return s?this.bb.__vector_len(this.bb_pos+s):0}typeIdsArray(){let s=this.bb.__offset(this.bb_pos,6);return s?new Int32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+s),this.bb.__vector_len(this.bb_pos+s)):null}static startUnion(s){s.startObject(2)}static addMode(s,c){s.addFieldInt16(0,c,r.apache.arrow.flatbuf.UnionMode.Sparse)}static addTypeIds(s,c){s.addFieldOffset(1,c,0)}static createTypeIdsVector(s,c){s.startVector(4,c.length,4);for(let _=c.length-1;_>=0;_--)s.addInt32(c[_]);return s.endVector()}static startTypeIdsVector(s,c){s.startVector(4,c,4)}static endUnion(s){return s.endObject()}static createUnion(s,c,_){return u.startUnion(s),u.addMode(s,c),u.addTypeIds(s,_),u.endUnion(s)}}a.Union=u})(o=i.flatbuf||(i.flatbuf={}))})(n=t.arrow||(t.arrow={}))})(e=r.apache||(r.apache={}))})(te=O.org||(O.org={}));(function(r){var e;(function(t){var n;(function(i){var o;(function(a){class u{constructor(){this.bb=null,this.bb_pos=0}__init(s,c){return this.bb_pos=s,this.bb=c,this}static getRootAsInt(s,c){return(c||new u).__init(s.readInt32(s.position())+s.position(),s)}bitWidth(){let s=this.bb.__offset(this.bb_pos,4);return s?this.bb.readInt32(this.bb_pos+s):0}isSigned(){let s=this.bb.__offset(this.bb_pos,6);return s?!!this.bb.readInt8(this.bb_pos+s):!1}static startInt(s){s.startObject(2)}static addBitWidth(s,c){s.addFieldInt32(0,c,0)}static addIsSigned(s,c){s.addFieldInt8(1,+c,0)}static endInt(s){return s.endObject()}static createInt(s,c,_){return u.startInt(s),u.addBitWidth(s,c),u.addIsSigned(s,_),u.endInt(s)}}a.Int=u})(o=i.flatbuf||(i.flatbuf={}))})(n=t.arrow||(t.arrow={}))})(e=r.apache||(r.apache={}))})(te=O.org||(O.org={}));(function(r){var e;(function(t){var n;(function(i){var o;(function(a){class u{constructor(){this.bb=null,this.bb_pos=0}__init(s,c){return this.bb_pos=s,this.bb=c,this}static getRootAsFloatingPoint(s,c){return(c||new u).__init(s.readInt32(s.position())+s.position(),s)}precision(){let s=this.bb.__offset(this.bb_pos,4);return s?this.bb.readInt16(this.bb_pos+s):r.apache.arrow.flatbuf.Precision.HALF}static startFloatingPoint(s){s.startObject(1)}static addPrecision(s,c){s.addFieldInt16(0,c,r.apache.arrow.flatbuf.Precision.HALF)}static endFloatingPoint(s){return s.endObject()}static createFloatingPoint(s,c){return u.startFloatingPoint(s),u.addPrecision(s,c),u.endFloatingPoint(s)}}a.FloatingPoint=u})(o=i.flatbuf||(i.flatbuf={}))})(n=t.arrow||(t.arrow={}))})(e=r.apache||(r.apache={}))})(te=O.org||(O.org={}));(function(r){var e;(function(t){var n;(function(i){var o;(function(a){class u{constructor(){this.bb=null,this.bb_pos=0}__init(s,c){return this.bb_pos=s,this.bb=c,this}static getRootAsUtf8(s,c){return(c||new u).__init(s.readInt32(s.position())+s.position(),s)}static startUtf8(s){s.startObject(0)}static endUtf8(s){return s.endObject()}static createUtf8(s){return u.startUtf8(s),u.endUtf8(s)}}a.Utf8=u})(o=i.flatbuf||(i.flatbuf={}))})(n=t.arrow||(t.arrow={}))})(e=r.apache||(r.apache={}))})(te=O.org||(O.org={}));(function(r){var e;(function(t){var n;(function(i){var o;(function(a){class u{constructor(){this.bb=null,this.bb_pos=0}__init(s,c){return this.bb_pos=s,this.bb=c,this}static getRootAsBinary(s,c){return(c||new u).__init(s.readInt32(s.position())+s.position(),s)}static startBinary(s){s.startObject(0)}static endBinary(s){return s.endObject()}static createBinary(s){return u.startBinary(s),u.endBinary(s)}}a.Binary=u})(o=i.flatbuf||(i.flatbuf={}))})(n=t.arrow||(t.arrow={}))})(e=r.apache||(r.apache={}))})(te=O.org||(O.org={}));(function(r){var e;(function(t){var n;(function(i){var o;(function(a){class u{constructor(){this.bb=null,this.bb_pos=0}__init(s,c){return this.bb_pos=s,this.bb=c,this}static getRootAsLargeUtf8(s,c){return(c||new u).__init(s.readInt32(s.position())+s.position(),s)}static startLargeUtf8(s){s.startObject(0)}static endLargeUtf8(s){return s.endObject()}static createLargeUtf8(s){return u.startLargeUtf8(s),u.endLargeUtf8(s)}}a.LargeUtf8=u})(o=i.flatbuf||(i.flatbuf={}))})(n=t.arrow||(t.arrow={}))})(e=r.apache||(r.apache={}))})(te=O.org||(O.org={}));(function(r){var e;(function(t){var n;(function(i){var o;(function(a){class u{constructor(){this.bb=null,this.bb_pos=0}__init(s,c){return this.bb_pos=s,this.bb=c,this}static getRootAsLargeBinary(s,c){return(c||new u).__init(s.readInt32(s.position())+s.position(),s)}static startLargeBinary(s){s.startObject(0)}static endLargeBinary(s){return s.endObject()}static createLargeBinary(s){return u.startLargeBinary(s),u.endLargeBinary(s)}}a.LargeBinary=u})(o=i.flatbuf||(i.flatbuf={}))})(n=t.arrow||(t.arrow={}))})(e=r.apache||(r.apache={}))})(te=O.org||(O.org={}));(function(r){var e;(function(t){var n;(function(i){var o;(function(a){class u{constructor(){this.bb=null,this.bb_pos=0}__init(s,c){return this.bb_pos=s,this.bb=c,this}static getRootAsFixedSizeBinary(s,c){return(c||new u).__init(s.readInt32(s.position())+s.position(),s)}byteWidth(){let s=this.bb.__offset(this.bb_pos,4);return s?this.bb.readInt32(this.bb_pos+s):0}static startFixedSizeBinary(s){s.startObject(1)}static addByteWidth(s,c){s.addFieldInt32(0,c,0)}static endFixedSizeBinary(s){return s.endObject()}static createFixedSizeBinary(s,c){return u.startFixedSizeBinary(s),u.addByteWidth(s,c),u.endFixedSizeBinary(s)}}a.FixedSizeBinary=u})(o=i.flatbuf||(i.flatbuf={}))})(n=t.arrow||(t.arrow={}))})(e=r.apache||(r.apache={}))})(te=O.org||(O.org={}));(function(r){var e;(function(t){var n;(function(i){var o;(function(a){class u{constructor(){this.bb=null,this.bb_pos=0}__init(s,c){return this.bb_pos=s,this.bb=c,this}static getRootAsBool(s,c){return(c||new u).__init(s.readInt32(s.position())+s.position(),s)}static startBool(s){s.startObject(0)}static endBool(s){return s.endObject()}static createBool(s){return u.startBool(s),u.endBool(s)}}a.Bool=u})(o=i.flatbuf||(i.flatbuf={}))})(n=t.arrow||(t.arrow={}))})(e=r.apache||(r.apache={}))})(te=O.org||(O.org={}));(function(r){var e;(function(t){var n;(function(i){var o;(function(a){class u{constructor(){this.bb=null,this.bb_pos=0}__init(s,c){return this.bb_pos=s,this.bb=c,this}static getRootAsDecimal(s,c){return(c||new u).__init(s.readInt32(s.position())+s.position(),s)}precision(){let s=this.bb.__offset(this.bb_pos,4);return s?this.bb.readInt32(this.bb_pos+s):0}scale(){let s=this.bb.__offset(this.bb_pos,6);return s?this.bb.readInt32(this.bb_pos+s):0}static startDecimal(s){s.startObject(2)}static addPrecision(s,c){s.addFieldInt32(0,c,0)}static addScale(s,c){s.addFieldInt32(1,c,0)}static endDecimal(s){return s.endObject()}static createDecimal(s,c,_){return u.startDecimal(s),u.addPrecision(s,c),u.addScale(s,_),u.endDecimal(s)}}a.Decimal=u})(o=i.flatbuf||(i.flatbuf={}))})(n=t.arrow||(t.arrow={}))})(e=r.apache||(r.apache={}))})(te=O.org||(O.org={}));(function(r){var e;(function(t){var n;(function(i){var o;(function(a){class u{constructor(){this.bb=null,this.bb_pos=0}__init(s,c){return this.bb_pos=s,this.bb=c,this}static getRootAsDate(s,c){return(c||new u).__init(s.readInt32(s.position())+s.position(),s)}unit(){let s=this.bb.__offset(this.bb_pos,4);return s?this.bb.readInt16(this.bb_pos+s):r.apache.arrow.flatbuf.DateUnit.MILLISECOND}static startDate(s){s.startObject(1)}static addUnit(s,c){s.addFieldInt16(0,c,r.apache.arrow.flatbuf.DateUnit.MILLISECOND)}static endDate(s){return s.endObject()}static createDate(s,c){return u.startDate(s),u.addUnit(s,c),u.endDate(s)}}a.Date=u})(o=i.flatbuf||(i.flatbuf={}))})(n=t.arrow||(t.arrow={}))})(e=r.apache||(r.apache={}))})(te=O.org||(O.org={}));(function(r){var e;(function(t){var n;(function(i){var o;(function(a){class u{constructor(){this.bb=null,this.bb_pos=0}__init(s,c){return this.bb_pos=s,this.bb=c,this}static getRootAsTime(s,c){return(c||new u).__init(s.readInt32(s.position())+s.position(),s)}unit(){let s=this.bb.__offset(this.bb_pos,4);return s?this.bb.readInt16(this.bb_pos+s):r.apache.arrow.flatbuf.TimeUnit.MILLISECOND}bitWidth(){let s=this.bb.__offset(this.bb_pos,6);return s?this.bb.readInt32(this.bb_pos+s):32}static startTime(s){s.startObject(2)}static addUnit(s,c){s.addFieldInt16(0,c,r.apache.arrow.flatbuf.TimeUnit.MILLISECOND)}static addBitWidth(s,c){s.addFieldInt32(1,c,32)}static endTime(s){return s.endObject()}static createTime(s,c,_){return u.startTime(s),u.addUnit(s,c),u.addBitWidth(s,_),u.endTime(s)}}a.Time=u})(o=i.flatbuf||(i.flatbuf={}))})(n=t.arrow||(t.arrow={}))})(e=r.apache||(r.apache={}))})(te=O.org||(O.org={}));(function(r){var e;(function(t){var n;(function(i){var o;(function(a){class u{constructor(){this.bb=null,this.bb_pos=0}__init(s,c){return this.bb_pos=s,this.bb=c,this}static getRootAsTimestamp(s,c){return(c||new u).__init(s.readInt32(s.position())+s.position(),s)}unit(){let s=this.bb.__offset(this.bb_pos,4);return s?this.bb.readInt16(this.bb_pos+s):r.apache.arrow.flatbuf.TimeUnit.SECOND}timezone(s){let c=this.bb.__offset(this.bb_pos,6);return c?this.bb.__string(this.bb_pos+c,s):null}static startTimestamp(s){s.startObject(2)}static addUnit(s,c){s.addFieldInt16(0,c,r.apache.arrow.flatbuf.TimeUnit.SECOND)}static addTimezone(s,c){s.addFieldOffset(1,c,0)}static endTimestamp(s){return s.endObject()}static createTimestamp(s,c,_){return u.startTimestamp(s),u.addUnit(s,c),u.addTimezone(s,_),u.endTimestamp(s)}}a.Timestamp=u})(o=i.flatbuf||(i.flatbuf={}))})(n=t.arrow||(t.arrow={}))})(e=r.apache||(r.apache={}))})(te=O.org||(O.org={}));(function(r){var e;(function(t){var n;(function(i){var o;(function(a){class u{constructor(){this.bb=null,this.bb_pos=0}__init(s,c){return this.bb_pos=s,this.bb=c,this}static getRootAsInterval(s,c){return(c||new u).__init(s.readInt32(s.position())+s.position(),s)}unit(){let s=this.bb.__offset(this.bb_pos,4);return s?this.bb.readInt16(this.bb_pos+s):r.apache.arrow.flatbuf.IntervalUnit.YEAR_MONTH}static startInterval(s){s.startObject(1)}static addUnit(s,c){s.addFieldInt16(0,c,r.apache.arrow.flatbuf.IntervalUnit.YEAR_MONTH)}static endInterval(s){return s.endObject()}static createInterval(s,c){return u.startInterval(s),u.addUnit(s,c),u.endInterval(s)}}a.Interval=u})(o=i.flatbuf||(i.flatbuf={}))})(n=t.arrow||(t.arrow={}))})(e=r.apache||(r.apache={}))})(te=O.org||(O.org={}));(function(r){var e;(function(t){var n;(function(i){var o;(function(a){class u{constructor(){this.bb=null,this.bb_pos=0}__init(s,c){return this.bb_pos=s,this.bb=c,this}static getRootAsDuration(s,c){return(c||new u).__init(s.readInt32(s.position())+s.position(),s)}unit(){let s=this.bb.__offset(this.bb_pos,4);return s?this.bb.readInt16(this.bb_pos+s):r.apache.arrow.flatbuf.TimeUnit.MILLISECOND}static startDuration(s){s.startObject(1)}static addUnit(s,c){s.addFieldInt16(0,c,r.apache.arrow.flatbuf.TimeUnit.MILLISECOND)}static endDuration(s){return s.endObject()}static createDuration(s,c){return u.startDuration(s),u.addUnit(s,c),u.endDuration(s)}}a.Duration=u})(o=i.flatbuf||(i.flatbuf={}))})(n=t.arrow||(t.arrow={}))})(e=r.apache||(r.apache={}))})(te=O.org||(O.org={}));(function(r){var e;(function(t){var n;(function(i){var o;(function(a){class u{constructor(){this.bb=null,this.bb_pos=0}__init(s,c){return this.bb_pos=s,this.bb=c,this}static getRootAsKeyValue(s,c){return(c||new u).__init(s.readInt32(s.position())+s.position(),s)}key(s){let c=this.bb.__offset(this.bb_pos,4);return c?this.bb.__string(this.bb_pos+c,s):null}value(s){let c=this.bb.__offset(this.bb_pos,6);return c?this.bb.__string(this.bb_pos+c,s):null}static startKeyValue(s){s.startObject(2)}static addKey(s,c){s.addFieldOffset(0,c,0)}static addValue(s,c){s.addFieldOffset(1,c,0)}static endKeyValue(s){return s.endObject()}static createKeyValue(s,c,_){return u.startKeyValue(s),u.addKey(s,c),u.addValue(s,_),u.endKeyValue(s)}}a.KeyValue=u})(o=i.flatbuf||(i.flatbuf={}))})(n=t.arrow||(t.arrow={}))})(e=r.apache||(r.apache={}))})(te=O.org||(O.org={}));(function(r){var e;(function(t){var n;(function(i){var o;(function(a){class u{constructor(){this.bb=null,this.bb_pos=0}__init(s,c){return this.bb_pos=s,this.bb=c,this}static getRootAsDictionaryEncoding(s,c){return(c||new u).__init(s.readInt32(s.position())+s.position(),s)}id(){let s=this.bb.__offset(this.bb_pos,4);return s?this.bb.readInt64(this.bb_pos+s):this.bb.createLong(0,0)}indexType(s){let c=this.bb.__offset(this.bb_pos,6);return c?(s||new r.apache.arrow.flatbuf.Int).__init(this.bb.__indirect(this.bb_pos+c),this.bb):null}isOrdered(){let s=this.bb.__offset(this.bb_pos,8);return s?!!this.bb.readInt8(this.bb_pos+s):!1}static startDictionaryEncoding(s){s.startObject(3)}static addId(s,c){s.addFieldInt64(0,c,s.createLong(0,0))}static addIndexType(s,c){s.addFieldOffset(1,c,0)}static addIsOrdered(s,c){s.addFieldInt8(2,+c,0)}static endDictionaryEncoding(s){return s.endObject()}static createDictionaryEncoding(s,c,_,U){return u.startDictionaryEncoding(s),u.addId(s,c),u.addIndexType(s,_),u.addIsOrdered(s,U),u.endDictionaryEncoding(s)}}a.DictionaryEncoding=u})(o=i.flatbuf||(i.flatbuf={}))})(n=t.arrow||(t.arrow={}))})(e=r.apache||(r.apache={}))})(te=O.org||(O.org={}));(function(r){var e;(function(t){var n;(function(i){var o;(function(a){class u{constructor(){this.bb=null,this.bb_pos=0}__init(s,c){return this.bb_pos=s,this.bb=c,this}static getRootAsField(s,c){return(c||new u).__init(s.readInt32(s.position())+s.position(),s)}name(s){let c=this.bb.__offset(this.bb_pos,4);return c?this.bb.__string(this.bb_pos+c,s):null}nullable(){let s=this.bb.__offset(this.bb_pos,6);return s?!!this.bb.readInt8(this.bb_pos+s):!1}typeType(){let s=this.bb.__offset(this.bb_pos,8);return s?this.bb.readUint8(this.bb_pos+s):r.apache.arrow.flatbuf.Type.NONE}type(s){let c=this.bb.__offset(this.bb_pos,10);return c?this.bb.__union(s,this.bb_pos+c):null}dictionary(s){let c=this.bb.__offset(this.bb_pos,12);return c?(s||new r.apache.arrow.flatbuf.DictionaryEncoding).__init(this.bb.__indirect(this.bb_pos+c),this.bb):null}children(s,c){let _=this.bb.__offset(this.bb_pos,14);return _?(c||new r.apache.arrow.flatbuf.Field).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+_)+s*4),this.bb):null}childrenLength(){let s=this.bb.__offset(this.bb_pos,14);return s?this.bb.__vector_len(this.bb_pos+s):0}customMetadata(s,c){let _=this.bb.__offset(this.bb_pos,16);return _?(c||new r.apache.arrow.flatbuf.KeyValue).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+_)+s*4),this.bb):null}customMetadataLength(){let s=this.bb.__offset(this.bb_pos,16);return s?this.bb.__vector_len(this.bb_pos+s):0}static startField(s){s.startObject(7)}static addName(s,c){s.addFieldOffset(0,c,0)}static addNullable(s,c){s.addFieldInt8(1,+c,0)}static addTypeType(s,c){s.addFieldInt8(2,c,r.apache.arrow.flatbuf.Type.NONE)}static addType(s,c){s.addFieldOffset(3,c,0)}static addDictionary(s,c){s.addFieldOffset(4,c,0)}static addChildren(s,c){s.addFieldOffset(5,c,0)}static createChildrenVector(s,c){s.startVector(4,c.length,4);for(let _=c.length-1;_>=0;_--)s.addOffset(c[_]);return s.endVector()}static startChildrenVector(s,c){s.startVector(4,c,4)}static addCustomMetadata(s,c){s.addFieldOffset(6,c,0)}static createCustomMetadataVector(s,c){s.startVector(4,c.length,4);for(let _=c.length-1;_>=0;_--)s.addOffset(c[_]);return s.endVector()}static startCustomMetadataVector(s,c){s.startVector(4,c,4)}static endField(s){return s.endObject()}static createField(s,c,_,U,J,Qe,Ft,Bt){return u.startField(s),u.addName(s,c),u.addNullable(s,_),u.addTypeType(s,U),u.addType(s,J),u.addDictionary(s,Qe),u.addChildren(s,Ft),u.addCustomMetadata(s,Bt),u.endField(s)}}a.Field=u})(o=i.flatbuf||(i.flatbuf={}))})(n=t.arrow||(t.arrow={}))})(e=r.apache||(r.apache={}))})(te=O.org||(O.org={}));(function(r){var e;(function(t){var n;(function(i){var o;(function(a){class u{constructor(){this.bb=null,this.bb_pos=0}__init(s,c){return this.bb_pos=s,this.bb=c,this}offset(){return this.bb.readInt64(this.bb_pos)}length(){return this.bb.readInt64(this.bb_pos+8)}static createBuffer(s,c,_){return s.prep(8,16),s.writeInt64(_),s.writeInt64(c),s.offset()}}a.Buffer=u})(o=i.flatbuf||(i.flatbuf={}))})(n=t.arrow||(t.arrow={}))})(e=r.apache||(r.apache={}))})(te=O.org||(O.org={}));(function(r){var e;(function(t){var n;(function(i){var o;(function(a){class u{constructor(){this.bb=null,this.bb_pos=0}__init(s,c){return this.bb_pos=s,this.bb=c,this}static getRootAsSchema(s,c){return(c||new u).__init(s.readInt32(s.position())+s.position(),s)}endianness(){let s=this.bb.__offset(this.bb_pos,4);return s?this.bb.readInt16(this.bb_pos+s):r.apache.arrow.flatbuf.Endianness.Little}fields(s,c){let _=this.bb.__offset(this.bb_pos,6);return _?(c||new r.apache.arrow.flatbuf.Field).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+_)+s*4),this.bb):null}fieldsLength(){let s=this.bb.__offset(this.bb_pos,6);return s?this.bb.__vector_len(this.bb_pos+s):0}customMetadata(s,c){let _=this.bb.__offset(this.bb_pos,8);return _?(c||new r.apache.arrow.flatbuf.KeyValue).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+_)+s*4),this.bb):null}customMetadataLength(){let s=this.bb.__offset(this.bb_pos,8);return s?this.bb.__vector_len(this.bb_pos+s):0}static startSchema(s){s.startObject(3)}static addEndianness(s,c){s.addFieldInt16(0,c,r.apache.arrow.flatbuf.Endianness.Little)}static addFields(s,c){s.addFieldOffset(1,c,0)}static createFieldsVector(s,c){s.startVector(4,c.length,4);for(let _=c.length-1;_>=0;_--)s.addOffset(c[_]);return s.endVector()}static startFieldsVector(s,c){s.startVector(4,c,4)}static addCustomMetadata(s,c){s.addFieldOffset(2,c,0)}static createCustomMetadataVector(s,c){s.startVector(4,c.length,4);for(let _=c.length-1;_>=0;_--)s.addOffset(c[_]);return s.endVector()}static startCustomMetadataVector(s,c){s.startVector(4,c,4)}static endSchema(s){return s.endObject()}static finishSchemaBuffer(s,c){s.finish(c)}static createSchema(s,c,_,U){return u.startSchema(s),u.addEndianness(s,c),u.addFields(s,_),u.addCustomMetadata(s,U),u.endSchema(s)}}a.Schema=u})(o=i.flatbuf||(i.flatbuf={}))})(n=t.arrow||(t.arrow={}))})(e=r.apache||(r.apache={}))})(te=O.org||(O.org={}))});var Za=B(Ge=>{"use strict";Object.defineProperty(Ge,"__esModule",{value:!0});Ge.org=void 0;var Di=Dn(),On;(function(r){var e;(function(t){var n;(function(i){var o;(function(a){a.Schema=Di.org.apache.arrow.flatbuf.Schema})(o=i.flatbuf||(i.flatbuf={}))})(n=t.arrow||(t.arrow={}))})(e=r.apache||(r.apache={}))})(On=Ge.org||(Ge.org={}));(function(r){var e;(function(t){var n;(function(i){var o;(function(a){let u;(function(f){f[f.NONE=0]="NONE",f[f.Schema=1]="Schema",f[f.DictionaryBatch=2]="DictionaryBatch",f[f.RecordBatch=3]="RecordBatch",f[f.Tensor=4]="Tensor",f[f.SparseTensor=5]="SparseTensor"})(u=a.MessageHeader||(a.MessageHeader={}))})(o=i.flatbuf||(i.flatbuf={}))})(n=t.arrow||(t.arrow={}))})(e=r.apache||(r.apache={}))})(On=Ge.org||(Ge.org={}));(function(r){var e;(function(t){var n;(function(i){var o;(function(a){class u{constructor(){this.bb=null,this.bb_pos=0}__init(s,c){return this.bb_pos=s,this.bb=c,this}length(){return this.bb.readInt64(this.bb_pos)}nullCount(){return this.bb.readInt64(this.bb_pos+8)}static createFieldNode(s,c,_){return s.prep(8,16),s.writeInt64(_),s.writeInt64(c),s.offset()}}a.FieldNode=u})(o=i.flatbuf||(i.flatbuf={}))})(n=t.arrow||(t.arrow={}))})(e=r.apache||(r.apache={}))})(On=Ge.org||(Ge.org={}));(function(r){var e;(function(t){var n;(function(i){var o;(function(a){class u{constructor(){this.bb=null,this.bb_pos=0}__init(s,c){return this.bb_pos=s,this.bb=c,this}static getRootAsRecordBatch(s,c){return(c||new u).__init(s.readInt32(s.position())+s.position(),s)}length(){let s=this.bb.__offset(this.bb_pos,4);return s?this.bb.readInt64(this.bb_pos+s):this.bb.createLong(0,0)}nodes(s,c){let _=this.bb.__offset(this.bb_pos,6);return _?(c||new r.apache.arrow.flatbuf.FieldNode).__init(this.bb.__vector(this.bb_pos+_)+s*16,this.bb):null}nodesLength(){let s=this.bb.__offset(this.bb_pos,6);return s?this.bb.__vector_len(this.bb_pos+s):0}buffers(s,c){let _=this.bb.__offset(this.bb_pos,8);return _?(c||new Di.org.apache.arrow.flatbuf.Buffer).__init(this.bb.__vector(this.bb_pos+_)+s*16,this.bb):null}buffersLength(){let s=this.bb.__offset(this.bb_pos,8);return s?this.bb.__vector_len(this.bb_pos+s):0}static startRecordBatch(s){s.startObject(3)}static addLength(s,c){s.addFieldInt64(0,c,s.createLong(0,0))}static addNodes(s,c){s.addFieldOffset(1,c,0)}static startNodesVector(s,c){s.startVector(16,c,8)}static addBuffers(s,c){s.addFieldOffset(2,c,0)}static startBuffersVector(s,c){s.startVector(16,c,8)}static endRecordBatch(s){return s.endObject()}static createRecordBatch(s,c,_,U){return u.startRecordBatch(s),u.addLength(s,c),u.addNodes(s,_),u.addBuffers(s,U),u.endRecordBatch(s)}}a.RecordBatch=u})(o=i.flatbuf||(i.flatbuf={}))})(n=t.arrow||(t.arrow={}))})(e=r.apache||(r.apache={}))})(On=Ge.org||(Ge.org={}));(function(r){var e;(function(t){var n;(function(i){var o;(function(a){class u{constructor(){this.bb=null,this.bb_pos=0}__init(s,c){return this.bb_pos=s,this.bb=c,this}static getRootAsDictionaryBatch(s,c){return(c||new u).__init(s.readInt32(s.position())+s.position(),s)}id(){let s=this.bb.__offset(this.bb_pos,4);return s?this.bb.readInt64(this.bb_pos+s):this.bb.createLong(0,0)}data(s){let c=this.bb.__offset(this.bb_pos,6);return c?(s||new r.apache.arrow.flatbuf.RecordBatch).__init(this.bb.__indirect(this.bb_pos+c),this.bb):null}isDelta(){let s=this.bb.__offset(this.bb_pos,8);return s?!!this.bb.readInt8(this.bb_pos+s):!1}static startDictionaryBatch(s){s.startObject(3)}static addId(s,c){s.addFieldInt64(0,c,s.createLong(0,0))}static addData(s,c){s.addFieldOffset(1,c,0)}static addIsDelta(s,c){s.addFieldInt8(2,+c,0)}static endDictionaryBatch(s){return s.endObject()}static createDictionaryBatch(s,c,_,U){return u.startDictionaryBatch(s),u.addId(s,c),u.addData(s,_),u.addIsDelta(s,U),u.endDictionaryBatch(s)}}a.DictionaryBatch=u})(o=i.flatbuf||(i.flatbuf={}))})(n=t.arrow||(t.arrow={}))})(e=r.apache||(r.apache={}))})(On=Ge.org||(Ge.org={}));(function(r){var e;(function(t){var n;(function(i){var o;(function(a){class u{constructor(){this.bb=null,this.bb_pos=0}__init(s,c){return this.bb_pos=s,this.bb=c,this}static getRootAsMessage(s,c){return(c||new u).__init(s.readInt32(s.position())+s.position(),s)}version(){let s=this.bb.__offset(this.bb_pos,4);return s?this.bb.readInt16(this.bb_pos+s):Di.org.apache.arrow.flatbuf.MetadataVersion.V1}headerType(){let s=this.bb.__offset(this.bb_pos,6);return s?this.bb.readUint8(this.bb_pos+s):r.apache.arrow.flatbuf.MessageHeader.NONE}header(s){let c=this.bb.__offset(this.bb_pos,8);return c?this.bb.__union(s,this.bb_pos+c):null}bodyLength(){let s=this.bb.__offset(this.bb_pos,10);return s?this.bb.readInt64(this.bb_pos+s):this.bb.createLong(0,0)}customMetadata(s,c){let _=this.bb.__offset(this.bb_pos,12);return _?(c||new Di.org.apache.arrow.flatbuf.KeyValue).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+_)+s*4),this.bb):null}customMetadataLength(){let s=this.bb.__offset(this.bb_pos,12);return s?this.bb.__vector_len(this.bb_pos+s):0}static startMessage(s){s.startObject(5)}static addVersion(s,c){s.addFieldInt16(0,c,Di.org.apache.arrow.flatbuf.MetadataVersion.V1)}static addHeaderType(s,c){s.addFieldInt8(1,c,r.apache.arrow.flatbuf.MessageHeader.NONE)}static addHeader(s,c){s.addFieldOffset(2,c,0)}static addBodyLength(s,c){s.addFieldInt64(3,c,s.createLong(0,0))}static addCustomMetadata(s,c){s.addFieldOffset(4,c,0)}static createCustomMetadataVector(s,c){s.startVector(4,c.length,4);for(let _=c.length-1;_>=0;_--)s.addOffset(c[_]);return s.endVector()}static startCustomMetadataVector(s,c){s.startVector(4,c,4)}static endMessage(s){return s.endObject()}static finishMessageBuffer(s,c){s.finish(c)}static createMessage(s,c,_,U,J,Qe){return u.startMessage(s),u.addVersion(s,c),u.addHeaderType(s,_),u.addHeader(s,U),u.addBodyLength(s,J),u.addCustomMetadata(s,Qe),u.endMessage(s)}}a.Message=u})(o=i.flatbuf||(i.flatbuf={}))})(n=t.arrow||(t.arrow={}))})(e=r.apache||(r.apache={}))})(On=Ge.org||(Ge.org={}))});var ue=B(de=>{"use strict";Object.defineProperty(de,"__esModule",{value:!0});de.BufferType=de.Type=de.MetadataVersion=de.MessageHeader=de.IntervalUnit=de.UnionMode=de.Precision=de.TimeUnit=de.DateUnit=de.ArrowType=void 0;var en=Dn(),Ug=Za();de.ArrowType=en.org.apache.arrow.flatbuf.Type;de.DateUnit=en.org.apache.arrow.flatbuf.DateUnit;de.TimeUnit=en.org.apache.arrow.flatbuf.TimeUnit;de.Precision=en.org.apache.arrow.flatbuf.Precision;de.UnionMode=en.org.apache.arrow.flatbuf.UnionMode;de.IntervalUnit=en.org.apache.arrow.flatbuf.IntervalUnit;de.MessageHeader=Ug.org.apache.arrow.flatbuf.MessageHeader;de.MetadataVersion=en.org.apache.arrow.flatbuf.MetadataVersion;var Vg;(function(r){r[r.NONE=0]="NONE",r[r.Null=1]="Null",r[r.Int=2]="Int",r[r.Float=3]="Float",r[r.Binary=4]="Binary",r[r.Utf8=5]="Utf8",r[r.Bool=6]="Bool",r[r.Decimal=7]="Decimal",r[r.Date=8]="Date",r[r.Time=9]="Time",r[r.Timestamp=10]="Timestamp",r[r.Interval=11]="Interval",r[r.List=12]="List",r[r.Struct=13]="Struct",r[r.Union=14]="Union",r[r.FixedSizeBinary=15]="FixedSizeBinary",r[r.FixedSizeList=16]="FixedSizeList",r[r.Map=17]="Map",r[r.Dictionary=-1]="Dictionary",r[r.Int8=-2]="Int8",r[r.Int16=-3]="Int16",r[r.Int32=-4]="Int32",r[r.Int64=-5]="Int64",r[r.Uint8=-6]="Uint8",r[r.Uint16=-7]="Uint16",r[r.Uint32=-8]="Uint32",r[r.Uint64=-9]="Uint64",r[r.Float16=-10]="Float16",r[r.Float32=-11]="Float32",r[r.Float64=-12]="Float64",r[r.DateDay=-13]="DateDay",r[r.DateMillisecond=-14]="DateMillisecond",r[r.TimestampSecond=-15]="TimestampSecond",r[r.TimestampMillisecond=-16]="TimestampMillisecond",r[r.TimestampMicrosecond=-17]="TimestampMicrosecond",r[r.TimestampNanosecond=-18]="TimestampNanosecond",r[r.TimeSecond=-19]="TimeSecond",r[r.TimeMillisecond=-20]="TimeMillisecond",r[r.TimeMicrosecond=-21]="TimeMicrosecond",r[r.TimeNanosecond=-22]="TimeNanosecond",r[r.DenseUnion=-23]="DenseUnion",r[r.SparseUnion=-24]="SparseUnion",r[r.IntervalDayTime=-25]="IntervalDayTime",r[r.IntervalYearMonth=-26]="IntervalYearMonth"})(Vg=de.Type||(de.Type={}));var Pg;(function(r){r[r.OFFSET=0]="OFFSET",r[r.DATA=1]="DATA",r[r.VALIDITY=2]="VALIDITY",r[r.TYPE=3]="TYPE"})(Pg=de.BufferType||(de.BufferType={}))});var Rt=B(Te=>{"use strict";Object.defineProperty(Te,"__esModule",{value:!0});Te.popcnt_uint32=Te.popcnt_array=Te.popcnt_bit_range=Te.iterateBits=Te.packBools=Te.truncateBitmap=Te.setBool=Te.getBit=Te.getBool=void 0;function Ld(r,e,t,n){return(t&1<<n)!=0}Te.getBool=Ld;function kd(r,e,t,n){return(t&1<<n)>>n}Te.getBit=kd;function Ng(r,e,t){return t?!!(r[e>>3]|=1<<e%8)||!0:!(r[e>>3]&=~(1<<e%8))&&!1}Te.setBool=Ng;function Rg(r,e,t){let n=t.byteLength+7&~7;if(r>0||t.byteLength<n){let i=new Uint8Array(n);return i.set(r%8==0?t.subarray(r>>3):Cd(eu(t,r,e,null,Ld)).subarray(0,n)),i}return t}Te.truncateBitmap=Rg;function Cd(r){let e=[],t=0,n=0,i=0;for(let a of r)a&&(i|=1<<n),++n==8&&(e[t++]=i,i=n=0);(t===0||n>0)&&(e[t++]=i);let o=new Uint8Array(e.length+7&~7);return o.set(e),o}Te.packBools=Cd;function*eu(r,e,t,n,i){let o=e%8,a=e>>3,u=0,f=t;for(;f>0;o=0){let s=r[a++];do yield i(n,u++,s,o);while(--f>0&&++o<8)}}Te.iterateBits=eu;function tu(r,e,t){if(t-e<=0)return 0;if(t-e<8){let o=0;for(let a of eu(r,e,t-e,r,kd))o+=a;return o}let n=t>>3<<3,i=e+(e%8==0?0:8-e%8);return tu(r,e,i)+tu(r,n,t)+qd(r,i>>3,n-i>>3)}Te.popcnt_bit_range=tu;function qd(r,e,t){let n=0,i=e|0,o=new DataView(r.buffer,r.byteOffset,r.byteLength),a=t===void 0?r.byteLength:i+t;for(;a-i>=4;)n+=Rs(o.getUint32(i)),i+=4;for(;a-i>=2;)n+=Rs(o.getUint16(i)),i+=2;for(;a-i>=1;)n+=Rs(o.getUint8(i)),i+=1;return n}Te.popcnt_array=qd;function Rs(r){let e=r|0;return e=e-(e>>>1&1431655765),e=(e&858993459)+(e>>>2&858993459),(e+(e>>>4)&252645135)*16843009>>>24}Te.popcnt_uint32=Rs});var Ce=B(xs=>{"use strict";Object.defineProperty(xs,"__esModule",{value:!0});xs.Visitor=void 0;var xg=wt(),jg=Be(),g=ue(),Eg=re(),oe=class{visitMany(e,...t){return e.map((n,i)=>this.visit(n,...t.map(o=>o[i])))}visit(...e){return this.getVisitFn(e[0],!1).apply(this,e)}getVisitFn(e,t=!0){return Lg(this,e,t)}visitNull(e,...t){return null}visitBool(e,...t){return null}visitInt(e,...t){return null}visitFloat(e,...t){return null}visitUtf8(e,...t){return null}visitBinary(e,...t){return null}visitFixedSizeBinary(e,...t){return null}visitDate(e,...t){return null}visitTimestamp(e,...t){return null}visitTime(e,...t){return null}visitDecimal(e,...t){return null}visitList(e,...t){return null}visitStruct(e,...t){return null}visitUnion(e,...t){return null}visitDictionary(e,...t){return null}visitInterval(e,...t){return null}visitFixedSizeList(e,...t){return null}visitMap(e,...t){return null}};xs.Visitor=oe;function Lg(r,e,t=!0){let n=null,i=g.Type.NONE;switch(e instanceof xg.Data||e instanceof jg.Vector?i=ru(e.type):e instanceof Eg.DataType?i=ru(e):typeof(i=e)!="number"&&(i=g.Type[e]),i){case g.Type.Null:n=r.visitNull;break;case g.Type.Bool:n=r.visitBool;break;case g.Type.Int:n=r.visitInt;break;case g.Type.Int8:n=r.visitInt8||r.visitInt;break;case g.Type.Int16:n=r.visitInt16||r.visitInt;break;case g.Type.Int32:n=r.visitInt32||r.visitInt;break;case g.Type.Int64:n=r.visitInt64||r.visitInt;break;case g.Type.Uint8:n=r.visitUint8||r.visitInt;break;case g.Type.Uint16:n=r.visitUint16||r.visitInt;break;case g.Type.Uint32:n=r.visitUint32||r.visitInt;break;case g.Type.Uint64:n=r.visitUint64||r.visitInt;break;case g.Type.Float:n=r.visitFloat;break;case g.Type.Float16:n=r.visitFloat16||r.visitFloat;break;case g.Type.Float32:n=r.visitFloat32||r.visitFloat;break;case g.Type.Float64:n=r.visitFloat64||r.visitFloat;break;case g.Type.Utf8:n=r.visitUtf8;break;case g.Type.Binary:n=r.visitBinary;break;case g.Type.FixedSizeBinary:n=r.visitFixedSizeBinary;break;case g.Type.Date:n=r.visitDate;break;case g.Type.DateDay:n=r.visitDateDay||r.visitDate;break;case g.Type.DateMillisecond:n=r.visitDateMillisecond||r.visitDate;break;case g.Type.Timestamp:n=r.visitTimestamp;break;case g.Type.TimestampSecond:n=r.visitTimestampSecond||r.visitTimestamp;break;case g.Type.TimestampMillisecond:n=r.visitTimestampMillisecond||r.visitTimestamp;break;case g.Type.TimestampMicrosecond:n=r.visitTimestampMicrosecond||r.visitTimestamp;break;case g.Type.TimestampNanosecond:n=r.visitTimestampNanosecond||r.visitTimestamp;break;case g.Type.Time:n=r.visitTime;break;case g.Type.TimeSecond:n=r.visitTimeSecond||r.visitTime;break;case g.Type.TimeMillisecond:n=r.visitTimeMillisecond||r.visitTime;break;case g.Type.TimeMicrosecond:n=r.visitTimeMicrosecond||r.visitTime;break;case g.Type.TimeNanosecond:n=r.visitTimeNanosecond||r.visitTime;break;case g.Type.Decimal:n=r.visitDecimal;break;case g.Type.List:n=r.visitList;break;case g.Type.Struct:n=r.visitStruct;break;case g.Type.Union:n=r.visitUnion;break;case g.Type.DenseUnion:n=r.visitDenseUnion||r.visitUnion;break;case g.Type.SparseUnion:n=r.visitSparseUnion||r.visitUnion;break;case g.Type.Dictionary:n=r.visitDictionary;break;case g.Type.Interval:n=r.visitInterval;break;case g.Type.IntervalDayTime:n=r.visitIntervalDayTime||r.visitInterval;break;case g.Type.IntervalYearMonth:n=r.visitIntervalYearMonth||r.visitInterval;break;case g.Type.FixedSizeList:n=r.visitFixedSizeList;break;case g.Type.Map:n=r.visitMap;break}if(typeof n=="function")return n;if(!t)return()=>null;throw new Error(`Unrecognized type '${g.Type[i]}'`)}function ru(r){switch(r.typeId){case g.Type.Null:return g.Type.Null;case g.Type.Int:let{bitWidth:e,isSigned:t}=r;switch(e){case 8:return t?g.Type.Int8:g.Type.Uint8;case 16:return t?g.Type.Int16:g.Type.Uint16;case 32:return t?g.Type.Int32:g.Type.Uint32;case 64:return t?g.Type.Int64:g.Type.Uint64}return g.Type.Int;case g.Type.Float:switch(r.precision){case g.Precision.HALF:return g.Type.Float16;case g.Precision.SINGLE:return g.Type.Float32;case g.Precision.DOUBLE:return g.Type.Float64}return g.Type.Float;case g.Type.Binary:return g.Type.Binary;case g.Type.Utf8:return g.Type.Utf8;case g.Type.Bool:return g.Type.Bool;case g.Type.Decimal:return g.Type.Decimal;case g.Type.Time:switch(r.unit){case g.TimeUnit.SECOND:return g.Type.TimeSecond;case g.TimeUnit.MILLISECOND:return g.Type.TimeMillisecond;case g.TimeUnit.MICROSECOND:return g.Type.TimeMicrosecond;case g.TimeUnit.NANOSECOND:return g.Type.TimeNanosecond}return g.Type.Time;case g.Type.Timestamp:switch(r.unit){case g.TimeUnit.SECOND:return g.Type.TimestampSecond;case g.TimeUnit.MILLISECOND:return g.Type.TimestampMillisecond;case g.TimeUnit.MICROSECOND:return g.Type.TimestampMicrosecond;case g.TimeUnit.NANOSECOND:return g.Type.TimestampNanosecond}return g.Type.Timestamp;case g.Type.Date:switch(r.unit){case g.DateUnit.DAY:return g.Type.DateDay;case g.DateUnit.MILLISECOND:return g.Type.DateMillisecond}return g.Type.Date;case g.Type.Interval:switch(r.unit){case g.IntervalUnit.DAY_TIME:return g.Type.IntervalDayTime;case g.IntervalUnit.YEAR_MONTH:return g.Type.IntervalYearMonth}return g.Type.Interval;case g.Type.Map:return g.Type.Map;case g.Type.List:return g.Type.List;case g.Type.Struct:return g.Type.Struct;case g.Type.Union:switch(r.mode){case g.UnionMode.Dense:return g.Type.DenseUnion;case g.UnionMode.Sparse:return g.Type.SparseUnion}return g.Type.Union;case g.Type.FixedSizeBinary:return g.Type.FixedSizeBinary;case g.Type.FixedSizeList:return g.Type.FixedSizeList;case g.Type.Dictionary:return g.Type.Dictionary}throw new Error(`Unrecognized type '${g.Type[r.typeId]}'`)}oe.prototype.visitInt8=null;oe.prototype.visitInt16=null;oe.prototype.visitInt32=null;oe.prototype.visitInt64=null;oe.prototype.visitUint8=null;oe.prototype.visitUint16=null;oe.prototype.visitUint32=null;oe.prototype.visitUint64=null;oe.prototype.visitFloat16=null;oe.prototype.visitFloat32=null;oe.prototype.visitFloat64=null;oe.prototype.visitDateDay=null;oe.prototype.visitDateMillisecond=null;oe.prototype.visitTimestampSecond=null;oe.prototype.visitTimestampMillisecond=null;oe.prototype.visitTimestampMicrosecond=null;oe.prototype.visitTimestampNanosecond=null;oe.prototype.visitTimeSecond=null;oe.prototype.visitTimeMillisecond=null;oe.prototype.visitTimeMicrosecond=null;oe.prototype.visitTimeNanosecond=null;oe.prototype.visitDenseUnion=null;oe.prototype.visitSparseUnion=null;oe.prototype.visitIntervalDayTime=null;oe.prototype.visitIntervalYearMonth=null});var ou=B(He=>{"use strict";Object.defineProperty(He,"__esModule",{value:!0});He.instance=He.TypeComparator=void 0;var kg=Ce(),P=class extends kg.Visitor{compareSchemas(e,t){return e===t||t instanceof e.constructor&&He.instance.compareFields(e.fields,t.fields)}compareFields(e,t){return e===t||Array.isArray(e)&&Array.isArray(t)&&e.length===t.length&&e.every((n,i)=>He.instance.compareField(n,t[i]))}compareField(e,t){return e===t||t instanceof e.constructor&&e.name===t.name&&e.nullable===t.nullable&&He.instance.visit(e.type,t.type)}};He.TypeComparator=P;function Ze(r,e){return e instanceof r.constructor}function Oi(r,e){return r===e||Ze(r,e)}function ir(r,e){return r===e||Ze(r,e)&&r.bitWidth===e.bitWidth&&r.isSigned===e.isSigned}function js(r,e){return r===e||Ze(r,e)&&r.precision===e.precision}function Cg(r,e){return r===e||Ze(r,e)&&r.byteWidth===e.byteWidth}function nu(r,e){return r===e||Ze(r,e)&&r.unit===e.unit}function Ai(r,e){return r===e||Ze(r,e)&&r.unit===e.unit&&r.timezone===e.timezone}function Fi(r,e){return r===e||Ze(r,e)&&r.unit===e.unit&&r.bitWidth===e.bitWidth}function qg(r,e){return r===e||Ze(r,e)&&r.children.length===e.children.length&&He.instance.compareFields(r.children,e.children)}function zg(r,e){return r===e||Ze(r,e)&&r.children.length===e.children.length&&He.instance.compareFields(r.children,e.children)}function iu(r,e){return r===e||Ze(r,e)&&r.mode===e.mode&&r.typeIds.every((t,n)=>t===e.typeIds[n])&&He.instance.compareFields(r.children,e.children)}function Wg(r,e){return r===e||Ze(r,e)&&r.id===e.id&&r.isOrdered===e.isOrdered&&He.instance.visit(r.indices,e.indices)&&He.instance.visit(r.dictionary,e.dictionary)}function su(r,e){return r===e||Ze(r,e)&&r.unit===e.unit}function Yg(r,e){return r===e||Ze(r,e)&&r.listSize===e.listSize&&r.children.length===e.children.length&&He.instance.compareFields(r.children,e.children)}function Hg(r,e){return r===e||Ze(r,e)&&r.keysSorted===e.keysSorted&&r.children.length===e.children.length&&He.instance.compareFields(r.children,e.children)}P.prototype.visitNull=Oi;P.prototype.visitBool=Oi;P.prototype.visitInt=ir;P.prototype.visitInt8=ir;P.prototype.visitInt16=ir;P.prototype.visitInt32=ir;P.prototype.visitInt64=ir;P.prototype.visitUint8=ir;P.prototype.visitUint16=ir;P.prototype.visitUint32=ir;P.prototype.visitUint64=ir;P.prototype.visitFloat=js;P.prototype.visitFloat16=js;P.prototype.visitFloat32=js;P.prototype.visitFloat64=js;P.prototype.visitUtf8=Oi;P.prototype.visitBinary=Oi;P.prototype.visitFixedSizeBinary=Cg;P.prototype.visitDate=nu;P.prototype.visitDateDay=nu;P.prototype.visitDateMillisecond=nu;P.prototype.visitTimestamp=Ai;P.prototype.visitTimestampSecond=Ai;P.prototype.visitTimestampMillisecond=Ai;P.prototype.visitTimestampMicrosecond=Ai;P.prototype.visitTimestampNanosecond=Ai;P.prototype.visitTime=Fi;P.prototype.visitTimeSecond=Fi;P.prototype.visitTimeMillisecond=Fi;P.prototype.visitTimeMicrosecond=Fi;P.prototype.visitTimeNanosecond=Fi;P.prototype.visitDecimal=Oi;P.prototype.visitList=qg;P.prototype.visitStruct=zg;P.prototype.visitUnion=iu;P.prototype.visitDenseUnion=iu;P.prototype.visitSparseUnion=iu;P.prototype.visitDictionary=Wg;P.prototype.visitInterval=su;P.prototype.visitIntervalDayTime=su;P.prototype.visitIntervalYearMonth=su;P.prototype.visitFixedSizeList=Yg;P.prototype.visitMap=Hg;He.instance=new P});var re=B(w=>{"use strict";Object.defineProperty(w,"__esModule",{value:!0});w.strideForType=w.Dictionary=w.Map_=w.FixedSizeList=w.FixedSizeBinary=w.SparseUnion=w.DenseUnion=w.Union=w.Struct=w.List=w.IntervalYearMonth=w.IntervalDayTime=w.Interval=w.TimestampNanosecond=w.TimestampMicrosecond=w.TimestampMillisecond=w.TimestampSecond=w.Timestamp=w.TimeNanosecond=w.TimeMicrosecond=w.TimeMillisecond=w.TimeSecond=w.Time=w.DateMillisecond=w.DateDay=w.Date_=w.Decimal=w.Bool=w.Utf8=w.Binary=w.Float64=w.Float32=w.Float16=w.Float=w.Uint64=w.Uint32=w.Uint16=w.Uint8=w.Int64=w.Int32=w.Int16=w.Int8=w.Int=w.Null=w.DataType=void 0;var $g=ou(),A=ue(),be=class{static isNull(e){return e&&e.typeId===A.Type.Null}static isInt(e){return e&&e.typeId===A.Type.Int}static isFloat(e){return e&&e.typeId===A.Type.Float}static isBinary(e){return e&&e.typeId===A.Type.Binary}static isUtf8(e){return e&&e.typeId===A.Type.Utf8}static isBool(e){return e&&e.typeId===A.Type.Bool}static isDecimal(e){return e&&e.typeId===A.Type.Decimal}static isDate(e){return e&&e.typeId===A.Type.Date}static isTime(e){return e&&e.typeId===A.Type.Time}static isTimestamp(e){return e&&e.typeId===A.Type.Timestamp}static isInterval(e){return e&&e.typeId===A.Type.Interval}static isList(e){return e&&e.typeId===A.Type.List}static isStruct(e){return e&&e.typeId===A.Type.Struct}static isUnion(e){return e&&e.typeId===A.Type.Union}static isFixedSizeBinary(e){return e&&e.typeId===A.Type.FixedSizeBinary}static isFixedSizeList(e){return e&&e.typeId===A.Type.FixedSizeList}static isMap(e){return e&&e.typeId===A.Type.Map}static isDictionary(e){return e&&e.typeId===A.Type.Dictionary}get typeId(){return A.Type.NONE}compareTo(e){return $g.instance.visit(this,e)}};w.DataType=be;be[Symbol.toStringTag]=(r=>(r.children=null,r.ArrayType=Array,r[Symbol.toStringTag]="DataType"))(be.prototype);var Es=class extends be{toString(){return"Null"}get typeId(){return A.Type.Null}};w.Null=Es;Es[Symbol.toStringTag]=(r=>r[Symbol.toStringTag]="Null")(Es.prototype);var ot=class extends be{constructor(e,t){super();this.isSigned=e,this.bitWidth=t}get typeId(){return A.Type.Int}get ArrayType(){switch(this.bitWidth){case 8:return this.isSigned?Int8Array:Uint8Array;case 16:return this.isSigned?Int16Array:Uint16Array;case 32:return this.isSigned?Int32Array:Uint32Array;case 64:return this.isSigned?Int32Array:Uint32Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}};w.Int=ot;ot[Symbol.toStringTag]=(r=>(r.isSigned=null,r.bitWidth=null,r[Symbol.toStringTag]="Int"))(ot.prototype);var au=class extends ot{constructor(){super(!0,8)}};w.Int8=au;var uu=class extends ot{constructor(){super(!0,16)}};w.Int16=uu;var cu=class extends ot{constructor(){super(!0,32)}};w.Int32=cu;var lu=class extends ot{constructor(){super(!0,64)}};w.Int64=lu;var du=class extends ot{constructor(){super(!1,8)}};w.Uint8=du;var fu=class extends ot{constructor(){super(!1,16)}};w.Uint16=fu;var hu=class extends ot{constructor(){super(!1,32)}};w.Uint32=hu;var pu=class extends ot{constructor(){super(!1,64)}};w.Uint64=pu;Object.defineProperty(au.prototype,"ArrayType",{value:Int8Array});Object.defineProperty(uu.prototype,"ArrayType",{value:Int16Array});Object.defineProperty(cu.prototype,"ArrayType",{value:Int32Array});Object.defineProperty(lu.prototype,"ArrayType",{value:Int32Array});Object.defineProperty(du.prototype,"ArrayType",{value:Uint8Array});Object.defineProperty(fu.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(hu.prototype,"ArrayType",{value:Uint32Array});Object.defineProperty(pu.prototype,"ArrayType",{value:Uint32Array});var tn=class extends be{constructor(e){super();this.precision=e}get typeId(){return A.Type.Float}get ArrayType(){switch(this.precision){case A.Precision.HALF:return Uint16Array;case A.Precision.SINGLE:return Float32Array;case A.Precision.DOUBLE:return Float64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`Float${this.precision<<5||16}`}};w.Float=tn;tn[Symbol.toStringTag]=(r=>(r.precision=null,r[Symbol.toStringTag]="Float"))(tn.prototype);var yu=class extends tn{constructor(){super(A.Precision.HALF)}};w.Float16=yu;var bu=class extends tn{constructor(){super(A.Precision.SINGLE)}};w.Float32=bu;var mu=class extends tn{constructor(){super(A.Precision.DOUBLE)}};w.Float64=mu;Object.defineProperty(yu.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(bu.prototype,"ArrayType",{value:Float32Array});Object.defineProperty(mu.prototype,"ArrayType",{value:Float64Array});var Ls=class extends be{constructor(){super()}get typeId(){return A.Type.Binary}toString(){return"Binary"}};w.Binary=Ls;Ls[Symbol.toStringTag]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Binary"))(Ls.prototype);var ks=class extends be{constructor(){super()}get typeId(){return A.Type.Utf8}toString(){return"Utf8"}};w.Utf8=ks;ks[Symbol.toStringTag]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Utf8"))(ks.prototype);var Cs=class extends be{constructor(){super()}get typeId(){return A.Type.Bool}toString(){return"Bool"}};w.Bool=Cs;Cs[Symbol.toStringTag]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Bool"))(Cs.prototype);var qs=class extends be{constructor(e,t){super();this.scale=e,this.precision=t}get typeId(){return A.Type.Decimal}toString(){return`Decimal[${this.precision}e${this.scale>0?"+":""}${this.scale}]`}};w.Decimal=qs;qs[Symbol.toStringTag]=(r=>(r.scale=null,r.precision=null,r.ArrayType=Uint32Array,r[Symbol.toStringTag]="Decimal"))(qs.prototype);var An=class extends be{constructor(e){super();this.unit=e}get typeId(){return A.Type.Date}toString(){return`Date${(this.unit+1)*32}<${A.DateUnit[this.unit]}>`}};w.Date_=An;An[Symbol.toStringTag]=(r=>(r.unit=null,r.ArrayType=Int32Array,r[Symbol.toStringTag]="Date"))(An.prototype);var zd=class extends An{constructor(){super(A.DateUnit.DAY)}};w.DateDay=zd;var Wd=class extends An{constructor(){super(A.DateUnit.MILLISECOND)}};w.DateMillisecond=Wd;var mr=class extends be{constructor(e,t){super();this.unit=e,this.bitWidth=t}get typeId(){return A.Type.Time}toString(){return`Time${this.bitWidth}<${A.TimeUnit[this.unit]}>`}};w.Time=mr;mr[Symbol.toStringTag]=(r=>(r.unit=null,r.bitWidth=null,r.ArrayType=Int32Array,r[Symbol.toStringTag]="Time"))(mr.prototype);var Yd=class extends mr{constructor(){super(A.TimeUnit.SECOND,32)}};w.TimeSecond=Yd;var Hd=class extends mr{constructor(){super(A.TimeUnit.MILLISECOND,32)}};w.TimeMillisecond=Hd;var $d=class extends mr{constructor(){super(A.TimeUnit.MICROSECOND,64)}};w.TimeMicrosecond=$d;var Jd=class extends mr{constructor(){super(A.TimeUnit.NANOSECOND,64)}};w.TimeNanosecond=Jd;var _r=class extends be{constructor(e,t){super();this.unit=e,this.timezone=t}get typeId(){return A.Type.Timestamp}toString(){return`Timestamp<${A.TimeUnit[this.unit]}${this.timezone?`, ${this.timezone}`:""}>`}};w.Timestamp=_r;_r[Symbol.toStringTag]=(r=>(r.unit=null,r.timezone=null,r.ArrayType=Int32Array,r[Symbol.toStringTag]="Timestamp"))(_r.prototype);var Kd=class extends _r{constructor(e){super(A.TimeUnit.SECOND,e)}};w.TimestampSecond=Kd;var Gd=class extends _r{constructor(e){super(A.TimeUnit.MILLISECOND,e)}};w.TimestampMillisecond=Gd;var Qd=class extends _r{constructor(e){super(A.TimeUnit.MICROSECOND,e)}};w.TimestampMicrosecond=Qd;var Xd=class extends _r{constructor(e){super(A.TimeUnit.NANOSECOND,e)}};w.TimestampNanosecond=Xd;var Fn=class extends be{constructor(e){super();this.unit=e}get typeId(){return A.Type.Interval}toString(){return`Interval<${A.IntervalUnit[this.unit]}>`}};w.Interval=Fn;Fn[Symbol.toStringTag]=(r=>(r.unit=null,r.ArrayType=Int32Array,r[Symbol.toStringTag]="Interval"))(Fn.prototype);var Zd=class extends Fn{constructor(){super(A.IntervalUnit.DAY_TIME)}};w.IntervalDayTime=Zd;var ef=class extends Fn{constructor(){super(A.IntervalUnit.YEAR_MONTH)}};w.IntervalYearMonth=ef;var zs=class extends be{constructor(e){super();this.children=[e]}get typeId(){return A.Type.List}toString(){return`List<${this.valueType}>`}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}};w.List=zs;zs[Symbol.toStringTag]=(r=>(r.children=null,r[Symbol.toStringTag]="List"))(zs.prototype);var Ws=class extends be{constructor(e){super();this.children=e}get typeId(){return A.Type.Struct}toString(){return`Struct<{${this.children.map(e=>`${e.name}:${e.type}`).join(", ")}}>`}};w.Struct=Ws;Ws[Symbol.toStringTag]=(r=>(r.children=null,r[Symbol.toStringTag]="Struct"))(Ws.prototype);var Mn=class extends be{constructor(e,t,n){super();this.mode=e,this.children=n,this.typeIds=t=Int32Array.from(t),this.typeIdToChildIndex=t.reduce((i,o,a)=>(i[o]=a)&&i||i,Object.create(null))}get typeId(){return A.Type.Union}toString(){return`${this[Symbol.toStringTag]}<${this.children.map(e=>`${e.type}`).join(" | ")}>`}};w.Union=Mn;Mn[Symbol.toStringTag]=(r=>(r.mode=null,r.typeIds=null,r.children=null,r.typeIdToChildIndex=null,r.ArrayType=Int8Array,r[Symbol.toStringTag]="Union"))(Mn.prototype);var tf=class extends Mn{constructor(e,t){super(A.UnionMode.Dense,e,t)}};w.DenseUnion=tf;var rf=class extends Mn{constructor(e,t){super(A.UnionMode.Sparse,e,t)}};w.SparseUnion=rf;var Ys=class extends be{constructor(e){super();this.byteWidth=e}get typeId(){return A.Type.FixedSizeBinary}toString(){return`FixedSizeBinary[${this.byteWidth}]`}};w.FixedSizeBinary=Ys;Ys[Symbol.toStringTag]=(r=>(r.byteWidth=null,r.ArrayType=Uint8Array,r[Symbol.toStringTag]="FixedSizeBinary"))(Ys.prototype);var Hs=class extends be{constructor(e,t){super();this.listSize=e,this.children=[t]}get typeId(){return A.Type.FixedSizeList}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}toString(){return`FixedSizeList[${this.listSize}]<${this.valueType}>`}};w.FixedSizeList=Hs;Hs[Symbol.toStringTag]=(r=>(r.children=null,r.listSize=null,r[Symbol.toStringTag]="FixedSizeList"))(Hs.prototype);var $s=class extends be{constructor(e,t=!1){super();this.children=[e],this.keysSorted=t}get typeId(){return A.Type.Map}get keyType(){return this.children[0].type.children[0].type}get valueType(){return this.children[0].type.children[1].type}toString(){return`Map<{${this.children[0].type.children.map(e=>`${e.name}:${e.type}`).join(", ")}}>`}};w.Map_=$s;$s[Symbol.toStringTag]=(r=>(r.children=null,r.keysSorted=null,r[Symbol.toStringTag]="Map_"))($s.prototype);var Jg=(r=>()=>++r)(-1),Js=class extends be{constructor(e,t,n,i){super();this.indices=t,this.dictionary=e,this.isOrdered=i||!1,this.id=n==null?Jg():typeof n=="number"?n:n.low}get typeId(){return A.Type.Dictionary}get children(){return this.dictionary.children}get valueType(){return this.dictionary}get ArrayType(){return this.dictionary.ArrayType}toString(){return`Dictionary<${this.indices}, ${this.dictionary}>`}};w.Dictionary=Js;Js[Symbol.toStringTag]=(r=>(r.id=null,r.indices=null,r.isOrdered=null,r.dictionary=null,r[Symbol.toStringTag]="Dictionary"))(Js.prototype);function Kg(r){let e=r;switch(r.typeId){case A.Type.Decimal:return 4;case A.Type.Timestamp:return 2;case A.Type.Date:return 1+e.unit;case A.Type.Interval:return 1+e.unit;case A.Type.Int:return 1+ +(e.bitWidth>32);case A.Type.Time:return 1+ +(e.bitWidth>32);case A.Type.FixedSizeList:return e.listSize;case A.Type.FixedSizeBinary:return e.byteWidth;default:return 1}}w.strideForType=Kg});var wt=B(rn=>{"use strict";Object.defineProperty(rn,"__esModule",{value:!0});rn.Data=rn.kUnknownNullCount=void 0;var Gg=Rt(),Qg=Rt(),M=ue(),Xg=re(),Z=we();rn.kUnknownNullCount=-1;var k=class{constructor(e,t,n,i,o,a,u){this.type=e,this.dictionary=u,this.offset=Math.floor(Math.max(t||0,0)),this.length=Math.floor(Math.max(n||0,0)),this._nullCount=Math.floor(Math.max(i||0,-1)),this.childData=(a||[]).map(s=>s instanceof k?s:s.data);let f;o instanceof k?(this.stride=o.stride,this.values=o.values,this.typeIds=o.typeIds,this.nullBitmap=o.nullBitmap,this.valueOffsets=o.valueOffsets):(this.stride=Xg.strideForType(e),o&&((f=o[0])&&(this.valueOffsets=f),(f=o[1])&&(this.values=f),(f=o[2])&&(this.nullBitmap=f),(f=o[3])&&(this.typeIds=f)))}get typeId(){return this.type.typeId}get ArrayType(){return this.type.ArrayType}get buffers(){return[this.valueOffsets,this.values,this.nullBitmap,this.typeIds]}get byteLength(){let e=0,{valueOffsets:t,values:n,nullBitmap:i,typeIds:o}=this;return t&&(e+=t.byteLength),n&&(e+=n.byteLength),i&&(e+=i.byteLength),o&&(e+=o.byteLength),this.childData.reduce((a,u)=>a+u.byteLength,e)}get nullCount(){let e=this._nullCount,t;return e<=rn.kUnknownNullCount&&(t=this.nullBitmap)&&(this._nullCount=e=this.length-Qg.popcnt_bit_range(t,this.offset,this.offset+this.length)),e}clone(e,t=this.offset,n=this.length,i=this._nullCount,o=this,a=this.childData){return new k(e,t,n,i,o,a,this.dictionary)}slice(e,t){let{stride:n,typeId:i,childData:o}=this,a=+(this._nullCount===0)-1,u=i===16?n:1,f=this._sliceBuffers(e,t,n,i);return this.clone(this.type,this.offset+e,t,a,f,!o.length||this.valueOffsets?o:this._sliceChildren(o,u*e,u*t))}_changeLengthAndBackfillNullBitmap(e){if(this.typeId===M.Type.Null)return this.clone(this.type,0,e,0);let{length:t,nullCount:n}=this,i=new Uint8Array((e+63&~63)>>3).fill(255,0,t>>3);i[t>>3]=(1<<t-(t&~7))-1,n>0&&i.set(Gg.truncateBitmap(this.offset,t,this.nullBitmap),0);let o=this.buffers;return o[M.BufferType.VALIDITY]=i,this.clone(this.type,0,e,n+(e-t),o)}_sliceBuffers(e,t,n,i){let o,{buffers:a}=this;return(o=a[M.BufferType.TYPE])&&(a[M.BufferType.TYPE]=o.subarray(e,e+t)),(o=a[M.BufferType.OFFSET])&&(a[M.BufferType.OFFSET]=o.subarray(e,e+t+1))||(o=a[M.BufferType.DATA])&&(a[M.BufferType.DATA]=i===6?o:o.subarray(n*e,n*(e+t))),a}_sliceChildren(e,t,n){return e.map(i=>i.slice(t,n))}static new(e,t,n,i,o,a,u){switch(o instanceof k?o=o.buffers:o||(o=[]),e.typeId){case M.Type.Null:return k.Null(e,t,n);case M.Type.Int:return k.Int(e,t,n,i||0,o[M.BufferType.VALIDITY],o[M.BufferType.DATA]||[]);case M.Type.Dictionary:return k.Dictionary(e,t,n,i||0,o[M.BufferType.VALIDITY],o[M.BufferType.DATA]||[],u);case M.Type.Float:return k.Float(e,t,n,i||0,o[M.BufferType.VALIDITY],o[M.BufferType.DATA]||[]);case M.Type.Bool:return k.Bool(e,t,n,i||0,o[M.BufferType.VALIDITY],o[M.BufferType.DATA]||[]);case M.Type.Decimal:return k.Decimal(e,t,n,i||0,o[M.BufferType.VALIDITY],o[M.BufferType.DATA]||[]);case M.Type.Date:return k.Date(e,t,n,i||0,o[M.BufferType.VALIDITY],o[M.BufferType.DATA]||[]);case M.Type.Time:return k.Time(e,t,n,i||0,o[M.BufferType.VALIDITY],o[M.BufferType.DATA]||[]);case M.Type.Timestamp:return k.Timestamp(e,t,n,i||0,o[M.BufferType.VALIDITY],o[M.BufferType.DATA]||[]);case M.Type.Interval:return k.Interval(e,t,n,i||0,o[M.BufferType.VALIDITY],o[M.BufferType.DATA]||[]);case M.Type.FixedSizeBinary:return k.FixedSizeBinary(e,t,n,i||0,o[M.BufferType.VALIDITY],o[M.BufferType.DATA]||[]);case M.Type.Binary:return k.Binary(e,t,n,i||0,o[M.BufferType.VALIDITY],o[M.BufferType.OFFSET]||[],o[M.BufferType.DATA]||[]);case M.Type.Utf8:return k.Utf8(e,t,n,i||0,o[M.BufferType.VALIDITY],o[M.BufferType.OFFSET]||[],o[M.BufferType.DATA]||[]);case M.Type.List:return k.List(e,t,n,i||0,o[M.BufferType.VALIDITY],o[M.BufferType.OFFSET]||[],(a||[])[0]);case M.Type.FixedSizeList:return k.FixedSizeList(e,t,n,i||0,o[M.BufferType.VALIDITY],(a||[])[0]);case M.Type.Struct:return k.Struct(e,t,n,i||0,o[M.BufferType.VALIDITY],a||[]);case M.Type.Map:return k.Map(e,t,n,i||0,o[M.BufferType.VALIDITY],o[M.BufferType.OFFSET]||[],(a||[])[0]);case M.Type.Union:return k.Union(e,t,n,i||0,o[M.BufferType.VALIDITY],o[M.BufferType.TYPE]||[],o[M.BufferType.OFFSET]||a,a)}throw new Error(`Unrecognized typeId ${e.typeId}`)}static Null(e,t,n){return new k(e,t,n,0)}static Int(e,t,n,i,o,a){return new k(e,t,n,i,[void 0,Z.toArrayBufferView(e.ArrayType,a),Z.toUint8Array(o)])}static Dictionary(e,t,n,i,o,a,u){return new k(e,t,n,i,[void 0,Z.toArrayBufferView(e.indices.ArrayType,a),Z.toUint8Array(o)],[],u)}static Float(e,t,n,i,o,a){return new k(e,t,n,i,[void 0,Z.toArrayBufferView(e.ArrayType,a),Z.toUint8Array(o)])}static Bool(e,t,n,i,o,a){return new k(e,t,n,i,[void 0,Z.toArrayBufferView(e.ArrayType,a),Z.toUint8Array(o)])}static Decimal(e,t,n,i,o,a){return new k(e,t,n,i,[void 0,Z.toArrayBufferView(e.ArrayType,a),Z.toUint8Array(o)])}static Date(e,t,n,i,o,a){return new k(e,t,n,i,[void 0,Z.toArrayBufferView(e.ArrayType,a),Z.toUint8Array(o)])}static Time(e,t,n,i,o,a){return new k(e,t,n,i,[void 0,Z.toArrayBufferView(e.ArrayType,a),Z.toUint8Array(o)])}static Timestamp(e,t,n,i,o,a){return new k(e,t,n,i,[void 0,Z.toArrayBufferView(e.ArrayType,a),Z.toUint8Array(o)])}static Interval(e,t,n,i,o,a){return new k(e,t,n,i,[void 0,Z.toArrayBufferView(e.ArrayType,a),Z.toUint8Array(o)])}static FixedSizeBinary(e,t,n,i,o,a){return new k(e,t,n,i,[void 0,Z.toArrayBufferView(e.ArrayType,a),Z.toUint8Array(o)])}static Binary(e,t,n,i,o,a,u){return new k(e,t,n,i,[Z.toInt32Array(a),Z.toUint8Array(u),Z.toUint8Array(o)])}static Utf8(e,t,n,i,o,a,u){return new k(e,t,n,i,[Z.toInt32Array(a),Z.toUint8Array(u),Z.toUint8Array(o)])}static List(e,t,n,i,o,a,u){return new k(e,t,n,i,[Z.toInt32Array(a),void 0,Z.toUint8Array(o)],u?[u]:[])}static FixedSizeList(e,t,n,i,o,a){return new k(e,t,n,i,[void 0,void 0,Z.toUint8Array(o)],a?[a]:[])}static Struct(e,t,n,i,o,a){return new k(e,t,n,i,[void 0,void 0,Z.toUint8Array(o)],a)}static Map(e,t,n,i,o,a,u){return new k(e,t,n,i,[Z.toInt32Array(a),void 0,Z.toUint8Array(o)],u?[u]:[])}static Union(e,t,n,i,o,a,u,f){let s=[void 0,void 0,Z.toUint8Array(o),Z.toArrayBufferView(e.ArrayType,a)];return e.mode===M.UnionMode.Sparse?new k(e,t,n,i,s,u):(s[M.BufferType.OFFSET]=Z.toInt32Array(u),new k(e,t,n,i,s,f))}};rn.Data=k;k.prototype.childData=Object.freeze([])});var _u=B(Ks=>{"use strict";Object.defineProperty(Ks,"__esModule",{value:!0});Ks.valueToString=void 0;var Zg=void 0;function eB(r){if(r===null)return"null";if(r===Zg)return"undefined";switch(typeof r){case"number":return`${r}`;case"bigint":return`${r}`;case"string":return`"${r}"`}return typeof r[Symbol.toPrimitive]=="function"?r[Symbol.toPrimitive]("string"):ArrayBuffer.isView(r)?`[${r}]`:JSON.stringify(r)}Ks.valueToString=eB});var nf=B(Gs=>{"use strict";Object.defineProperty(Gs,"__esModule",{value:!0});Gs.createIsValidFunction=void 0;var gu=_u(),tB=Ye();function rB(r){if(!r||r.length<=0)return function(i){return!0};let e="",t=r.filter(n=>n===n);return t.length>0&&(e=`
|
|
2
|
-
switch (x) {${t.map(n=>`
|
|
3
|
-
case ${nB(n)}:`).join("")}
|
|
4
|
-
return false;
|
|
5
|
-
}`),r.length!==t.length&&(e=`if (x !== x) return false;
|
|
6
|
-
${e}`),new Function("x",`${e}
|
|
7
|
-
return true;`)}Gs.createIsValidFunction=rB;function nB(r){return typeof r!="bigint"?gu.valueToString(r):tB.BigIntAvailable?`${gu.valueToString(r)}n`:`"${gu.valueToString(r)}"`}});var gr=B(at=>{"use strict";Object.defineProperty(at,"__esModule",{value:!0});at.WideBufferBuilder=at.OffsetsBufferBuilder=at.BitmapBufferBuilder=at.DataBufferBuilder=at.BufferBuilder=void 0;var sf=we(),Bu=Ye(),vu=(r,e)=>(r*e+63&~63||64)/e,iB=(r,e=0)=>r.length>=e?r.subarray(0,e):sf.memcpy(new r.constructor(e),r,0),Mi=class{constructor(e,t=1){this.buffer=e,this.stride=t,this.BYTES_PER_ELEMENT=e.BYTES_PER_ELEMENT,this.ArrayType=e.constructor,this._resize(this.length=e.length/t|0)}get byteLength(){return this.length*this.stride*this.BYTES_PER_ELEMENT|0}get reservedLength(){return this.buffer.length/this.stride}get reservedByteLength(){return this.buffer.byteLength}set(e,t){return this}append(e){return this.set(this.length,e)}reserve(e){if(e>0){this.length+=e;let t=this.stride,n=this.length*t,i=this.buffer.length;n>=i&&this._resize(i===0?vu(n*1,this.BYTES_PER_ELEMENT):vu(n*2,this.BYTES_PER_ELEMENT))}return this}flush(e=this.length){e=vu(e*this.stride,this.BYTES_PER_ELEMENT);let t=iB(this.buffer,e);return this.clear(),t}clear(){return this.length=0,this._resize(0),this}_resize(e){return this.buffer=sf.memcpy(new this.ArrayType(e),this.buffer)}};at.BufferBuilder=Mi;Mi.prototype.offset=0;var Qs=class extends Mi{last(){return this.get(this.length-1)}get(e){return this.buffer[e]}set(e,t){return this.reserve(e-this.length+1),this.buffer[e*this.stride]=t,this}};at.DataBufferBuilder=Qs;var of=class extends Qs{constructor(e=new Uint8Array(0)){super(e,1/8);this.numValid=0}get numInvalid(){return this.length-this.numValid}get(e){return this.buffer[e>>3]>>e%8&1}set(e,t){let{buffer:n}=this.reserve(e-this.length+1),i=e>>3,o=e%8,a=n[i]>>o&1;return t?a===0&&(n[i]|=1<<o,++this.numValid):a===1&&(n[i]&=~(1<<o),--this.numValid),this}clear(){return this.numValid=0,super.clear()}};at.BitmapBufferBuilder=of;var af=class extends Qs{constructor(e=new Int32Array(1)){super(e,1)}append(e){return this.set(this.length-1,e)}set(e,t){let n=this.length-1,i=this.reserve(e-n+1).buffer;return n<e++&&i.fill(i[n],n,e),i[e]=i[e-1]+t,this}flush(e=this.length-1){return e>this.length&&this.set(e-1,0),super.flush(e+1)}};at.OffsetsBufferBuilder=af;var uf=class extends Mi{get ArrayType64(){return this._ArrayType64||(this._ArrayType64=this.buffer instanceof Int32Array?Bu.BigInt64Array:Bu.BigUint64Array)}set(e,t){switch(this.reserve(e-this.length+1),typeof t){case"bigint":this.buffer64[e]=t;break;case"number":this.buffer[e*this.stride]=t;break;default:this.buffer.set(t,e*this.stride)}return this}_resize(e){let t=super._resize(e),n=t.byteLength/(this.BYTES_PER_ELEMENT*this.stride);return Bu.BigIntAvailable&&(this.buffer64=new this.ArrayType64(t.buffer,t.byteOffset,n)),t}};at.WideBufferBuilder=uf});var me=B(Br=>{"use strict";Object.defineProperty(Br,"__esModule",{value:!0});Br.VariableWidthBuilder=Br.FixedWidthBuilder=Br.Builder=void 0;var sB=Be(),Un=ue(),oB=wt(),aB=nf(),wu=gr(),uB=re(),ut=class{constructor({type:e,nullValues:t}){this.length=0,this.finished=!1,this.type=e,this.children=[],this.nullValues=t,this.stride=uB.strideForType(e),this._nulls=new wu.BitmapBufferBuilder,t&&t.length>0&&(this._isValid=aB.createIsValidFunction(t))}static new(e){}static throughNode(e){throw new Error('"throughNode" not available in this environment')}static throughDOM(e){throw new Error('"throughDOM" not available in this environment')}static throughIterable(e){return cB(e)}static throughAsyncIterable(e){return lB(e)}toVector(){return sB.Vector.new(this.flush())}get ArrayType(){return this.type.ArrayType}get nullCount(){return this._nulls.numInvalid}get numChildren(){return this.children.length}get byteLength(){let e=0;return this._offsets&&(e+=this._offsets.byteLength),this._values&&(e+=this._values.byteLength),this._nulls&&(e+=this._nulls.byteLength),this._typeIds&&(e+=this._typeIds.byteLength),this.children.reduce((t,n)=>t+n.byteLength,e)}get reservedLength(){return this._nulls.reservedLength}get reservedByteLength(){let e=0;return this._offsets&&(e+=this._offsets.reservedByteLength),this._values&&(e+=this._values.reservedByteLength),this._nulls&&(e+=this._nulls.reservedByteLength),this._typeIds&&(e+=this._typeIds.reservedByteLength),this.children.reduce((t,n)=>t+n.reservedByteLength,e)}get valueOffsets(){return this._offsets?this._offsets.buffer:null}get values(){return this._values?this._values.buffer:null}get nullBitmap(){return this._nulls?this._nulls.buffer:null}get typeIds(){return this._typeIds?this._typeIds.buffer:null}append(e){return this.set(this.length,e)}isValid(e){return this._isValid(e)}set(e,t){return this.setValid(e,this.isValid(t))&&this.setValue(e,t),this}setValue(e,t){this._setValue(this,e,t)}setValid(e,t){return this.length=this._nulls.set(e,+t).length,t}addChild(e,t=`${this.numChildren}`){throw new Error(`Cannot append children to non-nested type "${this.type}"`)}getChildAt(e){return this.children[e]||null}flush(){let e=[],t=this._values,n=this._offsets,i=this._typeIds,{length:o,nullCount:a}=this;i?(e[Un.BufferType.TYPE]=i.flush(o),n&&(e[Un.BufferType.OFFSET]=n.flush(o))):n?(t&&(e[Un.BufferType.DATA]=t.flush(n.last())),e[Un.BufferType.OFFSET]=n.flush(o)):t&&(e[Un.BufferType.DATA]=t.flush(o)),a>0&&(e[Un.BufferType.VALIDITY]=this._nulls.flush(o));let u=oB.Data.new(this.type,0,o,a,e,this.children.map(f=>f.flush()));return this.clear(),u}finish(){return this.finished=!0,this.children.forEach(e=>e.finish()),this}clear(){return this.length=0,this._offsets&&this._offsets.clear(),this._values&&this._values.clear(),this._nulls&&this._nulls.clear(),this._typeIds&&this._typeIds.clear(),this.children.forEach(e=>e.clear()),this}};Br.Builder=ut;ut.prototype.length=1;ut.prototype.stride=1;ut.prototype.children=null;ut.prototype.finished=!1;ut.prototype.nullValues=null;ut.prototype._isValid=()=>!0;var cf=class extends ut{constructor(e){super(e);this._values=new wu.DataBufferBuilder(new this.ArrayType(0),this.stride)}setValue(e,t){let n=this._values;return n.reserve(e-n.length+1),super.setValue(e,t)}};Br.FixedWidthBuilder=cf;var lf=class extends ut{constructor(e){super(e);this._pendingLength=0,this._offsets=new wu.OffsetsBufferBuilder}setValue(e,t){let n=this._pending||(this._pending=new Map),i=n.get(e);i&&(this._pendingLength-=i.length),this._pendingLength+=t.length,n.set(e,t)}setValid(e,t){return super.setValid(e,t)?!0:((this._pending||(this._pending=new Map)).set(e,void 0),!1)}clear(){return this._pendingLength=0,this._pending=void 0,super.clear()}flush(){return this._flush(),super.flush()}finish(){return this._flush(),super.finish()}_flush(){let e=this._pending,t=this._pendingLength;return this._pendingLength=0,this._pending=void 0,e&&e.size>0&&this._flushPending(e,t),this}};Br.VariableWidthBuilder=lf;function cB(r){let{["queueingStrategy"]:e="count"}=r,{["highWaterMark"]:t=e!=="bytes"?1e3:2**14}=r,n=e!=="bytes"?"length":"byteLength";return function*(i){let o=0,a=ut.new(r);for(let u of i)a.append(u)[n]>=t&&++o&&(yield a.toVector());(a.finish().length>0||o===0)&&(yield a.toVector())}}function lB(r){let{["queueingStrategy"]:e="count"}=r,{["highWaterMark"]:t=e!=="bytes"?1e3:2**14}=r,n=e!=="bytes"?"length":"byteLength";return async function*(i){let o=0,a=ut.new(r);for await(let u of i)a.append(u)[n]>=t&&++o&&(yield a.toVector());(a.finish().length>0||o===0)&&(yield a.toVector())}}});var Tu=B(Xs=>{"use strict";Object.defineProperty(Xs,"__esModule",{value:!0});Xs.BoolBuilder=void 0;var dB=gr(),fB=me(),df=class extends fB.Builder{constructor(e){super(e);this._values=new dB.BitmapBufferBuilder}setValue(e,t){this._values.set(e,+t)}};Xs.BoolBuilder=df});var Iu=B(Zs=>{"use strict";Object.defineProperty(Zs,"__esModule",{value:!0});Zs.NullBuilder=void 0;var hB=me(),ff=class extends hB.Builder{setValue(e,t){}setValid(e,t){return this.length=Math.max(e+1,this.length),t}};Zs.NullBuilder=ff});var Su=B(vr=>{"use strict";Object.defineProperty(vr,"__esModule",{value:!0});vr.DateMillisecondBuilder=vr.DateDayBuilder=vr.DateBuilder=void 0;var pB=me(),eo=class extends pB.FixedWidthBuilder{};vr.DateBuilder=eo;var hf=class extends eo{};vr.DateDayBuilder=hf;var pf=class extends eo{};vr.DateMillisecondBuilder=pf});var Du=B(to=>{"use strict";Object.defineProperty(to,"__esModule",{value:!0});to.DecimalBuilder=void 0;var yB=me(),yf=class extends yB.FixedWidthBuilder{};to.DecimalBuilder=yf});var Au=B(ro=>{"use strict";Object.defineProperty(ro,"__esModule",{value:!0});ro.DictionaryBuilder=void 0;var bB=re(),Ou=me(),bf=class extends Ou.Builder{constructor({type:e,nullValues:t,dictionaryHashFunction:n}){super({type:new bB.Dictionary(e.dictionary,e.indices,e.id,e.isOrdered)});this._nulls=null,this._dictionaryOffset=0,this._keysToIndices=Object.create(null),this.indices=Ou.Builder.new({type:this.type.indices,nullValues:t}),this.dictionary=Ou.Builder.new({type:this.type.dictionary,nullValues:null}),typeof n=="function"&&(this.valueToKey=n)}get values(){return this.indices.values}get nullCount(){return this.indices.nullCount}get nullBitmap(){return this.indices.nullBitmap}get byteLength(){return this.indices.byteLength+this.dictionary.byteLength}get reservedLength(){return this.indices.reservedLength+this.dictionary.reservedLength}get reservedByteLength(){return this.indices.reservedByteLength+this.dictionary.reservedByteLength}isValid(e){return this.indices.isValid(e)}setValid(e,t){let n=this.indices;return t=n.setValid(e,t),this.length=n.length,t}setValue(e,t){let n=this._keysToIndices,i=this.valueToKey(t),o=n[i];return o===void 0&&(n[i]=o=this._dictionaryOffset+this.dictionary.append(t).length-1),this.indices.setValue(e,o)}flush(){let e=this.type,t=this._dictionary,n=this.dictionary.toVector(),i=this.indices.flush().clone(e);return i.dictionary=t?t.concat(n):n,this.finished||(this._dictionaryOffset+=n.length),this._dictionary=i.dictionary,this.clear(),i}finish(){return this.indices.finish(),this.dictionary.finish(),this._dictionaryOffset=0,this._keysToIndices=Object.create(null),super.finish()}clear(){return this.indices.clear(),this.dictionary.clear(),super.clear()}valueToKey(e){return typeof e=="string"?e:`${e}`}};ro.DictionaryBuilder=bf});var Fu=B(no=>{"use strict";Object.defineProperty(no,"__esModule",{value:!0});no.FixedSizeBinaryBuilder=void 0;var mB=me(),mf=class extends mB.FixedWidthBuilder{};no.FixedSizeBinaryBuilder=mf});var Ui=B(Pn=>{"use strict";Object.defineProperty(Pn,"__esModule",{value:!0});Pn.float64ToUint16=Pn.uint16ToFloat64=void 0;var _f=new Float64Array(1),Vn=new Uint32Array(_f.buffer);function _B(r){let e=(r&31744)>>10,t=(r&1023)/1024,n=(-1)**((r&32768)>>15);switch(e){case 31:return n*(t?NaN:1/0);case 0:return n*(t?6103515625e-14*t:0)}return n*2**(e-15)*(1+t)}Pn.uint16ToFloat64=_B;function gB(r){if(r!==r)return 32256;_f[0]=r;let e=(Vn[1]&2147483648)>>16&65535,t=Vn[1]&2146435072,n=0;return t>=1089470464?Vn[0]>0?t=31744:(t=(t&2080374784)>>16,n=(Vn[1]&1048575)>>10):t<=1056964608?(n=1048576+(Vn[1]&1048575),n=1048576+(n<<(t>>20)-998)>>21,t=0):(t=t-1056964608>>10,n=(Vn[1]&1048575)+512>>10),e|t|n&65535}Pn.float64ToUint16=gB});var Mu=B(xt=>{"use strict";Object.defineProperty(xt,"__esModule",{value:!0});xt.Float64Builder=xt.Float32Builder=xt.Float16Builder=xt.FloatBuilder=void 0;var BB=Ui(),vB=me(),Vi=class extends vB.FixedWidthBuilder{};xt.FloatBuilder=Vi;var gf=class extends Vi{setValue(e,t){this._values.set(e,BB.float64ToUint16(t))}};xt.Float16Builder=gf;var Bf=class extends Vi{setValue(e,t){this._values.set(e,t)}};xt.Float32Builder=Bf;var vf=class extends Vi{setValue(e,t){this._values.set(e,t)}};xt.Float64Builder=vf});var Ri=B(Ue=>{"use strict";Object.defineProperty(Ue,"__esModule",{value:!0});Ue.BN=Ue.bignumToBigInt=Ue.bignumToString=Ue.isArrowBigNumSymbol=void 0;var wB=we(),Pi=Ye();Ue.isArrowBigNumSymbol=Symbol.for("isArrowBigNum");function Tt(r,...e){return e.length===0?Object.setPrototypeOf(wB.toArrayBufferView(this.TypedArray,r),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(r,...e),this.constructor.prototype)}Tt.prototype[Ue.isArrowBigNumSymbol]=!0;Tt.prototype.toJSON=function(){return`"${Ue.bignumToString(this)}"`};Tt.prototype.valueOf=function(){return wf(this)};Tt.prototype.toString=function(){return Ue.bignumToString(this)};Tt.prototype[Symbol.toPrimitive]=function(r="default"){switch(r){case"number":return wf(this);case"string":return Ue.bignumToString(this);case"default":return Ue.bignumToBigInt(this)}return Ue.bignumToString(this)};function Nn(...r){return Tt.apply(this,r)}function Rn(...r){return Tt.apply(this,r)}function Ni(...r){return Tt.apply(this,r)}Object.setPrototypeOf(Nn.prototype,Object.create(Int32Array.prototype));Object.setPrototypeOf(Rn.prototype,Object.create(Uint32Array.prototype));Object.setPrototypeOf(Ni.prototype,Object.create(Uint32Array.prototype));Object.assign(Nn.prototype,Tt.prototype,{constructor:Nn,signed:!0,TypedArray:Int32Array,BigIntArray:Pi.BigInt64Array});Object.assign(Rn.prototype,Tt.prototype,{constructor:Rn,signed:!1,TypedArray:Uint32Array,BigIntArray:Pi.BigUint64Array});Object.assign(Ni.prototype,Tt.prototype,{constructor:Ni,signed:!0,TypedArray:Uint32Array,BigIntArray:Pi.BigUint64Array});function wf(r){let{buffer:e,byteOffset:t,length:n,signed:i}=r,o=new Int32Array(e,t,n),a=0,u=0,f=o.length,s,c;for(;u<f;)c=o[u++],s=o[u++],i||(s=s>>>0),a+=(c>>>0)+s*u**32;return a}Pi.BigIntAvailable?(Ue.bignumToBigInt=r=>r.byteLength===8?new r.BigIntArray(r.buffer,r.byteOffset,1)[0]:Uu(r),Ue.bignumToString=r=>r.byteLength===8?`${new r.BigIntArray(r.buffer,r.byteOffset,1)[0]}`:Uu(r)):(Ue.bignumToString=Uu,Ue.bignumToBigInt=Ue.bignumToString);function Uu(r){let e="",t=new Uint32Array(2),n=new Uint16Array(r.buffer,r.byteOffset,r.byteLength/2),i=new Uint32Array((n=new Uint16Array(n).reverse()).buffer),o=-1,a=n.length-1;do{for(t[0]=n[o=0];o<a;)n[o++]=t[1]=t[0]/10,t[0]=(t[0]-t[1]*10<<16)+n[o];n[o]=t[1]=t[0]/10,t[0]=t[0]-t[1]*10,e=`${t[0]}${e}`}while(i[0]||i[1]||i[2]||i[3]);return e||"0"}var io=class{static new(e,t){switch(t){case!0:return new Nn(e);case!1:return new Rn(e)}switch(e.constructor){case Int8Array:case Int16Array:case Int32Array:case Pi.BigInt64Array:return new Nn(e)}return e.byteLength===16?new Ni(e):new Rn(e)}static signed(e){return new Nn(e)}static unsigned(e){return new Rn(e)}static decimal(e){return new Ni(e)}constructor(e,t){return io.new(e,t)}};Ue.BN=io});var Vu=B(Ie=>{"use strict";Object.defineProperty(Ie,"__esModule",{value:!0});Ie.Uint64Builder=Ie.Uint32Builder=Ie.Uint16Builder=Ie.Uint8Builder=Ie.Int64Builder=Ie.Int32Builder=Ie.Int16Builder=Ie.Int8Builder=Ie.IntBuilder=void 0;var TB=Ri(),Tf=gr(),IB=Ye(),SB=me(),jt=class extends SB.FixedWidthBuilder{setValue(e,t){this._values.set(e,t)}};Ie.IntBuilder=jt;var If=class extends jt{};Ie.Int8Builder=If;var Sf=class extends jt{};Ie.Int16Builder=Sf;var Df=class extends jt{};Ie.Int32Builder=Df;var Of=class extends jt{constructor(e){e.nullValues&&(e.nullValues=e.nullValues.map(so));super(e);this._values=new Tf.WideBufferBuilder(new Int32Array(0),2)}get values64(){return this._values.buffer64}isValid(e){return super.isValid(so(e))}};Ie.Int64Builder=Of;var Af=class extends jt{};Ie.Uint8Builder=Af;var Ff=class extends jt{};Ie.Uint16Builder=Ff;var Mf=class extends jt{};Ie.Uint32Builder=Mf;var Uf=class extends jt{constructor(e){e.nullValues&&(e.nullValues=e.nullValues.map(so));super(e);this._values=new Tf.WideBufferBuilder(new Uint32Array(0),2)}get values64(){return this._values.buffer64}isValid(e){return super.isValid(so(e))}};Ie.Uint64Builder=Uf;var so=(r=>e=>(ArrayBuffer.isView(e)&&(r.buffer=e.buffer,r.byteOffset=e.byteOffset,r.byteLength=e.byteLength,e=TB.bignumToBigInt(r),r.buffer=null),e))({BigIntArray:IB.BigInt64Array})});var Pu=B(ct=>{"use strict";Object.defineProperty(ct,"__esModule",{value:!0});ct.TimeNanosecondBuilder=ct.TimeMicrosecondBuilder=ct.TimeMillisecondBuilder=ct.TimeSecondBuilder=ct.TimeBuilder=void 0;var DB=me(),xn=class extends DB.FixedWidthBuilder{};ct.TimeBuilder=xn;var Vf=class extends xn{};ct.TimeSecondBuilder=Vf;var Pf=class extends xn{};ct.TimeMillisecondBuilder=Pf;var Nf=class extends xn{};ct.TimeMicrosecondBuilder=Nf;var Rf=class extends xn{};ct.TimeNanosecondBuilder=Rf});var Nu=B(lt=>{"use strict";Object.defineProperty(lt,"__esModule",{value:!0});lt.TimestampNanosecondBuilder=lt.TimestampMicrosecondBuilder=lt.TimestampMillisecondBuilder=lt.TimestampSecondBuilder=lt.TimestampBuilder=void 0;var OB=me(),jn=class extends OB.FixedWidthBuilder{};lt.TimestampBuilder=jn;var xf=class extends jn{};lt.TimestampSecondBuilder=xf;var jf=class extends jn{};lt.TimestampMillisecondBuilder=jf;var Ef=class extends jn{};lt.TimestampMicrosecondBuilder=Ef;var Lf=class extends jn{};lt.TimestampNanosecondBuilder=Lf});var Ru=B(wr=>{"use strict";Object.defineProperty(wr,"__esModule",{value:!0});wr.IntervalYearMonthBuilder=wr.IntervalDayTimeBuilder=wr.IntervalBuilder=void 0;var AB=me(),oo=class extends AB.FixedWidthBuilder{};wr.IntervalBuilder=oo;var kf=class extends oo{};wr.IntervalDayTimeBuilder=kf;var Cf=class extends oo{};wr.IntervalYearMonthBuilder=Cf});var uo=B(ao=>{"use strict";Object.defineProperty(ao,"__esModule",{value:!0});ao.BinaryBuilder=void 0;var FB=we(),MB=gr(),UB=me(),qf=class extends UB.VariableWidthBuilder{constructor(e){super(e);this._values=new MB.BufferBuilder(new Uint8Array(0))}get byteLength(){let e=this._pendingLength+this.length*4;return this._offsets&&(e+=this._offsets.byteLength),this._values&&(e+=this._values.byteLength),this._nulls&&(e+=this._nulls.byteLength),e}setValue(e,t){return super.setValue(e,FB.toUint8Array(t))}_flushPending(e,t){let n=this._offsets,i=this._values.reserve(t).buffer,o=0,a=0,u=0,f;for([o,f]of e)f===void 0?n.set(o,0):(a=f.length,i.set(f,u),n.set(o,a),u+=a)}};ao.BinaryBuilder=qf});var lo=B(co=>{"use strict";Object.defineProperty(co,"__esModule",{value:!0});co.Utf8Builder=void 0;var VB=Xr(),PB=uo(),NB=gr(),RB=me(),xu=class extends RB.VariableWidthBuilder{constructor(e){super(e);this._values=new NB.BufferBuilder(new Uint8Array(0))}get byteLength(){let e=this._pendingLength+this.length*4;return this._offsets&&(e+=this._offsets.byteLength),this._values&&(e+=this._values.byteLength),this._nulls&&(e+=this._nulls.byteLength),e}setValue(e,t){return super.setValue(e,VB.encodeUtf8(t))}_flushPending(e,t){}};co.Utf8Builder=xu;xu.prototype._flushPending=PB.BinaryBuilder.prototype._flushPending});var ju=B(fo=>{"use strict";Object.defineProperty(fo,"__esModule",{value:!0});fo.Run=void 0;var xB=Be(),zf=class{get length(){return this._values.length}get(e){return this._values[e]}clear(){return this._values=null,this}bind(e){return e instanceof xB.Vector?e:(this._values=e,this)}};fo.Run=zf});var xi=B(Ln=>{"use strict";Object.defineProperty(Ln,"__esModule",{value:!0});Ln.StructRow=Ln.MapRow=void 0;var Wf=_u(),qe=Symbol.for("parent"),En=Symbol.for("rowIndex"),tt=Symbol.for("keyToIdx"),rt=Symbol.for("idxToVal"),Eu=Symbol.for("nodejs.util.inspect.custom"),Et=class{constructor(e,t){this[qe]=e,this.size=t}entries(){return this[Symbol.iterator]()}has(e){return this.get(e)!==void 0}get(e){let t;if(e!=null){let n=this[tt]||(this[tt]=new Map),i=n.get(e);if(i!==void 0){let o=this[rt]||(this[rt]=new Array(this.size));(t=o[i])!==void 0||(o[i]=t=this.getValue(i))}else if((i=this.getIndex(e))>-1){n.set(e,i);let o=this[rt]||(this[rt]=new Array(this.size));(t=o[i])!==void 0||(o[i]=t=this.getValue(i))}}return t}set(e,t){if(e!=null){let n=this[tt]||(this[tt]=new Map),i=n.get(e);if(i===void 0&&n.set(e,i=this.getIndex(e)),i>-1){let o=this[rt]||(this[rt]=new Array(this.size));o[i]=this.setValue(i,t)}}return this}clear(){throw new Error(`Clearing ${this[Symbol.toStringTag]} not supported.`)}delete(e){throw new Error(`Deleting ${this[Symbol.toStringTag]} values not supported.`)}*[Symbol.iterator](){let e=this.keys(),t=this.values(),n=this[tt]||(this[tt]=new Map),i=this[rt]||(this[rt]=new Array(this.size));for(let o,a,u=0,f,s;!((f=e.next()).done||(s=t.next()).done);++u)o=f.value,a=s.value,i[u]=a,n.has(o)||n.set(o,u),yield[o,a]}forEach(e,t){let n=this.keys(),i=this.values(),o=t===void 0?e:(f,s,c)=>e.call(t,f,s,c),a=this[tt]||(this[tt]=new Map),u=this[rt]||(this[rt]=new Array(this.size));for(let f,s,c=0,_,U;!((_=n.next()).done||(U=i.next()).done);++c)f=_.value,s=U.value,u[c]=s,a.has(f)||a.set(f,c),o(s,f,this)}toArray(){return[...this.values()]}toJSON(){let e={};return this.forEach((t,n)=>e[n]=t),e}inspect(){return this.toString()}[Eu](){return this.toString()}toString(){let e=[];return this.forEach((t,n)=>{n=Wf.valueToString(n),t=Wf.valueToString(t),e.push(`${n}: ${t}`)}),`{ ${e.join(", ")} }`}};Et[Symbol.toStringTag]=(r=>(Object.defineProperties(r,{size:{writable:!0,enumerable:!1,configurable:!1,value:0},[qe]:{writable:!0,enumerable:!1,configurable:!1,value:null},[En]:{writable:!0,enumerable:!1,configurable:!1,value:-1}}),r[Symbol.toStringTag]="Row"))(Et.prototype);var Yf=class extends Et{constructor(e){super(e,e.length);return jB(this)}keys(){return this[qe].getChildAt(0)[Symbol.iterator]()}values(){return this[qe].getChildAt(1)[Symbol.iterator]()}getKey(e){return this[qe].getChildAt(0).get(e)}getIndex(e){return this[qe].getChildAt(0).indexOf(e)}getValue(e){return this[qe].getChildAt(1).get(e)}setValue(e,t){this[qe].getChildAt(1).set(e,t)}};Ln.MapRow=Yf;var Hf=class extends Et{constructor(e){super(e,e.type.children.length);return $f(this)}*keys(){for(let e of this[qe].type.children)yield e.name}*values(){for(let e of this[qe].type.children)yield this[e.name]}getKey(e){return this[qe].type.children[e].name}getIndex(e){return this[qe].type.children.findIndex(t=>t.name===e)}getValue(e){return this[qe].getChildAt(e).get(this[En])}setValue(e,t){return this[qe].getChildAt(e).set(this[En],t)}};Ln.StructRow=Hf;Object.setPrototypeOf(Et.prototype,Map.prototype);var $f=(()=>{let r={enumerable:!0,configurable:!1,get:null,set:null};return e=>{let t=-1,n=e[tt]||(e[tt]=new Map),i=a=>function(){return this.get(a)},o=a=>function(u){return this.set(a,u)};for(let a of e.keys())n.set(a,++t),r.get=i(a),r.set=o(a),e.hasOwnProperty(a)||(r.enumerable=!0,Object.defineProperty(e,a,r)),e.hasOwnProperty(t)||(r.enumerable=!1,Object.defineProperty(e,t,r));return r.get=r.set=null,e}})(),jB=(()=>{if(typeof Proxy=="undefined")return $f;let r=Et.prototype.has,e=Et.prototype.get,t=Et.prototype.set,n=Et.prototype.getKey,i={isExtensible(){return!1},deleteProperty(){return!1},preventExtensions(){return!0},ownKeys(o){return[...o.keys()].map(a=>`${a}`)},has(o,a){switch(a){case"getKey":case"getIndex":case"getValue":case"setValue":case"toArray":case"toJSON":case"inspect":case"constructor":case"isPrototypeOf":case"propertyIsEnumerable":case"toString":case"toLocaleString":case"valueOf":case"size":case"has":case"get":case"set":case"clear":case"delete":case"keys":case"values":case"entries":case"forEach":case"__proto__":case"__defineGetter__":case"__defineSetter__":case"hasOwnProperty":case"__lookupGetter__":case"__lookupSetter__":case Symbol.iterator:case Symbol.toStringTag:case qe:case En:case rt:case tt:case Eu:return!0}return typeof a=="number"&&!o.has(a)&&(a=o.getKey(a)),o.has(a)},get(o,a,u){switch(a){case"getKey":case"getIndex":case"getValue":case"setValue":case"toArray":case"toJSON":case"inspect":case"constructor":case"isPrototypeOf":case"propertyIsEnumerable":case"toString":case"toLocaleString":case"valueOf":case"size":case"has":case"get":case"set":case"clear":case"delete":case"keys":case"values":case"entries":case"forEach":case"__proto__":case"__defineGetter__":case"__defineSetter__":case"hasOwnProperty":case"__lookupGetter__":case"__lookupSetter__":case Symbol.iterator:case Symbol.toStringTag:case qe:case En:case rt:case tt:case Eu:return Reflect.get(o,a,u)}return typeof a=="number"&&!r.call(u,a)&&(a=n.call(u,a)),e.call(u,a)},set(o,a,u,f){switch(a){case qe:case En:case rt:case tt:return Reflect.set(o,a,u,f);case"getKey":case"getIndex":case"getValue":case"setValue":case"toArray":case"toJSON":case"inspect":case"constructor":case"isPrototypeOf":case"propertyIsEnumerable":case"toString":case"toLocaleString":case"valueOf":case"size":case"has":case"get":case"set":case"clear":case"delete":case"keys":case"values":case"entries":case"forEach":case"__proto__":case"__defineGetter__":case"__defineSetter__":case"hasOwnProperty":case"__lookupGetter__":case"__lookupSetter__":case Symbol.iterator:case Symbol.toStringTag:return!1}return typeof a=="number"&&!r.call(f,a)&&(a=n.call(f,a)),r.call(f,a)?!!t.call(f,a,u):!1}};return o=>new Proxy(o,i)})()});var Ei=B(Tr=>{"use strict";Object.defineProperty(Tr,"__esModule",{value:!0});Tr.createElementComparator=Tr.clampRange=Tr.clampIndex=void 0;var Jf=Be(),Kf=xi(),EB=we(),Gf=Ye();function LB(r,e,t){let n=r.length,i=e>-1?e:n+e%n;return t?t(r,i):i}Tr.clampIndex=LB;var Qf;function kB(r,e,t,n){let{length:i=0}=r,o=typeof e!="number"?0:e,a=typeof t!="number"?i:t;return o<0&&(o=(o%i+i)%i),a<0&&(a=(a%i+i)%i),a<o&&(Qf=o,o=a,a=Qf),a>i&&(a=i),n?n(r,o,a):[o,a]}Tr.clampRange=kB;var CB=Gf.BigIntAvailable?Gf.BigInt(0):0,Xf=r=>r!==r;function ji(r){let e=typeof r;if(e!=="object"||r===null)return Xf(r)?Xf:e!=="bigint"?t=>t===r:t=>CB+t===r;if(r instanceof Date){let t=r.valueOf();return n=>n instanceof Date?n.valueOf()===t:!1}return ArrayBuffer.isView(r)?t=>t?EB.compareArrayLike(r,t):!1:r instanceof Map?zB(r):Array.isArray(r)?qB(r):r instanceof Jf.Vector?WB(r):YB(r)}Tr.createElementComparator=ji;function qB(r){let e=[];for(let t=-1,n=r.length;++t<n;)e[t]=ji(r[t]);return ho(e)}function zB(r){let e=-1,t=[];return r.forEach(n=>t[++e]=ji(n)),ho(t)}function WB(r){let e=[];for(let t=-1,n=r.length;++t<n;)e[t]=ji(r.get(t));return ho(e)}function YB(r){let e=Object.keys(r);if(e.length===0)return()=>!1;let t=[];for(let n=-1,i=e.length;++n<i;)t[n]=ji(r[e[n]]);return ho(t,e)}function ho(r,e){return t=>{if(!t||typeof t!="object")return!1;switch(t.constructor){case Array:return HB(r,t);case Map:case Kf.MapRow:case Kf.StructRow:return Zf(r,t,t.keys());case Object:case void 0:return Zf(r,t,e||Object.keys(t))}return t instanceof Jf.Vector?$B(r,t):!1}}function HB(r,e){let t=r.length;if(e.length!==t)return!1;for(let n=-1;++n<t;)if(!r[n](e[n]))return!1;return!0}function $B(r,e){let t=r.length;if(e.length!==t)return!1;for(let n=-1;++n<t;)if(!r[n](e.get(n)))return!1;return!0}function Zf(r,e,t){let n=t[Symbol.iterator](),i=e instanceof Map?e.keys():Object.keys(e)[Symbol.iterator](),o=e instanceof Map?e.values():Object.values(e)[Symbol.iterator](),a=0,u=r.length,f=o.next(),s=n.next(),c=i.next();for(;a<u&&!s.done&&!c.done&&!f.done&&!(s.value!==c.value||!r[a](f.value));++a,s=n.next(),c=i.next(),f=o.next());return a===u&&s.done&&c.done&&f.done?!0:(n.return&&n.return(),i.return&&i.return(),o.return&&o.return(),!1)}});var Ir=B(po=>{"use strict";Object.defineProperty(po,"__esModule",{value:!0});po.Chunked=void 0;var JB=Ei(),eh=re(),KB=Sr(),th=Be(),sr=class extends th.AbstractVector{constructor(e,t=[],n=GB(t)){super();this._nullCount=-1,this._type=e,this._chunks=t,this._chunkOffsets=n,this._length=n[n.length-1],this._numChildren=(this._type.children||[]).length}static flatten(...e){return KB.selectChunkArgs(th.Vector,e)}static concat(...e){let t=sr.flatten(...e);return new sr(t[0].type,t)}get type(){return this._type}get length(){return this._length}get chunks(){return this._chunks}get typeId(){return this._type.typeId}get VectorName(){return`Chunked<${this._type}>`}get data(){return this._chunks[0]?this._chunks[0].data:null}get ArrayType(){return this._type.ArrayType}get numChildren(){return this._numChildren}get stride(){return this._chunks[0]?this._chunks[0].stride:1}get byteLength(){return this._chunks.reduce((e,t)=>e+t.byteLength,0)}get nullCount(){let e=this._nullCount;return e<0&&(this._nullCount=e=this._chunks.reduce((t,{nullCount:n})=>t+n,0)),e}get indices(){if(eh.DataType.isDictionary(this._type)){if(!this._indices){let e=this._chunks;this._indices=e.length===1?e[0].indices:sr.concat(...e.map(t=>t.indices))}return this._indices}return null}get dictionary(){return eh.DataType.isDictionary(this._type)?this._chunks[this._chunks.length-1].data.dictionary:null}*[Symbol.iterator](){for(let e of this._chunks)yield*e}clone(e=this._chunks){return new sr(this._type,e)}concat(...e){return this.clone(sr.flatten(this,...e))}slice(e,t){return JB.clampRange(this,e,t,this._sliceInternal)}getChildAt(e){if(e<0||e>=this._numChildren)return null;let t=this._children||(this._children=[]),n,i,o;return(n=t[e])?n:(i=(this._type.children||[])[e])&&(o=this._chunks.map(a=>a.getChildAt(e)).filter(a=>a!=null),o.length>0)?t[e]=new sr(i.type,o):null}search(e,t){let n=e,i=this._chunkOffsets,o=i.length-1;if(n<0||n>=i[o])return null;if(o<=1)return t?t(this,0,n):[0,n];let a=0,u=0,f=0;do{if(a+1===o)return t?t(this,a,n-u):[a,n-u];f=a+(o-a)/2|0,n>=i[f]?a=f:o=f}while(n<i[o]&&n>=(u=i[a]));return null}isValid(e){return!!this.search(e,this.isValidInternal)}get(e){return this.search(e,this.getInternal)}set(e,t){this.search(e,({chunks:n},i,o)=>n[i].set(o,t))}indexOf(e,t){return t&&typeof t=="number"?this.search(t,(n,i,o)=>this.indexOfInternal(n,i,o,e)):this.indexOfInternal(this,0,Math.max(0,t||0),e)}toArray(){let{chunks:e}=this,t=e.length,n=this._type.ArrayType;if(t<=0)return new n(0);if(t<=1)return e[0].toArray();let i=0,o=new Array(t);for(let f=-1;++f<t;)i+=(o[f]=e[f].toArray()).length;n!==o[0].constructor&&(n=o[0].constructor);let a=new n(i),u=n===Array?XB:QB;for(let f=-1,s=0;++f<t;)s=u(o[f],a,s);return a}getInternal({_chunks:e},t,n){return e[t].get(n)}isValidInternal({_chunks:e},t,n){return e[t].isValid(n)}indexOfInternal({_chunks:e},t,n,i){let o=t-1,a=e.length,u=n,f=0,s=-1;for(;++o<a;){if(~(s=e[o].indexOf(i,u)))return f+s;u=0,f+=e[o].length}return-1}_sliceInternal(e,t,n){let i=[],{chunks:o,_chunkOffsets:a}=e;for(let u=-1,f=o.length;++u<f;){let s=o[u],c=s.length,_=a[u];if(_>=n)break;if(t>=_+c)continue;if(_>=t&&_+c<=n){i.push(s);continue}let U=Math.max(0,t-_),J=Math.min(n-_,c);i.push(s.slice(U,J))}return e.clone(i)}};po.Chunked=sr;function GB(r){let e=new Uint32Array((r||[]).length+1),t=e[0]=0,n=e.length;for(let i=0;++i<n;)e[i]=t+=r[i-1].length;return e}var QB=(r,e,t)=>(e.set(r,t),t+r.length),XB=(r,e,t)=>{let n=t;for(let i=-1,o=r.length;++i<o;)e[n++]=r[i];return n}});var kn=B(yo=>{"use strict";Object.defineProperty(yo,"__esModule",{value:!0});yo.Column=void 0;var rh=Re(),nh=Be(),Lu=Ir(),nn=class extends Lu.Chunked{constructor(e,t=[],n){t=Lu.Chunked.flatten(...t);super(e.type,t,n);if(this._field=e,t.length===1&&!(this instanceof ku))return new ku(e,t[0],this._chunkOffsets)}static new(...e){let[t,n,...i]=e;typeof t!="string"&&!(t instanceof rh.Field)&&(n=t,t="");let o=Lu.Chunked.flatten(Array.isArray(n)?[...n,...i]:n instanceof nh.Vector?[n,...i]:[nh.Vector.new(n,...i)]);if(typeof t=="string"){let a=o[0].data.type;t=new rh.Field(t,a,!0)}else!t.nullable&&o.some(({nullCount:a})=>a>0)&&(t=t.clone({nullable:!0}));return new nn(t,o)}get field(){return this._field}get name(){return this._field.name}get nullable(){return this._field.nullable}get metadata(){return this._field.metadata}clone(e=this._chunks){return new nn(this._field,e)}getChildAt(e){if(e<0||e>=this.numChildren)return null;let t=this._children||(this._children=[]),n,i,o;return(n=t[e])?n:(i=(this.type.children||[])[e])&&(o=this._chunks.map(a=>a.getChildAt(e)).filter(a=>a!=null),o.length>0)?t[e]=new nn(i,o):null}};yo.Column=nn;var ku=class extends nn{constructor(e,t,n){super(e,[t],n);this._chunk=t}search(e,t){return t?t(this,0,e):[0,e]}isValid(e){return this._chunk.isValid(e)}get(e){return this._chunk.get(e)}set(e,t){this._chunk.set(e,t)}indexOf(e,t){return this._chunk.indexOf(e,t)}}});var Sr=B(et=>{"use strict";Object.defineProperty(et,"__esModule",{value:!0});et.selectColumnChildrenArgs=et.selectVectorChildrenArgs=et.selectChunkArgs=et.selectFieldArgs=et.selectColumnArgs=et.selectArgs=void 0;var ih=wt(),sh=Re(),Dr=kn(),Li=Be(),oh=re(),ZB=Ir(),Or=Array.isArray;et.selectArgs=(r,e)=>bo(r,e,[],0);et.selectColumnArgs=r=>{let[e,t]=qu(r,[[],[]]);return t.map((n,i)=>n instanceof Dr.Column?Dr.Column.new(n.field.clone(e[i]),n):n instanceof Li.Vector?Dr.Column.new(e[i],n):Dr.Column.new(e[i],[]))};et.selectFieldArgs=r=>qu(r,[[],[]]);et.selectChunkArgs=(r,e)=>Cu(r,e,[],0);et.selectVectorChildrenArgs=(r,e)=>ah(r,e,[],0);et.selectColumnChildrenArgs=(r,e)=>uh(r,e,[],0);function bo(r,e,t,n){let i,o=n,a=-1,u=e.length;for(;++a<u;)Or(i=e[a])?o=bo(r,i,t,o).length:i instanceof r&&(t[o++]=i);return t}function Cu(r,e,t,n){let i,o=n,a=-1,u=e.length;for(;++a<u;)Or(i=e[a])?o=Cu(r,i,t,o).length:i instanceof ZB.Chunked?o=Cu(r,i.chunks,t,o).length:i instanceof r&&(t[o++]=i);return t}function ah(r,e,t,n){let i,o=n,a=-1,u=e.length;for(;++a<u;)Or(i=e[a])?o=ah(r,i,t,o).length:i instanceof r?o=bo(Li.Vector,i.schema.fields.map((f,s)=>i.getChildAt(s)),t,o).length:i instanceof Li.Vector&&(t[o++]=i);return t}function uh(r,e,t,n){let i,o=n,a=-1,u=e.length;for(;++a<u;)Or(i=e[a])?o=uh(r,i,t,o).length:i instanceof r?o=bo(Dr.Column,i.schema.fields.map((f,s)=>Dr.Column.new(f,i.getChildAt(s))),t,o).length:i instanceof Dr.Column&&(t[o++]=i);return t}var ev=(r,[e,t],n)=>(r[0][n]=e,r[1][n]=t,r);function qu(r,e){let t,n;switch(n=r.length){case 0:return e;case 1:if(t=e[0],!r[0])return e;if(Or(r[0]))return qu(r[0],e);r[0]instanceof ih.Data||r[0]instanceof Li.Vector||r[0]instanceof oh.DataType||([t,r]=Object.entries(r[0]).reduce(ev,e));break;default:Or(t=r[n-1])?r=Or(r[0])?r[0]:r.slice(0,n-1):(r=Or(r[0])?r[0]:r,t=[])}let i=-1,o=-1,a=-1,u=r.length,f,s,[c,_]=e;for(;++a<u;)s=r[a],s instanceof Dr.Column&&(_[++o]=s)?c[++i]=s.field.clone(t[a],s.type,!0):({[a]:f=a}=t,s instanceof oh.DataType&&(_[++o]=s)?c[++i]=sh.Field.new(f,s,!0):s&&s.type&&(_[++o]=s)&&(s instanceof ih.Data&&(_[o]=s=Li.Vector.new(s)),c[++i]=sh.Field.new(f,s.type,!0)));return e}});var Re=B(Cn=>{"use strict";Object.defineProperty(Cn,"__esModule",{value:!0});Cn.Field=Cn.Schema=void 0;var tv=re(),rv=Sr(),nv=Sr(),ch=ou(),nt=class{constructor(e=[],t,n){this.fields=e||[],this.metadata=t||new Map,n||(n=zu(e)),this.dictionaries=n}static from(...e){return nt.new(e[0],e[1])}static new(...e){return new nt(nv.selectFieldArgs(e)[0])}get[Symbol.toStringTag](){return"Schema"}toString(){return`Schema<{ ${this.fields.map((e,t)=>`${t}: ${e}`).join(", ")} }>`}compareTo(e){return ch.instance.compareSchemas(this,e)}select(...e){let t=e.reduce((n,i)=>(n[i]=!0)&&n,Object.create(null));return new nt(this.fields.filter(n=>t[n.name]),this.metadata)}selectAt(...e){return new nt(e.map(t=>this.fields[t]).filter(Boolean),this.metadata)}assign(...e){let t=e[0]instanceof nt?e[0]:new nt(rv.selectArgs(Lt,e)),n=[...this.fields],i=mo(mo(new Map,this.metadata),t.metadata),o=t.fields.filter(u=>{let f=n.findIndex(s=>s.name===u.name);return~f?(n[f]=u.clone({metadata:mo(mo(new Map,n[f].metadata),u.metadata)}))&&!1:!0}),a=zu(o,new Map);return new nt([...n,...o],i,new Map([...this.dictionaries,...a]))}};Cn.Schema=nt;var Lt=class{constructor(e,t,n=!1,i){this.name=e,this.type=t,this.nullable=n,this.metadata=i||new Map}static new(...e){let[t,n,i,o]=e;return e[0]&&typeof e[0]=="object"&&({name:t}=e[0],n===void 0&&(n=e[0].type),i===void 0&&(i=e[0].nullable),o===void 0&&(o=e[0].metadata)),new Lt(`${t}`,n,i,o)}get typeId(){return this.type.typeId}get[Symbol.toStringTag](){return"Field"}toString(){return`${this.name}: ${this.type}`}compareTo(e){return ch.instance.compareField(this,e)}clone(...e){let[t,n,i,o]=e;return!e[0]||typeof e[0]!="object"?[t=this.name,n=this.type,i=this.nullable,o=this.metadata]=e:{name:t=this.name,type:n=this.type,nullable:i=this.nullable,metadata:o=this.metadata}=e[0],Lt.new(t,n,i,o)}};Cn.Field=Lt;function mo(r,e){return new Map([...r||new Map,...e||new Map])}function zu(r,e=new Map){for(let t=-1,n=r.length;++t<n;){let o=r[t].type;if(tv.DataType.isDictionary(o)){if(!e.has(o.id))e.set(o.id,o.dictionary);else if(e.get(o.id)!==o.dictionary)throw new Error("Cannot create Schema containing two different dictionaries with the same Id")}o.children&&o.children.length>0&&zu(o.children,e)}return e}nt.prototype.fields=null;nt.prototype.metadata=null;nt.prototype.dictionaries=null;Lt.prototype.type=null;Lt.prototype.name=null;Lt.prototype.nullable=null;Lt.prototype.metadata=null});var Wu=B(_o=>{"use strict";Object.defineProperty(_o,"__esModule",{value:!0});_o.ListBuilder=void 0;var iv=ju(),sv=Re(),ov=re(),av=gr(),uv=me(),lh=class extends uv.VariableWidthBuilder{constructor(e){super(e);this._run=new iv.Run,this._offsets=new av.OffsetsBufferBuilder}addChild(e,t="0"){if(this.numChildren>0)throw new Error("ListBuilder can only have one child.");return this.children[this.numChildren]=e,this.type=new ov.List(new sv.Field(t,e.type,!0)),this.numChildren-1}clear(){return this._run.clear(),super.clear()}_flushPending(e){let t=this._run,n=this._offsets,i=this._setValue,o=0,a;for([o,a]of e)a===void 0?n.set(o,0):(n.set(o,a.length),i(this,o,t.bind(a)))}};_o.ListBuilder=lh});var Yu=B(go=>{"use strict";Object.defineProperty(go,"__esModule",{value:!0});go.FixedSizeListBuilder=void 0;var cv=ju(),lv=Re(),dv=me(),fv=re(),dh=class extends dv.Builder{constructor(){super(...arguments);this._run=new cv.Run}setValue(e,t){super.setValue(e,this._run.bind(t))}addChild(e,t="0"){if(this.numChildren>0)throw new Error("FixedSizeListBuilder can only have one child.");let n=this.children.push(e);return this.type=new fv.FixedSizeList(this.type.listSize,new lv.Field(t,e.type,!0)),n}clear(){return this._run.clear(),super.clear()}};go.FixedSizeListBuilder=dh});var Hu=B(Bo=>{"use strict";Object.defineProperty(Bo,"__esModule",{value:!0});Bo.MapBuilder=void 0;var hv=Re(),pv=re(),yv=me(),fh=class extends yv.VariableWidthBuilder{set(e,t){return super.set(e,t)}setValue(e,t){t=t instanceof Map?t:new Map(Object.entries(t));let n=this._pending||(this._pending=new Map),i=n.get(e);i&&(this._pendingLength-=i.size),this._pendingLength+=t.size,n.set(e,t)}addChild(e,t=`${this.numChildren}`){if(this.numChildren>0)throw new Error("ListBuilder can only have one child.");return this.children[this.numChildren]=e,this.type=new pv.Map_(new hv.Field(t,e.type,!0),this.type.keysSorted),this.numChildren-1}_flushPending(e){let t=this._offsets,n=this._setValue;e.forEach((i,o)=>{i===void 0?t.set(o,0):(t.set(o,i.size),n(this,o,i))})}};Bo.MapBuilder=fh});var $u=B(vo=>{"use strict";Object.defineProperty(vo,"__esModule",{value:!0});vo.StructBuilder=void 0;var bv=Re(),mv=me(),_v=re(),hh=class extends mv.Builder{addChild(e,t=`${this.numChildren}`){let n=this.children.push(e);return this.type=new _v.Struct([...this.type.children,new bv.Field(t,e.type,!0)]),n}};vo.StructBuilder=hh});var Ju=B(Ar=>{"use strict";Object.defineProperty(Ar,"__esModule",{value:!0});Ar.DenseUnionBuilder=Ar.SparseUnionBuilder=Ar.UnionBuilder=void 0;var gv=Re(),ph=gr(),Bv=me(),vv=re(),wo=class extends Bv.Builder{constructor(e){super(e);this._typeIds=new ph.DataBufferBuilder(new Int8Array(0),1),typeof e.valueToChildTypeId=="function"&&(this._valueToChildTypeId=e.valueToChildTypeId)}get typeIdToChildIndex(){return this.type.typeIdToChildIndex}append(e,t){return this.set(this.length,e,t)}set(e,t,n){return n===void 0&&(n=this._valueToChildTypeId(this,t,e)),this.setValid(e,this.isValid(t))&&this.setValue(e,t,n),this}setValue(e,t,n){this._typeIds.set(e,n),super.setValue(e,t)}addChild(e,t=`${this.children.length}`){let n=this.children.push(e),{type:{children:i,mode:o,typeIds:a}}=this,u=[...i,new gv.Field(t,e.type)];return this.type=new vv.Union(o,[...a,n],u),n}_valueToChildTypeId(e,t,n){throw new Error("Cannot map UnionBuilder value to child typeId. Pass the `childTypeId` as the second argument to unionBuilder.append(), or supply a `valueToChildTypeId` function as part of the UnionBuilder constructor options.")}};Ar.UnionBuilder=wo;var yh=class extends wo{};Ar.SparseUnionBuilder=yh;var bh=class extends wo{constructor(e){super(e);this._offsets=new ph.DataBufferBuilder(new Int32Array(0))}setValue(e,t,n){let i=this.type.typeIdToChildIndex[n];return this._offsets.set(e,this.getChildAt(i).length),super.setValue(e,t,n)}};Ar.DenseUnionBuilder=bh});var Qu=B(qn=>{"use strict";Object.defineProperty(qn,"__esModule",{value:!0});qn.instance=qn.SetVisitor=void 0;var wv=Be(),Tv=Ce(),Iv=Xr(),Sv=Ui(),Dv=we(),dt=ue(),C=class extends Tv.Visitor{};qn.SetVisitor=C;var Ov=(r,e,t)=>{r[e]=t/864e5|0},Ku=(r,e,t)=>{r[e]=t%4294967296|0,r[e+1]=t/4294967296|0},Av=(r,e,t)=>{r[e]=t*1e3%4294967296|0,r[e+1]=t*1e3/4294967296|0},Fv=(r,e,t)=>{r[e]=t*1e6%4294967296|0,r[e+1]=t*1e6/4294967296|0},mh=(r,e,t,n)=>{let{[t]:i,[t+1]:o}=e;i!=null&&o!=null&&r.set(n.subarray(0,o-i),i)},Mv=({offset:r,values:e},t,n)=>{let i=r+t;n?e[i>>3]|=1<<i%8:e[i>>3]&=~(1<<i%8)},_h=({values:r},e,t)=>{Ov(r,e,t.valueOf())},gh=({values:r},e,t)=>{Ku(r,e*2,t.valueOf())},kt=({stride:r,values:e},t,n)=>{e[r*t]=n},Bh=({stride:r,values:e},t,n)=>{e[r*t]=Sv.float64ToUint16(n)},Gu=(r,e,t)=>{switch(typeof t){case"bigint":r.values64[e]=t;break;case"number":r.values[e*r.stride]=t;break;default:let n=t,{stride:i,ArrayType:o}=r,a=Dv.toArrayBufferView(o,n);r.values.set(a.subarray(0,i),i*e)}},Uv=({stride:r,values:e},t,n)=>{e.set(n.subarray(0,r),r*t)},Vv=({values:r,valueOffsets:e},t,n)=>mh(r,e,t,n),Pv=({values:r,valueOffsets:e},t,n)=>{mh(r,e,t,Iv.encodeUtf8(n))},Nv=(r,e,t)=>{r.type.bitWidth<64?kt(r,e,t):Gu(r,e,t)},Rv=(r,e,t)=>{r.type.precision!==dt.Precision.HALF?kt(r,e,t):Bh(r,e,t)},xv=(r,e,t)=>{r.type.unit===dt.DateUnit.DAY?_h(r,e,t):gh(r,e,t)},vh=({values:r},e,t)=>Ku(r,e*2,t/1e3),wh=({values:r},e,t)=>Ku(r,e*2,t),Th=({values:r},e,t)=>Av(r,e*2,t),Ih=({values:r},e,t)=>Fv(r,e*2,t),jv=(r,e,t)=>{switch(r.type.unit){case dt.TimeUnit.SECOND:return vh(r,e,t);case dt.TimeUnit.MILLISECOND:return wh(r,e,t);case dt.TimeUnit.MICROSECOND:return Th(r,e,t);case dt.TimeUnit.NANOSECOND:return Ih(r,e,t)}},Sh=({values:r,stride:e},t,n)=>{r[e*t]=n},Dh=({values:r,stride:e},t,n)=>{r[e*t]=n},Oh=({values:r},e,t)=>{r.set(t.subarray(0,2),2*e)},Ah=({values:r},e,t)=>{r.set(t.subarray(0,2),2*e)},Ev=(r,e,t)=>{switch(r.type.unit){case dt.TimeUnit.SECOND:return Sh(r,e,t);case dt.TimeUnit.MILLISECOND:return Dh(r,e,t);case dt.TimeUnit.MICROSECOND:return Oh(r,e,t);case dt.TimeUnit.NANOSECOND:return Ah(r,e,t)}},Lv=({values:r},e,t)=>{r.set(t.subarray(0,4),4*e)},kv=(r,e,t)=>{let n=r.getChildAt(0),i=r.valueOffsets;for(let o=-1,a=i[e],u=i[e+1];a<u;)n.set(a++,t.get(++o))},Cv=(r,e,t)=>{let n=r.getChildAt(0),i=r.valueOffsets,o=t instanceof Map?[...t]:Object.entries(t);for(let a=-1,u=i[e],f=i[e+1];u<f;)n.set(u++,o[++a])},qv=(r,e)=>(t,n,i)=>t&&t.set(r,e[i]),zv=(r,e)=>(t,n,i)=>t&&t.set(r,e.get(i)),Wv=(r,e)=>(t,n,i)=>t&&t.set(r,e.get(n.name)),Yv=(r,e)=>(t,n,i)=>t&&t.set(r,e[n.name]),Hv=(r,e,t)=>{let n=t instanceof Map?Wv(e,t):t instanceof wv.Vector?zv(e,t):Array.isArray(t)?qv(e,t):Yv(e,t);r.type.children.forEach((i,o)=>n(r.getChildAt(o),i,o))},$v=(r,e,t)=>{r.type.mode===dt.UnionMode.Dense?Fh(r,e,t):Mh(r,e,t)},Fh=(r,e,t)=>{let n=r.typeIdToChildIndex[r.typeIds[e]],i=r.getChildAt(n);i&&i.set(r.valueOffsets[e],t)},Mh=(r,e,t)=>{let n=r.typeIdToChildIndex[r.typeIds[e]],i=r.getChildAt(n);i&&i.set(e,t)},Jv=(r,e,t)=>{let n=r.getKey(e);n!==null&&r.setValue(n,t)},Kv=(r,e,t)=>{r.type.unit===dt.IntervalUnit.DAY_TIME?Uh(r,e,t):Vh(r,e,t)},Uh=({values:r},e,t)=>{r.set(t.subarray(0,2),2*e)},Vh=({values:r},e,t)=>{r[e]=t[0]*12+t[1]%12},Gv=(r,e,t)=>{let n=r.getChildAt(0),{stride:i}=r;for(let o=-1,a=e*i;++o<i;)n.set(a+o,t.get(o))};C.prototype.visitBool=Mv;C.prototype.visitInt=Nv;C.prototype.visitInt8=kt;C.prototype.visitInt16=kt;C.prototype.visitInt32=kt;C.prototype.visitInt64=Gu;C.prototype.visitUint8=kt;C.prototype.visitUint16=kt;C.prototype.visitUint32=kt;C.prototype.visitUint64=Gu;C.prototype.visitFloat=Rv;C.prototype.visitFloat16=Bh;C.prototype.visitFloat32=kt;C.prototype.visitFloat64=kt;C.prototype.visitUtf8=Pv;C.prototype.visitBinary=Vv;C.prototype.visitFixedSizeBinary=Uv;C.prototype.visitDate=xv;C.prototype.visitDateDay=_h;C.prototype.visitDateMillisecond=gh;C.prototype.visitTimestamp=jv;C.prototype.visitTimestampSecond=vh;C.prototype.visitTimestampMillisecond=wh;C.prototype.visitTimestampMicrosecond=Th;C.prototype.visitTimestampNanosecond=Ih;C.prototype.visitTime=Ev;C.prototype.visitTimeSecond=Sh;C.prototype.visitTimeMillisecond=Dh;C.prototype.visitTimeMicrosecond=Oh;C.prototype.visitTimeNanosecond=Ah;C.prototype.visitDecimal=Lv;C.prototype.visitList=kv;C.prototype.visitStruct=Hv;C.prototype.visitUnion=$v;C.prototype.visitDenseUnion=Fh;C.prototype.visitSparseUnion=Mh;C.prototype.visitDictionary=Jv;C.prototype.visitInterval=Kv;C.prototype.visitIntervalDayTime=Uh;C.prototype.visitIntervalYearMonth=Vh;C.prototype.visitFixedSizeList=Gv;C.prototype.visitMap=Cv;qn.instance=new C});var Ph=B(zn=>{"use strict";Object.defineProperty(zn,"__esModule",{value:!0});zn.instance=zn.GetBuilderCtor=void 0;var Qv=Ce(),Xv=uo(),Zv=Tu(),Xu=Su(),ew=Du(),tw=Au(),rw=Fu(),nw=Yu(),To=Mu(),Zu=Ru(),or=Vu(),iw=Wu(),sw=Hu(),ow=Iu(),aw=$u(),ki=Nu(),Ci=Pu(),ec=Ju(),uw=lo(),tc=class extends Qv.Visitor{visitNull(){return ow.NullBuilder}visitBool(){return Zv.BoolBuilder}visitInt(){return or.IntBuilder}visitInt8(){return or.Int8Builder}visitInt16(){return or.Int16Builder}visitInt32(){return or.Int32Builder}visitInt64(){return or.Int64Builder}visitUint8(){return or.Uint8Builder}visitUint16(){return or.Uint16Builder}visitUint32(){return or.Uint32Builder}visitUint64(){return or.Uint64Builder}visitFloat(){return To.FloatBuilder}visitFloat16(){return To.Float16Builder}visitFloat32(){return To.Float32Builder}visitFloat64(){return To.Float64Builder}visitUtf8(){return uw.Utf8Builder}visitBinary(){return Xv.BinaryBuilder}visitFixedSizeBinary(){return rw.FixedSizeBinaryBuilder}visitDate(){return Xu.DateBuilder}visitDateDay(){return Xu.DateDayBuilder}visitDateMillisecond(){return Xu.DateMillisecondBuilder}visitTimestamp(){return ki.TimestampBuilder}visitTimestampSecond(){return ki.TimestampSecondBuilder}visitTimestampMillisecond(){return ki.TimestampMillisecondBuilder}visitTimestampMicrosecond(){return ki.TimestampMicrosecondBuilder}visitTimestampNanosecond(){return ki.TimestampNanosecondBuilder}visitTime(){return Ci.TimeBuilder}visitTimeSecond(){return Ci.TimeSecondBuilder}visitTimeMillisecond(){return Ci.TimeMillisecondBuilder}visitTimeMicrosecond(){return Ci.TimeMicrosecondBuilder}visitTimeNanosecond(){return Ci.TimeNanosecondBuilder}visitDecimal(){return ew.DecimalBuilder}visitList(){return iw.ListBuilder}visitStruct(){return aw.StructBuilder}visitUnion(){return ec.UnionBuilder}visitDenseUnion(){return ec.DenseUnionBuilder}visitSparseUnion(){return ec.SparseUnionBuilder}visitDictionary(){return tw.DictionaryBuilder}visitInterval(){return Zu.IntervalBuilder}visitIntervalDayTime(){return Zu.IntervalDayTimeBuilder}visitIntervalYearMonth(){return Zu.IntervalYearMonthBuilder}visitFixedSizeList(){return nw.FixedSizeListBuilder}visitMap(){return sw.MapBuilder}};zn.GetBuilderCtor=tc;zn.instance=new tc});var So=B(T=>{"use strict";Object.defineProperty(T,"__esModule",{value:!0});T.DenseUnionBuilder=T.SparseUnionBuilder=T.UnionBuilder=T.StructBuilder=T.MapBuilder=T.FixedSizeListBuilder=T.ListBuilder=T.BinaryBuilder=T.Utf8Builder=T.IntervalYearMonthBuilder=T.IntervalDayTimeBuilder=T.IntervalBuilder=T.TimestampNanosecondBuilder=T.TimestampMicrosecondBuilder=T.TimestampMillisecondBuilder=T.TimestampSecondBuilder=T.TimestampBuilder=T.TimeNanosecondBuilder=T.TimeMicrosecondBuilder=T.TimeMillisecondBuilder=T.TimeSecondBuilder=T.TimeBuilder=T.Uint64Builder=T.Uint32Builder=T.Uint16Builder=T.Uint8Builder=T.Int64Builder=T.Int32Builder=T.Int16Builder=T.Int8Builder=T.IntBuilder=T.Float64Builder=T.Float32Builder=T.Float16Builder=T.FloatBuilder=T.FixedSizeBinaryBuilder=T.DictionaryBuilder=T.DecimalBuilder=T.DateMillisecondBuilder=T.DateDayBuilder=T.DateBuilder=T.NullBuilder=T.BoolBuilder=T.Builder=void 0;var cw=me();Object.defineProperty(T,"Builder",{enumerable:!0,get:function(){return cw.Builder}});var lw=Tu();Object.defineProperty(T,"BoolBuilder",{enumerable:!0,get:function(){return lw.BoolBuilder}});var dw=Iu();Object.defineProperty(T,"NullBuilder",{enumerable:!0,get:function(){return dw.NullBuilder}});var rc=Su();Object.defineProperty(T,"DateBuilder",{enumerable:!0,get:function(){return rc.DateBuilder}});Object.defineProperty(T,"DateDayBuilder",{enumerable:!0,get:function(){return rc.DateDayBuilder}});Object.defineProperty(T,"DateMillisecondBuilder",{enumerable:!0,get:function(){return rc.DateMillisecondBuilder}});var fw=Du();Object.defineProperty(T,"DecimalBuilder",{enumerable:!0,get:function(){return fw.DecimalBuilder}});var hw=Au();Object.defineProperty(T,"DictionaryBuilder",{enumerable:!0,get:function(){return hw.DictionaryBuilder}});var pw=Fu();Object.defineProperty(T,"FixedSizeBinaryBuilder",{enumerable:!0,get:function(){return pw.FixedSizeBinaryBuilder}});var Io=Mu();Object.defineProperty(T,"FloatBuilder",{enumerable:!0,get:function(){return Io.FloatBuilder}});Object.defineProperty(T,"Float16Builder",{enumerable:!0,get:function(){return Io.Float16Builder}});Object.defineProperty(T,"Float32Builder",{enumerable:!0,get:function(){return Io.Float32Builder}});Object.defineProperty(T,"Float64Builder",{enumerable:!0,get:function(){return Io.Float64Builder}});var ar=Vu();Object.defineProperty(T,"IntBuilder",{enumerable:!0,get:function(){return ar.IntBuilder}});Object.defineProperty(T,"Int8Builder",{enumerable:!0,get:function(){return ar.Int8Builder}});Object.defineProperty(T,"Int16Builder",{enumerable:!0,get:function(){return ar.Int16Builder}});Object.defineProperty(T,"Int32Builder",{enumerable:!0,get:function(){return ar.Int32Builder}});Object.defineProperty(T,"Int64Builder",{enumerable:!0,get:function(){return ar.Int64Builder}});Object.defineProperty(T,"Uint8Builder",{enumerable:!0,get:function(){return ar.Uint8Builder}});Object.defineProperty(T,"Uint16Builder",{enumerable:!0,get:function(){return ar.Uint16Builder}});Object.defineProperty(T,"Uint32Builder",{enumerable:!0,get:function(){return ar.Uint32Builder}});Object.defineProperty(T,"Uint64Builder",{enumerable:!0,get:function(){return ar.Uint64Builder}});var qi=Pu();Object.defineProperty(T,"TimeBuilder",{enumerable:!0,get:function(){return qi.TimeBuilder}});Object.defineProperty(T,"TimeSecondBuilder",{enumerable:!0,get:function(){return qi.TimeSecondBuilder}});Object.defineProperty(T,"TimeMillisecondBuilder",{enumerable:!0,get:function(){return qi.TimeMillisecondBuilder}});Object.defineProperty(T,"TimeMicrosecondBuilder",{enumerable:!0,get:function(){return qi.TimeMicrosecondBuilder}});Object.defineProperty(T,"TimeNanosecondBuilder",{enumerable:!0,get:function(){return qi.TimeNanosecondBuilder}});var zi=Nu();Object.defineProperty(T,"TimestampBuilder",{enumerable:!0,get:function(){return zi.TimestampBuilder}});Object.defineProperty(T,"TimestampSecondBuilder",{enumerable:!0,get:function(){return zi.TimestampSecondBuilder}});Object.defineProperty(T,"TimestampMillisecondBuilder",{enumerable:!0,get:function(){return zi.TimestampMillisecondBuilder}});Object.defineProperty(T,"TimestampMicrosecondBuilder",{enumerable:!0,get:function(){return zi.TimestampMicrosecondBuilder}});Object.defineProperty(T,"TimestampNanosecondBuilder",{enumerable:!0,get:function(){return zi.TimestampNanosecondBuilder}});var nc=Ru();Object.defineProperty(T,"IntervalBuilder",{enumerable:!0,get:function(){return nc.IntervalBuilder}});Object.defineProperty(T,"IntervalDayTimeBuilder",{enumerable:!0,get:function(){return nc.IntervalDayTimeBuilder}});Object.defineProperty(T,"IntervalYearMonthBuilder",{enumerable:!0,get:function(){return nc.IntervalYearMonthBuilder}});var yw=lo();Object.defineProperty(T,"Utf8Builder",{enumerable:!0,get:function(){return yw.Utf8Builder}});var bw=uo();Object.defineProperty(T,"BinaryBuilder",{enumerable:!0,get:function(){return bw.BinaryBuilder}});var mw=Wu();Object.defineProperty(T,"ListBuilder",{enumerable:!0,get:function(){return mw.ListBuilder}});var _w=Yu();Object.defineProperty(T,"FixedSizeListBuilder",{enumerable:!0,get:function(){return _w.FixedSizeListBuilder}});var gw=Hu();Object.defineProperty(T,"MapBuilder",{enumerable:!0,get:function(){return gw.MapBuilder}});var Bw=$u();Object.defineProperty(T,"StructBuilder",{enumerable:!0,get:function(){return Bw.StructBuilder}});var ic=Ju();Object.defineProperty(T,"UnionBuilder",{enumerable:!0,get:function(){return ic.UnionBuilder}});Object.defineProperty(T,"SparseUnionBuilder",{enumerable:!0,get:function(){return ic.SparseUnionBuilder}});Object.defineProperty(T,"DenseUnionBuilder",{enumerable:!0,get:function(){return ic.DenseUnionBuilder}});var sc=ue(),vw=lo(),ww=me(),Nh=Qu(),Rh=Ph();ww.Builder.new=xh;function xh(r){let e=r.type,t=new(Rh.instance.getVisitFn(e)())(r);if(e.children&&e.children.length>0){let n=r.children||[],i={nullValues:r.nullValues},o=Array.isArray(n)?(a,u)=>n[u]||i:({name:a})=>n[a]||i;e.children.forEach((a,u)=>{let{type:f}=a,s=o(a,u);t.children.push(xh({...s,type:f}))})}return t}Object.keys(sc.Type).map(r=>sc.Type[r]).filter(r=>typeof r=="number"&&r!==sc.Type.NONE).forEach(r=>{let e=Rh.instance.visit(r);e.prototype._setValue=Nh.instance.getVisitFn(r)});vw.Utf8Builder.prototype._setValue=Nh.instance.visitBinary});var Eh=B(sn=>{"use strict";Object.defineProperty(sn,"__esModule",{value:!0});sn.org=void 0;var oc=Dn(),jh;(function(r){var e;(function(t){var n;(function(i){var o;(function(a){class u{constructor(){this.bb=null,this.bb_pos=0}__init(s,c){return this.bb_pos=s,this.bb=c,this}static getRootAsFooter(s,c){return(c||new u).__init(s.readInt32(s.position())+s.position(),s)}version(){let s=this.bb.__offset(this.bb_pos,4);return s?this.bb.readInt16(this.bb_pos+s):oc.org.apache.arrow.flatbuf.MetadataVersion.V1}schema(s){let c=this.bb.__offset(this.bb_pos,6);return c?(s||new oc.org.apache.arrow.flatbuf.Schema).__init(this.bb.__indirect(this.bb_pos+c),this.bb):null}dictionaries(s,c){let _=this.bb.__offset(this.bb_pos,8);return _?(c||new r.apache.arrow.flatbuf.Block).__init(this.bb.__vector(this.bb_pos+_)+s*24,this.bb):null}dictionariesLength(){let s=this.bb.__offset(this.bb_pos,8);return s?this.bb.__vector_len(this.bb_pos+s):0}recordBatches(s,c){let _=this.bb.__offset(this.bb_pos,10);return _?(c||new r.apache.arrow.flatbuf.Block).__init(this.bb.__vector(this.bb_pos+_)+s*24,this.bb):null}recordBatchesLength(){let s=this.bb.__offset(this.bb_pos,10);return s?this.bb.__vector_len(this.bb_pos+s):0}static startFooter(s){s.startObject(4)}static addVersion(s,c){s.addFieldInt16(0,c,oc.org.apache.arrow.flatbuf.MetadataVersion.V1)}static addSchema(s,c){s.addFieldOffset(1,c,0)}static addDictionaries(s,c){s.addFieldOffset(2,c,0)}static startDictionariesVector(s,c){s.startVector(24,c,8)}static addRecordBatches(s,c){s.addFieldOffset(3,c,0)}static startRecordBatchesVector(s,c){s.startVector(24,c,8)}static endFooter(s){return s.endObject()}static finishFooterBuffer(s,c){s.finish(c)}static createFooter(s,c,_,U,J){return u.startFooter(s),u.addVersion(s,c),u.addSchema(s,_),u.addDictionaries(s,U),u.addRecordBatches(s,J),u.endFooter(s)}}a.Footer=u})(o=i.flatbuf||(i.flatbuf={}))})(n=t.arrow||(t.arrow={}))})(e=r.apache||(r.apache={}))})(jh=sn.org||(sn.org={}));(function(r){var e;(function(t){var n;(function(i){var o;(function(a){class u{constructor(){this.bb=null,this.bb_pos=0}__init(s,c){return this.bb_pos=s,this.bb=c,this}offset(){return this.bb.readInt64(this.bb_pos)}metaDataLength(){return this.bb.readInt32(this.bb_pos+8)}bodyLength(){return this.bb.readInt64(this.bb_pos+16)}static createBlock(s,c,_,U){return s.prep(8,24),s.writeInt64(U),s.pad(4),s.writeInt32(_),s.writeInt64(c),s.offset()}}a.Block=u})(o=i.flatbuf||(i.flatbuf={}))})(n=t.arrow||(t.arrow={}))})(e=r.apache||(r.apache={}))})(jh=sn.org||(sn.org={}))});var cc=B(Wn=>{"use strict";Object.defineProperty(Wn,"__esModule",{value:!0});Wn.FileBlock=Wn.Footer=void 0;var Lh=Eh(),ac=vn(),kh=ac.flatbuffers.Long,Tw=ac.flatbuffers.Builder,Iw=ac.flatbuffers.ByteBuffer,Sw=Lh.org.apache.arrow.flatbuf.Block,Ct=Lh.org.apache.arrow.flatbuf.Footer,Ch=Re(),qh=ue(),Dw=we(),uc=class{constructor(e,t=qh.MetadataVersion.V4,n,i){this.schema=e,this.version=t,n&&(this._recordBatches=n),i&&(this._dictionaryBatches=i)}static decode(e){e=new Iw(Dw.toUint8Array(e));let t=Ct.getRootAsFooter(e),n=Ch.Schema.decode(t.schema());return new zh(n,t)}static encode(e){let t=new Tw,n=Ch.Schema.encode(t,e.schema);Ct.startRecordBatchesVector(t,e.numRecordBatches),[...e.recordBatches()].slice().reverse().forEach(a=>Fr.encode(t,a));let i=t.endVector();Ct.startDictionariesVector(t,e.numDictionaries),[...e.dictionaryBatches()].slice().reverse().forEach(a=>Fr.encode(t,a));let o=t.endVector();return Ct.startFooter(t),Ct.addSchema(t,n),Ct.addVersion(t,qh.MetadataVersion.V4),Ct.addRecordBatches(t,i),Ct.addDictionaries(t,o),Ct.finishFooterBuffer(t,Ct.endFooter(t)),t.asUint8Array()}get numRecordBatches(){return this._recordBatches.length}get numDictionaries(){return this._dictionaryBatches.length}*recordBatches(){for(let e,t=-1,n=this.numRecordBatches;++t<n;)(e=this.getRecordBatch(t))&&(yield e)}*dictionaryBatches(){for(let e,t=-1,n=this.numDictionaries;++t<n;)(e=this.getDictionaryBatch(t))&&(yield e)}getRecordBatch(e){return e>=0&&e<this.numRecordBatches&&this._recordBatches[e]||null}getDictionaryBatch(e){return e>=0&&e<this.numDictionaries&&this._dictionaryBatches[e]||null}};Wn.Footer=uc;var zh=class extends uc{constructor(e,t){super(e,t.version());this._footer=t}get numRecordBatches(){return this._footer.recordBatchesLength()}get numDictionaries(){return this._footer.dictionariesLength()}getRecordBatch(e){if(e>=0&&e<this.numRecordBatches){let t=this._footer.recordBatches(e);if(t)return Fr.decode(t)}return null}getDictionaryBatch(e){if(e>=0&&e<this.numDictionaries){let t=this._footer.dictionaries(e);if(t)return Fr.decode(t)}return null}},Fr=class{constructor(e,t,n){this.metaDataLength=e,this.offset=typeof n=="number"?n:n.low,this.bodyLength=typeof t=="number"?t:t.low}static decode(e){return new Fr(e.metaDataLength(),e.bodyLength(),e.offset())}static encode(e,t){let{metaDataLength:n}=t,i=new kh(t.offset,0),o=new kh(t.bodyLength,0);return Sw.createBlock(e,i,n,o)}};Wn.FileBlock=Fr});var Pr=B(Vr=>{"use strict";Object.defineProperty(Vr,"__esModule",{value:!0});Vr.AsyncByteStream=Vr.ByteStream=Vr.AsyncByteQueue=void 0;var Mr=Si(),Wh=Xr(),Wi=In(),lc=we(),Yn=Ye(),dc=class extends Wi.AsyncQueue{write(e){if((e=lc.toUint8Array(e)).byteLength>0)return super.write(e)}toString(e=!1){return e?Wh.decodeUtf8(this.toUint8Array(!0)):this.toUint8Array(!1).then(Wh.decodeUtf8)}toUint8Array(e=!1){return e?lc.joinUint8Arrays(this._values)[0]:(async()=>{let t=[],n=0;for await(let i of this)t.push(i),n+=i.byteLength;return lc.joinUint8Arrays(t,n)[0]})()}};Vr.AsyncByteQueue=dc;var Yh=class{constructor(e){e&&(this.source=new Hh(Mr.default.fromIterable(e)))}[Symbol.iterator](){return this}next(e){return this.source.next(e)}throw(e){return this.source.throw(e)}return(e){return this.source.return(e)}peek(e){return this.source.peek(e)}read(e){return this.source.read(e)}};Vr.ByteStream=Yh;var Do=class{constructor(e){e instanceof Do?this.source=e.source:e instanceof dc?this.source=new Ur(Mr.default.fromAsyncIterable(e)):Yn.isReadableNodeStream(e)?this.source=new Ur(Mr.default.fromNodeStream(e)):Yn.isReadableDOMStream(e)?this.source=new Ur(Mr.default.fromDOMStream(e)):Yn.isFetchResponse(e)?this.source=new Ur(Mr.default.fromDOMStream(e.body)):Yn.isIterable(e)?this.source=new Ur(Mr.default.fromIterable(e)):Yn.isPromise(e)?this.source=new Ur(Mr.default.fromAsyncIterable(e)):Yn.isAsyncIterable(e)&&(this.source=new Ur(Mr.default.fromAsyncIterable(e)))}[Symbol.asyncIterator](){return this}next(e){return this.source.next(e)}throw(e){return this.source.throw(e)}return(e){return this.source.return(e)}get closed(){return this.source.closed}cancel(e){return this.source.cancel(e)}peek(e){return this.source.peek(e)}read(e){return this.source.read(e)}};Vr.AsyncByteStream=Do;var Hh=class{constructor(e){this.source=e}cancel(e){this.return(e)}peek(e){return this.next(e,"peek").value}read(e){return this.next(e,"read").value}next(e,t="read"){return this.source.next({cmd:t,size:e})}throw(e){return Object.create(this.source.throw&&this.source.throw(e)||Wi.ITERATOR_DONE)}return(e){return Object.create(this.source.return&&this.source.return(e)||Wi.ITERATOR_DONE)}},Ur=class{constructor(e){this.source=e,this._closedPromise=new Promise(t=>this._closedPromiseResolve=t)}async cancel(e){await this.return(e)}get closed(){return this._closedPromise}async read(e){return(await this.next(e,"read")).value}async peek(e){return(await this.next(e,"peek")).value}async next(e,t="read"){return await this.source.next({cmd:t,size:e})}async throw(e){let t=this.source.throw&&await this.source.throw(e)||Wi.ITERATOR_DONE;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(t)}async return(e){let t=this.source.return&&await this.source.return(e)||Wi.ITERATOR_DONE;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(t)}}});var fc=B(Hn=>{"use strict";Object.defineProperty(Hn,"__esModule",{value:!0});Hn.AsyncRandomAccessFile=Hn.RandomAccessFile=void 0;var $h=Pr(),Ow=we(),Jh=class extends $h.ByteStream{constructor(e,t){super();this.position=0,this.buffer=Ow.toUint8Array(e),this.size=typeof t=="undefined"?this.buffer.byteLength:t}readInt32(e){let{buffer:t,byteOffset:n}=this.readAt(e,4);return new DataView(t,n).getInt32(0,!0)}seek(e){return this.position=Math.min(e,this.size),e<this.size}read(e){let{buffer:t,size:n,position:i}=this;return t&&i<n?(typeof e!="number"&&(e=1/0),this.position=Math.min(n,i+Math.min(n-i,e)),t.subarray(i,this.position)):null}readAt(e,t){let n=this.buffer,i=Math.min(this.size,e+t);return n?n.subarray(e,i):new Uint8Array(t)}close(){this.buffer&&(this.buffer=null)}throw(e){return this.close(),{done:!0,value:e}}return(e){return this.close(),{done:!0,value:e}}};Hn.RandomAccessFile=Jh;var Kh=class extends $h.AsyncByteStream{constructor(e,t){super();this.position=0,this._handle=e,typeof t=="number"?this.size=t:this._pending=(async()=>{this.size=(await e.stat()).size,delete this._pending})()}async readInt32(e){let{buffer:t,byteOffset:n}=await this.readAt(e,4);return new DataView(t,n).getInt32(0,!0)}async seek(e){return this._pending&&await this._pending,this.position=Math.min(e,this.size),e<this.size}async read(e){this._pending&&await this._pending;let{_handle:t,size:n,position:i}=this;if(t&&i<n){typeof e!="number"&&(e=1/0);let o=i,a=0,u=0,f=Math.min(n,o+Math.min(n-o,e)),s=new Uint8Array(Math.max(0,(this.position=f)-o));for(;(o+=u)<f&&(a+=u)<s.byteLength;)({bytesRead:u}=await t.read(s,a,s.byteLength-a,o));return s}return null}async readAt(e,t){this._pending&&await this._pending;let{_handle:n,size:i}=this;if(n&&e+t<i){let o=Math.min(i,e+t),a=new Uint8Array(o-e);return(await n.read(a,0,t,e)).buffer}return new Uint8Array(t)}async close(){let e=this._handle;this._handle=null,e&&await e.close()}async throw(e){return await this.close(),{done:!0,value:e}}async return(e){return await this.close(),{done:!0,value:e}}};Hn.AsyncRandomAccessFile=Kh});var pc=B(qt=>{"use strict";Object.defineProperty(qt,"__esModule",{value:!0});qt.Int128=qt.Int64=qt.Uint64=qt.BaseInt64=void 0;var Aw=1<<16;function $n(r){return r<0&&(r=4294967295+r+1),`0x${r.toString(16)}`}var Jn=8,hc=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8],Oo=class{constructor(e){this.buffer=e}high(){return this.buffer[1]}low(){return this.buffer[0]}_times(e){let t=new Uint32Array([this.buffer[1]>>>16,this.buffer[1]&65535,this.buffer[0]>>>16,this.buffer[0]&65535]),n=new Uint32Array([e.buffer[1]>>>16,e.buffer[1]&65535,e.buffer[0]>>>16,e.buffer[0]&65535]),i=t[3]*n[3];this.buffer[0]=i&65535;let o=i>>>16;return i=t[2]*n[3],o+=i,i=t[3]*n[2]>>>0,o+=i,this.buffer[0]+=o<<16,this.buffer[1]=o>>>0<i?Aw:0,this.buffer[1]+=o>>>16,this.buffer[1]+=t[1]*n[3]+t[2]*n[2]+t[3]*n[1],this.buffer[1]+=t[0]*n[3]+t[1]*n[2]+t[2]*n[1]+t[3]*n[0]<<16,this}_plus(e){let t=this.buffer[0]+e.buffer[0]>>>0;this.buffer[1]+=e.buffer[1],t<this.buffer[0]>>>0&&++this.buffer[1],this.buffer[0]=t}lessThan(e){return this.buffer[1]<e.buffer[1]||this.buffer[1]===e.buffer[1]&&this.buffer[0]<e.buffer[0]}equals(e){return this.buffer[1]===e.buffer[1]&&this.buffer[0]==e.buffer[0]}greaterThan(e){return e.lessThan(this)}hex(){return`${$n(this.buffer[1])} ${$n(this.buffer[0])}`}};qt.BaseInt64=Oo;var ne=class extends Oo{times(e){return this._times(e),this}plus(e){return this._plus(e),this}static from(e,t=new Uint32Array(2)){return ne.fromString(typeof e=="string"?e:e.toString(),t)}static fromNumber(e,t=new Uint32Array(2)){return ne.fromString(e.toString(),t)}static fromString(e,t=new Uint32Array(2)){let n=e.length,i=new ne(t);for(let o=0;o<n;){let a=Jn<n-o?Jn:n-o,u=new ne(new Uint32Array([parseInt(e.substr(o,a),10),0])),f=new ne(new Uint32Array([hc[a],0]));i.times(f),i.plus(u),o+=a}return i}static convertArray(e){let t=new Uint32Array(e.length*2);for(let n=-1,i=e.length;++n<i;)ne.from(e[n],new Uint32Array(t.buffer,t.byteOffset+2*n*4,2));return t}static multiply(e,t){return new ne(new Uint32Array(e.buffer)).times(t)}static add(e,t){return new ne(new Uint32Array(e.buffer)).plus(t)}};qt.Uint64=ne;var it=class extends Oo{negate(){return this.buffer[0]=~this.buffer[0]+1,this.buffer[1]=~this.buffer[1],this.buffer[0]==0&&++this.buffer[1],this}times(e){return this._times(e),this}plus(e){return this._plus(e),this}lessThan(e){let t=this.buffer[1]<<0,n=e.buffer[1]<<0;return t<n||t===n&&this.buffer[0]<e.buffer[0]}static from(e,t=new Uint32Array(2)){return it.fromString(typeof e=="string"?e:e.toString(),t)}static fromNumber(e,t=new Uint32Array(2)){return it.fromString(e.toString(),t)}static fromString(e,t=new Uint32Array(2)){let n=e.startsWith("-"),i=e.length,o=new it(t);for(let a=n?1:0;a<i;){let u=Jn<i-a?Jn:i-a,f=new it(new Uint32Array([parseInt(e.substr(a,u),10),0])),s=new it(new Uint32Array([hc[u],0]));o.times(s),o.plus(f),a+=u}return n?o.negate():o}static convertArray(e){let t=new Uint32Array(e.length*2);for(let n=-1,i=e.length;++n<i;)it.from(e[n],new Uint32Array(t.buffer,t.byteOffset+2*n*4,2));return t}static multiply(e,t){return new it(new Uint32Array(e.buffer)).times(t)}static add(e,t){return new it(new Uint32Array(e.buffer)).plus(t)}};qt.Int64=it;var It=class{constructor(e){this.buffer=e}high(){return new it(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2))}low(){return new it(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset,2))}negate(){return this.buffer[0]=~this.buffer[0]+1,this.buffer[1]=~this.buffer[1],this.buffer[2]=~this.buffer[2],this.buffer[3]=~this.buffer[3],this.buffer[0]==0&&++this.buffer[1],this.buffer[1]==0&&++this.buffer[2],this.buffer[2]==0&&++this.buffer[3],this}times(e){let t=new ne(new Uint32Array([this.buffer[3],0])),n=new ne(new Uint32Array([this.buffer[2],0])),i=new ne(new Uint32Array([this.buffer[1],0])),o=new ne(new Uint32Array([this.buffer[0],0])),a=new ne(new Uint32Array([e.buffer[3],0])),u=new ne(new Uint32Array([e.buffer[2],0])),f=new ne(new Uint32Array([e.buffer[1],0])),s=new ne(new Uint32Array([e.buffer[0],0])),c=ne.multiply(o,s);this.buffer[0]=c.low();let _=new ne(new Uint32Array([c.high(),0]));return c=ne.multiply(i,s),_.plus(c),c=ne.multiply(o,f),_.plus(c),this.buffer[1]=_.low(),this.buffer[3]=_.lessThan(c)?1:0,this.buffer[2]=_.high(),new ne(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2)).plus(ne.multiply(n,s)).plus(ne.multiply(i,f)).plus(ne.multiply(o,u)),this.buffer[3]+=ne.multiply(t,s).plus(ne.multiply(n,f)).plus(ne.multiply(i,u)).plus(ne.multiply(o,a)).low(),this}plus(e){let t=new Uint32Array(4);return t[3]=this.buffer[3]+e.buffer[3]>>>0,t[2]=this.buffer[2]+e.buffer[2]>>>0,t[1]=this.buffer[1]+e.buffer[1]>>>0,t[0]=this.buffer[0]+e.buffer[0]>>>0,t[0]<this.buffer[0]>>>0&&++t[1],t[1]<this.buffer[1]>>>0&&++t[2],t[2]<this.buffer[2]>>>0&&++t[3],this.buffer[3]=t[3],this.buffer[2]=t[2],this.buffer[1]=t[1],this.buffer[0]=t[0],this}hex(){return`${$n(this.buffer[3])} ${$n(this.buffer[2])} ${$n(this.buffer[1])} ${$n(this.buffer[0])}`}static multiply(e,t){return new It(new Uint32Array(e.buffer)).times(t)}static add(e,t){return new It(new Uint32Array(e.buffer)).plus(t)}static from(e,t=new Uint32Array(4)){return It.fromString(typeof e=="string"?e:e.toString(),t)}static fromNumber(e,t=new Uint32Array(4)){return It.fromString(e.toString(),t)}static fromString(e,t=new Uint32Array(4)){let n=e.startsWith("-"),i=e.length,o=new It(t);for(let a=n?1:0;a<i;){let u=Jn<i-a?Jn:i-a,f=new It(new Uint32Array([parseInt(e.substr(a,u),10),0,0,0])),s=new It(new Uint32Array([hc[u],0,0,0]));o.times(s),o.plus(f),a+=u}return n?o.negate():o}static convertArray(e){let t=new Uint32Array(e.length*4);for(let n=-1,i=e.length;++n<i;)It.from(e[n],new Uint32Array(t.buffer,t.byteOffset+4*4*n,4));return t}};qt.Int128=It});var Zh=B(Kn=>{"use strict";Object.defineProperty(Kn,"__esModule",{value:!0});Kn.JSONVectorLoader=Kn.VectorLoader=void 0;var Ve=wt(),Fw=Re(),ur=re(),Mw=Ce(),Gh=Rt(),Uw=Xr(),Ao=pc(),Qh=ue(),zt=we(),yc=class extends Mw.Visitor{constructor(e,t,n,i){super();this.nodesIndex=-1,this.buffersIndex=-1,this.bytes=e,this.nodes=t,this.buffers=n,this.dictionaries=i}visit(e){return super.visit(e instanceof Fw.Field?e.type:e)}visitNull(e,{length:t}=this.nextFieldNode()){return Ve.Data.Null(e,0,t)}visitBool(e,{length:t,nullCount:n}=this.nextFieldNode()){return Ve.Data.Bool(e,0,t,n,this.readNullBitmap(e,n),this.readData(e))}visitInt(e,{length:t,nullCount:n}=this.nextFieldNode()){return Ve.Data.Int(e,0,t,n,this.readNullBitmap(e,n),this.readData(e))}visitFloat(e,{length:t,nullCount:n}=this.nextFieldNode()){return Ve.Data.Float(e,0,t,n,this.readNullBitmap(e,n),this.readData(e))}visitUtf8(e,{length:t,nullCount:n}=this.nextFieldNode()){return Ve.Data.Utf8(e,0,t,n,this.readNullBitmap(e,n),this.readOffsets(e),this.readData(e))}visitBinary(e,{length:t,nullCount:n}=this.nextFieldNode()){return Ve.Data.Binary(e,0,t,n,this.readNullBitmap(e,n),this.readOffsets(e),this.readData(e))}visitFixedSizeBinary(e,{length:t,nullCount:n}=this.nextFieldNode()){return Ve.Data.FixedSizeBinary(e,0,t,n,this.readNullBitmap(e,n),this.readData(e))}visitDate(e,{length:t,nullCount:n}=this.nextFieldNode()){return Ve.Data.Date(e,0,t,n,this.readNullBitmap(e,n),this.readData(e))}visitTimestamp(e,{length:t,nullCount:n}=this.nextFieldNode()){return Ve.Data.Timestamp(e,0,t,n,this.readNullBitmap(e,n),this.readData(e))}visitTime(e,{length:t,nullCount:n}=this.nextFieldNode()){return Ve.Data.Time(e,0,t,n,this.readNullBitmap(e,n),this.readData(e))}visitDecimal(e,{length:t,nullCount:n}=this.nextFieldNode()){return Ve.Data.Decimal(e,0,t,n,this.readNullBitmap(e,n),this.readData(e))}visitList(e,{length:t,nullCount:n}=this.nextFieldNode()){return Ve.Data.List(e,0,t,n,this.readNullBitmap(e,n),this.readOffsets(e),this.visit(e.children[0]))}visitStruct(e,{length:t,nullCount:n}=this.nextFieldNode()){return Ve.Data.Struct(e,0,t,n,this.readNullBitmap(e,n),this.visitMany(e.children))}visitUnion(e){return e.mode===Qh.UnionMode.Sparse?this.visitSparseUnion(e):this.visitDenseUnion(e)}visitDenseUnion(e,{length:t,nullCount:n}=this.nextFieldNode()){return Ve.Data.Union(e,0,t,n,this.readNullBitmap(e,n),this.readTypeIds(e),this.readOffsets(e),this.visitMany(e.children))}visitSparseUnion(e,{length:t,nullCount:n}=this.nextFieldNode()){return Ve.Data.Union(e,0,t,n,this.readNullBitmap(e,n),this.readTypeIds(e),this.visitMany(e.children))}visitDictionary(e,{length:t,nullCount:n}=this.nextFieldNode()){return Ve.Data.Dictionary(e,0,t,n,this.readNullBitmap(e,n),this.readData(e.indices),this.readDictionary(e))}visitInterval(e,{length:t,nullCount:n}=this.nextFieldNode()){return Ve.Data.Interval(e,0,t,n,this.readNullBitmap(e,n),this.readData(e))}visitFixedSizeList(e,{length:t,nullCount:n}=this.nextFieldNode()){return Ve.Data.FixedSizeList(e,0,t,n,this.readNullBitmap(e,n),this.visit(e.children[0]))}visitMap(e,{length:t,nullCount:n}=this.nextFieldNode()){return Ve.Data.Map(e,0,t,n,this.readNullBitmap(e,n),this.readOffsets(e),this.visit(e.children[0]))}nextFieldNode(){return this.nodes[++this.nodesIndex]}nextBufferRange(){return this.buffers[++this.buffersIndex]}readNullBitmap(e,t,n=this.nextBufferRange()){return t>0&&this.readData(e,n)||new Uint8Array(0)}readOffsets(e,t){return this.readData(e,t)}readTypeIds(e,t){return this.readData(e,t)}readData(e,{length:t,offset:n}=this.nextBufferRange()){return this.bytes.subarray(n,n+t)}readDictionary(e){return this.dictionaries.get(e.id)}};Kn.VectorLoader=yc;var Xh=class extends yc{constructor(e,t,n,i){super(new Uint8Array(0),t,n,i);this.sources=e}readNullBitmap(e,t,{offset:n}=this.nextBufferRange()){return t<=0?new Uint8Array(0):Gh.packBools(this.sources[n])}readOffsets(e,{offset:t}=this.nextBufferRange()){return zt.toArrayBufferView(Uint8Array,zt.toArrayBufferView(Int32Array,this.sources[t]))}readTypeIds(e,{offset:t}=this.nextBufferRange()){return zt.toArrayBufferView(Uint8Array,zt.toArrayBufferView(e.ArrayType,this.sources[t]))}readData(e,{offset:t}=this.nextBufferRange()){let{sources:n}=this;return ur.DataType.isTimestamp(e)||(ur.DataType.isInt(e)||ur.DataType.isTime(e))&&e.bitWidth===64||ur.DataType.isDate(e)&&e.unit===Qh.DateUnit.MILLISECOND?zt.toArrayBufferView(Uint8Array,Ao.Int64.convertArray(n[t])):ur.DataType.isDecimal(e)?zt.toArrayBufferView(Uint8Array,Ao.Int128.convertArray(n[t])):ur.DataType.isBinary(e)||ur.DataType.isFixedSizeBinary(e)?Vw(n[t]):ur.DataType.isBool(e)?Gh.packBools(n[t]):ur.DataType.isUtf8(e)?Uw.encodeUtf8(n[t].join("")):zt.toArrayBufferView(Uint8Array,zt.toArrayBufferView(e.ArrayType,n[t].map(i=>+i)))}};Kn.JSONVectorLoader=Xh;function Vw(r){let e=r.join(""),t=new Uint8Array(e.length/2);for(let n=0;n<e.length;n+=2)t[n>>1]=parseInt(e.substr(n,2),16);return t}});var op=B(Qn=>{"use strict";Object.defineProperty(Qn,"__esModule",{value:!0});Qn.instance=Qn.TypeAssembler=void 0;var Pw=vn(),Nw=Pw.flatbuffers.Long,xe=Dn(),Rw=Ce(),ep=xe.org.apache.arrow.flatbuf.Null,Fo=xe.org.apache.arrow.flatbuf.Int,bc=xe.org.apache.arrow.flatbuf.FloatingPoint,tp=xe.org.apache.arrow.flatbuf.Binary,rp=xe.org.apache.arrow.flatbuf.Bool,np=xe.org.apache.arrow.flatbuf.Utf8,Mo=xe.org.apache.arrow.flatbuf.Decimal,mc=xe.org.apache.arrow.flatbuf.Date,Uo=xe.org.apache.arrow.flatbuf.Time,Vo=xe.org.apache.arrow.flatbuf.Timestamp,_c=xe.org.apache.arrow.flatbuf.Interval,ip=xe.org.apache.arrow.flatbuf.List,sp=xe.org.apache.arrow.flatbuf.Struct_,Gn=xe.org.apache.arrow.flatbuf.Union,Yi=xe.org.apache.arrow.flatbuf.DictionaryEncoding,gc=xe.org.apache.arrow.flatbuf.FixedSizeBinary,Bc=xe.org.apache.arrow.flatbuf.FixedSizeList,vc=xe.org.apache.arrow.flatbuf.Map,wc=class extends Rw.Visitor{visit(e,t){return e==null||t==null?void 0:super.visit(e,t)}visitNull(e,t){return ep.startNull(t),ep.endNull(t)}visitInt(e,t){return Fo.startInt(t),Fo.addBitWidth(t,e.bitWidth),Fo.addIsSigned(t,e.isSigned),Fo.endInt(t)}visitFloat(e,t){return bc.startFloatingPoint(t),bc.addPrecision(t,e.precision),bc.endFloatingPoint(t)}visitBinary(e,t){return tp.startBinary(t),tp.endBinary(t)}visitBool(e,t){return rp.startBool(t),rp.endBool(t)}visitUtf8(e,t){return np.startUtf8(t),np.endUtf8(t)}visitDecimal(e,t){return Mo.startDecimal(t),Mo.addScale(t,e.scale),Mo.addPrecision(t,e.precision),Mo.endDecimal(t)}visitDate(e,t){return mc.startDate(t),mc.addUnit(t,e.unit),mc.endDate(t)}visitTime(e,t){return Uo.startTime(t),Uo.addUnit(t,e.unit),Uo.addBitWidth(t,e.bitWidth),Uo.endTime(t)}visitTimestamp(e,t){let n=e.timezone&&t.createString(e.timezone)||void 0;return Vo.startTimestamp(t),Vo.addUnit(t,e.unit),n!==void 0&&Vo.addTimezone(t,n),Vo.endTimestamp(t)}visitInterval(e,t){return _c.startInterval(t),_c.addUnit(t,e.unit),_c.endInterval(t)}visitList(e,t){return ip.startList(t),ip.endList(t)}visitStruct(e,t){return sp.startStruct_(t),sp.endStruct_(t)}visitUnion(e,t){Gn.startTypeIdsVector(t,e.typeIds.length);let n=Gn.createTypeIdsVector(t,e.typeIds);return Gn.startUnion(t),Gn.addMode(t,e.mode),Gn.addTypeIds(t,n),Gn.endUnion(t)}visitDictionary(e,t){let n=this.visit(e.indices,t);return Yi.startDictionaryEncoding(t),Yi.addId(t,new Nw(e.id,0)),Yi.addIsOrdered(t,e.isOrdered),n!==void 0&&Yi.addIndexType(t,n),Yi.endDictionaryEncoding(t)}visitFixedSizeBinary(e,t){return gc.startFixedSizeBinary(t),gc.addByteWidth(t,e.byteWidth),gc.endFixedSizeBinary(t)}visitFixedSizeList(e,t){return Bc.startFixedSizeList(t),Bc.addListSize(t,e.listSize),Bc.endFixedSizeList(t)}visitMap(e,t){return vc.startMap(t),vc.addKeysSorted(t,e.keysSorted),vc.endMap(t)}};Qn.TypeAssembler=wc;Qn.instance=new wc});var hp=B(Wt=>{"use strict";Object.defineProperty(Wt,"__esModule",{value:!0});Wt.fieldFromJSON=Wt.dictionaryBatchFromJSON=Wt.recordBatchFromJSON=Wt.schemaFromJSON=void 0;var Xn=Re(),fe=re(),on=an(),Zn=ue();function xw(r,e=new Map){return new Xn.Schema(Ew(r,e),Po(r.customMetadata),e)}Wt.schemaFromJSON=xw;function ap(r){return new on.RecordBatch(r.count,cp(r.columns),lp(r.columns))}Wt.recordBatchFromJSON=ap;function jw(r){return new on.DictionaryBatch(ap(r.data),r.id,r.isDelta)}Wt.dictionaryBatchFromJSON=jw;function Ew(r,e){return(r.fields||[]).filter(Boolean).map(t=>Xn.Field.fromJSON(t,e))}function up(r,e){return(r.children||[]).filter(Boolean).map(t=>Xn.Field.fromJSON(t,e))}function cp(r){return(r||[]).reduce((e,t)=>[...e,new on.FieldNode(t.count,Lw(t.VALIDITY)),...cp(t.children)],[])}function lp(r,e=[]){for(let t=-1,n=(r||[]).length;++t<n;){let i=r[t];i.VALIDITY&&e.push(new on.BufferRegion(e.length,i.VALIDITY.length)),i.TYPE&&e.push(new on.BufferRegion(e.length,i.TYPE.length)),i.OFFSET&&e.push(new on.BufferRegion(e.length,i.OFFSET.length)),i.DATA&&e.push(new on.BufferRegion(e.length,i.DATA.length)),e=lp(i.children,e)}return e}function Lw(r){return(r||[]).reduce((e,t)=>e+ +(t===0),0)}function kw(r,e){let t,n,i,o,a,u;return!e||!(o=r.dictionary)?(a=fp(r,up(r,e)),i=new Xn.Field(r.name,a,r.nullable,Po(r.customMetadata))):e.has(t=o.id)?(n=(n=o.indexType)?dp(n):new fe.Int32,u=new fe.Dictionary(e.get(t),n,t,o.isOrdered),i=new Xn.Field(r.name,u,r.nullable,Po(r.customMetadata))):(n=(n=o.indexType)?dp(n):new fe.Int32,e.set(t,a=fp(r,up(r,e))),u=new fe.Dictionary(a,n,t,o.isOrdered),i=new Xn.Field(r.name,u,r.nullable,Po(r.customMetadata))),i||null}Wt.fieldFromJSON=kw;function Po(r){return new Map(Object.entries(r||{}))}function dp(r){return new fe.Int(r.isSigned,r.bitWidth)}function fp(r,e){let t=r.type.name;switch(t){case"NONE":return new fe.Null;case"null":return new fe.Null;case"binary":return new fe.Binary;case"utf8":return new fe.Utf8;case"bool":return new fe.Bool;case"list":return new fe.List((e||[])[0]);case"struct":return new fe.Struct(e||[]);case"struct_":return new fe.Struct(e||[])}switch(t){case"int":{let n=r.type;return new fe.Int(n.isSigned,n.bitWidth)}case"floatingpoint":{let n=r.type;return new fe.Float(Zn.Precision[n.precision])}case"decimal":{let n=r.type;return new fe.Decimal(n.scale,n.precision)}case"date":{let n=r.type;return new fe.Date_(Zn.DateUnit[n.unit])}case"time":{let n=r.type;return new fe.Time(Zn.TimeUnit[n.unit],n.bitWidth)}case"timestamp":{let n=r.type;return new fe.Timestamp(Zn.TimeUnit[n.unit],n.timezone)}case"interval":{let n=r.type;return new fe.Interval(Zn.IntervalUnit[n.unit])}case"union":{let n=r.type;return new fe.Union(Zn.UnionMode[n.mode],n.typeIds||[],e||[])}case"fixedsizebinary":{let n=r.type;return new fe.FixedSizeBinary(n.byteWidth)}case"fixedsizelist":{let n=r.type;return new fe.FixedSizeList(n.listSize,(e||[])[0])}case"map":{let n=r.type;return new fe.Map_((e||[])[0],n.keysSorted)}}throw new Error(`Unrecognized type: "${t}"`)}});var an=B(ht=>{"use strict";Object.defineProperty(ht,"__esModule",{value:!0});ht.FieldNode=ht.BufferRegion=ht.DictionaryBatch=ht.RecordBatch=ht.Message=void 0;var Tc=vn(),ze=Dn(),No=Za(),je=Re(),Cw=we(),_e=ue(),Ic=op(),Ro=hp(),un=Tc.flatbuffers.Long,qw=Tc.flatbuffers.Builder,zw=Tc.flatbuffers.ByteBuffer,Pe=ze.org.apache.arrow.flatbuf.Type,St=ze.org.apache.arrow.flatbuf.Field,cr=ze.org.apache.arrow.flatbuf.Schema,Ww=ze.org.apache.arrow.flatbuf.Buffer,Nr=No.org.apache.arrow.flatbuf.Message,Rr=ze.org.apache.arrow.flatbuf.KeyValue,Yw=No.org.apache.arrow.flatbuf.FieldNode,pp=ze.org.apache.arrow.flatbuf.Endianness,xr=No.org.apache.arrow.flatbuf.RecordBatch,ei=No.org.apache.arrow.flatbuf.DictionaryBatch,he=re(),jr=class{constructor(e,t,n,i){this._version=t,this._headerType=n,this.body=new Uint8Array(0),i&&(this._createHeader=()=>i),this._bodyLength=typeof e=="number"?e:e.low}static fromJSON(e,t){let n=new jr(0,_e.MetadataVersion.V4,t);return n._createHeader=Hw(e,t),n}static decode(e){e=new zw(Cw.toUint8Array(e));let t=Nr.getRootAsMessage(e),n=t.bodyLength(),i=t.version(),o=t.headerType(),a=new jr(n,i,o);return a._createHeader=$w(t,o),a}static encode(e){let t=new qw,n=-1;return e.isSchema()?n=je.Schema.encode(t,e.header()):e.isRecordBatch()?n=ft.encode(t,e.header()):e.isDictionaryBatch()&&(n=Yt.encode(t,e.header())),Nr.startMessage(t),Nr.addVersion(t,_e.MetadataVersion.V4),Nr.addHeader(t,n),Nr.addHeaderType(t,e.headerType),Nr.addBodyLength(t,new un(e.bodyLength,0)),Nr.finishMessageBuffer(t,Nr.endMessage(t)),t.asUint8Array()}static from(e,t=0){if(e instanceof je.Schema)return new jr(0,_e.MetadataVersion.V4,_e.MessageHeader.Schema,e);if(e instanceof ft)return new jr(t,_e.MetadataVersion.V4,_e.MessageHeader.RecordBatch,e);if(e instanceof Yt)return new jr(t,_e.MetadataVersion.V4,_e.MessageHeader.DictionaryBatch,e);throw new Error(`Unrecognized Message header: ${e}`)}get type(){return this.headerType}get version(){return this._version}get headerType(){return this._headerType}get bodyLength(){return this._bodyLength}header(){return this._createHeader()}isSchema(){return this.headerType===_e.MessageHeader.Schema}isRecordBatch(){return this.headerType===_e.MessageHeader.RecordBatch}isDictionaryBatch(){return this.headerType===_e.MessageHeader.DictionaryBatch}};ht.Message=jr;var ft=class{constructor(e,t,n){this._nodes=t,this._buffers=n,this._length=typeof e=="number"?e:e.low}get nodes(){return this._nodes}get length(){return this._length}get buffers(){return this._buffers}};ht.RecordBatch=ft;var Yt=class{constructor(e,t,n=!1){this._data=e,this._isDelta=n,this._id=typeof t=="number"?t:t.low}get id(){return this._id}get data(){return this._data}get isDelta(){return this._isDelta}get length(){return this.data.length}get nodes(){return this.data.nodes}get buffers(){return this.data.buffers}};ht.DictionaryBatch=Yt;var cn=class{constructor(e,t){this.offset=typeof e=="number"?e:e.low,this.length=typeof t=="number"?t:t.low}};ht.BufferRegion=cn;var ln=class{constructor(e,t){this.length=typeof e=="number"?e:e.low,this.nullCount=typeof t=="number"?t:t.low}};ht.FieldNode=ln;function Hw(r,e){return()=>{switch(e){case _e.MessageHeader.Schema:return je.Schema.fromJSON(r);case _e.MessageHeader.RecordBatch:return ft.fromJSON(r);case _e.MessageHeader.DictionaryBatch:return Yt.fromJSON(r)}throw new Error(`Unrecognized Message type: { name: ${_e.MessageHeader[e]}, type: ${e} }`)}}function $w(r,e){return()=>{switch(e){case _e.MessageHeader.Schema:return je.Schema.decode(r.header(new cr));case _e.MessageHeader.RecordBatch:return ft.decode(r.header(new xr),r.version());case _e.MessageHeader.DictionaryBatch:return Yt.decode(r.header(new ei),r.version())}throw new Error(`Unrecognized Message type: { name: ${_e.MessageHeader[e]}, type: ${e} }`)}}je.Field.encode=iT;je.Field.decode=rT;je.Field.fromJSON=Ro.fieldFromJSON;je.Schema.encode=nT;je.Schema.decode=Jw;je.Schema.fromJSON=Ro.schemaFromJSON;ft.encode=sT;ft.decode=Kw;ft.fromJSON=Ro.recordBatchFromJSON;Yt.encode=oT;Yt.decode=Gw;Yt.fromJSON=Ro.dictionaryBatchFromJSON;ln.encode=aT;ln.decode=Xw;cn.encode=uT;cn.decode=Qw;function Jw(r,e=new Map){let t=tT(r,e);return new je.Schema(t,xo(r),e)}function Kw(r,e=_e.MetadataVersion.V4){return new ft(r.length(),Zw(r),eT(r,e))}function Gw(r,e=_e.MetadataVersion.V4){return new Yt(ft.decode(r.data(),e),r.id(),r.isDelta())}function Qw(r){return new cn(r.offset(),r.length())}function Xw(r){return new ln(r.length(),r.nullCount())}function Zw(r){let e=[];for(let t,n=-1,i=-1,o=r.nodesLength();++n<o;)(t=r.nodes(n))&&(e[++i]=ln.decode(t));return e}function eT(r,e){let t=[];for(let n,i=-1,o=-1,a=r.buffersLength();++i<a;)(n=r.buffers(i))&&(e<_e.MetadataVersion.V4&&(n.bb_pos+=8*(i+1)),t[++o]=cn.decode(n));return t}function tT(r,e){let t=[];for(let n,i=-1,o=-1,a=r.fieldsLength();++i<a;)(n=r.fields(i))&&(t[++o]=je.Field.decode(n,e));return t}function yp(r,e){let t=[];for(let n,i=-1,o=-1,a=r.childrenLength();++i<a;)(n=r.children(i))&&(t[++o]=je.Field.decode(n,e));return t}function rT(r,e){let t,n,i,o,a,u;return!e||!(u=r.dictionary())?(i=mp(r,yp(r,e)),n=new je.Field(r.name(),i,r.nullable(),xo(r))):e.has(t=u.id().low)?(o=(o=u.indexType())?bp(o):new he.Int32,a=new he.Dictionary(e.get(t),o,t,u.isOrdered()),n=new je.Field(r.name(),a,r.nullable(),xo(r))):(o=(o=u.indexType())?bp(o):new he.Int32,e.set(t,i=mp(r,yp(r,e))),a=new he.Dictionary(i,o,t,u.isOrdered()),n=new je.Field(r.name(),a,r.nullable(),xo(r))),n||null}function xo(r){let e=new Map;if(r)for(let t,n,i=-1,o=r.customMetadataLength()|0;++i<o;)(t=r.customMetadata(i))&&(n=t.key())!=null&&e.set(n,t.value());return e}function bp(r){return new he.Int(r.isSigned(),r.bitWidth())}function mp(r,e){let t=r.typeType();switch(t){case Pe.NONE:return new he.Null;case Pe.Null:return new he.Null;case Pe.Binary:return new he.Binary;case Pe.Utf8:return new he.Utf8;case Pe.Bool:return new he.Bool;case Pe.List:return new he.List((e||[])[0]);case Pe.Struct_:return new he.Struct(e||[])}switch(t){case Pe.Int:{let n=r.type(new ze.org.apache.arrow.flatbuf.Int);return new he.Int(n.isSigned(),n.bitWidth())}case Pe.FloatingPoint:{let n=r.type(new ze.org.apache.arrow.flatbuf.FloatingPoint);return new he.Float(n.precision())}case Pe.Decimal:{let n=r.type(new ze.org.apache.arrow.flatbuf.Decimal);return new he.Decimal(n.scale(),n.precision())}case Pe.Date:{let n=r.type(new ze.org.apache.arrow.flatbuf.Date);return new he.Date_(n.unit())}case Pe.Time:{let n=r.type(new ze.org.apache.arrow.flatbuf.Time);return new he.Time(n.unit(),n.bitWidth())}case Pe.Timestamp:{let n=r.type(new ze.org.apache.arrow.flatbuf.Timestamp);return new he.Timestamp(n.unit(),n.timezone())}case Pe.Interval:{let n=r.type(new ze.org.apache.arrow.flatbuf.Interval);return new he.Interval(n.unit())}case Pe.Union:{let n=r.type(new ze.org.apache.arrow.flatbuf.Union);return new he.Union(n.mode(),n.typeIdsArray()||[],e||[])}case Pe.FixedSizeBinary:{let n=r.type(new ze.org.apache.arrow.flatbuf.FixedSizeBinary);return new he.FixedSizeBinary(n.byteWidth())}case Pe.FixedSizeList:{let n=r.type(new ze.org.apache.arrow.flatbuf.FixedSizeList);return new he.FixedSizeList(n.listSize(),(e||[])[0])}case Pe.Map:{let n=r.type(new ze.org.apache.arrow.flatbuf.Map);return new he.Map_((e||[])[0],n.keysSorted())}}throw new Error(`Unrecognized type: "${Pe[t]}" (${t})`)}function nT(r,e){let t=e.fields.map(o=>je.Field.encode(r,o));cr.startFieldsVector(r,t.length);let n=cr.createFieldsVector(r,t),i=e.metadata&&e.metadata.size>0?cr.createCustomMetadataVector(r,[...e.metadata].map(([o,a])=>{let u=r.createString(`${o}`),f=r.createString(`${a}`);return Rr.startKeyValue(r),Rr.addKey(r,u),Rr.addValue(r,f),Rr.endKeyValue(r)})):-1;return cr.startSchema(r),cr.addFields(r,n),cr.addEndianness(r,cT?pp.Little:pp.Big),i!==-1&&cr.addCustomMetadata(r,i),cr.endSchema(r)}function iT(r,e){let t=-1,n=-1,i=-1,o=e.type,a=e.typeId;he.DataType.isDictionary(o)?(a=o.dictionary.typeId,i=Ic.instance.visit(o,r),n=Ic.instance.visit(o.dictionary,r)):n=Ic.instance.visit(o,r);let u=(o.children||[]).map(c=>je.Field.encode(r,c)),f=St.createChildrenVector(r,u),s=e.metadata&&e.metadata.size>0?St.createCustomMetadataVector(r,[...e.metadata].map(([c,_])=>{let U=r.createString(`${c}`),J=r.createString(`${_}`);return Rr.startKeyValue(r),Rr.addKey(r,U),Rr.addValue(r,J),Rr.endKeyValue(r)})):-1;return e.name&&(t=r.createString(e.name)),St.startField(r),St.addType(r,n),St.addTypeType(r,a),St.addChildren(r,f),St.addNullable(r,!!e.nullable),t!==-1&&St.addName(r,t),i!==-1&&St.addDictionary(r,i),s!==-1&&St.addCustomMetadata(r,s),St.endField(r)}function sT(r,e){let t=e.nodes||[],n=e.buffers||[];xr.startNodesVector(r,t.length),t.slice().reverse().forEach(a=>ln.encode(r,a));let i=r.endVector();xr.startBuffersVector(r,n.length),n.slice().reverse().forEach(a=>cn.encode(r,a));let o=r.endVector();return xr.startRecordBatch(r),xr.addLength(r,new un(e.length,0)),xr.addNodes(r,i),xr.addBuffers(r,o),xr.endRecordBatch(r)}function oT(r,e){let t=ft.encode(r,e.data);return ei.startDictionaryBatch(r),ei.addId(r,new un(e.id,0)),ei.addIsDelta(r,e.isDelta),ei.addData(r,t),ei.endDictionaryBatch(r)}function aT(r,e){return Yw.createFieldNode(r,new un(e.length,0),new un(e.nullCount,0))}function uT(r,e){return Ww.createBuffer(r,new un(e.offset,0),new un(e.length,0))}var cT=function(){let r=new ArrayBuffer(2);return new DataView(r).setInt16(0,256,!0),new Int16Array(r)[0]===256}()});var Eo=B(ee=>{"use strict";Object.defineProperty(ee,"__esModule",{value:!0});ee.magicX2AndPadding=ee.magicAndPadding=ee.magicLength=ee.checkForMagicArrowString=ee.MAGIC=ee.MAGIC_STR=ee.PADDING=ee.JSONMessageReader=ee.AsyncMessageReader=ee.MessageReader=void 0;var Er=ue(),lT=vn(),_p=lT.flatbuffers.ByteBuffer,Hi=an(),dT=Ye(),fT=fc(),gp=we(),jo=Pr(),Dt=In(),Sc=r=>`Expected ${Er.MessageHeader[r]} Message in stream, but was null or length 0.`,Dc=r=>`Header pointer of flatbuffer-encoded ${Er.MessageHeader[r]} Message is null or length 0.`,Bp=(r,e)=>`Expected to read ${r} metadata bytes, but only read ${e}.`,vp=(r,e)=>`Expected to read ${r} bytes for message body, but only read ${e}.`,Oc=class{constructor(e){this.source=e instanceof jo.ByteStream?e:new jo.ByteStream(e)}[Symbol.iterator](){return this}next(){let e;return(e=this.readMetadataLength()).done||e.value===-1&&(e=this.readMetadataLength()).done||(e=this.readMetadata(e.value)).done?Dt.ITERATOR_DONE:e}throw(e){return this.source.throw(e)}return(e){return this.source.return(e)}readMessage(e){let t;if((t=this.next()).done)return null;if(e!=null&&t.value.headerType!==e)throw new Error(Sc(e));return t.value}readMessageBody(e){if(e<=0)return new Uint8Array(0);let t=gp.toUint8Array(this.source.read(e));if(t.byteLength<e)throw new Error(vp(e,t.byteLength));return t.byteOffset%8==0&&t.byteOffset+t.byteLength<=t.buffer.byteLength?t:t.slice()}readSchema(e=!1){let t=Er.MessageHeader.Schema,n=this.readMessage(t),i=n&&n.header();if(e&&!i)throw new Error(Dc(t));return i}readMetadataLength(){let e=this.source.read(ee.PADDING),t=e&&new _p(e),n=t&&t.readInt32(0)||0;return{done:n===0,value:n}}readMetadata(e){let t=this.source.read(e);if(!t)return Dt.ITERATOR_DONE;if(t.byteLength<e)throw new Error(Bp(e,t.byteLength));return{done:!1,value:Hi.Message.decode(t)}}};ee.MessageReader=Oc;var wp=class{constructor(e,t){this.source=e instanceof jo.AsyncByteStream?e:dT.isFileHandle(e)?new fT.AsyncRandomAccessFile(e,t):new jo.AsyncByteStream(e)}[Symbol.asyncIterator](){return this}async next(){let e;return(e=await this.readMetadataLength()).done||e.value===-1&&(e=await this.readMetadataLength()).done||(e=await this.readMetadata(e.value)).done?Dt.ITERATOR_DONE:e}async throw(e){return await this.source.throw(e)}async return(e){return await this.source.return(e)}async readMessage(e){let t;if((t=await this.next()).done)return null;if(e!=null&&t.value.headerType!==e)throw new Error(Sc(e));return t.value}async readMessageBody(e){if(e<=0)return new Uint8Array(0);let t=gp.toUint8Array(await this.source.read(e));if(t.byteLength<e)throw new Error(vp(e,t.byteLength));return t.byteOffset%8==0&&t.byteOffset+t.byteLength<=t.buffer.byteLength?t:t.slice()}async readSchema(e=!1){let t=Er.MessageHeader.Schema,n=await this.readMessage(t),i=n&&n.header();if(e&&!i)throw new Error(Dc(t));return i}async readMetadataLength(){let e=await this.source.read(ee.PADDING),t=e&&new _p(e),n=t&&t.readInt32(0)||0;return{done:n===0,value:n}}async readMetadata(e){let t=await this.source.read(e);if(!t)return Dt.ITERATOR_DONE;if(t.byteLength<e)throw new Error(Bp(e,t.byteLength));return{done:!1,value:Hi.Message.decode(t)}}};ee.AsyncMessageReader=wp;var Tp=class extends Oc{constructor(e){super(new Uint8Array(0));this._schema=!1,this._body=[],this._batchIndex=0,this._dictionaryIndex=0,this._json=e instanceof Dt.ArrowJSON?e:new Dt.ArrowJSON(e)}next(){let{_json:e}=this;if(!this._schema){this._schema=!0;let t=Hi.Message.fromJSON(e.schema,Er.MessageHeader.Schema);return{done:!1,value:t}}if(this._dictionaryIndex<e.dictionaries.length){let t=e.dictionaries[this._dictionaryIndex++];this._body=t.data.columns;let n=Hi.Message.fromJSON(t,Er.MessageHeader.DictionaryBatch);return{done:!1,value:n}}if(this._batchIndex<e.batches.length){let t=e.batches[this._batchIndex++];this._body=t.columns;let n=Hi.Message.fromJSON(t,Er.MessageHeader.RecordBatch);return{done:!1,value:n}}return this._body=[],Dt.ITERATOR_DONE}readMessageBody(e){return t(this._body);function t(n){return(n||[]).reduce((i,o)=>[...i,...o.VALIDITY&&[o.VALIDITY]||[],...o.TYPE&&[o.TYPE]||[],...o.OFFSET&&[o.OFFSET]||[],...o.DATA&&[o.DATA]||[],...t(o.children)],[])}}readMessage(e){let t;if((t=this.next()).done)return null;if(e!=null&&t.value.headerType!==e)throw new Error(Sc(e));return t.value}readSchema(){let e=Er.MessageHeader.Schema,t=this.readMessage(e),n=t&&t.header();if(!t||!n)throw new Error(Dc(e));return n}};ee.JSONMessageReader=Tp;ee.PADDING=4;ee.MAGIC_STR="ARROW1";ee.MAGIC=new Uint8Array(ee.MAGIC_STR.length);for(let r=0;r<ee.MAGIC_STR.length;r+=1|0)ee.MAGIC[r]=ee.MAGIC_STR.charCodeAt(r);function hT(r,e=0){for(let t=-1,n=ee.MAGIC.length;++t<n;)if(ee.MAGIC[t]!==r[e+t])return!1;return!0}ee.checkForMagicArrowString=hT;ee.magicLength=ee.MAGIC.length;ee.magicAndPadding=ee.magicLength+ee.PADDING;ee.magicX2AndPadding=ee.magicLength*2+ee.PADDING});var Ap=B(Lo=>{"use strict";Object.defineProperty(Lo,"__esModule",{value:!0});Lo.VectorAssembler=void 0;var pT=Ce(),Ip=ue(),yT=lr(),Ac=we(),Fc=Rt(),bT=Sr(),Sp=an(),Dp=re(),Se=class extends pT.Visitor{constructor(){super();this._byteLength=0,this._nodes=[],this._buffers=[],this._bufferRegions=[]}static assemble(...e){let t=new Se,n=bT.selectVectorChildrenArgs(yT.RecordBatch,e),[i=t]=t.visitMany(n);return i}visit(e){if(!Dp.DataType.isDictionary(e.type)){let{data:t,length:n,nullCount:i}=e;if(n>2147483647)throw new RangeError("Cannot write arrays larger than 2^31 - 1 in length");Dp.DataType.isNull(e.type)||Ot.call(this,i<=0?new Uint8Array(0):Fc.truncateBitmap(t.offset,n,t.nullBitmap)),this.nodes.push(new Sp.FieldNode(n,i))}return super.visit(e)}visitNull(e){return this}visitDictionary(e){return this.visit(e.indices)}get nodes(){return this._nodes}get buffers(){return this._buffers}get byteLength(){return this._byteLength}get bufferRegions(){return this._bufferRegions}};Lo.VectorAssembler=Se;function Ot(r){let e=r.byteLength+7&~7;return this.buffers.push(r),this.bufferRegions.push(new Sp.BufferRegion(this._byteLength,e)),this._byteLength+=e,this}function mT(r){let{type:e,length:t,typeIds:n,valueOffsets:i}=r;if(Ot.call(this,n),e.mode===Ip.UnionMode.Sparse)return Uc.call(this,r);if(e.mode===Ip.UnionMode.Dense){if(r.offset<=0)return Ot.call(this,i),Uc.call(this,r);{let o=n.reduce((c,_)=>Math.max(c,_),n[0]),a=new Int32Array(o+1),u=new Int32Array(o+1).fill(-1),f=new Int32Array(t),s=Ac.rebaseValueOffsets(-i[0],t,i);for(let c,_,U=-1;++U<t;)(_=u[c=n[U]])===-1&&(_=u[c]=s[c]),f[U]=s[U]-_,++a[c];Ot.call(this,f);for(let c,_=-1,U=e.children.length;++_<U;)if(c=r.getChildAt(_)){let J=e.typeIds[_],Qe=Math.min(t,a[J]);this.visit(c.slice(u[J],Qe))}}}return this}function _T(r){let e;return r.nullCount>=r.length?Ot.call(this,new Uint8Array(0)):(e=r.values)instanceof Uint8Array?Ot.call(this,Fc.truncateBitmap(r.offset,r.length,e)):Ot.call(this,Fc.packBools(r))}function Lr(r){return Ot.call(this,r.values.subarray(0,r.length*r.stride))}function Op(r){let{length:e,values:t,valueOffsets:n}=r,i=n[0],o=n[e],a=Math.min(o-i,t.byteLength-i);return Ot.call(this,Ac.rebaseValueOffsets(-n[0],e,n)),Ot.call(this,t.subarray(i,i+a)),this}function Mc(r){let{length:e,valueOffsets:t}=r;return t&&Ot.call(this,Ac.rebaseValueOffsets(t[0],e,t)),this.visit(r.getChildAt(0))}function Uc(r){return this.visitMany(r.type.children.map((e,t)=>r.getChildAt(t)).filter(Boolean))[0]}Se.prototype.visitBool=_T;Se.prototype.visitInt=Lr;Se.prototype.visitFloat=Lr;Se.prototype.visitUtf8=Op;Se.prototype.visitBinary=Op;Se.prototype.visitFixedSizeBinary=Lr;Se.prototype.visitDate=Lr;Se.prototype.visitTimestamp=Lr;Se.prototype.visitTime=Lr;Se.prototype.visitDecimal=Lr;Se.prototype.visitList=Mc;Se.prototype.visitStruct=Uc;Se.prototype.visitUnion=mT;Se.prototype.visitInterval=Lr;Se.prototype.visitFixedSizeList=Mc;Se.prototype.visitMap=Mc});var Mp=B(ko=>{"use strict";Object.defineProperty(ko,"__esModule",{value:!0});ko.JSONTypeAssembler=void 0;var gT=Ce(),ye=ue(),Fp=class extends gT.Visitor{visit(e){return e==null?void 0:super.visit(e)}visitNull({typeId:e}){return{name:ye.ArrowType[e].toLowerCase()}}visitInt({typeId:e,bitWidth:t,isSigned:n}){return{name:ye.ArrowType[e].toLowerCase(),bitWidth:t,isSigned:n}}visitFloat({typeId:e,precision:t}){return{name:ye.ArrowType[e].toLowerCase(),precision:ye.Precision[t]}}visitBinary({typeId:e}){return{name:ye.ArrowType[e].toLowerCase()}}visitBool({typeId:e}){return{name:ye.ArrowType[e].toLowerCase()}}visitUtf8({typeId:e}){return{name:ye.ArrowType[e].toLowerCase()}}visitDecimal({typeId:e,scale:t,precision:n}){return{name:ye.ArrowType[e].toLowerCase(),scale:t,precision:n}}visitDate({typeId:e,unit:t}){return{name:ye.ArrowType[e].toLowerCase(),unit:ye.DateUnit[t]}}visitTime({typeId:e,unit:t,bitWidth:n}){return{name:ye.ArrowType[e].toLowerCase(),unit:ye.TimeUnit[t],bitWidth:n}}visitTimestamp({typeId:e,timezone:t,unit:n}){return{name:ye.ArrowType[e].toLowerCase(),unit:ye.TimeUnit[n],timezone:t}}visitInterval({typeId:e,unit:t}){return{name:ye.ArrowType[e].toLowerCase(),unit:ye.IntervalUnit[t]}}visitList({typeId:e}){return{name:ye.ArrowType[e].toLowerCase()}}visitStruct({typeId:e}){return{name:ye.ArrowType[e].toLowerCase()}}visitUnion({typeId:e,mode:t,typeIds:n}){return{name:ye.ArrowType[e].toLowerCase(),mode:ye.UnionMode[t],typeIds:[...n]}}visitDictionary(e){return this.visit(e.dictionary)}visitFixedSizeBinary({typeId:e,byteWidth:t}){return{name:ye.ArrowType[e].toLowerCase(),byteWidth:t}}visitFixedSizeList({typeId:e,listSize:t}){return{name:ye.ArrowType[e].toLowerCase(),listSize:t}}visitMap({typeId:e,keysSorted:t}){return{name:ye.ArrowType[e].toLowerCase(),keysSorted:t}}};ko.JSONTypeAssembler=Fp});var Pp=B(zo=>{"use strict";Object.defineProperty(zo,"__esModule",{value:!0});zo.JSONVectorAssembler=void 0;var BT=Ri(),$i=kn(),vT=Be(),wT=Ce(),TT=ue(),IT=lr(),Vc=ue(),Co=Rt(),ST=Sr(),Up=re(),qo=class extends wT.Visitor{static assemble(...e){return new qo().visitMany(ST.selectColumnChildrenArgs(IT.RecordBatch,e))}visit(e){let{data:t,name:n,length:i}=e,{offset:o,nullCount:a,nullBitmap:u}=t,f=Up.DataType.isDictionary(e.type)?e.type.indices:e.type,s=Object.assign([],t.buffers,{[TT.BufferType.VALIDITY]:void 0});return{name:n,count:i,VALIDITY:Up.DataType.isNull(f)?void 0:a<=0?Array.from({length:i},()=>1):[...Co.iterateBits(u,o,i,null,Co.getBit)],...super.visit(vT.Vector.new(t.clone(f,o,i,0,s)))}}visitNull(){return{}}visitBool({values:e,offset:t,length:n}){return{DATA:[...Co.iterateBits(e,t,n,null,Co.getBool)]}}visitInt(e){return{DATA:e.type.bitWidth<64?[...e.values]:[...Ji(e.values,2)]}}visitFloat(e){return{DATA:[...e.values]}}visitUtf8(e){return{DATA:[...e],OFFSET:[...e.valueOffsets]}}visitBinary(e){return{DATA:[...Vp(e)],OFFSET:[...e.valueOffsets]}}visitFixedSizeBinary(e){return{DATA:[...Vp(e)]}}visitDate(e){return{DATA:e.type.unit===Vc.DateUnit.DAY?[...e.values]:[...Ji(e.values,2)]}}visitTimestamp(e){return{DATA:[...Ji(e.values,2)]}}visitTime(e){return{DATA:e.type.unit<Vc.TimeUnit.MICROSECOND?[...e.values]:[...Ji(e.values,2)]}}visitDecimal(e){return{DATA:[...Ji(e.values,4)]}}visitList(e){return{OFFSET:[...e.valueOffsets],children:e.type.children.map((t,n)=>this.visit(new $i.Column(t,[e.getChildAt(n)])))}}visitStruct(e){return{children:e.type.children.map((t,n)=>this.visit(new $i.Column(t,[e.getChildAt(n)])))}}visitUnion(e){return{TYPE:[...e.typeIds],OFFSET:e.type.mode===Vc.UnionMode.Dense?[...e.valueOffsets]:void 0,children:e.type.children.map((t,n)=>this.visit(new $i.Column(t,[e.getChildAt(n)])))}}visitInterval(e){return{DATA:[...e.values]}}visitFixedSizeList(e){return{children:e.type.children.map((t,n)=>this.visit(new $i.Column(t,[e.getChildAt(n)])))}}visitMap(e){return{OFFSET:[...e.valueOffsets],children:e.type.children.map((t,n)=>this.visit(new $i.Column(t,[e.getChildAt(n)])))}}};zo.JSONVectorAssembler=qo;function*Vp(r){for(let e of r)yield e.reduce((t,n)=>`${t}${("0"+(n&255).toString(16)).slice(-2)}`,"").toUpperCase()}function*Ji(r,e){for(let t=-1,n=r.length/e;++t<n;)yield`${BT.BN.new(r.subarray((t+0)*e,(t+1)*e),!1)}`}});var Jo=B($t=>{"use strict";Object.defineProperty($t,"__esModule",{value:!0});$t.RecordBatchJSONWriter=$t.RecordBatchFileWriter=$t.RecordBatchStreamWriter=$t.RecordBatchWriter=void 0;var Pc=Gi(),DT=Eo(),OT=kn(),AT=re(),FT=Re(),Wo=an(),Nc=an(),ti=cc(),Rc=ue(),xc=Pr(),Np=Ap(),MT=Mp(),Rp=Pp(),UT=we(),jc=lr(),VT=In(),Ht=Ye(),Ki=class extends VT.ReadableInterop{constructor(e){super();this._position=0,this._started=!1,this._sink=new xc.AsyncByteQueue,this._schema=null,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._dictionaryDeltaOffsets=new Map,Ht.isObject(e)||(e={autoDestroy:!0,writeLegacyIpcFormat:!1}),this._autoDestroy=typeof e.autoDestroy=="boolean"?e.autoDestroy:!0,this._writeLegacyIpcFormat=typeof e.writeLegacyIpcFormat=="boolean"?e.writeLegacyIpcFormat:!1}static throughNode(e){throw new Error('"throughNode" not available in this environment')}static throughDOM(e,t){throw new Error('"throughDOM" not available in this environment')}toString(e=!1){return this._sink.toString(e)}toUint8Array(e=!1){return this._sink.toUint8Array(e)}writeAll(e){return Ht.isPromise(e)?e.then(t=>this.writeAll(t)):Ht.isAsyncIterable(e)?Lc(this,e):Ec(this,e)}get closed(){return this._sink.closed}[Symbol.asyncIterator](){return this._sink[Symbol.asyncIterator]()}toDOMStream(e){return this._sink.toDOMStream(e)}toNodeStream(e){return this._sink.toNodeStream(e)}close(){return this.reset()._sink.close()}abort(e){return this.reset()._sink.abort(e)}finish(){return this._autoDestroy?this.close():this.reset(this._sink,this._schema),this}reset(e=this._sink,t=null){return e===this._sink||e instanceof xc.AsyncByteQueue?this._sink=e:(this._sink=new xc.AsyncByteQueue,e&&Ht.isWritableDOMStream(e)?this.toDOMStream({type:"bytes"}).pipeTo(e):e&&Ht.isWritableNodeStream(e)&&this.toNodeStream({objectMode:!1}).pipe(e)),this._started&&this._schema&&this._writeFooter(this._schema),this._started=!1,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._dictionaryDeltaOffsets=new Map,(!t||!t.compareTo(this._schema))&&(t===null?(this._position=0,this._schema=null):(this._started=!0,this._schema=t,this._writeSchema(t))),this}write(e){let t=null;if(this._sink){if(e==null)return this.finish()&&void 0;if(e instanceof Pc.Table&&!(t=e.schema))return this.finish()&&void 0;if(e instanceof jc.RecordBatch&&!(t=e.schema))return this.finish()&&void 0}else throw new Error("RecordBatchWriter is closed");if(t&&!t.compareTo(this._schema)){if(this._started&&this._autoDestroy)return this.close();this.reset(this._sink,t)}e instanceof jc.RecordBatch?e instanceof jc._InternalEmptyPlaceholderRecordBatch||this._writeRecordBatch(e):e instanceof Pc.Table?this.writeAll(e.chunks):Ht.isIterable(e)&&this.writeAll(e)}_writeMessage(e,t=8){let n=t-1,i=Wo.Message.encode(e),o=i.byteLength,a=this._writeLegacyIpcFormat?4:8,u=o+a+n&~n,f=u-o-a;return e.headerType===Rc.MessageHeader.RecordBatch?this._recordBatchBlocks.push(new ti.FileBlock(u,e.bodyLength,this._position)):e.headerType===Rc.MessageHeader.DictionaryBatch&&this._dictionaryBlocks.push(new ti.FileBlock(u,e.bodyLength,this._position)),this._writeLegacyIpcFormat||this._write(Int32Array.of(-1)),this._write(Int32Array.of(u-a)),o>0&&this._write(i),this._writePadding(f)}_write(e){if(this._started){let t=UT.toUint8Array(e);t&&t.byteLength>0&&(this._sink.write(t),this._position+=t.byteLength)}return this}_writeSchema(e){return this._writeMessage(Wo.Message.from(e))}_writeFooter(e){return this._writeLegacyIpcFormat?this._write(Int32Array.of(0)):this._write(Int32Array.of(-1,0))}_writeMagic(){return this._write(DT.MAGIC)}_writePadding(e){return e>0?this._write(new Uint8Array(e)):this}_writeRecordBatch(e){let{byteLength:t,nodes:n,bufferRegions:i,buffers:o}=Np.VectorAssembler.assemble(e),a=new Nc.RecordBatch(e.length,n,i),u=Wo.Message.from(a,t);return this._writeDictionaries(e)._writeMessage(u)._writeBodyBuffers(o)}_writeDictionaryBatch(e,t,n=!1){this._dictionaryDeltaOffsets.set(t,e.length+(this._dictionaryDeltaOffsets.get(t)||0));let{byteLength:i,nodes:o,bufferRegions:a,buffers:u}=Np.VectorAssembler.assemble(e),f=new Nc.RecordBatch(e.length,o,a),s=new Nc.DictionaryBatch(f,t,n),c=Wo.Message.from(s,i);return this._writeMessage(c)._writeBodyBuffers(u)}_writeBodyBuffers(e){let t,n,i;for(let o=-1,a=e.length;++o<a;)(t=e[o])&&(n=t.byteLength)>0&&(this._write(t),(i=(n+7&~7)-n)>0&&this._writePadding(i));return this}_writeDictionaries(e){for(let[t,n]of e.dictionaries){let i=this._dictionaryDeltaOffsets.get(t)||0;if(i===0||(n=n.slice(i)).length>0){let o="chunks"in n?n.chunks:[n];for(let a of o)this._writeDictionaryBatch(a,t,i>0),i+=a.length}}return this}};$t.RecordBatchWriter=Ki;var Yo=class extends Ki{static writeAll(e,t){let n=new Yo(t);return Ht.isPromise(e)?e.then(i=>n.writeAll(i)):Ht.isAsyncIterable(e)?Lc(n,e):Ec(n,e)}};$t.RecordBatchStreamWriter=Yo;var Ho=class extends Ki{static writeAll(e){let t=new Ho;return Ht.isPromise(e)?e.then(n=>t.writeAll(n)):Ht.isAsyncIterable(e)?Lc(t,e):Ec(t,e)}constructor(){super();this._autoDestroy=!0}_writeSchema(e){return this._writeMagic()._writePadding(2)}_writeFooter(e){let t=ti.Footer.encode(new ti.Footer(e,Rc.MetadataVersion.V4,this._recordBatchBlocks,this._dictionaryBlocks));return super._writeFooter(e)._write(t)._write(Int32Array.of(t.byteLength))._writeMagic()}};$t.RecordBatchFileWriter=Ho;var $o=class extends Ki{constructor(){super();this._autoDestroy=!0,this._recordBatches=[],this._dictionaries=[]}static writeAll(e){return new $o().writeAll(e)}_writeMessage(){return this}_writeFooter(e){return this}_writeSchema(e){return this._write(`{
|
|
8
|
-
"schema": ${JSON.stringify({fields:e.fields.map(xp)},null,2)}`)}_writeDictionaries(e){return e.dictionaries.size>0&&this._dictionaries.push(e),this}_writeDictionaryBatch(e,t,n=!1){return this._dictionaryDeltaOffsets.set(t,e.length+(this._dictionaryDeltaOffsets.get(t)||0)),this._write(this._dictionaryBlocks.length===0?" ":`,
|
|
9
|
-
`),this._write(`${PT(e,t,n)}`),this._dictionaryBlocks.push(new ti.FileBlock(0,0,0)),this}_writeRecordBatch(e){return this._writeDictionaries(e),this._recordBatches.push(e),this}close(){if(this._dictionaries.length>0){this._write(`,
|
|
10
|
-
"dictionaries": [
|
|
11
|
-
`);for(let e of this._dictionaries)super._writeDictionaries(e);this._write(`
|
|
12
|
-
]`)}if(this._recordBatches.length>0){for(let e=-1,t=this._recordBatches.length;++e<t;)this._write(e===0?`,
|
|
13
|
-
"batches": [
|
|
14
|
-
`:`,
|
|
15
|
-
`),this._write(`${NT(this._recordBatches[e])}`),this._recordBatchBlocks.push(new ti.FileBlock(0,0,0));this._write(`
|
|
16
|
-
]`)}return this._schema&&this._write(`
|
|
17
|
-
}`),this._dictionaries=[],this._recordBatches=[],super.close()}};$t.RecordBatchJSONWriter=$o;function Ec(r,e){let t=e;e instanceof Pc.Table&&(t=e.chunks,r.reset(void 0,e.schema));for(let n of t)r.write(n);return r.finish()}async function Lc(r,e){for await(let t of e)r.write(t);return r.finish()}function xp({name:r,type:e,nullable:t}){let n=new MT.JSONTypeAssembler;return{name:r,nullable:t,type:n.visit(e),children:(e.children||[]).map(xp),dictionary:AT.DataType.isDictionary(e)?{id:e.id,isOrdered:e.isOrdered,indexType:n.visit(e.indices)}:void 0}}function PT(r,e,t=!1){let n=new FT.Field(`${e}`,r.type,r.nullCount>0),i=Rp.JSONVectorAssembler.assemble(new OT.Column(n,[r]));return JSON.stringify({id:e,isDelta:t,data:{count:r.length,columns:i}},null,2)}function NT(r){return JSON.stringify({count:r.length,columns:Rp.JSONVectorAssembler.assemble(r)},null,2)}});var qc=B(kr=>{"use strict";Object.defineProperty(kr,"__esModule",{value:!0});kr.distributeVectorsIntoRecordBatches=kr.distributeColumnsIntoRecordBatches=kr.ensureSameLengthData=void 0;var jp=wt(),kc=Re(),RT=Ir(),xT=lr(),Cc=new Uint8Array(0),Ep=r=>[Cc,Cc,new Uint8Array(r),Cc];function jT(r,e,t=e.reduce((n,i)=>Math.max(n,i.length),0)){let n,i,o=-1,a=e.length,u=[...r.fields],f=[],s=(t+63&~63)>>3;for(;++o<a;)(n=e[o])&&n.length===t?f[o]=n:((i=u[o]).nullable||(u[o]=u[o].clone({nullable:!0})),f[o]=n?n._changeLengthAndBackfillNullBitmap(t):jp.Data.new(i.type,0,t,t,Ep(s)));return[new kc.Schema(u),t,f]}kr.ensureSameLengthData=jT;function ET(r){return Lp(new kc.Schema(r.map(({field:e})=>e)),r)}kr.distributeColumnsIntoRecordBatches=ET;function Lp(r,e){return LT(r,e.map(t=>t instanceof RT.Chunked?t.chunks.map(n=>n.data):[t.data]))}kr.distributeVectorsIntoRecordBatches=Lp;function LT(r,e){let t=[...r.fields],n=[],i={numBatches:e.reduce((_,U)=>Math.max(_,U.length),0)},o=0,a=0,u=-1,f=e.length,s,c=[];for(;i.numBatches-- >0;){for(a=Number.POSITIVE_INFINITY,u=-1;++u<f;)c[u]=s=e[u].shift(),a=Math.min(a,s?s.length:a);isFinite(a)&&(c=kT(t,a,c,e,i),a>0&&(n[o++]=[a,c.slice()]))}return[r=new kc.Schema(t,r.metadata),n.map(_=>new xT.RecordBatch(r,..._))]}function kT(r,e,t,n,i){let o,a,u=0,f=-1,s=n.length,c=(e+63&~63)>>3;for(;++f<s;)(o=t[f])&&(u=o.length)>=e?u===e?t[f]=o:(t[f]=o.slice(0,e),o=o.slice(e,u-e),i.numBatches=Math.max(i.numBatches,n[f].unshift(o))):((a=r[f]).nullable||(r[f]=a.clone({nullable:!0})),t[f]=o?o._changeLengthAndBackfillNullBitmap(e):jp.Data.new(a.type,0,e,e,Ep(c)));return t}});var ve=B(Ko=>{"use strict";Object.defineProperty(Ko,"__esModule",{value:!0});Ko.BaseVector=void 0;var CT=ue(),qT=Ir(),zT=Ei(),zc=Be(),Wc=class extends zc.AbstractVector{constructor(e,t){super();this._children=t,this.numChildren=e.childData.length,this._bindDataAccessors(this.data=e)}get type(){return this.data.type}get typeId(){return this.data.typeId}get length(){return this.data.length}get offset(){return this.data.offset}get stride(){return this.data.stride}get nullCount(){return this.data.nullCount}get byteLength(){return this.data.byteLength}get VectorName(){return`${CT.Type[this.typeId]}Vector`}get ArrayType(){return this.type.ArrayType}get values(){return this.data.values}get typeIds(){return this.data.typeIds}get nullBitmap(){return this.data.nullBitmap}get valueOffsets(){return this.data.valueOffsets}get[Symbol.toStringTag](){return`${this.VectorName}<${this.type[Symbol.toStringTag]}>`}clone(e,t=this._children){return zc.Vector.new(e,t)}concat(...e){return qT.Chunked.concat(this,...e)}slice(e,t){return zT.clampRange(this,e,t,this._sliceInternal)}isValid(e){if(this.nullCount>0){let t=this.offset+e;return(this.nullBitmap[t>>3]&1<<t%8)!==0}return!0}getChildAt(e){return e<0||e>=this.numChildren?null:(this._children||(this._children=[]))[e]||(this._children[e]=zc.Vector.new(this.data.childData[e]))}toJSON(){return[...this]}_sliceInternal(e,t,n){return e.clone(e.data.slice(t,n-t),null)}_bindDataAccessors(e){}};Ko.BaseVector=Wc;Wc.prototype[Symbol.isConcatSpreadable]=!0});var Yc=B(Go=>{"use strict";Object.defineProperty(Go,"__esModule",{value:!0});Go.BinaryVector=void 0;var WT=Be(),YT=ve(),HT=re(),kp=class extends YT.BaseVector{asUtf8(){return WT.Vector.new(this.data.clone(new HT.Utf8))}};Go.BinaryVector=kp});var Hc=B(Qo=>{"use strict";Object.defineProperty(Qo,"__esModule",{value:!0});Qo.BoolVector=void 0;var $T=re(),JT=ve(),KT=Jt(),Cp=class extends JT.BaseVector{static from(e){return KT.vectorFromValuesWithType(()=>new $T.Bool,e)}};Qo.BoolVector=Cp});var Jc=B(Cr=>{"use strict";Object.defineProperty(Cr,"__esModule",{value:!0});Cr.DateMillisecondVector=Cr.DateDayVector=Cr.DateVector=void 0;var GT=ue(),QT=ve(),qp=Jt(),$c=re(),Xo=class extends QT.BaseVector{static from(...e){return e.length===2?qp.vectorFromValuesWithType(()=>e[1]===GT.DateUnit.DAY?new $c.DateDay:new $c.DateMillisecond,e[0]):qp.vectorFromValuesWithType(()=>new $c.DateMillisecond,e[0])}};Cr.DateVector=Xo;var zp=class extends Xo{};Cr.DateDayVector=zp;var Wp=class extends Xo{};Cr.DateMillisecondVector=Wp});var Kc=B(Zo=>{"use strict";Object.defineProperty(Zo,"__esModule",{value:!0});Zo.DecimalVector=void 0;var XT=ve(),Yp=class extends XT.BaseVector{};Zo.DecimalVector=Yp});var ta=B(ea=>{"use strict";Object.defineProperty(ea,"__esModule",{value:!0});ea.DictionaryVector=void 0;var ZT=wt(),Hp=Be(),eI=ve(),tI=Jt(),rI=re(),Gc=class extends eI.BaseVector{constructor(e){super(e);this.indices=Hp.Vector.new(e.clone(this.type.indices))}static from(...e){if(e.length===3){let[t,n,i]=e,o=new rI.Dictionary(t.type,n,null,null);return Hp.Vector.new(ZT.Data.Dictionary(o,0,i.length,0,null,i,t))}return tI.vectorFromValuesWithType(()=>e[0].type,e[0])}get dictionary(){return this.data.dictionary}reverseLookup(e){return this.dictionary.indexOf(e)}getKey(e){return this.indices.get(e)}getValue(e){return this.dictionary.get(e)}setKey(e,t){return this.indices.set(e,t)}setValue(e,t){return this.dictionary.set(e,t)}};ea.DictionaryVector=Gc;Gc.prototype.indices=null});var Qc=B(ra=>{"use strict";Object.defineProperty(ra,"__esModule",{value:!0});ra.FixedSizeBinaryVector=void 0;var nI=ve(),$p=class extends nI.BaseVector{};ra.FixedSizeBinaryVector=$p});var Xc=B(na=>{"use strict";Object.defineProperty(na,"__esModule",{value:!0});na.FixedSizeListVector=void 0;var iI=ve(),Jp=class extends iI.BaseVector{};na.FixedSizeListVector=Jp});var rl=B(Kt=>{"use strict";Object.defineProperty(Kt,"__esModule",{value:!0});Kt.Float64Vector=Kt.Float32Vector=Kt.Float16Vector=Kt.FloatVector=void 0;var sI=wt(),oI=Be(),aI=ve(),uI=Jt(),dn=re(),Qi=class extends aI.BaseVector{static from(e){let t=dI(this);if(e instanceof ArrayBuffer||ArrayBuffer.isView(e)){let n=lI(e.constructor)||t;if(t===null&&(t=n),t&&t===n){let i=new t,o=e.byteLength/i.ArrayType.BYTES_PER_ELEMENT;if(!cI(t,e.constructor))return oI.Vector.new(sI.Data.Float(i,0,o,0,null,e))}}if(t)return uI.vectorFromValuesWithType(()=>new t,e);throw e instanceof DataView||e instanceof ArrayBuffer?new TypeError(`Cannot infer float type from instance of ${e.constructor.name}`):new TypeError("Unrecognized FloatVector input")}};Kt.FloatVector=Qi;var Zc=class extends Qi{toFloat32Array(){return new Float32Array(this)}toFloat64Array(){return new Float64Array(this)}};Kt.Float16Vector=Zc;var el=class extends Qi{};Kt.Float32Vector=el;var tl=class extends Qi{};Kt.Float64Vector=tl;var cI=(r,e)=>r===dn.Float16&&e!==Uint16Array,lI=r=>{switch(r){case Uint16Array:return dn.Float16;case Float32Array:return dn.Float32;case Float64Array:return dn.Float64;default:return null}},dI=r=>{switch(r){case Zc:return dn.Float16;case el:return dn.Float32;case tl:return dn.Float64;default:return null}}});var nl=B(qr=>{"use strict";Object.defineProperty(qr,"__esModule",{value:!0});qr.IntervalYearMonthVector=qr.IntervalDayTimeVector=qr.IntervalVector=void 0;var fI=ve(),ia=class extends fI.BaseVector{};qr.IntervalVector=ia;var Kp=class extends ia{};qr.IntervalDayTimeVector=Kp;var Gp=class extends ia{};qr.IntervalYearMonthVector=Gp});var sa=B(De=>{"use strict";Object.defineProperty(De,"__esModule",{value:!0});De.Uint64Vector=De.Uint32Vector=De.Uint16Vector=De.Uint8Vector=De.Int64Vector=De.Int32Vector=De.Int16Vector=De.Int8Vector=De.IntVector=void 0;var hI=wt(),pI=Be(),yI=ve(),bI=Jt(),Qp=Ye(),Xp=we(),ge=re(),Gt=class extends yI.BaseVector{static from(...e){let[t,n=!1]=e,i=gI(this,n);if(t instanceof ArrayBuffer||ArrayBuffer.isView(t)){let o=_I(t.constructor,n)||i;if(i===null&&(i=o),i&&i===o){let a=new i,u=t.byteLength/a.ArrayType.BYTES_PER_ELEMENT;return mI(i,t.constructor)&&(u*=.5),pI.Vector.new(hI.Data.Int(a,0,u,0,null,t))}}if(i)return bI.vectorFromValuesWithType(()=>new i,t);throw t instanceof DataView||t instanceof ArrayBuffer?new TypeError(`Cannot infer integer type from instance of ${t.constructor.name}`):new TypeError("Unrecognized IntVector input")}};De.IntVector=Gt;var il=class extends Gt{};De.Int8Vector=il;var sl=class extends Gt{};De.Int16Vector=sl;var ol=class extends Gt{};De.Int32Vector=ol;var al=class extends Gt{toBigInt64Array(){return Xp.toBigInt64Array(this.values)}get values64(){return this._values64||(this._values64=this.toBigInt64Array())}};De.Int64Vector=al;var ul=class extends Gt{};De.Uint8Vector=ul;var cl=class extends Gt{};De.Uint16Vector=cl;var ll=class extends Gt{};De.Uint32Vector=ll;var dl=class extends Gt{toBigUint64Array(){return Xp.toBigUint64Array(this.values)}get values64(){return this._values64||(this._values64=this.toBigUint64Array())}};De.Uint64Vector=dl;var mI=(r,e)=>(r===ge.Int64||r===ge.Uint64)&&(e===Int32Array||e===Uint32Array),_I=(r,e)=>{switch(r){case Int8Array:return ge.Int8;case Int16Array:return ge.Int16;case Int32Array:return e?ge.Int64:ge.Int32;case Qp.BigInt64Array:return ge.Int64;case Uint8Array:return ge.Uint8;case Uint16Array:return ge.Uint16;case Uint32Array:return e?ge.Uint64:ge.Uint32;case Qp.BigUint64Array:return ge.Uint64;default:return null}},gI=(r,e)=>{switch(r){case il:return ge.Int8;case sl:return ge.Int16;case ol:return e?ge.Int64:ge.Int32;case al:return ge.Int64;case ul:return ge.Uint8;case cl:return ge.Uint16;case ll:return e?ge.Uint64:ge.Uint32;case dl:return ge.Uint64;default:return null}}});var fl=B(oa=>{"use strict";Object.defineProperty(oa,"__esModule",{value:!0});oa.ListVector=void 0;var BI=ve(),Zp=class extends BI.BaseVector{};oa.ListVector=Zp});var hl=B(aa=>{"use strict";Object.defineProperty(aa,"__esModule",{value:!0});aa.MapVector=void 0;var vI=xi(),wI=Be(),TI=ve(),II=re(),ey=class extends TI.BaseVector{asList(){let e=this.type.children[0];return wI.Vector.new(this.data.clone(new II.List(e)))}bind(e){let t=this.getChildAt(0),{[e]:n,[e+1]:i}=this.valueOffsets;return new vI.MapRow(t.slice(n,i))}};aa.MapVector=ey});var pl=B(ua=>{"use strict";Object.defineProperty(ua,"__esModule",{value:!0});ua.NullVector=void 0;var SI=ve(),ty=class extends SI.BaseVector{};ua.NullVector=ty});var yl=B(ca=>{"use strict";Object.defineProperty(ca,"__esModule",{value:!0});ca.StructVector=void 0;var DI=xi(),OI=ve(),AI=Symbol.for("rowIndex"),ry=class extends OI.BaseVector{bind(e){let t=this._row||(this._row=new DI.StructRow(this)),n=Object.create(t);return n[AI]=e,n}};ca.StructVector=ry});var bl=B(pt=>{"use strict";Object.defineProperty(pt,"__esModule",{value:!0});pt.TimestampNanosecondVector=pt.TimestampMicrosecondVector=pt.TimestampMillisecondVector=pt.TimestampSecondVector=pt.TimestampVector=void 0;var FI=ve(),ri=class extends FI.BaseVector{};pt.TimestampVector=ri;var ny=class extends ri{};pt.TimestampSecondVector=ny;var iy=class extends ri{};pt.TimestampMillisecondVector=iy;var sy=class extends ri{};pt.TimestampMicrosecondVector=sy;var oy=class extends ri{};pt.TimestampNanosecondVector=oy});var ml=B(yt=>{"use strict";Object.defineProperty(yt,"__esModule",{value:!0});yt.TimeNanosecondVector=yt.TimeMicrosecondVector=yt.TimeMillisecondVector=yt.TimeSecondVector=yt.TimeVector=void 0;var MI=ve(),ni=class extends MI.BaseVector{};yt.TimeVector=ni;var ay=class extends ni{};yt.TimeSecondVector=ay;var uy=class extends ni{};yt.TimeMillisecondVector=uy;var cy=class extends ni{};yt.TimeMicrosecondVector=cy;var ly=class extends ni{};yt.TimeNanosecondVector=ly});var _l=B(zr=>{"use strict";Object.defineProperty(zr,"__esModule",{value:!0});zr.SparseUnionVector=zr.DenseUnionVector=zr.UnionVector=void 0;var UI=ve(),la=class extends UI.BaseVector{get typeIdToChildIndex(){return this.data.type.typeIdToChildIndex}};zr.UnionVector=la;var dy=class extends la{get valueOffsets(){return this.data.valueOffsets}};zr.DenseUnionVector=dy;var fy=class extends la{};zr.SparseUnionVector=fy});var gl=B(da=>{"use strict";Object.defineProperty(da,"__esModule",{value:!0});da.Utf8Vector=void 0;var VI=Be(),PI=ve(),hy=re(),NI=Jt(),py=class extends PI.BaseVector{static from(e){return NI.vectorFromValuesWithType(()=>new hy.Utf8,e)}asBinary(){return VI.Vector.new(this.data.clone(new hy.Binary))}};da.Utf8Vector=py});var yy=B(Wr=>{"use strict";Object.defineProperty(Wr,"__esModule",{value:!0});Wr.partial2=Wr.partial1=Wr.partial0=void 0;function RI(r){return function(){return r(this)}}Wr.partial0=RI;function xI(r){return function(e){return r(this,e)}}Wr.partial1=xI;function jI(r){return function(e,t){return r(this,e,t)}}Wr.partial2=jI});var wl=B(ii=>{"use strict";Object.defineProperty(ii,"__esModule",{value:!0});ii.instance=ii.GetVisitor=void 0;var fa=Ri(),EI=Ce(),LI=Xr(),kI=Ui(),bt=ue(),N=class extends EI.Visitor{};ii.GetVisitor=N;var CI=(r,e)=>864e5*r[e],Bl=(r,e)=>4294967296*r[e+1]+(r[e]>>>0),qI=(r,e)=>4294967296*(r[e+1]/1e3)+(r[e]>>>0)/1e3,zI=(r,e)=>4294967296*(r[e+1]/1e6)+(r[e]>>>0)/1e6,by=r=>new Date(r),WI=(r,e)=>by(CI(r,e)),YI=(r,e)=>by(Bl(r,e)),HI=(r,e)=>null,my=(r,e,t)=>{let{[t]:n,[t+1]:i}=e;return n!=null&&i!=null?r.subarray(n,i):null},$I=({offset:r,values:e},t)=>{let n=r+t;return(e[n>>3]&1<<n%8)!=0},_y=({values:r},e)=>WI(r,e),gy=({values:r},e)=>YI(r,e*2),Qt=({stride:r,values:e},t)=>e[r*t],By=({stride:r,values:e},t)=>kI.uint16ToFloat64(e[r*t]),vl=({stride:r,values:e,type:t},n)=>fa.BN.new(e.subarray(r*n,r*(n+1)),t.isSigned),JI=({stride:r,values:e},t)=>e.subarray(r*t,r*(t+1)),KI=({values:r,valueOffsets:e},t)=>my(r,e,t),GI=({values:r,valueOffsets:e},t)=>{let n=my(r,e,t);return n!==null?LI.decodeUtf8(n):null},QI=(r,e)=>r.type.bitWidth<64?Qt(r,e):vl(r,e),XI=(r,e)=>r.type.precision!==bt.Precision.HALF?Qt(r,e):By(r,e),ZI=(r,e)=>r.type.unit===bt.DateUnit.DAY?_y(r,e):gy(r,e),vy=({values:r},e)=>1e3*Bl(r,e*2),wy=({values:r},e)=>Bl(r,e*2),Ty=({values:r},e)=>qI(r,e*2),Iy=({values:r},e)=>zI(r,e*2),e0=(r,e)=>{switch(r.type.unit){case bt.TimeUnit.SECOND:return vy(r,e);case bt.TimeUnit.MILLISECOND:return wy(r,e);case bt.TimeUnit.MICROSECOND:return Ty(r,e);case bt.TimeUnit.NANOSECOND:return Iy(r,e)}},Sy=({values:r,stride:e},t)=>r[e*t],Dy=({values:r,stride:e},t)=>r[e*t],Oy=({values:r},e)=>fa.BN.signed(r.subarray(2*e,2*(e+1))),Ay=({values:r},e)=>fa.BN.signed(r.subarray(2*e,2*(e+1))),t0=(r,e)=>{switch(r.type.unit){case bt.TimeUnit.SECOND:return Sy(r,e);case bt.TimeUnit.MILLISECOND:return Dy(r,e);case bt.TimeUnit.MICROSECOND:return Oy(r,e);case bt.TimeUnit.NANOSECOND:return Ay(r,e)}},r0=({values:r},e)=>fa.BN.decimal(r.subarray(4*e,4*(e+1))),n0=(r,e)=>{let t=r.getChildAt(0),{valueOffsets:n,stride:i}=r;return t.slice(n[e*i],n[e*i+1])},i0=(r,e)=>r.bind(e),s0=(r,e)=>r.bind(e),o0=(r,e)=>r.type.mode===bt.UnionMode.Dense?Fy(r,e):My(r,e),Fy=(r,e)=>{let t=r.typeIdToChildIndex[r.typeIds[e]],n=r.getChildAt(t);return n?n.get(r.valueOffsets[e]):null},My=(r,e)=>{let t=r.typeIdToChildIndex[r.typeIds[e]],n=r.getChildAt(t);return n?n.get(e):null},a0=(r,e)=>r.getValue(r.getKey(e)),u0=(r,e)=>r.type.unit===bt.IntervalUnit.DAY_TIME?Uy(r,e):Vy(r,e),Uy=({values:r},e)=>r.subarray(2*e,2*(e+1)),Vy=({values:r},e)=>{let t=r[e],n=new Int32Array(2);return n[0]=t/12|0,n[1]=t%12|0,n},c0=(r,e)=>{let t=r.getChildAt(0),{stride:n}=r;return t.slice(e*n,(e+1)*n)};N.prototype.visitNull=HI;N.prototype.visitBool=$I;N.prototype.visitInt=QI;N.prototype.visitInt8=Qt;N.prototype.visitInt16=Qt;N.prototype.visitInt32=Qt;N.prototype.visitInt64=vl;N.prototype.visitUint8=Qt;N.prototype.visitUint16=Qt;N.prototype.visitUint32=Qt;N.prototype.visitUint64=vl;N.prototype.visitFloat=XI;N.prototype.visitFloat16=By;N.prototype.visitFloat32=Qt;N.prototype.visitFloat64=Qt;N.prototype.visitUtf8=GI;N.prototype.visitBinary=KI;N.prototype.visitFixedSizeBinary=JI;N.prototype.visitDate=ZI;N.prototype.visitDateDay=_y;N.prototype.visitDateMillisecond=gy;N.prototype.visitTimestamp=e0;N.prototype.visitTimestampSecond=vy;N.prototype.visitTimestampMillisecond=wy;N.prototype.visitTimestampMicrosecond=Ty;N.prototype.visitTimestampNanosecond=Iy;N.prototype.visitTime=t0;N.prototype.visitTimeSecond=Sy;N.prototype.visitTimeMillisecond=Dy;N.prototype.visitTimeMicrosecond=Oy;N.prototype.visitTimeNanosecond=Ay;N.prototype.visitDecimal=r0;N.prototype.visitList=n0;N.prototype.visitStruct=s0;N.prototype.visitUnion=o0;N.prototype.visitDenseUnion=Fy;N.prototype.visitSparseUnion=My;N.prototype.visitDictionary=a0;N.prototype.visitInterval=u0;N.prototype.visitIntervalDayTime=Uy;N.prototype.visitIntervalYearMonth=Vy;N.prototype.visitFixedSizeList=c0;N.prototype.visitMap=i0;ii.instance=new N});var xy=B(si=>{"use strict";Object.defineProperty(si,"__esModule",{value:!0});si.instance=si.IndexOfVisitor=void 0;var l0=Ce(),Py=Rt(),Ny=Ei(),R=class extends l0.Visitor{};si.IndexOfVisitor=R;function d0(r,e){return e===null&&r.length>0?0:-1}function f0(r,e){let{nullBitmap:t}=r.data;if(!t||r.nullCount<=0)return-1;let n=0;for(let i of Py.iterateBits(t,r.data.offset+(e||0),r.length,t,Py.getBool)){if(!i)return n;++n}return-1}function G(r,e,t){if(e===void 0)return-1;if(e===null)return f0(r,t);let n=Ny.createElementComparator(e);for(let i=(t||0)-1,o=r.length;++i<o;)if(n(r.get(i)))return i;return-1}function Ry(r,e,t){let n=Ny.createElementComparator(e);for(let i=(t||0)-1,o=r.length;++i<o;)if(n(r.get(i)))return i;return-1}R.prototype.visitNull=d0;R.prototype.visitBool=G;R.prototype.visitInt=G;R.prototype.visitInt8=G;R.prototype.visitInt16=G;R.prototype.visitInt32=G;R.prototype.visitInt64=G;R.prototype.visitUint8=G;R.prototype.visitUint16=G;R.prototype.visitUint32=G;R.prototype.visitUint64=G;R.prototype.visitFloat=G;R.prototype.visitFloat16=G;R.prototype.visitFloat32=G;R.prototype.visitFloat64=G;R.prototype.visitUtf8=G;R.prototype.visitBinary=G;R.prototype.visitFixedSizeBinary=G;R.prototype.visitDate=G;R.prototype.visitDateDay=G;R.prototype.visitDateMillisecond=G;R.prototype.visitTimestamp=G;R.prototype.visitTimestampSecond=G;R.prototype.visitTimestampMillisecond=G;R.prototype.visitTimestampMicrosecond=G;R.prototype.visitTimestampNanosecond=G;R.prototype.visitTime=G;R.prototype.visitTimeSecond=G;R.prototype.visitTimeMillisecond=G;R.prototype.visitTimeMicrosecond=G;R.prototype.visitTimeNanosecond=G;R.prototype.visitDecimal=G;R.prototype.visitList=G;R.prototype.visitStruct=G;R.prototype.visitUnion=G;R.prototype.visitDenseUnion=Ry;R.prototype.visitSparseUnion=Ry;R.prototype.visitDictionary=G;R.prototype.visitInterval=G;R.prototype.visitIntervalDayTime=G;R.prototype.visitIntervalYearMonth=G;R.prototype.visitFixedSizeList=G;R.prototype.visitMap=G;si.instance=new R});var Tl=B(oi=>{"use strict";Object.defineProperty(oi,"__esModule",{value:!0});oi.instance=oi.IteratorVisitor=void 0;var ha=ue(),h0=Ce(),p0=Rt(),jy=wl(),x=class extends h0.Visitor{};oi.IteratorVisitor=x;function y0(r){let e=jy.instance.getVisitFn(r);return p0.iterateBits(r.data.nullBitmap,r.data.offset,r.length,r,(t,n,i,o)=>(i&1<<o)!=0?e(t,n):null)}function H(r){if(r.nullCount>0)return y0(r);let{type:e,typeId:t,length:n}=r;return r.stride===1&&(t===ha.Type.Timestamp||t===ha.Type.Int&&e.bitWidth!==64||t===ha.Type.Time&&e.bitWidth!==64||t===ha.Type.Float&&e.precision>0)?r.data.values.subarray(0,n)[Symbol.iterator]():function*(i){for(let o=-1;++o<n;)yield i(r,o)}(jy.instance.getVisitFn(r))}x.prototype.visitNull=H;x.prototype.visitBool=H;x.prototype.visitInt=H;x.prototype.visitInt8=H;x.prototype.visitInt16=H;x.prototype.visitInt32=H;x.prototype.visitInt64=H;x.prototype.visitUint8=H;x.prototype.visitUint16=H;x.prototype.visitUint32=H;x.prototype.visitUint64=H;x.prototype.visitFloat=H;x.prototype.visitFloat16=H;x.prototype.visitFloat32=H;x.prototype.visitFloat64=H;x.prototype.visitUtf8=H;x.prototype.visitBinary=H;x.prototype.visitFixedSizeBinary=H;x.prototype.visitDate=H;x.prototype.visitDateDay=H;x.prototype.visitDateMillisecond=H;x.prototype.visitTimestamp=H;x.prototype.visitTimestampSecond=H;x.prototype.visitTimestampMillisecond=H;x.prototype.visitTimestampMicrosecond=H;x.prototype.visitTimestampNanosecond=H;x.prototype.visitTime=H;x.prototype.visitTimeSecond=H;x.prototype.visitTimeMillisecond=H;x.prototype.visitTimeMicrosecond=H;x.prototype.visitTimeNanosecond=H;x.prototype.visitDecimal=H;x.prototype.visitList=H;x.prototype.visitStruct=H;x.prototype.visitUnion=H;x.prototype.visitDenseUnion=H;x.prototype.visitSparseUnion=H;x.prototype.visitDictionary=H;x.prototype.visitInterval=H;x.prototype.visitIntervalDayTime=H;x.prototype.visitIntervalYearMonth=H;x.prototype.visitFixedSizeList=H;x.prototype.visitMap=H;oi.instance=new x});var Ey=B(ai=>{"use strict";Object.defineProperty(ai,"__esModule",{value:!0});ai.instance=ai.ToArrayVisitor=void 0;var Xi=ue(),b0=Ce(),m0=Tl(),j=class extends b0.Visitor{};ai.ToArrayVisitor=j;function $(r){let{type:e,length:t,stride:n}=r;switch(e.typeId){case Xi.Type.Int:case Xi.Type.Float:case Xi.Type.Decimal:case Xi.Type.Time:case Xi.Type.Timestamp:return r.data.values.subarray(0,t*n)}return[...m0.instance.visit(r)]}j.prototype.visitNull=$;j.prototype.visitBool=$;j.prototype.visitInt=$;j.prototype.visitInt8=$;j.prototype.visitInt16=$;j.prototype.visitInt32=$;j.prototype.visitInt64=$;j.prototype.visitUint8=$;j.prototype.visitUint16=$;j.prototype.visitUint32=$;j.prototype.visitUint64=$;j.prototype.visitFloat=$;j.prototype.visitFloat16=$;j.prototype.visitFloat32=$;j.prototype.visitFloat64=$;j.prototype.visitUtf8=$;j.prototype.visitBinary=$;j.prototype.visitFixedSizeBinary=$;j.prototype.visitDate=$;j.prototype.visitDateDay=$;j.prototype.visitDateMillisecond=$;j.prototype.visitTimestamp=$;j.prototype.visitTimestampSecond=$;j.prototype.visitTimestampMillisecond=$;j.prototype.visitTimestampMicrosecond=$;j.prototype.visitTimestampNanosecond=$;j.prototype.visitTime=$;j.prototype.visitTimeSecond=$;j.prototype.visitTimeMillisecond=$;j.prototype.visitTimeMicrosecond=$;j.prototype.visitTimeNanosecond=$;j.prototype.visitDecimal=$;j.prototype.visitList=$;j.prototype.visitStruct=$;j.prototype.visitUnion=$;j.prototype.visitDenseUnion=$;j.prototype.visitSparseUnion=$;j.prototype.visitDictionary=$;j.prototype.visitInterval=$;j.prototype.visitIntervalDayTime=$;j.prototype.visitIntervalYearMonth=$;j.prototype.visitFixedSizeList=$;j.prototype.visitMap=$;ai.instance=new j});var Ly=B(ui=>{"use strict";Object.defineProperty(ui,"__esModule",{value:!0});ui.instance=ui.ByteWidthVisitor=void 0;var _0=Ce(),g0=ue(),Zi=(r,e)=>r+e,Il=r=>`Cannot compute the byte width of variable-width column ${r}`,Sl=class extends _0.Visitor{visitNull(e){return 0}visitInt(e){return e.bitWidth/8}visitFloat(e){return e.ArrayType.BYTES_PER_ELEMENT}visitBinary(e){throw new Error(Il(e))}visitUtf8(e){throw new Error(Il(e))}visitBool(e){return 1/8}visitDecimal(e){return 16}visitDate(e){return(e.unit+1)*4}visitTime(e){return e.bitWidth/8}visitTimestamp(e){return e.unit===g0.TimeUnit.SECOND?4:8}visitInterval(e){return(e.unit+1)*4}visitList(e){throw new Error(Il(e))}visitStruct(e){return this.visitFields(e.children).reduce(Zi,0)}visitUnion(e){return this.visitFields(e.children).reduce(Zi,0)}visitFixedSizeBinary(e){return e.byteWidth}visitFixedSizeList(e){return e.listSize*this.visitFields(e.children).reduce(Zi,0)}visitMap(e){return this.visitFields(e.children).reduce(Zi,0)}visitDictionary(e){return this.visit(e.indices)}visitFields(e){return(e||[]).map(t=>this.visit(t.type))}visitSchema(e){return this.visitFields(e.fields).reduce(Zi,0)}};ui.ByteWidthVisitor=Sl;ui.instance=new Sl});var ky=B(ci=>{"use strict";Object.defineProperty(ci,"__esModule",{value:!0});ci.instance=ci.GetVectorConstructor=void 0;var B0=Ce(),v0=Yc(),w0=Hc(),Dl=Jc(),T0=Kc(),I0=ta(),S0=Qc(),D0=Xc(),pa=rl(),Ol=nl(),dr=sa(),O0=fl(),A0=hl(),F0=pl(),M0=yl(),es=bl(),ts=ml(),Al=_l(),U0=gl(),Fl=class extends B0.Visitor{visitNull(){return F0.NullVector}visitBool(){return w0.BoolVector}visitInt(){return dr.IntVector}visitInt8(){return dr.Int8Vector}visitInt16(){return dr.Int16Vector}visitInt32(){return dr.Int32Vector}visitInt64(){return dr.Int64Vector}visitUint8(){return dr.Uint8Vector}visitUint16(){return dr.Uint16Vector}visitUint32(){return dr.Uint32Vector}visitUint64(){return dr.Uint64Vector}visitFloat(){return pa.FloatVector}visitFloat16(){return pa.Float16Vector}visitFloat32(){return pa.Float32Vector}visitFloat64(){return pa.Float64Vector}visitUtf8(){return U0.Utf8Vector}visitBinary(){return v0.BinaryVector}visitFixedSizeBinary(){return S0.FixedSizeBinaryVector}visitDate(){return Dl.DateVector}visitDateDay(){return Dl.DateDayVector}visitDateMillisecond(){return Dl.DateMillisecondVector}visitTimestamp(){return es.TimestampVector}visitTimestampSecond(){return es.TimestampSecondVector}visitTimestampMillisecond(){return es.TimestampMillisecondVector}visitTimestampMicrosecond(){return es.TimestampMicrosecondVector}visitTimestampNanosecond(){return es.TimestampNanosecondVector}visitTime(){return ts.TimeVector}visitTimeSecond(){return ts.TimeSecondVector}visitTimeMillisecond(){return ts.TimeMillisecondVector}visitTimeMicrosecond(){return ts.TimeMicrosecondVector}visitTimeNanosecond(){return ts.TimeNanosecondVector}visitDecimal(){return T0.DecimalVector}visitList(){return O0.ListVector}visitStruct(){return M0.StructVector}visitUnion(){return Al.UnionVector}visitDenseUnion(){return Al.DenseUnionVector}visitSparseUnion(){return Al.SparseUnionVector}visitDictionary(){return I0.DictionaryVector}visitInterval(){return Ol.IntervalVector}visitIntervalDayTime(){return Ol.IntervalDayTimeVector}visitIntervalYearMonth(){return Ol.IntervalYearMonthVector}visitFixedSizeList(){return D0.FixedSizeListVector}visitMap(){return A0.MapVector}};ci.GetVectorConstructor=Fl;ci.instance=new Fl});var Jt=B(v=>{"use strict";Object.defineProperty(v,"__esModule",{value:!0});v.vectorFromValuesWithType=v.StructRow=v.MapRow=v.Utf8Vector=v.SparseUnionVector=v.DenseUnionVector=v.UnionVector=v.TimeNanosecondVector=v.TimeMicrosecondVector=v.TimeMillisecondVector=v.TimeSecondVector=v.TimeVector=v.TimestampNanosecondVector=v.TimestampMicrosecondVector=v.TimestampMillisecondVector=v.TimestampSecondVector=v.TimestampVector=v.StructVector=v.NullVector=v.MapVector=v.ListVector=v.Uint64Vector=v.Uint32Vector=v.Uint16Vector=v.Uint8Vector=v.Int64Vector=v.Int32Vector=v.Int16Vector=v.Int8Vector=v.IntVector=v.IntervalYearMonthVector=v.IntervalDayTimeVector=v.IntervalVector=v.Float64Vector=v.Float32Vector=v.Float16Vector=v.FloatVector=v.FixedSizeListVector=v.FixedSizeBinaryVector=v.DictionaryVector=v.DecimalVector=v.DateMillisecondVector=v.DateDayVector=v.DateVector=v.Chunked=v.BoolVector=v.BinaryVector=v.BaseVector=v.Vector=void 0;var V0=Be();Object.defineProperty(v,"Vector",{enumerable:!0,get:function(){return V0.Vector}});var P0=ve();Object.defineProperty(v,"BaseVector",{enumerable:!0,get:function(){return P0.BaseVector}});var N0=Yc();Object.defineProperty(v,"BinaryVector",{enumerable:!0,get:function(){return N0.BinaryVector}});var R0=Hc();Object.defineProperty(v,"BoolVector",{enumerable:!0,get:function(){return R0.BoolVector}});var x0=Ir();Object.defineProperty(v,"Chunked",{enumerable:!0,get:function(){return x0.Chunked}});var Ml=Jc();Object.defineProperty(v,"DateVector",{enumerable:!0,get:function(){return Ml.DateVector}});Object.defineProperty(v,"DateDayVector",{enumerable:!0,get:function(){return Ml.DateDayVector}});Object.defineProperty(v,"DateMillisecondVector",{enumerable:!0,get:function(){return Ml.DateMillisecondVector}});var j0=Kc();Object.defineProperty(v,"DecimalVector",{enumerable:!0,get:function(){return j0.DecimalVector}});var E0=ta();Object.defineProperty(v,"DictionaryVector",{enumerable:!0,get:function(){return E0.DictionaryVector}});var L0=Qc();Object.defineProperty(v,"FixedSizeBinaryVector",{enumerable:!0,get:function(){return L0.FixedSizeBinaryVector}});var k0=Xc();Object.defineProperty(v,"FixedSizeListVector",{enumerable:!0,get:function(){return k0.FixedSizeListVector}});var ya=rl();Object.defineProperty(v,"FloatVector",{enumerable:!0,get:function(){return ya.FloatVector}});Object.defineProperty(v,"Float16Vector",{enumerable:!0,get:function(){return ya.Float16Vector}});Object.defineProperty(v,"Float32Vector",{enumerable:!0,get:function(){return ya.Float32Vector}});Object.defineProperty(v,"Float64Vector",{enumerable:!0,get:function(){return ya.Float64Vector}});var Ul=nl();Object.defineProperty(v,"IntervalVector",{enumerable:!0,get:function(){return Ul.IntervalVector}});Object.defineProperty(v,"IntervalDayTimeVector",{enumerable:!0,get:function(){return Ul.IntervalDayTimeVector}});Object.defineProperty(v,"IntervalYearMonthVector",{enumerable:!0,get:function(){return Ul.IntervalYearMonthVector}});var fr=sa();Object.defineProperty(v,"IntVector",{enumerable:!0,get:function(){return fr.IntVector}});Object.defineProperty(v,"Int8Vector",{enumerable:!0,get:function(){return fr.Int8Vector}});Object.defineProperty(v,"Int16Vector",{enumerable:!0,get:function(){return fr.Int16Vector}});Object.defineProperty(v,"Int32Vector",{enumerable:!0,get:function(){return fr.Int32Vector}});Object.defineProperty(v,"Int64Vector",{enumerable:!0,get:function(){return fr.Int64Vector}});Object.defineProperty(v,"Uint8Vector",{enumerable:!0,get:function(){return fr.Uint8Vector}});Object.defineProperty(v,"Uint16Vector",{enumerable:!0,get:function(){return fr.Uint16Vector}});Object.defineProperty(v,"Uint32Vector",{enumerable:!0,get:function(){return fr.Uint32Vector}});Object.defineProperty(v,"Uint64Vector",{enumerable:!0,get:function(){return fr.Uint64Vector}});var C0=fl();Object.defineProperty(v,"ListVector",{enumerable:!0,get:function(){return C0.ListVector}});var q0=hl();Object.defineProperty(v,"MapVector",{enumerable:!0,get:function(){return q0.MapVector}});var z0=pl();Object.defineProperty(v,"NullVector",{enumerable:!0,get:function(){return z0.NullVector}});var W0=yl();Object.defineProperty(v,"StructVector",{enumerable:!0,get:function(){return W0.StructVector}});var rs=bl();Object.defineProperty(v,"TimestampVector",{enumerable:!0,get:function(){return rs.TimestampVector}});Object.defineProperty(v,"TimestampSecondVector",{enumerable:!0,get:function(){return rs.TimestampSecondVector}});Object.defineProperty(v,"TimestampMillisecondVector",{enumerable:!0,get:function(){return rs.TimestampMillisecondVector}});Object.defineProperty(v,"TimestampMicrosecondVector",{enumerable:!0,get:function(){return rs.TimestampMicrosecondVector}});Object.defineProperty(v,"TimestampNanosecondVector",{enumerable:!0,get:function(){return rs.TimestampNanosecondVector}});var ns=ml();Object.defineProperty(v,"TimeVector",{enumerable:!0,get:function(){return ns.TimeVector}});Object.defineProperty(v,"TimeSecondVector",{enumerable:!0,get:function(){return ns.TimeSecondVector}});Object.defineProperty(v,"TimeMillisecondVector",{enumerable:!0,get:function(){return ns.TimeMillisecondVector}});Object.defineProperty(v,"TimeMicrosecondVector",{enumerable:!0,get:function(){return ns.TimeMicrosecondVector}});Object.defineProperty(v,"TimeNanosecondVector",{enumerable:!0,get:function(){return ns.TimeNanosecondVector}});var Vl=_l();Object.defineProperty(v,"UnionVector",{enumerable:!0,get:function(){return Vl.UnionVector}});Object.defineProperty(v,"DenseUnionVector",{enumerable:!0,get:function(){return Vl.DenseUnionVector}});Object.defineProperty(v,"SparseUnionVector",{enumerable:!0,get:function(){return Vl.SparseUnionVector}});var Y0=gl();Object.defineProperty(v,"Utf8Vector",{enumerable:!0,get:function(){return Y0.Utf8Vector}});var Cy=xi();Object.defineProperty(v,"MapRow",{enumerable:!0,get:function(){return Cy.MapRow}});Object.defineProperty(v,"StructRow",{enumerable:!0,get:function(){return Cy.StructRow}});var is=yy(),Pl=ue(),li=Be(),qy=Ir(),fn=ve(),H0=Rt(),ba=Ye(),zy=me(),Wy=wl(),Yy=Qu(),Hy=xy(),$y=Ey(),Jy=Tl(),Ky=Ly(),Gy=ky();li.Vector.new=$0;li.Vector.from=K0;function $0(r,...e){return new(Gy.instance.getVisitFn(r)())(r,...e)}function J0(r,e){if(ba.isIterable(e))return li.Vector.from({nullValues:[null,void 0],type:r(),values:e});if(ba.isAsyncIterable(e))return li.Vector.from({nullValues:[null,void 0],type:r(),values:e});let{values:t=[],type:n=r(),nullValues:i=[null,void 0]}={...e};return ba.isIterable(t)?li.Vector.from({nullValues:i,...e,type:n}):li.Vector.from({nullValues:i,...e,type:n})}v.vectorFromValuesWithType=J0;function K0(r){let{values:e=[],...t}={nullValues:[null,void 0],...r};if(ba.isIterable(e)){let n=[...zy.Builder.throughIterable(t)(e)];return n.length===1?n[0]:qy.Chunked.concat(n)}return(async n=>{let i=zy.Builder.throughAsyncIterable(t);for await(let o of i(e))n.push(o);return n.length===1?n[0]:qy.Chunked.concat(n)})([])}fn.BaseVector.prototype.get=function(e){return Wy.instance.visit(this,e)};fn.BaseVector.prototype.set=function(e,t){return Yy.instance.visit(this,e,t)};fn.BaseVector.prototype.indexOf=function(e,t){return Hy.instance.visit(this,e,t)};fn.BaseVector.prototype.toArray=function(){return $y.instance.visit(this)};fn.BaseVector.prototype.getByteWidth=function(){return Ky.instance.visit(this.type)};fn.BaseVector.prototype[Symbol.iterator]=function(){return Jy.instance.visit(this)};fn.BaseVector.prototype._bindDataAccessors=Z0;Object.keys(Pl.Type).map(r=>Pl.Type[r]).filter(r=>typeof r=="number").filter(r=>r!==Pl.Type.NONE).forEach(r=>{let e=Gy.instance.visit(r);e.prototype.get=is.partial1(Wy.instance.getVisitFn(r)),e.prototype.set=is.partial2(Yy.instance.getVisitFn(r)),e.prototype.indexOf=is.partial2(Hy.instance.getVisitFn(r)),e.prototype.toArray=is.partial0($y.instance.getVisitFn(r)),e.prototype.getByteWidth=G0(Ky.instance.getVisitFn(r)),e.prototype[Symbol.iterator]=is.partial0(Jy.instance.getVisitFn(r))});function G0(r){return function(){return r(this.type)}}function Q0(r){return function(e){return this.isValid(e)?r.call(this,e):null}}function X0(r){return function(e,t){H0.setBool(this.nullBitmap,this.offset+e,t!=null)&&r.call(this,e,t)}}function Z0(){let r=this.nullBitmap;r&&r.byteLength>0&&(this.get=Q0(this.get),this.set=X0(this.set))}});var Gi=B(ma=>{"use strict";Object.defineProperty(ma,"__esModule",{value:!0});ma.Table=void 0;var eS=kn(),Qy=Re(),Nl=lr(),tS=ss(),Rl=re(),Xy=Sr(),xl=Ye(),Zy=Jo(),eb=qc(),jl=Jt(),Ee=class extends jl.Chunked{constructor(...e){let t=null;e[0]instanceof Qy.Schema&&(t=e.shift());let n=Xy.selectArgs(Nl.RecordBatch,e);if(!t&&!(t=n[0]&&n[0].schema))throw new TypeError("Table must be initialized with a Schema or at least one RecordBatch");n[0]||(n[0]=new Nl._InternalEmptyPlaceholderRecordBatch(t));super(new Rl.Struct(t.fields),n);this._schema=t,this._chunks=n}static empty(e=new Qy.Schema([])){return new Ee(e,[])}static from(e){if(!e)return Ee.empty();if(typeof e=="object"){let n=xl.isIterable(e.values)?rS(e):xl.isAsyncIterable(e.values)?nS(e):null;if(n!==null)return n}let t=tS.RecordBatchReader.from(e);return xl.isPromise(t)?(async()=>await Ee.from(await t))():t.isSync()&&(t=t.open())?t.schema?new Ee(t.schema,[...t]):Ee.empty():(async n=>{let i=await n,o=i.schema,a=[];if(o){for await(let u of i)a.push(u);return new Ee(o,a)}return Ee.empty()})(t.open())}static async fromAsync(e){return await Ee.from(e)}static fromStruct(e){return Ee.new(e.data.childData,e.type.children)}static new(...e){return new Ee(...eb.distributeColumnsIntoRecordBatches(Xy.selectColumnArgs(e)))}get schema(){return this._schema}get length(){return this._length}get chunks(){return this._chunks}get numCols(){return this._numChildren}clone(e=this._chunks){return new Ee(this._schema,e)}getColumn(e){return this.getColumnAt(this.getColumnIndex(e))}getColumnAt(e){return this.getChildAt(e)}getColumnIndex(e){return this._schema.fields.findIndex(t=>t.name===e)}getChildAt(e){if(e<0||e>=this.numChildren)return null;let t,n,i=this._schema.fields,o=this._children||(this._children=[]);if(n=o[e])return n;if(t=i[e]){let a=this._chunks.map(u=>u.getChildAt(e)).filter(u=>u!=null);if(a.length>0)return o[e]=new eS.Column(t,a)}return null}serialize(e="binary",t=!0){return(t?Zy.RecordBatchStreamWriter:Zy.RecordBatchFileWriter).writeAll(this).toUint8Array(!0)}count(){return this._length}select(...e){let t=this._schema.fields.reduce((n,i,o)=>n.set(i.name,o),new Map);return this.selectAt(...e.map(n=>t.get(n)).filter(n=>n>-1))}selectAt(...e){let t=this._schema.selectAt(...e);return new Ee(t,this._chunks.map(({length:n,data:{childData:i}})=>new Nl.RecordBatch(t,n,e.map(o=>i[o]).filter(Boolean))))}assign(e){let t=this._schema.fields,[n,i]=e.schema.fields.reduce((u,f,s)=>{let[c,_]=u,U=t.findIndex(J=>J.name===f.name);return~U?_[U]=s:c.push(s),u},[[],[]]),o=this._schema.assign(e.schema),a=[...t.map((u,f,s,c=i[f])=>c===void 0?this.getColumnAt(f):e.getColumnAt(c)),...n.map(u=>e.getColumnAt(u))].filter(Boolean);return new Ee(...eb.distributeVectorsIntoRecordBatches(o,a))}};ma.Table=Ee;function rS(r){let{type:e}=r;return e instanceof Rl.Struct?Ee.fromStruct(jl.StructVector.from(r)):null}function nS(r){let{type:e}=r;return e instanceof Rl.Struct?jl.StructVector.from(r).then(t=>Ee.fromStruct(t)):null}});var lr=B(di=>{"use strict";Object.defineProperty(di,"__esModule",{value:!0});di._InternalEmptyPlaceholderRecordBatch=di.RecordBatch=void 0;var El=wt(),Ll=Gi(),iS=Be(),sS=Ce(),oS=Re(),aS=Ye(),uS=Ir(),cS=Sr(),kl=re(),lS=qc(),dS=Jt(),Yr=class extends dS.StructVector{constructor(...e){let t,n=e[0],i;if(e[1]instanceof El.Data)[,t,i]=e;else{let o=n.fields,[,a,u]=e;t=El.Data.Struct(new kl.Struct(o),0,a,0,null,u)}super(t,i);this._schema=n}static from(e){return aS.isIterable(e.values),Ll.Table.from(e)}static new(...e){let[t,n]=cS.selectFieldArgs(e),i=n.filter(o=>o instanceof iS.Vector);return new Yr(...lS.ensureSameLengthData(new oS.Schema(t),i.map(o=>o.data)))}clone(e,t=this._children){return new Yr(this._schema,e,t)}concat(...e){let t=this._schema,n=uS.Chunked.flatten(this,...e);return new Ll.Table(t,n.map(({data:i})=>new Yr(t,i)))}get schema(){return this._schema}get numCols(){return this._schema.fields.length}get dictionaries(){return this._dictionaries||(this._dictionaries=_a.collect(this))}select(...e){let t=this._schema.fields.reduce((n,i,o)=>n.set(i.name,o),new Map);return this.selectAt(...e.map(n=>t.get(n)).filter(n=>n>-1))}selectAt(...e){let t=this._schema.selectAt(...e),n=e.map(i=>this.data.childData[i]).filter(Boolean);return new Yr(t,this.length,n)}};di.RecordBatch=Yr;var tb=class extends Yr{constructor(e){super(e,0,e.fields.map(t=>El.Data.new(t.type,0,0,0)))}};di._InternalEmptyPlaceholderRecordBatch=tb;var _a=class extends sS.Visitor{constructor(){super(...arguments);this.dictionaries=new Map}static collect(e){return new _a().visit(e.data,new kl.Struct(e.schema.fields)).dictionaries}visit(e,t){return kl.DataType.isDictionary(t)?this.visitDictionary(e,t):(e.childData.forEach((n,i)=>this.visit(n,t.children[i].type)),this)}visitDictionary(e,t){let n=e.dictionary;return n&&n.length>0&&this.dictionaries.set(t.id,n),this}}});var ss=B(gt=>{"use strict";Object.defineProperty(gt,"__esModule",{value:!0});gt.AsyncRecordBatchFileReader=gt.RecordBatchFileReader=gt.AsyncRecordBatchStreamReader=gt.RecordBatchStreamReader=gt.RecordBatchReader=void 0;var rb=Be(),ga=ue(),nb=cc(),ib=Si(),sb=Pr(),os=fc(),ob=Zh(),Cl=lr(),hn=In(),mt=Eo(),_t=Ye(),Xt=class extends hn.ReadableInterop{constructor(e){super();this._impl=e}get closed(){return this._impl.closed}get schema(){return this._impl.schema}get autoDestroy(){return this._impl.autoDestroy}get dictionaries(){return this._impl.dictionaries}get numDictionaries(){return this._impl.numDictionaries}get numRecordBatches(){return this._impl.numRecordBatches}get footer(){return this._impl.isFile()?this._impl.footer:null}isSync(){return this._impl.isSync()}isAsync(){return this._impl.isAsync()}isFile(){return this._impl.isFile()}isStream(){return this._impl.isStream()}next(){return this._impl.next()}throw(e){return this._impl.throw(e)}return(e){return this._impl.return(e)}cancel(){return this._impl.cancel()}reset(e){return this._impl.reset(e),this._DOMStream=void 0,this._nodeStream=void 0,this}open(e){let t=this._impl.open(e);return _t.isPromise(t)?t.then(()=>this):this}readRecordBatch(e){return this._impl.isFile()?this._impl.readRecordBatch(e):null}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}toDOMStream(){return ib.default.toDOMStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this})}toNodeStream(){return ib.default.toNodeStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this},{objectMode:!0})}static throughNode(e){throw new Error('"throughNode" not available in this environment')}static throughDOM(e,t){throw new Error('"throughDOM" not available in this environment')}static from(e){return e instanceof Xt?e:_t.isArrowJSON(e)?fS(e):_t.isFileHandle(e)?yS(e):_t.isPromise(e)?(async()=>await Xt.from(await e))():_t.isFetchResponse(e)||_t.isReadableDOMStream(e)||_t.isReadableNodeStream(e)||_t.isAsyncIterable(e)?pS(new sb.AsyncByteStream(e)):hS(new sb.ByteStream(e))}static readAll(e){return e instanceof Xt?e.isSync()?lb(e):db(e):_t.isArrowJSON(e)||ArrayBuffer.isView(e)||_t.isIterable(e)||_t.isIteratorResult(e)?lb(e):db(e)}};gt.RecordBatchReader=Xt;var fi=class extends Xt{constructor(e){super(e);this._impl=e}[Symbol.iterator](){return this._impl[Symbol.iterator]()}async*[Symbol.asyncIterator](){yield*this[Symbol.iterator]()}};gt.RecordBatchStreamReader=fi;var hi=class extends Xt{constructor(e){super(e);this._impl=e}[Symbol.iterator](){throw new Error("AsyncRecordBatchStreamReader is not Iterable")}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}};gt.AsyncRecordBatchStreamReader=hi;var Ba=class extends fi{constructor(e){super(e);this._impl=e}};gt.RecordBatchFileReader=Ba;var ql=class extends hi{constructor(e){super(e);this._impl=e}};gt.AsyncRecordBatchFileReader=ql;var zl=class{constructor(e=new Map){this.closed=!1,this.autoDestroy=!0,this._dictionaryIndex=0,this._recordBatchIndex=0,this.dictionaries=e}get numDictionaries(){return this._dictionaryIndex}get numRecordBatches(){return this._recordBatchIndex}isSync(){return!1}isAsync(){return!1}isFile(){return!1}isStream(){return!1}reset(e){return this._dictionaryIndex=0,this._recordBatchIndex=0,this.schema=e,this.dictionaries=new Map,this}_loadRecordBatch(e,t){return new Cl.RecordBatch(this.schema,e.length,this._loadVectors(e,t,this.schema.fields))}_loadDictionaryBatch(e,t){let{id:n,isDelta:i,data:o}=e,{dictionaries:a,schema:u}=this,f=a.get(n);if(i||!f){let s=u.dictionaries.get(n);return f&&i?f.concat(rb.Vector.new(this._loadVectors(o,t,[s])[0])):rb.Vector.new(this._loadVectors(o,t,[s])[0])}return f}_loadVectors(e,t,n){return new ob.VectorLoader(t,e.nodes,e.buffers,this.dictionaries).visitMany(n)}},as=class extends zl{constructor(e,t){super(t);this._reader=_t.isArrowJSON(e)?new mt.JSONMessageReader(this._handle=e):new mt.MessageReader(this._handle=e)}isSync(){return!0}isStream(){return!0}[Symbol.iterator](){return this}cancel(){!this.closed&&(this.closed=!0)&&(this.reset()._reader.return(),this._reader=null,this.dictionaries=null)}open(e){return this.closed||(this.autoDestroy=cb(this,e),this.schema||(this.schema=this._reader.readSchema())||this.cancel()),this}throw(e){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.throw(e):hn.ITERATOR_DONE}return(e){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.return(e):hn.ITERATOR_DONE}next(){if(this.closed)return hn.ITERATOR_DONE;let e,{_reader:t}=this;for(;e=this._readNextMessageAndValidate();)if(e.isSchema())this.reset(e.header());else if(e.isRecordBatch()){this._recordBatchIndex++;let n=e.header(),i=t.readMessageBody(e.bodyLength),o=this._loadRecordBatch(n,i);return{done:!1,value:o}}else if(e.isDictionaryBatch()){this._dictionaryIndex++;let n=e.header(),i=t.readMessageBody(e.bodyLength),o=this._loadDictionaryBatch(n,i);this.dictionaries.set(n.id,o)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new Cl._InternalEmptyPlaceholderRecordBatch(this.schema)}):this.return()}_readNextMessageAndValidate(e){return this._reader.readMessage(e)}},us=class extends zl{constructor(e,t){super(t);this._reader=new mt.AsyncMessageReader(this._handle=e)}isAsync(){return!0}isStream(){return!0}[Symbol.asyncIterator](){return this}async cancel(){!this.closed&&(this.closed=!0)&&(await this.reset()._reader.return(),this._reader=null,this.dictionaries=null)}async open(e){return this.closed||(this.autoDestroy=cb(this,e),this.schema||(this.schema=await this._reader.readSchema())||await this.cancel()),this}async throw(e){return!this.closed&&this.autoDestroy&&(this.closed=!0)?await this.reset()._reader.throw(e):hn.ITERATOR_DONE}async return(e){return!this.closed&&this.autoDestroy&&(this.closed=!0)?await this.reset()._reader.return(e):hn.ITERATOR_DONE}async next(){if(this.closed)return hn.ITERATOR_DONE;let e,{_reader:t}=this;for(;e=await this._readNextMessageAndValidate();)if(e.isSchema())await this.reset(e.header());else if(e.isRecordBatch()){this._recordBatchIndex++;let n=e.header(),i=await t.readMessageBody(e.bodyLength),o=this._loadRecordBatch(n,i);return{done:!1,value:o}}else if(e.isDictionaryBatch()){this._dictionaryIndex++;let n=e.header(),i=await t.readMessageBody(e.bodyLength),o=this._loadDictionaryBatch(n,i);this.dictionaries.set(n.id,o)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new Cl._InternalEmptyPlaceholderRecordBatch(this.schema)}):await this.return()}async _readNextMessageAndValidate(e){return await this._reader.readMessage(e)}},Wl=class extends as{constructor(e,t){super(e instanceof os.RandomAccessFile?e:new os.RandomAccessFile(e),t)}get footer(){return this._footer}get numDictionaries(){return this._footer?this._footer.numDictionaries:0}get numRecordBatches(){return this._footer?this._footer.numRecordBatches:0}isSync(){return!0}isFile(){return!0}open(e){if(!this.closed&&!this._footer){this.schema=(this._footer=this._readFooter()).schema;for(let t of this._footer.dictionaryBatches())t&&this._readDictionaryBatch(this._dictionaryIndex++)}return super.open(e)}readRecordBatch(e){if(this.closed)return null;this._footer||this.open();let t=this._footer&&this._footer.getRecordBatch(e);if(t&&this._handle.seek(t.offset)){let n=this._reader.readMessage(ga.MessageHeader.RecordBatch);if(n&&n.isRecordBatch()){let i=n.header(),o=this._reader.readMessageBody(n.bodyLength);return this._loadRecordBatch(i,o)}}return null}_readDictionaryBatch(e){let t=this._footer&&this._footer.getDictionaryBatch(e);if(t&&this._handle.seek(t.offset)){let n=this._reader.readMessage(ga.MessageHeader.DictionaryBatch);if(n&&n.isDictionaryBatch()){let i=n.header(),o=this._reader.readMessageBody(n.bodyLength),a=this._loadDictionaryBatch(i,o);this.dictionaries.set(i.id,a)}}}_readFooter(){let{_handle:e}=this,t=e.size-mt.magicAndPadding,n=e.readInt32(t),i=e.readAt(t-n,n);return nb.Footer.decode(i)}_readNextMessageAndValidate(e){if(this._footer||this.open(),this._footer&&this._recordBatchIndex<this.numRecordBatches){let t=this._footer&&this._footer.getRecordBatch(this._recordBatchIndex);if(t&&this._handle.seek(t.offset))return this._reader.readMessage(e)}return null}},ab=class extends us{constructor(e,...t){let n=typeof t[0]!="number"?t.shift():void 0,i=t[0]instanceof Map?t.shift():void 0;super(e instanceof os.AsyncRandomAccessFile?e:new os.AsyncRandomAccessFile(e,n),i)}get footer(){return this._footer}get numDictionaries(){return this._footer?this._footer.numDictionaries:0}get numRecordBatches(){return this._footer?this._footer.numRecordBatches:0}isFile(){return!0}isAsync(){return!0}async open(e){if(!this.closed&&!this._footer){this.schema=(this._footer=await this._readFooter()).schema;for(let t of this._footer.dictionaryBatches())t&&await this._readDictionaryBatch(this._dictionaryIndex++)}return await super.open(e)}async readRecordBatch(e){if(this.closed)return null;this._footer||await this.open();let t=this._footer&&this._footer.getRecordBatch(e);if(t&&await this._handle.seek(t.offset)){let n=await this._reader.readMessage(ga.MessageHeader.RecordBatch);if(n&&n.isRecordBatch()){let i=n.header(),o=await this._reader.readMessageBody(n.bodyLength);return this._loadRecordBatch(i,o)}}return null}async _readDictionaryBatch(e){let t=this._footer&&this._footer.getDictionaryBatch(e);if(t&&await this._handle.seek(t.offset)){let n=await this._reader.readMessage(ga.MessageHeader.DictionaryBatch);if(n&&n.isDictionaryBatch()){let i=n.header(),o=await this._reader.readMessageBody(n.bodyLength),a=this._loadDictionaryBatch(i,o);this.dictionaries.set(i.id,a)}}}async _readFooter(){let{_handle:e}=this;e._pending&&await e._pending;let t=e.size-mt.magicAndPadding,n=await e.readInt32(t),i=await e.readAt(t-n,n);return nb.Footer.decode(i)}async _readNextMessageAndValidate(e){if(this._footer||await this.open(),this._footer&&this._recordBatchIndex<this.numRecordBatches){let t=this._footer.getRecordBatch(this._recordBatchIndex);if(t&&await this._handle.seek(t.offset))return await this._reader.readMessage(e)}return null}},ub=class extends as{constructor(e,t){super(e,t)}_loadVectors(e,t,n){return new ob.JSONVectorLoader(t,e.nodes,e.buffers,this.dictionaries).visitMany(n)}};function cb(r,e){return e&&typeof e.autoDestroy=="boolean"?e.autoDestroy:r.autoDestroy}function*lb(r){let e=Xt.from(r);try{if(!e.open({autoDestroy:!1}).closed)do yield e;while(!e.reset().open().closed)}finally{e.cancel()}}async function*db(r){let e=await Xt.from(r);try{if(!(await e.open({autoDestroy:!1})).closed)do yield e;while(!(await e.reset().open()).closed)}finally{await e.cancel()}}function fS(r){return new fi(new ub(r))}function hS(r){let e=r.peek(mt.magicLength+7&~7);return e&&e.byteLength>=4?mt.checkForMagicArrowString(e)?new Ba(new Wl(r.read())):new fi(new as(r)):new fi(new as(function*(){}()))}async function pS(r){let e=await r.peek(mt.magicLength+7&~7);return e&&e.byteLength>=4?mt.checkForMagicArrowString(e)?new Ba(new Wl(await r.read())):new hi(new us(r)):new hi(new us(async function*(){}()))}async function yS(r){let{size:e}=await r.stat(),t=new os.AsyncRandomAccessFile(r,e);return e>=mt.magicX2AndPadding&&mt.checkForMagicArrowString(await t.readAt(0,mt.magicLength+7&~7))?new ql(new ab(t)):new hi(new us(t))}});var pb=B(va=>{"use strict";Object.defineProperty(va,"__esModule",{value:!0});va.toDOMStream=void 0;var fb=we(),hb=Ye();function bS(r,e){if(hb.isAsyncIterable(r))return _S(r,e);if(hb.isIterable(r))return mS(r,e);throw new Error("toDOMStream() must be called with an Iterable or AsyncIterable")}va.toDOMStream=bS;function mS(r,e){let t=null,n=e&&e.type==="bytes"||!1,i=e&&e.highWaterMark||2**24;return new ReadableStream({...e,start(a){o(a,t||(t=r[Symbol.iterator]()))},pull(a){t?o(a,t):a.close()},cancel(){(t&&t.return&&t.return()||!0)&&(t=null)}},{highWaterMark:n?i:void 0,...e});function o(a,u){let f,s=null,c=a.desiredSize||null;for(;!(s=u.next(n?c:null)).done;)if(ArrayBuffer.isView(s.value)&&(f=fb.toUint8Array(s.value))&&(c!=null&&n&&(c=c-f.byteLength+1),s.value=f),a.enqueue(s.value),c!=null&&--c<=0)return;a.close()}}function _S(r,e){let t=null,n=e&&e.type==="bytes"||!1,i=e&&e.highWaterMark||2**24;return new ReadableStream({...e,async start(a){await o(a,t||(t=r[Symbol.asyncIterator]()))},async pull(a){t?await o(a,t):a.close()},async cancel(){(t&&t.return&&await t.return()||!0)&&(t=null)}},{highWaterMark:n?i:void 0,...e});async function o(a,u){let f,s=null,c=a.desiredSize||null;for(;!(s=await u.next(n?c:null)).done;)if(ArrayBuffer.isView(s.value)&&(f=fb.toUint8Array(s.value))&&(c!=null&&n&&(c=c-f.byteLength+1),s.value=f),a.enqueue(s.value),c!=null&&--c<=0)return;a.close()}}});var mb=B(pi=>{"use strict";Object.defineProperty(pi,"__esModule",{value:!0});pi.BuilderTransform=pi.builderThroughDOMStream=void 0;var gS=So();function BS(r){return new Yl(r)}pi.builderThroughDOMStream=BS;var Yl=class{constructor(e){this._numChunks=0,this._finished=!1,this._bufferedSize=0;let{["readableStrategy"]:t,["writableStrategy"]:n,["queueingStrategy"]:i="count",...o}=e;this._controller=null,this._builder=gS.Builder.new(o),this._getSize=i!=="bytes"?yb:bb;let{["highWaterMark"]:a=i==="bytes"?2**14:1e3}={...t},{["highWaterMark"]:u=i==="bytes"?2**14:1e3}={...n};this.readable=new ReadableStream({cancel:()=>{this._builder.clear()},pull:f=>{this._maybeFlush(this._builder,this._controller=f)},start:f=>{this._maybeFlush(this._builder,this._controller=f)}},{highWaterMark:a,size:i!=="bytes"?yb:bb}),this.writable=new WritableStream({abort:()=>{this._builder.clear()},write:()=>{this._maybeFlush(this._builder,this._controller)},close:()=>{this._maybeFlush(this._builder.finish(),this._controller)}},{highWaterMark:u,size:f=>this._writeValueAndReturnChunkSize(f)})}_writeValueAndReturnChunkSize(e){let t=this._bufferedSize;return this._bufferedSize=this._getSize(this._builder.append(e)),this._bufferedSize-t}_maybeFlush(e,t){t!==null&&(this._bufferedSize>=t.desiredSize&&++this._numChunks&&this._enqueue(t,e.toVector()),e.finished&&((e.length>0||this._numChunks===0)&&++this._numChunks&&this._enqueue(t,e.toVector()),!this._finished&&(this._finished=!0)&&this._enqueue(t,null)))}_enqueue(e,t){this._bufferedSize=0,this._controller=null,t===null?e.close():e.enqueue(t)}};pi.BuilderTransform=Yl;var yb=r=>r.length,bb=r=>r.byteLength});var _b=B(wa=>{"use strict";Object.defineProperty(wa,"__esModule",{value:!0});wa.recordBatchReaderThroughDOMStream=void 0;var vS=Pr(),wS=ss();function TS(r,e){let t=new vS.AsyncByteQueue,n=null,i=new ReadableStream({async cancel(){await t.close()},async start(u){await a(u,n||(n=await o()))},async pull(u){n?await a(u,n):u.close()}});return{writable:new WritableStream(t,{highWaterMark:2**14,...r}),readable:i};async function o(){return await(await wS.RecordBatchReader.from(t)).open(e)}async function a(u,f){let s=u.desiredSize,c=null;for(;!(c=await f.next()).done;)if(u.enqueue(c.value),s!=null&&--s<=0)return;u.close()}}wa.recordBatchReaderThroughDOMStream=TS});var gb=B(Ta=>{"use strict";Object.defineProperty(Ta,"__esModule",{value:!0});Ta.recordBatchWriterThroughDOMStream=void 0;var IS=Pr();function SS(r,e){let t=new this(r),n=new IS.AsyncByteStream(t),i=new ReadableStream({type:"bytes",async cancel(){await n.cancel()},async pull(a){await o(a)},async start(a){await o(a)}},{highWaterMark:2**14,...e});return{writable:new WritableStream(t,r),readable:i};async function o(a){let u=null,f=a.desiredSize;for(;u=await n.read(f||null);)if(a.enqueue(u),f!=null&&(f-=u.byteLength)<=0)return;a.close()}}Ta.recordBatchWriterThroughDOMStream=SS});var Ql=B(Q=>{"use strict";Object.defineProperty(Q,"__esModule",{value:!0});Q.custom=Q.or=Q.and=Q.col=Q.lit=Q.CustomPredicate=Q.Not=Q.GTeq=Q.LTeq=Q.Equals=Q.Or=Q.And=Q.CombinationPredicate=Q.ComparisonPredicate=Q.Predicate=Q.Col=Q.Literal=Q.Value=void 0;var DS=ta(),Hr=class{eq(e){return e instanceof Hr||(e=new hr(e)),new $l(this,e)}le(e){return e instanceof Hr||(e=new hr(e)),new Jl(this,e)}ge(e){return e instanceof Hr||(e=new hr(e)),new Kl(this,e)}lt(e){return new _i(this.ge(e))}gt(e){return new _i(this.le(e))}ne(e){return new _i(this.eq(e))}};Q.Value=Hr;var hr=class extends Hr{constructor(e){super();this.v=e}};Q.Literal=hr;var Hl=class extends Hr{constructor(e){super();this.name=e}bind(e){if(!this.colidx){this.colidx=-1;let n=e.schema.fields;for(let i=-1;++i<n.length;)if(n[i].name===this.name){this.colidx=i;break}if(this.colidx<0)throw new Error(`Failed to bind Col "${this.name}"`)}let t=this.vector=e.getChildAt(this.colidx);return n=>t.get(n)}};Q.Col=Hl;var yi=class{and(...e){return new bi(this,...e)}or(...e){return new mi(this,...e)}not(){return new _i(this)}};Q.Predicate=yi;var cs=class extends yi{constructor(e,t){super();this.left=e,this.right=t}bind(e){return this.left instanceof hr?this.right instanceof hr?this._bindLitLit(e,this.left,this.right):this._bindLitCol(e,this.left,this.right):this.right instanceof hr?this._bindColLit(e,this.left,this.right):this._bindColCol(e,this.left,this.right)}};Q.ComparisonPredicate=cs;var ls=class extends yi{constructor(...e){super();this.children=e}};Q.CombinationPredicate=ls;ls.prototype.children=Object.freeze([]);var bi=class extends ls{constructor(...e){e=e.reduce((t,n)=>t.concat(n instanceof bi?n.children:n),[]);super(...e)}bind(e){let t=this.children.map(n=>n.bind(e));return(n,i)=>t.every(o=>o(n,i))}};Q.And=bi;var mi=class extends ls{constructor(...e){e=e.reduce((t,n)=>t.concat(n instanceof mi?n.children:n),[]);super(...e)}bind(e){let t=this.children.map(n=>n.bind(e));return(n,i)=>t.some(o=>o(n,i))}};Q.Or=mi;var $l=class extends cs{_bindLitLit(e,t,n){let i=t.v==n.v;return()=>i}_bindColCol(e,t,n){let i=t.bind(e),o=n.bind(e);return(a,u)=>i(a,u)==o(a,u)}_bindColLit(e,t,n){let i=t.bind(e);if(t.vector instanceof DS.DictionaryVector){let o,a=t.vector;return a.dictionary!==this.lastDictionary?(o=a.reverseLookup(n.v),this.lastDictionary=a.dictionary,this.lastKey=o):o=this.lastKey,o===-1?()=>!1:u=>a.getKey(u)===o}else return(o,a)=>i(o,a)==n.v}_bindLitCol(e,t,n){return this._bindColLit(e,n,t)}};Q.Equals=$l;var Jl=class extends cs{_bindLitLit(e,t,n){let i=t.v<=n.v;return()=>i}_bindColCol(e,t,n){let i=t.bind(e),o=n.bind(e);return(a,u)=>i(a,u)<=o(a,u)}_bindColLit(e,t,n){let i=t.bind(e);return(o,a)=>i(o,a)<=n.v}_bindLitCol(e,t,n){let i=n.bind(e);return(o,a)=>t.v<=i(o,a)}};Q.LTeq=Jl;var Kl=class extends cs{_bindLitLit(e,t,n){let i=t.v>=n.v;return()=>i}_bindColCol(e,t,n){let i=t.bind(e),o=n.bind(e);return(a,u)=>i(a,u)>=o(a,u)}_bindColLit(e,t,n){let i=t.bind(e);return(o,a)=>i(o,a)>=n.v}_bindLitCol(e,t,n){let i=n.bind(e);return(o,a)=>t.v>=i(o,a)}};Q.GTeq=Kl;var _i=class extends yi{constructor(e){super();this.child=e}bind(e){let t=this.child.bind(e);return(n,i)=>!t(n,i)}};Q.Not=_i;var Gl=class extends yi{constructor(e,t){super();this.next=e,this.bind_=t}bind(e){return this.bind_(e),this.next}};Q.CustomPredicate=Gl;function OS(r){return new hr(r)}Q.lit=OS;function AS(r){return new Hl(r)}Q.col=AS;function FS(...r){return new bi(...r)}Q.and=FS;function MS(...r){return new mi(...r)}Q.or=MS;function US(r,e){return new Gl(r,e)}Q.custom=US});var Tb=B($r=>{"use strict";Object.defineProperty($r,"__esModule",{value:!0});$r.FilteredDataFrame=$r.CountByResult=$r.DataFrame=void 0;var gi=Gi(),Bb=sa(),Xl=Re(),vb=Ql(),VS=lr(),wb=re();gi.Table.prototype.countBy=function(r){return new pn(this.chunks).countBy(r)};gi.Table.prototype.scan=function(r,e){return new pn(this.chunks).scan(r,e)};gi.Table.prototype.scanReverse=function(r,e){return new pn(this.chunks).scanReverse(r,e)};gi.Table.prototype.filter=function(r){return new pn(this.chunks).filter(r)};var pn=class extends gi.Table{filter(e){return new ds(this.chunks,e)}scan(e,t){let n=this.chunks,i=n.length;for(let o=-1;++o<i;){let a=n[o];t&&t(a);for(let u=-1,f=a.length;++u<f;)e(u,a)}}scanReverse(e,t){let n=this.chunks,i=n.length;for(let o=i;--o>=0;){let a=n[o];t&&t(a);for(let u=a.length;--u>=0;)e(u,a)}}countBy(e){let t=this.chunks,n=t.length,i=typeof e=="string"?new vb.Col(e):e;i.bind(t[n-1]);let o=i.vector;if(!wb.DataType.isDictionary(o.type))throw new Error("countBy currently only supports dictionary-encoded columns");let a=Math.ceil(Math.log(o.length)/Math.log(256)),u=a==4?Uint32Array:a>=2?Uint16Array:Uint8Array,f=new u(o.dictionary.length);for(let s=-1;++s<n;){let c=t[s];i.bind(c);let _=i.vector.indices;for(let U=-1,J=c.length;++U<J;){let Qe=_.get(U);Qe!==null&&f[Qe]++}}return new Ia(o.dictionary,Bb.IntVector.from(f))}};$r.DataFrame=pn;var Ia=class extends gi.Table{constructor(e,t){let n=new Xl.Schema([new Xl.Field("values",e.type),new Xl.Field("counts",t.type)]);super(new VS.RecordBatch(n,t.length,[e,t]))}toJSON(){let e=this.getColumnAt(0),t=this.getColumnAt(1),n={};for(let i=-1;++i<this.length;)n[e.get(i)]=t.get(i);return n}};$r.CountByResult=Ia;var ds=class extends pn{constructor(e,t){super(e);this._predicate=t}scan(e,t){let n=this._chunks,i=n.length;for(let o=-1;++o<i;){let a=n[o],u=this._predicate.bind(a),f=!1;for(let s=-1,c=a.length;++s<c;)u(s,a)&&(t&&!f&&(t(a),f=!0),e(s,a))}}scanReverse(e,t){let n=this._chunks,i=n.length;for(let o=i;--o>=0;){let a=n[o],u=this._predicate.bind(a),f=!1;for(let s=a.length;--s>=0;)u(s,a)&&(t&&!f&&(t(a),f=!0),e(s,a))}}count(){let e=0,t=this._chunks,n=t.length;for(let i=-1;++i<n;){let o=t[i],a=this._predicate.bind(o);for(let u=-1,f=o.length;++u<f;)a(u,o)&&++e}return e}*[Symbol.iterator](){let e=this._chunks,t=e.length;for(let n=-1;++n<t;){let i=e[n],o=this._predicate.bind(i);for(let a=-1,u=i.length;++a<u;)o(a,i)&&(yield i.get(a))}}filter(e){return new ds(this._chunks,this._predicate.and(e))}countBy(e){let t=this._chunks,n=t.length,i=typeof e=="string"?new vb.Col(e):e;i.bind(t[n-1]);let o=i.vector;if(!wb.DataType.isDictionary(o.type))throw new Error("countBy currently only supports dictionary-encoded columns");let a=Math.ceil(Math.log(o.length)/Math.log(256)),u=a==4?Uint32Array:a>=2?Uint16Array:Uint8Array,f=new u(o.dictionary.length);for(let s=-1;++s<n;){let c=t[s],_=this._predicate.bind(c);i.bind(c);let U=i.vector.indices;for(let J=-1,Qe=c.length;++J<Qe;){let Ft=U.get(J);Ft!==null&&_(J,c)&&f[Ft]++}}return new Ia(o.dictionary,Bb.IntVector.from(f))}};$r.FilteredDataFrame=ds});var Sb=B(l=>{"use strict";Object.defineProperty(l,"__esModule",{value:!0});l.util=l.predicate=l.CountByResult=l.FilteredDataFrame=l.DataFrame=l.RecordBatch=l.Message=l.JSONMessageReader=l.AsyncMessageReader=l.MessageReader=l.RecordBatchJSONWriter=l.RecordBatchStreamWriter=l.RecordBatchFileWriter=l.RecordBatchWriter=l.AsyncRecordBatchStreamReader=l.AsyncRecordBatchFileReader=l.RecordBatchStreamReader=l.RecordBatchFileReader=l.RecordBatchReader=l.AsyncByteQueue=l.AsyncByteStream=l.ByteStream=l.Utf8Builder=l.SparseUnionBuilder=l.DenseUnionBuilder=l.UnionBuilder=l.TimeNanosecondBuilder=l.TimeMicrosecondBuilder=l.TimeMillisecondBuilder=l.TimeSecondBuilder=l.TimeBuilder=l.TimestampNanosecondBuilder=l.TimestampMicrosecondBuilder=l.TimestampMillisecondBuilder=l.TimestampSecondBuilder=l.TimestampBuilder=l.StructBuilder=l.NullBuilder=l.MapBuilder=l.ListBuilder=l.Uint64Builder=l.Uint32Builder=l.Uint16Builder=l.Uint8Builder=l.Int64Builder=l.Int32Builder=l.Int16Builder=l.Int8Builder=l.IntBuilder=l.IntervalYearMonthBuilder=l.IntervalDayTimeBuilder=l.IntervalBuilder=l.Float64Builder=l.Float32Builder=l.Float16Builder=l.FloatBuilder=l.FixedSizeListBuilder=l.FixedSizeBinaryBuilder=l.DictionaryBuilder=l.DecimalBuilder=l.DateMillisecondBuilder=l.DateDayBuilder=l.DateBuilder=l.BoolBuilder=l.BinaryBuilder=l.Builder=l.Utf8Vector=l.SparseUnionVector=l.DenseUnionVector=l.UnionVector=l.TimeNanosecondVector=l.TimeMicrosecondVector=l.TimeMillisecondVector=l.TimeSecondVector=l.TimeVector=l.TimestampNanosecondVector=l.TimestampMicrosecondVector=l.TimestampMillisecondVector=l.TimestampSecondVector=l.TimestampVector=l.StructVector=l.NullVector=l.MapVector=l.ListVector=l.Uint64Vector=l.Uint32Vector=l.Uint16Vector=l.Uint8Vector=l.Int64Vector=l.Int32Vector=l.Int16Vector=l.Int8Vector=l.IntVector=l.IntervalYearMonthVector=l.IntervalDayTimeVector=l.IntervalVector=l.Float64Vector=l.Float32Vector=l.Float16Vector=l.FloatVector=l.FixedSizeListVector=l.FixedSizeBinaryVector=l.DictionaryVector=l.DecimalVector=l.DateMillisecondVector=l.DateDayVector=l.DateVector=l.Chunked=l.BoolVector=l.BinaryVector=l.BaseVector=l.Vector=l.Field=l.Schema=l.Visitor=l.Column=l.Table=l.Map_=l.FixedSizeList=l.IntervalYearMonth=l.IntervalDayTime=l.Interval=l.Dictionary=l.SparseUnion=l.DenseUnion=l.Union=l.Struct=l.List=l.Decimal=l.TimeNanosecond=l.TimeMicrosecond=l.TimeMillisecond=l.TimeSecond=l.Time=l.TimestampNanosecond=l.TimestampMicrosecond=l.TimestampMillisecond=l.TimestampSecond=l.Timestamp=l.DateMillisecond=l.DateDay=l.Date_=l.FixedSizeBinary=l.Binary=l.Utf8=l.Float64=l.Float32=l.Float16=l.Float=l.Uint64=l.Uint32=l.Uint16=l.Uint8=l.Int64=l.Int32=l.Int16=l.Int8=l.Int=l.Bool=l.Null=l.DataType=l.Data=l.BufferType=l.UnionMode=l.Type=l.TimeUnit=l.Precision=l.MetadataVersion=l.MessageHeader=l.IntervalUnit=l.DateUnit=l.ArrowType=void 0;var Zt=ue();Object.defineProperty(l,"ArrowType",{enumerable:!0,get:function(){return Zt.ArrowType}});Object.defineProperty(l,"DateUnit",{enumerable:!0,get:function(){return Zt.DateUnit}});Object.defineProperty(l,"IntervalUnit",{enumerable:!0,get:function(){return Zt.IntervalUnit}});Object.defineProperty(l,"MessageHeader",{enumerable:!0,get:function(){return Zt.MessageHeader}});Object.defineProperty(l,"MetadataVersion",{enumerable:!0,get:function(){return Zt.MetadataVersion}});Object.defineProperty(l,"Precision",{enumerable:!0,get:function(){return Zt.Precision}});Object.defineProperty(l,"TimeUnit",{enumerable:!0,get:function(){return Zt.TimeUnit}});Object.defineProperty(l,"Type",{enumerable:!0,get:function(){return Zt.Type}});Object.defineProperty(l,"UnionMode",{enumerable:!0,get:function(){return Zt.UnionMode}});Object.defineProperty(l,"BufferType",{enumerable:!0,get:function(){return Zt.BufferType}});var PS=wt();Object.defineProperty(l,"Data",{enumerable:!0,get:function(){return PS.Data}});var z=re();Object.defineProperty(l,"DataType",{enumerable:!0,get:function(){return z.DataType}});Object.defineProperty(l,"Null",{enumerable:!0,get:function(){return z.Null}});Object.defineProperty(l,"Bool",{enumerable:!0,get:function(){return z.Bool}});Object.defineProperty(l,"Int",{enumerable:!0,get:function(){return z.Int}});Object.defineProperty(l,"Int8",{enumerable:!0,get:function(){return z.Int8}});Object.defineProperty(l,"Int16",{enumerable:!0,get:function(){return z.Int16}});Object.defineProperty(l,"Int32",{enumerable:!0,get:function(){return z.Int32}});Object.defineProperty(l,"Int64",{enumerable:!0,get:function(){return z.Int64}});Object.defineProperty(l,"Uint8",{enumerable:!0,get:function(){return z.Uint8}});Object.defineProperty(l,"Uint16",{enumerable:!0,get:function(){return z.Uint16}});Object.defineProperty(l,"Uint32",{enumerable:!0,get:function(){return z.Uint32}});Object.defineProperty(l,"Uint64",{enumerable:!0,get:function(){return z.Uint64}});Object.defineProperty(l,"Float",{enumerable:!0,get:function(){return z.Float}});Object.defineProperty(l,"Float16",{enumerable:!0,get:function(){return z.Float16}});Object.defineProperty(l,"Float32",{enumerable:!0,get:function(){return z.Float32}});Object.defineProperty(l,"Float64",{enumerable:!0,get:function(){return z.Float64}});Object.defineProperty(l,"Utf8",{enumerable:!0,get:function(){return z.Utf8}});Object.defineProperty(l,"Binary",{enumerable:!0,get:function(){return z.Binary}});Object.defineProperty(l,"FixedSizeBinary",{enumerable:!0,get:function(){return z.FixedSizeBinary}});Object.defineProperty(l,"Date_",{enumerable:!0,get:function(){return z.Date_}});Object.defineProperty(l,"DateDay",{enumerable:!0,get:function(){return z.DateDay}});Object.defineProperty(l,"DateMillisecond",{enumerable:!0,get:function(){return z.DateMillisecond}});Object.defineProperty(l,"Timestamp",{enumerable:!0,get:function(){return z.Timestamp}});Object.defineProperty(l,"TimestampSecond",{enumerable:!0,get:function(){return z.TimestampSecond}});Object.defineProperty(l,"TimestampMillisecond",{enumerable:!0,get:function(){return z.TimestampMillisecond}});Object.defineProperty(l,"TimestampMicrosecond",{enumerable:!0,get:function(){return z.TimestampMicrosecond}});Object.defineProperty(l,"TimestampNanosecond",{enumerable:!0,get:function(){return z.TimestampNanosecond}});Object.defineProperty(l,"Time",{enumerable:!0,get:function(){return z.Time}});Object.defineProperty(l,"TimeSecond",{enumerable:!0,get:function(){return z.TimeSecond}});Object.defineProperty(l,"TimeMillisecond",{enumerable:!0,get:function(){return z.TimeMillisecond}});Object.defineProperty(l,"TimeMicrosecond",{enumerable:!0,get:function(){return z.TimeMicrosecond}});Object.defineProperty(l,"TimeNanosecond",{enumerable:!0,get:function(){return z.TimeNanosecond}});Object.defineProperty(l,"Decimal",{enumerable:!0,get:function(){return z.Decimal}});Object.defineProperty(l,"List",{enumerable:!0,get:function(){return z.List}});Object.defineProperty(l,"Struct",{enumerable:!0,get:function(){return z.Struct}});Object.defineProperty(l,"Union",{enumerable:!0,get:function(){return z.Union}});Object.defineProperty(l,"DenseUnion",{enumerable:!0,get:function(){return z.DenseUnion}});Object.defineProperty(l,"SparseUnion",{enumerable:!0,get:function(){return z.SparseUnion}});Object.defineProperty(l,"Dictionary",{enumerable:!0,get:function(){return z.Dictionary}});Object.defineProperty(l,"Interval",{enumerable:!0,get:function(){return z.Interval}});Object.defineProperty(l,"IntervalDayTime",{enumerable:!0,get:function(){return z.IntervalDayTime}});Object.defineProperty(l,"IntervalYearMonth",{enumerable:!0,get:function(){return z.IntervalYearMonth}});Object.defineProperty(l,"FixedSizeList",{enumerable:!0,get:function(){return z.FixedSizeList}});Object.defineProperty(l,"Map_",{enumerable:!0,get:function(){return z.Map_}});var NS=Gi();Object.defineProperty(l,"Table",{enumerable:!0,get:function(){return NS.Table}});var RS=kn();Object.defineProperty(l,"Column",{enumerable:!0,get:function(){return RS.Column}});var xS=Ce();Object.defineProperty(l,"Visitor",{enumerable:!0,get:function(){return xS.Visitor}});var Ib=Re();Object.defineProperty(l,"Schema",{enumerable:!0,get:function(){return Ib.Schema}});Object.defineProperty(l,"Field",{enumerable:!0,get:function(){return Ib.Field}});var E=Jt();Object.defineProperty(l,"Vector",{enumerable:!0,get:function(){return E.Vector}});Object.defineProperty(l,"BaseVector",{enumerable:!0,get:function(){return E.BaseVector}});Object.defineProperty(l,"BinaryVector",{enumerable:!0,get:function(){return E.BinaryVector}});Object.defineProperty(l,"BoolVector",{enumerable:!0,get:function(){return E.BoolVector}});Object.defineProperty(l,"Chunked",{enumerable:!0,get:function(){return E.Chunked}});Object.defineProperty(l,"DateVector",{enumerable:!0,get:function(){return E.DateVector}});Object.defineProperty(l,"DateDayVector",{enumerable:!0,get:function(){return E.DateDayVector}});Object.defineProperty(l,"DateMillisecondVector",{enumerable:!0,get:function(){return E.DateMillisecondVector}});Object.defineProperty(l,"DecimalVector",{enumerable:!0,get:function(){return E.DecimalVector}});Object.defineProperty(l,"DictionaryVector",{enumerable:!0,get:function(){return E.DictionaryVector}});Object.defineProperty(l,"FixedSizeBinaryVector",{enumerable:!0,get:function(){return E.FixedSizeBinaryVector}});Object.defineProperty(l,"FixedSizeListVector",{enumerable:!0,get:function(){return E.FixedSizeListVector}});Object.defineProperty(l,"FloatVector",{enumerable:!0,get:function(){return E.FloatVector}});Object.defineProperty(l,"Float16Vector",{enumerable:!0,get:function(){return E.Float16Vector}});Object.defineProperty(l,"Float32Vector",{enumerable:!0,get:function(){return E.Float32Vector}});Object.defineProperty(l,"Float64Vector",{enumerable:!0,get:function(){return E.Float64Vector}});Object.defineProperty(l,"IntervalVector",{enumerable:!0,get:function(){return E.IntervalVector}});Object.defineProperty(l,"IntervalDayTimeVector",{enumerable:!0,get:function(){return E.IntervalDayTimeVector}});Object.defineProperty(l,"IntervalYearMonthVector",{enumerable:!0,get:function(){return E.IntervalYearMonthVector}});Object.defineProperty(l,"IntVector",{enumerable:!0,get:function(){return E.IntVector}});Object.defineProperty(l,"Int8Vector",{enumerable:!0,get:function(){return E.Int8Vector}});Object.defineProperty(l,"Int16Vector",{enumerable:!0,get:function(){return E.Int16Vector}});Object.defineProperty(l,"Int32Vector",{enumerable:!0,get:function(){return E.Int32Vector}});Object.defineProperty(l,"Int64Vector",{enumerable:!0,get:function(){return E.Int64Vector}});Object.defineProperty(l,"Uint8Vector",{enumerable:!0,get:function(){return E.Uint8Vector}});Object.defineProperty(l,"Uint16Vector",{enumerable:!0,get:function(){return E.Uint16Vector}});Object.defineProperty(l,"Uint32Vector",{enumerable:!0,get:function(){return E.Uint32Vector}});Object.defineProperty(l,"Uint64Vector",{enumerable:!0,get:function(){return E.Uint64Vector}});Object.defineProperty(l,"ListVector",{enumerable:!0,get:function(){return E.ListVector}});Object.defineProperty(l,"MapVector",{enumerable:!0,get:function(){return E.MapVector}});Object.defineProperty(l,"NullVector",{enumerable:!0,get:function(){return E.NullVector}});Object.defineProperty(l,"StructVector",{enumerable:!0,get:function(){return E.StructVector}});Object.defineProperty(l,"TimestampVector",{enumerable:!0,get:function(){return E.TimestampVector}});Object.defineProperty(l,"TimestampSecondVector",{enumerable:!0,get:function(){return E.TimestampSecondVector}});Object.defineProperty(l,"TimestampMillisecondVector",{enumerable:!0,get:function(){return E.TimestampMillisecondVector}});Object.defineProperty(l,"TimestampMicrosecondVector",{enumerable:!0,get:function(){return E.TimestampMicrosecondVector}});Object.defineProperty(l,"TimestampNanosecondVector",{enumerable:!0,get:function(){return E.TimestampNanosecondVector}});Object.defineProperty(l,"TimeVector",{enumerable:!0,get:function(){return E.TimeVector}});Object.defineProperty(l,"TimeSecondVector",{enumerable:!0,get:function(){return E.TimeSecondVector}});Object.defineProperty(l,"TimeMillisecondVector",{enumerable:!0,get:function(){return E.TimeMillisecondVector}});Object.defineProperty(l,"TimeMicrosecondVector",{enumerable:!0,get:function(){return E.TimeMicrosecondVector}});Object.defineProperty(l,"TimeNanosecondVector",{enumerable:!0,get:function(){return E.TimeNanosecondVector}});Object.defineProperty(l,"UnionVector",{enumerable:!0,get:function(){return E.UnionVector}});Object.defineProperty(l,"DenseUnionVector",{enumerable:!0,get:function(){return E.DenseUnionVector}});Object.defineProperty(l,"SparseUnionVector",{enumerable:!0,get:function(){return E.SparseUnionVector}});Object.defineProperty(l,"Utf8Vector",{enumerable:!0,get:function(){return E.Utf8Vector}});var W=So();Object.defineProperty(l,"Builder",{enumerable:!0,get:function(){return W.Builder}});Object.defineProperty(l,"BinaryBuilder",{enumerable:!0,get:function(){return W.BinaryBuilder}});Object.defineProperty(l,"BoolBuilder",{enumerable:!0,get:function(){return W.BoolBuilder}});Object.defineProperty(l,"DateBuilder",{enumerable:!0,get:function(){return W.DateBuilder}});Object.defineProperty(l,"DateDayBuilder",{enumerable:!0,get:function(){return W.DateDayBuilder}});Object.defineProperty(l,"DateMillisecondBuilder",{enumerable:!0,get:function(){return W.DateMillisecondBuilder}});Object.defineProperty(l,"DecimalBuilder",{enumerable:!0,get:function(){return W.DecimalBuilder}});Object.defineProperty(l,"DictionaryBuilder",{enumerable:!0,get:function(){return W.DictionaryBuilder}});Object.defineProperty(l,"FixedSizeBinaryBuilder",{enumerable:!0,get:function(){return W.FixedSizeBinaryBuilder}});Object.defineProperty(l,"FixedSizeListBuilder",{enumerable:!0,get:function(){return W.FixedSizeListBuilder}});Object.defineProperty(l,"FloatBuilder",{enumerable:!0,get:function(){return W.FloatBuilder}});Object.defineProperty(l,"Float16Builder",{enumerable:!0,get:function(){return W.Float16Builder}});Object.defineProperty(l,"Float32Builder",{enumerable:!0,get:function(){return W.Float32Builder}});Object.defineProperty(l,"Float64Builder",{enumerable:!0,get:function(){return W.Float64Builder}});Object.defineProperty(l,"IntervalBuilder",{enumerable:!0,get:function(){return W.IntervalBuilder}});Object.defineProperty(l,"IntervalDayTimeBuilder",{enumerable:!0,get:function(){return W.IntervalDayTimeBuilder}});Object.defineProperty(l,"IntervalYearMonthBuilder",{enumerable:!0,get:function(){return W.IntervalYearMonthBuilder}});Object.defineProperty(l,"IntBuilder",{enumerable:!0,get:function(){return W.IntBuilder}});Object.defineProperty(l,"Int8Builder",{enumerable:!0,get:function(){return W.Int8Builder}});Object.defineProperty(l,"Int16Builder",{enumerable:!0,get:function(){return W.Int16Builder}});Object.defineProperty(l,"Int32Builder",{enumerable:!0,get:function(){return W.Int32Builder}});Object.defineProperty(l,"Int64Builder",{enumerable:!0,get:function(){return W.Int64Builder}});Object.defineProperty(l,"Uint8Builder",{enumerable:!0,get:function(){return W.Uint8Builder}});Object.defineProperty(l,"Uint16Builder",{enumerable:!0,get:function(){return W.Uint16Builder}});Object.defineProperty(l,"Uint32Builder",{enumerable:!0,get:function(){return W.Uint32Builder}});Object.defineProperty(l,"Uint64Builder",{enumerable:!0,get:function(){return W.Uint64Builder}});Object.defineProperty(l,"ListBuilder",{enumerable:!0,get:function(){return W.ListBuilder}});Object.defineProperty(l,"MapBuilder",{enumerable:!0,get:function(){return W.MapBuilder}});Object.defineProperty(l,"NullBuilder",{enumerable:!0,get:function(){return W.NullBuilder}});Object.defineProperty(l,"StructBuilder",{enumerable:!0,get:function(){return W.StructBuilder}});Object.defineProperty(l,"TimestampBuilder",{enumerable:!0,get:function(){return W.TimestampBuilder}});Object.defineProperty(l,"TimestampSecondBuilder",{enumerable:!0,get:function(){return W.TimestampSecondBuilder}});Object.defineProperty(l,"TimestampMillisecondBuilder",{enumerable:!0,get:function(){return W.TimestampMillisecondBuilder}});Object.defineProperty(l,"TimestampMicrosecondBuilder",{enumerable:!0,get:function(){return W.TimestampMicrosecondBuilder}});Object.defineProperty(l,"TimestampNanosecondBuilder",{enumerable:!0,get:function(){return W.TimestampNanosecondBuilder}});Object.defineProperty(l,"TimeBuilder",{enumerable:!0,get:function(){return W.TimeBuilder}});Object.defineProperty(l,"TimeSecondBuilder",{enumerable:!0,get:function(){return W.TimeSecondBuilder}});Object.defineProperty(l,"TimeMillisecondBuilder",{enumerable:!0,get:function(){return W.TimeMillisecondBuilder}});Object.defineProperty(l,"TimeMicrosecondBuilder",{enumerable:!0,get:function(){return W.TimeMicrosecondBuilder}});Object.defineProperty(l,"TimeNanosecondBuilder",{enumerable:!0,get:function(){return W.TimeNanosecondBuilder}});Object.defineProperty(l,"UnionBuilder",{enumerable:!0,get:function(){return W.UnionBuilder}});Object.defineProperty(l,"DenseUnionBuilder",{enumerable:!0,get:function(){return W.DenseUnionBuilder}});Object.defineProperty(l,"SparseUnionBuilder",{enumerable:!0,get:function(){return W.SparseUnionBuilder}});Object.defineProperty(l,"Utf8Builder",{enumerable:!0,get:function(){return W.Utf8Builder}});var Zl=Pr();Object.defineProperty(l,"ByteStream",{enumerable:!0,get:function(){return Zl.ByteStream}});Object.defineProperty(l,"AsyncByteStream",{enumerable:!0,get:function(){return Zl.AsyncByteStream}});Object.defineProperty(l,"AsyncByteQueue",{enumerable:!0,get:function(){return Zl.AsyncByteQueue}});var fs=ss();Object.defineProperty(l,"RecordBatchReader",{enumerable:!0,get:function(){return fs.RecordBatchReader}});Object.defineProperty(l,"RecordBatchFileReader",{enumerable:!0,get:function(){return fs.RecordBatchFileReader}});Object.defineProperty(l,"RecordBatchStreamReader",{enumerable:!0,get:function(){return fs.RecordBatchStreamReader}});Object.defineProperty(l,"AsyncRecordBatchFileReader",{enumerable:!0,get:function(){return fs.AsyncRecordBatchFileReader}});Object.defineProperty(l,"AsyncRecordBatchStreamReader",{enumerable:!0,get:function(){return fs.AsyncRecordBatchStreamReader}});var Sa=Jo();Object.defineProperty(l,"RecordBatchWriter",{enumerable:!0,get:function(){return Sa.RecordBatchWriter}});Object.defineProperty(l,"RecordBatchFileWriter",{enumerable:!0,get:function(){return Sa.RecordBatchFileWriter}});Object.defineProperty(l,"RecordBatchStreamWriter",{enumerable:!0,get:function(){return Sa.RecordBatchStreamWriter}});Object.defineProperty(l,"RecordBatchJSONWriter",{enumerable:!0,get:function(){return Sa.RecordBatchJSONWriter}});var ed=Eo();Object.defineProperty(l,"MessageReader",{enumerable:!0,get:function(){return ed.MessageReader}});Object.defineProperty(l,"AsyncMessageReader",{enumerable:!0,get:function(){return ed.AsyncMessageReader}});Object.defineProperty(l,"JSONMessageReader",{enumerable:!0,get:function(){return ed.JSONMessageReader}});var jS=an();Object.defineProperty(l,"Message",{enumerable:!0,get:function(){return jS.Message}});var ES=lr();Object.defineProperty(l,"RecordBatch",{enumerable:!0,get:function(){return ES.RecordBatch}});var td=Tb();Object.defineProperty(l,"DataFrame",{enumerable:!0,get:function(){return td.DataFrame}});Object.defineProperty(l,"FilteredDataFrame",{enumerable:!0,get:function(){return td.FilteredDataFrame}});Object.defineProperty(l,"CountByResult",{enumerable:!0,get:function(){return td.CountByResult}});var LS=Ri(),kS=pc(),CS=Rt(),qS=Ui(),zS=we(),WS=Ei(),YS=Ql();l.predicate=YS;l.util={...LS,...kS,...CS,...qS,...zS,...WS}});var Da=B(d=>{"use strict";Object.defineProperty(d,"__esModule",{value:!0});d.Utf8Builder=d.SparseUnionBuilder=d.DenseUnionBuilder=d.UnionBuilder=d.TimeNanosecondBuilder=d.TimeMicrosecondBuilder=d.TimeMillisecondBuilder=d.TimeSecondBuilder=d.TimeBuilder=d.TimestampNanosecondBuilder=d.TimestampMicrosecondBuilder=d.TimestampMillisecondBuilder=d.TimestampSecondBuilder=d.TimestampBuilder=d.StructBuilder=d.NullBuilder=d.MapBuilder=d.ListBuilder=d.Uint64Builder=d.Uint32Builder=d.Uint16Builder=d.Uint8Builder=d.Int64Builder=d.Int32Builder=d.Int16Builder=d.Int8Builder=d.IntBuilder=d.IntervalYearMonthBuilder=d.IntervalDayTimeBuilder=d.IntervalBuilder=d.Float64Builder=d.Float32Builder=d.Float16Builder=d.FloatBuilder=d.FixedSizeListBuilder=d.FixedSizeBinaryBuilder=d.DictionaryBuilder=d.DecimalBuilder=d.DateMillisecondBuilder=d.DateDayBuilder=d.DateBuilder=d.BoolBuilder=d.BinaryBuilder=d.Builder=d.util=d.predicate=d.CountByResult=d.FilteredDataFrame=d.DataFrame=d.RecordBatch=d.Message=d.JSONMessageReader=d.AsyncMessageReader=d.MessageReader=d.RecordBatchJSONWriter=d.RecordBatchStreamWriter=d.RecordBatchFileWriter=d.RecordBatchWriter=d.AsyncRecordBatchStreamReader=d.AsyncRecordBatchFileReader=d.RecordBatchStreamReader=d.RecordBatchFileReader=d.RecordBatchReader=d.AsyncByteQueue=d.AsyncByteStream=d.ByteStream=d.Utf8Vector=d.SparseUnionVector=d.DenseUnionVector=d.UnionVector=d.TimeNanosecondVector=d.TimeMicrosecondVector=d.TimeMillisecondVector=d.TimeSecondVector=d.TimeVector=d.TimestampNanosecondVector=d.TimestampMicrosecondVector=d.TimestampMillisecondVector=d.TimestampSecondVector=d.TimestampVector=d.StructVector=d.NullVector=d.MapVector=d.ListVector=d.Uint64Vector=d.Uint32Vector=d.Uint16Vector=d.Uint8Vector=d.Int64Vector=d.Int32Vector=d.Int16Vector=d.Int8Vector=d.IntVector=d.IntervalYearMonthVector=d.IntervalDayTimeVector=d.IntervalVector=d.Float64Vector=d.Float32Vector=d.Float16Vector=d.FloatVector=d.FixedSizeListVector=d.FixedSizeBinaryVector=d.DictionaryVector=d.DecimalVector=d.DateMillisecondVector=d.DateDayVector=d.DateVector=d.Chunked=d.BoolVector=d.BinaryVector=d.BaseVector=d.Vector=d.Visitor=d.Field=d.Schema=d.Column=d.Table=d.Map_=d.FixedSizeList=d.IntervalYearMonth=d.IntervalDayTime=d.Interval=d.Dictionary=d.SparseUnion=d.DenseUnion=d.Union=d.Struct=d.List=d.Decimal=d.TimeNanosecond=d.TimeMicrosecond=d.TimeMillisecond=d.TimeSecond=d.Time=d.TimestampNanosecond=d.TimestampMicrosecond=d.TimestampMillisecond=d.TimestampSecond=d.Timestamp=d.DateMillisecond=d.DateDay=d.Date_=d.FixedSizeBinary=d.Binary=d.Utf8=d.Float64=d.Float32=d.Float16=d.Float=d.Uint64=d.Uint32=d.Uint16=d.Uint8=d.Int64=d.Int32=d.Int16=d.Int8=d.Int=d.Bool=d.Null=d.DataType=d.Data=d.BufferType=d.UnionMode=d.Type=d.TimeUnit=d.Precision=d.MetadataVersion=d.MessageHeader=d.IntervalUnit=d.DateUnit=d.ArrowType=void 0;var HS=Si(),$S=So(),JS=ss(),KS=Jo(),GS=pb(),QS=mb(),XS=_b(),ZS=gb();HS.default.toDOMStream=GS.toDOMStream;$S.Builder.throughDOM=QS.builderThroughDOMStream;JS.RecordBatchReader.throughDOM=XS.recordBatchReaderThroughDOMStream;KS.RecordBatchWriter.throughDOM=ZS.recordBatchWriterThroughDOMStream;var y=Sb();Object.defineProperty(d,"ArrowType",{enumerable:!0,get:function(){return y.ArrowType}});Object.defineProperty(d,"DateUnit",{enumerable:!0,get:function(){return y.DateUnit}});Object.defineProperty(d,"IntervalUnit",{enumerable:!0,get:function(){return y.IntervalUnit}});Object.defineProperty(d,"MessageHeader",{enumerable:!0,get:function(){return y.MessageHeader}});Object.defineProperty(d,"MetadataVersion",{enumerable:!0,get:function(){return y.MetadataVersion}});Object.defineProperty(d,"Precision",{enumerable:!0,get:function(){return y.Precision}});Object.defineProperty(d,"TimeUnit",{enumerable:!0,get:function(){return y.TimeUnit}});Object.defineProperty(d,"Type",{enumerable:!0,get:function(){return y.Type}});Object.defineProperty(d,"UnionMode",{enumerable:!0,get:function(){return y.UnionMode}});Object.defineProperty(d,"BufferType",{enumerable:!0,get:function(){return y.BufferType}});Object.defineProperty(d,"Data",{enumerable:!0,get:function(){return y.Data}});Object.defineProperty(d,"DataType",{enumerable:!0,get:function(){return y.DataType}});Object.defineProperty(d,"Null",{enumerable:!0,get:function(){return y.Null}});Object.defineProperty(d,"Bool",{enumerable:!0,get:function(){return y.Bool}});Object.defineProperty(d,"Int",{enumerable:!0,get:function(){return y.Int}});Object.defineProperty(d,"Int8",{enumerable:!0,get:function(){return y.Int8}});Object.defineProperty(d,"Int16",{enumerable:!0,get:function(){return y.Int16}});Object.defineProperty(d,"Int32",{enumerable:!0,get:function(){return y.Int32}});Object.defineProperty(d,"Int64",{enumerable:!0,get:function(){return y.Int64}});Object.defineProperty(d,"Uint8",{enumerable:!0,get:function(){return y.Uint8}});Object.defineProperty(d,"Uint16",{enumerable:!0,get:function(){return y.Uint16}});Object.defineProperty(d,"Uint32",{enumerable:!0,get:function(){return y.Uint32}});Object.defineProperty(d,"Uint64",{enumerable:!0,get:function(){return y.Uint64}});Object.defineProperty(d,"Float",{enumerable:!0,get:function(){return y.Float}});Object.defineProperty(d,"Float16",{enumerable:!0,get:function(){return y.Float16}});Object.defineProperty(d,"Float32",{enumerable:!0,get:function(){return y.Float32}});Object.defineProperty(d,"Float64",{enumerable:!0,get:function(){return y.Float64}});Object.defineProperty(d,"Utf8",{enumerable:!0,get:function(){return y.Utf8}});Object.defineProperty(d,"Binary",{enumerable:!0,get:function(){return y.Binary}});Object.defineProperty(d,"FixedSizeBinary",{enumerable:!0,get:function(){return y.FixedSizeBinary}});Object.defineProperty(d,"Date_",{enumerable:!0,get:function(){return y.Date_}});Object.defineProperty(d,"DateDay",{enumerable:!0,get:function(){return y.DateDay}});Object.defineProperty(d,"DateMillisecond",{enumerable:!0,get:function(){return y.DateMillisecond}});Object.defineProperty(d,"Timestamp",{enumerable:!0,get:function(){return y.Timestamp}});Object.defineProperty(d,"TimestampSecond",{enumerable:!0,get:function(){return y.TimestampSecond}});Object.defineProperty(d,"TimestampMillisecond",{enumerable:!0,get:function(){return y.TimestampMillisecond}});Object.defineProperty(d,"TimestampMicrosecond",{enumerable:!0,get:function(){return y.TimestampMicrosecond}});Object.defineProperty(d,"TimestampNanosecond",{enumerable:!0,get:function(){return y.TimestampNanosecond}});Object.defineProperty(d,"Time",{enumerable:!0,get:function(){return y.Time}});Object.defineProperty(d,"TimeSecond",{enumerable:!0,get:function(){return y.TimeSecond}});Object.defineProperty(d,"TimeMillisecond",{enumerable:!0,get:function(){return y.TimeMillisecond}});Object.defineProperty(d,"TimeMicrosecond",{enumerable:!0,get:function(){return y.TimeMicrosecond}});Object.defineProperty(d,"TimeNanosecond",{enumerable:!0,get:function(){return y.TimeNanosecond}});Object.defineProperty(d,"Decimal",{enumerable:!0,get:function(){return y.Decimal}});Object.defineProperty(d,"List",{enumerable:!0,get:function(){return y.List}});Object.defineProperty(d,"Struct",{enumerable:!0,get:function(){return y.Struct}});Object.defineProperty(d,"Union",{enumerable:!0,get:function(){return y.Union}});Object.defineProperty(d,"DenseUnion",{enumerable:!0,get:function(){return y.DenseUnion}});Object.defineProperty(d,"SparseUnion",{enumerable:!0,get:function(){return y.SparseUnion}});Object.defineProperty(d,"Dictionary",{enumerable:!0,get:function(){return y.Dictionary}});Object.defineProperty(d,"Interval",{enumerable:!0,get:function(){return y.Interval}});Object.defineProperty(d,"IntervalDayTime",{enumerable:!0,get:function(){return y.IntervalDayTime}});Object.defineProperty(d,"IntervalYearMonth",{enumerable:!0,get:function(){return y.IntervalYearMonth}});Object.defineProperty(d,"FixedSizeList",{enumerable:!0,get:function(){return y.FixedSizeList}});Object.defineProperty(d,"Map_",{enumerable:!0,get:function(){return y.Map_}});Object.defineProperty(d,"Table",{enumerable:!0,get:function(){return y.Table}});Object.defineProperty(d,"Column",{enumerable:!0,get:function(){return y.Column}});Object.defineProperty(d,"Schema",{enumerable:!0,get:function(){return y.Schema}});Object.defineProperty(d,"Field",{enumerable:!0,get:function(){return y.Field}});Object.defineProperty(d,"Visitor",{enumerable:!0,get:function(){return y.Visitor}});Object.defineProperty(d,"Vector",{enumerable:!0,get:function(){return y.Vector}});Object.defineProperty(d,"BaseVector",{enumerable:!0,get:function(){return y.BaseVector}});Object.defineProperty(d,"BinaryVector",{enumerable:!0,get:function(){return y.BinaryVector}});Object.defineProperty(d,"BoolVector",{enumerable:!0,get:function(){return y.BoolVector}});Object.defineProperty(d,"Chunked",{enumerable:!0,get:function(){return y.Chunked}});Object.defineProperty(d,"DateVector",{enumerable:!0,get:function(){return y.DateVector}});Object.defineProperty(d,"DateDayVector",{enumerable:!0,get:function(){return y.DateDayVector}});Object.defineProperty(d,"DateMillisecondVector",{enumerable:!0,get:function(){return y.DateMillisecondVector}});Object.defineProperty(d,"DecimalVector",{enumerable:!0,get:function(){return y.DecimalVector}});Object.defineProperty(d,"DictionaryVector",{enumerable:!0,get:function(){return y.DictionaryVector}});Object.defineProperty(d,"FixedSizeBinaryVector",{enumerable:!0,get:function(){return y.FixedSizeBinaryVector}});Object.defineProperty(d,"FixedSizeListVector",{enumerable:!0,get:function(){return y.FixedSizeListVector}});Object.defineProperty(d,"FloatVector",{enumerable:!0,get:function(){return y.FloatVector}});Object.defineProperty(d,"Float16Vector",{enumerable:!0,get:function(){return y.Float16Vector}});Object.defineProperty(d,"Float32Vector",{enumerable:!0,get:function(){return y.Float32Vector}});Object.defineProperty(d,"Float64Vector",{enumerable:!0,get:function(){return y.Float64Vector}});Object.defineProperty(d,"IntervalVector",{enumerable:!0,get:function(){return y.IntervalVector}});Object.defineProperty(d,"IntervalDayTimeVector",{enumerable:!0,get:function(){return y.IntervalDayTimeVector}});Object.defineProperty(d,"IntervalYearMonthVector",{enumerable:!0,get:function(){return y.IntervalYearMonthVector}});Object.defineProperty(d,"IntVector",{enumerable:!0,get:function(){return y.IntVector}});Object.defineProperty(d,"Int8Vector",{enumerable:!0,get:function(){return y.Int8Vector}});Object.defineProperty(d,"Int16Vector",{enumerable:!0,get:function(){return y.Int16Vector}});Object.defineProperty(d,"Int32Vector",{enumerable:!0,get:function(){return y.Int32Vector}});Object.defineProperty(d,"Int64Vector",{enumerable:!0,get:function(){return y.Int64Vector}});Object.defineProperty(d,"Uint8Vector",{enumerable:!0,get:function(){return y.Uint8Vector}});Object.defineProperty(d,"Uint16Vector",{enumerable:!0,get:function(){return y.Uint16Vector}});Object.defineProperty(d,"Uint32Vector",{enumerable:!0,get:function(){return y.Uint32Vector}});Object.defineProperty(d,"Uint64Vector",{enumerable:!0,get:function(){return y.Uint64Vector}});Object.defineProperty(d,"ListVector",{enumerable:!0,get:function(){return y.ListVector}});Object.defineProperty(d,"MapVector",{enumerable:!0,get:function(){return y.MapVector}});Object.defineProperty(d,"NullVector",{enumerable:!0,get:function(){return y.NullVector}});Object.defineProperty(d,"StructVector",{enumerable:!0,get:function(){return y.StructVector}});Object.defineProperty(d,"TimestampVector",{enumerable:!0,get:function(){return y.TimestampVector}});Object.defineProperty(d,"TimestampSecondVector",{enumerable:!0,get:function(){return y.TimestampSecondVector}});Object.defineProperty(d,"TimestampMillisecondVector",{enumerable:!0,get:function(){return y.TimestampMillisecondVector}});Object.defineProperty(d,"TimestampMicrosecondVector",{enumerable:!0,get:function(){return y.TimestampMicrosecondVector}});Object.defineProperty(d,"TimestampNanosecondVector",{enumerable:!0,get:function(){return y.TimestampNanosecondVector}});Object.defineProperty(d,"TimeVector",{enumerable:!0,get:function(){return y.TimeVector}});Object.defineProperty(d,"TimeSecondVector",{enumerable:!0,get:function(){return y.TimeSecondVector}});Object.defineProperty(d,"TimeMillisecondVector",{enumerable:!0,get:function(){return y.TimeMillisecondVector}});Object.defineProperty(d,"TimeMicrosecondVector",{enumerable:!0,get:function(){return y.TimeMicrosecondVector}});Object.defineProperty(d,"TimeNanosecondVector",{enumerable:!0,get:function(){return y.TimeNanosecondVector}});Object.defineProperty(d,"UnionVector",{enumerable:!0,get:function(){return y.UnionVector}});Object.defineProperty(d,"DenseUnionVector",{enumerable:!0,get:function(){return y.DenseUnionVector}});Object.defineProperty(d,"SparseUnionVector",{enumerable:!0,get:function(){return y.SparseUnionVector}});Object.defineProperty(d,"Utf8Vector",{enumerable:!0,get:function(){return y.Utf8Vector}});Object.defineProperty(d,"ByteStream",{enumerable:!0,get:function(){return y.ByteStream}});Object.defineProperty(d,"AsyncByteStream",{enumerable:!0,get:function(){return y.AsyncByteStream}});Object.defineProperty(d,"AsyncByteQueue",{enumerable:!0,get:function(){return y.AsyncByteQueue}});Object.defineProperty(d,"RecordBatchReader",{enumerable:!0,get:function(){return y.RecordBatchReader}});Object.defineProperty(d,"RecordBatchFileReader",{enumerable:!0,get:function(){return y.RecordBatchFileReader}});Object.defineProperty(d,"RecordBatchStreamReader",{enumerable:!0,get:function(){return y.RecordBatchStreamReader}});Object.defineProperty(d,"AsyncRecordBatchFileReader",{enumerable:!0,get:function(){return y.AsyncRecordBatchFileReader}});Object.defineProperty(d,"AsyncRecordBatchStreamReader",{enumerable:!0,get:function(){return y.AsyncRecordBatchStreamReader}});Object.defineProperty(d,"RecordBatchWriter",{enumerable:!0,get:function(){return y.RecordBatchWriter}});Object.defineProperty(d,"RecordBatchFileWriter",{enumerable:!0,get:function(){return y.RecordBatchFileWriter}});Object.defineProperty(d,"RecordBatchStreamWriter",{enumerable:!0,get:function(){return y.RecordBatchStreamWriter}});Object.defineProperty(d,"RecordBatchJSONWriter",{enumerable:!0,get:function(){return y.RecordBatchJSONWriter}});Object.defineProperty(d,"MessageReader",{enumerable:!0,get:function(){return y.MessageReader}});Object.defineProperty(d,"AsyncMessageReader",{enumerable:!0,get:function(){return y.AsyncMessageReader}});Object.defineProperty(d,"JSONMessageReader",{enumerable:!0,get:function(){return y.JSONMessageReader}});Object.defineProperty(d,"Message",{enumerable:!0,get:function(){return y.Message}});Object.defineProperty(d,"RecordBatch",{enumerable:!0,get:function(){return y.RecordBatch}});Object.defineProperty(d,"DataFrame",{enumerable:!0,get:function(){return y.DataFrame}});Object.defineProperty(d,"FilteredDataFrame",{enumerable:!0,get:function(){return y.FilteredDataFrame}});Object.defineProperty(d,"CountByResult",{enumerable:!0,get:function(){return y.CountByResult}});Object.defineProperty(d,"predicate",{enumerable:!0,get:function(){return y.predicate}});Object.defineProperty(d,"util",{enumerable:!0,get:function(){return y.util}});Object.defineProperty(d,"Builder",{enumerable:!0,get:function(){return y.Builder}});Object.defineProperty(d,"BinaryBuilder",{enumerable:!0,get:function(){return y.BinaryBuilder}});Object.defineProperty(d,"BoolBuilder",{enumerable:!0,get:function(){return y.BoolBuilder}});Object.defineProperty(d,"DateBuilder",{enumerable:!0,get:function(){return y.DateBuilder}});Object.defineProperty(d,"DateDayBuilder",{enumerable:!0,get:function(){return y.DateDayBuilder}});Object.defineProperty(d,"DateMillisecondBuilder",{enumerable:!0,get:function(){return y.DateMillisecondBuilder}});Object.defineProperty(d,"DecimalBuilder",{enumerable:!0,get:function(){return y.DecimalBuilder}});Object.defineProperty(d,"DictionaryBuilder",{enumerable:!0,get:function(){return y.DictionaryBuilder}});Object.defineProperty(d,"FixedSizeBinaryBuilder",{enumerable:!0,get:function(){return y.FixedSizeBinaryBuilder}});Object.defineProperty(d,"FixedSizeListBuilder",{enumerable:!0,get:function(){return y.FixedSizeListBuilder}});Object.defineProperty(d,"FloatBuilder",{enumerable:!0,get:function(){return y.FloatBuilder}});Object.defineProperty(d,"Float16Builder",{enumerable:!0,get:function(){return y.Float16Builder}});Object.defineProperty(d,"Float32Builder",{enumerable:!0,get:function(){return y.Float32Builder}});Object.defineProperty(d,"Float64Builder",{enumerable:!0,get:function(){return y.Float64Builder}});Object.defineProperty(d,"IntervalBuilder",{enumerable:!0,get:function(){return y.IntervalBuilder}});Object.defineProperty(d,"IntervalDayTimeBuilder",{enumerable:!0,get:function(){return y.IntervalDayTimeBuilder}});Object.defineProperty(d,"IntervalYearMonthBuilder",{enumerable:!0,get:function(){return y.IntervalYearMonthBuilder}});Object.defineProperty(d,"IntBuilder",{enumerable:!0,get:function(){return y.IntBuilder}});Object.defineProperty(d,"Int8Builder",{enumerable:!0,get:function(){return y.Int8Builder}});Object.defineProperty(d,"Int16Builder",{enumerable:!0,get:function(){return y.Int16Builder}});Object.defineProperty(d,"Int32Builder",{enumerable:!0,get:function(){return y.Int32Builder}});Object.defineProperty(d,"Int64Builder",{enumerable:!0,get:function(){return y.Int64Builder}});Object.defineProperty(d,"Uint8Builder",{enumerable:!0,get:function(){return y.Uint8Builder}});Object.defineProperty(d,"Uint16Builder",{enumerable:!0,get:function(){return y.Uint16Builder}});Object.defineProperty(d,"Uint32Builder",{enumerable:!0,get:function(){return y.Uint32Builder}});Object.defineProperty(d,"Uint64Builder",{enumerable:!0,get:function(){return y.Uint64Builder}});Object.defineProperty(d,"ListBuilder",{enumerable:!0,get:function(){return y.ListBuilder}});Object.defineProperty(d,"MapBuilder",{enumerable:!0,get:function(){return y.MapBuilder}});Object.defineProperty(d,"NullBuilder",{enumerable:!0,get:function(){return y.NullBuilder}});Object.defineProperty(d,"StructBuilder",{enumerable:!0,get:function(){return y.StructBuilder}});Object.defineProperty(d,"TimestampBuilder",{enumerable:!0,get:function(){return y.TimestampBuilder}});Object.defineProperty(d,"TimestampSecondBuilder",{enumerable:!0,get:function(){return y.TimestampSecondBuilder}});Object.defineProperty(d,"TimestampMillisecondBuilder",{enumerable:!0,get:function(){return y.TimestampMillisecondBuilder}});Object.defineProperty(d,"TimestampMicrosecondBuilder",{enumerable:!0,get:function(){return y.TimestampMicrosecondBuilder}});Object.defineProperty(d,"TimestampNanosecondBuilder",{enumerable:!0,get:function(){return y.TimestampNanosecondBuilder}});Object.defineProperty(d,"TimeBuilder",{enumerable:!0,get:function(){return y.TimeBuilder}});Object.defineProperty(d,"TimeSecondBuilder",{enumerable:!0,get:function(){return y.TimeSecondBuilder}});Object.defineProperty(d,"TimeMillisecondBuilder",{enumerable:!0,get:function(){return y.TimeMillisecondBuilder}});Object.defineProperty(d,"TimeMicrosecondBuilder",{enumerable:!0,get:function(){return y.TimeMicrosecondBuilder}});Object.defineProperty(d,"TimeNanosecondBuilder",{enumerable:!0,get:function(){return y.TimeNanosecondBuilder}});Object.defineProperty(d,"UnionBuilder",{enumerable:!0,get:function(){return y.UnionBuilder}});Object.defineProperty(d,"DenseUnionBuilder",{enumerable:!0,get:function(){return y.DenseUnionBuilder}});Object.defineProperty(d,"SparseUnionBuilder",{enumerable:!0,get:function(){return y.SparseUnionBuilder}});Object.defineProperty(d,"Utf8Builder",{enumerable:!0,get:function(){return y.Utf8Builder}})});var Ua=B(()=>{});var ad=B(()=>{});var Fb=B(()=>{});var nD={};ig(nD,{BROWSER_RUNTIME:()=>We,ConsoleLogger:()=>Od,DEFAULT_RUNTIME:()=>Ab,DuckDB:()=>Vb,DuckDBBindingsBase:()=>Ma,DuckDBConnection:()=>Oa,DuckDBDataProtocol:()=>Le,DuckDBFeature:()=>id,FileStatistics:()=>Fa,InsertMode:()=>od,JSONTableShape:()=>sd,LogEvent:()=>rr,LogLevel:()=>yr,LogOrigin:()=>br,LogTopic:()=>Qr,PreparedStatement:()=>nd,ResultStreamIterator:()=>Aa,StatusCode:()=>se,VoidLogger:()=>Dd,callSRet:()=>le,copyBuffer:()=>yn,decodeText:()=>Ob,dropResponseBuffers:()=>Ae,failWith:()=>Oe,getLogEventLabel:()=>ag,getLogLevelLabel:()=>og,getLogOriginLabel:()=>cg,getLogTopicLabel:()=>ug,readString:()=>ie});var yr;(function(o){o[o.NONE=0]="NONE",o[o.DEBUG=1]="DEBUG",o[o.INFO=2]="INFO",o[o.WARNING=3]="WARNING",o[o.ERROR=4]="ERROR"})(yr||(yr={}));var Qr;(function(o){o[o.NONE=0]="NONE",o[o.CONNECT=1]="CONNECT",o[o.DISCONNECT=2]="DISCONNECT",o[o.OPEN=3]="OPEN",o[o.QUERY=4]="QUERY"})(Qr||(Qr={}));var rr;(function(a){a[a.NONE=0]="NONE",a[a.OK=1]="OK",a[a.ERROR=2]="ERROR",a[a.START=3]="START",a[a.RUN=4]="RUN",a[a.CAPTURE=5]="CAPTURE"})(rr||(rr={}));var br;(function(o){o[o.NONE=0]="NONE",o[o.WEB_WORKER=1]="WEB_WORKER",o[o.NODE_WORKER=2]="NODE_WORKER",o[o.BINDINGS=3]="BINDINGS",o[o.ASYNC_DUCKDB=4]="ASYNC_DUCKDB"})(br||(br={}));var Dd=class{log(e){}},Od=class{log(e){console.log(e)}};function og(r){switch(r){case 0:return"NONE";case 1:return"DEBUG";case 2:return"INFO";case 3:return"WARNING";case 4:return"ERROR";default:return"?"}}function ag(r){switch(r){case 0:return"NONE";case 1:return"OK";case 2:return"ERROR";case 3:return"START";case 4:return"RUN";case 5:return"CAPTURE";default:return"?"}}function ug(r){switch(r){case 1:return"CONNECT";case 2:return"DISCONNECT";case 3:return"OPEN";case 4:return"QUERY";default:return"?"}}function cg(r){switch(r){case 0:return"NONE";case 1:return"WEB WORKER";case 2:return"NODE WORKER";case 3:return"DUCKDB BINDINGS";case 4:return"DUCKDB";default:return"?"}}var se;(function(e){e[e.SUCCESS=0]="SUCCESS"})(se||(se={}));var At=qa(Da());var Db=qa(Da()),rd=class extends Db.AsyncByteQueue{flush(){let e=super.toUint8Array(!0);return this._values.length=0,e}};var Oa=class{constructor(e,t){this._bindings=e,this._conn=t}close(){this._bindings.disconnect(this._conn)}useUnsafe(e){return e(this._bindings,this._conn)}query(e){let t=this._bindings.runQuery(this._conn,e),n=At.RecordBatchReader.from(t);return console.assert(n.isSync()),console.assert(n.isFile()),At.Table.from(n)}send(e){let t=this._bindings.sendQuery(this._conn,e),n=new Aa(this._bindings,this._conn,t),i=At.RecordBatchReader.from(n);return console.assert(i.isSync()),console.assert(i.isStream()),i}prepare(e){let t=this._bindings.createPrepared(this._conn,e);return new nd(this._bindings,this._conn,t)}insertArrowVectors(e,t){this.insertArrowTable(At.Table.new(e),t)}insertArrowTable(e,t){e.schema.fields.length==0&&console.warn("The schema is empty! If you used arrow.Table.from, consider constructing schema and batches manually"),this.insertArrowBatches(e.schema,e.chunks,t)}insertArrowBatches(e,t,n){e.fields.length==0&&console.warn("The schema is empty! If you used arrow.Table.from, consider constructing schema and batches manually");let i=new rd,o=new At.RecordBatchStreamWriter().reset(i,e),a=!0;for(let u of t)a||this._bindings.insertArrowFromIPCStream(this._conn,i.flush(),n),a=!1,o.write(u);o.finish(),this._bindings.insertArrowFromIPCStream(this._conn,i.flush(),n)}insertArrowFromIPCStream(e,t){this._bindings.insertArrowFromIPCStream(this._conn,e,t)}insertCSVFromPath(e,t){this._bindings.insertCSVFromPath(this._conn,e,t)}insertJSONFromPath(e,t){this._bindings.insertJSONFromPath(this._conn,e,t)}},Aa=class{constructor(e,t,n){this.bindings=e;this.conn=t;this.header=n;this._first=!0,this._depleted=!1}next(){if(this._first)return this._first=!1,{done:!1,value:this.header};if(this._depleted)return{done:!0,value:null};let e=this.bindings.fetchQueryResults(this.conn);return this._depleted=e.length==0,{done:this._depleted,value:e}}[Symbol.iterator](){return this}},nd=class{constructor(e,t,n){this.bindings=e,this.connectionId=t,this.statementId=n}close(){this.bindings.closePrepared(this.connectionId,this.statementId)}query(...e){let t=this.bindings.runPrepared(this.connectionId,this.statementId,e),n=At.RecordBatchReader.from(t);return console.assert(n.isSync()),console.assert(n.isFile()),At.Table.from(n)}send(...e){let t=this.bindings.sendPrepared(this.connectionId,this.statementId,e),n=new Aa(this.bindings,this.connectionId,t),i=At.RecordBatchReader.from(n);return console.assert(i.isSync()),console.assert(i.isStream()),i}};function eD(){let r=new TextDecoder;return e=>(typeof SharedArrayBuffer!="undefined"&&e.buffer instanceof SharedArrayBuffer&&(e=new Uint8Array(e)),r.decode(e))}var Ob=eD();function Oe(r,e){console.error(e),r.ccall("duckdb_web_fail_with",null,["string"],[e])}function yn(r,e,t){let n=r.HEAPU8.subarray(e,e+t),i=new Uint8Array(new ArrayBuffer(n.byteLength));return i.set(n),i}function ie(r,e,t){return Ob(r.HEAPU8.subarray(e,e+t))}var Le;(function(n){n[n.BUFFER=0]="BUFFER",n[n.NATIVE=1]="NATIVE",n[n.HTTP=3]="HTTP"})(Le||(Le={}));function le(r,e,t,n){let i=r.stackSave(),o=r.stackAlloc(3*8);t.unshift("number"),n.unshift(o),r.ccall(e,null,t,n);let a=r.HEAPF64[(o>>3)+0],u=r.HEAPF64[(o>>3)+1],f=r.HEAPF64[(o>>3)+2];return r.stackRestore(i),[a,u,f]}function Ae(r){r.ccall("duckdb_web_clear_response",null,[],[])}var Ab={testPlatformFeature:(r,e)=>!1,openFile:(r,e)=>{},syncFile:(r,e)=>{},closeFile:(r,e)=>{},getLastFileModificationTime:(r,e)=>0,getFileSize:(r,e)=>0,truncateFile:(r,e,t)=>{},readFile:(r,e,t,n,i)=>0,writeFile:(r,e,t,n,i)=>0,removeDirectory:(r,e,t)=>{},checkDirectory:(r,e,t)=>!1,createDirectory:(r,e,t)=>{},listDirectoryEntries:(r,e,t)=>!1,glob:(r,e,t)=>{},moveFile:(r,e,t,n,i)=>{},checkFile:(r,e,t)=>!1,removeFile:(r,e,t)=>{}};var Fa=class{constructor(e){let t=new Float64Array(e.buffer,e.byteOffset,e.byteLength/8),n=new Uint8Array(new ArrayBuffer(e.byteLength));n.set(e.subarray(7*8)),this.totalFileReadsCold=t[0],this.totalFileReadsAhead=t[1],this.totalFileReadsCached=t[2],this.totalFileWrites=t[3],this.totalPageAccesses=t[4],this.totalPageLoads=t[5],this.blockSize=t[6],this.blockStats=n}getBlockStats(e,t){return t=t||{file_reads_cold:0,file_reads_ahead:0,file_reads_cached:0,file_writes:0,page_accesses:0,page_loads:0},t.file_writes=this.blockStats[e*3+0]&15,t.file_reads_cold=this.blockStats[e*3+0]>>4,t.file_reads_ahead=this.blockStats[e*3+1]&15,t.file_reads_cached=this.blockStats[e*3+1]>>4,t.page_accesses=this.blockStats[e*3+1]&15,t.page_loads=this.blockStats[e*3+1]>>4,t}};var X=qa(Da());function hs(r,e){switch(e.typeId){case X.Type.Binary:return{name:r,type:"binary"};case X.Type.Bool:return{name:r,type:"bool"};case X.Type.Date:return{name:r,type:"date"};case X.Type.DateDay:return{name:r,type:"date32[d]"};case X.Type.DateMillisecond:return{name:r,type:"date64[ms]"};case X.Type.Decimal:{let t=e;return{name:r,type:"decimal",precision:t.precision,scale:t.scale}}case X.Type.Float:return{name:r,type:"float"};case X.Type.Float16:return{name:r,type:"float16"};case X.Type.Float32:return{name:r,type:"float32"};case X.Type.Float64:return{name:r,type:"float64"};case X.Type.Int:return{name:r,type:"int32"};case X.Type.Int16:return{name:r,type:"int16"};case X.Type.Int32:return{name:r,type:"int32"};case X.Type.Int64:return{name:r,type:"int64"};case X.Type.Uint16:return{name:r,type:"uint16"};case X.Type.Uint32:return{name:r,type:"uint32"};case X.Type.Uint64:return{name:r,type:"uint64"};case X.Type.Uint8:return{name:r,type:"uint8"};case X.Type.IntervalDayTime:return{name:r,type:"interval[dt]"};case X.Type.IntervalYearMonth:return{name:r,type:"interval[m]"};case X.Type.List:{let t=e;return{name:r,type:"list",children:[hs(t.valueField.name,t.valueField.type)]}}case X.Type.FixedSizeBinary:return{name:r,type:"fixedsizebinary",byteWidth:e.byteWidth};case X.Type.Null:return{name:r,type:"null"};case X.Type.Utf8:return{name:r,type:"utf8"};case X.Type.Struct:return{name:r,type:"struct",children:e.children.map(n=>hs(n.name,n.type))};case X.Type.Time:return{name:r,type:"time[s]"};case X.Type.TimeMicrosecond:return{name:r,type:"time[us]"};case X.Type.TimeMillisecond:return{name:r,type:"time[ms]"};case X.Type.TimeNanosecond:return{name:r,type:"time[ns]"};case X.Type.TimeSecond:return{name:r,type:"time[s]"};case X.Type.Timestamp:return{name:r,type:"timestamp",timezone:e.timezone||void 0};case X.Type.TimestampSecond:return{name:r,type:"timestamp[s]",timezone:e.timezone||void 0};case X.Type.TimestampMicrosecond:return{name:r,type:"timestamp[us]",timezone:e.timezone||void 0};case X.Type.TimestampNanosecond:return{name:r,type:"timestamp[ns]",timezone:e.timezone||void 0};case X.Type.TimestampMillisecond:return{name:r,type:"timestamp[ms]",timezone:e.timezone||void 0}}throw new Error(`unsupported arrow type: ${e.toString()}`)}var tD=new TextEncoder,id;(function(o){o[o.WASM_EXCEPTIONS=1]="WASM_EXCEPTIONS",o[o.WASM_THREADS=2]="WASM_THREADS",o[o.WASM_SIMD=4]="WASM_SIMD",o[o.WASM_BULK_MEMORY=8]="WASM_BULK_MEMORY",o[o.EMIT_BIGINT=16]="EMIT_BIGINT"})(id||(id={}));var Ma=class{constructor(e,t){this._instance=null;this._initPromise=null;this._initPromiseResolver=()=>{};this._logger=e,this._runtime=t}get logger(){return this._logger}get mod(){return this._instance}get pthread(){return this.mod.PThread||null}async instantiate(){return this._instance!=null?this:(this._initPromise!=null&&await this._initPromise,this._initPromise=new Promise(e=>{this._initPromiseResolver=e}),this._instance=await this.instantiateImpl({print:console.log.bind(console),printErr:console.log.bind(console),onRuntimeInitialized:this._initPromiseResolver}),await this._initPromise,this._initPromise=null,this)}open(e){let[t,n,i]=le(this.mod,"duckdb_web_open",["string"],[JSON.stringify(e)]);if(t!==se.SUCCESS)throw new Error(ie(this.mod,n,i));Ae(this.mod)}reset(){let[e,t,n]=le(this.mod,"duckdb_web_reset",[],[]);if(e!==se.SUCCESS)throw new Error(ie(this.mod,t,n));Ae(this.mod)}getVersion(){let[e,t,n]=le(this.mod,"duckdb_web_get_version",[],[]);if(e!==se.SUCCESS)throw new Error(ie(this.mod,t,n));let i=ie(this.mod,t,n);return Ae(this.mod),i}getFeatureFlags(){return this.mod.ccall("duckdb_web_get_feature_flags","number",[],[])}tokenize(e){let[t,n,i]=le(this.mod,"duckdb_web_tokenize",["string"],[e]);if(t!==se.SUCCESS)throw new Error(ie(this.mod,n,i));let o=ie(this.mod,n,i);return Ae(this.mod),JSON.parse(o)}connect(){let e=this.mod.ccall("duckdb_web_connect","number",[],[]);return new Oa(this,e)}disconnect(e){this.mod.ccall("duckdb_web_disconnect",null,["number"],[e])}runQuery(e,t){let[n,i,o]=le(this.mod,"duckdb_web_query_run",["number","string"],[e,t]);if(n!==se.SUCCESS)throw new Error(ie(this.mod,i,o));let a=yn(this.mod,i,o);return Ae(this.mod),a}sendQuery(e,t){let[n,i,o]=le(this.mod,"duckdb_web_query_send",["number","string"],[e,t]);if(n!==se.SUCCESS)throw new Error(ie(this.mod,i,o));let a=yn(this.mod,i,o);return Ae(this.mod),a}fetchQueryResults(e){let[t,n,i]=le(this.mod,"duckdb_web_query_fetch_results",["number"],[e]);if(t!==se.SUCCESS)throw new Error(ie(this.mod,n,i));let o=yn(this.mod,n,i);return Ae(this.mod),o}createPrepared(e,t){let[n,i,o]=le(this.mod,"duckdb_web_prepared_create",["number","string"],[e,t]);if(n!==se.SUCCESS)throw new Error(ie(this.mod,i,o));return Ae(this.mod),i}closePrepared(e,t){let[n,i,o]=le(this.mod,"duckdb_web_prepared_close",["number","number"],[e,t]);if(n!==se.SUCCESS)throw new Error(ie(this.mod,i,o));Ae(this.mod)}runPrepared(e,t,n){let[i,o,a]=le(this.mod,"duckdb_web_prepared_run",["number","number","string"],[e,t,JSON.stringify(n)]);if(i!==se.SUCCESS)throw new Error(ie(this.mod,o,a));let u=yn(this.mod,o,a);return Ae(this.mod),u}sendPrepared(e,t,n){let[i,o,a]=le(this.mod,"duckdb_web_prepared_send",["number","number","string"],[e,t,JSON.stringify(n)]);if(i!==se.SUCCESS)throw new Error(ie(this.mod,o,a));let u=yn(this.mod,o,a);return Ae(this.mod),u}insertArrowFromIPCStream(e,t,n){let i=this.mod._malloc(t.length);this.mod.HEAPU8.subarray(i,i+t.length).set(t);let a=n?JSON.stringify(n):"",[u,f,s]=le(this.mod,"duckdb_web_insert_arrow_from_ipc_stream",["number","number","number","string"],[e,i,t.length,a]);if(u!==se.SUCCESS)throw new Error(ie(this.mod,f,s))}insertCSVFromPath(e,t,n){if(n.columns!==void 0){n.columnsFlat=[];for(let s in n.columns)n.columnsFlat.push(hs(s,n.columns[s]))}let i={...n};i.columns=i.columnsFlat,delete i.columnsFlat;let o=JSON.stringify(i),[a,u,f]=le(this.mod,"duckdb_web_insert_csv_from_path",["number","string","string"],[e,t,o]);if(a!==se.SUCCESS)throw new Error(ie(this.mod,u,f))}insertJSONFromPath(e,t,n){if(n.columns!==void 0){n.columnsFlat=[];for(let s in n.columns)n.columnsFlat.push(hs(s,n.columns[s]))}let i={...n};i.columns=i.columnsFlat,delete i.columnsFlat;let o=JSON.stringify(i),[a,u,f]=le(this.mod,"duckdb_web_insert_json_from_path",["number","string","string"],[e,t,o]);if(a!==se.SUCCESS)throw new Error(ie(this.mod,u,f))}registerFileURL(e,t){t===void 0&&(t=e);let[n,i,o]=le(this.mod,"duckdb_web_fs_register_file_url",["string","string"],[e,t]);if(n!==se.SUCCESS)throw new Error(ie(this.mod,i,o));Ae(this.mod)}registerFileText(e,t){let n=tD.encode(t);this.registerFileBuffer(e,n)}registerFileBuffer(e,t){let n=this.mod._malloc(t.length);this.mod.HEAPU8.subarray(n,n+t.length).set(t);let[o,a,u]=le(this.mod,"duckdb_web_fs_register_file_buffer",["string","number","number"],[e,n,t.length]);if(o!==se.SUCCESS)throw new Error(ie(this.mod,a,u));Ae(this.mod)}registerFileHandle(e,t){let[n,i,o]=le(this.mod,"duckdb_web_fs_register_file_url",["string","string"],[e,e]);if(n!==se.SUCCESS)throw new Error(ie(this.mod,i,o));if(Ae(this.mod),globalThis.DUCKDB_RUNTIME._files=(globalThis.DUCKDB_RUNTIME._files||new Map).set(e,t),this.pthread){for(let a of this.pthread.runningWorkers)a.postMessage({cmd:"registerFileHandle",fileName:e,fileHandle:t});for(let a of this.pthread.unusedWorkers)a.postMessage({cmd:"dropFileHandle",fileName:e})}}dropFile(e){return this.mod.ccall("duckdb_web_fs_drop_file","boolean",["string"],[e])}dropFiles(){this.mod.ccall("duckdb_web_fs_drop_files",null,[],[])}flushFiles(){this.mod.ccall("duckdb_web_flush_files",null,[],[])}copyFileToPath(e,t){let[n,i,o]=le(this.mod,"duckdb_web_copy_file_to_path",["string","string"],[e,t]);if(n!==se.SUCCESS)throw new Error(ie(this.mod,i,o));Ae(this.mod)}copyFileToBuffer(e){let[t,n,i]=le(this.mod,"duckdb_web_copy_file_to_buffer",["string"],[e]);if(t!==se.SUCCESS)throw new Error(ie(this.mod,n,i));let o=this.mod.HEAPU8.subarray(n,n+i),a=new Uint8Array(o.length);return a.set(o),Ae(this.mod),a}collectFileStatistics(e,t){let[n,i,o]=le(this.mod,"duckdb_web_collect_file_stats",["string","boolean"],[e,t]);if(n!==se.SUCCESS)throw new Error(ie(this.mod,i,o))}exportFileStatistics(e){let[t,n,i]=le(this.mod,"duckdb_web_export_file_stats",["string"],[e]);if(t!==se.SUCCESS)throw new Error(ie(this.mod,n,i));return new Fa(this.mod.HEAPU8.subarray(n,n+i))}};var sd;(function(t){t.ROW_ARRAY="row-array",t.COLUMN_OBJECT="column-object"})(sd||(sd={}));var od;(function(t){t[t.APPEND=0]="APPEND",t[t.IMPORT=1]="IMPORT"})(od||(od={}));var Ub={},rD=function(){var r=Ub.url;return function(e){e=e||{};var t=typeof e!="undefined"?e:{},n,i;t.ready=new Promise(function(h,p){n=h,i=p});var o={},a;for(a in t)t.hasOwnProperty(a)&&(o[a]=t[a]);var u=[],f="./this.program",s=function(h,p){throw p},c=typeof window=="object",_=typeof importScripts=="function",U=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",J="";function Qe(h){return t.locateFile?t.locateFile(h,J):J+h}var Ft,Bt,bn,Pb;function Nb(h){if(!(h instanceof Is)){var p=h;Jr("exiting due to exception: "+p)}}var mn,_n;U?(_?J=Ua().dirname(J)+"/":J=__dirname+"/",Ft=function(p,m){return mn||(mn=ad()),_n||(_n=Ua()),p=_n.normalize(p),mn.readFileSync(p,m?null:"utf8")},bn=function(p){var m=Ft(p,!0);return m.buffer||(m=new Uint8Array(m)),cd(m.buffer),m},Bt=function(p,m,I){mn||(mn=ad()),_n||(_n=Ua()),p=_n.normalize(p),mn.readFile(p,function(L,K){L?I(L):m(K.buffer)})},process.argv.length>1&&(f=process.argv[1].replace(/\\/g,"/")),u=process.argv.slice(2),process.on("uncaughtException",function(h){if(!(h instanceof Is))throw h}),process.on("unhandledRejection",function(h){throw h}),s=function(h,p){if(Na())throw process.exitCode=h,p;Nb(p),process.exit(h)},t.inspect=function(){return"[Emscripten Module object]"}):(c||_)&&(_?J=self.location.href:typeof document!="undefined"&&document.currentScript&&(J=document.currentScript.src),r&&(J=r),J.indexOf("blob:")!==0?J=J.substr(0,J.replace(/[?#].*/,"").lastIndexOf("/")+1):J="",Ft=function(h){var p=new XMLHttpRequest;return p.open("GET",h,!1),p.send(null),p.responseText},_&&(bn=function(h){var p=new XMLHttpRequest;return p.open("GET",h,!1),p.responseType="arraybuffer",p.send(null),new Uint8Array(p.response)}),Bt=function(h,p,m){var I=new XMLHttpRequest;I.open("GET",h,!0),I.responseType="arraybuffer",I.onload=function(){if(I.status==200||I.status==0&&I.response){p(I.response);return}m()},I.onerror=m,I.send(null)},Pb=function(h){document.title=h});var Rb=t.print||console.log.bind(console),Jr=t.printErr||console.warn.bind(console);for(a in o)o.hasOwnProperty(a)&&(t[a]=o[a]);o=null,t.arguments&&(u=t.arguments),t.thisProgram&&(f=t.thisProgram),t.quit&&(s=t.quit);var Bi;t.wasmBinary&&(Bi=t.wasmBinary);var xb=t.noExitRuntime||!0;typeof WebAssembly!="object"&&er("no native wasm support detected");var ps,Va=!1,ys;function cd(h,p){h||er("Assertion failed: "+p)}function jb(h){var p=t["_"+h];return cd(p,"Cannot call unknown function "+h+", make sure it is exported"),p}function Eb(h,p,m,I,L){var K={string:function(Fe){var tr=0;if(Fe!=null&&Fe!==0){var Ii=(Fe.length<<2)+1;tr=La(Ii),Lb(Fe,tr,Ii)}return tr},array:function(Fe){var tr=La(Fe.length);return hd(Fe,tr),tr}};function q(Fe){return p==="string"?bs(Fe):p==="boolean"?Boolean(Fe):Fe}var Y=jb(h),pe=[],Mt=0;if(I)for(var Ut=0;Ut<I.length;Ut++){var Ti=K[m[Ut]];Ti?(Mt===0&&(Mt=wd()),pe[Ut]=Ti(I[Ut])):pe[Ut]=I[Ut]}var $e=Y.apply(null,pe);function Vt(Fe){return Mt!==0&&Td(Mt),q(Fe)}return $e=Vt($e),$e}var ld=typeof TextDecoder!="undefined"?new TextDecoder("utf8"):void 0;function dd(h,p,m){for(var I=p+m,L=p;h[L]&&!(L>=I);)++L;if(L-p>16&&h.subarray&&ld)return ld.decode(h.subarray(p,L));for(var K="";p<L;){var q=h[p++];if(!(q&128)){K+=String.fromCharCode(q);continue}var Y=h[p++]&63;if((q&224)==192){K+=String.fromCharCode((q&31)<<6|Y);continue}var pe=h[p++]&63;if((q&240)==224?q=(q&15)<<12|Y<<6|pe:q=(q&7)<<18|Y<<12|pe<<6|h[p++]&63,q<65536)K+=String.fromCharCode(q);else{var Mt=q-65536;K+=String.fromCharCode(55296|Mt>>10,56320|Mt&1023)}}return K}function bs(h,p){return h?dd(Bn,h,p):""}function fd(h,p,m,I){if(!(I>0))return 0;for(var L=m,K=m+I-1,q=0;q<h.length;++q){var Y=h.charCodeAt(q);if(Y>=55296&&Y<=57343){var pe=h.charCodeAt(++q);Y=65536+((Y&1023)<<10)|pe&1023}if(Y<=127){if(m>=K)break;p[m++]=Y}else if(Y<=2047){if(m+1>=K)break;p[m++]=192|Y>>6,p[m++]=128|Y&63}else if(Y<=65535){if(m+2>=K)break;p[m++]=224|Y>>12,p[m++]=128|Y>>6&63,p[m++]=128|Y&63}else{if(m+3>=K)break;p[m++]=240|Y>>18,p[m++]=128|Y>>12&63,p[m++]=128|Y>>6&63,p[m++]=128|Y&63}}return p[m]=0,m-L}function Lb(h,p,m){return fd(h,Bn,p,m)}function kb(h){for(var p=0,m=0;m<h.length;++m){var I=h.charCodeAt(m);I>=55296&&I<=57343&&(I=65536+((I&1023)<<10)|h.charCodeAt(++m)&1023),I<=127?++p:I<=2047?p+=2:I<=65535?p+=3:p+=4}return p}function hd(h,p){gn.set(h,p)}function Cb(h,p,m){for(var I=0;I<h.length;++I)gn[p++>>0]=h.charCodeAt(I);m||(gn[p>>0]=0)}function qb(h,p){return h%p>0&&(h+=p-h%p),h}var pd,gn,Bn,zb,Wb,ce,Yb,Hb,$b;function yd(h){pd=h,t.HEAP8=gn=new Int8Array(h),t.HEAP16=zb=new Int16Array(h),t.HEAP32=ce=new Int32Array(h),t.HEAPU8=Bn=new Uint8Array(h),t.HEAPU16=Wb=new Uint16Array(h),t.HEAPU32=Yb=new Uint32Array(h),t.HEAPF32=Hb=new Float32Array(h),t.HEAPF64=$b=new Float64Array(h)}var iD=t.INITIAL_MEMORY||16777216,Pa,bd=[],md=[],Jb=[],_d=[],Kb=!1,Gb=!1,Qb=0;function Na(){return xb||Qb>0}function Xb(){if(t.preRun)for(typeof t.preRun=="function"&&(t.preRun=[t.preRun]);t.preRun.length;)nm(t.preRun.shift());ms(bd)}function Zb(){Kb=!0,ms(md)}function em(){ms(Jb)}function tm(){Gb=!0}function rm(){if(t.postRun)for(typeof t.postRun=="function"&&(t.postRun=[t.postRun]);t.postRun.length;)sm(t.postRun.shift());ms(_d)}function nm(h){bd.unshift(h)}function im(h){md.unshift(h)}function sm(h){_d.unshift(h)}var Kr=0,Ra=null,vi=null;function om(h){Kr++,t.monitorRunDependencies&&t.monitorRunDependencies(Kr)}function am(h){if(Kr--,t.monitorRunDependencies&&t.monitorRunDependencies(Kr),Kr==0&&(Ra!==null&&(clearInterval(Ra),Ra=null),vi)){var p=vi;vi=null,p()}}t.preloadedImages={},t.preloadedAudios={};function er(h){t.onAbort&&t.onAbort(h),h="Aborted("+h+")",Jr(h),Va=!0,ys=1,h+=". Build with -s ASSERTIONS=1 for more info.";var p=new WebAssembly.RuntimeError(h);throw i(p),p}var um="data:application/octet-stream;base64,";function gd(h){return h.startsWith(um)}var st;t.locateFile?(st="duckdb_wasm.wasm",gd(st)||(st=Qe(st))):st=new URL("duckdb_wasm.wasm",Ub.url).toString();function Bd(h){try{if(h==st&&Bi)return new Uint8Array(Bi);if(bn)return bn(h);throw"both async and sync fetching of the wasm failed"}catch(p){er(p)}}function cm(){return!Bi&&(c||_)&&typeof fetch=="function"?fetch(st,{credentials:"same-origin"}).then(function(h){if(!h.ok)throw"failed to load wasm binary file at '"+st+"'";return h.arrayBuffer()}).catch(function(){return Bd(st)}):Promise.resolve().then(function(){return Bd(st)})}function lm(){var h={a:f_};function p(q,Y){var pe=q.exports;t.asm=pe,ps=t.asm.W,yd(ps.buffer),Pa=t.asm.Z,im(t.asm.X),am("wasm-instantiate")}om("wasm-instantiate");function m(q){p(q.instance)}function I(q){return cm().then(function(Y){return WebAssembly.instantiate(Y,h)}).then(function(Y){return Y}).then(q,function(Y){Jr("failed to asynchronously prepare wasm: "+Y),er(Y)})}function L(){return!Bi&&typeof WebAssembly.instantiateStreaming=="function"&&!gd(st)&&typeof fetch=="function"?fetch(st,{credentials:"same-origin"}).then(function(q){var Y=WebAssembly.instantiateStreaming(q,h);return Y.then(m,function(pe){return Jr("wasm streaming compile failed: "+pe),Jr("falling back to ArrayBuffer instantiation"),I(m)})}):I(m)}if(t.instantiateWasm)try{var K=t.instantiateWasm(h,p);return K}catch(q){return Jr("Module.instantiateWasm callback failed with error: "+q),!1}return L().catch(i),{}}function ms(h){for(;h.length>0;){var p=h.shift();if(typeof p=="function"){p(t);continue}var m=p.func;typeof m=="number"?p.arg===void 0?Pa.get(m)():Pa.get(m)(p.arg):m(p.arg===void 0?null:p.arg)}}function dm(h){if(h instanceof Is||h=="unwind")return ys;s(1,h)}var Ne={mappings:{},buffers:[null,[],[]],printChar:function(h,p){var m=Ne.buffers[h];p===0||p===10?((h===1?Rb:Jr)(dd(m,0)),m.length=0):m.push(p)},varargs:void 0,get:function(){Ne.varargs+=4;var h=ce[Ne.varargs-4>>2];return h},getStr:function(h){var p=bs(h);return p},get64:function(h,p){return h}};function fm(h,p){return h=Ne.getStr(h),Ne.doAccess(h,p)}function hm(h){return ce[vd()>>2]=h,h}function pm(h,p,m){return Ne.varargs=m,0}function ym(h,p){}function bm(h,p,m,I){}function mm(h,p,m){}function _m(){return 42}function gm(h,p,m){return Ne.varargs=m,0}function Bm(h,p,m){return 0}function vm(h,p){return h=Ne.getStr(h),Ne.doMkdir(h,p)}function wm(h,p,m){Ne.varargs=m}function Tm(h,p){}function Im(h){}function Sm(h,p){}function Dm(h){}function Om(h,p){er("To use dlopen, you need to use Emscripten's linking support, see https://github.com/emscripten-core/emscripten/wiki/Linking")}function Am(h,p){er("To use dlopen, you need to use Emscripten's linking support, see https://github.com/emscripten-core/emscripten/wiki/Linking")}function Fm(){er("")}var xa;U?xa=function(){var h=process.hrtime();return h[0]*1e3+h[1]/1e6}:xa=function(){return performance.now()};var Mm=!0;function Um(h,p){var m;if(h===0)m=Date.now();else if((h===1||h===4)&&Mm)m=xa();else return hm(28),-1;return ce[p>>2]=m/1e3|0,ce[p+4>>2]=m%1e3*1e3*1e3|0,0}function Vm(h,p){return globalThis.DUCKDB_RUNTIME.createDirectory(t,h,p)}function Pm(h,p){return globalThis.DUCKDB_RUNTIME.checkDirectory(t,h,p)}function Nm(h,p){return globalThis.DUCKDB_RUNTIME.listDirectoryEntries(t,h,p)}function Rm(h,p){return globalThis.DUCKDB_RUNTIME.removeDirectory(t,h,p)}function xm(h){return globalThis.DUCKDB_RUNTIME.closeFile(t,h)}function jm(h,p){return globalThis.DUCKDB_RUNTIME.checkFile(t,h,p)}function Em(h){return globalThis.DUCKDB_RUNTIME.getLastFileModificationTime(t,h)}function Lm(h){return globalThis.DUCKDB_RUNTIME.getFileSize(t,h)}function km(h,p,m,I){return globalThis.DUCKDB_RUNTIME.moveFile(t,h,p,m,I)}function Cm(h){return globalThis.DUCKDB_RUNTIME.openFile(t,h)}function qm(h,p,m,I){return globalThis.DUCKDB_RUNTIME.readFile(t,h,p,m,I)}function zm(h,p){return globalThis.DUCKDB_RUNTIME.truncateFile(t,h,p)}function Wm(h,p,m,I){return globalThis.DUCKDB_RUNTIME.writeFile(t,h,p,m,I)}function Ym(h,p){return globalThis.DUCKDB_RUNTIME.glob(t,h,p)}function Hm(h){return globalThis.DUCKDB_RUNTIME.testPlatformFeature(t,h)}function $m(){return 2147483648}function Jm(h,p,m){Bn.copyWithin(h,p,p+m)}function Km(h){try{return ps.grow(h-pd.byteLength+65535>>>16),yd(ps.buffer),1}catch{}}function Gm(h){var p=Bn.length;h=h>>>0;var m=2147483648;if(h>m)return!1;for(var I=1;I<=4;I*=2){var L=p*(1+.2/I);L=Math.min(L,h+100663296);var K=Math.min(m,qb(Math.max(h,L),65536)),q=Km(K);if(q)return!0}return!1}var ja={};function Qm(){return f||"./this.program"}function wi(){if(!wi.strings){var h=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",p={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:h,_:Qm()};for(var m in ja)ja[m]===void 0?delete p[m]:p[m]=ja[m];var I=[];for(var m in p)I.push(m+"="+p[m]);wi.strings=I}return wi.strings}function Xm(h,p){var m=0;return wi().forEach(function(I,L){var K=p+m;ce[h+L*4>>2]=K,Cb(I,K),m+=I.length+1}),0}function Zm(h,p){var m=wi();ce[h>>2]=m.length;var I=0;return m.forEach(function(L){I+=L.length+1}),ce[p>>2]=I,0}function e_(h){return 0}function t_(h,p){var m=h==1||h==2?2:er();return gn[p>>0]=m,0}function r_(h,p,m,I,L,K){var q=Ne.getStreamFromFD(h),Y=Ne.doReadv(q,p,m,I);return ce[K>>2]=Y,0}function n_(h,p,m,I,L,K){var q=Ne.getStreamFromFD(h),Y=Ne.doWritev(q,p,m,I);return ce[K>>2]=Y,0}function i_(h,p,m,I){var L=Ne.getStreamFromFD(h),K=Ne.doReadv(L,p,m);return ce[I>>2]=K,0}function s_(h,p,m,I,L){}function o_(h){var p=Ne.getStreamFromFD(h);return p.stream_ops&&p.stream_ops.fsync?-p.stream_ops.fsync(p):0}function a_(h,p,m,I){for(var L=0,K=0;K<m;K++){for(var q=ce[p+K*8>>2],Y=ce[p+(K*8+4)>>2],pe=0;pe<Y;pe++)Ne.printChar(h,Bn[q+pe]);L+=Y}return ce[I>>2]=L,0}function u_(){if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function"){var h=new Uint8Array(1);return function(){return crypto.getRandomValues(h),h[0]}}else if(U)try{var p=Fb();return function(){return p.randomBytes(1)[0]}}catch{}return function(){er("randomDevice")}}function _s(h,p){_s.randomDevice||(_s.randomDevice=u_());for(var m=0;m<p;m++)gn[h+m>>0]=_s.randomDevice();return 0}function gs(h){return h%4==0&&(h%100!=0||h%400==0)}function Ea(h,p){for(var m=0,I=0;I<=p;m+=h[I++]);return m}var Bs=[31,29,31,30,31,30,31,31,30,31,30,31],vs=[31,28,31,30,31,30,31,31,30,31,30,31];function ws(h,p){for(var m=new Date(h.getTime());p>0;){var I=gs(m.getFullYear()),L=m.getMonth(),K=(I?Bs:vs)[L];if(p>K-m.getDate())p-=K-m.getDate()+1,m.setDate(1),L<11?m.setMonth(L+1):(m.setMonth(0),m.setFullYear(m.getFullYear()+1));else return m.setDate(m.getDate()+p),m}return m}function c_(h,p,m,I){var L=ce[I+40>>2],K={tm_sec:ce[I>>2],tm_min:ce[I+4>>2],tm_hour:ce[I+8>>2],tm_mday:ce[I+12>>2],tm_mon:ce[I+16>>2],tm_year:ce[I+20>>2],tm_wday:ce[I+24>>2],tm_yday:ce[I+28>>2],tm_isdst:ce[I+32>>2],tm_gmtoff:ce[I+36>>2],tm_zone:L?bs(L):""},q=bs(m),Y={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var pe in Y)q=q.replace(new RegExp(pe,"g"),Y[pe]);var Mt=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],Ut=["January","February","March","April","May","June","July","August","September","October","November","December"];function Ti(S,V,Me){for(var ae=typeof S=="number"?S.toString():S||"";ae.length<V;)ae=Me[0]+ae;return ae}function $e(S,V){return Ti(S,V,"0")}function Vt(S,V){function Me(Pt){return Pt<0?-1:Pt>0?1:0}var ae;return(ae=Me(S.getFullYear()-V.getFullYear()))===0&&(ae=Me(S.getMonth()-V.getMonth()))===0&&(ae=Me(S.getDate()-V.getDate())),ae}function Fe(S){switch(S.getDay()){case 0:return new Date(S.getFullYear()-1,11,29);case 1:return S;case 2:return new Date(S.getFullYear(),0,3);case 3:return new Date(S.getFullYear(),0,2);case 4:return new Date(S.getFullYear(),0,1);case 5:return new Date(S.getFullYear()-1,11,31);case 6:return new Date(S.getFullYear()-1,11,30)}}function tr(S){var V=ws(new Date(S.tm_year+1900,0,1),S.tm_yday),Me=new Date(V.getFullYear(),0,4),ae=new Date(V.getFullYear()+1,0,4),Pt=Fe(Me),pr=Fe(ae);return Vt(Pt,V)<=0?Vt(pr,V)<=0?V.getFullYear()+1:V.getFullYear():V.getFullYear()-1}var Ii={"%a":function(S){return Mt[S.tm_wday].substring(0,3)},"%A":function(S){return Mt[S.tm_wday]},"%b":function(S){return Ut[S.tm_mon].substring(0,3)},"%B":function(S){return Ut[S.tm_mon]},"%C":function(S){var V=S.tm_year+1900;return $e(V/100|0,2)},"%d":function(S){return $e(S.tm_mday,2)},"%e":function(S){return Ti(S.tm_mday,2," ")},"%g":function(S){return tr(S).toString().substring(2)},"%G":function(S){return tr(S)},"%H":function(S){return $e(S.tm_hour,2)},"%I":function(S){var V=S.tm_hour;return V==0?V=12:V>12&&(V-=12),$e(V,2)},"%j":function(S){return $e(S.tm_mday+Ea(gs(S.tm_year+1900)?Bs:vs,S.tm_mon-1),3)},"%m":function(S){return $e(S.tm_mon+1,2)},"%M":function(S){return $e(S.tm_min,2)},"%n":function(){return`
|
|
18
|
-
`},"%p":function(S){return S.tm_hour>=0&&S.tm_hour<12?"AM":"PM"},"%S":function(S){return $e(S.tm_sec,2)},"%t":function(){return" "},"%u":function(S){return S.tm_wday||7},"%U":function(S){var V=new Date(S.tm_year+1900,0,1),Me=V.getDay()===0?V:ws(V,7-V.getDay()),ae=new Date(S.tm_year+1900,S.tm_mon,S.tm_mday);if(Vt(Me,ae)<0){var Pt=Ea(gs(ae.getFullYear())?Bs:vs,ae.getMonth()-1)-31,pr=31-Me.getDate(),Gr=pr+Pt+ae.getDate();return $e(Math.ceil(Gr/7),2)}return Vt(Me,V)===0?"01":"00"},"%V":function(S){var V=new Date(S.tm_year+1900,0,4),Me=new Date(S.tm_year+1901,0,4),ae=Fe(V),Pt=Fe(Me),pr=ws(new Date(S.tm_year+1900,0,1),S.tm_yday);if(Vt(pr,ae)<0)return"53";if(Vt(Pt,pr)<=0)return"01";var Gr;return ae.getFullYear()<S.tm_year+1900?Gr=S.tm_yday+32-ae.getDate():Gr=S.tm_yday+1-ae.getDate(),$e(Math.ceil(Gr/7),2)},"%w":function(S){return S.tm_wday},"%W":function(S){var V=new Date(S.tm_year,0,1),Me=V.getDay()===1?V:ws(V,V.getDay()===0?1:7-V.getDay()+1),ae=new Date(S.tm_year+1900,S.tm_mon,S.tm_mday);if(Vt(Me,ae)<0){var Pt=Ea(gs(ae.getFullYear())?Bs:vs,ae.getMonth()-1)-31,pr=31-Me.getDate(),Gr=pr+Pt+ae.getDate();return $e(Math.ceil(Gr/7),2)}return Vt(Me,V)===0?"01":"00"},"%y":function(S){return(S.tm_year+1900).toString().substring(2)},"%Y":function(S){return S.tm_year+1900},"%z":function(S){var V=S.tm_gmtoff,Me=V>=0;return V=Math.abs(V)/60,V=V/60*100+V%60,(Me?"+":"-")+String("0000"+V).slice(-4)},"%Z":function(S){return S.tm_zone},"%%":function(){return"%"}};for(var pe in Ii)q.includes(pe)&&(q=q.replace(new RegExp(pe,"g"),Ii[pe](K)));var Ca=d_(q,!1);return Ca.length>p?0:(hd(Ca,h),Ca.length-1)}function l_(h,p,m,I){return c_(h,p,m,I)}function d_(h,p,m){var I=m>0?m:kb(h)+1,L=new Array(I),K=fd(h,L,0,L.length);return p&&(L.length=K),L}var f_={u:fm,e:pm,O:ym,N:bm,P:mm,j:_m,R:gm,M:Bm,Q:vm,m:wm,s:Tm,i:Im,l:Sm,k:Dm,x:Om,v:Am,a:Fm,h:Um,D:Vm,E:Pm,B:Nm,C:Rm,w:xm,z:jm,G:Em,J:Lm,A:km,K:Cm,d:qm,F:zm,I:Wm,y:Ym,g:Hm,H:$m,U:Jm,V:Gm,T:Xm,n:Zm,b:e_,o:t_,q:r_,p:n_,f:i_,r:s_,t:o_,c:a_,L:_s,S:l_},sD=lm(),h_=t.___wasm_call_ctors=function(){return(h_=t.___wasm_call_ctors=t.asm.X).apply(null,arguments)},p_=t._main=function(){return(p_=t._main=t.asm.Y).apply(null,arguments)},y_=t._duckdb_web_fs_glob_add_path=function(){return(y_=t._duckdb_web_fs_glob_add_path=t.asm._).apply(null,arguments)},b_=t._duckdb_web_clear_response=function(){return(b_=t._duckdb_web_clear_response=t.asm.$).apply(null,arguments)},m_=t._duckdb_web_fail_with=function(){return(m_=t._duckdb_web_fail_with=t.asm.aa).apply(null,arguments)},__=t._duckdb_web_reset=function(){return(__=t._duckdb_web_reset=t.asm.ba).apply(null,arguments)},g_=t._duckdb_web_connect=function(){return(g_=t._duckdb_web_connect=t.asm.ca).apply(null,arguments)},B_=t._duckdb_web_disconnect=function(){return(B_=t._duckdb_web_disconnect=t.asm.da).apply(null,arguments)},v_=t._duckdb_web_flush_files=function(){return(v_=t._duckdb_web_flush_files=t.asm.ea).apply(null,arguments)},w_=t._duckdb_web_flush_file=function(){return(w_=t._duckdb_web_flush_file=t.asm.fa).apply(null,arguments)},T_=t._duckdb_web_open=function(){return(T_=t._duckdb_web_open=t.asm.ga).apply(null,arguments)},I_=t._duckdb_web_collect_file_stats=function(){return(I_=t._duckdb_web_collect_file_stats=t.asm.ha).apply(null,arguments)},S_=t._duckdb_web_export_file_stats=function(){return(S_=t._duckdb_web_export_file_stats=t.asm.ia).apply(null,arguments)},D_=t._duckdb_web_fs_drop_file=function(){return(D_=t._duckdb_web_fs_drop_file=t.asm.ja).apply(null,arguments)},O_=t._duckdb_web_fs_drop_files=function(){return(O_=t._duckdb_web_fs_drop_files=t.asm.ka).apply(null,arguments)},A_=t._duckdb_web_fs_get_file_info=function(){return(A_=t._duckdb_web_fs_get_file_info=t.asm.la).apply(null,arguments)},F_=t._duckdb_web_fs_set_file_descriptor=function(){return(F_=t._duckdb_web_fs_set_file_descriptor=t.asm.ma).apply(null,arguments)},M_=t._duckdb_web_fs_register_file_url=function(){return(M_=t._duckdb_web_fs_register_file_url=t.asm.na).apply(null,arguments)},U_=t._duckdb_web_fs_register_file_buffer=function(){return(U_=t._duckdb_web_fs_register_file_buffer=t.asm.oa).apply(null,arguments)},V_=t._duckdb_web_copy_file_to_buffer=function(){return(V_=t._duckdb_web_copy_file_to_buffer=t.asm.pa).apply(null,arguments)},P_=t._duckdb_web_copy_file_to_path=function(){return(P_=t._duckdb_web_copy_file_to_path=t.asm.qa).apply(null,arguments)},N_=t._duckdb_web_get_version=function(){return(N_=t._duckdb_web_get_version=t.asm.ra).apply(null,arguments)},R_=t._duckdb_web_get_feature_flags=function(){return(R_=t._duckdb_web_get_feature_flags=t.asm.sa).apply(null,arguments)},x_=t._duckdb_web_tokenize=function(){return(x_=t._duckdb_web_tokenize=t.asm.ta).apply(null,arguments)},j_=t._duckdb_web_prepared_create=function(){return(j_=t._duckdb_web_prepared_create=t.asm.ua).apply(null,arguments)},E_=t._duckdb_web_prepared_close=function(){return(E_=t._duckdb_web_prepared_close=t.asm.va).apply(null,arguments)},L_=t._duckdb_web_prepared_run=function(){return(L_=t._duckdb_web_prepared_run=t.asm.wa).apply(null,arguments)},k_=t._duckdb_web_prepared_send=function(){return(k_=t._duckdb_web_prepared_send=t.asm.xa).apply(null,arguments)},C_=t._duckdb_web_query_run=function(){return(C_=t._duckdb_web_query_run=t.asm.ya).apply(null,arguments)},q_=t._duckdb_web_query_send=function(){return(q_=t._duckdb_web_query_send=t.asm.za).apply(null,arguments)},z_=t._duckdb_web_query_fetch_results=function(){return(z_=t._duckdb_web_query_fetch_results=t.asm.Aa).apply(null,arguments)},W_=t._duckdb_web_insert_arrow_from_ipc_stream=function(){return(W_=t._duckdb_web_insert_arrow_from_ipc_stream=t.asm.Ba).apply(null,arguments)},Y_=t._duckdb_web_insert_csv_from_path=function(){return(Y_=t._duckdb_web_insert_csv_from_path=t.asm.Ca).apply(null,arguments)},H_=t._duckdb_web_insert_json_from_path=function(){return(H_=t._duckdb_web_insert_json_from_path=t.asm.Da).apply(null,arguments)},vd=t.___errno_location=function(){return(vd=t.___errno_location=t.asm.Ea).apply(null,arguments)},wd=t.stackSave=function(){return(wd=t.stackSave=t.asm.Fa).apply(null,arguments)},Td=t.stackRestore=function(){return(Td=t.stackRestore=t.asm.Ga).apply(null,arguments)},La=t.stackAlloc=function(){return(La=t.stackAlloc=t.asm.Ha).apply(null,arguments)},$_=t._malloc=function(){return($_=t._malloc=t.asm.Ia).apply(null,arguments)},J_=t._free=function(){return(J_=t._free=t.asm.Ja).apply(null,arguments)};t.ccall=Eb;var Ts;function Is(h){this.name="ExitStatus",this.message="Program terminated with exit("+h+")",this.status=h}var K_=!1;vi=function h(){Ts||ka(),Ts||(vi=h)};function G_(h){var p=t._main,m=0,I=0;try{var L=p(m,I);return Q_(L,!0),L}catch(K){return dm(K)}finally{K_=!0}}function ka(h){if(h=h||u,Kr>0||(Xb(),Kr>0))return;function p(){Ts||(Ts=!0,t.calledRun=!0,!Va&&(Zb(),em(),n(t),t.onRuntimeInitialized&&t.onRuntimeInitialized(),Id&&G_(h),rm()))}t.setStatus?(t.setStatus("Running..."),setTimeout(function(){setTimeout(function(){t.setStatus("")},1),p()},1)):p()}t.run=ka;function Q_(h,p){ys=h,Na()||tm(),X_(h)}function X_(h){ys=h,Na()||(t.onExit&&t.onExit(h),Va=!0),s(h,new Is(h))}if(t.preInit)for(typeof t.preInit=="function"&&(t.preInit=[t.preInit]);t.preInit.length>0;)t.preInit.pop()();var Id=!0;return t.noInitialRun&&(Id=!1),ka(),e.ready}}(),Mb=rD;var ud=class extends Ma{constructor(e,t,n,i){super(e,t);this.mainModuleURL=n,this.pthreadWorkerURL=i}locateFile(e,t){if(e.endsWith(".wasm"))return this.mainModuleURL;if(e.endsWith(".worker.js")){if(!this.pthreadWorkerURL)throw new Error("Missing DuckDB worker URL!");return this.pthreadWorkerURL}throw new Error(`WASM instantiation requested unexpected file: prefix=${t} path=${e}`)}instantiateWasm(e,t){return globalThis.DUCKDB_RUNTIME=this._runtime,WebAssembly.instantiateStreaming?WebAssembly.instantiateStreaming(fetch(this.mainModuleURL),e).then(n=>{t(n.instance,n.module)}):fetch(this.mainModuleURL).then(n=>n.arrayBuffer()).then(n=>WebAssembly.instantiate(n,e).then(i=>{t(i.instance,i.module)})).catch(n=>{console.error("Failed to instantiate WASM:",n)}),[]}};var Vb=class extends ud{constructor(e,t,n,i=null){super(e,t,n,i)}instantiateImpl(e){return Mb({...e,instantiateWasm:this.instantiateWasm.bind(this),locateFile:this.locateFile.bind(this)})}};var We={fileInfoCache:new Map,getFileInfo(r,e){try{let t=We.fileInfoCache.get(e);if(t)return t;let[n,i,o]=le(r,"duckdb_web_fs_get_file_info",["number"],[e]);if(n!==se.SUCCESS)throw new Error(ie(r,i,o));let a=ie(r,i,o);Ae(r);let u=JSON.parse(a);if(u==null)return null;let f={...u,blob:null};return We.fileInfoCache.set(e,f),f}catch(t){return Oe(r,t.toString()),null}},testPlatformFeature:(r,e)=>{switch(e){case 1:return typeof BigInt64Array!="undefined";default:return console.warn(`test for unknown feature: ${e}`),!1}},openFile:(r,e)=>{try{We.fileInfoCache.delete(e);let t=We.getFileInfo(r,e);switch(t?.data_protocol){case Le.HTTP:{let n=new XMLHttpRequest;n.open("HEAD",t.data_url,!1),n.setRequestHeader("Range","bytes=0-"),n.send(null);let i=!1;if(n.status==206?i=!0:n.status==200&&(i=n.getResponseHeader("Accept-Ranges")==="bytes"),!i)return Oe(r,`File does not support range requests: ${t.file_name}`),0;break}case Le.NATIVE:{if(!We._files?.get(t.file_name))return Oe(r,`No handle available for file: ${t.file_name}`),0;break}}}catch(t){Oe(r,t.toString())}return 0},glob:(r,e,t)=>{try{let n=ie(r,e,t);if(n.startsWith("http")){let i=new XMLHttpRequest;i.open("HEAD",n,!1),i.setRequestHeader("Range","bytes=0-"),i.send(null);let o=!1;if(i.status==206)o=!0;else if(i.status==200)o=i.getResponseHeader("Accept-Ranges")==="bytes";else{Oe(r,`HEAD request failed: ${n}`);return}if(!o){Oe(r,`File does not support range requests: ${n}`);return}r.ccall("duckdb_web_fs_glob_add_path",null,["string"],[n])}}catch(n){return Oe(r,n.toString()),0}},checkFile:(r,e,t)=>{try{let n=ie(r,e,t);if(n.startsWith("http")){let i=new XMLHttpRequest;i.open("HEAD",n,!1),i.setRequestHeader("Range","bytes=0-"),i.send(null);let o=!1;if(i.status==206)o=!0;else if(i.status==200)o=i.getResponseHeader("Accept-Ranges")==="bytes";else return!1;return!!o}}catch{return!1}return!1},syncFile:(r,e)=>{},closeFile:(r,e)=>{let t=We.getFileInfo(r,e);switch(We.fileInfoCache.delete(e),t?.data_protocol){case Le.HTTP:break;case Le.NATIVE:return}},truncateFile:(r,e,t)=>{switch(We.getFileInfo(r,e)?.data_protocol){case Le.HTTP:Oe(r,"Cannot truncate a http file");return;case Le.NATIVE:Oe(r,"truncateFile not implemented");return}return 0},readFile(r,e,t,n,i){try{let o=We.getFileInfo(r,e);switch(o?.data_protocol){case Le.HTTP:{if(!o.data_url)return Oe(r,`Missing data URL for file ${e}`),0;let a=new XMLHttpRequest;if(a.open("GET",o.data_url,!1),a.responseType="arraybuffer",a.setRequestHeader("Range",`bytes=${i}-${i+n-1}`),a.send(null),a.status==206||a.status==200&&n==a.response.byteLength&&i==0){let u=new Uint8Array(a.response,0,Math.min(a.response.byteLength,n));return r.HEAPU8.set(u,t),u.byteLength}else return a.status==200?(Oe(r,`Range request for ${o.data_url} did not return a partial response: ${a.status} "${a.statusText}"`),0):(Oe(r,`Range request for ${o.data_url} did returned non-success status: ${a.status} "${a.statusText}"`),0)}case Le.NATIVE:{let a=We._files?.get(o.file_name);if(!a)return Oe(r,`No handle available for file: ${o.file_name}`),0;let u=a.slice(i,i+n),f=new Uint8Array(new FileReaderSync().readAsArrayBuffer(u));return r.HEAPU8.set(f,t),f.byteLength}}return 0}catch(o){return Oe(r,o.toString()),0}},writeFile:(r,e,t,n,i)=>{switch(We.getFileInfo(r,e)?.data_protocol){case Le.HTTP:return Oe(r,"Cannot write to HTTP file"),0;case Le.NATIVE:return Oe(r,"writefile not implemented"),0}return 0},getFileSize:(r,e)=>{try{let t=We.getFileInfo(r,e);switch(t?.data_protocol){case Le.NATIVE:{let n=We._files?.get(t.file_name);return n?n.size:(Oe(r,`No handle available for file: ${t.file_name}`),0)}case Le.HTTP:{if(!t.data_url)throw new Error(`Missing data URL for file ${e}`);let n=new XMLHttpRequest;if(n.open("HEAD",t.data_url,!1),n.send(null),n.status==200){let i=n.getResponseHeader("Content-Length");if(i)return parseInt(i);throw Error(`HEAD ${t.data_url} does not contain the HTTP header: Content-Length`)}else throw Error(`HEAD ${t.data_url} returned non-success status: ${n.status} "${n.statusText}"`)}}return 0}catch(t){return Oe(r,t.toString()),0}},getLastFileModificationTime:(r,e)=>{let t=We.getFileInfo(r,e);switch(t?.data_protocol){case Le.NATIVE:{if(!We._files?.get(t.file_name))throw Error(`No handle available for file: ${t.file_name}`);return 0}case Le.HTTP:return new Date().getTime()}return 0},checkDirectory:(r,e,t)=>!1,createDirectory:(r,e,t)=>{},removeDirectory:(r,e,t)=>{},listDirectoryEntries:(r,e,t)=>!1,moveFile:(r,e,t,n,i)=>{},removeFile:(r,e,t)=>{}};return nD;})();
|
|
19
|
-
//# sourceMappingURL=duckdb-browser-sync-next.js.map
|