From bacba007bf736ed4035e21c42b68092cea376270 Mon Sep 17 00:00:00 2001 From: Zachary Blackwood Date: Mon, 12 Sep 2022 13:14:15 -0400 Subject: [PATCH 1/2] Replace streamlit js with minimal version --- .../frontend/streamlit-component-lib.js | 112 +++++------------- 1 file changed, 31 insertions(+), 81 deletions(-) diff --git a/src/st_keyup/frontend/streamlit-component-lib.js b/src/st_keyup/frontend/streamlit-component-lib.js index a1c06c5..85e0e92 100644 --- a/src/st_keyup/frontend/streamlit-component-lib.js +++ b/src/st_keyup/frontend/streamlit-component-lib.js @@ -1,83 +1,33 @@ -(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))n(s);new MutationObserver(s=>{for(const a of s)if(a.type==="childList")for(const i of a.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&n(i)}).observe(document,{childList:!0,subtree:!0});function r(s){const a={};return s.integrity&&(a.integrity=s.integrity),s.referrerpolicy&&(a.referrerPolicy=s.referrerpolicy),s.crossorigin==="use-credentials"?a.credentials="include":s.crossorigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function n(s){if(s.ep)return;s.ep=!0;const a=r(s);fetch(s.href,a)}})();function jo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Fs={exports:{}},R={};/** @license React v16.13.1 - * react-is.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var K=typeof Symbol=="function"&&Symbol.for,$n=K?Symbol.for("react.element"):60103,Wn=K?Symbol.for("react.portal"):60106,Pr=K?Symbol.for("react.fragment"):60107,$r=K?Symbol.for("react.strict_mode"):60108,Wr=K?Symbol.for("react.profiler"):60114,Yr=K?Symbol.for("react.provider"):60109,Hr=K?Symbol.for("react.context"):60110,Yn=K?Symbol.for("react.async_mode"):60111,Kr=K?Symbol.for("react.concurrent_mode"):60111,Jr=K?Symbol.for("react.forward_ref"):60112,Gr=K?Symbol.for("react.suspense"):60113,zo=K?Symbol.for("react.suspense_list"):60120,qr=K?Symbol.for("react.memo"):60115,Zr=K?Symbol.for("react.lazy"):60116,Po=K?Symbol.for("react.block"):60121,$o=K?Symbol.for("react.fundamental"):60117,Wo=K?Symbol.for("react.responder"):60118,Yo=K?Symbol.for("react.scope"):60119;function ct(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case $n:switch(e=e.type,e){case Yn:case Kr:case Pr:case Wr:case $r:case Gr:return e;default:switch(e=e&&e.$$typeof,e){case Hr:case Jr:case Zr:case qr:case Yr:return e;default:return t}}case Wn:return t}}}function Os(e){return ct(e)===Kr}R.AsyncMode=Yn;R.ConcurrentMode=Kr;R.ContextConsumer=Hr;R.ContextProvider=Yr;R.Element=$n;R.ForwardRef=Jr;R.Fragment=Pr;R.Lazy=Zr;R.Memo=qr;R.Portal=Wn;R.Profiler=Wr;R.StrictMode=$r;R.Suspense=Gr;R.isAsyncMode=function(e){return Os(e)||ct(e)===Yn};R.isConcurrentMode=Os;R.isContextConsumer=function(e){return ct(e)===Hr};R.isContextProvider=function(e){return ct(e)===Yr};R.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===$n};R.isForwardRef=function(e){return ct(e)===Jr};R.isFragment=function(e){return ct(e)===Pr};R.isLazy=function(e){return ct(e)===Zr};R.isMemo=function(e){return ct(e)===qr};R.isPortal=function(e){return ct(e)===Wn};R.isProfiler=function(e){return ct(e)===Wr};R.isStrictMode=function(e){return ct(e)===$r};R.isSuspense=function(e){return ct(e)===Gr};R.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Pr||e===Kr||e===Wr||e===$r||e===Gr||e===zo||typeof e=="object"&&e!==null&&(e.$$typeof===Zr||e.$$typeof===qr||e.$$typeof===Yr||e.$$typeof===Hr||e.$$typeof===Jr||e.$$typeof===$o||e.$$typeof===Wo||e.$$typeof===Yo||e.$$typeof===Po)};R.typeOf=ct;(function(e){e.exports=R})(Fs);var Ds=Fs.exports,Ho={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Ko={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},xs={};xs[Ds.ForwardRef]=Ho;xs[Ds.Memo]=Ko;var Ls={exports:{}},k={};/* -object-assign -(c) Sindre Sorhus -@license MIT -*/var Hi=Object.getOwnPropertySymbols,Jo=Object.prototype.hasOwnProperty,Go=Object.prototype.propertyIsEnumerable;function qo(e){if(e==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function Zo(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de",Object.getOwnPropertyNames(e)[0]==="5")return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;var n=Object.getOwnPropertyNames(t).map(function(a){return t[a]});if(n.join("")!=="0123456789")return!1;var s={};return"abcdefghijklmnopqrst".split("").forEach(function(a){s[a]=a}),Object.keys(Object.assign({},s)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}var Qo=Zo()?Object.assign:function(e,t){for(var r,n=qo(e),s,a=1;aSr.length&&Sr.push(e)}function xn(e,t,r,n){var s=typeof e;(s==="undefined"||s==="boolean")&&(e=null);var a=!1;if(e===null)a=!0;else switch(s){case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case Ge:case Xo:a=!0}}if(a)return r(n,e,t===""?"."+yn(e,0):t),1;if(a=0,t=t===""?".":t+":",Array.isArray(e))for(var i=0;i0){const e=new Array(arguments.length);for(let t=0;t>>0)+this.high*4294967296};h.Long.prototype.equals=function(e){return this.low==e.low&&this.high==e.high};h.Long.ZERO=new h.Long(0,0);h.Builder=function(e){if(e)var t=e;else var t=1024;this.bb=h.ByteBuffer.allocate(t),this.space=t,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};h.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};h.Builder.prototype.forceDefaults=function(e){this.force_defaults=e};h.Builder.prototype.dataBuffer=function(){return this.bb};h.Builder.prototype.asUint8Array=function(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())};h.Builder.prototype.prep=function(e,t){e>this.minalign&&(this.minalign=e);for(var r=~(this.bb.capacity()-this.space+t)+1&e-1;this.space=0&&this.vtable[t]==0;t--);for(var r=t+1;t>=0;t--)this.addInt16(this.vtable[t]!=0?e-this.vtable[t]:0);var n=2;this.addInt16(e-this.object_start);var s=(r+n)*h.SIZEOF_SHORT;this.addInt16(s);var a=0,i=this.space;t:for(t=0;t=0;n--)this.writeInt8(r.charCodeAt(n))}this.prep(this.minalign,h.SIZEOF_INT),this.addOffset(e),this.bb.setPosition(this.space)};h.Builder.prototype.requiredField=function(e,t){var r=this.bb.capacity()-e,n=r-this.bb.readInt32(r),s=this.bb.readInt16(n+t)!=0;if(!s)throw new Error("FlatBuffers: field "+t+" must be set")};h.Builder.prototype.startVector=function(e,t,r){this.notNested(),this.vector_num_elems=t,this.prep(h.SIZEOF_INT,e*t),this.prep(r,e*t)};h.Builder.prototype.endVector=function(){return this.writeInt32(this.vector_num_elems),this.offset()};h.Builder.prototype.createString=function(e){if(e instanceof Uint8Array)var t=e;else for(var t=[],r=0;r=56320)n=s;else{var a=e.charCodeAt(r++);n=(s<<10)+a+(65536-(55296<<10)-56320)}n<128?t.push(n):(n<2048?t.push(n>>6&31|192):(n<65536?t.push(n>>12&15|224):t.push(n>>18&7|240,n>>12&63|128),t.push(n>>6&63|128)),t.push(n&63|128))}this.addInt8(0),this.startVector(1,t.length,1),this.bb.setPosition(this.space-=t.length);for(var r=0,i=this.space,o=this.bb.bytes();r>24};h.ByteBuffer.prototype.readUint8=function(e){return this.bytes_[e]};h.ByteBuffer.prototype.readInt16=function(e){return this.readUint16(e)<<16>>16};h.ByteBuffer.prototype.readUint16=function(e){return this.bytes_[e]|this.bytes_[e+1]<<8};h.ByteBuffer.prototype.readInt32=function(e){return this.bytes_[e]|this.bytes_[e+1]<<8|this.bytes_[e+2]<<16|this.bytes_[e+3]<<24};h.ByteBuffer.prototype.readUint32=function(e){return this.readInt32(e)>>>0};h.ByteBuffer.prototype.readInt64=function(e){return new h.Long(this.readInt32(e),this.readInt32(e+4))};h.ByteBuffer.prototype.readUint64=function(e){return new h.Long(this.readUint32(e),this.readUint32(e+4))};h.ByteBuffer.prototype.readFloat32=function(e){return h.int32[0]=this.readInt32(e),h.float32[0]};h.ByteBuffer.prototype.readFloat64=function(e){return h.int32[h.isLittleEndian?0:1]=this.readInt32(e),h.int32[h.isLittleEndian?1:0]=this.readInt32(e+4),h.float64[0]};h.ByteBuffer.prototype.writeInt8=function(e,t){this.bytes_[e]=t};h.ByteBuffer.prototype.writeUint8=function(e,t){this.bytes_[e]=t};h.ByteBuffer.prototype.writeInt16=function(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8};h.ByteBuffer.prototype.writeUint16=function(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8};h.ByteBuffer.prototype.writeInt32=function(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8,this.bytes_[e+2]=t>>16,this.bytes_[e+3]=t>>24};h.ByteBuffer.prototype.writeUint32=function(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8,this.bytes_[e+2]=t>>16,this.bytes_[e+3]=t>>24};h.ByteBuffer.prototype.writeInt64=function(e,t){this.writeInt32(e,t.low),this.writeInt32(e+4,t.high)};h.ByteBuffer.prototype.writeUint64=function(e,t){this.writeUint32(e,t.low),this.writeUint32(e+4,t.high)};h.ByteBuffer.prototype.writeFloat32=function(e,t){h.float32[0]=t,this.writeInt32(e,h.int32[0])};h.ByteBuffer.prototype.writeFloat64=function(e,t){h.float64[0]=t,this.writeInt32(e,h.int32[h.isLittleEndian?0:1]),this.writeInt32(e+4,h.int32[h.isLittleEndian?1:0])};h.ByteBuffer.prototype.getBufferIdentifier=function(){if(this.bytes_.length>10)+55296,(a&(1<<10)-1)+56320))}return n};h.ByteBuffer.prototype.__indirect=function(e){return e+this.readInt32(e)};h.ByteBuffer.prototype.__vector=function(e){return e+this.readInt32(e)+h.SIZEOF_INT};h.ByteBuffer.prototype.__vector_len=function(e){return this.readInt32(e+this.readInt32(e))};h.ByteBuffer.prototype.__has_identifier=function(e){if(e.length!=h.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: file identifier must be length "+h.FILE_IDENTIFIER_LENGTH);for(var t=0;t57343)s.push(a);else if(56320<=a&&a<=57343)s.push(65533);else if(55296<=a&&a<=56319)if(n===r-1)s.push(65533);else{var i=e.charCodeAt(n+1);if(56320<=i&&i<=57343){var o=a&1023,c=i&1023;s.push(65536+(o<<10)+c),n+=1}else s.push(65533)}n+=1}return s}function Bc(e){for(var t="",r=0;r>10)+55296,(n&1023)+56320))}return t}var Br=-1;function Zn(e){this.tokens=[].slice.call(e)}Zn.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.shift():Br},prepend:function(e){if(Array.isArray(e))for(var t=e;t.length;)this.tokens.unshift(t.pop());else this.tokens.unshift(e)},push:function(e){if(Array.isArray(e))for(var t=e;t.length;)this.tokens.push(t.shift());else this.tokens.push(e)}};var _e=-1;function bn(e,t){if(e)throw TypeError("Decoder error");return t||65533}var Ar="utf-8";function Tr(e,t){if(!(this instanceof Tr))return new Tr(e,t);if(e=e!==void 0?String(e).toLowerCase():Ar,e!==Ar)throw new Error("Encoding not supported. Only utf-8 is supported");t=Qr(t),this._streaming=!1,this._BOMseen=!1,this._decoder=null,this._fatal=Boolean(t.fatal),this._ignoreBOM=Boolean(t.ignoreBOM),Object.defineProperty(this,"encoding",{value:"utf-8"}),Object.defineProperty(this,"fatal",{value:this._fatal}),Object.defineProperty(this,"ignoreBOM",{value:this._ignoreBOM})}Tr.prototype={decode:function(t,r){var n;typeof t=="object"&&t instanceof ArrayBuffer?n=new Uint8Array(t):typeof t=="object"&&"buffer"in t&&t.buffer instanceof ArrayBuffer?n=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):n=new Uint8Array(0),r=Qr(r),this._streaming||(this._decoder=new Ac({fatal:this._fatal}),this._BOMseen=!1),this._streaming=Boolean(r.stream);for(var s=new Zn(n),a=[],i;!s.endOfStream()&&(i=this._decoder.handler(s,s.read()),i!==_e);)i!==null&&(Array.isArray(i)?a.push.apply(a,i):a.push(i));if(!this._streaming){do{if(i=this._decoder.handler(s,s.read()),i===_e)break;i!==null&&(Array.isArray(i)?a.push.apply(a,i):a.push(i))}while(!s.endOfStream());this._decoder=null}return a.length&&["utf-8"].indexOf(this.encoding)!==-1&&!this._ignoreBOM&&!this._BOMseen&&(a[0]===65279?(this._BOMseen=!0,a.shift()):this._BOMseen=!0),Bc(a)}};function Fr(e,t){if(!(this instanceof Fr))return new Fr(e,t);if(e=e!==void 0?String(e).toLowerCase():Ar,e!==Ar)throw new Error("Encoding not supported. Only utf-8 is supported");t=Qr(t),this._streaming=!1,this._encoder=null,this._options={fatal:Boolean(t.fatal)},Object.defineProperty(this,"encoding",{value:"utf-8"})}Fr.prototype={encode:function(t,r){t=t?String(t):"",r=Qr(r),this._streaming||(this._encoder=new Tc(this._options)),this._streaming=Boolean(r.stream);for(var n=[],s=new Zn(Sc(t)),a;!s.endOfStream()&&(a=this._encoder.handler(s,s.read()),a!==_e);)Array.isArray(a)?n.push.apply(n,a):n.push(a);if(!this._streaming){for(;a=this._encoder.handler(s,s.read()),a!==_e;)Array.isArray(a)?n.push.apply(n,a):n.push(a);this._encoder=null}return new Uint8Array(n)}};function Ac(e){var t=e.fatal,r=0,n=0,s=0,a=128,i=191;this.handler=function(o,c){if(c===Br&&s!==0)return s=0,bn(t);if(c===Br)return _e;if(s===0){if(Ut(c,0,127))return c;if(Ut(c,194,223))s=1,r=c-192;else if(Ut(c,224,239))c===224&&(a=160),c===237&&(i=159),s=2,r=c-224;else if(Ut(c,240,244))c===240&&(a=144),c===244&&(i=143),s=3,r=c-240;else return bn(t);return r=r<<6*s,null}if(!Ut(c,a,i))return r=s=n=0,a=128,i=191,o.prepend(c),bn(t);if(a=128,i=191,n+=1,r+=c-128<<6*(s-n),n!==s)return null;var u=r;return r=s=n=0,u}}function Tc(e){e.fatal,this.handler=function(t,r){if(r===Br)return _e;if(Ut(r,0,127))return r;var n,s;Ut(r,128,2047)?(n=1,s=192):Ut(r,2048,65535)?(n=2,s=224):Ut(r,65536,1114111)&&(n=3,s=240);for(var a=[(r>>6*n)+s];n>0;){var i=r>>6*(n-1);a.push(128|i&63),n-=1}return a}}const Or=typeof Buffer=="function"?Buffer:null,Hs=typeof TextDecoder=="function"&&typeof TextEncoder=="function",En=(e=>{if(Hs||!Or){const t=new e("utf-8");return r=>t.decode(r)}return t=>{const{buffer:r,byteOffset:n,length:s}=x(t);return Or.from(r,n,s).toString()}})(typeof TextDecoder<"u"?TextDecoder:Tr),Xr=(e=>{if(Hs||!Or){const t=new e;return r=>t.encode(r)}return(t="")=>x(Or.from(t,"utf8"))})(typeof TextEncoder<"u"?TextEncoder:Fr),$=Object.freeze({done:!0,value:void 0});class Xi{constructor(t){this._json=t}get schema(){return this._json.schema}get batches(){return this._json.batches||[]}get dictionaries(){return this._json.dictionaries||[]}}class ne{tee(){return this._getDOMStream().tee()}pipe(t,r){return this._getNodeStream().pipe(t,r)}pipeTo(t,r){return this._getDOMStream().pipeTo(t,r)}pipeThrough(t,r){return this._getDOMStream().pipeThrough(t,r)}_getDOMStream(){return this._DOMStream||(this._DOMStream=this.toDOMStream())}_getNodeStream(){return this._nodeStream||(this._nodeStream=this.toNodeStream())}}class Fc extends ne{constructor(){super(),this._values=[],this.resolvers=[],this._closedPromise=new Promise(t=>this._closedPromiseResolve=t)}get closed(){return this._closedPromise}async cancel(t){await this.return(t)}write(t){this._ensureOpen()&&(this.resolvers.length<=0?this._values.push(t):this.resolvers.shift().resolve({done:!1,value:t}))}abort(t){this._closedPromiseResolve&&(this.resolvers.length<=0?this._error={error:t}:this.resolvers.shift().reject({done:!0,value:t}))}close(){if(this._closedPromiseResolve){const{resolvers:t}=this;for(;t.length>0;)t.shift().resolve($);this._closedPromiseResolve(),this._closedPromiseResolve=void 0}}[Symbol.asyncIterator](){return this}toDOMStream(t){return it.toDOMStream(this._closedPromiseResolve||this._error?this:this._values,t)}toNodeStream(t){return it.toNodeStream(this._closedPromiseResolve||this._error?this:this._values,t)}async throw(t){return await this.abort(t),$}async return(t){return await this.close(),$}async read(t){return(await this.next(t,"read")).value}async peek(t){return(await this.next(t,"peek")).value}next(...t){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((r,n)=>{this.resolvers.push({resolve:r,reject:n})}):Promise.resolve($)}_ensureOpen(){if(this._closedPromiseResolve)return!0;throw new Error(`${this} is closed`)}}const[Oc,tn]=(()=>{const e=()=>{throw new Error("BigInt is not available in this environment")};function t(){throw e()}return t.asIntN=()=>{throw e()},t.asUintN=()=>{throw e()},typeof BigInt<"u"?[BigInt,!0]:[t,!1]})(),[xe,Sd]=(()=>{const e=()=>{throw new Error("BigInt64Array is not available in this environment")};class t{static get BYTES_PER_ELEMENT(){return 8}static of(){throw e()}static from(){throw e()}constructor(){throw e()}}return typeof BigInt64Array<"u"?[BigInt64Array,!0]:[t,!1]})(),[Ze,Bd]=(()=>{const e=()=>{throw new Error("BigUint64Array is not available in this environment")};class t{static get BYTES_PER_ELEMENT(){return 8}static of(){throw e()}static from(){throw e()}constructor(){throw e()}}return typeof BigUint64Array<"u"?[BigUint64Array,!0]:[t,!1]})(),Dc=e=>typeof e=="number",Ks=e=>typeof e=="boolean",lt=e=>typeof e=="function",at=e=>e!=null&&Object(e)===e,Yt=e=>at(e)&<(e.then),mt=e=>at(e)&<(e[Symbol.iterator]),Ct=e=>at(e)&<(e[Symbol.asyncIterator]),Nn=e=>at(e)&&at(e.schema),Js=e=>at(e)&&"done"in e&&"value"in e,Gs=e=>at(e)&<(e.stat)&&Dc(e.fd),qs=e=>at(e)&&Qn(e.body),xc=e=>at(e)&<(e.abort)&<(e.getWriter)&&!(e instanceof ne),Qn=e=>at(e)&<(e.cancel)&<(e.getReader)&&!(e instanceof ne),Lc=e=>at(e)&<(e.end)&<(e.write)&&Ks(e.writable)&&!(e instanceof ne),Zs=e=>at(e)&<(e.read)&<(e.pipe)&&Ks(e.readable)&&!(e instanceof ne);var Mc=h.ByteBuffer;const Xn=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:ArrayBuffer;function Uc(e){let t=e[0]?[e[0]]:[],r,n,s,a;for(let i,o,c=0,u=0,d=e.length;++cd+y.byteLength,0),s,a,i,o=0,c=-1,u=Math.min(t||1/0,n);for(let d=r.length;++cO(Int8Array,e),Nc=e=>O(Int16Array,e),le=e=>O(Int32Array,e),Qs=e=>O(xe,e),x=e=>O(Uint8Array,e),Vc=e=>O(Uint16Array,e),Cc=e=>O(Uint32Array,e),Xs=e=>O(Ze,e),Rc=e=>O(Float32Array,e),kc=e=>O(Float64Array,e),jc=e=>O(Uint8ClampedArray,e),Vn=e=>(e.next(),e);function*Dt(e,t){const r=function*(s){yield s},n=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof Xn?r(t):mt(t)?t:r(t);yield*Vn(function*(s){let a=null;do a=s.next(yield O(e,a));while(!a.done)}(n[Symbol.iterator]()))}const zc=e=>Dt(Int8Array,e),Pc=e=>Dt(Int16Array,e),$c=e=>Dt(Int32Array,e),ta=e=>Dt(Uint8Array,e),Wc=e=>Dt(Uint16Array,e),Yc=e=>Dt(Uint32Array,e),Hc=e=>Dt(Float32Array,e),Kc=e=>Dt(Float64Array,e),Jc=e=>Dt(Uint8ClampedArray,e);async function*vt(e,t){if(Yt(t))return yield*vt(e,await t);const r=async function*(a){yield await a},n=async function*(a){yield*Vn(function*(i){let o=null;do o=i.next(yield o&&o.value);while(!o.done)}(a[Symbol.iterator]()))},s=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof Xn?r(t):mt(t)?n(t):Ct(t)?t:r(t);yield*Vn(async function*(a){let i=null;do i=await a.next(yield O(e,i));while(!i.done)}(s[Symbol.asyncIterator]()))}const Gc=e=>vt(Int8Array,e),qc=e=>vt(Int16Array,e),Zc=e=>vt(Int32Array,e),ea=e=>vt(Uint8Array,e),Qc=e=>vt(Uint16Array,e),Xc=e=>vt(Uint32Array,e),tu=e=>vt(Float32Array,e),eu=e=>vt(Float64Array,e),ru=e=>vt(Uint8ClampedArray,e);function en(e,t,r){if(e!==0){r=r.slice(0,t+1);for(let n=-1;++n<=t;)r[n]+=e}return r}function ra(e,t){let r=0,n=e.length;if(n!==t.length)return!1;if(n>0)do if(e[r]!==t[r])return!1;while(++r(e.next(),e);function*iu(e){let t,r=!1,n=[],s,a,i,o=0;function c(){return a==="peek"?gt(n,i)[0]:([s,n,o]=gt(n,i),s)}({cmd:a,size:i}=yield null);let u=ta(e)[Symbol.iterator]();try{do if({done:t,value:s}=isNaN(i-o)?u.next(void 0):u.next(i-o),!t&&s.byteLength>0&&(n.push(s),o+=s.byteLength),t||i<=o)do({cmd:a,size:i}=yield c());while(i0&&(n.push(s),o+=s.byteLength),t||i<=o)do({cmd:a,size:i}=yield c());while(i0&&(n.push(x(s)),o+=s.byteLength),t||i<=o)do({cmd:a,size:i}=yield c());while(i{}):Promise.resolve()}releaseLock(){this.reader&&this.reader.releaseLock(),this.reader=this.byobReader=this.defaultReader=null}async cancel(t){const{reader:r,source:n}=this;r&&await r.cancel(t).catch(()=>{}),n&&n.locked&&this.releaseLock()}async read(t){if(t===0)return{done:this.reader==null,value:new Uint8Array(0)};const r=!this.supportsBYOB||typeof t!="number"?await this.getDefaultReader().read():await this.readFromBYOBReader(t);return!r.done&&(r.value=x(r)),r}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(t){return await na(this.getBYOBReader(),new ArrayBuffer(t),0,t)}}async function na(e,t,r,n){if(r>=n)return{done:!1,value:new Uint8Array(t,0,n)};const{done:s,value:a}=await e.read(new Uint8Array(t,r,n-r));return(r+=a.byteLength){let r=s=>n([t,s]),n;return[t,r,new Promise(s=>(n=s)&&e.once(t,r))]};async function*cu(e){let t=[],r="error",n=!1,s=null,a,i,o=0,c=[],u;function d(){return a==="peek"?gt(c,i)[0]:([u,c,o]=gt(c,i),u)}if({cmd:a,size:i}=yield null,e.isTTY)return yield new Uint8Array(0);try{t[0]=mn(e,"end"),t[1]=mn(e,"error");do{if(t[2]=mn(e,"readable"),[r,s]=await Promise.race(t.map(F=>F[2])),r==="error")break;if((n=r==="end")||(isFinite(i-o)?(u=x(e.read(i-o)),u.byteLength0&&(c.push(u),o+=u.byteLength)),n||i<=o)do({cmd:a,size:i}=yield d());while(i{for(const[oe,ko]of F)e.off(oe,ko);try{const oe=e.destroy;oe&&oe.call(e,U),U=void 0}catch(oe){U=oe||U}finally{U!=null?lr(U):Bt()}})}}class L{}var f;(function(e){(function(t){(function(r){(function(n){(function(s){s[s.V1=0]="V1",s[s.V2=1]="V2",s[s.V3=2]="V3",s[s.V4=3]="V4"})(n.MetadataVersion||(n.MetadataVersion={}))})(r.flatbuf||(r.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(f||(f={}));(function(e){(function(t){(function(r){(function(n){(function(s){s[s.Sparse=0]="Sparse",s[s.Dense=1]="Dense"})(n.UnionMode||(n.UnionMode={}))})(r.flatbuf||(r.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(f||(f={}));(function(e){(function(t){(function(r){(function(n){(function(s){s[s.HALF=0]="HALF",s[s.SINGLE=1]="SINGLE",s[s.DOUBLE=2]="DOUBLE"})(n.Precision||(n.Precision={}))})(r.flatbuf||(r.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(f||(f={}));(function(e){(function(t){(function(r){(function(n){(function(s){s[s.DAY=0]="DAY",s[s.MILLISECOND=1]="MILLISECOND"})(n.DateUnit||(n.DateUnit={}))})(r.flatbuf||(r.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(f||(f={}));(function(e){(function(t){(function(r){(function(n){(function(s){s[s.SECOND=0]="SECOND",s[s.MILLISECOND=1]="MILLISECOND",s[s.MICROSECOND=2]="MICROSECOND",s[s.NANOSECOND=3]="NANOSECOND"})(n.TimeUnit||(n.TimeUnit={}))})(r.flatbuf||(r.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(f||(f={}));(function(e){(function(t){(function(r){(function(n){(function(s){s[s.YEAR_MONTH=0]="YEAR_MONTH",s[s.DAY_TIME=1]="DAY_TIME"})(n.IntervalUnit||(n.IntervalUnit={}))})(r.flatbuf||(r.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(f||(f={}));(function(e){(function(t){(function(r){(function(n){(function(s){s[s.NONE=0]="NONE",s[s.Null=1]="Null",s[s.Int=2]="Int",s[s.FloatingPoint=3]="FloatingPoint",s[s.Binary=4]="Binary",s[s.Utf8=5]="Utf8",s[s.Bool=6]="Bool",s[s.Decimal=7]="Decimal",s[s.Date=8]="Date",s[s.Time=9]="Time",s[s.Timestamp=10]="Timestamp",s[s.Interval=11]="Interval",s[s.List=12]="List",s[s.Struct_=13]="Struct_",s[s.Union=14]="Union",s[s.FixedSizeBinary=15]="FixedSizeBinary",s[s.FixedSizeList=16]="FixedSizeList",s[s.Map=17]="Map",s[s.Duration=18]="Duration",s[s.LargeBinary=19]="LargeBinary",s[s.LargeUtf8=20]="LargeUtf8",s[s.LargeList=21]="LargeList"})(n.Type||(n.Type={}))})(r.flatbuf||(r.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(f||(f={}));(function(e){(function(t){(function(r){(function(n){(function(s){s[s.Little=0]="Little",s[s.Big=1]="Big"})(n.Endianness||(n.Endianness={}))})(r.flatbuf||(r.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(f||(f={}));(function(e){(function(t){(function(r){(function(n){class s{constructor(){this.bb=null,this.bb_pos=0}__init(i,o){return this.bb_pos=i,this.bb=o,this}static getRootAsNull(i,o){return(o||new s).__init(i.readInt32(i.position())+i.position(),i)}static startNull(i){i.startObject(0)}static endNull(i){return i.endObject()}static createNull(i){return s.startNull(i),s.endNull(i)}}n.Null=s})(r.flatbuf||(r.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(f||(f={}));(function(e){(function(t){(function(r){(function(n){class s{constructor(){this.bb=null,this.bb_pos=0}__init(i,o){return this.bb_pos=i,this.bb=o,this}static getRootAsStruct_(i,o){return(o||new s).__init(i.readInt32(i.position())+i.position(),i)}static startStruct_(i){i.startObject(0)}static endStruct_(i){return i.endObject()}static createStruct_(i){return s.startStruct_(i),s.endStruct_(i)}}n.Struct_=s})(r.flatbuf||(r.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(f||(f={}));(function(e){(function(t){(function(r){(function(n){class s{constructor(){this.bb=null,this.bb_pos=0}__init(i,o){return this.bb_pos=i,this.bb=o,this}static getRootAsList(i,o){return(o||new s).__init(i.readInt32(i.position())+i.position(),i)}static startList(i){i.startObject(0)}static endList(i){return i.endObject()}static createList(i){return s.startList(i),s.endList(i)}}n.List=s})(r.flatbuf||(r.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(f||(f={}));(function(e){(function(t){(function(r){(function(n){class s{constructor(){this.bb=null,this.bb_pos=0}__init(i,o){return this.bb_pos=i,this.bb=o,this}static getRootAsLargeList(i,o){return(o||new s).__init(i.readInt32(i.position())+i.position(),i)}static startLargeList(i){i.startObject(0)}static endLargeList(i){return i.endObject()}static createLargeList(i){return s.startLargeList(i),s.endLargeList(i)}}n.LargeList=s})(r.flatbuf||(r.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(f||(f={}));(function(e){(function(t){(function(r){(function(n){class s{constructor(){this.bb=null,this.bb_pos=0}__init(i,o){return this.bb_pos=i,this.bb=o,this}static getRootAsFixedSizeList(i,o){return(o||new s).__init(i.readInt32(i.position())+i.position(),i)}listSize(){let i=this.bb.__offset(this.bb_pos,4);return i?this.bb.readInt32(this.bb_pos+i):0}static startFixedSizeList(i){i.startObject(1)}static addListSize(i,o){i.addFieldInt32(0,o,0)}static endFixedSizeList(i){return i.endObject()}static createFixedSizeList(i,o){return s.startFixedSizeList(i),s.addListSize(i,o),s.endFixedSizeList(i)}}n.FixedSizeList=s})(r.flatbuf||(r.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(f||(f={}));(function(e){(function(t){(function(r){(function(n){class s{constructor(){this.bb=null,this.bb_pos=0}__init(i,o){return this.bb_pos=i,this.bb=o,this}static getRootAsMap(i,o){return(o||new s).__init(i.readInt32(i.position())+i.position(),i)}keysSorted(){let i=this.bb.__offset(this.bb_pos,4);return i?!!this.bb.readInt8(this.bb_pos+i):!1}static startMap(i){i.startObject(1)}static addKeysSorted(i,o){i.addFieldInt8(0,+o,0)}static endMap(i){return i.endObject()}static createMap(i,o){return s.startMap(i),s.addKeysSorted(i,o),s.endMap(i)}}n.Map=s})(r.flatbuf||(r.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(f||(f={}));(function(e){(function(t){(function(r){(function(n){class s{constructor(){this.bb=null,this.bb_pos=0}__init(i,o){return this.bb_pos=i,this.bb=o,this}static getRootAsUnion(i,o){return(o||new s).__init(i.readInt32(i.position())+i.position(),i)}mode(){let i=this.bb.__offset(this.bb_pos,4);return i?this.bb.readInt16(this.bb_pos+i):e.apache.arrow.flatbuf.UnionMode.Sparse}typeIds(i){let o=this.bb.__offset(this.bb_pos,6);return o?this.bb.readInt32(this.bb.__vector(this.bb_pos+o)+i*4):0}typeIdsLength(){let i=this.bb.__offset(this.bb_pos,6);return i?this.bb.__vector_len(this.bb_pos+i):0}typeIdsArray(){let i=this.bb.__offset(this.bb_pos,6);return i?new Int32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+i),this.bb.__vector_len(this.bb_pos+i)):null}static startUnion(i){i.startObject(2)}static addMode(i,o){i.addFieldInt16(0,o,e.apache.arrow.flatbuf.UnionMode.Sparse)}static addTypeIds(i,o){i.addFieldOffset(1,o,0)}static createTypeIdsVector(i,o){i.startVector(4,o.length,4);for(let c=o.length-1;c>=0;c--)i.addInt32(o[c]);return i.endVector()}static startTypeIdsVector(i,o){i.startVector(4,o,4)}static endUnion(i){return i.endObject()}static createUnion(i,o,c){return s.startUnion(i),s.addMode(i,o),s.addTypeIds(i,c),s.endUnion(i)}}n.Union=s})(r.flatbuf||(r.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(f||(f={}));(function(e){(function(t){(function(r){(function(n){class s{constructor(){this.bb=null,this.bb_pos=0}__init(i,o){return this.bb_pos=i,this.bb=o,this}static getRootAsInt(i,o){return(o||new s).__init(i.readInt32(i.position())+i.position(),i)}bitWidth(){let i=this.bb.__offset(this.bb_pos,4);return i?this.bb.readInt32(this.bb_pos+i):0}isSigned(){let i=this.bb.__offset(this.bb_pos,6);return i?!!this.bb.readInt8(this.bb_pos+i):!1}static startInt(i){i.startObject(2)}static addBitWidth(i,o){i.addFieldInt32(0,o,0)}static addIsSigned(i,o){i.addFieldInt8(1,+o,0)}static endInt(i){return i.endObject()}static createInt(i,o,c){return s.startInt(i),s.addBitWidth(i,o),s.addIsSigned(i,c),s.endInt(i)}}n.Int=s})(r.flatbuf||(r.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(f||(f={}));(function(e){(function(t){(function(r){(function(n){class s{constructor(){this.bb=null,this.bb_pos=0}__init(i,o){return this.bb_pos=i,this.bb=o,this}static getRootAsFloatingPoint(i,o){return(o||new s).__init(i.readInt32(i.position())+i.position(),i)}precision(){let i=this.bb.__offset(this.bb_pos,4);return i?this.bb.readInt16(this.bb_pos+i):e.apache.arrow.flatbuf.Precision.HALF}static startFloatingPoint(i){i.startObject(1)}static addPrecision(i,o){i.addFieldInt16(0,o,e.apache.arrow.flatbuf.Precision.HALF)}static endFloatingPoint(i){return i.endObject()}static createFloatingPoint(i,o){return s.startFloatingPoint(i),s.addPrecision(i,o),s.endFloatingPoint(i)}}n.FloatingPoint=s})(r.flatbuf||(r.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(f||(f={}));(function(e){(function(t){(function(r){(function(n){class s{constructor(){this.bb=null,this.bb_pos=0}__init(i,o){return this.bb_pos=i,this.bb=o,this}static getRootAsUtf8(i,o){return(o||new s).__init(i.readInt32(i.position())+i.position(),i)}static startUtf8(i){i.startObject(0)}static endUtf8(i){return i.endObject()}static createUtf8(i){return s.startUtf8(i),s.endUtf8(i)}}n.Utf8=s})(r.flatbuf||(r.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(f||(f={}));(function(e){(function(t){(function(r){(function(n){class s{constructor(){this.bb=null,this.bb_pos=0}__init(i,o){return this.bb_pos=i,this.bb=o,this}static getRootAsBinary(i,o){return(o||new s).__init(i.readInt32(i.position())+i.position(),i)}static startBinary(i){i.startObject(0)}static endBinary(i){return i.endObject()}static createBinary(i){return s.startBinary(i),s.endBinary(i)}}n.Binary=s})(r.flatbuf||(r.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(f||(f={}));(function(e){(function(t){(function(r){(function(n){class s{constructor(){this.bb=null,this.bb_pos=0}__init(i,o){return this.bb_pos=i,this.bb=o,this}static getRootAsLargeUtf8(i,o){return(o||new s).__init(i.readInt32(i.position())+i.position(),i)}static startLargeUtf8(i){i.startObject(0)}static endLargeUtf8(i){return i.endObject()}static createLargeUtf8(i){return s.startLargeUtf8(i),s.endLargeUtf8(i)}}n.LargeUtf8=s})(r.flatbuf||(r.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(f||(f={}));(function(e){(function(t){(function(r){(function(n){class s{constructor(){this.bb=null,this.bb_pos=0}__init(i,o){return this.bb_pos=i,this.bb=o,this}static getRootAsLargeBinary(i,o){return(o||new s).__init(i.readInt32(i.position())+i.position(),i)}static startLargeBinary(i){i.startObject(0)}static endLargeBinary(i){return i.endObject()}static createLargeBinary(i){return s.startLargeBinary(i),s.endLargeBinary(i)}}n.LargeBinary=s})(r.flatbuf||(r.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(f||(f={}));(function(e){(function(t){(function(r){(function(n){class s{constructor(){this.bb=null,this.bb_pos=0}__init(i,o){return this.bb_pos=i,this.bb=o,this}static getRootAsFixedSizeBinary(i,o){return(o||new s).__init(i.readInt32(i.position())+i.position(),i)}byteWidth(){let i=this.bb.__offset(this.bb_pos,4);return i?this.bb.readInt32(this.bb_pos+i):0}static startFixedSizeBinary(i){i.startObject(1)}static addByteWidth(i,o){i.addFieldInt32(0,o,0)}static endFixedSizeBinary(i){return i.endObject()}static createFixedSizeBinary(i,o){return s.startFixedSizeBinary(i),s.addByteWidth(i,o),s.endFixedSizeBinary(i)}}n.FixedSizeBinary=s})(r.flatbuf||(r.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(f||(f={}));(function(e){(function(t){(function(r){(function(n){class s{constructor(){this.bb=null,this.bb_pos=0}__init(i,o){return this.bb_pos=i,this.bb=o,this}static getRootAsBool(i,o){return(o||new s).__init(i.readInt32(i.position())+i.position(),i)}static startBool(i){i.startObject(0)}static endBool(i){return i.endObject()}static createBool(i){return s.startBool(i),s.endBool(i)}}n.Bool=s})(r.flatbuf||(r.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(f||(f={}));(function(e){(function(t){(function(r){(function(n){class s{constructor(){this.bb=null,this.bb_pos=0}__init(i,o){return this.bb_pos=i,this.bb=o,this}static getRootAsDecimal(i,o){return(o||new s).__init(i.readInt32(i.position())+i.position(),i)}precision(){let i=this.bb.__offset(this.bb_pos,4);return i?this.bb.readInt32(this.bb_pos+i):0}scale(){let i=this.bb.__offset(this.bb_pos,6);return i?this.bb.readInt32(this.bb_pos+i):0}static startDecimal(i){i.startObject(2)}static addPrecision(i,o){i.addFieldInt32(0,o,0)}static addScale(i,o){i.addFieldInt32(1,o,0)}static endDecimal(i){return i.endObject()}static createDecimal(i,o,c){return s.startDecimal(i),s.addPrecision(i,o),s.addScale(i,c),s.endDecimal(i)}}n.Decimal=s})(r.flatbuf||(r.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(f||(f={}));(function(e){(function(t){(function(r){(function(n){class s{constructor(){this.bb=null,this.bb_pos=0}__init(i,o){return this.bb_pos=i,this.bb=o,this}static getRootAsDate(i,o){return(o||new s).__init(i.readInt32(i.position())+i.position(),i)}unit(){let i=this.bb.__offset(this.bb_pos,4);return i?this.bb.readInt16(this.bb_pos+i):e.apache.arrow.flatbuf.DateUnit.MILLISECOND}static startDate(i){i.startObject(1)}static addUnit(i,o){i.addFieldInt16(0,o,e.apache.arrow.flatbuf.DateUnit.MILLISECOND)}static endDate(i){return i.endObject()}static createDate(i,o){return s.startDate(i),s.addUnit(i,o),s.endDate(i)}}n.Date=s})(r.flatbuf||(r.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(f||(f={}));(function(e){(function(t){(function(r){(function(n){class s{constructor(){this.bb=null,this.bb_pos=0}__init(i,o){return this.bb_pos=i,this.bb=o,this}static getRootAsTime(i,o){return(o||new s).__init(i.readInt32(i.position())+i.position(),i)}unit(){let i=this.bb.__offset(this.bb_pos,4);return i?this.bb.readInt16(this.bb_pos+i):e.apache.arrow.flatbuf.TimeUnit.MILLISECOND}bitWidth(){let i=this.bb.__offset(this.bb_pos,6);return i?this.bb.readInt32(this.bb_pos+i):32}static startTime(i){i.startObject(2)}static addUnit(i,o){i.addFieldInt16(0,o,e.apache.arrow.flatbuf.TimeUnit.MILLISECOND)}static addBitWidth(i,o){i.addFieldInt32(1,o,32)}static endTime(i){return i.endObject()}static createTime(i,o,c){return s.startTime(i),s.addUnit(i,o),s.addBitWidth(i,c),s.endTime(i)}}n.Time=s})(r.flatbuf||(r.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(f||(f={}));(function(e){(function(t){(function(r){(function(n){class s{constructor(){this.bb=null,this.bb_pos=0}__init(i,o){return this.bb_pos=i,this.bb=o,this}static getRootAsTimestamp(i,o){return(o||new s).__init(i.readInt32(i.position())+i.position(),i)}unit(){let i=this.bb.__offset(this.bb_pos,4);return i?this.bb.readInt16(this.bb_pos+i):e.apache.arrow.flatbuf.TimeUnit.SECOND}timezone(i){let o=this.bb.__offset(this.bb_pos,6);return o?this.bb.__string(this.bb_pos+o,i):null}static startTimestamp(i){i.startObject(2)}static addUnit(i,o){i.addFieldInt16(0,o,e.apache.arrow.flatbuf.TimeUnit.SECOND)}static addTimezone(i,o){i.addFieldOffset(1,o,0)}static endTimestamp(i){return i.endObject()}static createTimestamp(i,o,c){return s.startTimestamp(i),s.addUnit(i,o),s.addTimezone(i,c),s.endTimestamp(i)}}n.Timestamp=s})(r.flatbuf||(r.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(f||(f={}));(function(e){(function(t){(function(r){(function(n){class s{constructor(){this.bb=null,this.bb_pos=0}__init(i,o){return this.bb_pos=i,this.bb=o,this}static getRootAsInterval(i,o){return(o||new s).__init(i.readInt32(i.position())+i.position(),i)}unit(){let i=this.bb.__offset(this.bb_pos,4);return i?this.bb.readInt16(this.bb_pos+i):e.apache.arrow.flatbuf.IntervalUnit.YEAR_MONTH}static startInterval(i){i.startObject(1)}static addUnit(i,o){i.addFieldInt16(0,o,e.apache.arrow.flatbuf.IntervalUnit.YEAR_MONTH)}static endInterval(i){return i.endObject()}static createInterval(i,o){return s.startInterval(i),s.addUnit(i,o),s.endInterval(i)}}n.Interval=s})(r.flatbuf||(r.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(f||(f={}));(function(e){(function(t){(function(r){(function(n){class s{constructor(){this.bb=null,this.bb_pos=0}__init(i,o){return this.bb_pos=i,this.bb=o,this}static getRootAsDuration(i,o){return(o||new s).__init(i.readInt32(i.position())+i.position(),i)}unit(){let i=this.bb.__offset(this.bb_pos,4);return i?this.bb.readInt16(this.bb_pos+i):e.apache.arrow.flatbuf.TimeUnit.MILLISECOND}static startDuration(i){i.startObject(1)}static addUnit(i,o){i.addFieldInt16(0,o,e.apache.arrow.flatbuf.TimeUnit.MILLISECOND)}static endDuration(i){return i.endObject()}static createDuration(i,o){return s.startDuration(i),s.addUnit(i,o),s.endDuration(i)}}n.Duration=s})(r.flatbuf||(r.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(f||(f={}));(function(e){(function(t){(function(r){(function(n){class s{constructor(){this.bb=null,this.bb_pos=0}__init(i,o){return this.bb_pos=i,this.bb=o,this}static getRootAsKeyValue(i,o){return(o||new s).__init(i.readInt32(i.position())+i.position(),i)}key(i){let o=this.bb.__offset(this.bb_pos,4);return o?this.bb.__string(this.bb_pos+o,i):null}value(i){let o=this.bb.__offset(this.bb_pos,6);return o?this.bb.__string(this.bb_pos+o,i):null}static startKeyValue(i){i.startObject(2)}static addKey(i,o){i.addFieldOffset(0,o,0)}static addValue(i,o){i.addFieldOffset(1,o,0)}static endKeyValue(i){return i.endObject()}static createKeyValue(i,o,c){return s.startKeyValue(i),s.addKey(i,o),s.addValue(i,c),s.endKeyValue(i)}}n.KeyValue=s})(r.flatbuf||(r.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(f||(f={}));(function(e){(function(t){(function(r){(function(n){class s{constructor(){this.bb=null,this.bb_pos=0}__init(i,o){return this.bb_pos=i,this.bb=o,this}static getRootAsDictionaryEncoding(i,o){return(o||new s).__init(i.readInt32(i.position())+i.position(),i)}id(){let i=this.bb.__offset(this.bb_pos,4);return i?this.bb.readInt64(this.bb_pos+i):this.bb.createLong(0,0)}indexType(i){let o=this.bb.__offset(this.bb_pos,6);return o?(i||new e.apache.arrow.flatbuf.Int).__init(this.bb.__indirect(this.bb_pos+o),this.bb):null}isOrdered(){let i=this.bb.__offset(this.bb_pos,8);return i?!!this.bb.readInt8(this.bb_pos+i):!1}static startDictionaryEncoding(i){i.startObject(3)}static addId(i,o){i.addFieldInt64(0,o,i.createLong(0,0))}static addIndexType(i,o){i.addFieldOffset(1,o,0)}static addIsOrdered(i,o){i.addFieldInt8(2,+o,0)}static endDictionaryEncoding(i){return i.endObject()}static createDictionaryEncoding(i,o,c,u){return s.startDictionaryEncoding(i),s.addId(i,o),s.addIndexType(i,c),s.addIsOrdered(i,u),s.endDictionaryEncoding(i)}}n.DictionaryEncoding=s})(r.flatbuf||(r.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(f||(f={}));(function(e){(function(t){(function(r){(function(n){class s{constructor(){this.bb=null,this.bb_pos=0}__init(i,o){return this.bb_pos=i,this.bb=o,this}static getRootAsField(i,o){return(o||new s).__init(i.readInt32(i.position())+i.position(),i)}name(i){let o=this.bb.__offset(this.bb_pos,4);return o?this.bb.__string(this.bb_pos+o,i):null}nullable(){let i=this.bb.__offset(this.bb_pos,6);return i?!!this.bb.readInt8(this.bb_pos+i):!1}typeType(){let i=this.bb.__offset(this.bb_pos,8);return i?this.bb.readUint8(this.bb_pos+i):e.apache.arrow.flatbuf.Type.NONE}type(i){let o=this.bb.__offset(this.bb_pos,10);return o?this.bb.__union(i,this.bb_pos+o):null}dictionary(i){let o=this.bb.__offset(this.bb_pos,12);return o?(i||new e.apache.arrow.flatbuf.DictionaryEncoding).__init(this.bb.__indirect(this.bb_pos+o),this.bb):null}children(i,o){let c=this.bb.__offset(this.bb_pos,14);return c?(o||new e.apache.arrow.flatbuf.Field).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+c)+i*4),this.bb):null}childrenLength(){let i=this.bb.__offset(this.bb_pos,14);return i?this.bb.__vector_len(this.bb_pos+i):0}customMetadata(i,o){let c=this.bb.__offset(this.bb_pos,16);return c?(o||new e.apache.arrow.flatbuf.KeyValue).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+c)+i*4),this.bb):null}customMetadataLength(){let i=this.bb.__offset(this.bb_pos,16);return i?this.bb.__vector_len(this.bb_pos+i):0}static startField(i){i.startObject(7)}static addName(i,o){i.addFieldOffset(0,o,0)}static addNullable(i,o){i.addFieldInt8(1,+o,0)}static addTypeType(i,o){i.addFieldInt8(2,o,e.apache.arrow.flatbuf.Type.NONE)}static addType(i,o){i.addFieldOffset(3,o,0)}static addDictionary(i,o){i.addFieldOffset(4,o,0)}static addChildren(i,o){i.addFieldOffset(5,o,0)}static createChildrenVector(i,o){i.startVector(4,o.length,4);for(let c=o.length-1;c>=0;c--)i.addOffset(o[c]);return i.endVector()}static startChildrenVector(i,o){i.startVector(4,o,4)}static addCustomMetadata(i,o){i.addFieldOffset(6,o,0)}static createCustomMetadataVector(i,o){i.startVector(4,o.length,4);for(let c=o.length-1;c>=0;c--)i.addOffset(o[c]);return i.endVector()}static startCustomMetadataVector(i,o){i.startVector(4,o,4)}static endField(i){return i.endObject()}static createField(i,o,c,u,d,y,F,U){return s.startField(i),s.addName(i,o),s.addNullable(i,c),s.addTypeType(i,u),s.addType(i,d),s.addDictionary(i,y),s.addChildren(i,F),s.addCustomMetadata(i,U),s.endField(i)}}n.Field=s})(r.flatbuf||(r.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(f||(f={}));(function(e){(function(t){(function(r){(function(n){class s{constructor(){this.bb=null,this.bb_pos=0}__init(i,o){return this.bb_pos=i,this.bb=o,this}offset(){return this.bb.readInt64(this.bb_pos)}length(){return this.bb.readInt64(this.bb_pos+8)}static createBuffer(i,o,c){return i.prep(8,16),i.writeInt64(c),i.writeInt64(o),i.offset()}}n.Buffer=s})(r.flatbuf||(r.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(f||(f={}));(function(e){(function(t){(function(r){(function(n){class s{constructor(){this.bb=null,this.bb_pos=0}__init(i,o){return this.bb_pos=i,this.bb=o,this}static getRootAsSchema(i,o){return(o||new s).__init(i.readInt32(i.position())+i.position(),i)}endianness(){let i=this.bb.__offset(this.bb_pos,4);return i?this.bb.readInt16(this.bb_pos+i):e.apache.arrow.flatbuf.Endianness.Little}fields(i,o){let c=this.bb.__offset(this.bb_pos,6);return c?(o||new e.apache.arrow.flatbuf.Field).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+c)+i*4),this.bb):null}fieldsLength(){let i=this.bb.__offset(this.bb_pos,6);return i?this.bb.__vector_len(this.bb_pos+i):0}customMetadata(i,o){let c=this.bb.__offset(this.bb_pos,8);return c?(o||new e.apache.arrow.flatbuf.KeyValue).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+c)+i*4),this.bb):null}customMetadataLength(){let i=this.bb.__offset(this.bb_pos,8);return i?this.bb.__vector_len(this.bb_pos+i):0}static startSchema(i){i.startObject(3)}static addEndianness(i,o){i.addFieldInt16(0,o,e.apache.arrow.flatbuf.Endianness.Little)}static addFields(i,o){i.addFieldOffset(1,o,0)}static createFieldsVector(i,o){i.startVector(4,o.length,4);for(let c=o.length-1;c>=0;c--)i.addOffset(o[c]);return i.endVector()}static startFieldsVector(i,o){i.startVector(4,o,4)}static addCustomMetadata(i,o){i.addFieldOffset(2,o,0)}static createCustomMetadataVector(i,o){i.startVector(4,o.length,4);for(let c=o.length-1;c>=0;c--)i.addOffset(o[c]);return i.endVector()}static startCustomMetadataVector(i,o){i.startVector(4,o,4)}static endSchema(i){return i.endObject()}static finishSchemaBuffer(i,o){i.finish(o)}static createSchema(i,o,c,u){return s.startSchema(i),s.addEndianness(i,o),s.addFields(i,c),s.addCustomMetadata(i,u),s.endSchema(i)}}n.Schema=s})(r.flatbuf||(r.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(f||(f={}));var q;(function(e){(function(t){(function(r){(function(n){n.Schema=f.apache.arrow.flatbuf.Schema})(r.flatbuf||(r.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(q||(q={}));(function(e){(function(t){(function(r){(function(n){(function(s){s[s.NONE=0]="NONE",s[s.Schema=1]="Schema",s[s.DictionaryBatch=2]="DictionaryBatch",s[s.RecordBatch=3]="RecordBatch",s[s.Tensor=4]="Tensor",s[s.SparseTensor=5]="SparseTensor"})(n.MessageHeader||(n.MessageHeader={}))})(r.flatbuf||(r.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(q||(q={}));(function(e){(function(t){(function(r){(function(n){class s{constructor(){this.bb=null,this.bb_pos=0}__init(i,o){return this.bb_pos=i,this.bb=o,this}length(){return this.bb.readInt64(this.bb_pos)}nullCount(){return this.bb.readInt64(this.bb_pos+8)}static createFieldNode(i,o,c){return i.prep(8,16),i.writeInt64(c),i.writeInt64(o),i.offset()}}n.FieldNode=s})(r.flatbuf||(r.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(q||(q={}));(function(e){(function(t){(function(r){(function(n){class s{constructor(){this.bb=null,this.bb_pos=0}__init(i,o){return this.bb_pos=i,this.bb=o,this}static getRootAsRecordBatch(i,o){return(o||new s).__init(i.readInt32(i.position())+i.position(),i)}length(){let i=this.bb.__offset(this.bb_pos,4);return i?this.bb.readInt64(this.bb_pos+i):this.bb.createLong(0,0)}nodes(i,o){let c=this.bb.__offset(this.bb_pos,6);return c?(o||new e.apache.arrow.flatbuf.FieldNode).__init(this.bb.__vector(this.bb_pos+c)+i*16,this.bb):null}nodesLength(){let i=this.bb.__offset(this.bb_pos,6);return i?this.bb.__vector_len(this.bb_pos+i):0}buffers(i,o){let c=this.bb.__offset(this.bb_pos,8);return c?(o||new f.apache.arrow.flatbuf.Buffer).__init(this.bb.__vector(this.bb_pos+c)+i*16,this.bb):null}buffersLength(){let i=this.bb.__offset(this.bb_pos,8);return i?this.bb.__vector_len(this.bb_pos+i):0}static startRecordBatch(i){i.startObject(3)}static addLength(i,o){i.addFieldInt64(0,o,i.createLong(0,0))}static addNodes(i,o){i.addFieldOffset(1,o,0)}static startNodesVector(i,o){i.startVector(16,o,8)}static addBuffers(i,o){i.addFieldOffset(2,o,0)}static startBuffersVector(i,o){i.startVector(16,o,8)}static endRecordBatch(i){return i.endObject()}static createRecordBatch(i,o,c,u){return s.startRecordBatch(i),s.addLength(i,o),s.addNodes(i,c),s.addBuffers(i,u),s.endRecordBatch(i)}}n.RecordBatch=s})(r.flatbuf||(r.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(q||(q={}));(function(e){(function(t){(function(r){(function(n){class s{constructor(){this.bb=null,this.bb_pos=0}__init(i,o){return this.bb_pos=i,this.bb=o,this}static getRootAsDictionaryBatch(i,o){return(o||new s).__init(i.readInt32(i.position())+i.position(),i)}id(){let i=this.bb.__offset(this.bb_pos,4);return i?this.bb.readInt64(this.bb_pos+i):this.bb.createLong(0,0)}data(i){let o=this.bb.__offset(this.bb_pos,6);return o?(i||new e.apache.arrow.flatbuf.RecordBatch).__init(this.bb.__indirect(this.bb_pos+o),this.bb):null}isDelta(){let i=this.bb.__offset(this.bb_pos,8);return i?!!this.bb.readInt8(this.bb_pos+i):!1}static startDictionaryBatch(i){i.startObject(3)}static addId(i,o){i.addFieldInt64(0,o,i.createLong(0,0))}static addData(i,o){i.addFieldOffset(1,o,0)}static addIsDelta(i,o){i.addFieldInt8(2,+o,0)}static endDictionaryBatch(i){return i.endObject()}static createDictionaryBatch(i,o,c,u){return s.startDictionaryBatch(i),s.addId(i,o),s.addData(i,c),s.addIsDelta(i,u),s.endDictionaryBatch(i)}}n.DictionaryBatch=s})(r.flatbuf||(r.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(q||(q={}));(function(e){(function(t){(function(r){(function(n){class s{constructor(){this.bb=null,this.bb_pos=0}__init(i,o){return this.bb_pos=i,this.bb=o,this}static getRootAsMessage(i,o){return(o||new s).__init(i.readInt32(i.position())+i.position(),i)}version(){let i=this.bb.__offset(this.bb_pos,4);return i?this.bb.readInt16(this.bb_pos+i):f.apache.arrow.flatbuf.MetadataVersion.V1}headerType(){let i=this.bb.__offset(this.bb_pos,6);return i?this.bb.readUint8(this.bb_pos+i):e.apache.arrow.flatbuf.MessageHeader.NONE}header(i){let o=this.bb.__offset(this.bb_pos,8);return o?this.bb.__union(i,this.bb_pos+o):null}bodyLength(){let i=this.bb.__offset(this.bb_pos,10);return i?this.bb.readInt64(this.bb_pos+i):this.bb.createLong(0,0)}customMetadata(i,o){let c=this.bb.__offset(this.bb_pos,12);return c?(o||new f.apache.arrow.flatbuf.KeyValue).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+c)+i*4),this.bb):null}customMetadataLength(){let i=this.bb.__offset(this.bb_pos,12);return i?this.bb.__vector_len(this.bb_pos+i):0}static startMessage(i){i.startObject(5)}static addVersion(i,o){i.addFieldInt16(0,o,f.apache.arrow.flatbuf.MetadataVersion.V1)}static addHeaderType(i,o){i.addFieldInt8(1,o,e.apache.arrow.flatbuf.MessageHeader.NONE)}static addHeader(i,o){i.addFieldOffset(2,o,0)}static addBodyLength(i,o){i.addFieldInt64(3,o,i.createLong(0,0))}static addCustomMetadata(i,o){i.addFieldOffset(4,o,0)}static createCustomMetadataVector(i,o){i.startVector(4,o.length,4);for(let c=o.length-1;c>=0;c--)i.addOffset(o[c]);return i.endVector()}static startCustomMetadataVector(i,o){i.startVector(4,o,4)}static endMessage(i){return i.endObject()}static finishMessageBuffer(i,o){i.finish(o)}static createMessage(i,o,c,u,d,y){return s.startMessage(i),s.addVersion(i,o),s.addHeaderType(i,c),s.addHeader(i,u),s.addBodyLength(i,d),s.addCustomMetadata(i,y),s.endMessage(i)}}n.Message=s})(r.flatbuf||(r.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(q||(q={}));f.apache.arrow.flatbuf.Type;var Ft=f.apache.arrow.flatbuf.DateUnit,V=f.apache.arrow.flatbuf.TimeUnit,ut=f.apache.arrow.flatbuf.Precision,Nt=f.apache.arrow.flatbuf.UnionMode,we=f.apache.arrow.flatbuf.IntervalUnit,j=q.apache.arrow.flatbuf.MessageHeader,dt=f.apache.arrow.flatbuf.MetadataVersion,l;(function(e){e[e.NONE=0]="NONE",e[e.Null=1]="Null",e[e.Int=2]="Int",e[e.Float=3]="Float",e[e.Binary=4]="Binary",e[e.Utf8=5]="Utf8",e[e.Bool=6]="Bool",e[e.Decimal=7]="Decimal",e[e.Date=8]="Date",e[e.Time=9]="Time",e[e.Timestamp=10]="Timestamp",e[e.Interval=11]="Interval",e[e.List=12]="List",e[e.Struct=13]="Struct",e[e.Union=14]="Union",e[e.FixedSizeBinary=15]="FixedSizeBinary",e[e.FixedSizeList=16]="FixedSizeList",e[e.Map=17]="Map",e[e.Dictionary=-1]="Dictionary",e[e.Int8=-2]="Int8",e[e.Int16=-3]="Int16",e[e.Int32=-4]="Int32",e[e.Int64=-5]="Int64",e[e.Uint8=-6]="Uint8",e[e.Uint16=-7]="Uint16",e[e.Uint32=-8]="Uint32",e[e.Uint64=-9]="Uint64",e[e.Float16=-10]="Float16",e[e.Float32=-11]="Float32",e[e.Float64=-12]="Float64",e[e.DateDay=-13]="DateDay",e[e.DateMillisecond=-14]="DateMillisecond",e[e.TimestampSecond=-15]="TimestampSecond",e[e.TimestampMillisecond=-16]="TimestampMillisecond",e[e.TimestampMicrosecond=-17]="TimestampMicrosecond",e[e.TimestampNanosecond=-18]="TimestampNanosecond",e[e.TimeSecond=-19]="TimeSecond",e[e.TimeMillisecond=-20]="TimeMillisecond",e[e.TimeMicrosecond=-21]="TimeMicrosecond",e[e.TimeNanosecond=-22]="TimeNanosecond",e[e.DenseUnion=-23]="DenseUnion",e[e.SparseUnion=-24]="SparseUnion",e[e.IntervalDayTime=-25]="IntervalDayTime",e[e.IntervalYearMonth=-26]="IntervalYearMonth"})(l||(l={}));var b;(function(e){e[e.OFFSET=0]="OFFSET",e[e.DATA=1]="DATA",e[e.VALIDITY=2]="VALIDITY",e[e.TYPE=3]="TYPE"})(b||(b={}));function ti(e,t,r,n){return(r&1<>n}function sa(e,t,r){return r?!!(e[t>>3]|=1<>3]&=~(1<0||r.byteLength>3):ke(Qe(r,e,t,null,ti)).subarray(0,n)),s}return r}function ke(e){let t=[],r=0,n=0,s=0;for(const i of e)i&&(s|=1<0)&&(t[r++]=s);let a=new Uint8Array(t.length+7&-8);return a.set(t),a}function*Qe(e,t,r,n,s){let a=t%8,i=t>>3,o=0,c=r;for(;c>0;a=0){let u=e[i++];do yield s(n,o++,u,a);while(--c>0&&++a<8)}}function Dr(e,t,r){if(r-t<=0)return 0;if(r-t<8){let a=0;for(const i of Qe(e,t,r-t,e,ia))a+=i;return a}const n=r>>3<<3,s=t+(t%8===0?0:8-t%8);return Dr(e,t,s)+Dr(e,n,r)+aa(e,s>>3,n-s>>3)}function aa(e,t,r){let n=0,s=t|0;const a=new DataView(e.buffer,e.byteOffset,e.byteLength),i=r===void 0?e.byteLength:s+r;for(;i-s>=4;)n+=_r(a.getUint32(s)),s+=4;for(;i-s>=2;)n+=_r(a.getUint16(s)),s+=2;for(;i-s>=1;)n+=_r(a.getUint8(s)),s+=1;return n}function _r(e){let t=e|0;return t=t-(t>>>1&1431655765),t=(t&858993459)+(t>>>2&858993459),(t+(t>>>4)&252645135)*16843009>>>24}const uu=Object.freeze(Object.defineProperty({__proto__:null,getBool:ti,getBit:ia,setBool:sa,truncateBitmap:rn,packBools:ke,iterateBits:Qe,popcnt_bit_range:Dr,popcnt_array:aa,popcnt_uint32:_r},Symbol.toStringTag,{value:"Module"}));class D{visitMany(t,...r){return t.map((n,s)=>this.visit(n,...r.map(a=>a[s])))}visit(...t){return this.getVisitFn(t[0],!1).apply(this,t)}getVisitFn(t,r=!0){return lu(this,t,r)}visitNull(t,...r){return null}visitBool(t,...r){return null}visitInt(t,...r){return null}visitFloat(t,...r){return null}visitUtf8(t,...r){return null}visitBinary(t,...r){return null}visitFixedSizeBinary(t,...r){return null}visitDate(t,...r){return null}visitTimestamp(t,...r){return null}visitTime(t,...r){return null}visitDecimal(t,...r){return null}visitList(t,...r){return null}visitStruct(t,...r){return null}visitUnion(t,...r){return null}visitDictionary(t,...r){return null}visitInterval(t,...r){return null}visitFixedSizeList(t,...r){return null}visitMap(t,...r){return null}}function lu(e,t,r=!0){let n=null,s=l.NONE;switch(t instanceof p||t instanceof L?s=gn(t.type):t instanceof A?s=gn(t):typeof(s=t)!="number"&&(s=l[t]),s){case l.Null:n=e.visitNull;break;case l.Bool:n=e.visitBool;break;case l.Int:n=e.visitInt;break;case l.Int8:n=e.visitInt8||e.visitInt;break;case l.Int16:n=e.visitInt16||e.visitInt;break;case l.Int32:n=e.visitInt32||e.visitInt;break;case l.Int64:n=e.visitInt64||e.visitInt;break;case l.Uint8:n=e.visitUint8||e.visitInt;break;case l.Uint16:n=e.visitUint16||e.visitInt;break;case l.Uint32:n=e.visitUint32||e.visitInt;break;case l.Uint64:n=e.visitUint64||e.visitInt;break;case l.Float:n=e.visitFloat;break;case l.Float16:n=e.visitFloat16||e.visitFloat;break;case l.Float32:n=e.visitFloat32||e.visitFloat;break;case l.Float64:n=e.visitFloat64||e.visitFloat;break;case l.Utf8:n=e.visitUtf8;break;case l.Binary:n=e.visitBinary;break;case l.FixedSizeBinary:n=e.visitFixedSizeBinary;break;case l.Date:n=e.visitDate;break;case l.DateDay:n=e.visitDateDay||e.visitDate;break;case l.DateMillisecond:n=e.visitDateMillisecond||e.visitDate;break;case l.Timestamp:n=e.visitTimestamp;break;case l.TimestampSecond:n=e.visitTimestampSecond||e.visitTimestamp;break;case l.TimestampMillisecond:n=e.visitTimestampMillisecond||e.visitTimestamp;break;case l.TimestampMicrosecond:n=e.visitTimestampMicrosecond||e.visitTimestamp;break;case l.TimestampNanosecond:n=e.visitTimestampNanosecond||e.visitTimestamp;break;case l.Time:n=e.visitTime;break;case l.TimeSecond:n=e.visitTimeSecond||e.visitTime;break;case l.TimeMillisecond:n=e.visitTimeMillisecond||e.visitTime;break;case l.TimeMicrosecond:n=e.visitTimeMicrosecond||e.visitTime;break;case l.TimeNanosecond:n=e.visitTimeNanosecond||e.visitTime;break;case l.Decimal:n=e.visitDecimal;break;case l.List:n=e.visitList;break;case l.Struct:n=e.visitStruct;break;case l.Union:n=e.visitUnion;break;case l.DenseUnion:n=e.visitDenseUnion||e.visitUnion;break;case l.SparseUnion:n=e.visitSparseUnion||e.visitUnion;break;case l.Dictionary:n=e.visitDictionary;break;case l.Interval:n=e.visitInterval;break;case l.IntervalDayTime:n=e.visitIntervalDayTime||e.visitInterval;break;case l.IntervalYearMonth:n=e.visitIntervalYearMonth||e.visitInterval;break;case l.FixedSizeList:n=e.visitFixedSizeList;break;case l.Map:n=e.visitMap;break}if(typeof n=="function")return n;if(!r)return()=>null;throw new Error(`Unrecognized type '${l[s]}'`)}function gn(e){switch(e.typeId){case l.Null:return l.Null;case l.Int:const{bitWidth:t,isSigned:r}=e;switch(t){case 8:return r?l.Int8:l.Uint8;case 16:return r?l.Int16:l.Uint16;case 32:return r?l.Int32:l.Uint32;case 64:return r?l.Int64:l.Uint64}return l.Int;case l.Float:switch(e.precision){case ut.HALF:return l.Float16;case ut.SINGLE:return l.Float32;case ut.DOUBLE:return l.Float64}return l.Float;case l.Binary:return l.Binary;case l.Utf8:return l.Utf8;case l.Bool:return l.Bool;case l.Decimal:return l.Decimal;case l.Time:switch(e.unit){case V.SECOND:return l.TimeSecond;case V.MILLISECOND:return l.TimeMillisecond;case V.MICROSECOND:return l.TimeMicrosecond;case V.NANOSECOND:return l.TimeNanosecond}return l.Time;case l.Timestamp:switch(e.unit){case V.SECOND:return l.TimestampSecond;case V.MILLISECOND:return l.TimestampMillisecond;case V.MICROSECOND:return l.TimestampMicrosecond;case V.NANOSECOND:return l.TimestampNanosecond}return l.Timestamp;case l.Date:switch(e.unit){case Ft.DAY:return l.DateDay;case Ft.MILLISECOND:return l.DateMillisecond}return l.Date;case l.Interval:switch(e.unit){case we.DAY_TIME:return l.IntervalDayTime;case we.YEAR_MONTH:return l.IntervalYearMonth}return l.Interval;case l.Map:return l.Map;case l.List:return l.List;case l.Struct:return l.Struct;case l.Union:switch(e.mode){case Nt.Dense:return l.DenseUnion;case Nt.Sparse:return l.SparseUnion}return l.Union;case l.FixedSizeBinary:return l.FixedSizeBinary;case l.FixedSizeList:return l.FixedSizeList;case l.Dictionary:return l.Dictionary}throw new Error(`Unrecognized type '${l[e.typeId]}'`)}D.prototype.visitInt8=null;D.prototype.visitInt16=null;D.prototype.visitInt32=null;D.prototype.visitInt64=null;D.prototype.visitUint8=null;D.prototype.visitUint16=null;D.prototype.visitUint32=null;D.prototype.visitUint64=null;D.prototype.visitFloat16=null;D.prototype.visitFloat32=null;D.prototype.visitFloat64=null;D.prototype.visitDateDay=null;D.prototype.visitDateMillisecond=null;D.prototype.visitTimestampSecond=null;D.prototype.visitTimestampMillisecond=null;D.prototype.visitTimestampMicrosecond=null;D.prototype.visitTimestampNanosecond=null;D.prototype.visitTimeSecond=null;D.prototype.visitTimeMillisecond=null;D.prototype.visitTimeMicrosecond=null;D.prototype.visitTimeNanosecond=null;D.prototype.visitDenseUnion=null;D.prototype.visitSparseUnion=null;D.prototype.visitIntervalDayTime=null;D.prototype.visitIntervalYearMonth=null;class m extends D{compareSchemas(t,r){return t===r||r instanceof t.constructor&&st.compareFields(t.fields,r.fields)}compareFields(t,r){return t===r||Array.isArray(t)&&Array.isArray(r)&&t.length===r.length&&t.every((n,s)=>st.compareField(n,r[s]))}compareField(t,r){return t===r||r instanceof t.constructor&&t.name===r.name&&t.nullable===r.nullable&&st.visit(t.type,r.type)}}function et(e,t){return t instanceof e.constructor}function Xe(e,t){return e===t||et(e,t)}function Rt(e,t){return e===t||et(e,t)&&e.bitWidth===t.bitWidth&&e.isSigned===t.isSigned}function nn(e,t){return e===t||et(e,t)&&e.precision===t.precision}function hu(e,t){return e===t||et(e,t)&&e.byteWidth===t.byteWidth}function ei(e,t){return e===t||et(e,t)&&e.unit===t.unit}function tr(e,t){return e===t||et(e,t)&&e.unit===t.unit&&e.timezone===t.timezone}function er(e,t){return e===t||et(e,t)&&e.unit===t.unit&&e.bitWidth===t.bitWidth}function fu(e,t){return e===t||et(e,t)&&e.children.length===t.children.length&&st.compareFields(e.children,t.children)}function du(e,t){return e===t||et(e,t)&&e.children.length===t.children.length&&st.compareFields(e.children,t.children)}function ri(e,t){return e===t||et(e,t)&&e.mode===t.mode&&e.typeIds.every((r,n)=>r===t.typeIds[n])&&st.compareFields(e.children,t.children)}function pu(e,t){return e===t||et(e,t)&&e.id===t.id&&e.isOrdered===t.isOrdered&&st.visit(e.indices,t.indices)&&st.visit(e.dictionary,t.dictionary)}function ni(e,t){return e===t||et(e,t)&&e.unit===t.unit}function yu(e,t){return e===t||et(e,t)&&e.listSize===t.listSize&&e.children.length===t.children.length&&st.compareFields(e.children,t.children)}function bu(e,t){return e===t||et(e,t)&&e.keysSorted===t.keysSorted&&e.children.length===t.children.length&&st.compareFields(e.children,t.children)}m.prototype.visitNull=Xe;m.prototype.visitBool=Xe;m.prototype.visitInt=Rt;m.prototype.visitInt8=Rt;m.prototype.visitInt16=Rt;m.prototype.visitInt32=Rt;m.prototype.visitInt64=Rt;m.prototype.visitUint8=Rt;m.prototype.visitUint16=Rt;m.prototype.visitUint32=Rt;m.prototype.visitUint64=Rt;m.prototype.visitFloat=nn;m.prototype.visitFloat16=nn;m.prototype.visitFloat32=nn;m.prototype.visitFloat64=nn;m.prototype.visitUtf8=Xe;m.prototype.visitBinary=Xe;m.prototype.visitFixedSizeBinary=hu;m.prototype.visitDate=ei;m.prototype.visitDateDay=ei;m.prototype.visitDateMillisecond=ei;m.prototype.visitTimestamp=tr;m.prototype.visitTimestampSecond=tr;m.prototype.visitTimestampMillisecond=tr;m.prototype.visitTimestampMicrosecond=tr;m.prototype.visitTimestampNanosecond=tr;m.prototype.visitTime=er;m.prototype.visitTimeSecond=er;m.prototype.visitTimeMillisecond=er;m.prototype.visitTimeMicrosecond=er;m.prototype.visitTimeNanosecond=er;m.prototype.visitDecimal=Xe;m.prototype.visitList=fu;m.prototype.visitStruct=du;m.prototype.visitUnion=ri;m.prototype.visitDenseUnion=ri;m.prototype.visitSparseUnion=ri;m.prototype.visitDictionary=pu;m.prototype.visitInterval=ni;m.prototype.visitIntervalDayTime=ni;m.prototype.visitIntervalYearMonth=ni;m.prototype.visitFixedSizeList=yu;m.prototype.visitMap=bu;const st=new m;class A{static isNull(t){return t&&t.typeId===l.Null}static isInt(t){return t&&t.typeId===l.Int}static isFloat(t){return t&&t.typeId===l.Float}static isBinary(t){return t&&t.typeId===l.Binary}static isUtf8(t){return t&&t.typeId===l.Utf8}static isBool(t){return t&&t.typeId===l.Bool}static isDecimal(t){return t&&t.typeId===l.Decimal}static isDate(t){return t&&t.typeId===l.Date}static isTime(t){return t&&t.typeId===l.Time}static isTimestamp(t){return t&&t.typeId===l.Timestamp}static isInterval(t){return t&&t.typeId===l.Interval}static isList(t){return t&&t.typeId===l.List}static isStruct(t){return t&&t.typeId===l.Struct}static isUnion(t){return t&&t.typeId===l.Union}static isFixedSizeBinary(t){return t&&t.typeId===l.FixedSizeBinary}static isFixedSizeList(t){return t&&t.typeId===l.FixedSizeList}static isMap(t){return t&&t.typeId===l.Map}static isDictionary(t){return t&&t.typeId===l.Dictionary}get typeId(){return l.NONE}compareTo(t){return st.visit(this,t)}}A[Symbol.toStringTag]=(e=>(e.children=null,e.ArrayType=Array,e[Symbol.toStringTag]="DataType"))(A.prototype);class ve extends A{toString(){return"Null"}get typeId(){return l.Null}}ve[Symbol.toStringTag]=(e=>e[Symbol.toStringTag]="Null")(ve.prototype);class tt extends A{constructor(t,r){super(),this.isSigned=t,this.bitWidth=r}get typeId(){return l.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}`}}tt[Symbol.toStringTag]=(e=>(e.isSigned=null,e.bitWidth=null,e[Symbol.toStringTag]="Int"))(tt.prototype);class ii extends tt{constructor(){super(!0,8)}}class si extends tt{constructor(){super(!0,16)}}class Qt extends tt{constructor(){super(!0,32)}}class Ie extends tt{constructor(){super(!0,64)}}class ai extends tt{constructor(){super(!1,8)}}class oi extends tt{constructor(){super(!1,16)}}class ci extends tt{constructor(){super(!1,32)}}class Se extends tt{constructor(){super(!1,64)}}Object.defineProperty(ii.prototype,"ArrayType",{value:Int8Array});Object.defineProperty(si.prototype,"ArrayType",{value:Int16Array});Object.defineProperty(Qt.prototype,"ArrayType",{value:Int32Array});Object.defineProperty(Ie.prototype,"ArrayType",{value:Int32Array});Object.defineProperty(ai.prototype,"ArrayType",{value:Uint8Array});Object.defineProperty(oi.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(ci.prototype,"ArrayType",{value:Uint32Array});Object.defineProperty(Se.prototype,"ArrayType",{value:Uint32Array});class Xt extends A{constructor(t){super(),this.precision=t}get typeId(){return l.Float}get ArrayType(){switch(this.precision){case ut.HALF:return Uint16Array;case ut.SINGLE:return Float32Array;case ut.DOUBLE:return Float64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`Float${this.precision<<5||16}`}}Xt[Symbol.toStringTag]=(e=>(e.precision=null,e[Symbol.toStringTag]="Float"))(Xt.prototype);class sn extends Xt{constructor(){super(ut.HALF)}}class ui extends Xt{constructor(){super(ut.SINGLE)}}class li extends Xt{constructor(){super(ut.DOUBLE)}}Object.defineProperty(sn.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(ui.prototype,"ArrayType",{value:Float32Array});Object.defineProperty(li.prototype,"ArrayType",{value:Float64Array});class je extends A{constructor(){super()}get typeId(){return l.Binary}toString(){return"Binary"}}je[Symbol.toStringTag]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]="Binary"))(je.prototype);class Be extends A{constructor(){super()}get typeId(){return l.Utf8}toString(){return"Utf8"}}Be[Symbol.toStringTag]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]="Utf8"))(Be.prototype);class ze extends A{constructor(){super()}get typeId(){return l.Bool}toString(){return"Bool"}}ze[Symbol.toStringTag]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]="Bool"))(ze.prototype);class xr extends A{constructor(t,r){super(),this.scale=t,this.precision=r}get typeId(){return l.Decimal}toString(){return`Decimal[${this.precision}e${this.scale>0?"+":""}${this.scale}]`}}xr[Symbol.toStringTag]=(e=>(e.scale=null,e.precision=null,e.ArrayType=Uint32Array,e[Symbol.toStringTag]="Decimal"))(xr.prototype);class Ae extends A{constructor(t){super(),this.unit=t}get typeId(){return l.Date}toString(){return`Date${(this.unit+1)*32}<${Ft[this.unit]}>`}}Ae[Symbol.toStringTag]=(e=>(e.unit=null,e.ArrayType=Int32Array,e[Symbol.toStringTag]="Date"))(Ae.prototype);class mu extends Ae{constructor(){super(Ft.DAY)}}class ts extends Ae{constructor(){super(Ft.MILLISECOND)}}class Lr extends A{constructor(t,r){super(),this.unit=t,this.bitWidth=r}get typeId(){return l.Time}toString(){return`Time${this.bitWidth}<${V[this.unit]}>`}}Lr[Symbol.toStringTag]=(e=>(e.unit=null,e.bitWidth=null,e.ArrayType=Int32Array,e[Symbol.toStringTag]="Time"))(Lr.prototype);class Mr extends A{constructor(t,r){super(),this.unit=t,this.timezone=r}get typeId(){return l.Timestamp}toString(){return`Timestamp<${V[this.unit]}${this.timezone?`, ${this.timezone}`:""}>`}}Mr[Symbol.toStringTag]=(e=>(e.unit=null,e.timezone=null,e.ArrayType=Int32Array,e[Symbol.toStringTag]="Timestamp"))(Mr.prototype);class Ur extends A{constructor(t){super(),this.unit=t}get typeId(){return l.Interval}toString(){return`Interval<${we[this.unit]}>`}}Ur[Symbol.toStringTag]=(e=>(e.unit=null,e.ArrayType=Int32Array,e[Symbol.toStringTag]="Interval"))(Ur.prototype);class Te extends A{constructor(t){super(),this.children=[t]}get typeId(){return l.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}}Te[Symbol.toStringTag]=(e=>(e.children=null,e[Symbol.toStringTag]="List"))(Te.prototype);class _t extends A{constructor(t){super(),this.children=t}get typeId(){return l.Struct}toString(){return`Struct<{${this.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}}_t[Symbol.toStringTag]=(e=>(e.children=null,e[Symbol.toStringTag]="Struct"))(_t.prototype);class Pe extends A{constructor(t,r,n){super(),this.mode=t,this.children=n,this.typeIds=r=Int32Array.from(r),this.typeIdToChildIndex=r.reduce((s,a,i)=>(s[a]=i)&&s||s,Object.create(null))}get typeId(){return l.Union}toString(){return`${this[Symbol.toStringTag]}<${this.children.map(t=>`${t.type}`).join(" | ")}>`}}Pe[Symbol.toStringTag]=(e=>(e.mode=null,e.typeIds=null,e.children=null,e.typeIdToChildIndex=null,e.ArrayType=Int8Array,e[Symbol.toStringTag]="Union"))(Pe.prototype);class Er extends A{constructor(t){super(),this.byteWidth=t}get typeId(){return l.FixedSizeBinary}toString(){return`FixedSizeBinary[${this.byteWidth}]`}}Er[Symbol.toStringTag]=(e=>(e.byteWidth=null,e.ArrayType=Uint8Array,e[Symbol.toStringTag]="FixedSizeBinary"))(Er.prototype);class $e extends A{constructor(t,r){super(),this.listSize=t,this.children=[r]}get typeId(){return l.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}>`}}$e[Symbol.toStringTag]=(e=>(e.children=null,e.listSize=null,e[Symbol.toStringTag]="FixedSizeList"))($e.prototype);class We extends A{constructor(t,r=!1){super(),this.children=[t],this.keysSorted=r}get typeId(){return l.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(t=>`${t.name}:${t.type}`).join(", ")}}>`}}We[Symbol.toStringTag]=(e=>(e.children=null,e.keysSorted=null,e[Symbol.toStringTag]="Map_"))(We.prototype);const gu=(e=>()=>++e)(-1);class Ht extends A{constructor(t,r,n,s){super(),this.indices=r,this.dictionary=t,this.isOrdered=s||!1,this.id=n==null?gu():typeof n=="number"?n:n.low}get typeId(){return l.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}>`}}Ht[Symbol.toStringTag]=(e=>(e.id=null,e.indices=null,e.isOrdered=null,e.dictionary=null,e[Symbol.toStringTag]="Dictionary"))(Ht.prototype);function oa(e){let t=e;switch(e.typeId){case l.Decimal:return 4;case l.Timestamp:return 2;case l.Date:return 1+t.unit;case l.Interval:return 1+t.unit;case l.Int:return 1+ +(t.bitWidth>32);case l.Time:return 1+ +(t.bitWidth>32);case l.FixedSizeList:return t.listSize;case l.FixedSizeBinary:return t.byteWidth;default:return 1}}const _u=-1;class p{constructor(t,r,n,s,a,i,o){this.type=t,this.dictionary=o,this.offset=Math.floor(Math.max(r||0,0)),this.length=Math.floor(Math.max(n||0,0)),this._nullCount=Math.floor(Math.max(s||0,-1)),this.childData=(i||[]).map(u=>u instanceof p?u:u.data);let c;a instanceof p?(this.stride=a.stride,this.values=a.values,this.typeIds=a.typeIds,this.nullBitmap=a.nullBitmap,this.valueOffsets=a.valueOffsets):(this.stride=oa(t),a&&((c=a[0])&&(this.valueOffsets=c),(c=a[1])&&(this.values=c),(c=a[2])&&(this.nullBitmap=c),(c=a[3])&&(this.typeIds=c)))}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 t=0,{valueOffsets:r,values:n,nullBitmap:s,typeIds:a}=this;return r&&(t+=r.byteLength),n&&(t+=n.byteLength),s&&(t+=s.byteLength),a&&(t+=a.byteLength),this.childData.reduce((i,o)=>i+o.byteLength,t)}get nullCount(){let t=this._nullCount,r;return t<=_u&&(r=this.nullBitmap)&&(this._nullCount=t=this.length-Dr(r,this.offset,this.offset+this.length)),t}clone(t,r=this.offset,n=this.length,s=this._nullCount,a=this,i=this.childData){return new p(t,r,n,s,a,i,this.dictionary)}slice(t,r){const{stride:n,typeId:s,childData:a}=this,i=+(this._nullCount===0)-1,o=s===16?n:1,c=this._sliceBuffers(t,r,n,s);return this.clone(this.type,this.offset+t,r,i,c,!a.length||this.valueOffsets?a:this._sliceChildren(a,o*t,o*r))}_changeLengthAndBackfillNullBitmap(t){if(this.typeId===l.Null)return this.clone(this.type,0,t,0);const{length:r,nullCount:n}=this,s=new Uint8Array((t+63&-64)>>3).fill(255,0,r>>3);s[r>>3]=(1<0&&s.set(rn(this.offset,r,this.nullBitmap),0);const a=this.buffers;return a[b.VALIDITY]=s,this.clone(this.type,0,t,n+(t-r),a)}_sliceBuffers(t,r,n,s){let a,{buffers:i}=this;return(a=i[b.TYPE])&&(i[b.TYPE]=a.subarray(t,t+r)),(a=i[b.OFFSET])&&(i[b.OFFSET]=a.subarray(t,t+r+1))||(a=i[b.DATA])&&(i[b.DATA]=s===6?a:a.subarray(n*t,n*(t+r))),i}_sliceChildren(t,r,n){return t.map(s=>s.slice(r,n))}static new(t,r,n,s,a,i,o){switch(a instanceof p?a=a.buffers:a||(a=[]),t.typeId){case l.Null:return p.Null(t,r,n);case l.Int:return p.Int(t,r,n,s||0,a[b.VALIDITY],a[b.DATA]||[]);case l.Dictionary:return p.Dictionary(t,r,n,s||0,a[b.VALIDITY],a[b.DATA]||[],o);case l.Float:return p.Float(t,r,n,s||0,a[b.VALIDITY],a[b.DATA]||[]);case l.Bool:return p.Bool(t,r,n,s||0,a[b.VALIDITY],a[b.DATA]||[]);case l.Decimal:return p.Decimal(t,r,n,s||0,a[b.VALIDITY],a[b.DATA]||[]);case l.Date:return p.Date(t,r,n,s||0,a[b.VALIDITY],a[b.DATA]||[]);case l.Time:return p.Time(t,r,n,s||0,a[b.VALIDITY],a[b.DATA]||[]);case l.Timestamp:return p.Timestamp(t,r,n,s||0,a[b.VALIDITY],a[b.DATA]||[]);case l.Interval:return p.Interval(t,r,n,s||0,a[b.VALIDITY],a[b.DATA]||[]);case l.FixedSizeBinary:return p.FixedSizeBinary(t,r,n,s||0,a[b.VALIDITY],a[b.DATA]||[]);case l.Binary:return p.Binary(t,r,n,s||0,a[b.VALIDITY],a[b.OFFSET]||[],a[b.DATA]||[]);case l.Utf8:return p.Utf8(t,r,n,s||0,a[b.VALIDITY],a[b.OFFSET]||[],a[b.DATA]||[]);case l.List:return p.List(t,r,n,s||0,a[b.VALIDITY],a[b.OFFSET]||[],(i||[])[0]);case l.FixedSizeList:return p.FixedSizeList(t,r,n,s||0,a[b.VALIDITY],(i||[])[0]);case l.Struct:return p.Struct(t,r,n,s||0,a[b.VALIDITY],i||[]);case l.Map:return p.Map(t,r,n,s||0,a[b.VALIDITY],a[b.OFFSET]||[],(i||[])[0]);case l.Union:return p.Union(t,r,n,s||0,a[b.VALIDITY],a[b.TYPE]||[],a[b.OFFSET]||i,i)}throw new Error(`Unrecognized typeId ${t.typeId}`)}static Null(t,r,n){return new p(t,r,n,0)}static Int(t,r,n,s,a,i){return new p(t,r,n,s,[void 0,O(t.ArrayType,i),x(a)])}static Dictionary(t,r,n,s,a,i,o){return new p(t,r,n,s,[void 0,O(t.indices.ArrayType,i),x(a)],[],o)}static Float(t,r,n,s,a,i){return new p(t,r,n,s,[void 0,O(t.ArrayType,i),x(a)])}static Bool(t,r,n,s,a,i){return new p(t,r,n,s,[void 0,O(t.ArrayType,i),x(a)])}static Decimal(t,r,n,s,a,i){return new p(t,r,n,s,[void 0,O(t.ArrayType,i),x(a)])}static Date(t,r,n,s,a,i){return new p(t,r,n,s,[void 0,O(t.ArrayType,i),x(a)])}static Time(t,r,n,s,a,i){return new p(t,r,n,s,[void 0,O(t.ArrayType,i),x(a)])}static Timestamp(t,r,n,s,a,i){return new p(t,r,n,s,[void 0,O(t.ArrayType,i),x(a)])}static Interval(t,r,n,s,a,i){return new p(t,r,n,s,[void 0,O(t.ArrayType,i),x(a)])}static FixedSizeBinary(t,r,n,s,a,i){return new p(t,r,n,s,[void 0,O(t.ArrayType,i),x(a)])}static Binary(t,r,n,s,a,i,o){return new p(t,r,n,s,[le(i),x(o),x(a)])}static Utf8(t,r,n,s,a,i,o){return new p(t,r,n,s,[le(i),x(o),x(a)])}static List(t,r,n,s,a,i,o){return new p(t,r,n,s,[le(i),void 0,x(a)],[o])}static FixedSizeList(t,r,n,s,a,i){return new p(t,r,n,s,[void 0,void 0,x(a)],[i])}static Struct(t,r,n,s,a,i){return new p(t,r,n,s,[void 0,void 0,x(a)],i)}static Map(t,r,n,s,a,i,o){return new p(t,r,n,s,[le(i),void 0,x(a)],[o])}static Union(t,r,n,s,a,i,o,c){const u=[void 0,void 0,x(a),O(t.ArrayType,i)];return t.mode===Nt.Sparse?new p(t,r,n,s,u,o):(u[b.OFFSET]=le(o),new p(t,r,n,s,u,c))}}p.prototype.childData=Object.freeze([]);const wu=void 0;function Ee(e){if(e===null)return"null";if(e===wu)return"undefined";switch(typeof e){case"number":return`${e}`;case"bigint":return`${e}`;case"string":return`"${e}"`}return typeof e[Symbol.toPrimitive]=="function"?e[Symbol.toPrimitive]("string"):ArrayBuffer.isView(e)?`[${e}]`:JSON.stringify(e)}function vu(e){if(!e||e.length<=0)return function(s){return!0};let t="",r=e.filter(n=>n===n);return r.length>0&&(t=` - switch (x) {${r.map(n=>` - case ${Iu(n)}:`).join("")} - return false; - }`),e.length!==r.length&&(t=`if (x !== x) return false; -${t}`),new Function("x",`${t} -return true;`)}function Iu(e){return typeof e!="bigint"?Ee(e):tn?`${Ee(e)}n`:`"${Ee(e)}"`}const _n=(e,t)=>(e*t+63&-64||64)/t,Su=(e,t=0)=>e.length>=t?e.subarray(0,t):Re(new e.constructor(t),e,0);class rr{constructor(t,r=1){this.buffer=t,this.stride=r,this.BYTES_PER_ELEMENT=t.BYTES_PER_ELEMENT,this.ArrayType=t.constructor,this._resize(this.length=t.length/r|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(t,r){return this}append(t){return this.set(this.length,t)}reserve(t){if(t>0){this.length+=t;const r=this.stride,n=this.length*r,s=this.buffer.length;n>=s&&this._resize(s===0?_n(n*1,this.BYTES_PER_ELEMENT):_n(n*2,this.BYTES_PER_ELEMENT))}return this}flush(t=this.length){t=_n(t*this.stride,this.BYTES_PER_ELEMENT);const r=Su(this.buffer,t);return this.clear(),r}clear(){return this.length=0,this._resize(0),this}_resize(t){return this.buffer=Re(new this.ArrayType(t),this.buffer)}}rr.prototype.offset=0;class nr extends rr{last(){return this.get(this.length-1)}get(t){return this.buffer[t]}set(t,r){return this.reserve(t-this.length+1),this.buffer[t*this.stride]=r,this}}class ca extends nr{constructor(t=new Uint8Array(0)){super(t,1/8),this.numValid=0}get numInvalid(){return this.length-this.numValid}get(t){return this.buffer[t>>3]>>t%8&1}set(t,r){const{buffer:n}=this.reserve(t-this.length+1),s=t>>3,a=t%8,i=n[s]>>a&1;return r?i===0&&(n[s]|=1<this.length&&this.set(t-1,0),super.flush(t+1)}}class la extends rr{get ArrayType64(){return this._ArrayType64||(this._ArrayType64=this.buffer instanceof Int32Array?xe:Ze)}set(t,r){switch(this.reserve(t-this.length+1),typeof r){case"bigint":this.buffer64[t]=r;break;case"number":this.buffer[t*this.stride]=r;break;default:this.buffer.set(r,t*this.stride)}return this}_resize(t){const r=super._resize(t),n=r.byteLength/(this.BYTES_PER_ELEMENT*this.stride);return tn&&(this.buffer64=new this.ArrayType64(r.buffer,r.byteOffset,n)),r}}class W{constructor({type:t,nullValues:r}){this.length=0,this.finished=!1,this.type=t,this.children=[],this.nullValues=r,this.stride=oa(t),this._nulls=new ca,r&&r.length>0&&(this._isValid=vu(r))}static new(t){}static throughNode(t){throw new Error('"throughNode" not available in this environment')}static throughDOM(t){throw new Error('"throughDOM" not available in this environment')}static throughIterable(t){return Bu(t)}static throughAsyncIterable(t){return Au(t)}toVector(){return L.new(this.flush())}get ArrayType(){return this.type.ArrayType}get nullCount(){return this._nulls.numInvalid}get numChildren(){return this.children.length}get byteLength(){let t=0;return this._offsets&&(t+=this._offsets.byteLength),this._values&&(t+=this._values.byteLength),this._nulls&&(t+=this._nulls.byteLength),this._typeIds&&(t+=this._typeIds.byteLength),this.children.reduce((r,n)=>r+n.byteLength,t)}get reservedLength(){return this._nulls.reservedLength}get reservedByteLength(){let t=0;return this._offsets&&(t+=this._offsets.reservedByteLength),this._values&&(t+=this._values.reservedByteLength),this._nulls&&(t+=this._nulls.reservedByteLength),this._typeIds&&(t+=this._typeIds.reservedByteLength),this.children.reduce((r,n)=>r+n.reservedByteLength,t)}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(t){return this.set(this.length,t)}isValid(t){return this._isValid(t)}set(t,r){return this.setValid(t,this.isValid(r))&&this.setValue(t,r),this}setValue(t,r){this._setValue(this,t,r)}setValid(t,r){return this.length=this._nulls.set(t,+r).length,r}addChild(t,r=`${this.numChildren}`){throw new Error(`Cannot append children to non-nested type "${this.type}"`)}getChildAt(t){return this.children[t]||null}flush(){const t=[],r=this._values,n=this._offsets,s=this._typeIds,{length:a,nullCount:i}=this;s?(t[b.TYPE]=s.flush(a),n&&(t[b.OFFSET]=n.flush(a))):n?(r&&(t[b.DATA]=r.flush(n.last())),t[b.OFFSET]=n.flush(a)):r&&(t[b.DATA]=r.flush(a)),i>0&&(t[b.VALIDITY]=this._nulls.flush(a));const o=p.new(this.type,0,a,i,t,this.children.map(c=>c.flush()));return this.clear(),o}finish(){return this.finished=!0,this.children.forEach(t=>t.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(t=>t.clear()),this}}W.prototype.length=1;W.prototype.stride=1;W.prototype.children=null;W.prototype.finished=!1;W.prototype.nullValues=null;W.prototype._isValid=()=>!0;class Jt extends W{constructor(t){super(t),this._values=new nr(new this.ArrayType(0),this.stride)}setValue(t,r){const n=this._values;return n.reserve(t-n.length+1),super.setValue(t,r)}}class an extends W{constructor(t){super(t),this._pendingLength=0,this._offsets=new ua}setValue(t,r){const n=this._pending||(this._pending=new Map),s=n.get(t);s&&(this._pendingLength-=s.length),this._pendingLength+=r.length,n.set(t,r)}setValid(t,r){return super.setValid(t,r)?!0:((this._pending||(this._pending=new Map)).set(t,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(){const t=this._pending,r=this._pendingLength;return this._pendingLength=0,this._pending=void 0,t&&t.size>0&&this._flushPending(t,r),this}}function Bu(e){const{["queueingStrategy"]:t="count"}=e,{["highWaterMark"]:r=t!=="bytes"?1e3:2**14}=e,n=t!=="bytes"?"length":"byteLength";return function*(s){let a=0,i=W.new(e);for(const o of s)i.append(o)[n]>=r&&++a&&(yield i.toVector());(i.finish().length>0||a===0)&&(yield i.toVector())}}function Au(e){const{["queueingStrategy"]:t="count"}=e,{["highWaterMark"]:r=t!=="bytes"?1e3:2**14}=e,n=t!=="bytes"?"length":"byteLength";return async function*(s){let a=0,i=W.new(e);for await(const o of s)i.append(o)[n]>=r&&++a&&(yield i.toVector());(i.finish().length>0||a===0)&&(yield i.toVector())}}class Tu extends W{constructor(t){super(t),this._values=new ca}setValue(t,r){this._values.set(t,+r)}}class Fu extends W{setValue(t,r){}setValid(t,r){return this.length=Math.max(t+1,this.length),r}}class hi extends Jt{}class Ou extends hi{}class Du extends hi{}class xu extends Jt{}class Lu extends W{constructor({type:t,nullValues:r,dictionaryHashFunction:n}){super({type:new Ht(t.dictionary,t.indices,t.id,t.isOrdered)}),this._nulls=null,this._dictionaryOffset=0,this._keysToIndices=Object.create(null),this.indices=W.new({type:this.type.indices,nullValues:r}),this.dictionary=W.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(t){return this.indices.isValid(t)}setValid(t,r){const n=this.indices;return r=n.setValid(t,r),this.length=n.length,r}setValue(t,r){let n=this._keysToIndices,s=this.valueToKey(r),a=n[s];return a===void 0&&(n[s]=a=this._dictionaryOffset+this.dictionary.append(r).length-1),this.indices.setValue(t,a)}flush(){const t=this.type,r=this._dictionary,n=this.dictionary.toVector(),s=this.indices.flush().clone(t);return s.dictionary=r?r.concat(n):n,this.finished||(this._dictionaryOffset+=n.length),this._dictionary=s.dictionary,this.clear(),s}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(t){return typeof t=="string"?t:`${t}`}}class Mu extends Jt{}const ha=new Float64Array(1),ce=new Uint32Array(ha.buffer);function fa(e){let t=(e&31744)>>10,r=(e&1023)/1024,n=(-1)**((e&32768)>>15);switch(t){case 31:return n*(r?NaN:1/0);case 0:return n*(r?6103515625e-14*r:0)}return n*2**(t-15)*(1+r)}function fi(e){if(e!==e)return 32256;ha[0]=e;let t=(ce[1]&2147483648)>>16&65535,r=ce[1]&2146435072,n=0;return r>=1089470464?ce[0]>0?r=31744:(r=(r&2080374784)>>16,n=(ce[1]&1048575)>>10):r<=1056964608?(n=1048576+(ce[1]&1048575),n=1048576+(n<<(r>>20)-998)>>21,r=0):(r=r-1056964608>>10,n=(ce[1]&1048575)+512>>10),t|r|n&65535}const Uu=Object.freeze(Object.defineProperty({__proto__:null,uint16ToFloat64:fa,float64ToUint16:fi},Symbol.toStringTag,{value:"Module"}));class on extends Jt{}class Eu extends on{setValue(t,r){this._values.set(t,fi(r))}}class Nu extends on{setValue(t,r){this._values.set(t,r)}}class Vu extends on{setValue(t,r){this._values.set(t,r)}}const da=Symbol.for("isArrowBigNum");function It(e,...t){return t.length===0?Object.setPrototypeOf(O(this.TypedArray,e),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(e,...t),this.constructor.prototype)}It.prototype[da]=!0;It.prototype.toJSON=function(){return`"${$t(this)}"`};It.prototype.valueOf=function(){return pa(this)};It.prototype.toString=function(){return $t(this)};It.prototype[Symbol.toPrimitive]=function(e="default"){switch(e){case"number":return pa(this);case"string":return $t(this);case"default":return He(this)}return $t(this)};function de(...e){return It.apply(this,e)}function pe(...e){return It.apply(this,e)}function Ye(...e){return It.apply(this,e)}Object.setPrototypeOf(de.prototype,Object.create(Int32Array.prototype));Object.setPrototypeOf(pe.prototype,Object.create(Uint32Array.prototype));Object.setPrototypeOf(Ye.prototype,Object.create(Uint32Array.prototype));Object.assign(de.prototype,It.prototype,{constructor:de,signed:!0,TypedArray:Int32Array,BigIntArray:xe});Object.assign(pe.prototype,It.prototype,{constructor:pe,signed:!1,TypedArray:Uint32Array,BigIntArray:Ze});Object.assign(Ye.prototype,It.prototype,{constructor:Ye,signed:!0,TypedArray:Uint32Array,BigIntArray:Ze});function pa(e){let{buffer:t,byteOffset:r,length:n,signed:s}=e,a=new Int32Array(t,r,n),i=0,o=0,c=a.length,u,d;for(;o>>0),i+=(d>>>0)+u*o**32;return i}let $t,He;tn?(He=e=>e.byteLength===8?new e.BigIntArray(e.buffer,e.byteOffset,1)[0]:wn(e),$t=e=>e.byteLength===8?`${new e.BigIntArray(e.buffer,e.byteOffset,1)[0]}`:wn(e)):($t=wn,He=$t);function wn(e){let t="",r=new Uint32Array(2),n=new Uint16Array(e.buffer,e.byteOffset,e.byteLength/2),s=new Uint32Array((n=new Uint16Array(n).reverse()).buffer),a=-1,i=n.length-1;do{for(r[0]=n[a=0];at=>(ArrayBuffer.isView(t)&&(e.buffer=t.buffer,e.byteOffset=t.byteOffset,e.byteLength=t.byteLength,t=He(e),e.buffer=null),t))({BigIntArray:xe});class ir extends Jt{}class Hu extends ir{}class Ku extends ir{}class Ju extends ir{}class Gu extends ir{}class sr extends Jt{}class qu extends sr{}class Zu extends sr{}class Qu extends sr{}class Xu extends sr{}class di extends Jt{}class tl extends di{}class el extends di{}class ya extends an{constructor(t){super(t),this._values=new rr(new Uint8Array(0))}get byteLength(){let t=this._pendingLength+this.length*4;return this._offsets&&(t+=this._offsets.byteLength),this._values&&(t+=this._values.byteLength),this._nulls&&(t+=this._nulls.byteLength),t}setValue(t,r){return super.setValue(t,x(r))}_flushPending(t,r){const n=this._offsets,s=this._values.reserve(r).buffer;let a=0,i=0,o=0,c;for([a,c]of t)c===void 0?n.set(a,0):(i=c.length,s.set(c,o),n.set(a,i),o+=i)}}class pi extends an{constructor(t){super(t),this._values=new rr(new Uint8Array(0))}get byteLength(){let t=this._pendingLength+this.length*4;return this._offsets&&(t+=this._offsets.byteLength),this._values&&(t+=this._values.byteLength),this._nulls&&(t+=this._nulls.byteLength),t}setValue(t,r){return super.setValue(t,Xr(r))}_flushPending(t,r){}}pi.prototype._flushPending=ya.prototype._flushPending;class ba{get length(){return this._values.length}get(t){return this._values[t]}clear(){return this._values=null,this}bind(t){return t instanceof L?t:(this._values=t,this)}}const J=Symbol.for("parent"),ye=Symbol.for("rowIndex"),nt=Symbol.for("keyToIdx"),rt=Symbol.for("idxToVal"),Cn=Symbol.for("nodejs.util.inspect.custom");class Et{constructor(t,r){this[J]=t,this.size=r}entries(){return this[Symbol.iterator]()}has(t){return this.get(t)!==void 0}get(t){let r;if(t!=null){const n=this[nt]||(this[nt]=new Map);let s=n.get(t);if(s!==void 0){const a=this[rt]||(this[rt]=new Array(this.size));(r=a[s])!==void 0||(a[s]=r=this.getValue(s))}else if((s=this.getIndex(t))>-1){n.set(t,s);const a=this[rt]||(this[rt]=new Array(this.size));(r=a[s])!==void 0||(a[s]=r=this.getValue(s))}}return r}set(t,r){if(t!=null){const n=this[nt]||(this[nt]=new Map);let s=n.get(t);if(s===void 0&&n.set(t,s=this.getIndex(t)),s>-1){const a=this[rt]||(this[rt]=new Array(this.size));a[s]=this.setValue(s,r)}}return this}clear(){throw new Error(`Clearing ${this[Symbol.toStringTag]} not supported.`)}delete(t){throw new Error(`Deleting ${this[Symbol.toStringTag]} values not supported.`)}*[Symbol.iterator](){const t=this.keys(),r=this.values(),n=this[nt]||(this[nt]=new Map),s=this[rt]||(this[rt]=new Array(this.size));for(let a,i,o=0,c,u;!((c=t.next()).done||(u=r.next()).done);++o)a=c.value,i=u.value,s[o]=i,n.has(a)||n.set(a,o),yield[a,i]}forEach(t,r){const n=this.keys(),s=this.values(),a=r===void 0?t:(c,u,d)=>t.call(r,c,u,d),i=this[nt]||(this[nt]=new Map),o=this[rt]||(this[rt]=new Array(this.size));for(let c,u,d=0,y,F;!((y=n.next()).done||(F=s.next()).done);++d)c=y.value,u=F.value,o[d]=u,i.has(c)||i.set(c,d),a(u,c,this)}toArray(){return[...this.values()]}toJSON(){const t={};return this.forEach((r,n)=>t[n]=r),t}inspect(){return this.toString()}[Cn](){return this.toString()}toString(){const t=[];return this.forEach((r,n)=>{n=Ee(n),r=Ee(r),t.push(`${n}: ${r}`)}),`{ ${t.join(", ")} }`}}Et[Symbol.toStringTag]=(e=>(Object.defineProperties(e,{size:{writable:!0,enumerable:!1,configurable:!1,value:0},[J]:{writable:!0,enumerable:!1,configurable:!1,value:null},[ye]:{writable:!0,enumerable:!1,configurable:!1,value:-1}}),e[Symbol.toStringTag]="Row"))(Et.prototype);class ma extends Et{constructor(t){return super(t,t.length),rl(this)}keys(){return this[J].getChildAt(0)[Symbol.iterator]()}values(){return this[J].getChildAt(1)[Symbol.iterator]()}getKey(t){return this[J].getChildAt(0).get(t)}getIndex(t){return this[J].getChildAt(0).indexOf(t)}getValue(t){return this[J].getChildAt(1).get(t)}setValue(t,r){this[J].getChildAt(1).set(t,r)}}class ga extends Et{constructor(t){return super(t,t.type.children.length),_a(this)}*keys(){for(const t of this[J].type.children)yield t.name}*values(){for(const t of this[J].type.children)yield this[t.name]}getKey(t){return this[J].type.children[t].name}getIndex(t){return this[J].type.children.findIndex(r=>r.name===t)}getValue(t){return this[J].getChildAt(t).get(this[ye])}setValue(t,r){return this[J].getChildAt(t).set(this[ye],r)}}Object.setPrototypeOf(Et.prototype,Map.prototype);const _a=(()=>{const e={enumerable:!0,configurable:!1,get:null,set:null};return t=>{let r=-1,n=t[nt]||(t[nt]=new Map);const s=i=>function(){return this.get(i)},a=i=>function(o){return this.set(i,o)};for(const i of t.keys())n.set(i,++r),e.get=s(i),e.set=a(i),t.hasOwnProperty(i)||(e.enumerable=!0,Object.defineProperty(t,i,e)),t.hasOwnProperty(r)||(e.enumerable=!1,Object.defineProperty(t,r,e));return e.get=e.set=null,t}})(),rl=(()=>{if(typeof Proxy>"u")return _a;const e=Et.prototype.has,t=Et.prototype.get,r=Et.prototype.set,n=Et.prototype.getKey,s={isExtensible(){return!1},deleteProperty(){return!1},preventExtensions(){return!0},ownKeys(a){return[...a.keys()].map(i=>`${i}`)},has(a,i){switch(i){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 J:case ye:case rt:case nt:case Cn:return!0}return typeof i=="number"&&!a.has(i)&&(i=a.getKey(i)),a.has(i)},get(a,i,o){switch(i){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 J:case ye:case rt:case nt:case Cn:return Reflect.get(a,i,o)}return typeof i=="number"&&!e.call(o,i)&&(i=n.call(o,i)),t.call(o,i)},set(a,i,o,c){switch(i){case J:case ye:case rt:case nt:return Reflect.set(a,i,o,c);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 i=="number"&&!e.call(c,i)&&(i=n.call(c,i)),e.call(c,i)?!!r.call(c,i,o):!1}};return a=>new Proxy(a,s)})();function nl(e,t,r){const n=e.length,s=t>-1?t:n+t%n;return r?r(e,s):s}let es;function yi(e,t,r,n){let{length:s=0}=e,a=typeof t!="number"?0:t,i=typeof r!="number"?s:r;return a<0&&(a=(a%s+s)%s),i<0&&(i=(i%s+s)%s),is&&(i=s),n?n(e,a,i):[a,i]}const il=tn?Oc(0):0,rs=e=>e!==e;function se(e){let t=typeof e;if(t!=="object"||e===null)return rs(e)?rs:t!=="bigint"?r=>r===e:r=>il+r===e;if(e instanceof Date){const r=e.valueOf();return n=>n instanceof Date?n.valueOf()===r:!1}return ArrayBuffer.isView(e)?r=>r?ra(e,r):!1:e instanceof Map?al(e):Array.isArray(e)?sl(e):e instanceof L?ol(e):cl(e)}function sl(e){const t=[];for(let r=-1,n=e.length;++rr[++t]=se(n)),cn(r)}function ol(e){const t=[];for(let r=-1,n=e.length;++r!1;const r=[];for(let n=-1,s=t.length;++n{if(!r||typeof r!="object")return!1;switch(r.constructor){case Array:return ul(e,r);case Map:case ma:case ga:return ns(e,r,r.keys());case Object:case void 0:return ns(e,r,t||Object.keys(r))}return r instanceof L?ll(e,r):!1}}function ul(e,t){const r=e.length;if(t.length!==r)return!1;for(let n=-1;++n`}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((t,r)=>t+r.byteLength,0)}get nullCount(){let t=this._nullCount;return t<0&&(this._nullCount=t=this._chunks.reduce((r,{nullCount:n})=>r+n,0)),t}get indices(){if(A.isDictionary(this._type)){if(!this._indices){const t=this._chunks;this._indices=t.length===1?t[0].indices:G.concat(...t.map(r=>r.indices))}return this._indices}return null}get dictionary(){return A.isDictionary(this._type)?this._chunks[this._chunks.length-1].data.dictionary:null}*[Symbol.iterator](){for(const t of this._chunks)yield*t}clone(t=this._chunks){return new G(this._type,t)}concat(...t){return this.clone(G.flatten(this,...t))}slice(t,r){return yi(this,t,r,this._sliceInternal)}getChildAt(t){if(t<0||t>=this._numChildren)return null;let r=this._children||(this._children=[]),n,s,a;return(n=r[t])?n:(s=(this._type.children||[])[t])&&(a=this._chunks.map(i=>i.getChildAt(t)).filter(i=>i!=null),a.length>0)?r[t]=new G(s.type,a):null}search(t,r){let n=t,s=this._chunkOffsets,a=s.length-1;if(n<0||n>=s[a])return null;if(a<=1)return r?r(this,0,n):[0,n];let i=0,o=0,c=0;do{if(i+1===a)return r?r(this,i,n-o):[i,n-o];c=i+(a-i)/2|0,n>=s[c]?i=c:a=c}while(n=(o=s[i]));return null}isValid(t){return!!this.search(t,this.isValidInternal)}get(t){return this.search(t,this.getInternal)}set(t,r){this.search(t,({chunks:n},s,a)=>n[s].set(a,r))}indexOf(t,r){return r&&typeof r=="number"?this.search(r,(n,s,a)=>this.indexOfInternal(n,s,a,t)):this.indexOfInternal(this,0,Math.max(0,r||0),t)}toArray(){const{chunks:t}=this,r=t.length;let n=this._type.ArrayType;if(r<=0)return new n(0);if(r<=1)return t[0].toArray();let s=0,a=new Array(r);for(let c=-1;++c=n)break;if(r>=y+d)continue;if(y>=r&&y+d<=n){s.push(u);continue}const F=Math.max(0,r-y),U=Math.min(n-y,d);s.push(u.slice(F,U))}return t.clone(s)}}function fl(e){let t=new Uint32Array((e||[]).length+1),r=t[0]=0,n=t.length;for(let s=0;++s(t.set(e,r),r+e.length),pl=(e,t,r)=>{let n=r;for(let s=-1,a=e.length;++sa>0)&&(t=t.clone({nullable:!0}));return new pt(t,s)}get field(){return this._field}get name(){return this._field.name}get nullable(){return this._field.nullable}get metadata(){return this._field.metadata}clone(t=this._chunks){return new pt(this._field,t)}getChildAt(t){if(t<0||t>=this.numChildren)return null;let r=this._children||(this._children=[]),n,s,a;return(n=r[t])?n:(s=(this.type.children||[])[t])&&(a=this._chunks.map(i=>i.getChildAt(t)).filter(i=>i!=null),a.length>0)?r[t]=new pt(s,a):null}}class is extends pt{constructor(t,r,n){super(t,[r],n),this._chunk=r}search(t,r){return r?r(this,0,t):[0,t]}isValid(t){return this._chunk.isValid(t)}get(t){return this._chunk.get(t)}set(t,r){this._chunk.set(t,r)}indexOf(t,r){return this._chunk.indexOf(t,r)}}const Zt=Array.isArray,wa=(e,t)=>bi(e,t,[],0),yl=e=>{const[t,r]=mi(e,[[],[]]);return r.map((n,s)=>n instanceof pt?pt.new(n.field.clone(t[s]),n):n instanceof L?pt.new(t[s],n):pt.new(t[s],[]))},va=e=>mi(e,[[],[]]),bl=(e,t)=>Rn(e,t,[],0),ml=(e,t)=>Ia(e,t,[],0);function bi(e,t,r,n){let s,a=n,i=-1,o=t.length;for(;++is.getChildAt(u)),r,a).length:s instanceof L&&(r[a++]=s);return r}const gl=(e,[t,r],n)=>(e[0][n]=t,e[1][n]=r,e);function mi(e,t){let r,n;switch(n=e.length){case 0:return t;case 1:if(r=t[0],!e[0])return t;if(Zt(e[0]))return mi(e[0],t);e[0]instanceof p||e[0]instanceof L||e[0]instanceof A||([r,e]=Object.entries(e[0]).reduce(gl,t));break;default:Zt(r=e[n-1])?e=Zt(e[0])?e[0]:e.slice(0,n-1):(e=Zt(e[0])?e[0]:e,r=[])}let s=-1,a=-1,i=-1,o=e.length,c,u,[d,y]=t;for(;++i`${r}: ${t}`).join(", ")} }>`}compareTo(t){return st.compareSchemas(this,t)}select(...t){const r=t.reduce((n,s)=>(n[s]=!0)&&n,Object.create(null));return new C(this.fields.filter(n=>r[n.name]),this.metadata)}selectAt(...t){return new C(t.map(r=>this.fields[r]).filter(Boolean),this.metadata)}assign(...t){const r=t[0]instanceof C?t[0]:new C(wa(M,t)),n=[...this.fields],s=fr(fr(new Map,this.metadata),r.metadata),a=r.fields.filter(o=>{const c=n.findIndex(u=>u.name===o.name);return~c?(n[c]=o.clone({metadata:fr(fr(new Map,n[c].metadata),o.metadata)}))&&!1:!0}),i=kn(a,new Map);return new C([...n,...a],s,new Map([...this.dictionaries,...i]))}}class M{constructor(t,r,n=!1,s){this.name=t,this.type=r,this.nullable=n,this.metadata=s||new Map}static new(...t){let[r,n,s,a]=t;return t[0]&&typeof t[0]=="object"&&({name:r}=t[0],n===void 0&&(n=t[0].type),s===void 0&&(s=t[0].nullable),a===void 0&&(a=t[0].metadata)),new M(`${r}`,n,s,a)}get typeId(){return this.type.typeId}get[Symbol.toStringTag](){return"Field"}toString(){return`${this.name}: ${this.type}`}compareTo(t){return st.compareField(this,t)}clone(...t){let[r,n,s,a]=t;return!t[0]||typeof t[0]!="object"?[r=this.name,n=this.type,s=this.nullable,a=this.metadata]=t:{name:r=this.name,type:n=this.type,nullable:s=this.nullable,metadata:a=this.metadata}=t[0],M.new(r,n,s,a)}}function fr(e,t){return new Map([...e||new Map,...t||new Map])}function kn(e,t=new Map){for(let r=-1,n=e.length;++r0&&kn(a.children,t)}return t}C.prototype.fields=null;C.prototype.metadata=null;C.prototype.dictionaries=null;M.prototype.type=null;M.prototype.name=null;M.prototype.nullable=null;M.prototype.metadata=null;class _l extends an{constructor(t){super(t),this._run=new ba,this._offsets=new ua}addChild(t,r="0"){if(this.numChildren>0)throw new Error("ListBuilder can only have one child.");return this.children[this.numChildren]=t,this.type=new Te(new M(r,t.type,!0)),this.numChildren-1}clear(){return this._run.clear(),super.clear()}_flushPending(t){const r=this._run,n=this._offsets,s=this._setValue;let a=0,i;for([a,i]of t)i===void 0?n.set(a,0):(n.set(a,i.length),s(this,a,r.bind(i)))}}class wl extends W{constructor(){super(...arguments),this._run=new ba}setValue(t,r){super.setValue(t,this._run.bind(r))}addChild(t,r="0"){if(this.numChildren>0)throw new Error("FixedSizeListBuilder can only have one child.");const n=this.children.push(t);return this.type=new $e(this.type.listSize,new M(r,t.type,!0)),n}clear(){return this._run.clear(),super.clear()}}class vl extends an{set(t,r){return super.set(t,r)}setValue(t,r){r=r instanceof Map?r:new Map(Object.entries(r));const n=this._pending||(this._pending=new Map),s=n.get(t);s&&(this._pendingLength-=s.size),this._pendingLength+=r.size,n.set(t,r)}addChild(t,r=`${this.numChildren}`){if(this.numChildren>0)throw new Error("ListBuilder can only have one child.");return this.children[this.numChildren]=t,this.type=new We(new M(r,t.type,!0),this.type.keysSorted),this.numChildren-1}_flushPending(t){const r=this._offsets,n=this._setValue;t.forEach((s,a)=>{s===void 0?r.set(a,0):(r.set(a,s.size),n(this,a,s))})}}class Il extends W{addChild(t,r=`${this.numChildren}`){const n=this.children.push(t);return this.type=new _t([...this.type.children,new M(r,t.type,!0)]),n}}class gi extends W{constructor(t){super(t),this._typeIds=new nr(new Int8Array(0),1),typeof t.valueToChildTypeId=="function"&&(this._valueToChildTypeId=t.valueToChildTypeId)}get typeIdToChildIndex(){return this.type.typeIdToChildIndex}append(t,r){return this.set(this.length,t,r)}set(t,r,n){return n===void 0&&(n=this._valueToChildTypeId(this,r,t)),this.setValid(t,this.isValid(r))&&this.setValue(t,r,n),this}setValue(t,r,n){this._typeIds.set(t,n),super.setValue(t,r)}addChild(t,r=`${this.children.length}`){const n=this.children.push(t),{type:{children:s,mode:a,typeIds:i}}=this,o=[...s,new M(r,t.type)];return this.type=new Pe(a,[...i,n],o),n}_valueToChildTypeId(t,r,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.")}}class Sl extends gi{}class Bl extends gi{constructor(t){super(t),this._offsets=new nr(new Int32Array(0))}setValue(t,r,n){const s=this.type.typeIdToChildIndex[n];return this._offsets.set(t,this.getChildAt(s).length),super.setValue(t,r,n)}}class I extends D{}const Al=(e,t,r)=>{e[t]=r/864e5|0},_i=(e,t,r)=>{e[t]=r%4294967296|0,e[t+1]=r/4294967296|0},Tl=(e,t,r)=>{e[t]=r*1e3%4294967296|0,e[t+1]=r*1e3/4294967296|0},Fl=(e,t,r)=>{e[t]=r*1e6%4294967296|0,e[t+1]=r*1e6/4294967296|0},Sa=(e,t,r,n)=>{const{[r]:s,[r+1]:a}=t;s!=null&&a!=null&&e.set(n.subarray(0,a-s),s)},Ol=({offset:e,values:t},r,n)=>{const s=e+r;n?t[s>>3]|=1<>3]&=~(1<{Al(e,t,r.valueOf())},Aa=({values:e},t,r)=>{_i(e,t*2,r.valueOf())},xt=({stride:e,values:t},r,n)=>{t[e*r]=n},Ta=({stride:e,values:t},r,n)=>{t[e*r]=fi(n)},wi=(e,t,r)=>{switch(typeof r){case"bigint":e.values64[t]=r;break;case"number":e.values[t*e.stride]=r;break;default:const n=r,{stride:s,ArrayType:a}=e,i=O(a,n);e.values.set(i.subarray(0,s),s*t)}},Dl=({stride:e,values:t},r,n)=>{t.set(n.subarray(0,e),e*r)},xl=({values:e,valueOffsets:t},r,n)=>Sa(e,t,r,n),Ll=({values:e,valueOffsets:t},r,n)=>{Sa(e,t,r,Xr(n))},Ml=(e,t,r)=>{e.type.bitWidth<64?xt(e,t,r):wi(e,t,r)},Ul=(e,t,r)=>{e.type.precision!==ut.HALF?xt(e,t,r):Ta(e,t,r)},El=(e,t,r)=>{e.type.unit===Ft.DAY?Ba(e,t,r):Aa(e,t,r)},Fa=({values:e},t,r)=>_i(e,t*2,r/1e3),Oa=({values:e},t,r)=>_i(e,t*2,r),Da=({values:e},t,r)=>Tl(e,t*2,r),xa=({values:e},t,r)=>Fl(e,t*2,r),Nl=(e,t,r)=>{switch(e.type.unit){case V.SECOND:return Fa(e,t,r);case V.MILLISECOND:return Oa(e,t,r);case V.MICROSECOND:return Da(e,t,r);case V.NANOSECOND:return xa(e,t,r)}},La=({values:e,stride:t},r,n)=>{e[t*r]=n},Ma=({values:e,stride:t},r,n)=>{e[t*r]=n},Ua=({values:e},t,r)=>{e.set(r.subarray(0,2),2*t)},Ea=({values:e},t,r)=>{e.set(r.subarray(0,2),2*t)},Vl=(e,t,r)=>{switch(e.type.unit){case V.SECOND:return La(e,t,r);case V.MILLISECOND:return Ma(e,t,r);case V.MICROSECOND:return Ua(e,t,r);case V.NANOSECOND:return Ea(e,t,r)}},Cl=({values:e},t,r)=>{e.set(r.subarray(0,4),4*t)},Rl=(e,t,r)=>{const n=e.getChildAt(0),s=e.valueOffsets;for(let a=-1,i=s[t],o=s[t+1];i{const n=e.getChildAt(0),s=e.valueOffsets,a=r instanceof Map?[...r]:Object.entries(r);for(let i=-1,o=s[t],c=s[t+1];o(r,n,s)=>r&&r.set(e,t[s]),zl=(e,t)=>(r,n,s)=>r&&r.set(e,t.get(s)),Pl=(e,t)=>(r,n,s)=>r&&r.set(e,t.get(n.name)),$l=(e,t)=>(r,n,s)=>r&&r.set(e,t[n.name]),Wl=(e,t,r)=>{const n=r instanceof Map?Pl(t,r):r instanceof L?zl(t,r):Array.isArray(r)?jl(t,r):$l(t,r);e.type.children.forEach((s,a)=>n(e.getChildAt(a),s,a))},Yl=(e,t,r)=>{e.type.mode===Nt.Dense?Na(e,t,r):Va(e,t,r)},Na=(e,t,r)=>{const n=e.typeIdToChildIndex[e.typeIds[t]],s=e.getChildAt(n);s&&s.set(e.valueOffsets[t],r)},Va=(e,t,r)=>{const n=e.typeIdToChildIndex[e.typeIds[t]],s=e.getChildAt(n);s&&s.set(t,r)},Hl=(e,t,r)=>{const n=e.getKey(t);n!==null&&e.setValue(n,r)},Kl=(e,t,r)=>{e.type.unit===we.DAY_TIME?Ca(e,t,r):Ra(e,t,r)},Ca=({values:e},t,r)=>{e.set(r.subarray(0,2),2*t)},Ra=({values:e},t,r)=>{e[t]=r[0]*12+r[1]%12},Jl=(e,t,r)=>{const n=e.getChildAt(0),{stride:s}=e;for(let a=-1,i=t*s;++a0){const n=e.children||[],s={nullValues:e.nullValues},a=Array.isArray(n)?(i,o)=>n[o]||s:({name:i})=>n[i]||s;t.children.forEach((i,o)=>{const{type:c}=i,u=a(i,o);r.children.push(ja({...u,type:c}))})}return r}Object.keys(l).map(e=>l[e]).filter(e=>typeof e=="number"&&e!==l.NONE).forEach(e=>{const t=ka.visit(e);t.prototype._setValue=un.getVisitFn(e)});pi.prototype._setValue=un.visitBinary;var Fe;(function(e){(function(t){(function(r){(function(n){class s{constructor(){this.bb=null,this.bb_pos=0}__init(i,o){return this.bb_pos=i,this.bb=o,this}static getRootAsFooter(i,o){return(o||new s).__init(i.readInt32(i.position())+i.position(),i)}version(){let i=this.bb.__offset(this.bb_pos,4);return i?this.bb.readInt16(this.bb_pos+i):f.apache.arrow.flatbuf.MetadataVersion.V1}schema(i){let o=this.bb.__offset(this.bb_pos,6);return o?(i||new f.apache.arrow.flatbuf.Schema).__init(this.bb.__indirect(this.bb_pos+o),this.bb):null}dictionaries(i,o){let c=this.bb.__offset(this.bb_pos,8);return c?(o||new e.apache.arrow.flatbuf.Block).__init(this.bb.__vector(this.bb_pos+c)+i*24,this.bb):null}dictionariesLength(){let i=this.bb.__offset(this.bb_pos,8);return i?this.bb.__vector_len(this.bb_pos+i):0}recordBatches(i,o){let c=this.bb.__offset(this.bb_pos,10);return c?(o||new e.apache.arrow.flatbuf.Block).__init(this.bb.__vector(this.bb_pos+c)+i*24,this.bb):null}recordBatchesLength(){let i=this.bb.__offset(this.bb_pos,10);return i?this.bb.__vector_len(this.bb_pos+i):0}static startFooter(i){i.startObject(4)}static addVersion(i,o){i.addFieldInt16(0,o,f.apache.arrow.flatbuf.MetadataVersion.V1)}static addSchema(i,o){i.addFieldOffset(1,o,0)}static addDictionaries(i,o){i.addFieldOffset(2,o,0)}static startDictionariesVector(i,o){i.startVector(24,o,8)}static addRecordBatches(i,o){i.addFieldOffset(3,o,0)}static startRecordBatchesVector(i,o){i.startVector(24,o,8)}static endFooter(i){return i.endObject()}static finishFooterBuffer(i,o){i.finish(o)}static createFooter(i,o,c,u,d){return s.startFooter(i),s.addVersion(i,o),s.addSchema(i,c),s.addDictionaries(i,u),s.addRecordBatches(i,d),s.endFooter(i)}}n.Footer=s})(r.flatbuf||(r.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(Fe||(Fe={}));(function(e){(function(t){(function(r){(function(n){class s{constructor(){this.bb=null,this.bb_pos=0}__init(i,o){return this.bb_pos=i,this.bb=o,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(i,o,c,u){return i.prep(8,24),i.writeInt64(u),i.pad(4),i.writeInt32(c),i.writeInt64(o),i.offset()}}n.Block=s})(r.flatbuf||(r.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(Fe||(Fe={}));var ss=h.Long,ql=h.Builder,Zl=h.ByteBuffer,Ql=Fe.apache.arrow.flatbuf.Block,At=Fe.apache.arrow.flatbuf.Footer;class Ke{constructor(t,r=dt.V4,n,s){this.schema=t,this.version=r,n&&(this._recordBatches=n),s&&(this._dictionaryBatches=s)}static decode(t){t=new Zl(x(t));const r=At.getRootAsFooter(t),n=C.decode(r.schema());return new Xl(n,r)}static encode(t){const r=new ql,n=C.encode(r,t.schema);At.startRecordBatchesVector(r,t.numRecordBatches),[...t.recordBatches()].slice().reverse().forEach(i=>Kt.encode(r,i));const s=r.endVector();At.startDictionariesVector(r,t.numDictionaries),[...t.dictionaryBatches()].slice().reverse().forEach(i=>Kt.encode(r,i));const a=r.endVector();return At.startFooter(r),At.addSchema(r,n),At.addVersion(r,dt.V4),At.addRecordBatches(r,s),At.addDictionaries(r,a),At.finishFooterBuffer(r,At.endFooter(r)),r.asUint8Array()}get numRecordBatches(){return this._recordBatches.length}get numDictionaries(){return this._dictionaryBatches.length}*recordBatches(){for(let t,r=-1,n=this.numRecordBatches;++r=0&&t=0&&t=0&&t=0&&t0)return super.write(t)}toString(t=!1){return t?En(this.toUint8Array(!0)):this.toUint8Array(!1).then(En)}toUint8Array(t=!1){return t?gt(this._values)[0]:(async()=>{let r=[],n=0;for await(const s of this)r.push(s),n+=s.byteLength;return gt(r,n)[0]})()}}class Vr{constructor(t){t&&(this.source=new th(it.fromIterable(t)))}[Symbol.iterator](){return this}next(t){return this.source.next(t)}throw(t){return this.source.throw(t)}return(t){return this.source.return(t)}peek(t){return this.source.peek(t)}read(t){return this.source.read(t)}}class te{constructor(t){t instanceof te?this.source=t.source:t instanceof Ne?this.source=new qt(it.fromAsyncIterable(t)):Zs(t)?this.source=new qt(it.fromNodeStream(t)):Qn(t)?this.source=new qt(it.fromDOMStream(t)):qs(t)?this.source=new qt(it.fromDOMStream(t.body)):mt(t)?this.source=new qt(it.fromIterable(t)):Yt(t)?this.source=new qt(it.fromAsyncIterable(t)):Ct(t)&&(this.source=new qt(it.fromAsyncIterable(t)))}[Symbol.asyncIterator](){return this}next(t){return this.source.next(t)}throw(t){return this.source.throw(t)}return(t){return this.source.return(t)}get closed(){return this.source.closed}cancel(t){return this.source.cancel(t)}peek(t){return this.source.peek(t)}read(t){return this.source.read(t)}}class th{constructor(t){this.source=t}cancel(t){this.return(t)}peek(t){return this.next(t,"peek").value}read(t){return this.next(t,"read").value}next(t,r="read"){return this.source.next({cmd:r,size:t})}throw(t){return Object.create(this.source.throw&&this.source.throw(t)||$)}return(t){return Object.create(this.source.return&&this.source.return(t)||$)}}class qt{constructor(t){this.source=t,this._closedPromise=new Promise(r=>this._closedPromiseResolve=r)}async cancel(t){await this.return(t)}get closed(){return this._closedPromise}async read(t){return(await this.next(t,"read")).value}async peek(t){return(await this.next(t,"peek")).value}async next(t,r="read"){return await this.source.next({cmd:r,size:t})}async throw(t){const r=this.source.throw&&await this.source.throw(t)||$;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(r)}async return(t){const r=this.source.return&&await this.source.return(t)||$;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(r)}}class as extends Vr{constructor(t,r){super(),this.position=0,this.buffer=x(t),this.size=typeof r>"u"?this.buffer.byteLength:r}readInt32(t){const{buffer:r,byteOffset:n}=this.readAt(t,4);return new DataView(r,n).getInt32(0,!0)}seek(t){return this.position=Math.min(t,this.size),t{this.size=(await t.stat()).size,delete this._pending})()}async readInt32(t){const{buffer:r,byteOffset:n}=await this.readAt(t,4);return new DataView(r,n).getInt32(0,!0)}async seek(t){return this._pending&&await this._pending,this.position=Math.min(t,this.size),t>>16,this.buffer[1]&65535,this.buffer[0]>>>16,this.buffer[0]&65535]),n=new Uint32Array([t.buffer[1]>>>16,t.buffer[1]&65535,t.buffer[0]>>>16,t.buffer[0]&65535]);let s=r[3]*n[3];this.buffer[0]=s&65535;let a=s>>>16;return s=r[2]*n[3],a+=s,s=r[3]*n[2]>>>0,a+=s,this.buffer[0]+=a<<16,this.buffer[1]=a>>>0>>16,this.buffer[1]+=r[1]*n[3]+r[2]*n[2]+r[3]*n[1],this.buffer[1]+=r[0]*n[3]+r[1]*n[2]+r[2]*n[1]+r[3]*n[0]<<16,this}_plus(t){const r=this.buffer[0]+t.buffer[0]>>>0;this.buffer[1]+=t.buffer[1],r>>0&&++this.buffer[1],this.buffer[0]=r}lessThan(t){return this.buffer[1]>>0,r[2]=this.buffer[2]+t.buffer[2]>>>0,r[1]=this.buffer[1]+t.buffer[1]>>>0,r[0]=this.buffer[0]+t.buffer[0]>>>0,r[0]>>0&&++r[1],r[1]>>0&&++r[2],r[2]>>0&&++r[3],this.buffer[3]=r[3],this.buffer[2]=r[2],this.buffer[1]=r[1],this.buffer[0]=r[0],this}hex(){return`${fe(this.buffer[3])} ${fe(this.buffer[2])} ${fe(this.buffer[1])} ${fe(this.buffer[0])}`}static multiply(t,r){return new ft(new Uint32Array(t.buffer)).times(r)}static add(t,r){return new ft(new Uint32Array(t.buffer)).plus(r)}static from(t,r=new Uint32Array(4)){return ft.fromString(typeof t=="string"?t:t.toString(),r)}static fromNumber(t,r=new Uint32Array(4)){return ft.fromString(t.toString(),r)}static fromString(t,r=new Uint32Array(4)){const n=t.startsWith("-"),s=t.length;let a=new ft(r);for(let i=n?1:0;i0&&this.readData(t,n)||new Uint8Array(0)}readOffsets(t,r){return this.readData(t,r)}readTypeIds(t,r){return this.readData(t,r)}readData(t,{length:r,offset:n}=this.nextBufferRange()){return this.bytes.subarray(n,n+r)}readDictionary(t){return this.dictionaries.get(t.id)}}class nh extends za{constructor(t,r,n,s){super(new Uint8Array(0),r,n,s),this.sources=t}readNullBitmap(t,r,{offset:n}=this.nextBufferRange()){return r<=0?new Uint8Array(0):ke(this.sources[n])}readOffsets(t,{offset:r}=this.nextBufferRange()){return O(Uint8Array,O(Int32Array,this.sources[r]))}readTypeIds(t,{offset:r}=this.nextBufferRange()){return O(Uint8Array,O(t.ArrayType,this.sources[r]))}readData(t,{offset:r}=this.nextBufferRange()){const{sources:n}=this;return A.isTimestamp(t)||(A.isInt(t)||A.isTime(t))&&t.bitWidth===64||A.isDate(t)&&t.unit===Ft.MILLISECOND?O(Uint8Array,Z.convertArray(n[r])):A.isDecimal(t)?O(Uint8Array,ft.convertArray(n[r])):A.isBinary(t)||A.isFixedSizeBinary(t)?ih(n[r]):A.isBool(t)?ke(n[r]):A.isUtf8(t)?Xr(n[r].join("")):O(Uint8Array,O(t.ArrayType,n[r].map(s=>+s)))}}function ih(e){const t=e.join(""),r=new Uint8Array(t.length/2);for(let n=0;n>1]=parseInt(t.substr(n,2),16);return r}var sh=h.Long,os=f.apache.arrow.flatbuf.Null,dr=f.apache.arrow.flatbuf.Int,vn=f.apache.arrow.flatbuf.FloatingPoint,cs=f.apache.arrow.flatbuf.Binary,us=f.apache.arrow.flatbuf.Bool,ls=f.apache.arrow.flatbuf.Utf8,pr=f.apache.arrow.flatbuf.Decimal,In=f.apache.arrow.flatbuf.Date,yr=f.apache.arrow.flatbuf.Time,br=f.apache.arrow.flatbuf.Timestamp,Sn=f.apache.arrow.flatbuf.Interval,hs=f.apache.arrow.flatbuf.List,fs=f.apache.arrow.flatbuf.Struct_,ue=f.apache.arrow.flatbuf.Union,Le=f.apache.arrow.flatbuf.DictionaryEncoding,Bn=f.apache.arrow.flatbuf.FixedSizeBinary,An=f.apache.arrow.flatbuf.FixedSizeList,Tn=f.apache.arrow.flatbuf.Map;class ah extends D{visit(t,r){return t==null||r==null?void 0:super.visit(t,r)}visitNull(t,r){return os.startNull(r),os.endNull(r)}visitInt(t,r){return dr.startInt(r),dr.addBitWidth(r,t.bitWidth),dr.addIsSigned(r,t.isSigned),dr.endInt(r)}visitFloat(t,r){return vn.startFloatingPoint(r),vn.addPrecision(r,t.precision),vn.endFloatingPoint(r)}visitBinary(t,r){return cs.startBinary(r),cs.endBinary(r)}visitBool(t,r){return us.startBool(r),us.endBool(r)}visitUtf8(t,r){return ls.startUtf8(r),ls.endUtf8(r)}visitDecimal(t,r){return pr.startDecimal(r),pr.addScale(r,t.scale),pr.addPrecision(r,t.precision),pr.endDecimal(r)}visitDate(t,r){return In.startDate(r),In.addUnit(r,t.unit),In.endDate(r)}visitTime(t,r){return yr.startTime(r),yr.addUnit(r,t.unit),yr.addBitWidth(r,t.bitWidth),yr.endTime(r)}visitTimestamp(t,r){const n=t.timezone&&r.createString(t.timezone)||void 0;return br.startTimestamp(r),br.addUnit(r,t.unit),n!==void 0&&br.addTimezone(r,n),br.endTimestamp(r)}visitInterval(t,r){return Sn.startInterval(r),Sn.addUnit(r,t.unit),Sn.endInterval(r)}visitList(t,r){return hs.startList(r),hs.endList(r)}visitStruct(t,r){return fs.startStruct_(r),fs.endStruct_(r)}visitUnion(t,r){ue.startTypeIdsVector(r,t.typeIds.length);const n=ue.createTypeIdsVector(r,t.typeIds);return ue.startUnion(r),ue.addMode(r,t.mode),ue.addTypeIds(r,n),ue.endUnion(r)}visitDictionary(t,r){const n=this.visit(t.indices,r);return Le.startDictionaryEncoding(r),Le.addId(r,new sh(t.id,0)),Le.addIsOrdered(r,t.isOrdered),n!==void 0&&Le.addIndexType(r,n),Le.endDictionaryEncoding(r)}visitFixedSizeBinary(t,r){return Bn.startFixedSizeBinary(r),Bn.addByteWidth(r,t.byteWidth),Bn.endFixedSizeBinary(r)}visitFixedSizeList(t,r){return An.startFixedSizeList(r),An.addListSize(r,t.listSize),An.endFixedSizeList(r)}visitMap(t,r){return Tn.startMap(r),Tn.addKeysSorted(r,t.keysSorted),Tn.endMap(r)}}const Fn=new ah;function oh(e,t=new Map){return new C(uh(e,t),wr(e.customMetadata),t)}function Pa(e){return new ot(e.count,$a(e.columns),Wa(e.columns))}function ch(e){return new Ot(Pa(e.data),e.id,e.isDelta)}function uh(e,t){return(e.fields||[]).filter(Boolean).map(r=>M.fromJSON(r,t))}function ds(e,t){return(e.children||[]).filter(Boolean).map(r=>M.fromJSON(r,t))}function $a(e){return(e||[]).reduce((t,r)=>[...t,new ae(r.count,lh(r.VALIDITY)),...$a(r.children)],[])}function Wa(e,t=[]){for(let r=-1,n=(e||[]).length;++rt+ +(r===0),0)}function hh(e,t){let r,n,s,a,i,o;return!t||!(a=e.dictionary)?(i=ys(e,ds(e,t)),s=new M(e.name,i,e.nullable,wr(e.customMetadata))):t.has(r=a.id)?(n=(n=a.indexType)?ps(n):new Qt,o=new Ht(t.get(r),n,r,a.isOrdered),s=new M(e.name,o,e.nullable,wr(e.customMetadata))):(n=(n=a.indexType)?ps(n):new Qt,t.set(r,i=ys(e,ds(e,t))),o=new Ht(i,n,r,a.isOrdered),s=new M(e.name,o,e.nullable,wr(e.customMetadata))),s||null}function wr(e){return new Map(Object.entries(e||{}))}function ps(e){return new tt(e.isSigned,e.bitWidth)}function ys(e,t){const r=e.type.name;switch(r){case"NONE":return new ve;case"null":return new ve;case"binary":return new je;case"utf8":return new Be;case"bool":return new ze;case"list":return new Te((t||[])[0]);case"struct":return new _t(t||[]);case"struct_":return new _t(t||[])}switch(r){case"int":{const n=e.type;return new tt(n.isSigned,n.bitWidth)}case"floatingpoint":{const n=e.type;return new Xt(ut[n.precision])}case"decimal":{const n=e.type;return new xr(n.scale,n.precision)}case"date":{const n=e.type;return new Ae(Ft[n.unit])}case"time":{const n=e.type;return new Lr(V[n.unit],n.bitWidth)}case"timestamp":{const n=e.type;return new Mr(V[n.unit],n.timezone)}case"interval":{const n=e.type;return new Ur(we[n.unit])}case"union":{const n=e.type;return new Pe(Nt[n.mode],n.typeIds||[],t||[])}case"fixedsizebinary":{const n=e.type;return new Er(n.byteWidth)}case"fixedsizelist":{const n=e.type;return new $e(n.listSize,(t||[])[0])}case"map":{const n=e.type;return new We((t||[])[0],n.keysSorted)}}throw new Error(`Unrecognized type: "${r}"`)}var ee=h.Long,fh=h.Builder,dh=h.ByteBuffer,H=f.apache.arrow.flatbuf.Type,ht=f.apache.arrow.flatbuf.Field,Mt=f.apache.arrow.flatbuf.Schema,ph=f.apache.arrow.flatbuf.Buffer,jt=q.apache.arrow.flatbuf.Message,Pt=f.apache.arrow.flatbuf.KeyValue,yh=q.apache.arrow.flatbuf.FieldNode,bs=f.apache.arrow.flatbuf.Endianness,zt=q.apache.arrow.flatbuf.RecordBatch,he=q.apache.arrow.flatbuf.DictionaryBatch;class Q{constructor(t,r,n,s){this._version=r,this._headerType=n,this.body=new Uint8Array(0),s&&(this._createHeader=()=>s),this._bodyLength=typeof t=="number"?t:t.low}static fromJSON(t,r){const n=new Q(0,dt.V4,r);return n._createHeader=bh(t,r),n}static decode(t){t=new dh(x(t));const r=jt.getRootAsMessage(t),n=r.bodyLength(),s=r.version(),a=r.headerType(),i=new Q(n,s,a);return i._createHeader=mh(r,a),i}static encode(t){let r=new fh,n=-1;return t.isSchema()?n=C.encode(r,t.header()):t.isRecordBatch()?n=ot.encode(r,t.header()):t.isDictionaryBatch()&&(n=Ot.encode(r,t.header())),jt.startMessage(r),jt.addVersion(r,dt.V4),jt.addHeader(r,n),jt.addHeaderType(r,t.headerType),jt.addBodyLength(r,new ee(t.bodyLength,0)),jt.finishMessageBuffer(r,jt.endMessage(r)),r.asUint8Array()}static from(t,r=0){if(t instanceof C)return new Q(0,dt.V4,j.Schema,t);if(t instanceof ot)return new Q(r,dt.V4,j.RecordBatch,t);if(t instanceof Ot)return new Q(r,dt.V4,j.DictionaryBatch,t);throw new Error(`Unrecognized Message header: ${t}`)}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===j.Schema}isRecordBatch(){return this.headerType===j.RecordBatch}isDictionaryBatch(){return this.headerType===j.DictionaryBatch}}class ot{get nodes(){return this._nodes}get length(){return this._length}get buffers(){return this._buffers}constructor(t,r,n){this._nodes=r,this._buffers=n,this._length=typeof t=="number"?t:t.low}}class Ot{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}constructor(t,r,n=!1){this._data=t,this._isDelta=n,this._id=typeof r=="number"?r:r.low}}class Tt{constructor(t,r){this.offset=typeof t=="number"?t:t.low,this.length=typeof r=="number"?r:r.low}}class ae{constructor(t,r){this.length=typeof t=="number"?t:t.low,this.nullCount=typeof r=="number"?r:r.low}}function bh(e,t){return()=>{switch(t){case j.Schema:return C.fromJSON(e);case j.RecordBatch:return ot.fromJSON(e);case j.DictionaryBatch:return Ot.fromJSON(e)}throw new Error(`Unrecognized Message type: { name: ${j[t]}, type: ${t} }`)}}function mh(e,t){return()=>{switch(t){case j.Schema:return C.decode(e.header(new Mt));case j.RecordBatch:return ot.decode(e.header(new zt),e.version());case j.DictionaryBatch:return Ot.decode(e.header(new he),e.version())}throw new Error(`Unrecognized Message type: { name: ${j[t]}, type: ${t} }`)}}M.encode=Oh;M.decode=Th;M.fromJSON=hh;C.encode=Fh;C.decode=gh;C.fromJSON=oh;ot.encode=Dh;ot.decode=_h;ot.fromJSON=Pa;Ot.encode=xh;Ot.decode=wh;Ot.fromJSON=ch;ae.encode=Lh;ae.decode=Ih;Tt.encode=Mh;Tt.decode=vh;function gh(e,t=new Map){const r=Ah(e,t);return new C(r,vr(e),t)}function _h(e,t=dt.V4){return new ot(e.length(),Sh(e),Bh(e,t))}function wh(e,t=dt.V4){return new Ot(ot.decode(e.data(),t),e.id(),e.isDelta())}function vh(e){return new Tt(e.offset(),e.length())}function Ih(e){return new ae(e.length(),e.nullCount())}function Sh(e){const t=[];for(let r,n=-1,s=-1,a=e.nodesLength();++nM.encode(e,a));Mt.startFieldsVector(e,r.length);const n=Mt.createFieldsVector(e,r),s=t.metadata&&t.metadata.size>0?Mt.createCustomMetadataVector(e,[...t.metadata].map(([a,i])=>{const o=e.createString(`${a}`),c=e.createString(`${i}`);return Pt.startKeyValue(e),Pt.addKey(e,o),Pt.addValue(e,c),Pt.endKeyValue(e)})):-1;return Mt.startSchema(e),Mt.addFields(e,n),Mt.addEndianness(e,Uh?bs.Little:bs.Big),s!==-1&&Mt.addCustomMetadata(e,s),Mt.endSchema(e)}function Oh(e,t){let r=-1,n=-1,s=-1,a=t.type,i=t.typeId;A.isDictionary(a)?(i=a.dictionary.typeId,s=Fn.visit(a,e),n=Fn.visit(a.dictionary,e)):n=Fn.visit(a,e);const o=(a.children||[]).map(d=>M.encode(e,d)),c=ht.createChildrenVector(e,o),u=t.metadata&&t.metadata.size>0?ht.createCustomMetadataVector(e,[...t.metadata].map(([d,y])=>{const F=e.createString(`${d}`),U=e.createString(`${y}`);return Pt.startKeyValue(e),Pt.addKey(e,F),Pt.addValue(e,U),Pt.endKeyValue(e)})):-1;return t.name&&(r=e.createString(t.name)),ht.startField(e),ht.addType(e,n),ht.addTypeType(e,i),ht.addChildren(e,c),ht.addNullable(e,!!t.nullable),r!==-1&&ht.addName(e,r),s!==-1&&ht.addDictionary(e,s),u!==-1&&ht.addCustomMetadata(e,u),ht.endField(e)}function Dh(e,t){const r=t.nodes||[],n=t.buffers||[];zt.startNodesVector(e,r.length),r.slice().reverse().forEach(i=>ae.encode(e,i));const s=e.endVector();zt.startBuffersVector(e,n.length),n.slice().reverse().forEach(i=>Tt.encode(e,i));const a=e.endVector();return zt.startRecordBatch(e),zt.addLength(e,new ee(t.length,0)),zt.addNodes(e,s),zt.addBuffers(e,a),zt.endRecordBatch(e)}function xh(e,t){const r=ot.encode(e,t.data);return he.startDictionaryBatch(e),he.addId(e,new ee(t.id,0)),he.addIsDelta(e,t.isDelta),he.addData(e,r),he.endDictionaryBatch(e)}function Lh(e,t){return yh.createFieldNode(e,new ee(t.length,0),new ee(t.nullCount,0))}function Mh(e,t){return ph.createBuffer(e,new ee(t.offset,0),new ee(t.length,0))}const Uh=function(){const e=new ArrayBuffer(2);return new DataView(e).setInt16(0,256,!0),new Int16Array(e)[0]===256}();var Ya=h.ByteBuffer;const Si=e=>`Expected ${j[e]} Message in stream, but was null or length 0.`,Bi=e=>`Header pointer of flatbuffer-encoded ${j[e]} Message is null or length 0.`,Ha=(e,t)=>`Expected to read ${e} metadata bytes, but only read ${t}.`,Ka=(e,t)=>`Expected to read ${e} bytes for message body, but only read ${t}.`;class Ja{constructor(t){this.source=t instanceof Vr?t:new Vr(t)}[Symbol.iterator](){return this}next(){let t;return(t=this.readMetadataLength()).done||t.value===-1&&(t=this.readMetadataLength()).done||(t=this.readMetadata(t.value)).done?$:t}throw(t){return this.source.throw(t)}return(t){return this.source.return(t)}readMessage(t){let r;if((r=this.next()).done)return null;if(t!=null&&r.value.headerType!==t)throw new Error(Si(t));return r.value}readMessageBody(t){if(t<=0)return new Uint8Array(0);const r=x(this.source.read(t));if(r.byteLength[...s,...a.VALIDITY&&[a.VALIDITY]||[],...a.TYPE&&[a.TYPE]||[],...a.OFFSET&&[a.OFFSET]||[],...a.DATA&&[a.DATA]||[],...r(a.children)],[])}}readMessage(t){let r;if((r=this.next()).done)return null;if(t!=null&&r.value.headerType!==t)throw new Error(Si(t));return r.value}readSchema(){const t=j.Schema,r=this.readMessage(t),n=r&&r.header();if(!r||!n)throw new Error(Bi(t));return n}}const ln=4,jn="ARROW1",Je=new Uint8Array(jn.length);for(let e=0;e2147483647)throw new RangeError("Cannot write arrays larger than 2^31 - 1 in length");A.isNull(t.type)||yt.call(this,s<=0?new Uint8Array(0):rn(r.offset,n,r.nullBitmap)),this.nodes.push(new ae(n,s))}return super.visit(t)}visitNull(t){return this}visitDictionary(t){return this.visit(t.indices)}get nodes(){return this._nodes}get buffers(){return this._buffers}get byteLength(){return this._byteLength}get bufferRegions(){return this._bufferRegions}}function yt(e){const t=e.byteLength+7&-8;return this.buffers.push(e),this.bufferRegions.push(new Tt(this._byteLength,t)),this._byteLength+=t,this}function Ch(e){const{type:t,length:r,typeIds:n,valueOffsets:s}=e;if(yt.call(this,n),t.mode===Nt.Sparse)return zn.call(this,e);if(t.mode===Nt.Dense){if(e.offset<=0)return yt.call(this,s),zn.call(this,e);{const a=n.reduce((d,y)=>Math.max(d,y),n[0]),i=new Int32Array(a+1),o=new Int32Array(a+1).fill(-1),c=new Int32Array(r),u=en(-s[0],r,s);for(let d,y,F=-1;++F=e.length?yt.call(this,new Uint8Array(0)):(t=e.values)instanceof Uint8Array?yt.call(this,rn(e.offset,e.length,t)):yt.call(this,ke(e))}function Gt(e){return yt.call(this,e.values.subarray(0,e.length*e.stride))}function qa(e){const{length:t,values:r,valueOffsets:n}=e,s=n[0],a=n[t],i=Math.min(a-s,r.byteLength-s);return yt.call(this,en(-n[0],t,n)),yt.call(this,r.subarray(s,s+i)),this}function Ti(e){const{length:t,valueOffsets:r}=e;return r&&yt.call(this,en(r[0],t,r)),this.visit(e.getChildAt(0))}function zn(e){return this.visitMany(e.type.children.map((t,r)=>e.getChildAt(r)).filter(Boolean))[0]}Y.prototype.visitBool=Rh;Y.prototype.visitInt=Gt;Y.prototype.visitFloat=Gt;Y.prototype.visitUtf8=qa;Y.prototype.visitBinary=qa;Y.prototype.visitFixedSizeBinary=Gt;Y.prototype.visitDate=Gt;Y.prototype.visitTimestamp=Gt;Y.prototype.visitTime=Gt;Y.prototype.visitDecimal=Gt;Y.prototype.visitList=Ti;Y.prototype.visitStruct=zn;Y.prototype.visitUnion=Ch;Y.prototype.visitInterval=Gt;Y.prototype.visitFixedSizeList=Ti;Y.prototype.visitMap=Ti;class Fi extends ne{constructor(t){super(),this._position=0,this._started=!1,this._sink=new Ne,this._schema=null,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._dictionaryDeltaOffsets=new Map,at(t)||(t={autoDestroy:!0,writeLegacyIpcFormat:!1}),this._autoDestroy=typeof t.autoDestroy=="boolean"?t.autoDestroy:!0,this._writeLegacyIpcFormat=typeof t.writeLegacyIpcFormat=="boolean"?t.writeLegacyIpcFormat:!1}static throughNode(t){throw new Error('"throughNode" not available in this environment')}static throughDOM(t,r){throw new Error('"throughDOM" not available in this environment')}toString(t=!1){return this._sink.toString(t)}toUint8Array(t=!1){return this._sink.toUint8Array(t)}writeAll(t){return Yt(t)?t.then(r=>this.writeAll(r)):Ct(t)?Li(this,t):xi(this,t)}get closed(){return this._sink.closed}[Symbol.asyncIterator](){return this._sink[Symbol.asyncIterator]()}toDOMStream(t){return this._sink.toDOMStream(t)}toNodeStream(t){return this._sink.toNodeStream(t)}close(){return this.reset()._sink.close()}abort(t){return this.reset()._sink.abort(t)}finish(){return this._autoDestroy?this.close():this.reset(this._sink,this._schema),this}reset(t=this._sink,r=null){return t===this._sink||t instanceof Ne?this._sink=t:(this._sink=new Ne,t&&xc(t)?this.toDOMStream({type:"bytes"}).pipeTo(t):t&&Lc(t)&&this.toNodeStream({objectMode:!1}).pipe(t)),this._started&&this._schema&&this._writeFooter(this._schema),this._started=!1,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._dictionaryDeltaOffsets=new Map,(!r||!r.compareTo(this._schema))&&(r===null?(this._position=0,this._schema=null):(this._started=!0,this._schema=r,this._writeSchema(r))),this}write(t){let r=null;if(this._sink){if(t==null)return this.finish()&&void 0;if(t instanceof E&&!(r=t.schema))return this.finish()&&void 0;if(t instanceof X&&!(r=t.schema))return this.finish()&&void 0}else throw new Error("RecordBatchWriter is closed");if(r&&!r.compareTo(this._schema)){if(this._started&&this._autoDestroy)return this.close();this.reset(this._sink,r)}t instanceof X?t instanceof pn||this._writeRecordBatch(t):t instanceof E?this.writeAll(t.chunks):mt(t)&&this.writeAll(t)}_writeMessage(t,r=8){const n=r-1,s=Q.encode(t),a=s.byteLength,i=this._writeLegacyIpcFormat?4:8,o=a+i+n&~n,c=o-a-i;return t.headerType===j.RecordBatch?this._recordBatchBlocks.push(new Kt(o,t.bodyLength,this._position)):t.headerType===j.DictionaryBatch&&this._dictionaryBlocks.push(new Kt(o,t.bodyLength,this._position)),this._writeLegacyIpcFormat||this._write(Int32Array.of(-1)),this._write(Int32Array.of(o-i)),a>0&&this._write(s),this._writePadding(c)}_write(t){if(this._started){const r=x(t);r&&r.byteLength>0&&(this._sink.write(r),this._position+=r.byteLength)}return this}_writeSchema(t){return this._writeMessage(Q.from(t))}_writeFooter(t){return this._writeLegacyIpcFormat?this._write(Int32Array.of(0)):this._write(Int32Array.of(-1,0))}_writeMagic(){return this._write(Je)}_writePadding(t){return t>0?this._write(new Uint8Array(t)):this}_writeRecordBatch(t){const{byteLength:r,nodes:n,bufferRegions:s,buffers:a}=Y.assemble(t),i=new ot(t.length,n,s),o=Q.from(i,r);return this._writeDictionaries(t)._writeMessage(o)._writeBodyBuffers(a)}_writeDictionaryBatch(t,r,n=!1){this._dictionaryDeltaOffsets.set(r,t.length+(this._dictionaryDeltaOffsets.get(r)||0));const{byteLength:s,nodes:a,bufferRegions:i,buffers:o}=Y.assemble(t),c=new ot(t.length,a,i),u=new Ot(c,r,n),d=Q.from(u,s);return this._writeMessage(d)._writeBodyBuffers(o)}_writeBodyBuffers(t){let r,n,s;for(let a=-1,i=t.length;++a0&&(this._write(r),(s=(n+7&-8)-n)>0&&this._writePadding(s));return this}_writeDictionaries(t){for(let[r,n]of t.dictionaries){let s=this._dictionaryDeltaOffsets.get(r)||0;if(s===0||(n=n.slice(s)).length>0){const a="chunks"in n?n.chunks:[n];for(const i of a)this._writeDictionaryBatch(i,r,s>0),s+=i.length}}return this}}class Oi extends Fi{static writeAll(t,r){const n=new Oi(r);return Yt(t)?t.then(s=>n.writeAll(s)):Ct(t)?Li(n,t):xi(n,t)}}class Di extends Fi{constructor(){super(),this._autoDestroy=!0}static writeAll(t){const r=new Di;return Yt(t)?t.then(n=>r.writeAll(n)):Ct(t)?Li(r,t):xi(r,t)}_writeSchema(t){return this._writeMagic()._writePadding(2)}_writeFooter(t){const r=Ke.encode(new Ke(t,dt.V4,this._recordBatchBlocks,this._dictionaryBlocks));return super._writeFooter(t)._write(r)._write(Int32Array.of(r.byteLength))._writeMagic()}}function xi(e,t){let r=t;t instanceof E&&(r=t.chunks,e.reset(void 0,t.schema));for(const n of r)e.write(n);return e.finish()}async function Li(e,t){for await(const r of t)e.write(r);return e.finish()}const On=new Uint8Array(0),Za=e=>[On,On,new Uint8Array(e),On];function kh(e,t,r=t.reduce((n,s)=>Math.max(n,s.length),0)){let n,s,a=-1,i=t.length;const o=[...e.fields],c=[],u=(r+63&-64)>>3;for(;++at)),e)}function Qa(e,t){return zh(e,t.map(r=>r instanceof G?r.chunks.map(n=>n.data):[r.data]))}function zh(e,t){const r=[...e.fields],n=[],s={numBatches:t.reduce((y,F)=>Math.max(y,F.length),0)};let a=0,i=0,o=-1,c=t.length,u,d=[];for(;s.numBatches-- >0;){for(i=Number.POSITIVE_INFINITY,o=-1;++o0&&(n[a++]=[i,d.slice()]))}return[e=new C(r,e.metadata),n.map(y=>new X(e,...y))]}function Ph(e,t,r,n,s){let a,i,o=0,c=-1,u=n.length;const d=(t+63&-64)>>3;for(;++c=t?o===t?r[c]=a:(r[c]=a.slice(0,t),a=a.slice(t,o-t),s.numBatches=Math.max(s.numBatches,n[c].unshift(a))):((i=e[c]).nullable||(e[c]=i.clone({nullable:!0})),r[c]=a?a._changeLengthAndBackfillNullBitmap(t):p.new(i.type,0,t,t,Za(d)));return r}class z extends L{constructor(t,r){super(),this._children=r,this.numChildren=t.childData.length,this._bindDataAccessors(this.data=t)}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`${l[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(t,r=this._children){return L.new(t,r)}concat(...t){return G.concat(this,...t)}slice(t,r){return yi(this,t,r,this._sliceInternal)}isValid(t){if(this.nullCount>0){const r=this.offset+t;return(this.nullBitmap[r>>3]&1<=this.numChildren?null:(this._children||(this._children=[]))[t]||(this._children[t]=L.new(this.data.childData[t]))}toJSON(){return[...this]}_sliceInternal(t,r,n){return t.clone(t.data.slice(r,n-r),null)}_bindDataAccessors(t){}}z.prototype[Symbol.isConcatSpreadable]=!0;class $h extends z{asUtf8(){return L.new(this.data.clone(new Be))}}class Wh extends z{static from(t){return re(()=>new ze,t)}}class Mi extends z{static from(...t){return t.length===2?re(()=>t[1]===Ft.DAY?new mu:new ts,t[0]):re(()=>new ts,t[0])}}class Yh extends Mi{}class Hh extends Mi{}class Kh extends z{}class Ui extends z{constructor(t){super(t),this.indices=L.new(t.clone(this.type.indices))}static from(...t){if(t.length===3){const[r,n,s]=t,a=new Ht(r.type,n,null,null);return L.new(p.Dictionary(a,0,s.length,0,null,s,r))}return re(()=>t[0].type,t[0])}get dictionary(){return this.data.dictionary}reverseLookup(t){return this.dictionary.indexOf(t)}getKey(t){return this.indices.get(t)}getValue(t){return this.dictionary.get(t)}setKey(t,r){return this.indices.set(t,r)}setValue(t,r){return this.dictionary.set(t,r)}}Ui.prototype.indices=null;class Jh extends z{}class Gh extends z{}class hn extends z{static from(t){let r=Qh(this);if(t instanceof ArrayBuffer||ArrayBuffer.isView(t)){let n=Zh(t.constructor)||r;if(r===null&&(r=n),r&&r===n){let s=new r,a=t.byteLength/s.ArrayType.BYTES_PER_ELEMENT;if(!qh(r,t.constructor))return L.new(p.Float(s,0,a,0,null,t))}}if(r)return re(()=>new r,t);throw t instanceof DataView||t instanceof ArrayBuffer?new TypeError(`Cannot infer float type from instance of ${t.constructor.name}`):new TypeError("Unrecognized FloatVector input")}}class Xa extends hn{toFloat32Array(){return new Float32Array(this)}toFloat64Array(){return new Float64Array(this)}}class to extends hn{}class eo extends hn{}const qh=(e,t)=>e===sn&&t!==Uint16Array,Zh=e=>{switch(e){case Uint16Array:return sn;case Float32Array:return ui;case Float64Array:return li;default:return null}},Qh=e=>{switch(e){case Xa:return sn;case to:return ui;case eo:return li;default:return null}};class Ei extends z{}class Xh extends Ei{}class tf extends Ei{}class St extends z{static from(...t){let[r,n=!1]=t,s=nf(this,n);if(r instanceof ArrayBuffer||ArrayBuffer.isView(r)){let a=rf(r.constructor,n)||s;if(s===null&&(s=a),s&&s===a){let i=new s,o=r.byteLength/i.ArrayType.BYTES_PER_ELEMENT;return ef(s,r.constructor)&&(o*=.5),L.new(p.Int(i,0,o,0,null,r))}}if(s)return re(()=>new s,r);throw r instanceof DataView||r instanceof ArrayBuffer?new TypeError(`Cannot infer integer type from instance of ${r.constructor.name}`):new TypeError("Unrecognized IntVector input")}}class ro extends St{}class no extends St{}class io extends St{}class so extends St{toBigInt64Array(){return Qs(this.values)}get values64(){return this._values64||(this._values64=this.toBigInt64Array())}}class ao extends St{}class oo extends St{}class co extends St{}class uo extends St{toBigUint64Array(){return Xs(this.values)}get values64(){return this._values64||(this._values64=this.toBigUint64Array())}}const ef=(e,t)=>(e===Ie||e===Se)&&(t===Int32Array||t===Uint32Array),rf=(e,t)=>{switch(e){case Int8Array:return ii;case Int16Array:return si;case Int32Array:return t?Ie:Qt;case xe:return Ie;case Uint8Array:return ai;case Uint16Array:return oi;case Uint32Array:return t?Se:ci;case Ze:return Se;default:return null}},nf=(e,t)=>{switch(e){case ro:return ii;case no:return si;case io:return t?Ie:Qt;case so:return Ie;case ao:return ai;case oo:return oi;case co:return t?Se:ci;case uo:return Se;default:return null}};class sf extends z{}class af extends z{asList(){const t=this.type.children[0];return L.new(this.data.clone(new Te(t)))}bind(t){const r=this.getChildAt(0),{[t]:n,[t+1]:s}=this.valueOffsets;return new ma(r.slice(n,s))}}class of extends z{}const cf=Symbol.for("rowIndex");class fn extends z{bind(t){const r=this._row||(this._row=new ga(this)),n=Object.create(r);return n[cf]=t,n}}class or extends z{}class uf extends or{}class lf extends or{}class hf extends or{}class ff extends or{}class cr extends z{}class df extends cr{}class pf extends cr{}class yf extends cr{}class bf extends cr{}class Ni extends z{get typeIdToChildIndex(){return this.data.type.typeIdToChildIndex}}class mf extends Ni{get valueOffsets(){return this.data.valueOffsets}}class gf extends Ni{}class _f extends z{static from(t){return re(()=>new Be,t)}asBinary(){return L.new(this.data.clone(new je))}}function ws(e){return function(){return e(this)}}function wf(e){return function(t){return e(this,t)}}function vs(e){return function(t,r){return e(this,t,r)}}class g extends D{}const vf=(e,t)=>864e5*e[t],Vi=(e,t)=>4294967296*e[t+1]+(e[t]>>>0),If=(e,t)=>4294967296*(e[t+1]/1e3)+(e[t]>>>0)/1e3,Sf=(e,t)=>4294967296*(e[t+1]/1e6)+(e[t]>>>0)/1e6,lo=e=>new Date(e),Bf=(e,t)=>lo(vf(e,t)),Af=(e,t)=>lo(Vi(e,t)),Tf=(e,t)=>null,ho=(e,t,r)=>{const{[r]:n,[r+1]:s}=t;return n!=null&&s!=null?e.subarray(n,s):null},Ff=({offset:e,values:t},r)=>{const n=e+r;return(t[n>>3]&1<Bf(e,t),po=({values:e},t)=>Af(e,t*2),Lt=({stride:e,values:t},r)=>t[e*r],yo=({stride:e,values:t},r)=>fa(t[e*r]),Ci=({stride:e,values:t,type:r},n)=>ie.new(t.subarray(e*n,e*(n+1)),r.isSigned),Of=({stride:e,values:t},r)=>t.subarray(e*r,e*(r+1)),Df=({values:e,valueOffsets:t},r)=>ho(e,t,r),xf=({values:e,valueOffsets:t},r)=>{const n=ho(e,t,r);return n!==null?En(n):null},Lf=(e,t)=>e.type.bitWidth<64?Lt(e,t):Ci(e,t),Mf=(e,t)=>e.type.precision!==ut.HALF?Lt(e,t):yo(e,t),Uf=(e,t)=>e.type.unit===Ft.DAY?fo(e,t):po(e,t),bo=({values:e},t)=>1e3*Vi(e,t*2),mo=({values:e},t)=>Vi(e,t*2),go=({values:e},t)=>If(e,t*2),_o=({values:e},t)=>Sf(e,t*2),Ef=(e,t)=>{switch(e.type.unit){case V.SECOND:return bo(e,t);case V.MILLISECOND:return mo(e,t);case V.MICROSECOND:return go(e,t);case V.NANOSECOND:return _o(e,t)}},wo=({values:e,stride:t},r)=>e[t*r],vo=({values:e,stride:t},r)=>e[t*r],Io=({values:e},t)=>ie.signed(e.subarray(2*t,2*(t+1))),So=({values:e},t)=>ie.signed(e.subarray(2*t,2*(t+1))),Nf=(e,t)=>{switch(e.type.unit){case V.SECOND:return wo(e,t);case V.MILLISECOND:return vo(e,t);case V.MICROSECOND:return Io(e,t);case V.NANOSECOND:return So(e,t)}},Vf=({values:e},t)=>ie.decimal(e.subarray(4*t,4*(t+1))),Cf=(e,t)=>{const r=e.getChildAt(0),{valueOffsets:n,stride:s}=e;return r.slice(n[t*s],n[t*s+1])},Rf=(e,t)=>e.bind(t),kf=(e,t)=>e.bind(t),jf=(e,t)=>e.type.mode===Nt.Dense?Bo(e,t):Ao(e,t),Bo=(e,t)=>{const r=e.typeIdToChildIndex[e.typeIds[t]],n=e.getChildAt(r);return n?n.get(e.valueOffsets[t]):null},Ao=(e,t)=>{const r=e.typeIdToChildIndex[e.typeIds[t]],n=e.getChildAt(r);return n?n.get(t):null},zf=(e,t)=>e.getValue(e.getKey(t)),Pf=(e,t)=>e.type.unit===we.DAY_TIME?To(e,t):Fo(e,t),To=({values:e},t)=>e.subarray(2*t,2*(t+1)),Fo=({values:e},t)=>{const r=e[t],n=new Int32Array(2);return n[0]=r/12|0,n[1]=r%12|0,n},$f=(e,t)=>{const r=e.getChildAt(0),{stride:n}=e;return r.slice(t*n,(t+1)*n)};g.prototype.visitNull=Tf;g.prototype.visitBool=Ff;g.prototype.visitInt=Lf;g.prototype.visitInt8=Lt;g.prototype.visitInt16=Lt;g.prototype.visitInt32=Lt;g.prototype.visitInt64=Ci;g.prototype.visitUint8=Lt;g.prototype.visitUint16=Lt;g.prototype.visitUint32=Lt;g.prototype.visitUint64=Ci;g.prototype.visitFloat=Mf;g.prototype.visitFloat16=yo;g.prototype.visitFloat32=Lt;g.prototype.visitFloat64=Lt;g.prototype.visitUtf8=xf;g.prototype.visitBinary=Df;g.prototype.visitFixedSizeBinary=Of;g.prototype.visitDate=Uf;g.prototype.visitDateDay=fo;g.prototype.visitDateMillisecond=po;g.prototype.visitTimestamp=Ef;g.prototype.visitTimestampSecond=bo;g.prototype.visitTimestampMillisecond=mo;g.prototype.visitTimestampMicrosecond=go;g.prototype.visitTimestampNanosecond=_o;g.prototype.visitTime=Nf;g.prototype.visitTimeSecond=wo;g.prototype.visitTimeMillisecond=vo;g.prototype.visitTimeMicrosecond=Io;g.prototype.visitTimeNanosecond=So;g.prototype.visitDecimal=Vf;g.prototype.visitList=Cf;g.prototype.visitStruct=kf;g.prototype.visitUnion=jf;g.prototype.visitDenseUnion=Bo;g.prototype.visitSparseUnion=Ao;g.prototype.visitDictionary=zf;g.prototype.visitInterval=Pf;g.prototype.visitIntervalDayTime=To;g.prototype.visitIntervalYearMonth=Fo;g.prototype.visitFixedSizeList=$f;g.prototype.visitMap=Rf;const dn=new g;class _ extends D{}function Wf(e,t){return t===null&&e.length>0?0:-1}function Yf(e,t){const{nullBitmap:r}=e;if(!r||e.nullCount<=0)return-1;let n=0;for(const s of Qe(r,e.data.offset+(t||0),e.length,r,ti)){if(!s)return n;++n}return-1}function T(e,t,r){if(t===void 0)return-1;if(t===null)return Yf(e,r);const n=se(t);for(let s=(r||0)-1,a=e.length;++s(s&1<0)return Hf(e);const{type:t,typeId:r,length:n}=e;return e.stride===1&&(r===l.Timestamp||r===l.Int&&t.bitWidth!==64||r===l.Time&&t.bitWidth!==64||r===l.Float&&t.precision>0)?e.values.subarray(0,n)[Symbol.iterator]():function*(s){for(let a=-1;++ae+t,Dn=e=>`Cannot compute the byte width of variable-width column ${e}`;class Kf extends D{visitNull(t){return 0}visitInt(t){return t.bitWidth/8}visitFloat(t){return t.ArrayType.BYTES_PER_ELEMENT}visitBinary(t){throw new Error(Dn(t))}visitUtf8(t){throw new Error(Dn(t))}visitBool(t){return 1/8}visitDecimal(t){return 16}visitDate(t){return(t.unit+1)*4}visitTime(t){return t.bitWidth/8}visitTimestamp(t){return t.unit===V.SECOND?4:8}visitInterval(t){return(t.unit+1)*4}visitList(t){throw new Error(Dn(t))}visitStruct(t){return this.visitFields(t.children).reduce(Me,0)}visitUnion(t){return this.visitFields(t.children).reduce(Me,0)}visitFixedSizeBinary(t){return t.byteWidth}visitFixedSizeList(t){return t.listSize*this.visitFields(t.children).reduce(Me,0)}visitMap(t){return this.visitFields(t.children).reduce(Me,0)}visitDictionary(t){return this.visit(t.indices)}visitFields(t){return(t||[]).map(r=>this.visit(r.type))}visitSchema(t){return this.visitFields(t.fields).reduce(Me,0)}}const Lo=new Kf;class Jf extends D{visitNull(){return of}visitBool(){return Wh}visitInt(){return St}visitInt8(){return ro}visitInt16(){return no}visitInt32(){return io}visitInt64(){return so}visitUint8(){return ao}visitUint16(){return oo}visitUint32(){return co}visitUint64(){return uo}visitFloat(){return hn}visitFloat16(){return Xa}visitFloat32(){return to}visitFloat64(){return eo}visitUtf8(){return _f}visitBinary(){return $h}visitFixedSizeBinary(){return Jh}visitDate(){return Mi}visitDateDay(){return Yh}visitDateMillisecond(){return Hh}visitTimestamp(){return or}visitTimestampSecond(){return uf}visitTimestampMillisecond(){return lf}visitTimestampMicrosecond(){return hf}visitTimestampNanosecond(){return ff}visitTime(){return cr}visitTimeSecond(){return df}visitTimeMillisecond(){return pf}visitTimeMicrosecond(){return yf}visitTimeNanosecond(){return bf}visitDecimal(){return Kh}visitList(){return sf}visitStruct(){return fn}visitUnion(){return Ni}visitDenseUnion(){return mf}visitSparseUnion(){return gf}visitDictionary(){return Ui}visitInterval(){return Ei}visitIntervalDayTime(){return Xh}visitIntervalYearMonth(){return tf}visitFixedSizeList(){return Gh}visitMap(){return af}}const Mo=new Jf;L.new=Gf;L.from=qf;function Gf(e,...t){return new(Mo.getVisitFn(e)())(e,...t)}function re(e,t){if(mt(t))return L.from({nullValues:[null,void 0],type:e(),values:t});if(Ct(t))return L.from({nullValues:[null,void 0],type:e(),values:t});const{values:r=[],type:n=e(),nullValues:s=[null,void 0]}={...t};return mt(r)?L.from({nullValues:s,...t,type:n}):L.from({nullValues:s,...t,type:n})}function qf(e){const{values:t=[],...r}={nullValues:[null,void 0],...e};if(mt(t)){const n=[...W.throughIterable(r)(t)];return n.length===1?n[0]:G.concat(n)}return(async n=>{const s=W.throughAsyncIterable(r);for await(const a of s(t))n.push(a);return n.length===1?n[0]:G.concat(n)})([])}z.prototype.get=function(t){return dn.visit(this,t)};z.prototype.set=function(t,r){return un.visit(this,t,r)};z.prototype.indexOf=function(t,r){return Do.visit(this,t,r)};z.prototype.toArray=function(){return xo.visit(this)};z.prototype.getByteWidth=function(){return Lo.visit(this.type)};z.prototype[Symbol.iterator]=function(){return Ri.visit(this)};z.prototype._bindDataAccessors=td;Object.keys(l).map(e=>l[e]).filter(e=>typeof e=="number").filter(e=>e!==l.NONE).forEach(e=>{const t=Mo.visit(e);t.prototype.get=wf(dn.getVisitFn(e)),t.prototype.set=vs(un.getVisitFn(e)),t.prototype.indexOf=vs(Do.getVisitFn(e)),t.prototype.toArray=ws(xo.getVisitFn(e)),t.prototype.getByteWidth=Zf(Lo.getVisitFn(e)),t.prototype[Symbol.iterator]=ws(Ri.getVisitFn(e))});function Zf(e){return function(){return e(this.type)}}function Qf(e){return function(t){return this.isValid(t)?e.call(this,t):null}}function Xf(e){return function(t,r){sa(this.nullBitmap,this.offset+t,r!=null)&&e.call(this,t,r)}}function td(){const e=this.nullBitmap;e&&e.byteLength>0&&(this.get=Qf(this.get),this.set=Xf(this.set))}class E extends G{constructor(...t){let r=null;t[0]instanceof C&&(r=t.shift());let n=wa(X,t);if(!r&&!(r=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 pn(r)),super(new _t(r.fields),n),this._schema=r,this._chunks=n}static empty(t=new C([])){return new E(t,[])}static from(t){if(!t)return E.empty();if(typeof t=="object"){let n=mt(t.values)?ed(t):Ct(t.values)?rd(t):null;if(n!==null)return n}let r=bt.from(t);return Yt(r)?(async()=>await E.from(await r))():r.isSync()&&(r=r.open())?r.schema?new E(r.schema,[...r]):E.empty():(async n=>{const s=await n,a=s.schema,i=[];if(a){for await(let o of s)i.push(o);return new E(a,i)}return E.empty()})(r.open())}static async fromAsync(t){return await E.from(t)}static fromStruct(t){return E.new(t.data.childData,t.type.children)}static new(...t){return new E(...jh(yl(t)))}get schema(){return this._schema}get length(){return this._length}get chunks(){return this._chunks}get numCols(){return this._numChildren}clone(t=this._chunks){return new E(this._schema,t)}getColumn(t){return this.getColumnAt(this.getColumnIndex(t))}getColumnAt(t){return this.getChildAt(t)}getColumnIndex(t){return this._schema.fields.findIndex(r=>r.name===t)}getChildAt(t){if(t<0||t>=this.numChildren)return null;let r,n;const s=this._schema.fields,a=this._children||(this._children=[]);if(n=a[t])return n;if(r=s[t]){const i=this._chunks.map(o=>o.getChildAt(t)).filter(o=>o!=null);if(i.length>0)return a[t]=new pt(r,i)}return null}serialize(t="binary",r=!0){return(r?Oi:Di).writeAll(this).toUint8Array(!0)}count(){return this._length}select(...t){const r=this._schema.fields.reduce((n,s,a)=>n.set(s.name,a),new Map);return this.selectAt(...t.map(n=>r.get(n)).filter(n=>n>-1))}selectAt(...t){const r=this._schema.selectAt(...t);return new E(r,this._chunks.map(({length:n,data:{childData:s}})=>new X(r,n,t.map(a=>s[a]).filter(Boolean))))}assign(t){const r=this._schema.fields,[n,s]=t.schema.fields.reduce((o,c,u)=>{const[d,y]=o,F=r.findIndex(U=>U.name===c.name);return~F?y[F]=u:d.push(u),o},[[],[]]),a=this._schema.assign(t.schema),i=[...r.map((o,c,u,d=s[c])=>d===void 0?this.getColumnAt(c):t.getColumnAt(d)),...n.map(o=>t.getColumnAt(o))].filter(Boolean);return new E(...Qa(a,i))}}function ed(e){const{type:t}=e;return t instanceof _t?E.fromStruct(fn.from(e)):null}function rd(e){const{type:t}=e;return t instanceof _t?fn.from(e).then(r=>E.fromStruct(r)):null}class X extends fn{constructor(...t){let r,n=t[0],s;if(t[1]instanceof p)[,r,s]=t;else{const a=n.fields,[,i,o]=t;r=p.Struct(new _t(a),0,i,0,null,o)}super(r,s),this._schema=n}static from(t){return mt(t.values),E.from(t)}static new(...t){const[r,n]=va(t),s=n.filter(a=>a instanceof L);return new X(...kh(new C(r),s.map(a=>a.data)))}clone(t,r=this._children){return new X(this._schema,t,r)}concat(...t){const r=this._schema,n=G.flatten(this,...t);return new E(r,n.map(({data:s})=>new X(r,s)))}get schema(){return this._schema}get numCols(){return this._schema.fields.length}get dictionaries(){return this._dictionaries||(this._dictionaries=ki.collect(this))}select(...t){const r=this._schema.fields.reduce((n,s,a)=>n.set(s.name,a),new Map);return this.selectAt(...t.map(n=>r.get(n)).filter(n=>n>-1))}selectAt(...t){const r=this._schema.selectAt(...t),n=t.map(s=>this.data.childData[s]).filter(Boolean);return new X(r,this.length,n)}}class pn extends X{constructor(t){super(t,0,t.fields.map(r=>p.new(r.type,0,0,0)))}}class ki extends D{constructor(){super(...arguments),this.dictionaries=new Map}static collect(t){return new ki().visit(t.data,new _t(t.schema.fields)).dictionaries}visit(t,r){return A.isDictionary(r)?this.visitDictionary(t,r):(t.childData.forEach((n,s)=>this.visit(n,r.children[s].type)),this)}visitDictionary(t,r){const n=t.dictionary;return n&&n.length>0&&this.dictionaries.set(r.id,n),this}}class bt extends ne{constructor(t){super(),this._impl=t}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(t){return this._impl.throw(t)}return(t){return this._impl.return(t)}cancel(){return this._impl.cancel()}reset(t){return this._impl.reset(t),this._DOMStream=void 0,this._nodeStream=void 0,this}open(t){const r=this._impl.open(t);return Yt(r)?r.then(()=>this):this}readRecordBatch(t){return this._impl.isFile()?this._impl.readRecordBatch(t):null}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}toDOMStream(){return it.toDOMStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this})}toNodeStream(){return it.toNodeStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this},{objectMode:!0})}static throughNode(t){throw new Error('"throughNode" not available in this environment')}static throughDOM(t,r){throw new Error('"throughDOM" not available in this environment')}static from(t){return t instanceof bt?t:Nn(t)?ad(t):Gs(t)?ud(t):Yt(t)?(async()=>await bt.from(await t))():qs(t)||Qn(t)||Zs(t)||Ct(t)?cd(new te(t)):od(new Vr(t))}static readAll(t){return t instanceof bt?t.isSync()?Is(t):Ss(t):Nn(t)||ArrayBuffer.isView(t)||mt(t)||Js(t)?Is(t):Ss(t)}}class Rr extends bt{constructor(t){super(t),this._impl=t}[Symbol.iterator](){return this._impl[Symbol.iterator]()}async*[Symbol.asyncIterator](){yield*this[Symbol.iterator]()}}class kr extends bt{constructor(t){super(t),this._impl=t}[Symbol.iterator](){throw new Error("AsyncRecordBatchStreamReader is not Iterable")}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}}class Uo extends Rr{constructor(t){super(t),this._impl=t}}class nd extends kr{constructor(t){super(t),this._impl=t}}class Eo{constructor(t=new Map){this.closed=!1,this.autoDestroy=!0,this._dictionaryIndex=0,this._recordBatchIndex=0,this.dictionaries=t}get numDictionaries(){return this._dictionaryIndex}get numRecordBatches(){return this._recordBatchIndex}isSync(){return!1}isAsync(){return!1}isFile(){return!1}isStream(){return!1}reset(t){return this._dictionaryIndex=0,this._recordBatchIndex=0,this.schema=t,this.dictionaries=new Map,this}_loadRecordBatch(t,r){return new X(this.schema,t.length,this._loadVectors(t,r,this.schema.fields))}_loadDictionaryBatch(t,r){const{id:n,isDelta:s,data:a}=t,{dictionaries:i,schema:o}=this,c=i.get(n);if(s||!c){const u=o.dictionaries.get(n);return c&&s?c.concat(L.new(this._loadVectors(a,r,[u])[0])):L.new(this._loadVectors(a,r,[u])[0])}return c}_loadVectors(t,r,n){return new za(r,t.nodes,t.buffers,this.dictionaries).visitMany(n)}}class jr extends Eo{constructor(t,r){super(r),this._reader=Nn(t)?new Nh(this._handle=t):new Ja(this._handle=t)}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(t){return this.closed||(this.autoDestroy=Vo(this,t),this.schema||(this.schema=this._reader.readSchema())||this.cancel()),this}throw(t){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.throw(t):$}return(t){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.return(t):$}next(){if(this.closed)return $;let t,{_reader:r}=this;for(;t=this._readNextMessageAndValidate();)if(t.isSchema())this.reset(t.header());else if(t.isRecordBatch()){this._recordBatchIndex++;const n=t.header(),s=r.readMessageBody(t.bodyLength),a=this._loadRecordBatch(n,s);return{done:!1,value:a}}else if(t.isDictionaryBatch()){this._dictionaryIndex++;const n=t.header(),s=r.readMessageBody(t.bodyLength),a=this._loadDictionaryBatch(n,s);this.dictionaries.set(n.id,a)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new pn(this.schema)}):this.return()}_readNextMessageAndValidate(t){return this._reader.readMessage(t)}}class zr extends Eo{constructor(t,r){super(r),this._reader=new Eh(this._handle=t)}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(t){return this.closed||(this.autoDestroy=Vo(this,t),this.schema||(this.schema=await this._reader.readSchema())||await this.cancel()),this}async throw(t){return!this.closed&&this.autoDestroy&&(this.closed=!0)?await this.reset()._reader.throw(t):$}async return(t){return!this.closed&&this.autoDestroy&&(this.closed=!0)?await this.reset()._reader.return(t):$}async next(){if(this.closed)return $;let t,{_reader:r}=this;for(;t=await this._readNextMessageAndValidate();)if(t.isSchema())await this.reset(t.header());else if(t.isRecordBatch()){this._recordBatchIndex++;const n=t.header(),s=await r.readMessageBody(t.bodyLength),a=this._loadRecordBatch(n,s);return{done:!1,value:a}}else if(t.isDictionaryBatch()){this._dictionaryIndex++;const n=t.header(),s=await r.readMessageBody(t.bodyLength),a=this._loadDictionaryBatch(n,s);this.dictionaries.set(n.id,a)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new pn(this.schema)}):await this.return()}async _readNextMessageAndValidate(t){return await this._reader.readMessage(t)}}class No extends jr{constructor(t,r){super(t instanceof as?t:new as(t),r)}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(t){if(!this.closed&&!this._footer){this.schema=(this._footer=this._readFooter()).schema;for(const r of this._footer.dictionaryBatches())r&&this._readDictionaryBatch(this._dictionaryIndex++)}return super.open(t)}readRecordBatch(t){if(this.closed)return null;this._footer||this.open();const r=this._footer&&this._footer.getRecordBatch(t);if(r&&this._handle.seek(r.offset)){const n=this._reader.readMessage(j.RecordBatch);if(n&&n.isRecordBatch()){const s=n.header(),a=this._reader.readMessageBody(n.bodyLength);return this._loadRecordBatch(s,a)}}return null}_readDictionaryBatch(t){const r=this._footer&&this._footer.getDictionaryBatch(t);if(r&&this._handle.seek(r.offset)){const n=this._reader.readMessage(j.DictionaryBatch);if(n&&n.isDictionaryBatch()){const s=n.header(),a=this._reader.readMessageBody(n.bodyLength),i=this._loadDictionaryBatch(s,a);this.dictionaries.set(s.id,i)}}}_readFooter(){const{_handle:t}=this,r=t.size-Ga,n=t.readInt32(r),s=t.readAt(r-n,n);return Ke.decode(s)}_readNextMessageAndValidate(t){if(this._footer||this.open(),this._footer&&this._recordBatchIndex=4?Ai(t)?new Uo(new No(e.read())):new Rr(new jr(e)):new Rr(new jr(function*(){}()))}async function cd(e){const t=await e.peek(ar+7&-8);return t&&t.byteLength>=4?Ai(t)?new Uo(new No(await e.read())):new kr(new zr(e)):new kr(new zr(async function*(){}()))}async function ud(e){const{size:t}=await e.stat(),r=new Cr(e,t);return t>=Vh&&Ai(await r.readAt(0,ar+7&-8))?new nd(new id(r)):new kr(new zr(r))}function ld(e,t){if(Ct(e))return fd(e,t);if(mt(e))return hd(e,t);throw new Error("toDOMStream() must be called with an Iterable or AsyncIterable")}function hd(e,t){let r=null;const n=t&&t.type==="bytes"||!1,s=t&&t.highWaterMark||2**24;return new ReadableStream({...t,start(i){a(i,r||(r=e[Symbol.iterator]()))},pull(i){r?a(i,r):i.close()},cancel(){(r&&r.return&&r.return()||!0)&&(r=null)}},{highWaterMark:n?s:void 0,...t});function a(i,o){let c,u=null,d=i.desiredSize||null;for(;!(u=o.next(n?d:null)).done;)if(ArrayBuffer.isView(u.value)&&(c=x(u.value))&&(d!=null&&n&&(d=d-c.byteLength+1),u.value=c),i.enqueue(u.value),d!=null&&--d<=0)return;i.close()}}function fd(e,t){let r=null;const n=t&&t.type==="bytes"||!1,s=t&&t.highWaterMark||2**24;return new ReadableStream({...t,async start(i){await a(i,r||(r=e[Symbol.asyncIterator]()))},async pull(i){r?await a(i,r):i.close()},async cancel(){(r&&r.return&&await r.return()||!0)&&(r=null)}},{highWaterMark:n?s:void 0,...t});async function a(i,o){let c,u=null,d=i.desiredSize||null;for(;!(u=await o.next(n?d:null)).done;)if(ArrayBuffer.isView(u.value)&&(c=x(u.value))&&(d!=null&&n&&(d=d-c.byteLength+1),u.value=c),i.enqueue(u.value),d!=null&&--d<=0)return;i.close()}}function dd(e){return new pd(e)}class pd{constructor(t){this._numChunks=0,this._finished=!1,this._bufferedSize=0;const{["readableStrategy"]:r,["writableStrategy"]:n,["queueingStrategy"]:s="count",...a}=t;this._controller=null,this._builder=W.new(a),this._getSize=s!=="bytes"?Bs:As;const{["highWaterMark"]:i=s==="bytes"?2**14:1e3}={...r},{["highWaterMark"]:o=s==="bytes"?2**14:1e3}={...n};this.readable=new ReadableStream({cancel:()=>{this._builder.clear()},pull:c=>{this._maybeFlush(this._builder,this._controller=c)},start:c=>{this._maybeFlush(this._builder,this._controller=c)}},{highWaterMark:i,size:s!=="bytes"?Bs:As}),this.writable=new WritableStream({abort:()=>{this._builder.clear()},write:()=>{this._maybeFlush(this._builder,this._controller)},close:()=>{this._maybeFlush(this._builder.finish(),this._controller)}},{highWaterMark:o,size:c=>this._writeValueAndReturnChunkSize(c)})}_writeValueAndReturnChunkSize(t){const r=this._bufferedSize;return this._bufferedSize=this._getSize(this._builder.append(t)),this._bufferedSize-r}_maybeFlush(t,r){r!==null&&(this._bufferedSize>=r.desiredSize&&++this._numChunks&&this._enqueue(r,t.toVector()),t.finished&&((t.length>0||this._numChunks===0)&&++this._numChunks&&this._enqueue(r,t.toVector()),!this._finished&&(this._finished=!0)&&this._enqueue(r,null)))}_enqueue(t,r){this._bufferedSize=0,this._controller=null,r===null?t.close():t.enqueue(r)}}const Bs=e=>e.length,As=e=>e.byteLength;function yd(e,t){const r=new Ne;let n=null;const s=new ReadableStream({async cancel(){await r.close()},async start(o){await i(o,n||(n=await a()))},async pull(o){n?await i(o,n):o.close()}});return{writable:new WritableStream(r,{highWaterMark:2**14,...e}),readable:s};async function a(){return await(await bt.from(r)).open(t)}async function i(o,c){let u=o.desiredSize,d=null;for(;!(d=await c.next()).done;)if(o.enqueue(d.value),u!=null&&--u<=0)return;o.close()}}function bd(e,t){const r=new this(e),n=new te(r),s=new ReadableStream({type:"bytes",async cancel(){await n.cancel()},async pull(i){await a(i)},async start(i){await a(i)}},{highWaterMark:2**14,...t});return{writable:new WritableStream(r,e),readable:s};async function a(i){let o=null,c=i.desiredSize;for(;o=await n.read(c||null);)if(i.enqueue(o),c!=null&&(c-=o.byteLength)<=0)return;i.close()}}class be{eq(t){return t instanceof be||(t=new me(t)),new md(this,t)}le(t){return t instanceof be||(t=new me(t)),new gd(this,t)}ge(t){return t instanceof be||(t=new me(t)),new _d(this,t)}lt(t){return new Ir(this.ge(t))}gt(t){return new Ir(this.le(t))}ne(t){return new Ir(this.eq(t))}}class me extends be{constructor(t){super(),this.v=t}}class Co extends be{constructor(t){super(),this.name=t}bind(t){if(!this.colidx){this.colidx=-1;const n=t.schema.fields;for(let s=-1;++sr.get(n)}}class ji{and(...t){return new $i(this,...t)}or(...t){return new Wi(this,...t)}not(){return new Ir(this)}}class zi extends ji{constructor(t,r){super(),this.left=t,this.right=r}bind(t){return this.left instanceof me?this.right instanceof me?this._bindLitLit(t,this.left,this.right):this._bindLitCol(t,this.left,this.right):this.right instanceof me?this._bindColLit(t,this.left,this.right):this._bindColCol(t,this.left,this.right)}}class Pi extends ji{constructor(...t){super(),this.children=t}}Pi.prototype.children=Object.freeze([]);class $i extends Pi{constructor(...t){t=t.reduce((r,n)=>r.concat(n instanceof $i?n.children:n),[]),super(...t)}bind(t){const r=this.children.map(n=>n.bind(t));return(n,s)=>r.every(a=>a(n,s))}}class Wi extends Pi{constructor(...t){t=t.reduce((r,n)=>r.concat(n instanceof Wi?n.children:n),[]),super(...t)}bind(t){const r=this.children.map(n=>n.bind(t));return(n,s)=>r.some(a=>a(n,s))}}class md extends zi{_bindLitLit(t,r,n){const s=r.v==n.v;return()=>s}_bindColCol(t,r,n){const s=r.bind(t),a=n.bind(t);return(i,o)=>s(i,o)==a(i,o)}_bindColLit(t,r,n){const s=r.bind(t);if(r.vector instanceof Ui){let a;const i=r.vector;return i.dictionary!==this.lastDictionary?(a=i.reverseLookup(n.v),this.lastDictionary=i.dictionary,this.lastKey=a):a=this.lastKey,a===-1?()=>!1:o=>i.getKey(o)===a}else return(a,i)=>s(a,i)==n.v}_bindLitCol(t,r,n){return this._bindColLit(t,n,r)}}class gd extends zi{_bindLitLit(t,r,n){const s=r.v<=n.v;return()=>s}_bindColCol(t,r,n){const s=r.bind(t),a=n.bind(t);return(i,o)=>s(i,o)<=a(i,o)}_bindColLit(t,r,n){const s=r.bind(t);return(a,i)=>s(a,i)<=n.v}_bindLitCol(t,r,n){const s=n.bind(t);return(a,i)=>r.v<=s(a,i)}}class _d extends zi{_bindLitLit(t,r,n){const s=r.v>=n.v;return()=>s}_bindColCol(t,r,n){const s=r.bind(t),a=n.bind(t);return(i,o)=>s(i,o)>=a(i,o)}_bindColLit(t,r,n){const s=r.bind(t);return(a,i)=>s(a,i)>=n.v}_bindLitCol(t,r,n){const s=n.bind(t);return(a,i)=>r.v>=s(a,i)}}class Ir extends ji{constructor(t){super(),this.child=t}bind(t){const r=this.child.bind(t);return(n,s)=>!r(n,s)}}E.prototype.countBy=function(e){return new ur(this.chunks).countBy(e)};E.prototype.scan=function(e,t){return new ur(this.chunks).scan(e,t)};E.prototype.scanReverse=function(e,t){return new ur(this.chunks).scanReverse(e,t)};E.prototype.filter=function(e){return new ur(this.chunks).filter(e)};class ur extends E{filter(t){return new Yi(this.chunks,t)}scan(t,r){const n=this.chunks,s=n.length;for(let a=-1;++a=0;){const i=n[a];r&&r(i);for(let o=i.length;--o>=0;)t(o,i)}}countBy(t){const r=this.chunks,n=r.length,s=typeof t=="string"?new Co(t):t;s.bind(r[n-1]);const a=s.vector;if(!A.isDictionary(a.type))throw new Error("countBy currently only supports dictionary-encoded columns");const i=Math.ceil(Math.log(a.length)/Math.log(256)),o=i==4?Uint32Array:i>=2?Uint16Array:Uint8Array,c=new o(a.dictionary.length);for(let u=-1;++u=0;){const i=n[a],o=this._predicate.bind(i);let c=!1;for(let u=i.length;--u>=0;)o(u,i)&&(r&&!c&&(r(i),c=!0),t(u,i))}}count(){let t=0;const r=this._chunks,n=r.length;for(let s=-1;++s=2?Uint16Array:Uint8Array,c=new o(a.dictionary.length);for(let u=-1;++u=a.headerRows&&o=a.headerColumns;if(c){var y=["blank"];return o>0&&y.push("level"+i),{type:"blank",classNames:y.join(" "),content:""}}else if(d){var F=o-a.headerColumns,y=["col_heading","level"+i,"col"+F];return{type:"columns",classNames:y.join(" "),content:a.getContent(a.columnsTable,F,i)}}else if(u){var U=i-a.headerRows,y=["row_heading","level"+o,"row"+U];return{type:"index",id:"T_"+a.uuid+"level"+o+"_row"+U,classNames:y.join(" "),content:a.getContent(a.indexTable,U,o)}}else{var U=i-a.headerRows,F=o-a.headerColumns,y=["data","row"+U,"col"+F],Bt=a.styler?a.getContent(a.styler.displayValuesTable,U,F):a.getContent(a.dataTable,U,F);return{type:"data",id:"T_"+a.uuid+"row"+U+"_col"+F,classNames:y.join(" "),content:Bt}}},this.getContent=function(i,o,c){var u=i.getColumnAt(c);if(u===null)return"";var d=a.getColumnTypeId(i,c);switch(d){case l.Timestamp:return a.nanosToDate(u.get(o));default:return u.get(o)}},this.dataTable=E.from(t),this.indexTable=E.from(r),this.columnsTable=E.from(n),this.styler=s?{caption:s.caption,displayValuesTable:E.from(s.displayValues),styles:s.styles,uuid:s.uuid}:void 0}return Object.defineProperty(e.prototype,"rows",{get:function(){return this.indexTable.length+this.columnsTable.numCols},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"columns",{get:function(){return this.indexTable.numCols+this.columnsTable.length},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"headerRows",{get:function(){return this.rows-this.dataRows},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"headerColumns",{get:function(){return this.columns-this.dataColumns},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dataRows",{get:function(){return this.dataTable.length},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dataColumns",{get:function(){return this.dataTable.numCols},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"uuid",{get:function(){return this.styler&&this.styler.uuid},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"caption",{get:function(){return this.styler&&this.styler.caption},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"styles",{get:function(){return this.styler&&this.styler.styles},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"table",{get:function(){return this.dataTable},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"index",{get:function(){return this.indexTable},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"columnTable",{get:function(){return this.columnsTable},enumerable:!0,configurable:!0}),e.prototype.serialize=function(){return{data:this.dataTable.serialize(),index:this.indexTable.serialize(),columns:this.columnsTable.serialize()}},e.prototype.getColumnTypeId=function(t,r){return t.schema.fields[r].type.typeId},e.prototype.nanosToDate=function(t){return new Date(t/1e6)},e}();/** - * @license - * Copyright 2018-2021 Streamlit Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */var Ve=globalThis&&globalThis.__assign||function(){return Ve=Object.assign||function(e){for(var t,r=1,n=arguments.length;r0?e.argsDataframeToObject(t.dfs):{};r=Ve(Ve({},r),n);var s=Boolean(t.disabled),a=t.theme;a&&wd(a);var i={disabled:s,args:r,theme:a},o=new CustomEvent(e.RENDER_EVENT,{detail:i});e.events.dispatchEvent(o)},e.argsDataframeToObject=function(t){var r=t.map(function(n){var s=n.key,a=n.value;return[s,e.toArrowTable(a)]});return Object.fromEntries(r)},e.toArrowTable=function(t){var r=t.data,n=r.data,s=r.index,a=r.columns,i=r.styler;return new Ts(n,s,a,i)},e.sendBackMsg=function(t,r){window.parent.postMessage(Ve({isStreamlitMessage:!0,type:t},r),"*")},e}(),wd=function(e){var t=document.createElement("style");document.head.appendChild(t),t.innerHTML=` - :root { - --primary-color: `+e.primaryColor+`; - --background-color: `+e.backgroundColor+`; - --secondary-background-color: `+e.secondaryBackgroundColor+`; - --text-color: `+e.textColor+`; - --font: `+e.font+`; - } +// Borrowed minimalistic Streamlit API from Thiago +// https://discuss.streamlit.io/t/code-snippet-create-components-without-any-frontend-tooling-no-react-babel-webpack-etc/13064 +function sendMessageToStreamlitClient(type, data) { + console.log(type, data) + const outData = Object.assign({ + isStreamlitMessage: true, + type: type, + }, data); + window.parent.postMessage(outData, "*"); +} - body { - background-color: var(--background-color); - color: var(--text-color); +const Streamlit = { + setComponentReady: function() { + sendMessageToStreamlitClient("streamlit:componentReady", {apiVersion: 1}); + }, + setFrameHeight: function(height) { + sendMessageToStreamlitClient("streamlit:setFrameHeight", {height: height}); + }, + setComponentValue: function(value) { + sendMessageToStreamlitClient("streamlit:setComponentValue", {value: value}); + }, + RENDER_EVENT: "streamlit:render", + events: { + addEventListener: function(type, callback) { + window.addEventListener("message", function(event) { + if (event.data.type === type) { + event.detail = event.data + callback(event); + } + }); + } } - `};function vd(e){var t=!1;try{t=e instanceof BigInt64Array||e instanceof BigUint64Array}catch{}return e instanceof Int8Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array||t}/** - * @license - * Copyright 2018-2021 Streamlit Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */var Id=globalThis&&globalThis.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,s){n.__proto__=s}||function(n,s){for(var a in s)s.hasOwnProperty(a)&&(n[a]=s[a])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();(function(e){Id(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.componentDidMount=function(){Pn.setFrameHeight()},t.prototype.componentDidUpdate=function(){Pn.setFrameHeight()},t})(pc.PureComponent);Streamlit=Pn; +} \ No newline at end of file From ce368df2f51ed79a46d02911065695ff20beb9bb Mon Sep 17 00:00:00 2001 From: Zachary Blackwood Date: Mon, 12 Sep 2022 13:21:52 -0400 Subject: [PATCH 2/2] Bump version --- requirements.txt | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index cf8c4a8..8de1a14 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ streamlit>=1.2.0 -streamlit-keyup>=0.1.5 +streamlit-keyup>=0.1.9 jinja2 diff --git a/setup.py b/setup.py index c8fabcd..597e795 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ setuptools.setup( name="streamlit-keyup", - version="0.1.8", + version="0.1.9", author="Zachary Blackwood", author_email="zachary@streamlit.io", description="Text input that renders on keyup",