UNPKG

trifeather

Version:

Pre-triangulated feather files

1 lines 309 kB
(function(Je,A){typeof exports=="object"&&typeof module<"u"?A(exports):typeof define=="function"&&define.amd?define(["exports"],A):(Je=typeof globalThis<"u"?globalThis:Je||self,A(Je.trifeather={}))})(this,function(Je){"use strict";function A(n,t,e,i){function r(s){return s instanceof e?s:new e(function(o){o(s)})}return new(e||(e=Promise))(function(s,o){function a(c){try{l(i.next(c))}catch(h){o(h)}}function u(c){try{l(i.throw(c))}catch(h){o(h)}}function l(c){c.done?s(c.value):r(c.value).then(a,u)}l((i=i.apply(n,t||[])).next())})}function Ea(n){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&n[t],i=0;if(e)return e.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&i>=n.length&&(n=void 0),{value:n&&n[i++],done:!n}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function $(n){return this instanceof $?(this.v=n,this):new $(n)}function ce(n,t,e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=e.apply(n,t||[]),r,s=[];return r={},o("next"),o("throw"),o("return"),r[Symbol.asyncIterator]=function(){return this},r;function o(f){i[f]&&(r[f]=function(d){return new Promise(function(g,w){s.push([f,d,g,w])>1||a(f,d)})})}function a(f,d){try{u(i[f](d))}catch(g){h(s[0][3],g)}}function u(f){f.value instanceof $?Promise.resolve(f.value.v).then(l,c):h(s[0][2],f)}function l(f){a("next",f)}function c(f){a("throw",f)}function h(f,d){f(d),s.shift(),s.length&&a(s[0][0],s[0][1])}}function Gi(n){var t,e;return t={},i("next"),i("throw",function(r){throw r}),i("return"),t[Symbol.iterator]=function(){return this},t;function i(r,s){t[r]=n[r]?function(o){return(e=!e)?{value:$(n[r](o)),done:r==="return"}:s?s(o):o}:s}}function yn(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=n[Symbol.asyncIterator],e;return t?t.call(n):(n=typeof Ea=="function"?Ea(n):n[Symbol.iterator](),e={},i("next"),i("throw"),i("return"),e[Symbol.asyncIterator]=function(){return this},e);function i(s){e[s]=n[s]&&function(o){return new Promise(function(a,u){o=n[s](o),r(a,u,o.done,o.value)})}}function r(s,o,a,u){Promise.resolve(u).then(function(l){s({value:l,done:a})},o)}}const tf=new TextDecoder("utf-8"),bs=n=>tf.decode(n),ef=new TextEncoder,qi=n=>ef.encode(n),[Lv,Ta]=(()=>{const n=()=>{throw new Error("BigInt is not available in this environment")};function t(){throw n()}return t.asIntN=()=>{throw n()},t.asUintN=()=>{throw n()},typeof BigInt<"u"?[BigInt,!0]:[t,!1]})(),[La,kv]=(()=>{const n=()=>{throw new Error("BigInt64Array is not available in this environment")};class t{static get BYTES_PER_ELEMENT(){return 8}static of(){throw n()}static from(){throw n()}constructor(){throw n()}}return typeof BigInt64Array<"u"?[BigInt64Array,!0]:[t,!1]})(),[ws,Rv]=(()=>{const n=()=>{throw new Error("BigUint64Array is not available in this environment")};class t{static get BYTES_PER_ELEMENT(){return 8}static of(){throw n()}static from(){throw n()}constructor(){throw n()}}return typeof BigUint64Array<"u"?[BigUint64Array,!0]:[t,!1]})(),nf=n=>typeof n=="number",ka=n=>typeof n=="boolean",pt=n=>typeof n=="function",Ft=n=>n!=null&&Object(n)===n,Xe=n=>Ft(n)&&pt(n.then),ui=n=>Ft(n)&&pt(n[Symbol.iterator]),Ln=n=>Ft(n)&&pt(n[Symbol.asyncIterator]),xs=n=>Ft(n)&&Ft(n.schema),Ra=n=>Ft(n)&&"done"in n&&"value"in n,Ua=n=>Ft(n)&&pt(n.stat)&&nf(n.fd),Ca=n=>Ft(n)&&Ss(n.body),Zi=n=>"_getDOMStream"in n&&"_getNodeStream"in n,rf=n=>Ft(n)&&pt(n.abort)&&pt(n.getWriter)&&!Zi(n),Ss=n=>Ft(n)&&pt(n.cancel)&&pt(n.getReader)&&!Zi(n),sf=n=>Ft(n)&&pt(n.end)&&pt(n.write)&&ka(n.writable)&&!Zi(n),za=n=>Ft(n)&&pt(n.read)&&pt(n.pipe)&&ka(n.readable)&&!Zi(n),of=n=>Ft(n)&&pt(n.clear)&&pt(n.bytes)&&pt(n.position)&&pt(n.setPosition)&&pt(n.capacity)&&pt(n.getBufferIdentifier)&&pt(n.createLong),Is=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:ArrayBuffer;function af(n){const t=n[0]?[n[0]]:[];let e,i,r,s;for(let o,a,u=0,l=0,c=n.length;++u<c;){if(o=t[l],a=n[u],!o||!a||o.buffer!==a.buffer||a.byteOffset<o.byteOffset){a&&(t[++l]=a);continue}if({byteOffset:e,byteLength:r}=o,{byteOffset:i,byteLength:s}=a,e+r<i||i+s<e){a&&(t[++l]=a);continue}t[l]=new Uint8Array(o.buffer,e,i-e+s)}return t}function Ji(n,t,e=0,i=t.byteLength){const r=n.byteLength,s=new Uint8Array(n.buffer,n.byteOffset,r),o=new Uint8Array(t.buffer,t.byteOffset,Math.min(i,r));return s.set(o,e),n}function he(n,t){const e=af(n),i=e.reduce((c,h)=>c+h.byteLength,0);let r,s,o,a=0,u=-1;const l=Math.min(t||Number.POSITIVE_INFINITY,i);for(const c=e.length;++u<c;){if(r=e[u],s=r.subarray(0,Math.min(r.length,l-a)),l<=a+s.length){s.length<r.length?e[u]=r.subarray(s.length):s.length===r.length&&u++,o?Ji(o,s,a):o=s;break}Ji(o||(o=new Uint8Array(l)),s,a),a+=s.length}return[o||new Uint8Array(0),e.slice(u),i-(o?o.byteLength:0)]}function at(n,t){let e=Ra(t)?t.value:t;return e instanceof n?n===Uint8Array?new n(e.buffer,e.byteOffset,e.byteLength):e:e?(typeof e=="string"&&(e=qi(e)),e instanceof ArrayBuffer?new n(e):e instanceof Is?new n(e):of(e)?at(n,e.bytes()):ArrayBuffer.isView(e)?e.byteLength<=0?new n(0):new n(e.buffer,e.byteOffset,e.byteLength/n.BYTES_PER_ELEMENT):n.from(e)):new n(0)}const li=n=>at(Int32Array,n),Z=n=>at(Uint8Array,n),As=n=>(n.next(),n);function*uf(n,t){const e=function*(r){yield r},i=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof Is?e(t):ui(t)?t:e(t);return yield*As(function*(r){let s=null;do s=r.next(yield at(n,s));while(!s.done)}(i[Symbol.iterator]())),new n}const lf=n=>uf(Uint8Array,n);function Pa(n,t){return ce(this,arguments,function*(){if(Xe(t))return yield $(yield $(yield*Gi(yn(Pa(n,yield $(t))))));const i=function(o){return ce(this,arguments,function*(){yield yield $(yield $(o))})},r=function(o){return ce(this,arguments,function*(){yield $(yield*Gi(yn(As(function*(a){let u=null;do u=a.next(yield u?.value);while(!u.done)}(o[Symbol.iterator]())))))})},s=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof Is?i(t):ui(t)?r(t):Ln(t)?t:i(t);return yield $(yield*Gi(yn(As(function(o){return ce(this,arguments,function*(){let a=null;do a=yield $(o.next(yield yield $(at(n,a))));while(!a.done)})}(s[Symbol.asyncIterator]()))))),yield $(new n)})}const cf=n=>Pa(Uint8Array,n);function Bs(n,t,e){if(n!==0){e=e.slice(0,t+1);for(let i=-1;++i<=t;)e[i]+=n}return e}function hf(n,t){let e=0;const i=n.length;if(i!==t.length)return!1;if(i>0)do if(n[e]!==t[e])return!1;while(++e<i);return!0}var $t={fromIterable(n){return Xi(ff(n))},fromAsyncIterable(n){return Xi(df(n))},fromDOMStream(n){return Xi(pf(n))},fromNodeStream(n){return Xi(gf(n))},toDOMStream(n,t){throw new Error('"toDOMStream" not available in this environment')},toNodeStream(n,t){throw new Error('"toNodeStream" not available in this environment')}};const Xi=n=>(n.next(),n);function*ff(n){let t,e=!1,i=[],r,s,o,a=0;function u(){return s==="peek"?he(i,o)[0]:([r,i,a]=he(i,o),r)}({cmd:s,size:o}=yield null);const l=lf(n)[Symbol.iterator]();try{do if({done:t,value:r}=Number.isNaN(o-a)?l.next():l.next(o-a),!t&&r.byteLength>0&&(i.push(r),a+=r.byteLength),t||o<=a)do({cmd:s,size:o}=yield u());while(o<a);while(!t)}catch(c){(e=!0)&&typeof l.throw=="function"&&l.throw(c)}finally{e===!1&&typeof l.return=="function"&&l.return(null)}return null}function df(n){return ce(this,arguments,function*(){let e,i=!1,r=[],s,o,a,u=0;function l(){return o==="peek"?he(r,a)[0]:([s,r,u]=he(r,a),s)}({cmd:o,size:a}=yield yield $(null));const c=cf(n)[Symbol.asyncIterator]();try{do if({done:e,value:s}=Number.isNaN(a-u)?yield $(c.next()):yield $(c.next(a-u)),!e&&s.byteLength>0&&(r.push(s),u+=s.byteLength),e||a<=u)do({cmd:o,size:a}=yield yield $(l()));while(a<u);while(!e)}catch(h){(i=!0)&&typeof c.throw=="function"&&(yield $(c.throw(h)))}finally{i===!1&&typeof c.return=="function"&&(yield $(c.return(new Uint8Array(0))))}return yield $(null)})}function pf(n){return ce(this,arguments,function*(){let e=!1,i=!1,r=[],s,o,a,u=0;function l(){return o==="peek"?he(r,a)[0]:([s,r,u]=he(r,a),s)}({cmd:o,size:a}=yield yield $(null));const c=new yf(n);try{do if({done:e,value:s}=Number.isNaN(a-u)?yield $(c.read()):yield $(c.read(a-u)),!e&&s.byteLength>0&&(r.push(Z(s)),u+=s.byteLength),e||a<=u)do({cmd:o,size:a}=yield yield $(l()));while(a<u);while(!e)}catch(h){(i=!0)&&(yield $(c.cancel(h)))}finally{i===!1?yield $(c.cancel()):n.locked&&c.releaseLock()}return yield $(null)})}class yf{constructor(t){this.source=t,this.reader=null,this.reader=this.source.getReader(),this.reader.closed.catch(()=>{})}get closed(){return this.reader?this.reader.closed.catch(()=>{}):Promise.resolve()}releaseLock(){this.reader&&this.reader.releaseLock(),this.reader=null}cancel(t){return A(this,void 0,void 0,function*(){const{reader:e,source:i}=this;e&&(yield e.cancel(t).catch(()=>{})),i&&i.locked&&this.releaseLock()})}read(t){return A(this,void 0,void 0,function*(){if(t===0)return{done:this.reader==null,value:new Uint8Array(0)};const e=yield this.reader.read();return!e.done&&(e.value=Z(e)),e})}}const Ms=(n,t)=>{const e=r=>i([t,r]);let i;return[t,e,new Promise(r=>(i=r)&&n.once(t,e))]};function gf(n){return ce(this,arguments,function*(){const e=[];let i="error",r=!1,s=null,o,a,u=0,l=[],c;function h(){return o==="peek"?he(l,a)[0]:([c,l,u]=he(l,a),c)}if({cmd:o,size:a}=yield yield $(null),n.isTTY)return yield yield $(new Uint8Array(0)),yield $(null);try{e[0]=Ms(n,"end"),e[1]=Ms(n,"error");do{if(e[2]=Ms(n,"readable"),[i,s]=yield $(Promise.race(e.map(d=>d[2]))),i==="error")break;if((r=i==="end")||(Number.isFinite(a-u)?(c=Z(n.read(a-u)),c.byteLength<a-u&&(c=Z(n.read()))):c=Z(n.read()),c.byteLength>0&&(l.push(c),u+=c.byteLength)),r||a<=u)do({cmd:o,size:a}=yield yield $(h()));while(a<u)}while(!r)}finally{yield $(f(e,i==="error"?s:null))}return yield $(null);function f(d,g){return c=l=null,new Promise((w,B)=>{for(const[_,x]of d)n.off(_,x);try{const _=n.destroy;_&&_.call(n,g),g=void 0}catch(_){g=_||g}finally{g!=null?B(g):w()}})}})}var Rt;(function(n){n[n.V1=0]="V1",n[n.V2=1]="V2",n[n.V3=2]="V3",n[n.V4=3]="V4",n[n.V5=4]="V5"})(Rt||(Rt={}));var Ut;(function(n){n[n.Sparse=0]="Sparse",n[n.Dense=1]="Dense"})(Ut||(Ut={}));var xt;(function(n){n[n.HALF=0]="HALF",n[n.SINGLE=1]="SINGLE",n[n.DOUBLE=2]="DOUBLE"})(xt||(xt={}));var fe;(function(n){n[n.DAY=0]="DAY",n[n.MILLISECOND=1]="MILLISECOND"})(fe||(fe={}));var K;(function(n){n[n.SECOND=0]="SECOND",n[n.MILLISECOND=1]="MILLISECOND",n[n.MICROSECOND=2]="MICROSECOND",n[n.NANOSECOND=3]="NANOSECOND"})(K||(K={}));var Ke;(function(n){n[n.YEAR_MONTH=0]="YEAR_MONTH",n[n.DAY_TIME=1]="DAY_TIME",n[n.MONTH_DAY_NANO=2]="MONTH_DAY_NANO"})(Ke||(Ke={}));var tt;(function(n){n[n.NONE=0]="NONE",n[n.Schema=1]="Schema",n[n.DictionaryBatch=2]="DictionaryBatch",n[n.RecordBatch=3]="RecordBatch",n[n.Tensor=4]="Tensor",n[n.SparseTensor=5]="SparseTensor"})(tt||(tt={}));var p;(function(n){n[n.NONE=0]="NONE",n[n.Null=1]="Null",n[n.Int=2]="Int",n[n.Float=3]="Float",n[n.Binary=4]="Binary",n[n.Utf8=5]="Utf8",n[n.Bool=6]="Bool",n[n.Decimal=7]="Decimal",n[n.Date=8]="Date",n[n.Time=9]="Time",n[n.Timestamp=10]="Timestamp",n[n.Interval=11]="Interval",n[n.List=12]="List",n[n.Struct=13]="Struct",n[n.Union=14]="Union",n[n.FixedSizeBinary=15]="FixedSizeBinary",n[n.FixedSizeList=16]="FixedSizeList",n[n.Map=17]="Map",n[n.Dictionary=-1]="Dictionary",n[n.Int8=-2]="Int8",n[n.Int16=-3]="Int16",n[n.Int32=-4]="Int32",n[n.Int64=-5]="Int64",n[n.Uint8=-6]="Uint8",n[n.Uint16=-7]="Uint16",n[n.Uint32=-8]="Uint32",n[n.Uint64=-9]="Uint64",n[n.Float16=-10]="Float16",n[n.Float32=-11]="Float32",n[n.Float64=-12]="Float64",n[n.DateDay=-13]="DateDay",n[n.DateMillisecond=-14]="DateMillisecond",n[n.TimestampSecond=-15]="TimestampSecond",n[n.TimestampMillisecond=-16]="TimestampMillisecond",n[n.TimestampMicrosecond=-17]="TimestampMicrosecond",n[n.TimestampNanosecond=-18]="TimestampNanosecond",n[n.TimeSecond=-19]="TimeSecond",n[n.TimeMillisecond=-20]="TimeMillisecond",n[n.TimeMicrosecond=-21]="TimeMicrosecond",n[n.TimeNanosecond=-22]="TimeNanosecond",n[n.DenseUnion=-23]="DenseUnion",n[n.SparseUnion=-24]="SparseUnion",n[n.IntervalDayTime=-25]="IntervalDayTime",n[n.IntervalYearMonth=-26]="IntervalYearMonth"})(p||(p={}));var ke;(function(n){n[n.OFFSET=0]="OFFSET",n[n.DATA=1]="DATA",n[n.VALIDITY=2]="VALIDITY",n[n.TYPE=3]="TYPE"})(ke||(ke={}));const mf=void 0;function Qe(n){if(n===null)return"null";if(n===mf)return"undefined";switch(typeof n){case"number":return`${n}`;case"bigint":return`${n}`;case"string":return`"${n}"`}return typeof n[Symbol.toPrimitive]=="function"?n[Symbol.toPrimitive]("string"):ArrayBuffer.isView(n)?n instanceof BigInt64Array||n instanceof BigUint64Array?`[${[...n].map(t=>Qe(t))}]`:`[${n}]`:ArrayBuffer.isView(n)?`[${n}]`:JSON.stringify(n,(t,e)=>typeof e=="bigint"?`${e}`:e)}const _f=Symbol.for("isArrowBigNum");function Zt(n,...t){return t.length===0?Object.setPrototypeOf(at(this.TypedArray,n),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(n,...t),this.constructor.prototype)}Zt.prototype[_f]=!0,Zt.prototype.toJSON=function(){return`"${gn(this)}"`},Zt.prototype.valueOf=function(){return Va(this)},Zt.prototype.toString=function(){return gn(this)},Zt.prototype[Symbol.toPrimitive]=function(n="default"){switch(n){case"number":return Va(this);case"string":return gn(this);case"default":return Fs(this)}return gn(this)};function kn(...n){return Zt.apply(this,n)}function Rn(...n){return Zt.apply(this,n)}function ci(...n){return Zt.apply(this,n)}Object.setPrototypeOf(kn.prototype,Object.create(Int32Array.prototype)),Object.setPrototypeOf(Rn.prototype,Object.create(Uint32Array.prototype)),Object.setPrototypeOf(ci.prototype,Object.create(Uint32Array.prototype)),Object.assign(kn.prototype,Zt.prototype,{constructor:kn,signed:!0,TypedArray:Int32Array,BigIntArray:La}),Object.assign(Rn.prototype,Zt.prototype,{constructor:Rn,signed:!1,TypedArray:Uint32Array,BigIntArray:ws}),Object.assign(ci.prototype,Zt.prototype,{constructor:ci,signed:!0,TypedArray:Uint32Array,BigIntArray:ws});function Va(n){const{buffer:t,byteOffset:e,length:i,signed:r}=n,s=new ws(t,e,i),o=r&&s[s.length-1]&BigInt(1)<<BigInt(63);let a=BigInt(o?1:0),u=BigInt(0);if(o){for(const l of s)a+=~l*(BigInt(1)<<BigInt(32)*u++);a*=BigInt(-1)}else for(const l of s)a+=l*(BigInt(1)<<BigInt(32)*u++);return a}let gn,Fs;Ta?(Fs=n=>n.byteLength===8?new n.BigIntArray(n.buffer,n.byteOffset,1)[0]:Os(n),gn=n=>n.byteLength===8?`${new n.BigIntArray(n.buffer,n.byteOffset,1)[0]}`:Os(n)):(gn=Os,Fs=gn);function Os(n){let t="";const e=new Uint32Array(2);let i=new Uint16Array(n.buffer,n.byteOffset,n.byteLength/2);const r=new Uint32Array((i=new Uint16Array(i).reverse()).buffer);let s=-1;const o=i.length-1;do{for(e[0]=i[s=0];s<o;)i[s++]=e[1]=e[0]/10,e[0]=(e[0]-e[1]*10<<16)+i[s];i[s]=e[1]=e[0]/10,e[0]=e[0]-e[1]*10,t=`${e[0]}${t}`}while(r[0]||r[1]||r[2]||r[3]);return t??"0"}class Ds{static new(t,e){switch(e){case!0:return new kn(t);case!1:return new Rn(t)}switch(t.constructor){case Int8Array:case Int16Array:case Int32Array:case La:return new kn(t)}return t.byteLength===16?new ci(t):new Rn(t)}static signed(t){return new kn(t)}static unsigned(t){return new Rn(t)}static decimal(t){return new ci(t)}constructor(t,e){return Ds.new(t,e)}}var $a,ja,Ya,Wa,Ha,Ga,qa,Za,Ja,Xa,Ka,Qa,tu,eu,nu,iu,ru,su,ou;class D{static isNull(t){return t?.typeId===p.Null}static isInt(t){return t?.typeId===p.Int}static isFloat(t){return t?.typeId===p.Float}static isBinary(t){return t?.typeId===p.Binary}static isUtf8(t){return t?.typeId===p.Utf8}static isBool(t){return t?.typeId===p.Bool}static isDecimal(t){return t?.typeId===p.Decimal}static isDate(t){return t?.typeId===p.Date}static isTime(t){return t?.typeId===p.Time}static isTimestamp(t){return t?.typeId===p.Timestamp}static isInterval(t){return t?.typeId===p.Interval}static isList(t){return t?.typeId===p.List}static isStruct(t){return t?.typeId===p.Struct}static isUnion(t){return t?.typeId===p.Union}static isFixedSizeBinary(t){return t?.typeId===p.FixedSizeBinary}static isFixedSizeList(t){return t?.typeId===p.FixedSizeList}static isMap(t){return t?.typeId===p.Map}static isDictionary(t){return t?.typeId===p.Dictionary}static isDenseUnion(t){return D.isUnion(t)&&t.mode===Ut.Dense}static isSparseUnion(t){return D.isUnion(t)&&t.mode===Ut.Sparse}get typeId(){return p.NONE}}$a=Symbol.toStringTag,D[$a]=(n=>(n.children=null,n.ArrayType=Array,n[Symbol.toStringTag]="DataType"))(D.prototype);class Re extends D{toString(){return"Null"}get typeId(){return p.Null}}ja=Symbol.toStringTag,Re[ja]=(n=>n[Symbol.toStringTag]="Null")(Re.prototype);class At extends D{constructor(t,e){super(),this.isSigned=t,this.bitWidth=e}get typeId(){return p.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?BigInt64Array:BigUint64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}}Ya=Symbol.toStringTag,At[Ya]=(n=>(n.isSigned=null,n.bitWidth=null,n[Symbol.toStringTag]="Int"))(At.prototype);class Ns extends At{constructor(){super(!0,8)}get ArrayType(){return Int8Array}}class Es extends At{constructor(){super(!0,16)}get ArrayType(){return Int16Array}}class Jt extends At{constructor(){super(!0,32)}get ArrayType(){return Int32Array}}class Ki extends At{constructor(){super(!0,64)}get ArrayType(){return BigInt64Array}}class Qi extends At{constructor(){super(!1,8)}get ArrayType(){return Uint8Array}}class au extends At{constructor(){super(!1,16)}get ArrayType(){return Uint16Array}}class Ts extends At{constructor(){super(!1,32)}get ArrayType(){return Uint32Array}}class uu extends At{constructor(){super(!1,64)}get ArrayType(){return BigUint64Array}}Object.defineProperty(Ns.prototype,"ArrayType",{value:Int8Array}),Object.defineProperty(Es.prototype,"ArrayType",{value:Int16Array}),Object.defineProperty(Jt.prototype,"ArrayType",{value:Int32Array}),Object.defineProperty(Ki.prototype,"ArrayType",{value:BigInt64Array}),Object.defineProperty(Qi.prototype,"ArrayType",{value:Uint8Array}),Object.defineProperty(au.prototype,"ArrayType",{value:Uint16Array}),Object.defineProperty(Ts.prototype,"ArrayType",{value:Uint32Array}),Object.defineProperty(uu.prototype,"ArrayType",{value:BigUint64Array});class mn extends D{constructor(t){super(),this.precision=t}get typeId(){return p.Float}get ArrayType(){switch(this.precision){case xt.HALF:return Uint16Array;case xt.SINGLE:return Float32Array;case xt.DOUBLE:return Float64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`Float${this.precision<<5||16}`}}Wa=Symbol.toStringTag,mn[Wa]=(n=>(n.precision=null,n[Symbol.toStringTag]="Float"))(mn.prototype);class _n extends mn{constructor(){super(xt.SINGLE)}}class tr extends mn{constructor(){super(xt.DOUBLE)}}Object.defineProperty(_n.prototype,"ArrayType",{value:Float32Array}),Object.defineProperty(tr.prototype,"ArrayType",{value:Float64Array});class hi extends D{constructor(){super()}get typeId(){return p.Binary}toString(){return"Binary"}}Ha=Symbol.toStringTag,hi[Ha]=(n=>(n.ArrayType=Uint8Array,n[Symbol.toStringTag]="Binary"))(hi.prototype);class de extends D{constructor(){super()}get typeId(){return p.Utf8}toString(){return"Utf8"}}Ga=Symbol.toStringTag,de[Ga]=(n=>(n.ArrayType=Uint8Array,n[Symbol.toStringTag]="Utf8"))(de.prototype);class fi extends D{constructor(){super()}get typeId(){return p.Bool}toString(){return"Bool"}}qa=Symbol.toStringTag,fi[qa]=(n=>(n.ArrayType=Uint8Array,n[Symbol.toStringTag]="Bool"))(fi.prototype);class er extends D{constructor(t,e,i=128){super(),this.scale=t,this.precision=e,this.bitWidth=i}get typeId(){return p.Decimal}toString(){return`Decimal[${this.precision}e${this.scale>0?"+":""}${this.scale}]`}}Za=Symbol.toStringTag,er[Za]=(n=>(n.scale=null,n.precision=null,n.ArrayType=Uint32Array,n[Symbol.toStringTag]="Decimal"))(er.prototype);class di extends D{constructor(t){super(),this.unit=t}get typeId(){return p.Date}toString(){return`Date${(this.unit+1)*32}<${fe[this.unit]}>`}}Ja=Symbol.toStringTag,di[Ja]=(n=>(n.unit=null,n.ArrayType=Int32Array,n[Symbol.toStringTag]="Date"))(di.prototype);class vf extends di{constructor(){super(fe.MILLISECOND)}}class pi extends D{constructor(t,e){super(),this.unit=t,this.bitWidth=e}get typeId(){return p.Time}toString(){return`Time${this.bitWidth}<${K[this.unit]}>`}get ArrayType(){switch(this.bitWidth){case 32:return Int32Array;case 64:return BigInt64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}}Xa=Symbol.toStringTag,pi[Xa]=(n=>(n.unit=null,n.bitWidth=null,n[Symbol.toStringTag]="Time"))(pi.prototype);class nr extends D{constructor(t,e){super(),this.unit=t,this.timezone=e}get typeId(){return p.Timestamp}toString(){return`Timestamp<${K[this.unit]}${this.timezone?`, ${this.timezone}`:""}>`}}Ka=Symbol.toStringTag,nr[Ka]=(n=>(n.unit=null,n.timezone=null,n.ArrayType=Int32Array,n[Symbol.toStringTag]="Timestamp"))(nr.prototype);class ir extends D{constructor(t){super(),this.unit=t}get typeId(){return p.Interval}toString(){return`Interval<${Ke[this.unit]}>`}}Qa=Symbol.toStringTag,ir[Qa]=(n=>(n.unit=null,n.ArrayType=Int32Array,n[Symbol.toStringTag]="Interval"))(ir.prototype);class Un extends D{constructor(t){super(),this.children=[t]}get typeId(){return p.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}}tu=Symbol.toStringTag,Un[tu]=(n=>(n.children=null,n[Symbol.toStringTag]="List"))(Un.prototype);class vt extends D{constructor(t){super(),this.children=t}get typeId(){return p.Struct}toString(){return`Struct<{${this.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}}eu=Symbol.toStringTag,vt[eu]=(n=>(n.children=null,n[Symbol.toStringTag]="Struct"))(vt.prototype);class yi extends D{constructor(t,e,i){super(),this.mode=t,this.children=i,this.typeIds=e=Int32Array.from(e),this.typeIdToChildIndex=e.reduce((r,s,o)=>(r[s]=o)&&r||r,Object.create(null))}get typeId(){return p.Union}toString(){return`${this[Symbol.toStringTag]}<${this.children.map(t=>`${t.type}`).join(" | ")}>`}}nu=Symbol.toStringTag,yi[nu]=(n=>(n.mode=null,n.typeIds=null,n.children=null,n.typeIdToChildIndex=null,n.ArrayType=Int8Array,n[Symbol.toStringTag]="Union"))(yi.prototype);class rr extends D{constructor(t){super(),this.byteWidth=t}get typeId(){return p.FixedSizeBinary}toString(){return`FixedSizeBinary[${this.byteWidth}]`}}iu=Symbol.toStringTag,rr[iu]=(n=>(n.byteWidth=null,n.ArrayType=Uint8Array,n[Symbol.toStringTag]="FixedSizeBinary"))(rr.prototype);class gi extends D{constructor(t,e){super(),this.listSize=t,this.children=[e]}get typeId(){return p.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}>`}}ru=Symbol.toStringTag,gi[ru]=(n=>(n.children=null,n.listSize=null,n[Symbol.toStringTag]="FixedSizeList"))(gi.prototype);class mi extends D{constructor(t,e=!1){super(),this.children=[t],this.keysSorted=e}get typeId(){return p.Map}get keyType(){return this.children[0].type.children[0].type}get valueType(){return this.children[0].type.children[1].type}get childType(){return this.children[0].type}toString(){return`Map<{${this.children[0].type.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}}su=Symbol.toStringTag,mi[su]=(n=>(n.children=null,n.keysSorted=null,n[Symbol.toStringTag]="Map_"))(mi.prototype);const bf=(n=>()=>++n)(-1);class pe extends D{constructor(t,e,i,r){super(),this.indices=e,this.dictionary=t,this.isOrdered=r||!1,this.id=i==null?bf():typeof i=="number"?i:i.low}get typeId(){return p.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}>`}}ou=Symbol.toStringTag,pe[ou]=(n=>(n.id=null,n.indices=null,n.isOrdered=null,n.dictionary=null,n[Symbol.toStringTag]="Dictionary"))(pe.prototype);function ye(n){const t=n;switch(n.typeId){case p.Decimal:return n.bitWidth/32;case p.Timestamp:return 2;case p.Date:return 1+t.unit;case p.Interval:return 1+t.unit;case p.FixedSizeList:return t.listSize;case p.FixedSizeBinary:return t.byteWidth;default:return 1}}class H{visitMany(t,...e){return t.map((i,r)=>this.visit(i,...e.map(s=>s[r])))}visit(...t){return this.getVisitFn(t[0],!1).apply(this,t)}getVisitFn(t,e=!0){return wf(this,t,e)}getVisitFnByTypeId(t,e=!0){return Cn(this,t,e)}visitNull(t,...e){return null}visitBool(t,...e){return null}visitInt(t,...e){return null}visitFloat(t,...e){return null}visitUtf8(t,...e){return null}visitBinary(t,...e){return null}visitFixedSizeBinary(t,...e){return null}visitDate(t,...e){return null}visitTimestamp(t,...e){return null}visitTime(t,...e){return null}visitDecimal(t,...e){return null}visitList(t,...e){return null}visitStruct(t,...e){return null}visitUnion(t,...e){return null}visitDictionary(t,...e){return null}visitInterval(t,...e){return null}visitFixedSizeList(t,...e){return null}visitMap(t,...e){return null}}function wf(n,t,e=!0){return typeof t=="number"?Cn(n,t,e):typeof t=="string"&&t in p?Cn(n,p[t],e):t&&t instanceof D?Cn(n,lu(t),e):t?.type&&t.type instanceof D?Cn(n,lu(t.type),e):Cn(n,p.NONE,e)}function Cn(n,t,e=!0){let i=null;switch(t){case p.Null:i=n.visitNull;break;case p.Bool:i=n.visitBool;break;case p.Int:i=n.visitInt;break;case p.Int8:i=n.visitInt8||n.visitInt;break;case p.Int16:i=n.visitInt16||n.visitInt;break;case p.Int32:i=n.visitInt32||n.visitInt;break;case p.Int64:i=n.visitInt64||n.visitInt;break;case p.Uint8:i=n.visitUint8||n.visitInt;break;case p.Uint16:i=n.visitUint16||n.visitInt;break;case p.Uint32:i=n.visitUint32||n.visitInt;break;case p.Uint64:i=n.visitUint64||n.visitInt;break;case p.Float:i=n.visitFloat;break;case p.Float16:i=n.visitFloat16||n.visitFloat;break;case p.Float32:i=n.visitFloat32||n.visitFloat;break;case p.Float64:i=n.visitFloat64||n.visitFloat;break;case p.Utf8:i=n.visitUtf8;break;case p.Binary:i=n.visitBinary;break;case p.FixedSizeBinary:i=n.visitFixedSizeBinary;break;case p.Date:i=n.visitDate;break;case p.DateDay:i=n.visitDateDay||n.visitDate;break;case p.DateMillisecond:i=n.visitDateMillisecond||n.visitDate;break;case p.Timestamp:i=n.visitTimestamp;break;case p.TimestampSecond:i=n.visitTimestampSecond||n.visitTimestamp;break;case p.TimestampMillisecond:i=n.visitTimestampMillisecond||n.visitTimestamp;break;case p.TimestampMicrosecond:i=n.visitTimestampMicrosecond||n.visitTimestamp;break;case p.TimestampNanosecond:i=n.visitTimestampNanosecond||n.visitTimestamp;break;case p.Time:i=n.visitTime;break;case p.TimeSecond:i=n.visitTimeSecond||n.visitTime;break;case p.TimeMillisecond:i=n.visitTimeMillisecond||n.visitTime;break;case p.TimeMicrosecond:i=n.visitTimeMicrosecond||n.visitTime;break;case p.TimeNanosecond:i=n.visitTimeNanosecond||n.visitTime;break;case p.Decimal:i=n.visitDecimal;break;case p.List:i=n.visitList;break;case p.Struct:i=n.visitStruct;break;case p.Union:i=n.visitUnion;break;case p.DenseUnion:i=n.visitDenseUnion||n.visitUnion;break;case p.SparseUnion:i=n.visitSparseUnion||n.visitUnion;break;case p.Dictionary:i=n.visitDictionary;break;case p.Interval:i=n.visitInterval;break;case p.IntervalDayTime:i=n.visitIntervalDayTime||n.visitInterval;break;case p.IntervalYearMonth:i=n.visitIntervalYearMonth||n.visitInterval;break;case p.FixedSizeList:i=n.visitFixedSizeList;break;case p.Map:i=n.visitMap;break}if(typeof i=="function")return i;if(!e)return()=>null;throw new Error(`Unrecognized type '${p[t]}'`)}function lu(n){switch(n.typeId){case p.Null:return p.Null;case p.Int:{const{bitWidth:t,isSigned:e}=n;switch(t){case 8:return e?p.Int8:p.Uint8;case 16:return e?p.Int16:p.Uint16;case 32:return e?p.Int32:p.Uint32;case 64:return e?p.Int64:p.Uint64}return p.Int}case p.Float:switch(n.precision){case xt.HALF:return p.Float16;case xt.SINGLE:return p.Float32;case xt.DOUBLE:return p.Float64}return p.Float;case p.Binary:return p.Binary;case p.Utf8:return p.Utf8;case p.Bool:return p.Bool;case p.Decimal:return p.Decimal;case p.Time:switch(n.unit){case K.SECOND:return p.TimeSecond;case K.MILLISECOND:return p.TimeMillisecond;case K.MICROSECOND:return p.TimeMicrosecond;case K.NANOSECOND:return p.TimeNanosecond}return p.Time;case p.Timestamp:switch(n.unit){case K.SECOND:return p.TimestampSecond;case K.MILLISECOND:return p.TimestampMillisecond;case K.MICROSECOND:return p.TimestampMicrosecond;case K.NANOSECOND:return p.TimestampNanosecond}return p.Timestamp;case p.Date:switch(n.unit){case fe.DAY:return p.DateDay;case fe.MILLISECOND:return p.DateMillisecond}return p.Date;case p.Interval:switch(n.unit){case Ke.DAY_TIME:return p.IntervalDayTime;case Ke.YEAR_MONTH:return p.IntervalYearMonth}return p.Interval;case p.Map:return p.Map;case p.List:return p.List;case p.Struct:return p.Struct;case p.Union:switch(n.mode){case Ut.Dense:return p.DenseUnion;case Ut.Sparse:return p.SparseUnion}return p.Union;case p.FixedSizeBinary:return p.FixedSizeBinary;case p.FixedSizeList:return p.FixedSizeList;case p.Dictionary:return p.Dictionary}throw new Error(`Unrecognized type '${p[n.typeId]}'`)}H.prototype.visitInt8=null,H.prototype.visitInt16=null,H.prototype.visitInt32=null,H.prototype.visitInt64=null,H.prototype.visitUint8=null,H.prototype.visitUint16=null,H.prototype.visitUint32=null,H.prototype.visitUint64=null,H.prototype.visitFloat16=null,H.prototype.visitFloat32=null,H.prototype.visitFloat64=null,H.prototype.visitDateDay=null,H.prototype.visitDateMillisecond=null,H.prototype.visitTimestampSecond=null,H.prototype.visitTimestampMillisecond=null,H.prototype.visitTimestampMicrosecond=null,H.prototype.visitTimestampNanosecond=null,H.prototype.visitTimeSecond=null,H.prototype.visitTimeMillisecond=null,H.prototype.visitTimeMicrosecond=null,H.prototype.visitTimeNanosecond=null,H.prototype.visitDenseUnion=null,H.prototype.visitSparseUnion=null,H.prototype.visitIntervalDayTime=null,H.prototype.visitIntervalYearMonth=null;const cu=new Float64Array(1),zn=new Uint32Array(cu.buffer);function hu(n){const t=(n&31744)>>10,e=(n&1023)/1024,i=Math.pow(-1,(n&32768)>>15);switch(t){case 31:return i*(e?Number.NaN:1/0);case 0:return i*(e?6103515625e-14*e:0)}return i*Math.pow(2,t-15)*(1+e)}function fu(n){if(n!==n)return 32256;cu[0]=n;const t=(zn[1]&2147483648)>>16&65535;let e=zn[1]&2146435072,i=0;return e>=1089470464?zn[0]>0?e=31744:(e=(e&2080374784)>>16,i=(zn[1]&1048575)>>10):e<=1056964608?(i=1048576+(zn[1]&1048575),i=1048576+(i<<(e>>20)-998)>>21,e=0):(e=e-1056964608>>10,i=(zn[1]&1048575)+512>>10),t|e|i&65535}class C extends H{}function V(n){return(t,e,i)=>{if(t.setValid(e,i!=null))return n(t,e,i)}}const xf=(n,t,e)=>{n[t]=Math.trunc(e/864e5)},Ls=(n,t,e)=>{n[t]=Math.trunc(e%4294967296),n[t+1]=Math.trunc(e/4294967296)},Sf=(n,t,e)=>{n[t]=Math.trunc(e*1e3%4294967296),n[t+1]=Math.trunc(e*1e3/4294967296)},If=(n,t,e)=>{n[t]=Math.trunc(e*1e6%4294967296),n[t+1]=Math.trunc(e*1e6/4294967296)},du=(n,t,e,i)=>{if(e+1<t.length){const{[e]:r,[e+1]:s}=t;n.set(i.subarray(0,s-r),r)}},Af=({offset:n,values:t},e,i)=>{const r=n+e;i?t[r>>3]|=1<<r%8:t[r>>3]&=~(1<<r%8)},Ue=({values:n},t,e)=>{n[t]=e},ks=({values:n},t,e)=>{n[t]=e},pu=({values:n},t,e)=>{n[t]=fu(e)},Bf=(n,t,e)=>{switch(n.type.precision){case xt.HALF:return pu(n,t,e);case xt.SINGLE:case xt.DOUBLE:return ks(n,t,e)}},Rs=({values:n},t,e)=>{xf(n,t,e.valueOf())},Us=({values:n},t,e)=>{Ls(n,t*2,e.valueOf())},yu=({stride:n,values:t},e,i)=>{t.set(i.subarray(0,n),n*e)},Mf=({values:n,valueOffsets:t},e,i)=>du(n,t,e,i),Ff=({values:n,valueOffsets:t},e,i)=>{du(n,t,e,qi(i))},gu=(n,t,e)=>{n.type.unit===fe.DAY?Rs(n,t,e):Us(n,t,e)},Cs=({values:n},t,e)=>Ls(n,t*2,e/1e3),zs=({values:n},t,e)=>Ls(n,t*2,e),Ps=({values:n},t,e)=>Sf(n,t*2,e),Vs=({values:n},t,e)=>If(n,t*2,e),mu=(n,t,e)=>{switch(n.type.unit){case K.SECOND:return Cs(n,t,e);case K.MILLISECOND:return zs(n,t,e);case K.MICROSECOND:return Ps(n,t,e);case K.NANOSECOND:return Vs(n,t,e)}},$s=({values:n},t,e)=>{n[t]=e},js=({values:n},t,e)=>{n[t]=e},Ys=({values:n},t,e)=>{n[t]=e},Ws=({values:n},t,e)=>{n[t]=e},_u=(n,t,e)=>{switch(n.type.unit){case K.SECOND:return $s(n,t,e);case K.MILLISECOND:return js(n,t,e);case K.MICROSECOND:return Ys(n,t,e);case K.NANOSECOND:return Ws(n,t,e)}},vu=({values:n,stride:t},e,i)=>{n.set(i.subarray(0,t),t*e)},Of=(n,t,e)=>{const i=n.children[0],r=n.valueOffsets,s=jt.getVisitFn(i);if(Array.isArray(e))for(let o=-1,a=r[t],u=r[t+1];a<u;)s(i,a++,e[++o]);else for(let o=-1,a=r[t],u=r[t+1];a<u;)s(i,a++,e.get(++o))},Df=(n,t,e)=>{const i=n.children[0],{valueOffsets:r}=n,s=jt.getVisitFn(i);let{[t]:o,[t+1]:a}=r;const u=e instanceof Map?e.entries():Object.entries(e);for(const l of u)if(s(i,o,l),++o>=a)break},Nf=(n,t)=>(e,i,r,s)=>i&&e(i,n,t[s]),Ef=(n,t)=>(e,i,r,s)=>i&&e(i,n,t.get(s)),Tf=(n,t)=>(e,i,r,s)=>i&&e(i,n,t.get(r.name)),Lf=(n,t)=>(e,i,r,s)=>i&&e(i,n,t[r.name]),kf=(n,t,e)=>{const i=n.type.children.map(s=>jt.getVisitFn(s.type)),r=e instanceof Map?Tf(t,e):e instanceof O?Ef(t,e):Array.isArray(e)?Nf(t,e):Lf(t,e);n.type.children.forEach((s,o)=>r(i[o],n.children[o],s,o))},Rf=(n,t,e)=>{n.type.mode===Ut.Dense?bu(n,t,e):wu(n,t,e)},bu=(n,t,e)=>{const i=n.type.typeIdToChildIndex[n.typeIds[t]],r=n.children[i];jt.visit(r,n.valueOffsets[t],e)},wu=(n,t,e)=>{const i=n.type.typeIdToChildIndex[n.typeIds[t]],r=n.children[i];jt.visit(r,t,e)},Uf=(n,t,e)=>{var i;(i=n.dictionary)===null||i===void 0||i.set(n.values[t],e)},xu=(n,t,e)=>{n.type.unit===Ke.DAY_TIME?Hs(n,t,e):Gs(n,t,e)},Hs=({values:n},t,e)=>{n.set(e.subarray(0,2),2*t)},Gs=({values:n},t,e)=>{n[t]=e[0]*12+e[1]%12},Cf=(n,t,e)=>{const{stride:i}=n,r=n.children[0],s=jt.getVisitFn(r);if(Array.isArray(e))for(let o=-1,a=t*i;++o<i;)s(r,a+o,e[o]);else for(let o=-1,a=t*i;++o<i;)s(r,a+o,e.get(o))};C.prototype.visitBool=V(Af),C.prototype.visitInt=V(Ue),C.prototype.visitInt8=V(Ue),C.prototype.visitInt16=V(Ue),C.prototype.visitInt32=V(Ue),C.prototype.visitInt64=V(Ue),C.prototype.visitUint8=V(Ue),C.prototype.visitUint16=V(Ue),C.prototype.visitUint32=V(Ue),C.prototype.visitUint64=V(Ue),C.prototype.visitFloat=V(Bf),C.prototype.visitFloat16=V(pu),C.prototype.visitFloat32=V(ks),C.prototype.visitFloat64=V(ks),C.prototype.visitUtf8=V(Ff),C.prototype.visitBinary=V(Mf),C.prototype.visitFixedSizeBinary=V(yu),C.prototype.visitDate=V(gu),C.prototype.visitDateDay=V(Rs),C.prototype.visitDateMillisecond=V(Us),C.prototype.visitTimestamp=V(mu),C.prototype.visitTimestampSecond=V(Cs),C.prototype.visitTimestampMillisecond=V(zs),C.prototype.visitTimestampMicrosecond=V(Ps),C.prototype.visitTimestampNanosecond=V(Vs),C.prototype.visitTime=V(_u),C.prototype.visitTimeSecond=V($s),C.prototype.visitTimeMillisecond=V(js),C.prototype.visitTimeMicrosecond=V(Ys),C.prototype.visitTimeNanosecond=V(Ws),C.prototype.visitDecimal=V(vu),C.prototype.visitList=V(Of),C.prototype.visitStruct=V(kf),C.prototype.visitUnion=V(Rf),C.prototype.visitDenseUnion=V(bu),C.prototype.visitSparseUnion=V(wu),C.prototype.visitDictionary=V(Uf),C.prototype.visitInterval=V(xu),C.prototype.visitIntervalDayTime=V(Hs),C.prototype.visitIntervalYearMonth=V(Gs),C.prototype.visitFixedSizeList=V(Cf),C.prototype.visitMap=V(Df);const jt=new C,Xt=Symbol.for("parent"),Pn=Symbol.for("rowIndex");class qs{constructor(t,e){return this[Xt]=t,this[Pn]=e,new Proxy(this,new Pf)}toArray(){return Object.values(this.toJSON())}toJSON(){const t=this[Pn],e=this[Xt],i=e.type.children,r={};for(let s=-1,o=i.length;++s<o;)r[i[s].name]=Ot.visit(e.children[s],t);return r}toString(){return`{${[...this].map(([t,e])=>`${Qe(t)}: ${Qe(e)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}[Symbol.iterator](){return new zf(this[Xt],this[Pn])}}class zf{constructor(t,e){this.childIndex=0,this.children=t.children,this.rowIndex=e,this.childFields=t.type.children,this.numChildren=this.childFields.length}[Symbol.iterator](){return this}next(){const t=this.childIndex;return t<this.numChildren?(this.childIndex=t+1,{done:!1,value:[this.childFields[t].name,Ot.visit(this.children[t],this.rowIndex)]}):{done:!0,value:null}}}Object.defineProperties(qs.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[Xt]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Pn]:{writable:!0,enumerable:!1,configurable:!1,value:-1}});class Pf{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(t){return t[Xt].type.children.map(e=>e.name)}has(t,e){return t[Xt].type.children.findIndex(i=>i.name===e)!==-1}getOwnPropertyDescriptor(t,e){if(t[Xt].type.children.findIndex(i=>i.name===e)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(t,e){if(Reflect.has(t,e))return t[e];const i=t[Xt].type.children.findIndex(r=>r.name===e);if(i!==-1){const r=Ot.visit(t[Xt].children[i],t[Pn]);return Reflect.set(t,e,r),r}}set(t,e,i){const r=t[Xt].type.children.findIndex(s=>s.name===e);return r!==-1?(jt.visit(t[Xt].children[r],t[Pn],i),Reflect.set(t,e,i)):Reflect.has(t,e)||typeof e=="symbol"?Reflect.set(t,e,i):!1}}class E extends H{}function z(n){return(t,e)=>t.getValid(e)?n(t,e):null}const Vf=(n,t)=>864e5*n[t],Zs=(n,t)=>4294967296*n[t+1]+(n[t]>>>0),$f=(n,t)=>4294967296*(n[t+1]/1e3)+(n[t]>>>0)/1e3,jf=(n,t)=>4294967296*(n[t+1]/1e6)+(n[t]>>>0)/1e6,Su=n=>new Date(n),Yf=(n,t)=>Su(Vf(n,t)),Wf=(n,t)=>Su(Zs(n,t)),Hf=(n,t)=>null,Iu=(n,t,e)=>{if(e+1>=t.length)return null;const i=t[e],r=t[e+1];return n.subarray(i,r)},Gf=({offset:n,values:t},e)=>{const i=n+e;return(t[i>>3]&1<<i%8)!==0},Au=({values:n},t)=>Yf(n,t),Bu=({values:n},t)=>Wf(n,t*2),tn=({stride:n,values:t},e)=>t[n*e],qf=({stride:n,values:t},e)=>hu(t[n*e]),Mu=({values:n},t)=>n[t],Zf=({stride:n,values:t},e)=>t.subarray(n*e,n*(e+1)),Jf=({values:n,valueOffsets:t},e)=>Iu(n,t,e),Xf=({values:n,valueOffsets:t},e)=>{const i=Iu(n,t,e);return i!==null?bs(i):null},Kf=({values:n},t)=>n[t],Qf=({type:n,values:t},e)=>n.precision!==xt.HALF?t[e]:hu(t[e]),td=(n,t)=>n.type.unit===fe.DAY?Au(n,t):Bu(n,t),Fu=({values:n},t)=>1e3*Zs(n,t*2),Ou=({values:n},t)=>Zs(n,t*2),Du=({values:n},t)=>$f(n,t*2),Nu=({values:n},t)=>jf(n,t*2),ed=(n,t)=>{switch(n.type.unit){case K.SECOND:return Fu(n,t);case K.MILLISECOND:return Ou(n,t);case K.MICROSECOND:return Du(n,t);case K.NANOSECOND:return Nu(n,t)}},Eu=({values:n},t)=>n[t],Tu=({values:n},t)=>n[t],Lu=({values:n},t)=>n[t],ku=({values:n},t)=>n[t],nd=(n,t)=>{switch(n.type.unit){case K.SECOND:return Eu(n,t);case K.MILLISECOND:return Tu(n,t);case K.MICROSECOND:return Lu(n,t);case K.NANOSECOND:return ku(n,t)}},id=({values:n,stride:t},e)=>Ds.decimal(n.subarray(t*e,t*(e+1))),rd=(n,t)=>{const{valueOffsets:e,stride:i,children:r}=n,{[t*i]:s,[t*i+1]:o}=e,u=r[0].slice(s,o-s);return new O([u])},sd=(n,t)=>{const{valueOffsets:e,children:i}=n,{[t]:r,[t+1]:s}=e,o=i[0];return new sr(o.slice(r,s-r))},od=(n,t)=>new qs(n,t),ad=(n,t)=>n.type.mode===Ut.Dense?Ru(n,t):Uu(n,t),Ru=(n,t)=>{const e=n.type.typeIdToChildIndex[n.typeIds[t]],i=n.children[e];return Ot.visit(i,n.valueOffsets[t])},Uu=(n,t)=>{const e=n.type.typeIdToChildIndex[n.typeIds[t]],i=n.children[e];return Ot.visit(i,t)},ud=(n,t)=>{var e;return(e=n.dictionary)===null||e===void 0?void 0:e.get(n.values[t])},ld=(n,t)=>n.type.unit===Ke.DAY_TIME?Cu(n,t):zu(n,t),Cu=({values:n},t)=>n.subarray(2*t,2*(t+1)),zu=({values:n},t)=>{const e=n[t],i=new Int32Array(2);return i[0]=Math.trunc(e/12),i[1]=Math.trunc(e%12),i},cd=(n,t)=>{const{stride:e,children:i}=n,s=i[0].slice(t*e,e);return new O([s])};E.prototype.visitNull=z(Hf),E.prototype.visitBool=z(Gf),E.prototype.visitInt=z(Kf),E.prototype.visitInt8=z(tn),E.prototype.visitInt16=z(tn),E.prototype.visitInt32=z(tn),E.prototype.visitInt64=z(Mu),E.prototype.visitUint8=z(tn),E.prototype.visitUint16=z(tn),E.prototype.visitUint32=z(tn),E.prototype.visitUint64=z(Mu),E.prototype.visitFloat=z(Qf),E.prototype.visitFloat16=z(qf),E.prototype.visitFloat32=z(tn),E.prototype.visitFloat64=z(tn),E.prototype.visitUtf8=z(Xf),E.prototype.visitBinary=z(Jf),E.prototype.visitFixedSizeBinary=z(Zf),E.prototype.visitDate=z(td),E.prototype.visitDateDay=z(Au),E.prototype.visitDateMillisecond=z(Bu),E.prototype.visitTimestamp=z(ed),E.prototype.visitTimestampSecond=z(Fu),E.prototype.visitTimestampMillisecond=z(Ou),E.prototype.visitTimestampMicrosecond=z(Du),E.prototype.visitTimestampNanosecond=z(Nu),E.prototype.visitTime=z(nd),E.prototype.visitTimeSecond=z(Eu),E.prototype.visitTimeMillisecond=z(Tu),E.prototype.visitTimeMicrosecond=z(Lu),E.prototype.visitTimeNanosecond=z(ku),E.prototype.visitDecimal=z(id),E.prototype.visitList=z(rd),E.prototype.visitStruct=z(od),E.prototype.visitUnion=z(ad),E.prototype.visitDenseUnion=z(Ru),E.prototype.visitSparseUnion=z(Uu),E.prototype.visitDictionary=z(ud),E.prototype.visitInterval=z(ld),E.prototype.visitIntervalDayTime=z(Cu),E.prototype.visitIntervalYearMonth=z(zu),E.prototype.visitFixedSizeList=z(cd),E.prototype.visitMap=z(sd);const Ot=new E,Kt=Symbol.for("keys"),Vn=Symbol.for("vals");class sr{constructor(t){return this[Kt]=new O([t.children[0]]).memoize(),this[Vn]=t.children[1],new Proxy(this,new fd)}[Symbol.iterator](){return new hd(this[Kt],this[Vn])}get size(){return this[Kt].length}toArray(){return Object.values(this.toJSON())}toJSON(){const t=this[Kt],e=this[Vn],i={};for(let r=-1,s=t.length;++r<s;)i[t.get(r)]=Ot.visit(e,r);return i}toString(){return`{${[...this].map(([t,e])=>`${Qe(t)}: ${Qe(e)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}}class hd{constructor(t,e){this.keys=t,this.vals=e,this.keyIndex=0,this.numKeys=t.length}[Symbol.iterator](){return this}next(){const t=this.keyIndex;return t===this.numKeys?{done:!0,value:null}:(this.keyIndex++,{done:!1,value:[this.keys.get(t),Ot.visit(this.vals,t)]})}}class fd{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(t){return t[Kt].toArray().map(String)}has(t,e){return t[Kt].includes(e)}getOwnPropertyDescriptor(t,e){if(t[Kt].indexOf(e)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(t,e){if(Reflect.has(t,e))return t[e];const i=t[Kt].indexOf(e);if(i!==-1){const r=Ot.visit(Reflect.get(t,Vn),i);return Reflect.set(t,e,r),r}}set(t,e,i){const r=t[Kt].indexOf(e);return r!==-1?(jt.visit(Reflect.get(t,Vn),r,i),Reflect.set(t,e,i)):Reflect.has(t,e)?Reflect.set(t,e,i):!1}}Object.defineProperties(sr.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[Kt]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Vn]:{writable:!0,enumerable:!1,configurable:!1,value:null}});let Pu;function Vu(n,t,e,i){const{length:r=0}=n;let s=typeof t!="number"?0:t,o=typeof e!="number"?r:e;return s<0&&(s=(s%r+r)%r),o<0&&(o=(o%r+r)%r),o<s&&(Pu=s,s=o,o=Pu),o>r&&(o=r),i?i(n,s,o):[s,o]}const $u=n=>n!==n;function $n(n){if(typeof n!=="object"||n===null)return $u(n)?$u:e=>e===n;if(n instanceof Date){const e=n.valueOf();return i=>i instanceof Date?i.valueOf()===e:!1}return ArrayBuffer.isView(n)?e=>e?hf(n,e):!1:n instanceof Map?pd(n):Array.isArray(n)?dd(n):n instanceof O?yd(n):gd(n,!0)}function dd(n){const t=[];for(let e=-1,i=n.length;++e<i;)t[e]=$n(n[e]);return or(t)}function pd(n){let t=-1;const e=[];for(const i of n.values())e[++t]=$n(i);return or(e)}function yd(n){const t=[];for(let e=-1,i=n.length;++e<i;)t[e]=$n(n.get(e));return or(t)}function gd(n,t=!1){const e=Object.keys(n);if(!t&&e.length===0)return()=>!1;const i=[];for(let r=-1,s=e.length;++r<s;)i[r]=$n(n[e[r]]);return or(i,e)}function or(n,t){return e=>{if(!e||typeof e!="object")return!1;switch(e.constructor){case Array:return md(n,e);case Map:return ju(n,e,e.keys());case sr:case qs:case Object:case void 0:return ju(n,e,t||Object.keys(e))}return e instanceof O?_d(n,e):!1}}function md(n,t){const e=n.length;if(t.length!==e)return!1;for(let i=-1;++i<e;)if(!n[i](t[i]))return!1;return!0}function _d(n,t){const e=n.length;if(t.length!==e)return!1;for(let i=-1;++i<e;)if(!n[i](t.get(i)))return!1;return!0}function ju(n,t,e){const i=e[Symbol.iterator](),r=t instanceof Map?t.keys():Object.keys(t)[Symbol.iterator](),s=t instanceof Map?t.values():Object.values(t)[Symbol.iterator]();let o=0;const a=n.length;let u=s.next(),l=i.next(),c=r.next();for(;o<a&&!l.done&&!c.done&&!u.done&&!(l.value!==c.value||!n[o](u.value));++o,l=i.next(),c=r.next(),u=s.next());return o===a&&l.done&&c.done&&u.done?!0:(i.return&&i.return(),r.return&&r.return(),s.return&&s.return(),!1)}function Yu(n,t,e,i){return(e&1<<i)!==0}function vd(n,t,e,i){return(e&1<<i)>>i}function Js(n,t,e){const i=e.byteLength+7&-8;if(n>0||e.byteLength<i){const r=new Uint8Array(i);return r.set(n%8===0?e.subarray(n>>3):ar(new Xs(e,n,t,null,Yu)).subarray(0,i)),r}return e}function ar(n){const t=[];let e=0,i=0,r=0;for(const o of n)o&&(r|=1<<i),++i===8&&(t[e++]=r,r=i=0);(e===0||i>0)&&(t[e++]=r);const s=new Uint8Array(t.length+7&-8);return s.set(t),s}class Xs{constructor(t,e,i,r,s){this.bytes=t,this.length=i,this.context=r,this.get=s,this.bit=e%8,this.byteIndex=e>>3,this.byte=t[this.byteIndex++],this.index=0}next(){return this.index<this.length?(this.bit===8&&(this.bit=0,this.byte=this.bytes[this.byteIndex++]),{value:this.get(this.context,this.index++,this.byte,this.bit++)}):{done:!0,value:null}}[Symbol.iterator](){return this}}function Ks(n,t,e){if(e-t<=0)return 0;if(e-t<8){let s=0;for(const o of new Xs(n,t,e-t,n,vd))s+=o;return s}const i=e>>3<<3,r=t+(t%8===0?0:8-t%8);return Ks(n,t,r)+Ks(n,i,e)+bd(n,r>>3,i-r>>3)}function bd(n,t,e){let i=0,r=Math.trunc(t);const s=new DataView(n.buffer,n.byteOffset,n.byteLength),o=e===void 0?n.byteLength:r+e;for(;o-r>=4;)i+=Qs(s.getUint32(r)),r+=4;for(;o-r>=2;)i+=Qs(s.getUint16(r)),r+=2;for(;o-r>=1;)i+=Qs(s.getUint8(r)),r+=1;return i}function Qs(n){let t=Math.trunc(n);return t=t-(t>>>1&1431655765),t=(t&858993459)+(t>>>2&858993459),(t+(t>>>4)&252645135)*16843009>>>24}const wd=-1;class nt{constructor(t,e,i,r,s,o=[],a){this.type=t,this.children=o,this.dictionary=a,this.offset=Math.floor(Math.max(e||0,0)),this.length=Math.floor(Math.max(i||0,0)),this._nullCount=Math.floor(Math.max(r||0,-1));let u;s instanceof nt?(this.stride=s.stride,this.values=s.values,this.typeIds=s.typeIds,this.nullBitmap=s.nullBitmap,this.valueOffsets=s.valueOffsets):(this.stride=ye(t),s&&((u=s[0])&&(this.valueOffsets=u),(u=s[1])&&(this.values=u),(u=s[2])&&(this.nullBitmap=u),(u=s[3])&&(this.typeIds=u))),this.nullable=this._nullCount!==0&&this.nullBitmap&&this.nullBitmap.byteLength>0}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;const{valueOffsets:e,values:i,nullBitmap:r,typeIds:s}=this;return e&&(t+=e.byteLength),i&&(t+=i.byteLength),r&&(t+=r.byteLength),s&&(t+=s.byteLength),this.children.reduce((o,a)=>o+a.byteLength,t)}get nullCount(){let t=this._nullCount,e;return t<=wd&&(e=this.nullBitmap)&&(this._nullCount=t=this.length-Ks(e,this.offset,this.offset+this.length)),t}getValid(t){if(this.nullable&&this.nullCount>0){const e=this.offset+t;return(this.nullBitmap[e>>3]&1<<e%8)!==0}return!0}setValid(t,e){if(!this.nullable)return e;if(!this.nullBitmap||this.nullBitmap.byteLength<=t>>3){const{nullBitmap:u}=this._changeLengthAndBackfillNullBitmap(this.length);Object.assign(this,{nullBitmap:u,_nullCount:0})}const{nullBitmap:i,offset:r}=this,s=r+t>>3,o=(r+t)%8,a=i[s]>>o&1;return e?a===0&&(i[s]|=1<<o,this._nullCount=this.nullCount+1):a===1&&(i[s]&=~(1<<o),this._nullCount=this.nullCount-1),e}clone(t=this.type,e=this.offset,i=this.length,r=this._nullCount,s=this,o=this.children){return new nt(t,e,i,r,s,o,this.dictionary)}slice(t,e){const{stride:i,typeId:r,children:s}=this,o=+(this._nullCount===0)-1,a=r===16?i:1,u=this._sliceBuffers(t,e,i,r);return this.clone(this.type,this.offset+t,e,o,u,s.length===0||this.valueOffsets?s:this._sliceChildren(s,a*t,a*e))}_changeLengthAndBackfillNullBitmap(t){if(this.typeId===p.Null)return this.clone(this.type,0,t,0);const{length:e,nullCount:i}=this,r=new Uint8Array((t+63&-64)>>3).fill(255,0,e>>3);r[e>>3]=(1<<e-(e&-8))-1,i>0&&r.set(Js(this.offset,e,this.nullBitmap),0);const s=this.buffers;return s[ke.VALIDITY]=r,this.clone(this.type,0,t,i+(t-e),s)}_sliceBuffers(t,e,i,r){let s;const{buffers:o}=this;return(s=o[ke.TYPE])&&(o[ke.TYPE]=s.subarray(t,t+e)),(s=o[ke.OFFSET])&&(o[ke.OFFSET]=s.subarray(t,t+e+1))||(s=o[ke.DATA])&&(o[ke.DATA]=r===6?s:s.subarray(i*t,i*(t+e))),o}_sliceChildren(t,e,i){return t.map(r=>r.slice(e,i))}}nt.prototype.children=Object.freeze([]);class _i extends H{visit(t){return this.getVisitFn(t.type).call(this,t)}visitNull(t){const{["type"]:e,["offset"]:i=0,["length"]:r=0}=t;return new nt(e,i,r,0)}visitBool(t){const{["type"]:e,["offset"]:i=0}=t,r=Z(t.nullBitmap),s=at(e.ArrayType,t.data),{["length"]:o=s.length>>3,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new nt(e,i,o,a,[void 0,s,r])}visitInt(t){const{["type"]:e,["offset"]:i=0}=t,r=Z(t.nullBitmap),s=at(e.ArrayType,t.data),{["length"]:o=s.length,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new nt(e,i,o,a,[void 0,s,r])}visitFloat(t){const{["type"]:e,["offset"]:i=0}=t,r=Z(t.nullBitmap),s=at(e.ArrayType,t.data),{["length"]:o=s.length,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new nt(e,i,o,a,[void 0,s,r])}visitUtf8(t){const{["type"]:e,["offset"]:i=0}=t,r=Z(t.data),s=Z(t.nullBitmap),o=li(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:u=t.nullBitmap?-1:0}=t;return new nt(e,i,a,u,[o,r,s])}visitBinary(t){const{["type"]:e,["offset"]:i=0}=t,r=Z(t.data),s=Z(t.nullBitmap),o=li(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:u=t.nullBitmap?-1:0}=t;return new nt(e,i,a,u,[o,r,s])}visitFixedSizeBinary(t){const{["type"]:e,["offset"]:i=0}=t,r=Z(t.nullBitmap),s=at(e.ArrayType,t.data),{["length"]:o=s.length/ye(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new nt(e,i,o,a,[void 0,s,r])}visitDate(t){const{["type"]:e,["offset"]:i=0}=t,r=Z(t.nullBitmap),s=at(e.ArrayType,t.data),{["length"]:o=s.length/ye(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new nt(e,i,o,a,[void 0,s,r])}visitTimestamp(t){const{["type"]:e,["offset"]:i=0}=t,r=Z(t.nullBitmap),s=at(e.ArrayType,t.data),{["length"]