@run-trace/duckdb-wasm 0.3.1 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/dist/duckdb-browser-blocking.cjs +1 -1
  2. package/dist/duckdb-browser-blocking.cjs.map +4 -4
  3. package/dist/duckdb-browser-blocking.mjs +1 -1
  4. package/dist/duckdb-browser-blocking.mjs.map +4 -4
  5. package/dist/duckdb-browser-coi.pthread.worker.js +1 -1
  6. package/dist/duckdb-browser-coi.pthread.worker.js.map +3 -3
  7. package/dist/duckdb-browser-coi.worker.js +1 -1
  8. package/dist/duckdb-browser-coi.worker.js.map +3 -3
  9. package/dist/duckdb-browser.cjs +1 -1
  10. package/dist/duckdb-browser.cjs.map +3 -3
  11. package/dist/duckdb-browser.mjs +1 -1
  12. package/dist/duckdb-browser.mjs.map +3 -3
  13. package/dist/duckdb-coi.wasm +0 -0
  14. package/dist/duckdb-eh.wasm +0 -0
  15. package/dist/duckdb-node-blocking.cjs +2 -4
  16. package/dist/duckdb-node-blocking.cjs.map +4 -4
  17. package/dist/duckdb-node-eh.worker.cjs +2 -4
  18. package/dist/duckdb-node-eh.worker.cjs.map +4 -4
  19. package/dist/duckdb-node.cjs +1 -1
  20. package/dist/duckdb-node.cjs.map +3 -3
  21. package/dist/types/src/bindings/bindings_base.d.ts +2 -1
  22. package/dist/types/src/platform.d.ts +1 -1
  23. package/package.json +2 -7
  24. package/dist/duckdb-browser-eh.worker.js +0 -14
  25. package/dist/duckdb-browser-eh.worker.js.map +0 -7
  26. package/dist/duckdb-browser-mvp.worker.js +0 -14
  27. package/dist/duckdb-mvp.wasm +0 -0
  28. package/dist/duckdb-node-mvp.worker.cjs +0 -52
  29. package/dist/duckdb-node-mvp.worker.cjs.map +0 -7
  30. package/dist/types/src/bindings/bindings_browser_mvp.d.ts +0 -11
  31. package/dist/types/src/bindings/bindings_node_mvp.d.ts +0 -12
  32. package/dist/types/src/targets/duckdb-browser-mvp.worker.d.ts +0 -2
  33. package/dist/types/src/targets/duckdb-node-mvp.worker.d.ts +0 -2
@@ -1,14 +0,0 @@
1
- "use strict";var duckdb=(()=>{var Ig=Object.create;var Bs=Object.defineProperty;var Tg=Object.getOwnPropertyDescriptor;var jg=Object.getOwnPropertyNames;var Dg=Object.getPrototypeOf,Bg=Object.prototype.hasOwnProperty;var Da=(i,t)=>(t=Symbol[i])?t:Symbol.for("Symbol."+i);var Fg=(i=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(i,{get:(t,e)=>(typeof require<"u"?require:t)[e]}):i)(function(i){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+i+'" is not supported')});var Lr=(i,t)=>()=>(t||i((t={exports:{}}).exports,t),t.exports),$i=(i,t)=>{for(var e in t)Bs(i,e,{get:t[e],enumerable:!0})},pl=(i,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let c of jg(t))!Bg.call(i,c)&&c!==e&&Bs(i,c,{get:()=>t[c],enumerable:!(r=Tg(t,c))||r.enumerable});return i};var _l=(i,t,e)=>(e=i!=null?Ig(Dg(i)):{},pl(t||!i||!i.__esModule?Bs(e,"default",{value:i,enumerable:!0}):e,i)),Ag=i=>pl(Bs({},"__esModule",{value:!0}),i);var xg=function(i,t){this[0]=i,this[1]=t};var ur=i=>{var t=i[Da("asyncIterator")],e=!1,r,c={};return t==null?(t=i[Da("iterator")](),r=f=>c[f]=_=>t[f](_)):(t=t.call(i),r=f=>c[f]=_=>{if(e){if(e=!1,f==="throw")throw _;return _}return e=!0,{done:!1,value:new xg(new Promise(b=>{var g=t[f](_);if(!(g instanceof Object))throw TypeError("Object expected");b(g)}),1)}}),c[Da("iterator")]=()=>c,r("next"),"throw"in t?r("throw"):c.throw=f=>{throw f},"return"in t&&r("return"),c};var _d=Lr(()=>{});var yd=Lr(()=>{});var vd=Lr((bd,Ec)=>{"use strict";var md=(()=>{var t;var i=typeof document<"u"?(t=document.currentScript)==null?void 0:t.src:void 0;return typeof __filename<"u"&&(i||(i=__filename)),function(e={}){var r=e,c,f,_=new Promise((n,s)=>{c=n,f=s}),b=Object.assign({},r),g=[],T="./this.program",D=(n,s)=>{throw s},U=typeof window=="object",M=typeof importScripts=="function",N=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",nt="";function Et(n){return r.locateFile?r.locateFile(n,nt):nt+n}var Wt,Vt,kt;if(N){var Dt=_d(),Qt=yd();M?nt=Qt.dirname(nt)+"/":nt=__dirname+"/",Wt=(n,s)=>(n=Mc(n)?new URL(n):Qt.normalize(n),Dt.readFileSync(n,s?void 0:"utf8")),kt=n=>{var s=Wt(n,!0);return s.buffer||(s=new Uint8Array(s)),s},Vt=(n,s,o,a=!0)=>{n=Mc(n)?new URL(n):Qt.normalize(n),Dt.readFile(n,a?void 0:"utf8",(l,u)=>{l?o(l):s(a?u.buffer:u)})},!r.thisProgram&&process.argv.length>1&&(T=process.argv[1].replace(/\\/g,"/")),g=process.argv.slice(2),D=(n,s)=>{throw process.exitCode=n,s}}else(U||M)&&(M?nt=self.location.href:typeof document<"u"&&document.currentScript&&(nt=document.currentScript.src),i&&(nt=i),nt.startsWith("blob:")?nt="":nt=nt.substr(0,nt.replace(/[?#].*/,"").lastIndexOf("/")+1),Wt=n=>{var s=new XMLHttpRequest;return s.open("GET",n,!1),s.send(null),s.responseText},M&&(kt=n=>{var s=new XMLHttpRequest;return s.open("GET",n,!1),s.responseType="arraybuffer",s.send(null),new Uint8Array(s.response)}),Vt=(n,s,o)=>{var a=new XMLHttpRequest;a.open("GET",n,!0),a.responseType="arraybuffer",a.onload=()=>{if(a.status==200||a.status==0&&a.response){s(a.response);return}o()},a.onerror=o,a.send(null)});var te=r.print||console.log.bind(console),k=r.printErr||console.error.bind(console);Object.assign(r,b),b=null,r.arguments&&(g=r.arguments),r.thisProgram&&(T=r.thisProgram),r.quit&&(D=r.quit);var P;r.wasmBinary&&(P=r.wasmBinary);var q,O=!1,W;function R(n,s){n||Ie(s)}var J,E,X,st,C,_t,ti,St;function Ee(){var n=q.buffer;r.HEAP8=J=new Int8Array(n),r.HEAP16=X=new Int16Array(n),r.HEAPU8=E=new Uint8Array(n),r.HEAPU16=st=new Uint16Array(n),r.HEAP32=C=new Int32Array(n),r.HEAPU32=_t=new Uint32Array(n),r.HEAPF32=ti=new Float32Array(n),r.HEAPF64=St=new Float64Array(n)}var Oe=[],Vi=[],pn=[],kr=[],Er=!1;function Ad(){if(r.preRun)for(typeof r.preRun=="function"&&(r.preRun=[r.preRun]);r.preRun.length;)Od(r.preRun.shift());ms(Oe)}function xd(){Er=!0,ms(Vi)}function kd(){ms(pn)}function Ed(){if(r.postRun)for(typeof r.postRun=="function"&&(r.postRun=[r.postRun]);r.postRun.length;)Md(r.postRun.shift());ms(kr)}function Od(n){Oe.unshift(n)}function Ud(n){Vi.unshift(n)}function Md(n){kr.unshift(n)}var cr=0,ya=null,_n=null;function Rd(n){var s;cr++,(s=r.monitorRunDependencies)==null||s.call(r,cr)}function Cd(n){var o;if(cr--,(o=r.monitorRunDependencies)==null||o.call(r,cr),cr==0&&(ya!==null&&(clearInterval(ya),ya=null),_n)){var s=_n;_n=null,s()}}function Ie(n){var o;(o=r.onAbort)==null||o.call(r,n),n="Aborted("+n+")",k(n),O=!0,W=1,n+=". Build with -sASSERTIONS for more info.";var s=new WebAssembly.RuntimeError(n);throw f(s),s}var Ld="data:application/octet-stream;base64,",Uc=n=>n.startsWith(Ld),Mc=n=>n.startsWith("file://"),Or;Or="./duckdb-mvp.wasm",Uc(Or)||(Or=Et(Or));function Rc(n){if(n==Or&&P)return new Uint8Array(P);if(kt)return kt(n);throw"both async and sync fetching of the wasm failed"}function Nd(n){return!P&&(U||M)&&typeof fetch=="function"?fetch(n,{credentials:"same-origin"}).then(s=>{if(!s.ok)throw"failed to load wasm binary file at '".concat(n,"'");return s.arrayBuffer()}).catch(()=>Rc(n)):Promise.resolve().then(()=>Rc(n))}function Cc(n,s,o){return Nd(n).then(a=>WebAssembly.instantiate(a,s)).then(o,a=>{k("failed to asynchronously prepare wasm: ".concat(a)),Ie(a)})}function Pd(n,s,o,a){return!n&&typeof WebAssembly.instantiateStreaming=="function"&&!Uc(s)&&!N&&typeof fetch=="function"?fetch(s,{credentials:"same-origin"}).then(l=>{var u=WebAssembly.instantiateStreaming(l,o);return u.then(a,function(d){return k("wasm streaming compile failed: ".concat(d)),k("falling back to ArrayBuffer instantiation"),Cc(s,o,a)})}):Cc(s,o,a)}function Vd(){var n={a:zh};function s(a,l){return K=a.exports,K=wg(K),q=K.vh,Ee(),Ta=K.yh,Ud(K.wh),Cd("wasm-instantiate"),K}Rd("wasm-instantiate");function o(a){s(a.instance)}if(r.instantiateWasm)try{return r.instantiateWasm(n,s)}catch(a){k("Module.instantiateWasm callback failed with error: ".concat(a)),f(a)}return Pd(P,Or,n,o).catch(f),{}}var Te,Ur,Hd={10164832:(n,s,o,a)=>{var l=It(n);if(typeof XMLHttpRequest>"u")return 0;let u=new XMLHttpRequest;u.open(It(a),l,!1),u.responseType="arraybuffer";for(var d=0,v=s;d<v*2;){var h=C[o/4+d>>>0],p=C[o/4+d+1>>>0];try{var y=encodeURI(It(h));y==="Host"&&(y="X-Host-Override"),y==="User-Agent"&&(y="X-user-agent"),y==="Authorization"?u.setRequestHeader(y,It(p)):u.setRequestHeader(y,encodeURI(It(p)))}catch($){console.warn("Error while performing XMLHttpRequest.setRequestHeader()",$)}d+=2}try{u.send(null)}catch($){return 0}if(u.status>=400)return 0;for(var m=u.response,v=m.byteLength,I=hi(v+4),B=new Uint8Array(m),F=0;F<v;F++)r.HEAPU8[F+I+4]=B[F];var A=new Uint8Array(4);return A[0]=v%256,v-=A[0],v/=256,A[1]=v%256,v-=A[1],v/=256,A[2]=v%256,v-=A[2],v/=256,A[3]=v%256,v-=A[3],v/=256,r.HEAPU8.set(A,I),I},10166239:(n,s,o,a,l,u)=>{var d=It(n);if(typeof XMLHttpRequest>"u")return 0;let h=new XMLHttpRequest;h.open(It(a),d,!1),h.responseType="arraybuffer";for(var p=0,A=s;p<A*2;){var y=C[o/4+p>>>0],m=C[o/4+p+1>>>0];try{var v=encodeURI(It(y));v==="Host"&&(v="X-Host-Override"),v==="User-Agent"&&(v="X-user-agent"),v==="Authorization"?h.setRequestHeader(v,It(m)):h.setRequestHeader(v,encodeURI(It(m)))}catch(H){console.warn("Error while performing XMLHttpRequest.setRequestHeader()",H)}p+=2}try{for(var I=new Uint8Array(u),B=0;B<u;B++)I[B]=r.HEAPU8[B+l];h.send(I)}catch(H){return 0}if(h.status>=400)return 0;for(var F=Uint8Array.from(Array.from(h.getResponseHeader("Etag")).map(H=>H.charCodeAt(0))),A=F.byteLength,$=hi(A+4),yt=new Uint8Array(F),B=0;B<A;B++)r.HEAPU8[B+$+4]=yt[B];var x=new Uint8Array(4);return x[0]=A%256,A-=x[0],A/=256,x[1]=A%256,A-=x[1],A/=256,x[2]=A%256,A-=x[2],A/=256,x[3]=A%256,A-=x[3],A/=256,r.HEAPU8.set(x,$),$},10167859:(n,s,o,a)=>{var l=It(n);if(typeof XMLHttpRequest>"u")return 0;let u=new XMLHttpRequest;u.open(It(a),l,!1),u.responseType="arraybuffer";for(var d=0,v=s;d<v*2;){var h=C[o/4+d>>>0],p=C[o/4+d+1>>>0];console.log("HEAD",It(h),It(p));try{var y=encodeURI(It(h));y==="Host"&&(y="X-Host-Override"),y==="User-Agent"&&(y="X-user-agent"),y==="Authorization"?u.setRequestHeader(y,It(p)):u.setRequestHeader(y,encodeURI(It(p)))}catch(x){console.warn("Error while performing XMLHttpRequest.setRequestHeader()",x)}d+=2}try{u.send(null)}catch(x){return 0}if(u.status>=400)return 0;for(var m=u.response,v=m.byteLength,I=hi(v+8),B=new Uint8Array(m),F=0;F<v;F++)r.HEAPU8[F+I+8]=B[F];var A=new Uint8Array(4);A[0]=v%256,v-=A[0],v/=256,A[1]=v%256,v-=A[1],v/=256,A[2]=v%256,v-=A[2],v/=256,A[3]=v%256,v-=A[3],v/=256,r.HEAPU8.set(A,I+4);var $=Uint8Array.from(Array.from(u.getAllResponseHeaders()).map(x=>x.charCodeAt(0)));v=$.byteLength;for(var yt=hi(v+8),F=0;F<v;F++)r.HEAPU8[F+yt+8]=$[F];return A=new Uint8Array(4),A[0]=v%256,v-=A[0],v/=256,A[1]=v%256,v-=A[1],v/=256,A[2]=v%256,v-=A[2],v/=256,A[3]=v%256,v-=A[3],v/=256,r.HEAPU8.set(A,yt+4),v=yt,A=new Uint8Array(4),A[0]=v%256,v-=A[0],v/=256,A[1]=v%256,v-=A[1],v/=256,A[2]=v%256,v-=A[2],v/=256,A[3]=v%256,v-=A[3],v/=256,r.HEAPU8.set(A,I),I},10170204:(n,s,o,a)=>{var l=It(n);if(typeof XMLHttpRequest>"u")return 0;let u=new XMLHttpRequest;u.open(It(a),l,!1),u.responseType="arraybuffer";for(var d=0,v=s;d<v*2;){var h=C[o/4+d>>>0],p=C[o/4+d+1>>>0];try{var y=encodeURI(It(h));y==="Host"&&(y="X-Host-Override"),y==="User-Agent"&&(y="X-user-agent"),y==="Authorization"?u.setRequestHeader(y,It(p)):u.setRequestHeader(y,encodeURI(It(p)))}catch($){console.warn("Error while performing XMLHttpRequest.setRequestHeader()",$)}d+=2}try{u.send(null)}catch($){return 0}if(u.status>=400)return 0;for(var m=u.response,v=m.byteLength,I=hi(v+4),B=new Uint8Array(m),F=0;F<v;F++)r.HEAPU8[F+I+4]=B[F];var A=new Uint8Array(4);return A[0]=v%256,v-=A[0],v/=256,A[1]=v%256,v-=A[1],v/=256,A[2]=v%256,v-=A[2],v/=256,A[3]=v%256,v-=A[3],v/=256,r.HEAPU8.set(A,I),I},10171611:(n,s,o,a,l,u)=>{var d=It(n);if(typeof XMLHttpRequest>"u")return 0;let h=new XMLHttpRequest;h.open(It(a),d,!1),h.responseType="arraybuffer";for(var p=0,A=s;p<A*2;){var y=C[o/4+p>>>0],m=C[o/4+p+1>>>0];try{var v=encodeURI(It(y));v==="Host"&&(v="X-Host-Override"),v==="User-Agent"&&(v="X-user-agent"),v==="Authorization"?h.setRequestHeader(v,It(m)):h.setRequestHeader(v,encodeURI(It(m)))}catch(H){console.warn("Error while performing XMLHttpRequest.setRequestHeader()",H)}p+=2}try{for(var I=new Uint8Array(u),B=0;B<u;B++)I[B]=r.HEAPU8[B+l];h.send(I)}catch(H){return 0}if(h.status>=400)return 0;for(var F=h.response,A=F.byteLength,$=hi(A+4),yt=new Uint8Array(F),B=0;B<A;B++)r.HEAPU8[B+$+4]=yt[B];var x=new Uint8Array(4);return x[0]=A%256,A-=x[0],A/=256,x[1]=A%256,A-=x[1],A/=256,x[2]=A%256,A-=x[2],A/=256,x[3]=A%256,A-=x[3],A/=256,r.HEAPU8.set(x,$),$}};function Lc(n){this.name="ExitStatus",this.message="Program terminated with exit(".concat(n,")"),this.status=n}var ms=n=>{for(;n.length>0;)n.shift()(r)},zd=r.noExitRuntime||!0,w=n=>ll(n),S=()=>dl(),Hi=[],bs=0,lr=(n,s)=>s+2097152>>>0<4194305-!!n?(n>>>0)+s*4294967296:NaN;function Wd(n){n>>>=0;var s=new vs(n);return s.get_caught()||(s.set_caught(!0),bs--),s.set_rethrown(!1),Hi.push(s),___cxa_increment_exception_refcount(s.excPtr),s.get_exception_ptr()}function $d(){if(!Hi.length)return 0;var n=Hi[Hi.length-1];return ___cxa_increment_exception_refcount(n.excPtr),n.excPtr}var fi=0,Yd=()=>{_setThrew(0,0);var n=Hi.pop();___cxa_decrement_exception_refcount(n.excPtr),fi=0};class vs{constructor(s){this.excPtr=s,this.ptr=s-24}set_type(s){_t[this.ptr+4>>>2>>>0]=s}get_type(){return _t[this.ptr+4>>>2>>>0]}set_destructor(s){_t[this.ptr+8>>>2>>>0]=s}get_destructor(){return _t[this.ptr+8>>>2>>>0]}set_caught(s){s=s?1:0,J[this.ptr+12>>>0]=s}get_caught(){return J[this.ptr+12>>>0]!=0}set_rethrown(s){s=s?1:0,J[this.ptr+13>>>0]=s}get_rethrown(){return J[this.ptr+13>>>0]!=0}init(s,o){this.set_adjusted_ptr(0),this.set_type(s),this.set_destructor(o)}set_adjusted_ptr(s){_t[this.ptr+16>>>2>>>0]=s}get_adjusted_ptr(){return _t[this.ptr+16>>>2>>>0]}get_exception_ptr(){var s=___cxa_is_pointer_type(this.get_type());if(s)return _t[this.excPtr>>>2>>>0];var o=this.get_adjusted_ptr();return o!==0?o:this.excPtr}}function Gd(n){throw n>>>=0,fi||(fi=n),fi}var Mr=n=>al(n),gs=n=>{var s=fi;if(!s)return Mr(0),0;var o=new vs(s);o.set_adjusted_ptr(s);var a=o.get_type();if(!a)return Mr(0),s;for(var l in n){var u=n[l];if(u===0||u===a)break;var d=o.ptr+16;if(___cxa_can_catch(u,a,d))return Mr(u),s}return Mr(a),s};function Kd(){return gs([])}function qd(n){return n>>>=0,gs([n])}function Jd(n,s){return n>>>=0,s>>>=0,gs([n,s])}function Xd(n,s,o){return n>>>=0,s>>>=0,o>>>=0,gs([n,s,o])}var Nc=()=>{var n=Hi.pop();n||Ie("no exception to throw");var s=n.excPtr;throw n.get_rethrown()||(Hi.push(n),n.set_rethrown(!0),n.set_caught(!1),bs++),fi=s,fi};function Zd(n){if(n>>>=0,!!n){var s=new vs(n);Hi.push(s),s.set_rethrown(!0),Nc()}}function Qd(n,s,o){n>>>=0,s>>>=0,o>>>=0;var a=new vs(n);throw a.init(s,o),fi=n,bs++,fi}var tf=()=>bs;function Pc(){Ie("missing function: $SOCKFS")}Pc.stub=!0;function ma(){Ie("missing function: $FS")}ma.stub=!0;var Rr=n=>{var s=Pc.getSocket(n);if(!s)throw new ma.ErrnoError(8);return s},ba=n=>(n&255)+"."+(n>>8&255)+"."+(n>>16&255)+"."+(n>>24&255),Vc=n=>{var s="",o=0,a=0,l=0,u=0,d=0,h=0,p=[n[0]&65535,n[0]>>16,n[1]&65535,n[1]>>16,n[2]&65535,n[2]>>16,n[3]&65535,n[3]>>16],y=!0,m="";for(h=0;h<5;h++)if(p[h]!==0){y=!1;break}if(y){if(m=ba(p[6]|p[7]<<16),p[5]===-1)return s="::ffff:",s+=m,s;if(p[5]===0)return s="::",m==="0.0.0.0"&&(m=""),m==="0.0.0.1"&&(m="1"),s+=m,s}for(o=0;o<8;o++)p[o]===0&&(o-l>1&&(d=0),l=o,d++),d>a&&(a=d,u=o-a+1);for(o=0;o<8;o++){if(a>1&&p[o]===0&&o>=u&&o<u+a){o===u&&(s+=":",u===0&&(s+=":"));continue}s+=Number(_ntohs(p[o]&65535)).toString(16),s+=o<7?":":""}return s},Hc=(n,s)=>{var o=X[n>>>1>>>0],a=_ntohs(st[n+2>>>1>>>0]),l;switch(o){case 2:if(s!==16)return{errno:28};l=C[n+4>>>2>>>0],l=ba(l);break;case 10:if(s!==28)return{errno:28};l=[C[n+8>>>2>>>0],C[n+12>>>2>>>0],C[n+16>>>2>>>0],C[n+20>>>2>>>0]],l=Vc(l);break;default:return{errno:5}}return{family:o,addr:l,port:a}},ws=n=>{for(var s=n.split("."),o=0;o<4;o++){var a=Number(s[o]);if(isNaN(a))return null;s[o]=a}return(s[0]|s[1]<<8|s[2]<<16|s[3]<<24)>>>0},Ss=n=>parseInt(n),va=n=>{var s,o,a,l,u=/^((?=.*::)(?!.*::.+::)(::)?([\dA-F]{1,4}:(:|\b)|){5}|([\dA-F]{1,4}:){6})((([\dA-F]{1,4}((?!\3)::|:\b|$))|(?!\2\3)){2}|(((2[0-4]|1\d|[1-9])?\d|25[0-5])\.?\b){4})$/i,d=[];if(!u.test(n))return null;if(n==="::")return[0,0,0,0,0,0,0,0];for(n.startsWith("::")?n=n.replace("::","Z:"):n=n.replace("::",":Z:"),n.indexOf(".")>0?(n=n.replace(new RegExp("[.]","g"),":"),s=n.split(":"),s[s.length-4]=Ss(s[s.length-4])+Ss(s[s.length-3])*256,s[s.length-3]=Ss(s[s.length-2])+Ss(s[s.length-1])*256,s=s.slice(0,s.length-2)):s=n.split(":"),a=0,l=0,o=0;o<s.length;o++)if(typeof s[o]=="string")if(s[o]==="Z"){for(l=0;l<8-s.length+1;l++)d[o+l]=0;a=l-1}else d[o+a]=_htons(parseInt(s[o],16));else d[o+a]=s[o];return[d[1]<<16|d[0],d[3]<<16|d[2],d[5]<<16|d[4],d[7]<<16|d[6]]},_e={address_map:{id:1,addrs:{},names:{}},lookup_name(n){var s=ws(n);if(s!==null||(s=va(n),s!==null))return n;var o;if(_e.address_map.addrs[n])o=_e.address_map.addrs[n];else{var a=_e.address_map.id++;R(a<65535,"exceeded max address mappings of 65535"),o="172.29."+(a&255)+"."+(a&65280),_e.address_map.names[o]=n,_e.address_map.addrs[n]=o}return o},lookup_addr(n){return _e.address_map.names[n]?_e.address_map.names[n]:null}},zc=(n,s,o)=>{if(o&&n===0)return null;var a=Hc(n,s);if(a.errno)throw new ma.ErrnoError(a.errno);return a.addr=_e.lookup_addr(a.addr)||a.addr,a};function ef(n,s,o,a,l,u){s>>>=0,o>>>=0;var d=Rr(n),h=zc(s,o);return d.sock_ops.bind(d,h.addr,h.port),0}function rf(n,s,o,a,l,u){s>>>=0,o>>>=0;var d=Rr(n),h=zc(s,o);return d.sock_ops.connect(d,h.addr,h.port),0}var nf=(n,s,o)=>{};function sf(n,s,o,a){s>>>=0}var Wc=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0,$c=(n,s,o)=>{s>>>=0;for(var a=s+o,l=s;n[l]&&!(l>=a);)++l;if(l-s>16&&n.buffer&&Wc)return Wc.decode(n.subarray(s,l));for(var u="";s<l;){var d=n[s++];if(!(d&128)){u+=String.fromCharCode(d);continue}var h=n[s++]&63;if((d&224)==192){u+=String.fromCharCode((d&31)<<6|h);continue}var p=n[s++]&63;if((d&240)==224?d=(d&15)<<12|h<<6|p:d=(d&7)<<18|h<<12|p<<6|n[s++]&63,d<65536)u+=String.fromCharCode(d);else{var y=d-65536;u+=String.fromCharCode(55296|y>>10,56320|y&1023)}}return u},It=(n,s)=>(n>>>=0,n?$c(E,n,s):""),ga={varargs:void 0,getStr(n){var s=It(n);return s}};function of(n,s,o){return o>>>=0,ga.varargs=o,0}function af(n,s){s>>>=0}function cf(n,s,o){var a=lr(s,o)}var wa=n=>{for(var s=0,o=0;o<n.length;++o){var a=n.charCodeAt(o);a<=127?s++:a<=2047?s+=2:a>=55296&&a<=57343?(s+=4,++o):s+=3}return s};r.lengthBytesUTF8=wa;var Yc=(n,s,o,a)=>{if(o>>>=0,!(a>0))return 0;for(var l=o,u=o+a-1,d=0;d<n.length;++d){var h=n.charCodeAt(d);if(h>=55296&&h<=57343){var p=n.charCodeAt(++d);h=65536+((h&1023)<<10)|p&1023}if(h<=127){if(o>=u)break;s[o++>>>0]=h}else if(h<=2047){if(o+1>=u)break;s[o++>>>0]=192|h>>6,s[o++>>>0]=128|h&63}else if(h<=65535){if(o+2>=u)break;s[o++>>>0]=224|h>>12,s[o++>>>0]=128|h>>6&63,s[o++>>>0]=128|h&63}else{if(o+3>=u)break;s[o++>>>0]=240|h>>18,s[o++>>>0]=128|h>>12&63,s[o++>>>0]=128|h>>6&63,s[o++>>>0]=128|h&63}}return s[o>>>0]=0,o-l},zi=(n,s,o)=>Yc(n,E,s,o);r.stringToUTF8=zi;function lf(n,s){n>>>=0,s>>>=0}function uf(n,s,o){s>>>=0,o>>>=0}var Gc=(n,s)=>(E.fill(0,n,n+s),n),Is=(n,s,o,a,l)=>{switch(s){case 2:o=ws(o),Gc(n,16),l&&(C[l>>>2>>>0]=16),X[n>>>1>>>0]=s,C[n+4>>>2>>>0]=o,X[n+2>>>1>>>0]=_htons(a);break;case 10:o=va(o),Gc(n,28),l&&(C[l>>>2>>>0]=28),C[n>>>2>>>0]=s,C[n+8>>>2>>>0]=o[0],C[n+12>>>2>>>0]=o[1],C[n+16>>>2>>>0]=o[2],C[n+20>>>2>>>0]=o[3],X[n+2>>>1>>>0]=_htons(a);break;default:return 5}return 0};function df(n,s,o,a,l,u){s>>>=0,o>>>=0;var d=Rr(n);if(!d.daddr)return-53;var h=Is(s,d.family,_e.lookup_name(d.daddr),d.dport,o);return 0}function ff(n,s,o,a,l,u){s>>>=0,o>>>=0;var d=Rr(n),h=Is(s,d.family,_e.lookup_name(d.saddr||"0.0.0.0"),d.sport,o);return 0}function hf(n,s,o,a,l,u){a>>>=0,l>>>=0;var d=Rr(n);return s===1&&o===4?(C[a>>>2>>>0]=d.error,C[l>>>2>>>0]=4,d.error=null,0):-50}function pf(n,s,o){return o>>>=0,ga.varargs=o,0}function _f(n,s){n>>>=0,s>>>=0}function yf(n,s,o){s>>>=0}function mf(n,s,o,a){s>>>=0,o>>>=0}function bf(n,s,o,a){s>>>=0,a>>>=0,ga.varargs=a}function vf(n,s,o){n>>>=0}function gf(n,s,o,a){s>>>=0,o>>>=0,a>>>=0}function wf(n,s,o,a,l,u){s>>>=0,o>>>=0,l>>>=0,u>>>=0;var d=Rr(n),h=d.sock_ops.recvmsg(d,o);if(!h)return 0;if(l)var p=Is(l,d.family,_e.lookup_name(h.addr),h.port,u);return E.set(h.buffer,s>>>0),h.buffer.byteLength}function Sf(n,s,o,a){s>>>=0,a>>>=0}function If(n){n>>>=0}function Tf(n,s,o,a,l,u){s>>>=0,o>>>=0,l>>>=0,u>>>=0}var jf=(n,s,o)=>{};function Df(n,s){n>>>=0,s>>>=0}function Bf(n,s,o){n>>>=0,s>>>=0,o>>>=0}function Ff(n,s,o){s>>>=0}var Af=1,xf=()=>Af,kf=()=>{throw 1/0};function Kc(){Ie("missing function: _emval_call_method")}Kc.stub=!0;function qc(){Ie("missing function: _emval_decref")}qc.stub=!0;function Jc(){Ie("missing function: _emval_get_global")}Jc.stub=!0;function Xc(){Ie("missing function: _emval_get_method_caller")}Xc.stub=!0;function Zc(){Ie("missing function: _emval_run_destructors")}Zc.stub=!0;var yn=n=>n%4===0&&(n%100!==0||n%400===0),Ef=[0,31,60,91,121,152,182,213,244,274,305,335],Of=[0,31,59,90,120,151,181,212,243,273,304,334],Uf=n=>{var s=yn(n.getFullYear()),o=s?Ef:Of,a=o[n.getMonth()]+n.getDate()-1;return a};function Mf(n,s,o){var a=lr(n,s);o>>>=0;var l=new Date(a*1e3);C[o>>>2>>>0]=l.getSeconds(),C[o+4>>>2>>>0]=l.getMinutes(),C[o+8>>>2>>>0]=l.getHours(),C[o+12>>>2>>>0]=l.getDate(),C[o+16>>>2>>>0]=l.getMonth(),C[o+20>>>2>>>0]=l.getFullYear()-1900,C[o+24>>>2>>>0]=l.getDay();var u=Uf(l)|0;C[o+28>>>2>>>0]=u,C[o+36>>>2>>>0]=-(l.getTimezoneOffset()*60);var d=new Date(l.getFullYear(),0,1),h=new Date(l.getFullYear(),6,1).getTimezoneOffset(),p=d.getTimezoneOffset(),y=(h!=p&&l.getTimezoneOffset()==Math.min(p,h))|0;C[o+32>>>2>>>0]=y}function Rf(n,s,o,a,l,u,d,h){n>>>=0;var p=lr(l,u);return d>>>=0,h>>>=0,-52}function Cf(n,s,o,a,l,u,d){n>>>=0,s>>>=0;var h=lr(u,d)}var Lf=function(n,s,o,a){n>>>=0,s>>>=0,o>>>=0,a>>>=0;var l=new Date().getFullYear(),u=new Date(l,0,1),d=new Date(l,6,1),h=u.getTimezoneOffset(),p=d.getTimezoneOffset(),y=Math.max(h,p);_t[n>>>2>>>0]=y*60,C[s>>>2>>>0]=+(h!=p);var m=B=>B.toLocaleTimeString(void 0,{hour12:!1,timeZoneName:"short"}).split(" ")[1],v=m(u),I=m(d);p<h?(zi(v,o,17),zi(I,a,17)):(zi(v,a,17),zi(I,o,17))},Nf=()=>{Ie("")};function Pf(n,s){return n>>>=0,globalThis.DUCKDB_RUNTIME.createDirectory(r,n,s)}function Vf(n,s){return n>>>=0,globalThis.DUCKDB_RUNTIME.checkDirectory(r,n,s)}function Hf(n,s){return n>>>=0,globalThis.DUCKDB_RUNTIME.listDirectoryEntries(r,n,s)}function zf(n,s){return n>>>=0,globalThis.DUCKDB_RUNTIME.removeDirectory(r,n,s)}function Wf(n){return globalThis.DUCKDB_RUNTIME.closeFile(r,n)}function $f(n,s){return n>>>=0,globalThis.DUCKDB_RUNTIME.dropFile(r,n,s)}function Yf(n,s){return n>>>=0,globalThis.DUCKDB_RUNTIME.checkFile(r,n,s)}function Gf(n,s,o,a){return n>>>=0,o>>>=0,globalThis.DUCKDB_RUNTIME.moveFile(r,n,s,o,a)}function Kf(n,s){return globalThis.DUCKDB_RUNTIME.openFile(r,n,s)}function qf(n,s,o,a){return s>>>=0,globalThis.DUCKDB_RUNTIME.readFile(r,n,s,o,a)}function Jf(n,s){return globalThis.DUCKDB_RUNTIME.truncateFile(r,n,s)}function Xf(n,s,o,a){return s>>>=0,globalThis.DUCKDB_RUNTIME.writeFile(r,n,s,o,a)}function Zf(n){return globalThis.DUCKDB_RUNTIME.getDefaultDataProtocol(n)}function Qf(n,s){return n>>>=0,globalThis.DUCKDB_RUNTIME.glob(r,n,s)}function th(n){return globalThis.DUCKDB_RUNTIME.testPlatformFeature(r,n)}function eh(n,s,o,a,l,u){return n>>>=0,o>>>=0,l>>>=0,globalThis.DUCKDB_RUNTIME.callScalarUDF(r,n,s,o,a,l,u)}var Sa=[],ih=(n,s)=>{Sa.length=0;for(var o;o=E[n++>>>0];){var a=o!=105;a&=o!=112,s+=a&&s%8?4:0,Sa.push(o==112?_t[s>>>2>>>0]:o==105?C[s>>>2>>>0]:St[s>>>3>>>0]),s+=a?8:4}return Sa},rh=(n,s,o)=>{var a=ih(s,o);return Hd[n](...a)};function nh(n,s,o){return n>>>=0,s>>>=0,o>>>=0,rh(n,s,o)}var sh=()=>Date.now(),Qc=()=>4294901760;function oh(){return Qc()}var tl;tl=()=>performance.now();var ah=n=>{var s=q.buffer,o=(n-s.byteLength+65535)/65536;try{return q.grow(o),Ee(),1}catch(a){}};function ch(n){n>>>=0;var s=E.length,o=Qc();if(n>o)return!1;for(var a=(p,y)=>p+(y-p%y)%y,l=1;l<=4;l*=2){var u=s*(1+.2/l);u=Math.min(u,n+100663296);var d=Math.min(o,a(Math.max(n,u),65536)),h=ah(d);if(h)return!0}return!1}var Ia={},lh=()=>T||"./this.program",mn=()=>{if(!mn.strings){var n=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",s={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:n,_:lh()};for(var o in Ia)Ia[o]===void 0?delete s[o]:s[o]=Ia[o];var a=[];for(var o in s)a.push("".concat(o,"=").concat(s[o]));mn.strings=a}return mn.strings},uh=(n,s)=>{for(var o=0;o<n.length;++o)J[s++>>>0]=n.charCodeAt(o);J[s>>>0]=0},dh=function(n,s){n>>>=0,s>>>=0;var o=0;return mn().forEach((a,l)=>{var u=s+o;_t[n+l*4>>>2>>>0]=u,uh(a,u),o+=a.length+1}),0},fh=function(n,s){n>>>=0,s>>>=0;var o=mn();_t[n>>>2>>>0]=o.length;var a=0;return o.forEach(l=>a+=l.length+1),_t[s>>>2>>>0]=a,0},hh=0,ph=()=>zd||hh>0,_h=n=>{var s;W=n,ph()||((s=r.onExit)==null||s.call(r,n),O=!0),D(n,new Lc(n))},el=(n,s)=>{W=n,_h(n)},yh=el,mh=n=>52;function bh(n,s){s>>>=0;var o=0,a=0,l=0;{var u=2;n==0?o=2:(n==1||n==2)&&(o=64),l=1}return J[s>>>0]=u,X[s+2>>>1>>>0]=l,Ur=[o>>>0,(Te=o,+Math.abs(Te)>=1?Te>0?+Math.floor(Te/4294967296)>>>0:~~+Math.ceil((Te-+(~~Te>>>0))/4294967296)>>>0:0)],C[s+8>>>2>>>0]=Ur[0],C[s+12>>>2>>>0]=Ur[1],Ur=[a>>>0,(Te=a,+Math.abs(Te)>=1?Te>0?+Math.floor(Te/4294967296)>>>0:~~+Math.ceil((Te-+(~~Te>>>0))/4294967296)>>>0:0)],C[s+16>>>2>>>0]=Ur[0],C[s+20>>>2>>>0]=Ur[1],0}function vh(n,s,o,a,l,u){s>>>=0,o>>>=0;var d=lr(a,l);return u>>>=0,52}function gh(n,s,o,a,l,u){s>>>=0,o>>>=0;var d=lr(a,l);return u>>>=0,52}function wh(n,s,o,a){return s>>>=0,o>>>=0,a>>>=0,52}function Sh(n,s,o,a,l){var u=lr(s,o);return l>>>=0,70}var Ih=n=>52,Th=[null,[],[]],jh=(n,s)=>{var o=Th[n];s===0||s===10?((n===1?te:k)($c(o,0)),o.length=0):o.push(s)};function Dh(n,s,o,a){s>>>=0,o>>>=0,a>>>=0;for(var l=0,u=0;u<o;u++){var d=_t[s>>>2>>>0],h=_t[s+4>>>2>>>0];s+=8;for(var p=0;p<h;p++)jh(n,E[d+p>>>0]);l+=h}return _t[a>>>2>>>0]=l,0}function Bh(n,s,o,a){n>>>=0,s>>>=0,o>>>=0,a>>>=0;var l=0,u=0,d=0,h=0,p=0,y=0,m;function v(I,B,F,A,$,yt){var x,H,Tt,Nt;return H=I===10?28:16,$=I===10?Vc($):ba($),x=hi(H),Nt=Is(x,I,$,yt),R(!Nt),Tt=hi(32),C[Tt+4>>>2>>>0]=I,C[Tt+8>>>2>>>0]=B,C[Tt+12>>>2>>>0]=F,_t[Tt+24>>>2>>>0]=A,_t[Tt+20>>>2>>>0]=x,I===10?C[Tt+16>>>2>>>0]=28:C[Tt+16>>>2>>>0]=16,C[Tt+28>>>2>>>0]=0,Tt}if(o&&(d=C[o>>>2>>>0],h=C[o+4>>>2>>>0],p=C[o+8>>>2>>>0],y=C[o+12>>>2>>>0]),p&&!y&&(y=p===2?17:6),!p&&y&&(p=y===17?2:1),y===0&&(y=6),p===0&&(p=1),!n&&!s)return-2;if(d&-1088||o!==0&&C[o>>>2>>>0]&2&&!n)return-1;if(d&32)return-2;if(p!==0&&p!==1&&p!==2)return-7;if(h!==0&&h!==2&&h!==10)return-6;if(s&&(s=It(s),u=parseInt(s,10),isNaN(u)))return d&1024?-2:-8;if(!n)return h===0&&(h=2),d&1||(h===2?l=_htonl(2130706433):l=[0,0,0,1]),m=v(h,p,y,null,l,u),_t[a>>>2>>>0]=m,0;if(n=It(n),l=ws(n),l!==null)if(h===0||h===2)h=2;else if(h===10&&d&8)l=[0,0,_htonl(65535),l],h=10;else return-2;else if(l=va(n),l!==null)if(h===0||h===10)h=10;else return-2;return l!=null?(m=v(h,p,y,n,l,u),_t[a>>>2>>>0]=m,0):d&4?-2:(n=_e.lookup_name(n),l=ws(n),h===0?h=2:h===10&&(l=[0,0,_htonl(65535),l]),m=v(h,p,y,null,l,u),_t[a>>>2>>>0]=m,0)}var Fh=()=>{if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function")return a=>crypto.getRandomValues(a);if(N)try{var n=Fg("crypto"),s=n.randomFillSync;if(s)return a=>n.randomFillSync(a);var o=n.randomBytes;return a=>(a.set(o(a.byteLength)),a)}catch(a){}Ie("initRandomDevice")},il=n=>(il=Fh())(n);function Ah(n,s){return n>>>=0,s>>>=0,il(E.subarray(n>>>0,n+s>>>0)),0}function xh(n,s,o,a,l,u,d){n>>>=0,o>>>=0,l>>>=0;var h=Hc(n,s);if(h.errno)return-6;var p=h.port,y=h.addr,m=!1;if(o&&a){var v;if(d&1||!(v=_e.lookup_addr(y))){if(d&8)return-2}else y=v;var I=zi(y,o,a);I+1>=a&&(m=!0)}if(l&&u){p=""+p;var I=zi(p,l,u);I+1>=u&&(m=!0)}return m?-12:0}function kh(n){return n>>>=0,n}var Eh=(n,s)=>{for(var o=0,a=0;a<=s;o+=n[a++]);return o},rl=[31,29,31,30,31,30,31,31,30,31,30,31],nl=[31,28,31,30,31,30,31,31,30,31,30,31],Oh=(n,s)=>{for(var o=new Date(n.getTime());s>0;){var a=yn(o.getFullYear()),l=o.getMonth(),u=(a?rl:nl)[l];if(s>u-o.getDate())s-=u-o.getDate()+1,o.setDate(1),l<11?o.setMonth(l+1):(o.setMonth(0),o.setFullYear(o.getFullYear()+1));else return o.setDate(o.getDate()+s),o}return o};function Uh(n,s,o){var a=o>0?o:wa(n)+1,l=new Array(a),u=Yc(n,l,0,l.length);return s&&(l.length=u),l}var sl=(n,s)=>{J.set(n,s>>>0)};function Mh(n,s,o,a){n>>>=0,s>>>=0,o>>>=0,a>>>=0;var l=_t[a+40>>>2>>>0],u={tm_sec:C[a>>>2>>>0],tm_min:C[a+4>>>2>>>0],tm_hour:C[a+8>>>2>>>0],tm_mday:C[a+12>>>2>>>0],tm_mon:C[a+16>>>2>>>0],tm_year:C[a+20>>>2>>>0],tm_wday:C[a+24>>>2>>>0],tm_yday:C[a+28>>>2>>>0],tm_isdst:C[a+32>>>2>>>0],tm_gmtoff:C[a+36>>>2>>>0],tm_zone:l?It(l):""},d=It(o),h={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var p in h)d=d.replace(new RegExp(p,"g"),h[p]);var y=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],m=["January","February","March","April","May","June","July","August","September","October","November","December"];function v(x,H,Tt){for(var Nt=typeof x=="number"?x.toString():x||"";Nt.length<H;)Nt=Tt[0]+Nt;return Nt}function I(x,H){return v(x,H,"0")}function B(x,H){function Tt(Wi){return Wi<0?-1:Wi>0?1:0}var Nt;return(Nt=Tt(x.getFullYear()-H.getFullYear()))===0&&(Nt=Tt(x.getMonth()-H.getMonth()))===0&&(Nt=Tt(x.getDate()-H.getDate())),Nt}function F(x){switch(x.getDay()){case 0:return new Date(x.getFullYear()-1,11,29);case 1:return x;case 2:return new Date(x.getFullYear(),0,3);case 3:return new Date(x.getFullYear(),0,2);case 4:return new Date(x.getFullYear(),0,1);case 5:return new Date(x.getFullYear()-1,11,31);case 6:return new Date(x.getFullYear()-1,11,30)}}function A(x){var H=Oh(new Date(x.tm_year+1900,0,1),x.tm_yday),Tt=new Date(H.getFullYear(),0,4),Nt=new Date(H.getFullYear()+1,0,4),Wi=F(Tt),pi=F(Nt);return B(Wi,H)<=0?B(pi,H)<=0?H.getFullYear()+1:H.getFullYear():H.getFullYear()-1}var $={"%a":x=>y[x.tm_wday].substring(0,3),"%A":x=>y[x.tm_wday],"%b":x=>m[x.tm_mon].substring(0,3),"%B":x=>m[x.tm_mon],"%C":x=>{var H=x.tm_year+1900;return I(H/100|0,2)},"%d":x=>I(x.tm_mday,2),"%e":x=>v(x.tm_mday,2," "),"%g":x=>A(x).toString().substring(2),"%G":A,"%H":x=>I(x.tm_hour,2),"%I":x=>{var H=x.tm_hour;return H==0?H=12:H>12&&(H-=12),I(H,2)},"%j":x=>I(x.tm_mday+Eh(yn(x.tm_year+1900)?rl:nl,x.tm_mon-1),3),"%m":x=>I(x.tm_mon+1,2),"%M":x=>I(x.tm_min,2),"%n":()=>"\n","%p":x=>x.tm_hour>=0&&x.tm_hour<12?"AM":"PM","%S":x=>I(x.tm_sec,2),"%t":()=>" ","%u":x=>x.tm_wday||7,"%U":x=>{var H=x.tm_yday+7-x.tm_wday;return I(Math.floor(H/7),2)},"%V":x=>{var H=Math.floor((x.tm_yday+7-(x.tm_wday+6)%7)/7);if((x.tm_wday+371-x.tm_yday-2)%7<=2&&H++,H){if(H==53){var Nt=(x.tm_wday+371-x.tm_yday)%7;Nt!=4&&(Nt!=3||!yn(x.tm_year))&&(H=1)}}else{H=52;var Tt=(x.tm_wday+7-x.tm_yday-1)%7;(Tt==4||Tt==5&&yn(x.tm_year%400-1))&&H++}return I(H,2)},"%w":x=>x.tm_wday,"%W":x=>{var H=x.tm_yday+7-(x.tm_wday+6)%7;return I(Math.floor(H/7),2)},"%y":x=>(x.tm_year+1900).toString().substring(2),"%Y":x=>x.tm_year+1900,"%z":x=>{var H=x.tm_gmtoff,Tt=H>=0;return H=Math.abs(H)/60,H=H/60*100+H%60,(Tt?"+":"-")+("0000"+H).slice(-4)},"%Z":x=>x.tm_zone,"%%":()=>"%"};d=d.replace(/%%/g,"\0\0");for(var p in $)d.includes(p)&&(d=d.replace(new RegExp(p,"g"),$[p](u)));d=d.replace(/\0\0/g,"%");var yt=Uh(d,!1);return yt.length>s?0:(sl(yt,n),yt.length-1)}function Rh(n,s,o,a,l){return n>>>=0,s>>>=0,o>>>=0,a>>>=0,l>>>=0,Mh(n,s,o,a)}var Ch=n=>{if(n instanceof Lc||n=="unwind")return W;D(1,n)},Ts=[],Ta,L=n=>{var s=Ts[n];return s||(n>=Ts.length&&(Ts.length=n+1),Ts[n]=s=Ta.get(n)),s},Lh=n=>{var s=r["_"+n];return s},js=n=>ul(n);r.stackAlloc=js;var Nh=n=>{var s=wa(n)+1,o=js(s);return zi(n,o,s),o},Ph=(n,s,o,a,l)=>{var u={string:F=>{var A=0;return F!=null&&F!==0&&(A=Nh(F)),A},array:F=>{var A=js(F.length);return sl(F,A),A}};function d(F){return s==="string"?It(F):s==="boolean"?!!F:F}var h=Lh(n),p=[],y=0;if(a)for(var m=0;m<a.length;m++){var v=u[o[m]];v?(y===0&&(y=S()),p[m]=v(a[m])):p[m]=a[m]}var I=h(...p);function B(F){return y!==0&&w(y),d(F)}return I=B(I),I},Cr=(n,s)=>{n<128?s.push(n):s.push(n%128|128,n>>7)},ja=(n,s)=>{var o=n.slice(0,1),a=n.slice(1),l={i:127,p:127,j:126,f:125,d:124,e:111};s.push(96),Cr(a.length,s);for(var u=0;u<a.length;++u)s.push(l[a[u]]);o=="v"?s.push(0):s.push(1,l[o])},Vh=n=>{var s=[],o=[0,97,115,109,1,0,0,0];s.push(o);var a=[n[0].replace("j","i"),"i",n.slice(1).replace(/j/g,"ii")].join(""),l=[3];ja(a,l),ja(n,l),ja("vi",l);var u=[1];Cr(l.length,u),u.push(...l),s.push(u);var d=[2,15,2,1,101,1,116,1,112,0,0,1,101,1,114,0,2];s.push(d);var h=[3,2,1,0];s.push(h);var p=[7,5,1,1,102,0,1];s.push(p);var y=[];n[0]==="j"?y=[1,1,126]:y.push(0);function m(H){y.push(32),Cr(H,y)}for(var v=1,I=1;I<n.length;I++)n[I]=="j"?(m(v+1),y.push(173,66,32,134),m(v),y.push(172,132),v+=2):(m(v),v++);y.push(32,0,17,1,0),n[0]==="j"&&(y.push(34),Cr(v,y),y.push(66,32,136,167,16,0),m(v),y.push(167)),y.push(11);var B=[1];Cr(y.length,B),B.push(...y);var F=[10];Cr(B.length,F),F.push(...B),s.push(F);var A=new Uint8Array([].concat.apply([],s)),$=new WebAssembly.Module(A),yt=new WebAssembly.Instance($,{e:{t:Ta,r:Mr}}),x=yt.exports.f;return x},Hh=n=>cl(),zh={q:Wd,Vb:$d,u:Yd,a:Kd,k:qd,B:Jd,ma:Xd,Pa:Nc,Kb:Zd,s:Qd,L:tf,c:Gd,gb:ef,lb:rf,Kg:nf,mh:sf,ba:of,lh:af,$b:cf,nh:lf,gh:uf,fb:df,eb:ff,jb:hf,Aa:pf,ih:_f,hh:yf,jh:mf,Na:bf,kb:vf,dh:gf,hb:wf,eh:Sf,$a:If,ib:Tf,Ma:jf,kh:Df,oh:Bf,ab:Ff,mb:xf,Lg:kf,Hg:Kc,Fg:qc,Jg:Jc,Ig:Xc,Gg:Zc,ec:Mf,Rc:Rf,Sc:Cf,rh:Lf,F:Nf,Xg:Pf,Yg:Vf,Vg:Hf,Wg:zf,Ya:Wf,$g:$f,Tg:Yf,Ug:Gf,_g:Kf,ua:qf,Zg:Jf,Za:Xf,ah:Zf,Sg:Qf,Xa:th,bh:eh,ra:nh,qa:sh,nb:oh,ya:tl,uh:ch,Od:dh,Zd:fh,_:yh,na:mh,df:bh,bc:vh,ac:gh,Qa:wh,Cg:Sh,fh:Ih,Ba:Dh,La:Bh,ch:Ah,Ka:xh,Q:ey,J:x_,ga:N_,D:d_,Ja:w_,$:T_,Wa:ty,oa:$p,Sa:uy,ia:B_,da:E_,Ta:sy,U:O_,rc:Iv,lc:Av,If:dm,sb:yg,Kc:nv,Qd:eb,jc:kv,kc:xv,X:b_,Ra:Wp,va:Q_,sc:Sv,Jf:um,p:Xp,E:y_,ph:$_,sh:H_,T:M_,ha:f_,za:z_,S:__,qh:W_,th:V_,ca:P_,d:Cp,O:C_,H:L_,_a:G_,C:S_,sa:K_,la:q_,zc:_v,Ga:Y_,pa:J_,b:Np,Fa:cy,yd:bb,Ve:Xm,g:Pp,bb:U_,Ea:dy,Da:fy,j:zp,Oa:n_,Qg:oy,ka:ly,o:Vp,cb:F_,v:Qp,w:Kp,I:u_,R:l_,Z:qp,ja:t_,r:Jp,A:o_,Og:hy,W:g_,x:v_,vb:hg,Nd:rb,xd:vb,He:d0,vd:wb,zd:mb,Jd:ab,Vd:J0,wd:gb,xb:dg,de:V0,Id:cb,Ad:yb,Yd:G0,Ie:u0,Wd:q0,$d:$0,Md:nb,Ue:Zm,rf:Fm,Mf:am,ue:T0,xe:w0,hd:Mb,Ag:vy,pf:xm,Nf:om,Hf:fm,of:km,Be:m0,zg:gy,ud:Sb,td:Ib,le:O0,qg:Ay,sf:Bm,Ae:b0,se:D0,ge:L0,sd:Tb,rd:jb,md:xb,Tc:Xb,Se:t0,Kd:ob,Xd:K0,Wf:Xy,pg:xy,lg:Uy,Ff:pm,Vf:Zy,ub:pg,Jb:Qv,Hb:eg,Yc:Yb,Sb:$v,Ub:zv,Rb:Yv,og:ky,xf:Sm,wf:Im,Le:a0,te:j0,rb:mg,vc:vv,Mb:Xv,vg:Ty,wb:fg,ve:I0,mg:Oy,Uf:Qy,Xf:Jy,Qe:i0,Ee:p0,Lc:rv,ld:kb,Ib:tg,Lb:Zv,Of:sm,bd:Vb,ig:Cy,Pe:r0,Oc:tv,Ac:pv,Oe:n0,Me:o0,wc:bv,xc:mv,tc:wv,Sf:em,cg:zy,we:S0,nc:Bv,fd:Cb,Ef:_m,Ke:c0,yf:wm,We:qm,Xe:Km,wg:Iy,tg:Dy,Rf:im,Eg:yy,Re:e0,nf:Em,Fd:db,yc:yv,Ze:Ym,Bc:hv,Hd:lb,Ye:Gm,Cd:pb,Dc:dv,Gc:cv,Vc:qb,mf:Om,ff:Nm,Td:Z0,Ud:X0,Hc:av,af:zm,ye:g0,kf:Mm,Kf:lm,Cf:mm,Zb:Nv,Cc:fv,_b:Lv,ef:Pm,Bd:_b,Ec:uv,zf:gm,Qc:Zb,Fb:rg,me:E0,Zc:$b,Bb:ag,ob:gg,Rd:tb,Gb:ig,pb:vg,sg:By,cd:Pb,oc:Dv,qb:bg,dd:Nb,ic:Ev,Ic:ov,_c:Wb,uc:gv,l:Mp,Ng:py,Rg:iy,Va:ry,h:Lp,G:c_,Ha:k_,K:j_,wa:Z_,Ua:ny,Mg:_y,Y:a_,N:A_,xa:X_,e:Rp,Ca:Gp,db:D_,f:Hp,Pg:ay,i:Yp,m:s_,n:r_,y:Zp,t:h_,P:m_,M:e_,aa:p_,Ia:I_,ea:R_,ta:i_,gg:Ny,lf:Um,qf:Am,Jc:sv,Pc:Qb,ne:k0,Af:vm,Ce:y0,Je:l0,tf:Dm,$c:zb,bf:Hm,ie:R0,Xb:Vv,ug:jy,Bf:bm,Dd:hb,Pb:Kv,fc:Mv,gc:Uv,ad:Hb,id:Ub,re:B0,Ld:sb,Uc:Jb,_d:Y0,ce:H0,Eb:ng,hg:Ly,yg:wy,fa:Jm,tb:_g,Qf:rm,uf:jm,vf:Tm,Fc:lv,dc:Rv,be:z0,gf:Lm,oe:x0,he:C0,Sd:Q0,je:M0,Qb:Gv,$f:Yy,Xc:Gb,Wc:Kb,Ed:fb,bg:Wy,yb:ug,dg:Hy,pd:Bb,xg:Sy,Mc:iv,Zf:Ky,Bg:by,jg:Ry,gd:Rb,Lf:cm,qe:F0,pe:A0,Tb:Wv,Wb:Hv,jd:Ob,fg:Py,Ob:qv,ae:W0,nd:Ab,qd:Db,cf:Vm,Dg:my,ke:U0,Gd:ub,kd:Eb,_f:Gy,ag:$y,Db:sg,od:Fb,Cb:og,rg:Fy,kg:My,Yf:qy,Ne:s0,ng:Ey,Ge:f0,Fe:h0,ze:v0,Ab:cg,zb:lg,Nb:Jv,ee:P0,Tf:tm,mc:Fv,qc:Tv,eg:Vy,Pd:ib,Yb:Pv,Te:Qm,$e:Wm,fe:N0,pc:jv,Pf:nm,_e:$m,Gf:hm,cc:Cv,ed:Lb,Df:ym,De:_0,hc:Ov,Nc:ev,jf:Rm,hf:Cm,z:kh,V:Rh},K=Vd(),ol=r._main=(n,s)=>(ol=r._main=K.xh)(n,s),Wh=r._duckdb_web_fs_glob_add_path=n=>(Wh=r._duckdb_web_fs_glob_add_path=K.zh)(n),$h=r._duckdb_web_clear_response=()=>($h=r._duckdb_web_clear_response=K.Ah)(),Yh=r._duckdb_web_fail_with=n=>(Yh=r._duckdb_web_fail_with=K.Bh)(n),Gh=r._duckdb_web_reset=n=>(Gh=r._duckdb_web_reset=K.Ch)(n),Kh=r._duckdb_web_connect=()=>(Kh=r._duckdb_web_connect=K.Dh)(),qh=r._duckdb_web_disconnect=n=>(qh=r._duckdb_web_disconnect=K.Eh)(n),Jh=r._duckdb_web_flush_files=()=>(Jh=r._duckdb_web_flush_files=K.Fh)(),Xh=r._duckdb_web_flush_file=n=>(Xh=r._duckdb_web_flush_file=K.Gh)(n),Zh=r._duckdb_web_open=(n,s)=>(Zh=r._duckdb_web_open=K.Hh)(n,s),Qh=r._duckdb_web_get_global_file_info=(n,s)=>(Qh=r._duckdb_web_get_global_file_info=K.Ih)(n,s),tp=r._duckdb_web_collect_file_stats=(n,s,o)=>(tp=r._duckdb_web_collect_file_stats=K.Jh)(n,s,o),ep=r._duckdb_web_export_file_stats=(n,s)=>(ep=r._duckdb_web_export_file_stats=K.Kh)(n,s),ip=r._duckdb_web_fs_drop_file=(n,s)=>(ip=r._duckdb_web_fs_drop_file=K.Lh)(n,s),rp=r._duckdb_web_fs_drop_files=(n,s,o)=>(rp=r._duckdb_web_fs_drop_files=K.Mh)(n,s,o),np=r._duckdb_web_fs_glob_file_infos=(n,s)=>(np=r._duckdb_web_fs_glob_file_infos=K.Nh)(n,s),sp=r._duckdb_web_fs_get_file_info_by_id=(n,s,o)=>(sp=r._duckdb_web_fs_get_file_info_by_id=K.Oh)(n,s,o),op=r._duckdb_web_fs_get_file_info_by_name=(n,s,o)=>(op=r._duckdb_web_fs_get_file_info_by_name=K.Ph)(n,s,o),ap=r._duckdb_web_fs_register_file_url=(n,s,o,a,l)=>(ap=r._duckdb_web_fs_register_file_url=K.Qh)(n,s,o,a,l),cp=r._duckdb_web_fs_register_file_buffer=(n,s,o,a)=>(cp=r._duckdb_web_fs_register_file_buffer=K.Rh)(n,s,o,a),lp=r._duckdb_web_copy_file_to_buffer=(n,s)=>(lp=r._duckdb_web_copy_file_to_buffer=K.Sh)(n,s),up=r._duckdb_web_copy_file_to_path=(n,s,o)=>(up=r._duckdb_web_copy_file_to_path=K.Th)(n,s,o),dp=r._duckdb_web_get_version=n=>(dp=r._duckdb_web_get_version=K.Uh)(n),fp=r._duckdb_web_get_feature_flags=()=>(fp=r._duckdb_web_get_feature_flags=K.Vh)(),hp=r._duckdb_web_tokenize=(n,s)=>(hp=r._duckdb_web_tokenize=K.Wh)(n,s),pp=r._duckdb_web_tokenize_buffer=(n,s,o)=>(pp=r._duckdb_web_tokenize_buffer=K.Xh)(n,s,o),_p=r._duckdb_web_udf_scalar_create=(n,s,o)=>(_p=r._duckdb_web_udf_scalar_create=K.Yh)(n,s,o),yp=r._duckdb_web_prepared_create=(n,s,o)=>(yp=r._duckdb_web_prepared_create=K.Zh)(n,s,o),mp=r._duckdb_web_prepared_create_buffer=(n,s,o,a)=>(mp=r._duckdb_web_prepared_create_buffer=K._h)(n,s,o,a),bp=r._duckdb_web_prepared_close=(n,s,o)=>(bp=r._duckdb_web_prepared_close=K.$h)(n,s,o),vp=r._duckdb_web_prepared_run=(n,s,o,a)=>(vp=r._duckdb_web_prepared_run=K.ai)(n,s,o,a),gp=r._duckdb_web_prepared_send=(n,s,o,a)=>(gp=r._duckdb_web_prepared_send=K.bi)(n,s,o,a),wp=r._duckdb_web_query_run=(n,s,o)=>(wp=r._duckdb_web_query_run=K.ci)(n,s,o),Sp=r._duckdb_web_query_run_buffer=(n,s,o,a)=>(Sp=r._duckdb_web_query_run_buffer=K.di)(n,s,o,a),Ip=r._duckdb_web_pending_query_start=(n,s,o,a)=>(Ip=r._duckdb_web_pending_query_start=K.ei)(n,s,o,a),Tp=r._duckdb_web_pending_query_start_buffer=(n,s,o,a,l)=>(Tp=r._duckdb_web_pending_query_start_buffer=K.fi)(n,s,o,a,l),jp=r._duckdb_web_pending_query_poll=(n,s,o)=>(jp=r._duckdb_web_pending_query_poll=K.gi)(n,s,o),Dp=r._duckdb_web_pending_query_cancel=(n,s)=>(Dp=r._duckdb_web_pending_query_cancel=K.hi)(n,s),Bp=r._duckdb_web_query_fetch_results=(n,s)=>(Bp=r._duckdb_web_query_fetch_results=K.ii)(n,s),Fp=r._duckdb_web_get_tablenames=(n,s,o)=>(Fp=r._duckdb_web_get_tablenames=K.ji)(n,s,o),Ap=r._duckdb_web_get_tablenames_buffer=(n,s,o,a)=>(Ap=r._duckdb_web_get_tablenames_buffer=K.ki)(n,s,o,a),xp=r._duckdb_web_insert_arrow_from_ipc_stream=(n,s,o,a,l)=>(xp=r._duckdb_web_insert_arrow_from_ipc_stream=K.li)(n,s,o,a,l),kp=r._duckdb_web_insert_csv_from_path=(n,s,o,a)=>(kp=r._duckdb_web_insert_csv_from_path=K.mi)(n,s,o,a),Ep=r._duckdb_web_insert_json_from_path=(n,s,o,a)=>(Ep=r._duckdb_web_insert_json_from_path=K.ni)(n,s,o,a),hi=r._malloc=n=>(hi=r._malloc=K.ri)(n),Op=r._free=n=>(Op=r._free=K.si)(n),Up=r._calloc=(n,s)=>(Up=r._calloc=K.ti)(n,s),al=n=>(al=K.vi)(n),cl=()=>(cl=K.wi)(),ll=n=>(ll=K.xi)(n),ul=n=>(ul=K.yi)(n),dl=()=>(dl=K.zi)();function Mp(n){var s=S();try{L(n)()}catch(o){if(w(s),o!==o+0)throw o;_setThrew(1,0)}}function Rp(n,s,o){var a=S();try{L(n)(s,o)}catch(l){if(w(a),l!==l+0)throw l;_setThrew(1,0)}}function Cp(n,s){var o=S();try{return L(n)(s)}catch(a){if(w(o),a!==a+0)throw a;_setThrew(1,0)}}function Lp(n,s){var o=S();try{L(n)(s)}catch(a){if(w(o),a!==a+0)throw a;_setThrew(1,0)}}function Np(n,s,o){var a=S();try{return L(n)(s,o)}catch(l){if(w(a),l!==l+0)throw l;_setThrew(1,0)}}function Pp(n,s,o,a){var l=S();try{return L(n)(s,o,a)}catch(u){if(w(l),u!==u+0)throw u;_setThrew(1,0)}}function Vp(n,s,o,a,l,u){var d=S();try{return L(n)(s,o,a,l,u)}catch(h){if(w(d),h!==h+0)throw h;_setThrew(1,0)}}function Hp(n,s,o,a){var l=S();try{L(n)(s,o,a)}catch(u){if(w(l),u!==u+0)throw u;_setThrew(1,0)}}function zp(n,s,o,a,l){var u=S();try{return L(n)(s,o,a,l)}catch(d){if(w(u),d!==d+0)throw d;_setThrew(1,0)}}function Wp(n,s,o,a){var l=S();try{return L(n)(s,o,a)}catch(u){if(w(l),u!==u+0)throw u;_setThrew(1,0)}}function $p(n,s,o,a){var l=S();try{return L(n)(s,o,a)}catch(u){if(w(l),u!==u+0)throw u;_setThrew(1,0)}}function Yp(n,s,o,a,l){var u=S();try{L(n)(s,o,a,l)}catch(d){if(w(u),d!==d+0)throw d;_setThrew(1,0)}}function Gp(n,s,o,a){var l=S();try{L(n)(s,o,a)}catch(u){if(w(l),u!==u+0)throw u;_setThrew(1,0)}}function Kp(n,s,o,a,l,u,d,h){var p=S();try{return L(n)(s,o,a,l,u,d,h)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function qp(n,s,o,a,l,u,d,h,p,y,m){var v=S();try{return L(n)(s,o,a,l,u,d,h,p,y,m)}catch(I){if(w(v),I!==I+0)throw I;_setThrew(1,0)}}function Jp(n,s,o,a,l,u,d,h,p,y,m,v,I){var B=S();try{return L(n)(s,o,a,l,u,d,h,p,y,m,v,I)}catch(F){if(w(B),F!==F+0)throw F;_setThrew(1,0)}}function Xp(n){var s=S();try{return L(n)()}catch(o){if(w(s),o!==o+0)throw o;_setThrew(1,0)}}function Zp(n,s,o,a,l,u,d,h){var p=S();try{L(n)(s,o,a,l,u,d,h)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function Qp(n,s,o,a,l,u,d){var h=S();try{return L(n)(s,o,a,l,u,d)}catch(p){if(w(h),p!==p+0)throw p;_setThrew(1,0)}}function t_(n,s,o,a,l,u,d,h,p,y,m,v){var I=S();try{return L(n)(s,o,a,l,u,d,h,p,y,m,v)}catch(B){if(w(I),B!==B+0)throw B;_setThrew(1,0)}}function e_(n,s,o,a,l,u,d,h,p,y,m){var v=S();try{L(n)(s,o,a,l,u,d,h,p,y,m)}catch(I){if(w(v),I!==I+0)throw I;_setThrew(1,0)}}function i_(n,s,o,a,l,u,d,h,p,y,m,v,I,B,F,A){var $=S();try{L(n)(s,o,a,l,u,d,h,p,y,m,v,I,B,F,A)}catch(yt){if(w($),yt!==yt+0)throw yt;_setThrew(1,0)}}function r_(n,s,o,a,l,u,d){var h=S();try{L(n)(s,o,a,l,u,d)}catch(p){if(w(h),p!==p+0)throw p;_setThrew(1,0)}}function n_(n,s,o,a,l,u){var d=S();try{return L(n)(s,o,a,l,u)}catch(h){if(w(d),h!==h+0)throw h;_setThrew(1,0)}}function s_(n,s,o,a,l,u){var d=S();try{L(n)(s,o,a,l,u)}catch(h){if(w(d),h!==h+0)throw h;_setThrew(1,0)}}function o_(n,s,o,a,l,u,d,h,p,y,m,v,I,B){var F=S();try{return L(n)(s,o,a,l,u,d,h,p,y,m,v,I,B)}catch(A){if(w(F),A!==A+0)throw A;_setThrew(1,0)}}function a_(n,s,o){var a=S();try{L(n)(s,o)}catch(l){if(w(a),l!==l+0)throw l;_setThrew(1,0)}}function c_(n,s,o){var a=S();try{L(n)(s,o)}catch(l){if(w(a),l!==l+0)throw l;_setThrew(1,0)}}function l_(n,s,o,a,l,u,d,h,p,y){var m=S();try{return L(n)(s,o,a,l,u,d,h,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function u_(n,s,o,a,l,u,d,h,p){var y=S();try{return L(n)(s,o,a,l,u,d,h,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function d_(n,s){var o=S();try{return L(n)(s)}catch(a){if(w(o),a!==a+0)throw a;_setThrew(1,0)}}function f_(n,s,o,a,l){var u=S();try{return L(n)(s,o,a,l)}catch(d){if(w(u),d!==d+0)throw d;_setThrew(1,0)}}function h_(n,s,o,a,l,u,d,h,p){var y=S();try{L(n)(s,o,a,l,u,d,h,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function p_(n,s,o,a,l,u,d,h,p,y,m,v){var I=S();try{L(n)(s,o,a,l,u,d,h,p,y,m,v)}catch(B){if(w(I),B!==B+0)throw B;_setThrew(1,0)}}function __(n,s){var o=S();try{return L(n)(s)}catch(a){if(w(o),a!==a+0)throw a;_setThrew(1,0)}}function y_(n,s){var o=S();try{return L(n)(s)}catch(a){if(w(o),a!==a+0)throw a;_setThrew(1,0)}}function m_(n,s,o,a,l,u,d,h,p,y){var m=S();try{L(n)(s,o,a,l,u,d,h,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function b_(n,s){var o=S();try{return L(n)(s)}catch(a){if(w(o),a!==a+0)throw a;_setThrew(1,0)}}function v_(n,s,o,a,l,u,d,h,p,y,m,v,I,B,F,A,$,yt){var x=S();try{return L(n)(s,o,a,l,u,d,h,p,y,m,v,I,B,F,A,$,yt)}catch(H){if(w(x),H!==H+0)throw H;_setThrew(1,0)}}function g_(n,s,o,a,l,u,d,h,p,y,m,v,I,B,F,A,$){var yt=S();try{return L(n)(s,o,a,l,u,d,h,p,y,m,v,I,B,F,A,$)}catch(x){if(w(yt),x!==x+0)throw x;_setThrew(1,0)}}function w_(n,s,o,a){var l=S();try{return L(n)(s,o,a)}catch(u){if(w(l),u!==u+0)throw u;_setThrew(1,0)}}function S_(n,s,o,a,l){var u=S();try{return L(n)(s,o,a,l)}catch(d){if(w(u),d!==d+0)throw d;_setThrew(1,0)}}function I_(n,s,o,a,l,u,d,h,p,y,m,v,I){var B=S();try{L(n)(s,o,a,l,u,d,h,p,y,m,v,I)}catch(F){if(w(B),F!==F+0)throw F;_setThrew(1,0)}}function T_(n,s,o){var a=S();try{return L(n)(s,o)}catch(l){if(w(a),l!==l+0)throw l;_setThrew(1,0)}}function j_(n,s,o,a){var l=S();try{L(n)(s,o,a)}catch(u){if(w(l),u!==u+0)throw u;_setThrew(1,0)}}function D_(n,s,o,a,l,u,d,h,p,y,m){var v=S();try{L(n)(s,o,a,l,u,d,h,p,y,m)}catch(I){if(w(v),I!==I+0)throw I;_setThrew(1,0)}}function B_(n,s,o,a,l){var u=S();try{return L(n)(s,o,a,l)}catch(d){if(w(u),d!==d+0)throw d;_setThrew(1,0)}}function F_(n,s,o,a,l,u,d){var h=S();try{return L(n)(s,o,a,l,u,d)}catch(p){if(w(h),p!==p+0)throw p;_setThrew(1,0)}}function A_(n,s,o,a){var l=S();try{L(n)(s,o,a)}catch(u){if(w(l),u!==u+0)throw u;_setThrew(1,0)}}function x_(n,s){var o=S();try{return L(n)(s)}catch(a){if(w(o),a!==a+0)throw a;_setThrew(1,0)}}function k_(n,s,o,a,l,u,d){var h=S();try{L(n)(s,o,a,l,u,d)}catch(p){if(w(h),p!==p+0)throw p;_setThrew(1,0)}}function E_(n,s,o,a,l,u){var d=S();try{return L(n)(s,o,a,l,u)}catch(h){if(w(d),h!==h+0)throw h;_setThrew(1,0)}}function O_(n,s,o,a,l,u,d){var h=S();try{return L(n)(s,o,a,l,u,d)}catch(p){if(w(h),p!==p+0)throw p;_setThrew(1,0)}}function U_(n,s,o,a,l){var u=S();try{return L(n)(s,o,a,l)}catch(d){if(w(u),d!==d+0)throw d;_setThrew(1,0)}}function M_(n,s,o,a){var l=S();try{return L(n)(s,o,a)}catch(u){if(w(l),u!==u+0)throw u;_setThrew(1,0)}}function R_(n,s,o,a,l,u,d,h,p,y,m,v,I,B){var F=S();try{L(n)(s,o,a,l,u,d,h,p,y,m,v,I,B)}catch(A){if(w(F),A!==A+0)throw A;_setThrew(1,0)}}function C_(n,s,o){var a=S();try{return L(n)(s,o)}catch(l){if(w(a),l!==l+0)throw l;_setThrew(1,0)}}function L_(n,s,o,a){var l=S();try{return L(n)(s,o,a)}catch(u){if(w(l),u!==u+0)throw u;_setThrew(1,0)}}function N_(n,s){var o=S();try{return L(n)(s)}catch(a){if(w(o),a!==a+0)throw a;_setThrew(1,0)}}function P_(n,s,o,a){var l=S();try{return L(n)(s,o,a)}catch(u){if(w(l),u!==u+0)throw u;_setThrew(1,0)}}function V_(n,s,o){var a=S();try{return L(n)(s,o)}catch(l){if(w(a),l!==l+0)throw l;_setThrew(1,0)}}function H_(n,s,o){var a=S();try{return L(n)(s,o)}catch(l){if(w(a),l!==l+0)throw l;_setThrew(1,0)}}function z_(n,s,o,a,l,u){var d=S();try{return L(n)(s,o,a,l,u)}catch(h){if(w(d),h!==h+0)throw h;_setThrew(1,0)}}function W_(n,s,o){var a=S();try{return L(n)(s,o)}catch(l){if(w(a),l!==l+0)throw l;_setThrew(1,0)}}function $_(n,s,o){var a=S();try{return L(n)(s,o)}catch(l){if(w(a),l!==l+0)throw l;_setThrew(1,0)}}function Y_(n,s,o){var a=S();try{return L(n)(s,o)}catch(l){if(w(a),l!==l+0)throw l;_setThrew(1,0)}}function G_(n,s,o,a){var l=S();try{return L(n)(s,o,a)}catch(u){if(w(l),u!==u+0)throw u;_setThrew(1,0)}}function K_(n,s,o,a,l,u){var d=S();try{return L(n)(s,o,a,l,u)}catch(h){if(w(d),h!==h+0)throw h;_setThrew(1,0)}}function q_(n,s,o,a,l,u,d){var h=S();try{return L(n)(s,o,a,l,u,d)}catch(p){if(w(h),p!==p+0)throw p;_setThrew(1,0)}}function J_(n,s,o,a,l){var u=S();try{return L(n)(s,o,a,l)}catch(d){if(w(u),d!==d+0)throw d;_setThrew(1,0)}}function X_(n,s,o,a,l){var u=S();try{L(n)(s,o,a,l)}catch(d){if(w(u),d!==d+0)throw d;_setThrew(1,0)}}function Z_(n,s,o,a,l){var u=S();try{L(n)(s,o,a,l)}catch(d){if(w(u),d!==d+0)throw d;_setThrew(1,0)}}function Q_(n,s,o,a,l){var u=S();try{return L(n)(s,o,a,l)}catch(d){if(w(u),d!==d+0)throw d;_setThrew(1,0)}}function ty(n,s,o,a,l,u,d){var h=S();try{return L(n)(s,o,a,l,u,d)}catch(p){if(w(h),p!==p+0)throw p;_setThrew(1,0)}}function ey(n){var s=S();try{return L(n)()}catch(o){if(w(s),o!==o+0)throw o;_setThrew(1,0)}}function iy(n,s,o,a,l,u,d){var h=S();try{L(n)(s,o,a,l,u,d)}catch(p){if(w(h),p!==p+0)throw p;_setThrew(1,0)}}function ry(n,s,o,a,l,u,d,h){var p=S();try{L(n)(s,o,a,l,u,d,h)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function ny(n,s,o,a,l,u,d){var h=S();try{L(n)(s,o,a,l,u,d)}catch(p){if(w(h),p!==p+0)throw p;_setThrew(1,0)}}function sy(n,s,o,a,l,u){var d=S();try{return L(n)(s,o,a,l,u)}catch(h){if(w(d),h!==h+0)throw h;_setThrew(1,0)}}function oy(n,s,o,a,l,u,d){var h=S();try{return L(n)(s,o,a,l,u,d)}catch(p){if(w(h),p!==p+0)throw p;_setThrew(1,0)}}function ay(n,s,o,a,l,u){var d=S();try{L(n)(s,o,a,l,u)}catch(h){if(w(d),h!==h+0)throw h;_setThrew(1,0)}}function cy(n,s,o,a,l,u,d){var h=S();try{return L(n)(s,o,a,l,u,d)}catch(p){if(w(h),p!==p+0)throw p;_setThrew(1,0)}}function ly(n,s,o,a,l,u,d,h){var p=S();try{return L(n)(s,o,a,l,u,d,h)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function uy(n,s,o,a,l,u,d,h,p,y){var m=S();try{return L(n)(s,o,a,l,u,d,h,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function dy(n,s,o,a,l,u,d,h,p){var y=S();try{return L(n)(s,o,a,l,u,d,h,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function fy(n,s,o,a,l,u,d){var h=S();try{return L(n)(s,o,a,l,u,d)}catch(p){if(w(h),p!==p+0)throw p;_setThrew(1,0)}}function hy(n,s,o,a,l,u,d,h,p,y,m,v,I,B,F,A){var $=S();try{return L(n)(s,o,a,l,u,d,h,p,y,m,v,I,B,F,A)}catch(yt){if(w($),yt!==yt+0)throw yt;_setThrew(1,0)}}function py(n,s,o,a,l,u){var d=S();try{L(n)(s,o,a,l,u)}catch(h){if(w(d),h!==h+0)throw h;_setThrew(1,0)}}function _y(n,s,o,a,l,u,d,h){var p=S();try{L(n)(s,o,a,l,u,d,h)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function yy(n,s,o,a,l){var u=S();try{return dynCall_jiiii(n,s,o,a,l)}catch(d){if(w(u),d!==d+0)throw d;_setThrew(1,0)}}function my(n,s,o,a,l,u,d){var h=S();try{dynCall_viijj(n,s,o,a,l,u,d)}catch(p){if(w(h),p!==p+0)throw p;_setThrew(1,0)}}function by(n,s,o,a,l,u,d){var h=S();try{dynCall_viijii(n,s,o,a,l,u,d)}catch(p){if(w(h),p!==p+0)throw p;_setThrew(1,0)}}function vy(n,s,o,a,l,u,d){var h=S();try{return dynCall_iiiiij(n,s,o,a,l,u,d)}catch(p){if(w(h),p!==p+0)throw p;_setThrew(1,0)}}function gy(n,s,o,a,l,u,d,h,p){var y=S();try{return dynCall_iiiiijj(n,s,o,a,l,u,d,h,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function wy(n,s,o,a,l,u){var d=S();try{dynCall_viiij(n,s,o,a,l,u)}catch(h){if(w(d),h!==h+0)throw h;_setThrew(1,0)}}function Sy(n,s,o,a,l){var u=S();try{dynCall_viij(n,s,o,a,l)}catch(d){if(w(u),d!==d+0)throw d;_setThrew(1,0)}}function Iy(n,s){var o=S();try{return dynCall_ji(n,s)}catch(a){if(w(o),a!==a+0)throw a;_setThrew(1,0)}}function Ty(n,s,o,a){var l=S();try{return dynCall_iij(n,s,o,a)}catch(u){if(w(l),u!==u+0)throw u;_setThrew(1,0)}}function jy(n,s,o,a,l,u,d){var h=S();try{dynCall_viiiij(n,s,o,a,l,u,d)}catch(p){if(w(h),p!==p+0)throw p;_setThrew(1,0)}}function Dy(n,s,o){var a=S();try{return dynCall_jii(n,s,o)}catch(l){if(w(a),l!==l+0)throw l;_setThrew(1,0)}}function By(n,s,o){var a=S();try{return dynCall_jj(n,s,o)}catch(l){if(w(a),l!==l+0)throw l;_setThrew(1,0)}}function Fy(n,s,o,a){var l=S();try{dynCall_vij(n,s,o,a)}catch(u){if(w(l),u!==u+0)throw u;_setThrew(1,0)}}function Ay(n,s,o,a,l,u){var d=S();try{return dynCall_iiiij(n,s,o,a,l,u)}catch(h){if(w(d),h!==h+0)throw h;_setThrew(1,0)}}function xy(n,s,o,a,l){var u=S();try{return dynCall_iiij(n,s,o,a,l)}catch(d){if(w(u),d!==d+0)throw d;_setThrew(1,0)}}function ky(n,s,o,a,l,u,d,h){var p=S();try{return dynCall_iiijij(n,s,o,a,l,u,d,h)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function Ey(n,s,o,a,l,u,d,h){var p=S();try{dynCall_vijiiii(n,s,o,a,l,u,d,h)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function Oy(n,s,o,a,l){var u=S();try{return dynCall_iiji(n,s,o,a,l)}catch(d){if(w(u),d!==d+0)throw d;_setThrew(1,0)}}function Uy(n,s,o,a,l,u){var d=S();try{return dynCall_iiiji(n,s,o,a,l,u)}catch(h){if(w(d),h!==h+0)throw h;_setThrew(1,0)}}function My(n,s,o,a,l){var u=S();try{dynCall_viji(n,s,o,a,l)}catch(d){if(w(u),d!==d+0)throw d;_setThrew(1,0)}}function Ry(n,s,o,a,l,u,d,h){var p=S();try{dynCall_viijiii(n,s,o,a,l,u,d,h)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function Cy(n,s,o,a,l,u){var d=S();try{return dynCall_iijj(n,s,o,a,l,u)}catch(h){if(w(d),h!==h+0)throw h;_setThrew(1,0)}}function Ly(n,s,o,a,l,u,d,h,p,y,m,v,I){var B=S();try{dynCall_viiiijjjii(n,s,o,a,l,u,d,h,p,y,m,v,I)}catch(F){if(w(B),F!==F+0)throw F;_setThrew(1,0)}}function Ny(n,s,o,a,l,u,d,h,p,y){var m=S();try{dynCall_viiiiiiij(n,s,o,a,l,u,d,h,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function Py(n,s,o,a,l,u,d,h){var p=S();try{dynCall_viijij(n,s,o,a,l,u,d,h)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function Vy(n,s,o,a,l,u,d,h,p){var y=S();try{dynCall_vijijj(n,s,o,a,l,u,d,h,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function Hy(n,s,o,a,l,u,d,h,p,y,m,v){var I=S();try{dynCall_viiijjjj(n,s,o,a,l,u,d,h,p,y,m,v)}catch(B){if(w(I),B!==B+0)throw B;_setThrew(1,0)}}function zy(n,s,o,a){var l=S();try{return dynCall_iji(n,s,o,a)}catch(u){if(w(l),u!==u+0)throw u;_setThrew(1,0)}}function Wy(n,s,o,a,l,u,d,h,p,y){var m=S();try{dynCall_viiijjj(n,s,o,a,l,u,d,h,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function $y(n,s,o,a,l,u,d,h,p,y){var m=S();try{dynCall_viijjji(n,s,o,a,l,u,d,h,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function Yy(n,s,o,a,l,u,d,h){var p=S();try{dynCall_viiijj(n,s,o,a,l,u,d,h)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function Gy(n,s,o,a,l,u,d,h,p){var y=S();try{dynCall_viijjj(n,s,o,a,l,u,d,h,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function Ky(n,s,o,a,l,u){var d=S();try{dynCall_viiji(n,s,o,a,l,u)}catch(h){if(w(d),h!==h+0)throw h;_setThrew(1,0)}}function qy(n,s,o,a,l,u){var d=S();try{dynCall_vijii(n,s,o,a,l,u)}catch(h){if(w(d),h!==h+0)throw h;_setThrew(1,0)}}function Jy(n,s,o,a,l,u,d){var h=S();try{return dynCall_iijiii(n,s,o,a,l,u,d)}catch(p){if(w(h),p!==p+0)throw p;_setThrew(1,0)}}function Xy(n,s,o,a,l,u,d,h,p,y){var m=S();try{return dynCall_iiiijjj(n,s,o,a,l,u,d,h,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function Zy(n,s,o,a,l,u,d,h){var p=S();try{return dynCall_iiijiii(n,s,o,a,l,u,d,h)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function Qy(n,s,o,a,l,u){var d=S();try{return dynCall_iijii(n,s,o,a,l,u)}catch(h){if(w(d),h!==h+0)throw h;_setThrew(1,0)}}function tm(n,s,o,a,l,u,d,h,p){var y=S();try{dynCall_vijiiji(n,s,o,a,l,u,d,h,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function em(n,s,o){var a=S();try{return dynCall_ij(n,s,o)}catch(l){if(w(a),l!==l+0)throw l;_setThrew(1,0)}}function im(n,s,o,a){var l=S();try{return dynCall_jiii(n,s,o,a)}catch(u){if(w(l),u!==u+0)throw u;_setThrew(1,0)}}function rm(n,s,o,a,l,u,d){var h=S();try{dynCall_viiiji(n,s,o,a,l,u,d)}catch(p){if(w(h),p!==p+0)throw p;_setThrew(1,0)}}function nm(n,s,o,a,l,u,d,h){var p=S();try{dynCall_vijjj(n,s,o,a,l,u,d,h)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function sm(n,s,o,a,l,u,d){var h=S();try{return dynCall_iijij(n,s,o,a,l,u,d)}catch(p){if(w(h),p!==p+0)throw p;_setThrew(1,0)}}function om(n,s,o,a,l,u,d,h,p){var y=S();try{return dynCall_iiiiijii(n,s,o,a,l,u,d,h,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function am(n,s,o,a,l,u,d,h,p,y){var m=S();try{return dynCall_iiiiiijii(n,s,o,a,l,u,d,h,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function cm(n,s,o,a,l,u,d,h,p,y){var m=S();try{dynCall_viijiiiii(n,s,o,a,l,u,d,h,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function lm(n,s,o,a,l,u){var d=S();try{return dynCall_jiiji(n,s,o,a,l,u)}catch(h){if(w(d),h!==h+0)throw h;_setThrew(1,0)}}function um(n,s,o,a,l,u){var d=S();try{return dynCall_fiiji(n,s,o,a,l,u)}catch(h){if(w(d),h!==h+0)throw h;_setThrew(1,0)}}function dm(n,s,o,a,l,u){var d=S();try{return dynCall_diiji(n,s,o,a,l,u)}catch(h){if(w(d),h!==h+0)throw h;_setThrew(1,0)}}function fm(n,s,o,a,l,u,d,h,p,y){var m=S();try{return dynCall_iiiiijiii(n,s,o,a,l,u,d,h,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function hm(n,s,o){var a=S();try{dynCall_vj(n,s,o)}catch(l){if(w(a),l!==l+0)throw l;_setThrew(1,0)}}function pm(n,s,o,a,l,u,d){var h=S();try{return dynCall_iiijii(n,s,o,a,l,u,d)}catch(p){if(w(h),p!==p+0)throw p;_setThrew(1,0)}}function _m(n,s,o,a,l,u,d,h){var p=S();try{return dynCall_ijjiii(n,s,o,a,l,u,d,h)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function ym(n,s,o,a,l,u,d){var h=S();try{dynCall_vjiiii(n,s,o,a,l,u,d)}catch(p){if(w(h),p!==p+0)throw p;_setThrew(1,0)}}function mm(n,s,o,a,l,u,d){var h=S();try{return dynCall_jiijii(n,s,o,a,l,u,d)}catch(p){if(w(h),p!==p+0)throw p;_setThrew(1,0)}}function bm(n,s,o,a,l,u,d,h){var p=S();try{dynCall_viiiiji(n,s,o,a,l,u,d,h)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function vm(n,s,o,a,l,u,d,h){var p=S();try{dynCall_viiiiij(n,s,o,a,l,u,d,h)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function gm(n,s,o,a){var l=S();try{return dynCall_jij(n,s,o,a)}catch(u){if(w(l),u!==u+0)throw u;_setThrew(1,0)}}function wm(n){var s=S();try{return dynCall_j(n)}catch(o){if(w(s),o!==o+0)throw o;_setThrew(1,0)}}function Sm(n,s,o,a,l,u,d){var h=S();try{return dynCall_iiijj(n,s,o,a,l,u,d)}catch(p){if(w(h),p!==p+0)throw p;_setThrew(1,0)}}function Im(n,s,o,a,l,u,d,h){var p=S();try{return dynCall_iiijji(n,s,o,a,l,u,d,h)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function Tm(n,s,o,a,l,u,d,h,p){var y=S();try{dynCall_viiijiii(n,s,o,a,l,u,d,h,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function jm(n,s,o,a,l,u,d,h){var p=S();try{dynCall_viiijii(n,s,o,a,l,u,d,h)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function Dm(n,s,o,a,l,u,d,h,p,y,m){var v=S();try{dynCall_viiiiijiii(n,s,o,a,l,u,d,h,p,y,m)}catch(I){if(w(v),I!==I+0)throw I;_setThrew(1,0)}}function Bm(n,s,o,a,l,u,d){var h=S();try{return dynCall_iiiiji(n,s,o,a,l,u,d)}catch(p){if(w(h),p!==p+0)throw p;_setThrew(1,0)}}function Fm(n,s,o,a,l,u,d,h,p){var y=S();try{return dynCall_iiiiiiji(n,s,o,a,l,u,d,h,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function Am(n,s,o,a,l,u,d,h,p){var y=S();try{dynCall_viiiiiij(n,s,o,a,l,u,d,h,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function xm(n,s,o,a,l,u,d,h){var p=S();try{return dynCall_iiiiiji(n,s,o,a,l,u,d,h)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function km(n,s,o,a,l,u,d,h,p,y,m){var v=S();try{return dynCall_iiiiijiiii(n,s,o,a,l,u,d,h,p,y,m)}catch(I){if(w(v),I!==I+0)throw I;_setThrew(1,0)}}function Em(n,s,o,a,l,u,d){var h=S();try{return dynCall_jiiiiii(n,s,o,a,l,u,d)}catch(p){if(w(h),p!==p+0)throw p;_setThrew(1,0)}}function Om(n,s,o,a,l,u){var d=S();try{return dynCall_jiiij(n,s,o,a,l,u)}catch(h){if(w(d),h!==h+0)throw h;_setThrew(1,0)}}function Um(n,s,o,a,l,u,d,h,p,y,m,v,I){var B=S();try{dynCall_viiiiiiijij(n,s,o,a,l,u,d,h,p,y,m,v,I)}catch(F){if(w(B),F!==F+0)throw F;_setThrew(1,0)}}function Mm(n,s,o,a,l){var u=S();try{return dynCall_jiij(n,s,o,a,l)}catch(d){if(w(u),d!==d+0)throw d;_setThrew(1,0)}}function Rm(n,s,o,a,l,u,d){var h=S();try{dynCall_vjjii(n,s,o,a,l,u,d)}catch(p){if(w(h),p!==p+0)throw p;_setThrew(1,0)}}function Cm(n,s,o,a,l,u,d,h,p,y,m){var v=S();try{dynCall_vjjijij(n,s,o,a,l,u,d,h,p,y,m)}catch(I){if(w(v),I!==I+0)throw I;_setThrew(1,0)}}function Lm(n,s,o,a,l,u,d,h,p,y,m,v,I){var B=S();try{dynCall_viiijiijij(n,s,o,a,l,u,d,h,p,y,m,v,I)}catch(F){if(w(B),F!==F+0)throw F;_setThrew(1,0)}}function Nm(n,s,o,a,l,u,d){var h=S();try{return dynCall_jiiiji(n,s,o,a,l,u,d)}catch(p){if(w(h),p!==p+0)throw p;_setThrew(1,0)}}function Pm(n,s,o,a,l,u,d,h,p){var y=S();try{return dynCall_jiijiij(n,s,o,a,l,u,d,h,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function Vm(n,s,o,a,l,u,d,h,p,y){var m=S();try{dynCall_viijijj(n,s,o,a,l,u,d,h,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function Hm(n,s,o,a,l,u,d,h,p,y,m){var v=S();try{dynCall_viiiiijij(n,s,o,a,l,u,d,h,p,y,m)}catch(I){if(w(v),I!==I+0)throw I;_setThrew(1,0)}}function zm(n,s,o,a,l,u,d,h,p){var y=S();try{return dynCall_jiiijij(n,s,o,a,l,u,d,h,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function Wm(n,s,o,a,l,u,d){var h=S();try{dynCall_vijji(n,s,o,a,l,u,d)}catch(p){if(w(h),p!==p+0)throw p;_setThrew(1,0)}}function $m(n,s,o,a,l,u,d,h,p){var y=S();try{dynCall_vijjji(n,s,o,a,l,u,d,h,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function Ym(n,s,o,a,l,u,d,h,p){var y=S();try{return dynCall_jiiiiiji(n,s,o,a,l,u,d,h,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function Gm(n,s,o,a,l,u,d){var h=S();try{return dynCall_jiiiij(n,s,o,a,l,u,d)}catch(p){if(w(h),p!==p+0)throw p;_setThrew(1,0)}}function Km(n,s){var o=S();try{return dynCall_jf(n,s)}catch(a){if(w(o),a!==a+0)throw a;_setThrew(1,0)}}function qm(n,s){var o=S();try{return dynCall_jd(n,s)}catch(a){if(w(o),a!==a+0)throw a;_setThrew(1,0)}}function Jm(n,s,o,a,l,u,d){var h=S();try{dynCall_viiijd(n,s,o,a,l,u,d)}catch(p){if(w(h),p!==p+0)throw p;_setThrew(1,0)}}function Xm(n,s,o,a,l,u){var d=S();try{return dynCall_iiifj(n,s,o,a,l,u)}catch(h){if(w(d),h!==h+0)throw h;_setThrew(1,0)}}function Zm(n,s,o,a,l,u,d,h){var p=S();try{return dynCall_iiiiiij(n,s,o,a,l,u,d,h)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function Qm(n,s,o,a,l,u){var d=S();try{dynCall_vijj(n,s,o,a,l,u)}catch(h){if(w(d),h!==h+0)throw h;_setThrew(1,0)}}function t0(n,s,o,a,l,u,d,h){var p=S();try{return dynCall_iiiijj(n,s,o,a,l,u,d,h)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function e0(n,s,o,a,l,u){var d=S();try{return dynCall_jiiiii(n,s,o,a,l,u)}catch(h){if(w(d),h!==h+0)throw h;_setThrew(1,0)}}function i0(n,s,o,a,l,u,d,h){var p=S();try{return dynCall_iijiiii(n,s,o,a,l,u,d,h)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function r0(n,s,o,a,l,u,d){var h=S();try{return dynCall_iijji(n,s,o,a,l,u,d)}catch(p){if(w(h),p!==p+0)throw p;_setThrew(1,0)}}function n0(n,s,o,a,l,u,d,h,p,y){var m=S();try{return dynCall_iijjiiii(n,s,o,a,l,u,d,h,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function s0(n,s,o,a,l,u,d){var h=S();try{dynCall_vijiii(n,s,o,a,l,u,d)}catch(p){if(w(h),p!==p+0)throw p;_setThrew(1,0)}}function o0(n,s,o,a,l,u,d,h,p,y,m){var v=S();try{return dynCall_iijjiiiii(n,s,o,a,l,u,d,h,p,y,m)}catch(I){if(w(v),I!==I+0)throw I;_setThrew(1,0)}}function a0(n,s,o,a,l,u,d,h,p,y){var m=S();try{return dynCall_iiijjiii(n,s,o,a,l,u,d,h,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function c0(n,s,o,a,l,u,d){var h=S();try{return dynCall_ijjj(n,s,o,a,l,u,d)}catch(p){if(w(h),p!==p+0)throw p;_setThrew(1,0)}}function l0(n,s,o,a,l,u,d,h,p,y){var m=S();try{dynCall_viiiiijii(n,s,o,a,l,u,d,h,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function u0(n,s,o,a,l,u,d,h,p,y,m,v,I,B,F,A,$,yt,x,H,Tt,Nt){var Wi=S();try{return dynCall_iiiiiiiijjjjjjii(n,s,o,a,l,u,d,h,p,y,m,v,I,B,F,A,$,yt,x,H,Tt,Nt)}catch(pi){if(w(Wi),pi!==pi+0)throw pi;_setThrew(1,0)}}function d0(n,s,o,a,l,u,d,h,p,y,m,v){var I=S();try{return dynCall_iiiiiiiiiij(n,s,o,a,l,u,d,h,p,y,m,v)}catch(B){if(w(I),B!==B+0)throw B;_setThrew(1,0)}}function f0(n,s,o,a,l,u,d,h,p){var y=S();try{dynCall_vijiiiii(n,s,o,a,l,u,d,h,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function h0(n,s,o,a,l,u,d,h,p,y){var m=S();try{dynCall_vijiiiiii(n,s,o,a,l,u,d,h,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function p0(n,s,o,a,l,u,d,h,p){var y=S();try{return dynCall_iijiiiii(n,s,o,a,l,u,d,h,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function _0(n,s,o,a,l,u,d,h){var p=S();try{dynCall_vjiiij(n,s,o,a,l,u,d,h)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function y0(n,s,o,a,l,u,d,h,p){var y=S();try{dynCall_viiiiiji(n,s,o,a,l,u,d,h,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function m0(n,s,o,a,l,u,d,h,p,y,m,v){var I=S();try{return dynCall_iiiiijiiiii(n,s,o,a,l,u,d,h,p,y,m,v)}catch(B){if(w(I),B!==B+0)throw B;_setThrew(1,0)}}function b0(n,s,o,a,l,u,d,h){var p=S();try{return dynCall_iiiijii(n,s,o,a,l,u,d,h)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function v0(n,s,o,a,l,u,d,h,p,y,m){var v=S();try{dynCall_vijiiiiiii(n,s,o,a,l,u,d,h,p,y,m)}catch(I){if(w(v),I!==I+0)throw I;_setThrew(1,0)}}function g0(n,s,o,a,l,u,d,h){var p=S();try{return dynCall_jiiijj(n,s,o,a,l,u,d,h)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function w0(n,s,o,a,l,u,d,h,p,y,m){var v=S();try{return dynCall_iiiiiijji(n,s,o,a,l,u,d,h,p,y,m)}catch(I){if(w(v),I!==I+0)throw I;_setThrew(1,0)}}function S0(n,s,o,a,l){var u=S();try{return dynCall_ijii(n,s,o,a,l)}catch(d){if(w(u),d!==d+0)throw d;_setThrew(1,0)}}function I0(n,s,o,a,l){var u=S();try{return dynCall_iijf(n,s,o,a,l)}catch(d){if(w(u),d!==d+0)throw d;_setThrew(1,0)}}function T0(n,s,o,a,l,u,d,h,p,y,m,v,I,B,F,A,$){var yt=S();try{return dynCall_iiiiiijiijjji(n,s,o,a,l,u,d,h,p,y,m,v,I,B,F,A,$)}catch(x){if(w(yt),x!==x+0)throw x;_setThrew(1,0)}}function j0(n,s,o,a,l,u,d,h,p,y,m,v,I){var B=S();try{return dynCall_iiijjijiii(n,s,o,a,l,u,d,h,p,y,m,v,I)}catch(F){if(w(B),F!==F+0)throw F;_setThrew(1,0)}}function D0(n,s,o,a,l,u,d,h,p){var y=S();try{return dynCall_iiiijiii(n,s,o,a,l,u,d,h,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function B0(n,s,o,a,l,u,d,h,p,y){var m=S();try{dynCall_viiiijij(n,s,o,a,l,u,d,h,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function F0(n,s,o,a,l,u,d,h,p,y,m){var v=S();try{dynCall_viijiiiiii(n,s,o,a,l,u,d,h,p,y,m)}catch(I){if(w(v),I!==I+0)throw I;_setThrew(1,0)}}function A0(n,s,o,a,l,u,d,h,p,y){var m=S();try{dynCall_viijiiij(n,s,o,a,l,u,d,h,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function x0(n,s,o,a,l,u,d,h,p,y,m,v){var I=S();try{dynCall_viiijiijj(n,s,o,a,l,u,d,h,p,y,m,v)}catch(B){if(w(I),B!==B+0)throw B;_setThrew(1,0)}}function k0(n,s,o,a,l,u,d,h,p,y,m,v,I){var B=S();try{dynCall_viiiiiijjj(n,s,o,a,l,u,d,h,p,y,m,v,I)}catch(F){if(w(B),F!==F+0)throw F;_setThrew(1,0)}}function E0(n,s,o,a,l,u,d){var h=S();try{return dynCall_jijij(n,s,o,a,l,u,d)}catch(p){if(w(h),p!==p+0)throw p;_setThrew(1,0)}}function O0(n,s,o,a,l,u,d,h,p,y,m){var v=S();try{return dynCall_iiiiijjj(n,s,o,a,l,u,d,h,p,y,m)}catch(I){if(w(v),I!==I+0)throw I;_setThrew(1,0)}}function U0(n,s,o,a,l,u,d,h){var p=S();try{dynCall_viijji(n,s,o,a,l,u,d,h)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function M0(n,s,o,a,l,u,d,h,p,y,m){var v=S();try{dynCall_viiijijj(n,s,o,a,l,u,d,h,p,y,m)}catch(I){if(w(v),I!==I+0)throw I;_setThrew(1,0)}}function R0(n,s,o,a,l,u,d,h,p,y,m,v,I){var B=S();try{dynCall_viiiiijjij(n,s,o,a,l,u,d,h,p,y,m,v,I)}catch(F){if(w(B),F!==F+0)throw F;_setThrew(1,0)}}function C0(n,s,o,a,l,u,d,h,p){var y=S();try{dynCall_viiijij(n,s,o,a,l,u,d,h,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function L0(n,s,o,a,l,u,d,h,p,y){var m=S();try{return dynCall_iiiijiiii(n,s,o,a,l,u,d,h,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function N0(n,s,o,a,l,u,d,h,p){var y=S();try{dynCall_vijjiii(n,s,o,a,l,u,d,h,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function P0(n,s,o,a,l,u,d,h){var p=S();try{dynCall_vijiij(n,s,o,a,l,u,d,h)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function V0(n,s,o,a,l,u,d,h,p,y){var m=S();try{return dynCall_iiiiiiiij(n,s,o,a,l,u,d,h,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function H0(n,s,o,a,l,u,d,h,p,y,m,v){var I=S();try{dynCall_viiiijjij(n,s,o,a,l,u,d,h,p,y,m,v)}catch(B){if(w(I),B!==B+0)throw B;_setThrew(1,0)}}function z0(n,s,o,a,l,u,d,h,p,y,m,v,I){var B=S();try{dynCall_viiijiiijii(n,s,o,a,l,u,d,h,p,y,m,v,I)}catch(F){if(w(B),F!==F+0)throw F;_setThrew(1,0)}}function W0(n,s,o,a,l,u,d,h,p,y,m,v){var I=S();try{dynCall_viijijiiii(n,s,o,a,l,u,d,h,p,y,m,v)}catch(B){if(w(I),B!==B+0)throw B;_setThrew(1,0)}}function $0(n,s,o,a,l,u,d,h,p,y){var m=S();try{return dynCall_iiiiiiiji(n,s,o,a,l,u,d,h,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function Y0(n,s,o,a,l,u,d,h,p,y,m){var v=S();try{dynCall_viiiijjii(n,s,o,a,l,u,d,h,p,y,m)}catch(I){if(w(v),I!==I+0)throw I;_setThrew(1,0)}}function G0(n,s,o,a,l,u,d,h,p,y,m,v){var I=S();try{return dynCall_iiiiiiiijj(n,s,o,a,l,u,d,h,p,y,m,v)}catch(B){if(w(I),B!==B+0)throw B;_setThrew(1,0)}}function K0(n,s,o,a,l,u,d,h,p,y,m){var v=S();try{return dynCall_iiiijjiii(n,s,o,a,l,u,d,h,p,y,m)}catch(I){if(w(v),I!==I+0)throw I;_setThrew(1,0)}}function q0(n,s,o,a,l,u,d,h,p){var y=S();try{return dynCall_iiiiiiij(n,s,o,a,l,u,d,h,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function J0(n,s,o,a,l,u,d,h,p,y,m,v,I){var B=S();try{return dynCall_iiiiiiiiijii(n,s,o,a,l,u,d,h,p,y,m,v,I)}catch(F){if(w(B),F!==F+0)throw F;_setThrew(1,0)}}function X0(n,s,o,a,l,u,d,h,p){var y=S();try{return dynCall_jiiijiii(n,s,o,a,l,u,d,h,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function Z0(n,s,o,a,l,u,d,h){var p=S();try{return dynCall_jiiijii(n,s,o,a,l,u,d,h)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function Q0(n,s,o,a,l,u,d,h,p,y){var m=S();try{dynCall_viiijiji(n,s,o,a,l,u,d,h,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function tb(n,s,o,a,l,u,d,h){var p=S();try{return dynCall_jijjj(n,s,o,a,l,u,d,h)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function eb(n,s,o,a,l,u,d,h){var p=S();try{return dynCall_dijjj(n,s,o,a,l,u,d,h)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function ib(n,s,o,a,l,u,d,h,p,y){var m=S();try{dynCall_vijijjd(n,s,o,a,l,u,d,h,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function rb(n,s,o,a,l,u,d,h,p,y,m,v,I,B){var F=S();try{return dynCall_iiiiiiiiiiiji(n,s,o,a,l,u,d,h,p,y,m,v,I,B)}catch(A){if(w(F),A!==A+0)throw A;_setThrew(1,0)}}function nb(n,s,o,a,l,u,d,h,p,y,m,v){var I=S();try{return dynCall_iiiiiiijji(n,s,o,a,l,u,d,h,p,y,m,v)}catch(B){if(w(I),B!==B+0)throw B;_setThrew(1,0)}}function sb(n,s,o,a,l,u,d,h,p){var y=S();try{dynCall_viiiijj(n,s,o,a,l,u,d,h,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function ob(n,s,o,a,l,u,d,h,p){var y=S();try{return dynCall_iiiijji(n,s,o,a,l,u,d,h,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function ab(n,s,o,a,l,u,d,h,p,y,m,v){var I=S();try{return dynCall_iiiiiiiiiji(n,s,o,a,l,u,d,h,p,y,m,v)}catch(B){if(w(I),B!==B+0)throw B;_setThrew(1,0)}}function cb(n,s,o,a,l,u,d,h,p,y,m){var v=S();try{return dynCall_iiiiiiiiji(n,s,o,a,l,u,d,h,p,y,m)}catch(I){if(w(v),I!==I+0)throw I;_setThrew(1,0)}}function lb(n,s,o,a,l,u,d,h,p,y,m){var v=S();try{return dynCall_jiiiiijji(n,s,o,a,l,u,d,h,p,y,m)}catch(I){if(w(v),I!==I+0)throw I;_setThrew(1,0)}}function ub(n,s,o,a,l,u,d,h,p){var y=S();try{dynCall_viijjii(n,s,o,a,l,u,d,h,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function db(n,s,o,a,l,u,d,h){var p=S();try{return dynCall_jiiiiiii(n,s,o,a,l,u,d,h)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function fb(n,s,o,a,l,u,d,h,p,y,m){var v=S();try{dynCall_viiijjiii(n,s,o,a,l,u,d,h,p,y,m)}catch(I){if(w(v),I!==I+0)throw I;_setThrew(1,0)}}function hb(n,s,o,a,l,u,d,h,p){var y=S();try{dynCall_viiiijii(n,s,o,a,l,u,d,h,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function pb(n,s,o,a,l,u,d,h){var p=S();try{return dynCall_jiiiiji(n,s,o,a,l,u,d,h)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function _b(n,s,o,a,l,u,d){var h=S();try{return dynCall_jiijj(n,s,o,a,l,u,d)}catch(p){if(w(h),p!==p+0)throw p;_setThrew(1,0)}}function yb(n,s,o,a,l,u,d,h,p,y,m,v,I){var B=S();try{return dynCall_iiiiiiiijiii(n,s,o,a,l,u,d,h,p,y,m,v,I)}catch(F){if(w(B),F!==F+0)throw F;_setThrew(1,0)}}function mb(n,s,o,a,l,u,d,h,p,y,m){var v=S();try{return dynCall_iiiiiiiiij(n,s,o,a,l,u,d,h,p,y,m)}catch(I){if(w(v),I!==I+0)throw I;_setThrew(1,0)}}function bb(n,s,o,a,l,u){var d=S();try{return dynCall_iiidj(n,s,o,a,l,u)}catch(h){if(w(d),h!==h+0)throw h;_setThrew(1,0)}}function vb(n,s,o,a,l,u,d,h,p,y,m,v,I,B,F,A){var $=S();try{return dynCall_iiiiiiiiiiijiii(n,s,o,a,l,u,d,h,p,y,m,v,I,B,F,A)}catch(yt){if(w($),yt!==yt+0)throw yt;_setThrew(1,0)}}function gb(n,s,o,a,l,u,d,h,p,y,m,v,I,B,F,A,$,yt,x){var H=S();try{return dynCall_iiiiiiiiijiiiiiiii(n,s,o,a,l,u,d,h,p,y,m,v,I,B,F,A,$,yt,x)}catch(Tt){if(w(H),Tt!==Tt+0)throw Tt;_setThrew(1,0)}}function wb(n,s,o,a,l,u,d,h,p,y,m,v,I){var B=S();try{return dynCall_iiiiiiiiiiji(n,s,o,a,l,u,d,h,p,y,m,v,I)}catch(F){if(w(B),F!==F+0)throw F;_setThrew(1,0)}}function Sb(n,s,o,a,l,u,d,h,p,y,m){var v=S();try{return dynCall_iiiiijjii(n,s,o,a,l,u,d,h,p,y,m)}catch(I){if(w(v),I!==I+0)throw I;_setThrew(1,0)}}function Ib(n,s,o,a,l,u,d,h,p,y,m,v){var I=S();try{return dynCall_iiiiijjij(n,s,o,a,l,u,d,h,p,y,m,v)}catch(B){if(w(I),B!==B+0)throw B;_setThrew(1,0)}}function Tb(n,s,o,a,l,u,d,h,p,y,m,v){var I=S();try{return dynCall_iiiijiiiij(n,s,o,a,l,u,d,h,p,y,m,v)}catch(B){if(w(I),B!==B+0)throw B;_setThrew(1,0)}}function jb(n,s,o,a,l,u,d,h,p,y,m){var v=S();try{return dynCall_iiiijiiij(n,s,o,a,l,u,d,h,p,y,m)}catch(I){if(w(v),I!==I+0)throw I;_setThrew(1,0)}}function Db(n,s,o,a,l,u,d,h,p,y,m,v,I,B,F){var A=S();try{dynCall_viijijijiji(n,s,o,a,l,u,d,h,p,y,m,v,I,B,F)}catch($){if(w(A),$!==$+0)throw $;_setThrew(1,0)}}function Bb(n,s,o,a,l,u,d,h,p,y,m,v,I,B){var F=S();try{dynCall_viiijjjjii(n,s,o,a,l,u,d,h,p,y,m,v,I,B)}catch(A){if(w(F),A!==A+0)throw A;_setThrew(1,0)}}function Fb(n,s,o,a,l,u,d,h,p,y,m,v){var I=S();try{dynCall_viijjjji(n,s,o,a,l,u,d,h,p,y,m,v)}catch(B){if(w(I),B!==B+0)throw B;_setThrew(1,0)}}function Ab(n,s,o,a,l,u,d,h,p,y,m,v,I,B){var F=S();try{dynCall_viijijijij(n,s,o,a,l,u,d,h,p,y,m,v,I,B)}catch(A){if(w(F),A!==A+0)throw A;_setThrew(1,0)}}function xb(n,s,o,a,l,u,d,h,p,y,m,v,I,B,F){var A=S();try{return dynCall_iiiijiijjiii(n,s,o,a,l,u,d,h,p,y,m,v,I,B,F)}catch($){if(w(A),$!==$+0)throw $;_setThrew(1,0)}}function kb(n,s,o,a,l,u,d,h,p,y,m,v){var I=S();try{return dynCall_iijiiiiiij(n,s,o,a,l,u,d,h,p,y,m,v)}catch(B){if(w(I),B!==B+0)throw B;_setThrew(1,0)}}function Eb(n,s,o,a,l,u,d,h,p,y,m,v){var I=S();try{dynCall_viijjiiij(n,s,o,a,l,u,d,h,p,y,m,v)}catch(B){if(w(I),B!==B+0)throw B;_setThrew(1,0)}}function Ob(n,s,o,a,l,u,d,h,p,y,m,v){var I=S();try{dynCall_viijiijji(n,s,o,a,l,u,d,h,p,y,m,v)}catch(B){if(w(I),B!==B+0)throw B;_setThrew(1,0)}}function Ub(n,s,o,a,l,u,d,h,p,y,m,v,I,B,F){var A=S();try{dynCall_viiiijiijjii(n,s,o,a,l,u,d,h,p,y,m,v,I,B,F)}catch($){if(w(A),$!==$+0)throw $;_setThrew(1,0)}}function Mb(n,s,o,a,l,u,d,h,p,y,m,v,I,B,F,A,$,yt,x,H){var Tt=S();try{return dynCall_iiiiiijjiiiiiiiji(n,s,o,a,l,u,d,h,p,y,m,v,I,B,F,A,$,yt,x,H)}catch(Nt){if(w(Tt),Nt!==Nt+0)throw Nt;_setThrew(1,0)}}function Rb(n,s,o,a,l,u,d,h,p){var y=S();try{dynCall_viijiiii(n,s,o,a,l,u,d,h,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function Cb(n,s,o,a,l,u){var d=S();try{return dynCall_ijji(n,s,o,a,l,u)}catch(h){if(w(d),h!==h+0)throw h;_setThrew(1,0)}}function Lb(n,s,o,a,l){var u=S();try{dynCall_vjii(n,s,o,a,l)}catch(d){if(w(u),d!==d+0)throw d;_setThrew(1,0)}}function Nb(n,s,o,a,l){var u=S();try{return dynCall_jjj(n,s,o,a,l)}catch(d){if(w(u),d!==d+0)throw d;_setThrew(1,0)}}function Pb(n,s,o,a){var l=S();try{return dynCall_jji(n,s,o,a)}catch(u){if(w(l),u!==u+0)throw u;_setThrew(1,0)}}function Vb(n,s,o,a,l,u,d,h){var p=S();try{return dynCall_iijiji(n,s,o,a,l,u,d,h)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function Hb(n,s,o,a,l,u,d,h,p,y,m,v,I,B,F){var A=S();try{dynCall_viiiijiiiiiiii(n,s,o,a,l,u,d,h,p,y,m,v,I,B,F)}catch($){if(w(A),$!==$+0)throw $;_setThrew(1,0)}}function zb(n,s,o,a,l,u,d,h,p,y,m,v){var I=S();try{dynCall_viiiiijiiii(n,s,o,a,l,u,d,h,p,y,m,v)}catch(B){if(w(I),B!==B+0)throw B;_setThrew(1,0)}}function Wb(n,s,o,a,l,u,d,h){var p=S();try{return dynCall_jjjij(n,s,o,a,l,u,d,h)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function $b(n,s,o,a,l,u){var d=S();try{return dynCall_jijj(n,s,o,a,l,u)}catch(h){if(w(d),h!==h+0)throw h;_setThrew(1,0)}}function Yb(n,s,o,a,l,u,d,h,p,y,m){var v=S();try{return dynCall_iiijiiiji(n,s,o,a,l,u,d,h,p,y,m)}catch(I){if(w(v),I!==I+0)throw I;_setThrew(1,0)}}function Gb(n,s,o,a,l,u,d,h,p){var y=S();try{dynCall_viiijji(n,s,o,a,l,u,d,h,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function Kb(n,s,o,a,l,u,d,h,p,y){var m=S();try{dynCall_viiijjii(n,s,o,a,l,u,d,h,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function qb(n,s,o,a,l,u,d,h,p,y){var m=S();try{return dynCall_jiiiijji(n,s,o,a,l,u,d,h,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function Jb(n,s,o,a,l,u,d,h,p,y){var m=S();try{dynCall_viiiijji(n,s,o,a,l,u,d,h,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function Xb(n,s,o,a,l,u,d,h,p){var y=S();try{return dynCall_iiiijij(n,s,o,a,l,u,d,h,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function Zb(n,s,o,a,l){var u=S();try{return dynCall_jiji(n,s,o,a,l)}catch(d){if(w(u),d!==d+0)throw d;_setThrew(1,0)}}function Qb(n,s,o,a,l,u,d,h,p,y,m,v){var I=S();try{dynCall_viiiiiijij(n,s,o,a,l,u,d,h,p,y,m,v)}catch(B){if(w(I),B!==B+0)throw B;_setThrew(1,0)}}function tv(n,s,o,a,l,u,d,h){var p=S();try{return dynCall_iijjii(n,s,o,a,l,u,d,h)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function ev(n,s,o,a,l){var u=S();try{dynCall_vjj(n,s,o,a,l)}catch(d){if(w(u),d!==d+0)throw d;_setThrew(1,0)}}function iv(n,s,o,a,l,u){var d=S();try{dynCall_viijd(n,s,o,a,l,u)}catch(h){if(w(d),h!==h+0)throw h;_setThrew(1,0)}}function rv(n,s,o,a,l,u,d,h,p,y){var m=S();try{return dynCall_iijiiiiii(n,s,o,a,l,u,d,h,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function nv(n,s,o,a){var l=S();try{return dynCall_dij(n,s,o,a)}catch(u){if(w(l),u!==u+0)throw u;_setThrew(1,0)}}function sv(n,s,o,a,l,u,d,h,p,y){var m=S();try{dynCall_viiiiiiji(n,s,o,a,l,u,d,h,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function ov(n,s,o,a,l,u,d){var h=S();try{return dynCall_jjjii(n,s,o,a,l,u,d)}catch(p){if(w(h),p!==p+0)throw p;_setThrew(1,0)}}function av(n,s,o,a,l,u,d,h,p,y,m,v,I){var B=S();try{return dynCall_jiiijiijiii(n,s,o,a,l,u,d,h,p,y,m,v,I)}catch(F){if(w(B),F!==F+0)throw F;_setThrew(1,0)}}function cv(n,s,o,a,l,u,d,h,p,y){var m=S();try{return dynCall_jiiiijiii(n,s,o,a,l,u,d,h,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function lv(n,s,o,a,l,u,d,h,p,y){var m=S();try{dynCall_viiijiiii(n,s,o,a,l,u,d,h,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function uv(n,s,o,a,l,u,d,h,p,y){var m=S();try{return dynCall_jiijjiii(n,s,o,a,l,u,d,h,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function dv(n,s,o,a,l,u,d,h,p){var y=S();try{return dynCall_jiiiijii(n,s,o,a,l,u,d,h,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function fv(n,s,o,a,l,u,d,h,p){var y=S();try{return dynCall_jiijiiii(n,s,o,a,l,u,d,h,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function hv(n,s,o,a,l,u,d,h,p,y,m,v){var I=S();try{return dynCall_jiiiiijiiii(n,s,o,a,l,u,d,h,p,y,m,v)}catch(B){if(w(I),B!==B+0)throw B;_setThrew(1,0)}}function pv(n,s,o,a,l,u,d,h,p){var y=S();try{return dynCall_iijjiii(n,s,o,a,l,u,d,h,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function _v(n,s,o,a,l){var u=S();try{return dynCall_iidj(n,s,o,a,l)}catch(d){if(w(u),d!==d+0)throw d;_setThrew(1,0)}}function yv(n,s,o,a,l,u,d,h,p){var y=S();try{return dynCall_jiiiiiiii(n,s,o,a,l,u,d,h,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function mv(n,s,o,a,l,u,d,h,p,y){var m=S();try{return dynCall_iijjjii(n,s,o,a,l,u,d,h,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function bv(n,s,o,a,l,u,d,h,p){var y=S();try{return dynCall_iijjji(n,s,o,a,l,u,d,h,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function vv(n,s,o,a,l,u,d,h,p){var y=S();try{return dynCall_iiijjj(n,s,o,a,l,u,d,h,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function gv(n,s,o,a,l,u,d,h){var p=S();try{return dynCall_jjjji(n,s,o,a,l,u,d,h)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function wv(n,s,o,a,l,u,d,h,p,y){var m=S();try{return dynCall_iijjjj(n,s,o,a,l,u,d,h,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function Sv(n,s,o,a,l,u,d){var h=S();try{return dynCall_fiiiij(n,s,o,a,l,u,d)}catch(p){if(w(h),p!==p+0)throw p;_setThrew(1,0)}}function Iv(n,s,o,a,l,u,d){var h=S();try{return dynCall_diiiij(n,s,o,a,l,u,d)}catch(p){if(w(h),p!==p+0)throw p;_setThrew(1,0)}}function Tv(n,s,o,a,l,u,d,h){var p=S();try{dynCall_vijiji(n,s,o,a,l,u,d,h)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function jv(n,s,o,a,l,u,d,h,p){var y=S();try{dynCall_vijjij(n,s,o,a,l,u,d,h,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function Dv(n,s,o,a,l,u){var d=S();try{return dynCall_jjij(n,s,o,a,l,u)}catch(h){if(w(d),h!==h+0)throw h;_setThrew(1,0)}}function Bv(n,s,o,a,l,u){var d=S();try{return dynCall_ijij(n,s,o,a,l,u)}catch(h){if(w(d),h!==h+0)throw h;_setThrew(1,0)}}function Fv(n,s,o,a,l,u,d){var h=S();try{dynCall_vijij(n,s,o,a,l,u,d)}catch(p){if(w(h),p!==p+0)throw p;_setThrew(1,0)}}function Av(n,s,o,a,l){var u=S();try{return dynCall_diij(n,s,o,a,l)}catch(d){if(w(u),d!==d+0)throw d;_setThrew(1,0)}}function xv(n,s,o,a,l,u){var d=S();try{return dynCall_djij(n,s,o,a,l,u)}catch(h){if(w(d),h!==h+0)throw h;_setThrew(1,0)}}function kv(n,s,o){var a=S();try{return dynCall_dj(n,s,o)}catch(l){if(w(a),l!==l+0)throw l;_setThrew(1,0)}}function Ev(n,s,o,a,l,u){var d=S();try{return dynCall_jjjd(n,s,o,a,l,u)}catch(h){if(w(d),h!==h+0)throw h;_setThrew(1,0)}}function Ov(n,s,o,a,l,u){var d=S();try{dynCall_vjij(n,s,o,a,l,u)}catch(h){if(w(d),h!==h+0)throw h;_setThrew(1,0)}}function Uv(n,s,o,a,l,u,d,h,p,y,m,v){var I=S();try{dynCall_viiiijiiiii(n,s,o,a,l,u,d,h,p,y,m,v)}catch(B){if(w(I),B!==B+0)throw B;_setThrew(1,0)}}function Mv(n,s,o,a,l,u,d,h,p,y,m){var v=S();try{dynCall_viiiijiiii(n,s,o,a,l,u,d,h,p,y,m)}catch(I){if(w(v),I!==I+0)throw I;_setThrew(1,0)}}function Rv(n,s,o,a,l,u,d,h,p,y,m,v){var I=S();try{dynCall_viiijiiiji(n,s,o,a,l,u,d,h,p,y,m,v)}catch(B){if(w(I),B!==B+0)throw B;_setThrew(1,0)}}function Cv(n,s,o,a){var l=S();try{dynCall_vji(n,s,o,a)}catch(u){if(w(l),u!==u+0)throw u;_setThrew(1,0)}}function Lv(n,s,o,a,l,u,d,h,p,y){var m=S();try{return dynCall_jiijiiiii(n,s,o,a,l,u,d,h,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function Nv(n,s,o,a,l,u,d,h){var p=S();try{return dynCall_jiijiii(n,s,o,a,l,u,d,h)}catch(y){if(w(p),y!==y+0)throw y;_setThrew(1,0)}}function Pv(n,s,o,a,l,u,d,h,p,y,m,v){var I=S();try{dynCall_vijijjji(n,s,o,a,l,u,d,h,p,y,m,v)}catch(B){if(w(I),B!==B+0)throw B;_setThrew(1,0)}}function Vv(n,s,o,a,l,u,d,h,p,y,m,v,I){var B=S();try{dynCall_viiiiijjji(n,s,o,a,l,u,d,h,p,y,m,v,I)}catch(F){if(w(B),F!==F+0)throw F;_setThrew(1,0)}}function Hv(n,s,o,a,l,u,d,h,p,y,m){var v=S();try{dynCall_viijiijj(n,s,o,a,l,u,d,h,p,y,m)}catch(I){if(w(v),I!==I+0)throw I;_setThrew(1,0)}}function zv(n,s,o,a,l,u,d,h,p){var y=S();try{return dynCall_iiijiij(n,s,o,a,l,u,d,h,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function Wv(n,s,o,a,l,u,d,h,p){var y=S();try{dynCall_viijiij(n,s,o,a,l,u,d,h,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function $v(n,s,o,a,l,u,d,h,p,y,m,v){var I=S();try{return dynCall_iiijiiijj(n,s,o,a,l,u,d,h,p,y,m,v)}catch(B){if(w(I),B!==B+0)throw B;_setThrew(1,0)}}function Yv(n,s,o,a,l,u,d,h,p,y,m){var v=S();try{return dynCall_iiijiijj(n,s,o,a,l,u,d,h,p,y,m)}catch(I){if(w(v),I!==I+0)throw I;_setThrew(1,0)}}function Gv(n,s,o,a,l,u,d,h,p,y,m,v,I){var B=S();try{dynCall_viiijijjj(n,s,o,a,l,u,d,h,p,y,m,v,I)}catch(F){if(w(B),F!==F+0)throw F;_setThrew(1,0)}}function Kv(n,s,o,a,l,u,d,h,p,y){var m=S();try{dynCall_viiiijiii(n,s,o,a,l,u,d,h,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function qv(n,s,o,a,l,u,d,h,p){var y=S();try{dynCall_viijiji(n,s,o,a,l,u,d,h,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function Jv(n,s,o,a,l,u,d,h,p,y,m){var v=S();try{dynCall_vijiiiiji(n,s,o,a,l,u,d,h,p,y,m)}catch(I){if(w(v),I!==I+0)throw I;_setThrew(1,0)}}function Xv(n,s,o,a,l,u,d,h,p,y){var m=S();try{return dynCall_iiijjji(n,s,o,a,l,u,d,h,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function Zv(n,s,o,a,l,u,d,h,p,y){var m=S();try{return dynCall_iijiijj(n,s,o,a,l,u,d,h,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function Qv(n,s,o,a,l,u,d,h,p,y,m,v,I){var B=S();try{return dynCall_iiijiiiijj(n,s,o,a,l,u,d,h,p,y,m,v,I)}catch(F){if(w(B),F!==F+0)throw F;_setThrew(1,0)}}function tg(n,s,o,a,l,u,d,h,p,y,m){var v=S();try{return dynCall_iijiiijj(n,s,o,a,l,u,d,h,p,y,m)}catch(I){if(w(v),I!==I+0)throw I;_setThrew(1,0)}}function eg(n,s,o,a,l,u,d,h,p,y){var m=S();try{return dynCall_iiijiiij(n,s,o,a,l,u,d,h,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function ig(n,s,o,a,l,u,d,h,p,y){var m=S();try{return dynCall_jijjjj(n,s,o,a,l,u,d,h,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function rg(n,s,o,a,l,u,d){var h=S();try{return dynCall_jijiii(n,s,o,a,l,u,d)}catch(p){if(w(h),p!==p+0)throw p;_setThrew(1,0)}}function ng(n,s,o,a,l,u,d,h,p,y,m){var v=S();try{dynCall_viiiijjj(n,s,o,a,l,u,d,h,p,y,m)}catch(I){if(w(v),I!==I+0)throw I;_setThrew(1,0)}}function sg(n,s,o,a,l,u,d,h,p,y,m,v){var I=S();try{dynCall_viijjjiii(n,s,o,a,l,u,d,h,p,y,m,v)}catch(B){if(w(I),B!==B+0)throw B;_setThrew(1,0)}}function og(n,s,o,a,l,u,d,h,p,y,m,v,I){var B=S();try{dynCall_viijjjjii(n,s,o,a,l,u,d,h,p,y,m,v,I)}catch(F){if(w(B),F!==F+0)throw F;_setThrew(1,0)}}function ag(n,s,o,a,l,u,d){var h=S();try{return dynCall_jijji(n,s,o,a,l,u,d)}catch(p){if(w(h),p!==p+0)throw p;_setThrew(1,0)}}function cg(n,s,o,a,l,u,d,h,p,y,m,v){var I=S();try{dynCall_vijiiiiiiii(n,s,o,a,l,u,d,h,p,y,m,v)}catch(B){if(w(I),B!==B+0)throw B;_setThrew(1,0)}}function lg(n,s,o,a,l,u,d,h,p,y){var m=S();try{dynCall_vijiiiij(n,s,o,a,l,u,d,h,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function ug(n,s,o,a,l,u,d,h,p,y,m,v,I){var B=S();try{dynCall_viiijjjiii(n,s,o,a,l,u,d,h,p,y,m,v,I)}catch(F){if(w(B),F!==F+0)throw F;_setThrew(1,0)}}function dg(n,s,o,a,l,u,d,h,p,y,m,v,I,B){var F=S();try{return dynCall_iiiiiiiiijji(n,s,o,a,l,u,d,h,p,y,m,v,I,B)}catch(A){if(w(F),A!==A+0)throw A;_setThrew(1,0)}}function fg(n,s,o,a,l){var u=S();try{return dynCall_iijd(n,s,o,a,l)}catch(d){if(w(u),d!==d+0)throw d;_setThrew(1,0)}}function hg(n,s,o,a,l,u,d,h,p,y,m,v,I,B,F,A,$,yt,x,H,Tt,Nt){var Wi=S();try{return dynCall_iiiiiiiiiiiijjidjii(n,s,o,a,l,u,d,h,p,y,m,v,I,B,F,A,$,yt,x,H,Tt,Nt)}catch(pi){if(w(Wi),pi!==pi+0)throw pi;_setThrew(1,0)}}function pg(n,s,o,a,l,u,d,h,p,y){var m=S();try{return dynCall_iiijiiiii(n,s,o,a,l,u,d,h,p,y)}catch(v){if(w(m),v!==v+0)throw v;_setThrew(1,0)}}function _g(n,s,o,a,l,u,d,h,p,y,m,v){var I=S();try{dynCall_viiijdjji(n,s,o,a,l,u,d,h,p,y,m,v)}catch(B){if(w(I),B!==B+0)throw B;_setThrew(1,0)}}function yg(n,s,o,a,l,u,d){var h=S();try{return dynCall_diijj(n,s,o,a,l,u,d)}catch(p){if(w(h),p!==p+0)throw p;_setThrew(1,0)}}function mg(n,s,o,a,l,u,d,h,p,y,m,v){var I=S();try{return dynCall_iiijjijj(n,s,o,a,l,u,d,h,p,y,m,v)}catch(B){if(w(I),B!==B+0)throw B;_setThrew(1,0)}}function bg(n,s,o,a,l,u,d){var h=S();try{return dynCall_jjiji(n,s,o,a,l,u,d)}catch(p){if(w(h),p!==p+0)throw p;_setThrew(1,0)}}function vg(n,s,o,a,l,u,d,h,p,y,m,v,I){var B=S();try{return dynCall_jijjjjjd(n,s,o,a,l,u,d,h,p,y,m,v,I)}catch(F){if(w(B),F!==F+0)throw F;_setThrew(1,0)}}function gg(n,s,o,a,l,u,d,h,p){var y=S();try{return dynCall_jijjiii(n,s,o,a,l,u,d,h,p)}catch(m){if(w(y),m!==m+0)throw m;_setThrew(1,0)}}function wg(n){n=Object.assign({},n);var s=a=>l=>a(l)>>>0,o=a=>()=>a()>>>0;return n.ri=s(n.ri),n.yi=s(n.yi),n.zi=o(n.zi),n}r.stackSave=S,r.stackRestore=w,r.stackAlloc=js,r.getTempRet0=Hh,r.setTempRet0=Mr,r.ccall=Ph,r.createDyncallWrapper=Vh;var Ds;_n=function n(){Ds||fl(),Ds||(_n=n)};function Sg(){var n=ol,s=0,o=0;try{var a=n(s,o);return el(a,!0),a}catch(l){return Ch(l)}}function fl(){if(cr>0||(Ad(),cr>0))return;function n(){Ds||(Ds=!0,r.calledRun=!0,!O&&(xd(),kd(),c(r),r.onRuntimeInitialized&&r.onRuntimeInitialized(),hl&&Sg(),Ed()))}r.setStatus?(r.setStatus("Running..."),setTimeout(function(){setTimeout(function(){r.setStatus("")},1),n()},1)):n()}if(r.preInit)for(typeof r.preInit=="function"&&(r.preInit=[r.preInit]);r.preInit.length>0;)r.preInit.pop()();var hl=!0;return r.noInitialRun&&(hl=!1),fl(),_}})();typeof bd=="object"&&typeof Ec=="object"?Ec.exports=md:typeof define=="function"&&define.amd&&define([],()=>md)});var wd=Lr(()=>{});var Sd=Lr(()=>{});var Id=Lr((c2,_a)=>{(function(){"use strict";var i="input is invalid type",t=typeof window=="object",e=t?window:{};e.JS_SHA256_NO_WINDOW&&(t=!1);var r=!t&&typeof self=="object",c=!e.JS_SHA256_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node&&process.type!="renderer";c?e=global:r&&(e=self);var f=!e.JS_SHA256_NO_COMMON_JS&&typeof _a=="object"&&_a.exports,_=typeof define=="function"&&define.amd,b=!e.JS_SHA256_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",g="0123456789abcdef".split(""),T=[-2147483648,8388608,32768,128],D=[24,16,8,0],U=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],M=["hex","array","digest","arrayBuffer"],N=[];(e.JS_SHA256_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(k){return Object.prototype.toString.call(k)==="[object Array]"}),b&&(e.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(k){return typeof k=="object"&&k.buffer&&k.buffer.constructor===ArrayBuffer});var nt=function(k,P){return function(q){return new Dt(P,!0).update(q)[k]()}},Et=function(k){var P=nt("hex",k);c&&(P=Wt(P,k)),P.create=function(){return new Dt(k)},P.update=function(W){return P.create().update(W)};for(var q=0;q<M.length;++q){var O=M[q];P[O]=nt(O,k)}return P},Wt=function(k,P){var q=wd(),O=Sd().Buffer,W=P?"sha224":"sha256",R;O.from&&!e.JS_SHA256_NO_BUFFER_FROM?R=O.from:R=function(E){return new O(E)};var J=function(E){if(typeof E=="string")return q.createHash(W).update(E,"utf8").digest("hex");if(E==null)throw new Error(i);return E.constructor===ArrayBuffer&&(E=new Uint8Array(E)),Array.isArray(E)||ArrayBuffer.isView(E)||E.constructor===O?q.createHash(W).update(R(E)).digest("hex"):k(E)};return J},Vt=function(k,P){return function(q,O){return new Qt(q,P,!0).update(O)[k]()}},kt=function(k){var P=Vt("hex",k);P.create=function(W){return new Qt(W,k)},P.update=function(W,R){return P.create(W).update(R)};for(var q=0;q<M.length;++q){var O=M[q];P[O]=Vt(O,k)}return P};function Dt(k,P){P?(N[0]=N[16]=N[1]=N[2]=N[3]=N[4]=N[5]=N[6]=N[7]=N[8]=N[9]=N[10]=N[11]=N[12]=N[13]=N[14]=N[15]=0,this.blocks=N):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],k?(this.h0=3238371032,this.h1=914150663,this.h2=812702999,this.h3=4144912697,this.h4=4290775857,this.h5=1750603025,this.h6=1694076839,this.h7=3204075428):(this.h0=1779033703,this.h1=3144134277,this.h2=1013904242,this.h3=2773480762,this.h4=1359893119,this.h5=2600822924,this.h6=528734635,this.h7=1541459225),this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0,this.is224=k}Dt.prototype.update=function(k){if(!this.finalized){var P,q=typeof k;if(q!=="string"){if(q==="object"){if(k===null)throw new Error(i);if(b&&k.constructor===ArrayBuffer)k=new Uint8Array(k);else if(!Array.isArray(k)&&(!b||!ArrayBuffer.isView(k)))throw new Error(i)}else throw new Error(i);P=!0}for(var O,W=0,R,J=k.length,E=this.blocks;W<J;){if(this.hashed&&(this.hashed=!1,E[0]=this.block,this.block=E[16]=E[1]=E[2]=E[3]=E[4]=E[5]=E[6]=E[7]=E[8]=E[9]=E[10]=E[11]=E[12]=E[13]=E[14]=E[15]=0),P)for(R=this.start;W<J&&R<64;++W)E[R>>>2]|=k[W]<<D[R++&3];else for(R=this.start;W<J&&R<64;++W)O=k.charCodeAt(W),O<128?E[R>>>2]|=O<<D[R++&3]:O<2048?(E[R>>>2]|=(192|O>>>6)<<D[R++&3],E[R>>>2]|=(128|O&63)<<D[R++&3]):O<55296||O>=57344?(E[R>>>2]|=(224|O>>>12)<<D[R++&3],E[R>>>2]|=(128|O>>>6&63)<<D[R++&3],E[R>>>2]|=(128|O&63)<<D[R++&3]):(O=65536+((O&1023)<<10|k.charCodeAt(++W)&1023),E[R>>>2]|=(240|O>>>18)<<D[R++&3],E[R>>>2]|=(128|O>>>12&63)<<D[R++&3],E[R>>>2]|=(128|O>>>6&63)<<D[R++&3],E[R>>>2]|=(128|O&63)<<D[R++&3]);this.lastByteIndex=R,this.bytes+=R-this.start,R>=64?(this.block=E[16],this.start=R-64,this.hash(),this.hashed=!0):this.start=R}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},Dt.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var k=this.blocks,P=this.lastByteIndex;k[16]=this.block,k[P>>>2]|=T[P&3],this.block=k[16],P>=56&&(this.hashed||this.hash(),k[0]=this.block,k[16]=k[1]=k[2]=k[3]=k[4]=k[5]=k[6]=k[7]=k[8]=k[9]=k[10]=k[11]=k[12]=k[13]=k[14]=k[15]=0),k[14]=this.hBytes<<3|this.bytes>>>29,k[15]=this.bytes<<3,this.hash()}},Dt.prototype.hash=function(){var k=this.h0,P=this.h1,q=this.h2,O=this.h3,W=this.h4,R=this.h5,J=this.h6,E=this.h7,X=this.blocks,st,C,_t,ti,St,Ee,Oe,Vi,pn,kr,Er;for(st=16;st<64;++st)St=X[st-15],C=(St>>>7|St<<25)^(St>>>18|St<<14)^St>>>3,St=X[st-2],_t=(St>>>17|St<<15)^(St>>>19|St<<13)^St>>>10,X[st]=X[st-16]+C+X[st-7]+_t<<0;for(Er=P&q,st=0;st<64;st+=4)this.first?(this.is224?(Vi=300032,St=X[0]-1413257819,E=St-150054599<<0,O=St+24177077<<0):(Vi=704751109,St=X[0]-210244248,E=St-1521486534<<0,O=St+143694565<<0),this.first=!1):(C=(k>>>2|k<<30)^(k>>>13|k<<19)^(k>>>22|k<<10),_t=(W>>>6|W<<26)^(W>>>11|W<<21)^(W>>>25|W<<7),Vi=k&P,ti=Vi^k&q^Er,Oe=W&R^~W&J,St=E+_t+Oe+U[st]+X[st],Ee=C+ti,E=O+St<<0,O=St+Ee<<0),C=(O>>>2|O<<30)^(O>>>13|O<<19)^(O>>>22|O<<10),_t=(E>>>6|E<<26)^(E>>>11|E<<21)^(E>>>25|E<<7),pn=O&k,ti=pn^O&P^Vi,Oe=E&W^~E&R,St=J+_t+Oe+U[st+1]+X[st+1],Ee=C+ti,J=q+St<<0,q=St+Ee<<0,C=(q>>>2|q<<30)^(q>>>13|q<<19)^(q>>>22|q<<10),_t=(J>>>6|J<<26)^(J>>>11|J<<21)^(J>>>25|J<<7),kr=q&O,ti=kr^q&k^pn,Oe=J&E^~J&W,St=R+_t+Oe+U[st+2]+X[st+2],Ee=C+ti,R=P+St<<0,P=St+Ee<<0,C=(P>>>2|P<<30)^(P>>>13|P<<19)^(P>>>22|P<<10),_t=(R>>>6|R<<26)^(R>>>11|R<<21)^(R>>>25|R<<7),Er=P&q,ti=Er^P&O^kr,Oe=R&J^~R&E,St=W+_t+Oe+U[st+3]+X[st+3],Ee=C+ti,W=k+St<<0,k=St+Ee<<0,this.chromeBugWorkAround=!0;this.h0=this.h0+k<<0,this.h1=this.h1+P<<0,this.h2=this.h2+q<<0,this.h3=this.h3+O<<0,this.h4=this.h4+W<<0,this.h5=this.h5+R<<0,this.h6=this.h6+J<<0,this.h7=this.h7+E<<0},Dt.prototype.hex=function(){this.finalize();var k=this.h0,P=this.h1,q=this.h2,O=this.h3,W=this.h4,R=this.h5,J=this.h6,E=this.h7,X=g[k>>>28&15]+g[k>>>24&15]+g[k>>>20&15]+g[k>>>16&15]+g[k>>>12&15]+g[k>>>8&15]+g[k>>>4&15]+g[k&15]+g[P>>>28&15]+g[P>>>24&15]+g[P>>>20&15]+g[P>>>16&15]+g[P>>>12&15]+g[P>>>8&15]+g[P>>>4&15]+g[P&15]+g[q>>>28&15]+g[q>>>24&15]+g[q>>>20&15]+g[q>>>16&15]+g[q>>>12&15]+g[q>>>8&15]+g[q>>>4&15]+g[q&15]+g[O>>>28&15]+g[O>>>24&15]+g[O>>>20&15]+g[O>>>16&15]+g[O>>>12&15]+g[O>>>8&15]+g[O>>>4&15]+g[O&15]+g[W>>>28&15]+g[W>>>24&15]+g[W>>>20&15]+g[W>>>16&15]+g[W>>>12&15]+g[W>>>8&15]+g[W>>>4&15]+g[W&15]+g[R>>>28&15]+g[R>>>24&15]+g[R>>>20&15]+g[R>>>16&15]+g[R>>>12&15]+g[R>>>8&15]+g[R>>>4&15]+g[R&15]+g[J>>>28&15]+g[J>>>24&15]+g[J>>>20&15]+g[J>>>16&15]+g[J>>>12&15]+g[J>>>8&15]+g[J>>>4&15]+g[J&15];return this.is224||(X+=g[E>>>28&15]+g[E>>>24&15]+g[E>>>20&15]+g[E>>>16&15]+g[E>>>12&15]+g[E>>>8&15]+g[E>>>4&15]+g[E&15]),X},Dt.prototype.toString=Dt.prototype.hex,Dt.prototype.digest=function(){this.finalize();var k=this.h0,P=this.h1,q=this.h2,O=this.h3,W=this.h4,R=this.h5,J=this.h6,E=this.h7,X=[k>>>24&255,k>>>16&255,k>>>8&255,k&255,P>>>24&255,P>>>16&255,P>>>8&255,P&255,q>>>24&255,q>>>16&255,q>>>8&255,q&255,O>>>24&255,O>>>16&255,O>>>8&255,O&255,W>>>24&255,W>>>16&255,W>>>8&255,W&255,R>>>24&255,R>>>16&255,R>>>8&255,R&255,J>>>24&255,J>>>16&255,J>>>8&255,J&255];return this.is224||X.push(E>>>24&255,E>>>16&255,E>>>8&255,E&255),X},Dt.prototype.array=Dt.prototype.digest,Dt.prototype.arrayBuffer=function(){this.finalize();var k=new ArrayBuffer(this.is224?28:32),P=new DataView(k);return P.setUint32(0,this.h0),P.setUint32(4,this.h1),P.setUint32(8,this.h2),P.setUint32(12,this.h3),P.setUint32(16,this.h4),P.setUint32(20,this.h5),P.setUint32(24,this.h6),this.is224||P.setUint32(28,this.h7),k};function Qt(k,P,q){var O,W=typeof k;if(W==="string"){var R=[],J=k.length,E=0,X;for(O=0;O<J;++O)X=k.charCodeAt(O),X<128?R[E++]=X:X<2048?(R[E++]=192|X>>>6,R[E++]=128|X&63):X<55296||X>=57344?(R[E++]=224|X>>>12,R[E++]=128|X>>>6&63,R[E++]=128|X&63):(X=65536+((X&1023)<<10|k.charCodeAt(++O)&1023),R[E++]=240|X>>>18,R[E++]=128|X>>>12&63,R[E++]=128|X>>>6&63,R[E++]=128|X&63);k=R}else if(W==="object"){if(k===null)throw new Error(i);if(b&&k.constructor===ArrayBuffer)k=new Uint8Array(k);else if(!Array.isArray(k)&&(!b||!ArrayBuffer.isView(k)))throw new Error(i)}else throw new Error(i);k.length>64&&(k=new Dt(P,!0).update(k).array());var st=[],C=[];for(O=0;O<64;++O){var _t=k[O]||0;st[O]=92^_t,C[O]=54^_t}Dt.call(this,P,q),this.update(C),this.oKeyPad=st,this.inner=!0,this.sharedMemory=q}Qt.prototype=new Dt,Qt.prototype.finalize=function(){if(Dt.prototype.finalize.call(this),this.inner){this.inner=!1;var k=this.array();Dt.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(k),Dt.prototype.finalize.call(this)}};var te=Et();te.sha256=te,te.sha224=Et(!0),te.sha256.hmac=kt(),te.sha224.hmac=kt(!0),f?_a.exports=te:(e.sha256=te.sha256,e.sha224=te.sha224,_&&define(function(){return te}))})()});var s1={};$i(s1,{registerWorker:()=>Fd});function ml(i,t){var e={};for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&t.indexOf(r)<0&&(e[r]=i[r]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var c=0,r=Object.getOwnPropertySymbols(i);c<r.length;c++)t.indexOf(r[c])<0&&Object.prototype.propertyIsEnumerable.call(i,r[c])&&(e[r[c]]=i[r[c]]);return e}function V(i,t,e,r){function c(f){return f instanceof e?f:new e(function(_){_(f)})}return new(e||(e=Promise))(function(f,_){function b(D){try{T(r.next(D))}catch(U){_(U)}}function g(D){try{T(r.throw(D))}catch(U){_(U)}}function T(D){D.done?f(D.value):c(D.value).then(b,g)}T((r=r.apply(i,t||[])).next())})}function yl(i){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&i[t],r=0;if(e)return e.call(i);if(i&&typeof i.length=="number")return{next:function(){return i&&r>=i.length&&(i=void 0),{value:i&&i[r++],done:!i}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function pt(i){return this instanceof pt?(this.v=i,this):new pt(i)}function ye(i,t,e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=e.apply(i,t||[]),c,f=[];return c={},_("next"),_("throw"),_("return"),c[Symbol.asyncIterator]=function(){return this},c;function _(M){r[M]&&(c[M]=function(N){return new Promise(function(nt,Et){f.push([M,N,nt,Et])>1||b(M,N)})})}function b(M,N){try{g(r[M](N))}catch(nt){U(f[0][3],nt)}}function g(M){M.value instanceof pt?Promise.resolve(M.value.v).then(T,D):U(f[0][2],M)}function T(M){b("next",M)}function D(M){b("throw",M)}function U(M,N){M(N),f.shift(),f.length&&b(f[0][0],f[0][1])}}function Nr(i){var t,e;return t={},r("next"),r("throw",function(c){throw c}),r("return"),t[Symbol.iterator]=function(){return this},t;function r(c,f){t[c]=i[c]?function(_){return(e=!e)?{value:pt(i[c](_)),done:!1}:f?f(_):_}:f}}function Ue(i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=i[Symbol.asyncIterator],e;return t?t.call(i):(i=typeof yl=="function"?yl(i):i[Symbol.iterator](),e={},r("next"),r("throw"),r("return"),e[Symbol.asyncIterator]=function(){return this},e);function r(f){e[f]=i[f]&&function(_){return new Promise(function(b,g){_=i[f](_),c(b,g,_.done,_.value)})}}function c(f,_,b,g){Promise.resolve(g).then(function(T){f({value:T,done:b})},_)}}var Ea={};$i(Ea,{compareArrayLike:()=>ka,joinUint8Arrays:()=>me,memcpy:()=>gn,rebaseValueOffsets:()=>Ms,toArrayBufferView:()=>mt,toArrayBufferViewAsyncIterator:()=>Ce,toArrayBufferViewIterator:()=>ii,toBigInt64Array:()=>Us,toBigUint64Array:()=>Ng,toFloat32Array:()=>Pg,toFloat32ArrayAsyncIterator:()=>iw,toFloat32ArrayIterator:()=>Kg,toFloat64Array:()=>Vg,toFloat64ArrayAsyncIterator:()=>rw,toFloat64ArrayIterator:()=>qg,toInt16Array:()=>Rg,toInt16ArrayAsyncIterator:()=>Zg,toInt16ArrayIterator:()=>Wg,toInt32Array:()=>dr,toInt32ArrayAsyncIterator:()=>Qg,toInt32ArrayIterator:()=>$g,toInt8Array:()=>Mg,toInt8ArrayAsyncIterator:()=>Xg,toInt8ArrayIterator:()=>zg,toUint16Array:()=>Cg,toUint16ArrayAsyncIterator:()=>tw,toUint16ArrayIterator:()=>Yg,toUint32Array:()=>Lg,toUint32ArrayAsyncIterator:()=>ew,toUint32ArrayIterator:()=>Gg,toUint8Array:()=>ot,toUint8ArrayAsyncIterator:()=>xa,toUint8ArrayIterator:()=>Aa,toUint8ClampedArray:()=>Hg,toUint8ClampedArrayAsyncIterator:()=>nw,toUint8ClampedArrayIterator:()=>Jg});var kg=new TextDecoder("utf-8"),bn=i=>kg.decode(i),Eg=new TextEncoder,ei=i=>Eg.encode(i);var Og=i=>typeof i=="number",bl=i=>typeof i=="boolean",qt=i=>typeof i=="function",oe=i=>i!=null&&Object(i)===i,Me=i=>oe(i)&&qt(i.then);var Re=i=>oe(i)&&qt(i[Symbol.iterator]),je=i=>oe(i)&&qt(i[Symbol.asyncIterator]),Fs=i=>oe(i)&&oe(i.schema);var As=i=>oe(i)&&"done"in i&&"value"in i;var xs=i=>oe(i)&&qt(i.stat)&&Og(i.fd);var ks=i=>oe(i)&&vn(i.body),Es=i=>"_getDOMStream"in i&&"_getNodeStream"in i,vl=i=>oe(i)&&qt(i.abort)&&qt(i.getWriter)&&!Es(i),vn=i=>oe(i)&&qt(i.cancel)&&qt(i.getReader)&&!Es(i),gl=i=>oe(i)&&qt(i.end)&&qt(i.write)&&bl(i.writable)&&!Es(i),Os=i=>oe(i)&&qt(i.read)&&qt(i.pipe)&&bl(i.readable)&&!Es(i),wl=i=>oe(i)&&qt(i.clear)&&qt(i.bytes)&&qt(i.position)&&qt(i.setPosition)&&qt(i.capacity)&&qt(i.getBufferIdentifier)&&qt(i.createLong);var Fa=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:ArrayBuffer;function Ug(i){let t=i[0]?[i[0]]:[],e,r,c,f;for(let _,b,g=0,T=0,D=i.length;++g<D;){if(_=t[T],b=i[g],!_||!b||_.buffer!==b.buffer||b.byteOffset<_.byteOffset){b&&(t[++T]=b);continue}if({byteOffset:e,byteLength:c}=_,{byteOffset:r,byteLength:f}=b,e+c<r||r+f<e){b&&(t[++T]=b);continue}t[T]=new Uint8Array(_.buffer,e,r-e+f)}return t}function gn(i,t,e=0,r=t.byteLength){let c=i.byteLength,f=new Uint8Array(i.buffer,i.byteOffset,c),_=new Uint8Array(t.buffer,t.byteOffset,Math.min(r,c));return f.set(_,e),i}function me(i,t){let e=Ug(i),r=e.reduce((D,U)=>D+U.byteLength,0),c,f,_,b=0,g=-1,T=Math.min(t||Number.POSITIVE_INFINITY,r);for(let D=e.length;++g<D;){if(c=e[g],f=c.subarray(0,Math.min(c.length,T-b)),T<=b+f.length){f.length<c.length?e[g]=c.subarray(f.length):f.length===c.length&&g++,_?gn(_,f,b):_=f;break}gn(_||(_=new Uint8Array(T)),f,b),b+=f.length}return[_||new Uint8Array(0),e.slice(g),r-(_?_.byteLength:0)]}function mt(i,t){let e=As(t)?t.value:t;return e instanceof i?i===Uint8Array?new i(e.buffer,e.byteOffset,e.byteLength):e:e?(typeof e=="string"&&(e=ei(e)),e instanceof ArrayBuffer?new i(e):e instanceof Fa?new i(e):wl(e)?mt(i,e.bytes()):ArrayBuffer.isView(e)?e.byteLength<=0?new i(0):new i(e.buffer,e.byteOffset,e.byteLength/i.BYTES_PER_ELEMENT):i.from(e)):new i(0)}var Mg=i=>mt(Int8Array,i),Rg=i=>mt(Int16Array,i),dr=i=>mt(Int32Array,i),Us=i=>mt(BigInt64Array,i),ot=i=>mt(Uint8Array,i),Cg=i=>mt(Uint16Array,i),Lg=i=>mt(Uint32Array,i),Ng=i=>mt(BigUint64Array,i),Pg=i=>mt(Float32Array,i),Vg=i=>mt(Float64Array,i),Hg=i=>mt(Uint8ClampedArray,i),Ba=i=>(i.next(),i);function*ii(i,t){let e=function*(c){yield c},r=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof Fa?e(t):Re(t)?t:e(t);return yield*ur(Ba(function*(c){let f=null;do f=c.next(yield mt(i,f));while(!f.done)}(r[Symbol.iterator]()))),new i}var zg=i=>ii(Int8Array,i),Wg=i=>ii(Int16Array,i),$g=i=>ii(Int32Array,i),Aa=i=>ii(Uint8Array,i),Yg=i=>ii(Uint16Array,i),Gg=i=>ii(Uint32Array,i),Kg=i=>ii(Float32Array,i),qg=i=>ii(Float64Array,i),Jg=i=>ii(Uint8ClampedArray,i);function Ce(i,t){return ye(this,arguments,function*(){if(Me(t))return yield pt(yield pt(yield*ur(Nr(Ue(Ce(i,yield pt(t)))))));let r=function(_){return ye(this,arguments,function*(){yield yield pt(yield pt(_))})},c=function(_){return ye(this,arguments,function*(){yield pt(yield*ur(Nr(Ue(Ba(function*(b){let g=null;do g=b.next(yield g==null?void 0:g.value);while(!g.done)}(_[Symbol.iterator]()))))))})},f=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof Fa?r(t):Re(t)?c(t):je(t)?t:r(t);return yield pt(yield*ur(Nr(Ue(Ba(function(_){return ye(this,arguments,function*(){let b=null;do b=yield pt(_.next(yield yield pt(mt(i,b))));while(!b.done)})}(f[Symbol.asyncIterator]())))))),yield pt(new i)})}var Xg=i=>Ce(Int8Array,i),Zg=i=>Ce(Int16Array,i),Qg=i=>Ce(Int32Array,i),xa=i=>Ce(Uint8Array,i),tw=i=>Ce(Uint16Array,i),ew=i=>Ce(Uint32Array,i),iw=i=>Ce(Float32Array,i),rw=i=>Ce(Float64Array,i),nw=i=>Ce(Uint8ClampedArray,i);function Ms(i,t,e){if(i!==0){e=e.slice(0,t);for(let r=-1,c=e.length;++r<c;)e[r]+=i}return e.subarray(0,t)}function ka(i,t){let e=0,r=i.length;if(r!==t.length)return!1;if(r>0)do if(i[e]!==t[e])return!1;while(++e<r);return!0}var ee={fromIterable(i){return Rs(sw(i))},fromAsyncIterable(i){return Rs(ow(i))},fromDOMStream(i){return Rs(aw(i))},fromNodeStream(i){return Rs(cw(i))},toDOMStream(i,t){throw new Error('"toDOMStream" not available in this environment')},toNodeStream(i,t){throw new Error('"toNodeStream" not available in this environment')}},Rs=i=>(i.next(),i);function*sw(i){let t,e=!1,r=[],c,f,_,b=0;function g(){return f==="peek"?me(r,_)[0]:([c,r,b]=me(r,_),c)}({cmd:f,size:_}=(yield null)||{cmd:"read",size:0});let T=Aa(i)[Symbol.iterator]();try{do if({done:t,value:c}=Number.isNaN(_-b)?T.next():T.next(_-b),!t&&c.byteLength>0&&(r.push(c),b+=c.byteLength),t||_<=b)do({cmd:f,size:_}=yield g());while(_<b);while(!t)}catch(D){(e=!0)&&typeof T.throw=="function"&&T.throw(D)}finally{e===!1&&typeof T.return=="function"&&T.return(null)}return null}function ow(i){return ye(this,arguments,function*(){let e,r=!1,c=[],f,_,b,g=0;function T(){return _==="peek"?me(c,b)[0]:([f,c,g]=me(c,b),f)}({cmd:_,size:b}=(yield yield pt(null))||{cmd:"read",size:0});let D=xa(i)[Symbol.asyncIterator]();try{do if({done:e,value:f}=Number.isNaN(b-g)?yield pt(D.next()):yield pt(D.next(b-g)),!e&&f.byteLength>0&&(c.push(f),g+=f.byteLength),e||b<=g)do({cmd:_,size:b}=yield yield pt(T()));while(b<g);while(!e)}catch(U){(r=!0)&&typeof D.throw=="function"&&(yield pt(D.throw(U)))}finally{r===!1&&typeof D.return=="function"&&(yield pt(D.return(new Uint8Array(0))))}return yield pt(null)})}function aw(i){return ye(this,arguments,function*(){let e=!1,r=!1,c=[],f,_,b,g=0;function T(){return _==="peek"?me(c,b)[0]:([f,c,g]=me(c,b),f)}({cmd:_,size:b}=(yield yield pt(null))||{cmd:"read",size:0});let D=new Ua(i);try{do if({done:e,value:f}=Number.isNaN(b-g)?yield pt(D.read()):yield pt(D.read(b-g)),!e&&f.byteLength>0&&(c.push(ot(f)),g+=f.byteLength),e||b<=g)do({cmd:_,size:b}=yield yield pt(T()));while(b<g);while(!e)}catch(U){(r=!0)&&(yield pt(D.cancel(U)))}finally{r===!1?yield pt(D.cancel()):i.locked&&D.releaseLock()}return yield pt(null)})}var Ua=class{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 V(this,void 0,void 0,function*(){let{reader:e,source:r}=this;e&&(yield e.cancel(t).catch(()=>{})),r&&r.locked&&this.releaseLock()})}read(t){return V(this,void 0,void 0,function*(){if(t===0)return{done:this.reader==null,value:new Uint8Array(0)};let e=yield this.reader.read();return!e.done&&(e.value=ot(e)),e})}},Oa=(i,t)=>{let e=c=>r([t,c]),r;return[t,e,new Promise(c=>(r=c)&&i.once(t,e))]};function cw(i){return ye(this,arguments,function*(){let e=[],r="error",c=!1,f=null,_,b,g=0,T=[],D;function U(){return _==="peek"?me(T,b)[0]:([D,T,g]=me(T,b),D)}if({cmd:_,size:b}=(yield yield pt(null))||{cmd:"read",size:0},i.isTTY)return yield yield pt(new Uint8Array(0)),yield pt(null);try{e[0]=Oa(i,"end"),e[1]=Oa(i,"error");do{if(e[2]=Oa(i,"readable"),[r,f]=yield pt(Promise.race(e.map(N=>N[2]))),r==="error")break;if((c=r==="end")||(Number.isFinite(b-g)?(D=ot(i.read(b-g)),D.byteLength<b-g&&(D=ot(i.read()))):D=ot(i.read()),D.byteLength>0&&(T.push(D),g+=D.byteLength)),c||b<=g)do({cmd:_,size:b}=yield yield pt(U()));while(b<g)}while(!c)}finally{yield pt(M(e,r==="error"?f:null))}return yield pt(null);function M(N,nt){return D=T=null,new Promise((Et,Wt)=>{for(let[Vt,kt]of N)i.off(Vt,kt);try{let Vt=i.destroy;Vt&&Vt.call(i,nt),nt=void 0}catch(Vt){nt=Vt||nt}finally{nt!=null?Wt(nt):Et()}})}})}var Bt;(function(i){i[i.V1=0]="V1",i[i.V2=1]="V2",i[i.V3=2]="V3",i[i.V4=3]="V4",i[i.V5=4]="V5"})(Bt||(Bt={}));var Ut;(function(i){i[i.Sparse=0]="Sparse",i[i.Dense=1]="Dense"})(Ut||(Ut={}));var Ot;(function(i){i[i.HALF=0]="HALF",i[i.SINGLE=1]="SINGLE",i[i.DOUBLE=2]="DOUBLE"})(Ot||(Ot={}));var $t;(function(i){i[i.DAY=0]="DAY",i[i.MILLISECOND=1]="MILLISECOND"})($t||($t={}));var Y;(function(i){i[i.SECOND=0]="SECOND",i[i.MILLISECOND=1]="MILLISECOND",i[i.MICROSECOND=2]="MICROSECOND",i[i.NANOSECOND=3]="NANOSECOND"})(Y||(Y={}));var Jt;(function(i){i[i.YEAR_MONTH=0]="YEAR_MONTH",i[i.DAY_TIME=1]="DAY_TIME",i[i.MONTH_DAY_NANO=2]="MONTH_DAY_NANO"})(Jt||(Jt={}));var ri=new Int32Array(2),Cs=new Float32Array(ri.buffer),Ls=new Float64Array(ri.buffer),Pr=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1;var wn;(function(i){i[i.UTF8_BYTES=1]="UTF8_BYTES",i[i.UTF16_STRING=2]="UTF16_STRING"})(wn||(wn={}));var be=class i{constructor(t){this.bytes_=t,this.position_=0,this.text_decoder_=new TextDecoder}static allocate(t){return new i(new Uint8Array(t))}clear(){this.position_=0}bytes(){return this.bytes_}position(){return this.position_}setPosition(t){this.position_=t}capacity(){return this.bytes_.length}readInt8(t){return this.readUint8(t)<<24>>24}readUint8(t){return this.bytes_[t]}readInt16(t){return this.readUint16(t)<<16>>16}readUint16(t){return this.bytes_[t]|this.bytes_[t+1]<<8}readInt32(t){return this.bytes_[t]|this.bytes_[t+1]<<8|this.bytes_[t+2]<<16|this.bytes_[t+3]<<24}readUint32(t){return this.readInt32(t)>>>0}readInt64(t){return BigInt.asIntN(64,BigInt(this.readUint32(t))+(BigInt(this.readUint32(t+4))<<BigInt(32)))}readUint64(t){return BigInt.asUintN(64,BigInt(this.readUint32(t))+(BigInt(this.readUint32(t+4))<<BigInt(32)))}readFloat32(t){return ri[0]=this.readInt32(t),Cs[0]}readFloat64(t){return ri[Pr?0:1]=this.readInt32(t),ri[Pr?1:0]=this.readInt32(t+4),Ls[0]}writeInt8(t,e){this.bytes_[t]=e}writeUint8(t,e){this.bytes_[t]=e}writeInt16(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8}writeUint16(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8}writeInt32(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8,this.bytes_[t+2]=e>>16,this.bytes_[t+3]=e>>24}writeUint32(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8,this.bytes_[t+2]=e>>16,this.bytes_[t+3]=e>>24}writeInt64(t,e){this.writeInt32(t,Number(BigInt.asIntN(32,e))),this.writeInt32(t+4,Number(BigInt.asIntN(32,e>>BigInt(32))))}writeUint64(t,e){this.writeUint32(t,Number(BigInt.asUintN(32,e))),this.writeUint32(t+4,Number(BigInt.asUintN(32,e>>BigInt(32))))}writeFloat32(t,e){Cs[0]=e,this.writeInt32(t,ri[0])}writeFloat64(t,e){Ls[0]=e,this.writeInt32(t,ri[Pr?0:1]),this.writeInt32(t+4,ri[Pr?1:0])}getBufferIdentifier(){if(this.bytes_.length<this.position_+4+4)throw new Error("FlatBuffers: ByteBuffer is too short to contain an identifier.");let t="";for(let e=0;e<4;e++)t+=String.fromCharCode(this.readInt8(this.position_+4+e));return t}__offset(t,e){let r=t-this.readInt32(t);return e<this.readInt16(r)?this.readInt16(r+e):0}__union(t,e){return t.bb_pos=e+this.readInt32(e),t.bb=this,t}__string(t,e){t+=this.readInt32(t);let r=this.readInt32(t);t+=4;let c=this.bytes_.subarray(t,t+r);return e===wn.UTF8_BYTES?c:this.text_decoder_.decode(c)}__union_with_string(t,e){return typeof t=="string"?this.__string(e):this.__union(t,e)}__indirect(t){return t+this.readInt32(t)}__vector(t){return t+this.readInt32(t)+4}__vector_len(t){return this.readInt32(t+this.readInt32(t))}__has_identifier(t){if(t.length!=4)throw new Error("FlatBuffers: file identifier must be length "+4);for(let e=0;e<4;e++)if(t.charCodeAt(e)!=this.readInt8(this.position()+4+e))return!1;return!0}createScalarList(t,e){let r=[];for(let c=0;c<e;++c){let f=t(c);f!==null&&r.push(f)}return r}createObjList(t,e){let r=[];for(let c=0;c<e;++c){let f=t(c);f!==null&&r.push(f.unpack())}return r}};var fr=class i{constructor(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,this.string_maps=null,this.text_encoder=new TextEncoder;let e;t?e=t:e=1024,this.bb=be.allocate(e),this.space=e}clear(){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,this.string_maps=null}forceDefaults(t){this.force_defaults=t}dataBuffer(){return this.bb}asUint8Array(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())}prep(t,e){t>this.minalign&&(this.minalign=t);let r=~(this.bb.capacity()-this.space+e)+1&t-1;for(;this.space<r+t+e;){let c=this.bb.capacity();this.bb=i.growByteBuffer(this.bb),this.space+=this.bb.capacity()-c}this.pad(r)}pad(t){for(let e=0;e<t;e++)this.bb.writeInt8(--this.space,0)}writeInt8(t){this.bb.writeInt8(this.space-=1,t)}writeInt16(t){this.bb.writeInt16(this.space-=2,t)}writeInt32(t){this.bb.writeInt32(this.space-=4,t)}writeInt64(t){this.bb.writeInt64(this.space-=8,t)}writeFloat32(t){this.bb.writeFloat32(this.space-=4,t)}writeFloat64(t){this.bb.writeFloat64(this.space-=8,t)}addInt8(t){this.prep(1,0),this.writeInt8(t)}addInt16(t){this.prep(2,0),this.writeInt16(t)}addInt32(t){this.prep(4,0),this.writeInt32(t)}addInt64(t){this.prep(8,0),this.writeInt64(t)}addFloat32(t){this.prep(4,0),this.writeFloat32(t)}addFloat64(t){this.prep(8,0),this.writeFloat64(t)}addFieldInt8(t,e,r){(this.force_defaults||e!=r)&&(this.addInt8(e),this.slot(t))}addFieldInt16(t,e,r){(this.force_defaults||e!=r)&&(this.addInt16(e),this.slot(t))}addFieldInt32(t,e,r){(this.force_defaults||e!=r)&&(this.addInt32(e),this.slot(t))}addFieldInt64(t,e,r){(this.force_defaults||e!==r)&&(this.addInt64(e),this.slot(t))}addFieldFloat32(t,e,r){(this.force_defaults||e!=r)&&(this.addFloat32(e),this.slot(t))}addFieldFloat64(t,e,r){(this.force_defaults||e!=r)&&(this.addFloat64(e),this.slot(t))}addFieldOffset(t,e,r){(this.force_defaults||e!=r)&&(this.addOffset(e),this.slot(t))}addFieldStruct(t,e,r){e!=r&&(this.nested(e),this.slot(t))}nested(t){if(t!=this.offset())throw new TypeError("FlatBuffers: struct must be serialized inline.")}notNested(){if(this.isNested)throw new TypeError("FlatBuffers: object serialization must not be nested.")}slot(t){this.vtable!==null&&(this.vtable[t]=this.offset())}offset(){return this.bb.capacity()-this.space}static growByteBuffer(t){let e=t.capacity();if(e&3221225472)throw new Error("FlatBuffers: cannot grow buffer beyond 2 gigabytes.");let r=e<<1,c=be.allocate(r);return c.setPosition(r-e),c.bytes().set(t.bytes(),r-e),c}addOffset(t){this.prep(4,0),this.writeInt32(this.offset()-t+4)}startObject(t){this.notNested(),this.vtable==null&&(this.vtable=[]),this.vtable_in_use=t;for(let e=0;e<t;e++)this.vtable[e]=0;this.isNested=!0,this.object_start=this.offset()}endObject(){if(this.vtable==null||!this.isNested)throw new Error("FlatBuffers: endObject called without startObject");this.addInt32(0);let t=this.offset(),e=this.vtable_in_use-1;for(;e>=0&&this.vtable[e]==0;e--);let r=e+1;for(;e>=0;e--)this.addInt16(this.vtable[e]!=0?t-this.vtable[e]:0);let c=2;this.addInt16(t-this.object_start);let f=(r+c)*2;this.addInt16(f);let _=0,b=this.space;t:for(e=0;e<this.vtables.length;e++){let g=this.bb.capacity()-this.vtables[e];if(f==this.bb.readInt16(g)){for(let T=2;T<f;T+=2)if(this.bb.readInt16(b+T)!=this.bb.readInt16(g+T))continue t;_=this.vtables[e];break}}return _?(this.space=this.bb.capacity()-t,this.bb.writeInt32(this.space,_-t)):(this.vtables.push(this.offset()),this.bb.writeInt32(this.bb.capacity()-t,this.offset()-t)),this.isNested=!1,t}finish(t,e,r){let c=r?4:0;if(e){let f=e;if(this.prep(this.minalign,8+c),f.length!=4)throw new TypeError("FlatBuffers: file identifier must be length "+4);for(let _=3;_>=0;_--)this.writeInt8(f.charCodeAt(_))}this.prep(this.minalign,4+c),this.addOffset(t),c&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)}finishSizePrefixed(t,e){this.finish(t,e,!0)}requiredField(t,e){let r=this.bb.capacity()-t,c=r-this.bb.readInt32(r);if(!(e<this.bb.readInt16(c)&&this.bb.readInt16(c+e)!=0))throw new TypeError("FlatBuffers: field "+e+" must be set")}startVector(t,e,r){this.notNested(),this.vector_num_elems=e,this.prep(4,t*e),this.prep(r,t*e)}endVector(){return this.writeInt32(this.vector_num_elems),this.offset()}createSharedString(t){if(!t)return 0;if(this.string_maps||(this.string_maps=new Map),this.string_maps.has(t))return this.string_maps.get(t);let e=this.createString(t);return this.string_maps.set(t,e),e}createString(t){if(t==null)return 0;let e;return t instanceof Uint8Array?e=t:e=this.text_encoder.encode(t),this.addInt8(0),this.startVector(1,e.length,1),this.bb.setPosition(this.space-=e.length),this.bb.bytes().set(e,this.space),this.endVector()}createByteVector(t){return t==null?0:(this.startVector(1,t.length,1),this.bb.setPosition(this.space-=t.length),this.bb.bytes().set(t,this.space),this.endVector())}createObjectOffset(t){return t===null?0:typeof t=="string"?this.createString(t):t.pack(this)}createObjectOffsetList(t){let e=[];for(let r=0;r<t.length;++r){let c=t[r];if(c!==null)e.push(this.createObjectOffset(c));else throw new TypeError("FlatBuffers: Argument for createObjectOffsetList cannot contain null.")}return e}createStructOffsetList(t,e){return e(this,t.length),this.createObjectOffsetList(t.slice().reverse()),this.endVector()}};var Sn;(function(i){i[i.BUFFER=0]="BUFFER"})(Sn||(Sn={}));var In;(function(i){i[i.LZ4_FRAME=0]="LZ4_FRAME",i[i.ZSTD=1]="ZSTD"})(In||(In={}));var Ps=class i{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsBodyCompression(t,e){return(e||new i).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsBodyCompression(t,e){return t.setPosition(t.position()+4),(e||new i).__init(t.readInt32(t.position())+t.position(),t)}codec(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt8(this.bb_pos+t):In.LZ4_FRAME}method(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt8(this.bb_pos+t):Sn.BUFFER}static startBodyCompression(t){t.startObject(2)}static addCodec(t,e){t.addFieldInt8(0,e,In.LZ4_FRAME)}static addMethod(t,e){t.addFieldInt8(1,e,Sn.BUFFER)}static endBodyCompression(t){return t.endObject()}static createBodyCompression(t,e,r){return i.startBodyCompression(t),i.addCodec(t,e),i.addMethod(t,r),i.endBodyCompression(t)}};var Vr=class{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}offset(){return this.bb.readInt64(this.bb_pos)}length(){return this.bb.readInt64(this.bb_pos+8)}static sizeOf(){return 16}static createBuffer(t,e,r){return t.prep(8,16),t.writeInt64(BigInt(r!=null?r:0)),t.writeInt64(BigInt(e!=null?e:0)),t.offset()}};var Hr=class{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}length(){return this.bb.readInt64(this.bb_pos)}nullCount(){return this.bb.readInt64(this.bb_pos+8)}static sizeOf(){return 16}static createFieldNode(t,e,r){return t.prep(8,16),t.writeInt64(BigInt(r!=null?r:0)),t.writeInt64(BigInt(e!=null?e:0)),t.offset()}};var ve=class i{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsRecordBatch(t,e){return(e||new i).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsRecordBatch(t,e){return t.setPosition(t.position()+4),(e||new i).__init(t.readInt32(t.position())+t.position(),t)}length(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt64(this.bb_pos+t):BigInt("0")}nodes(t,e){let r=this.bb.__offset(this.bb_pos,6);return r?(e||new Hr).__init(this.bb.__vector(this.bb_pos+r)+t*16,this.bb):null}nodesLength(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}buffers(t,e){let r=this.bb.__offset(this.bb_pos,8);return r?(e||new Vr).__init(this.bb.__vector(this.bb_pos+r)+t*16,this.bb):null}buffersLength(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}compression(t){let e=this.bb.__offset(this.bb_pos,10);return e?(t||new Ps).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}static startRecordBatch(t){t.startObject(4)}static addLength(t,e){t.addFieldInt64(0,e,BigInt("0"))}static addNodes(t,e){t.addFieldOffset(1,e,0)}static startNodesVector(t,e){t.startVector(16,e,8)}static addBuffers(t,e){t.addFieldOffset(2,e,0)}static startBuffersVector(t,e){t.startVector(16,e,8)}static addCompression(t,e){t.addFieldOffset(3,e,0)}static endRecordBatch(t){return t.endObject()}};var _i=class i{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsDictionaryBatch(t,e){return(e||new i).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDictionaryBatch(t,e){return t.setPosition(t.position()+4),(e||new i).__init(t.readInt32(t.position())+t.position(),t)}id(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt64(this.bb_pos+t):BigInt("0")}data(t){let e=this.bb.__offset(this.bb_pos,6);return e?(t||new ve).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}isDelta(){let t=this.bb.__offset(this.bb_pos,8);return t?!!this.bb.readInt8(this.bb_pos+t):!1}static startDictionaryBatch(t){t.startObject(3)}static addId(t,e){t.addFieldInt64(0,e,BigInt("0"))}static addData(t,e){t.addFieldOffset(1,e,0)}static addIsDelta(t,e){t.addFieldInt8(2,+e,0)}static endDictionaryBatch(t){return t.endObject()}};var Yi;(function(i){i[i.Little=0]="Little",i[i.Big=1]="Big"})(Yi||(Yi={}));var Tn;(function(i){i[i.DenseArray=0]="DenseArray"})(Tn||(Tn={}));var Ne=class i{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsInt(t,e){return(e||new i).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsInt(t,e){return t.setPosition(t.position()+4),(e||new i).__init(t.readInt32(t.position())+t.position(),t)}bitWidth(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):0}isSigned(){let t=this.bb.__offset(this.bb_pos,6);return t?!!this.bb.readInt8(this.bb_pos+t):!1}static startInt(t){t.startObject(2)}static addBitWidth(t,e){t.addFieldInt32(0,e,0)}static addIsSigned(t,e){t.addFieldInt8(1,+e,0)}static endInt(t){return t.endObject()}static createInt(t,e,r){return i.startInt(t),i.addBitWidth(t,e),i.addIsSigned(t,r),i.endInt(t)}};var ni=class i{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsDictionaryEncoding(t,e){return(e||new i).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDictionaryEncoding(t,e){return t.setPosition(t.position()+4),(e||new i).__init(t.readInt32(t.position())+t.position(),t)}id(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt64(this.bb_pos+t):BigInt("0")}indexType(t){let e=this.bb.__offset(this.bb_pos,6);return e?(t||new Ne).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}isOrdered(){let t=this.bb.__offset(this.bb_pos,8);return t?!!this.bb.readInt8(this.bb_pos+t):!1}dictionaryKind(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt16(this.bb_pos+t):Tn.DenseArray}static startDictionaryEncoding(t){t.startObject(4)}static addId(t,e){t.addFieldInt64(0,e,BigInt("0"))}static addIndexType(t,e){t.addFieldOffset(1,e,0)}static addIsOrdered(t,e){t.addFieldInt8(2,+e,0)}static addDictionaryKind(t,e){t.addFieldInt16(3,e,Tn.DenseArray)}static endDictionaryEncoding(t){return t.endObject()}};var Xt=class i{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsKeyValue(t,e){return(e||new i).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsKeyValue(t,e){return t.setPosition(t.position()+4),(e||new i).__init(t.readInt32(t.position())+t.position(),t)}key(t){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}value(t){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__string(this.bb_pos+e,t):null}static startKeyValue(t){t.startObject(2)}static addKey(t,e){t.addFieldOffset(0,e,0)}static addValue(t,e){t.addFieldOffset(1,e,0)}static endKeyValue(t){return t.endObject()}static createKeyValue(t,e,r){return i.startKeyValue(t),i.addKey(t,e),i.addValue(t,r),i.endKeyValue(t)}};var jn=class i{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsBinary(t,e){return(e||new i).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsBinary(t,e){return t.setPosition(t.position()+4),(e||new i).__init(t.readInt32(t.position())+t.position(),t)}static startBinary(t){t.startObject(0)}static endBinary(t){return t.endObject()}static createBinary(t){return i.startBinary(t),i.endBinary(t)}};var Dn=class i{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsBool(t,e){return(e||new i).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsBool(t,e){return t.setPosition(t.position()+4),(e||new i).__init(t.readInt32(t.position())+t.position(),t)}static startBool(t){t.startObject(0)}static endBool(t){return t.endObject()}static createBool(t){return i.startBool(t),i.endBool(t)}};var Gi=class i{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsDate(t,e){return(e||new i).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDate(t,e){return t.setPosition(t.position()+4),(e||new i).__init(t.readInt32(t.position())+t.position(),t)}unit(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):$t.MILLISECOND}static startDate(t){t.startObject(1)}static addUnit(t,e){t.addFieldInt16(0,e,$t.MILLISECOND)}static endDate(t){return t.endObject()}static createDate(t,e){return i.startDate(t),i.addUnit(t,e),i.endDate(t)}};var si=class i{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsDecimal(t,e){return(e||new i).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDecimal(t,e){return t.setPosition(t.position()+4),(e||new i).__init(t.readInt32(t.position())+t.position(),t)}precision(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):0}scale(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt32(this.bb_pos+t):0}bitWidth(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readInt32(this.bb_pos+t):128}static startDecimal(t){t.startObject(3)}static addPrecision(t,e){t.addFieldInt32(0,e,0)}static addScale(t,e){t.addFieldInt32(1,e,0)}static addBitWidth(t,e){t.addFieldInt32(2,e,128)}static endDecimal(t){return t.endObject()}static createDecimal(t,e,r,c){return i.startDecimal(t),i.addPrecision(t,e),i.addScale(t,r),i.addBitWidth(t,c),i.endDecimal(t)}};var Ki=class i{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsDuration(t,e){return(e||new i).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDuration(t,e){return t.setPosition(t.position()+4),(e||new i).__init(t.readInt32(t.position())+t.position(),t)}unit(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):Y.MILLISECOND}static startDuration(t){t.startObject(1)}static addUnit(t,e){t.addFieldInt16(0,e,Y.MILLISECOND)}static endDuration(t){return t.endObject()}static createDuration(t,e){return i.startDuration(t),i.addUnit(t,e),i.endDuration(t)}};var qi=class i{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsFixedSizeBinary(t,e){return(e||new i).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFixedSizeBinary(t,e){return t.setPosition(t.position()+4),(e||new i).__init(t.readInt32(t.position())+t.position(),t)}byteWidth(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):0}static startFixedSizeBinary(t){t.startObject(1)}static addByteWidth(t,e){t.addFieldInt32(0,e,0)}static endFixedSizeBinary(t){return t.endObject()}static createFixedSizeBinary(t,e){return i.startFixedSizeBinary(t),i.addByteWidth(t,e),i.endFixedSizeBinary(t)}};var Ji=class i{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsFixedSizeList(t,e){return(e||new i).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFixedSizeList(t,e){return t.setPosition(t.position()+4),(e||new i).__init(t.readInt32(t.position())+t.position(),t)}listSize(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):0}static startFixedSizeList(t){t.startObject(1)}static addListSize(t,e){t.addFieldInt32(0,e,0)}static endFixedSizeList(t){return t.endObject()}static createFixedSizeList(t,e){return i.startFixedSizeList(t),i.addListSize(t,e),i.endFixedSizeList(t)}};var Xi=class i{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsFloatingPoint(t,e){return(e||new i).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFloatingPoint(t,e){return t.setPosition(t.position()+4),(e||new i).__init(t.readInt32(t.position())+t.position(),t)}precision(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):Ot.HALF}static startFloatingPoint(t){t.startObject(1)}static addPrecision(t,e){t.addFieldInt16(0,e,Ot.HALF)}static endFloatingPoint(t){return t.endObject()}static createFloatingPoint(t,e){return i.startFloatingPoint(t),i.addPrecision(t,e),i.endFloatingPoint(t)}};var Zi=class i{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsInterval(t,e){return(e||new i).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsInterval(t,e){return t.setPosition(t.position()+4),(e||new i).__init(t.readInt32(t.position())+t.position(),t)}unit(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):Jt.YEAR_MONTH}static startInterval(t){t.startObject(1)}static addUnit(t,e){t.addFieldInt16(0,e,Jt.YEAR_MONTH)}static endInterval(t){return t.endObject()}static createInterval(t,e){return i.startInterval(t),i.addUnit(t,e),i.endInterval(t)}};var Bn=class i{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsLargeBinary(t,e){return(e||new i).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsLargeBinary(t,e){return t.setPosition(t.position()+4),(e||new i).__init(t.readInt32(t.position())+t.position(),t)}static startLargeBinary(t){t.startObject(0)}static endLargeBinary(t){return t.endObject()}static createLargeBinary(t){return i.startLargeBinary(t),i.endLargeBinary(t)}};var Fn=class i{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsLargeUtf8(t,e){return(e||new i).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsLargeUtf8(t,e){return t.setPosition(t.position()+4),(e||new i).__init(t.readInt32(t.position())+t.position(),t)}static startLargeUtf8(t){t.startObject(0)}static endLargeUtf8(t){return t.endObject()}static createLargeUtf8(t){return i.startLargeUtf8(t),i.endLargeUtf8(t)}};var An=class i{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsList(t,e){return(e||new i).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsList(t,e){return t.setPosition(t.position()+4),(e||new i).__init(t.readInt32(t.position())+t.position(),t)}static startList(t){t.startObject(0)}static endList(t){return t.endObject()}static createList(t){return i.startList(t),i.endList(t)}};var Qi=class i{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsMap(t,e){return(e||new i).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsMap(t,e){return t.setPosition(t.position()+4),(e||new i).__init(t.readInt32(t.position())+t.position(),t)}keysSorted(){let t=this.bb.__offset(this.bb_pos,4);return t?!!this.bb.readInt8(this.bb_pos+t):!1}static startMap(t){t.startObject(1)}static addKeysSorted(t,e){t.addFieldInt8(0,+e,0)}static endMap(t){return t.endObject()}static createMap(t,e){return i.startMap(t),i.addKeysSorted(t,e),i.endMap(t)}};var xn=class i{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsNull(t,e){return(e||new i).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsNull(t,e){return t.setPosition(t.position()+4),(e||new i).__init(t.readInt32(t.position())+t.position(),t)}static startNull(t){t.startObject(0)}static endNull(t){return t.endObject()}static createNull(t){return i.startNull(t),i.endNull(t)}};var kn=class i{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsStruct_(t,e){return(e||new i).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsStruct_(t,e){return t.setPosition(t.position()+4),(e||new i).__init(t.readInt32(t.position())+t.position(),t)}static startStruct_(t){t.startObject(0)}static endStruct_(t){return t.endObject()}static createStruct_(t){return i.startStruct_(t),i.endStruct_(t)}};var yi=class i{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsTime(t,e){return(e||new i).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsTime(t,e){return t.setPosition(t.position()+4),(e||new i).__init(t.readInt32(t.position())+t.position(),t)}unit(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):Y.MILLISECOND}bitWidth(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt32(this.bb_pos+t):32}static startTime(t){t.startObject(2)}static addUnit(t,e){t.addFieldInt16(0,e,Y.MILLISECOND)}static addBitWidth(t,e){t.addFieldInt32(1,e,32)}static endTime(t){return t.endObject()}static createTime(t,e,r){return i.startTime(t),i.addUnit(t,e),i.addBitWidth(t,r),i.endTime(t)}};var mi=class i{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsTimestamp(t,e){return(e||new i).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsTimestamp(t,e){return t.setPosition(t.position()+4),(e||new i).__init(t.readInt32(t.position())+t.position(),t)}unit(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):Y.SECOND}timezone(t){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__string(this.bb_pos+e,t):null}static startTimestamp(t){t.startObject(2)}static addUnit(t,e){t.addFieldInt16(0,e,Y.SECOND)}static addTimezone(t,e){t.addFieldOffset(1,e,0)}static endTimestamp(t){return t.endObject()}static createTimestamp(t,e,r){return i.startTimestamp(t),i.addUnit(t,e),i.addTimezone(t,r),i.endTimestamp(t)}};var Pe=class i{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsUnion(t,e){return(e||new i).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsUnion(t,e){return t.setPosition(t.position()+4),(e||new i).__init(t.readInt32(t.position())+t.position(),t)}mode(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):Ut.Sparse}typeIds(t){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readInt32(this.bb.__vector(this.bb_pos+e)+t*4):0}typeIdsLength(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}typeIdsArray(){let t=this.bb.__offset(this.bb_pos,6);return t?new Int32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}static startUnion(t){t.startObject(2)}static addMode(t,e){t.addFieldInt16(0,e,Ut.Sparse)}static addTypeIds(t,e){t.addFieldOffset(1,e,0)}static createTypeIdsVector(t,e){t.startVector(4,e.length,4);for(let r=e.length-1;r>=0;r--)t.addInt32(e[r]);return t.endVector()}static startTypeIdsVector(t,e){t.startVector(4,e,4)}static endUnion(t){return t.endObject()}static createUnion(t,e,r){return i.startUnion(t),i.addMode(t,e),i.addTypeIds(t,r),i.endUnion(t)}};var En=class i{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsUtf8(t,e){return(e||new i).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsUtf8(t,e){return t.setPosition(t.position()+4),(e||new i).__init(t.readInt32(t.position())+t.position(),t)}static startUtf8(t){t.startObject(0)}static endUtf8(t){return t.endObject()}static createUtf8(t){return i.startUtf8(t),i.endUtf8(t)}};var Mt;(function(i){i[i.NONE=0]="NONE",i[i.Null=1]="Null",i[i.Int=2]="Int",i[i.FloatingPoint=3]="FloatingPoint",i[i.Binary=4]="Binary",i[i.Utf8=5]="Utf8",i[i.Bool=6]="Bool",i[i.Decimal=7]="Decimal",i[i.Date=8]="Date",i[i.Time=9]="Time",i[i.Timestamp=10]="Timestamp",i[i.Interval=11]="Interval",i[i.List=12]="List",i[i.Struct_=13]="Struct_",i[i.Union=14]="Union",i[i.FixedSizeBinary=15]="FixedSizeBinary",i[i.FixedSizeList=16]="FixedSizeList",i[i.Map=17]="Map",i[i.Duration=18]="Duration",i[i.LargeBinary=19]="LargeBinary",i[i.LargeUtf8=20]="LargeUtf8",i[i.LargeList=21]="LargeList",i[i.RunEndEncoded=22]="RunEndEncoded"})(Mt||(Mt={}));var se=class i{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsField(t,e){return(e||new i).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsField(t,e){return t.setPosition(t.position()+4),(e||new i).__init(t.readInt32(t.position())+t.position(),t)}name(t){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}nullable(){let t=this.bb.__offset(this.bb_pos,6);return t?!!this.bb.readInt8(this.bb_pos+t):!1}typeType(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readUint8(this.bb_pos+t):Mt.NONE}type(t){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.__union(t,this.bb_pos+e):null}dictionary(t){let e=this.bb.__offset(this.bb_pos,12);return e?(t||new ni).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}children(t,e){let r=this.bb.__offset(this.bb_pos,14);return r?(e||new i).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+t*4),this.bb):null}childrenLength(){let t=this.bb.__offset(this.bb_pos,14);return t?this.bb.__vector_len(this.bb_pos+t):0}customMetadata(t,e){let r=this.bb.__offset(this.bb_pos,16);return r?(e||new Xt).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+t*4),this.bb):null}customMetadataLength(){let t=this.bb.__offset(this.bb_pos,16);return t?this.bb.__vector_len(this.bb_pos+t):0}static startField(t){t.startObject(7)}static addName(t,e){t.addFieldOffset(0,e,0)}static addNullable(t,e){t.addFieldInt8(1,+e,0)}static addTypeType(t,e){t.addFieldInt8(2,e,Mt.NONE)}static addType(t,e){t.addFieldOffset(3,e,0)}static addDictionary(t,e){t.addFieldOffset(4,e,0)}static addChildren(t,e){t.addFieldOffset(5,e,0)}static createChildrenVector(t,e){t.startVector(4,e.length,4);for(let r=e.length-1;r>=0;r--)t.addOffset(e[r]);return t.endVector()}static startChildrenVector(t,e){t.startVector(4,e,4)}static addCustomMetadata(t,e){t.addFieldOffset(6,e,0)}static createCustomMetadataVector(t,e){t.startVector(4,e.length,4);for(let r=e.length-1;r>=0;r--)t.addOffset(e[r]);return t.endVector()}static startCustomMetadataVector(t,e){t.startVector(4,e,4)}static endField(t){return t.endObject()}};var ue=class i{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsSchema(t,e){return(e||new i).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsSchema(t,e){return t.setPosition(t.position()+4),(e||new i).__init(t.readInt32(t.position())+t.position(),t)}endianness(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):Yi.Little}fields(t,e){let r=this.bb.__offset(this.bb_pos,6);return r?(e||new se).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+t*4),this.bb):null}fieldsLength(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}customMetadata(t,e){let r=this.bb.__offset(this.bb_pos,8);return r?(e||new Xt).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+t*4),this.bb):null}customMetadataLength(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}features(t){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.readInt64(this.bb.__vector(this.bb_pos+e)+t*8):BigInt(0)}featuresLength(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__vector_len(this.bb_pos+t):0}static startSchema(t){t.startObject(4)}static addEndianness(t,e){t.addFieldInt16(0,e,Yi.Little)}static addFields(t,e){t.addFieldOffset(1,e,0)}static createFieldsVector(t,e){t.startVector(4,e.length,4);for(let r=e.length-1;r>=0;r--)t.addOffset(e[r]);return t.endVector()}static startFieldsVector(t,e){t.startVector(4,e,4)}static addCustomMetadata(t,e){t.addFieldOffset(2,e,0)}static createCustomMetadataVector(t,e){t.startVector(4,e.length,4);for(let r=e.length-1;r>=0;r--)t.addOffset(e[r]);return t.endVector()}static startCustomMetadataVector(t,e){t.startVector(4,e,4)}static addFeatures(t,e){t.addFieldOffset(3,e,0)}static createFeaturesVector(t,e){t.startVector(8,e.length,8);for(let r=e.length-1;r>=0;r--)t.addInt64(e[r]);return t.endVector()}static startFeaturesVector(t,e){t.startVector(8,e,8)}static endSchema(t){return t.endObject()}static finishSchemaBuffer(t,e){t.finish(e)}static finishSizePrefixedSchemaBuffer(t,e){t.finish(e,void 0,!0)}static createSchema(t,e,r,c,f){return i.startSchema(t),i.addEndianness(t,e),i.addFields(t,r),i.addCustomMetadata(t,c),i.addFeatures(t,f),i.endSchema(t)}};var vt;(function(i){i[i.NONE=0]="NONE",i[i.Schema=1]="Schema",i[i.DictionaryBatch=2]="DictionaryBatch",i[i.RecordBatch=3]="RecordBatch",i[i.Tensor=4]="Tensor",i[i.SparseTensor=5]="SparseTensor"})(vt||(vt={}));var j;(function(i){i[i.NONE=0]="NONE",i[i.Null=1]="Null",i[i.Int=2]="Int",i[i.Float=3]="Float",i[i.Binary=4]="Binary",i[i.Utf8=5]="Utf8",i[i.Bool=6]="Bool",i[i.Decimal=7]="Decimal",i[i.Date=8]="Date",i[i.Time=9]="Time",i[i.Timestamp=10]="Timestamp",i[i.Interval=11]="Interval",i[i.List=12]="List",i[i.Struct=13]="Struct",i[i.Union=14]="Union",i[i.FixedSizeBinary=15]="FixedSizeBinary",i[i.FixedSizeList=16]="FixedSizeList",i[i.Map=17]="Map",i[i.Duration=18]="Duration",i[i.LargeBinary=19]="LargeBinary",i[i.LargeUtf8=20]="LargeUtf8",i[i.Dictionary=-1]="Dictionary",i[i.Int8=-2]="Int8",i[i.Int16=-3]="Int16",i[i.Int32=-4]="Int32",i[i.Int64=-5]="Int64",i[i.Uint8=-6]="Uint8",i[i.Uint16=-7]="Uint16",i[i.Uint32=-8]="Uint32",i[i.Uint64=-9]="Uint64",i[i.Float16=-10]="Float16",i[i.Float32=-11]="Float32",i[i.Float64=-12]="Float64",i[i.DateDay=-13]="DateDay",i[i.DateMillisecond=-14]="DateMillisecond",i[i.TimestampSecond=-15]="TimestampSecond",i[i.TimestampMillisecond=-16]="TimestampMillisecond",i[i.TimestampMicrosecond=-17]="TimestampMicrosecond",i[i.TimestampNanosecond=-18]="TimestampNanosecond",i[i.TimeSecond=-19]="TimeSecond",i[i.TimeMillisecond=-20]="TimeMillisecond",i[i.TimeMicrosecond=-21]="TimeMicrosecond",i[i.TimeNanosecond=-22]="TimeNanosecond",i[i.DenseUnion=-23]="DenseUnion",i[i.SparseUnion=-24]="SparseUnion",i[i.IntervalDayTime=-25]="IntervalDayTime",i[i.IntervalYearMonth=-26]="IntervalYearMonth",i[i.DurationSecond=-27]="DurationSecond",i[i.DurationMillisecond=-28]="DurationMillisecond",i[i.DurationMicrosecond=-29]="DurationMicrosecond",i[i.DurationNanosecond=-30]="DurationNanosecond"})(j||(j={}));var Be;(function(i){i[i.OFFSET=0]="OFFSET",i[i.DATA=1]="DATA",i[i.VALIDITY=2]="VALIDITY",i[i.TYPE=3]="TYPE"})(Be||(Be={}));var tc={};$i(tc,{clampRange:()=>Rn,createElementComparator:()=>rr,wrapIndex:()=>hr});var Ma={};$i(Ma,{valueToString:()=>Ve});function Ve(i){if(i===null)return"null";if(i===void 0)return"undefined";switch(typeof i){case"number":return"".concat(i);case"bigint":return"".concat(i);case"string":return'"'.concat(i,'"')}return typeof i[Symbol.toPrimitive]=="function"?i[Symbol.toPrimitive]("string"):ArrayBuffer.isView(i)?i instanceof BigInt64Array||i instanceof BigUint64Array?"[".concat([...i].map(t=>Ve(t)),"]"):"[".concat(i,"]"):ArrayBuffer.isView(i)?"[".concat(i,"]"):JSON.stringify(i,(t,e)=>typeof e=="bigint"?"".concat(e):e)}var Na={};$i(Na,{BN:()=>Un,bigNumToBigInt:()=>Il,bigNumToNumber:()=>La,bigNumToString:()=>$r,isArrowBigNumSymbol:()=>Sl});function wt(i){if(typeof i=="bigint"&&(i<Number.MIN_SAFE_INTEGER||i>Number.MAX_SAFE_INTEGER))throw new TypeError("".concat(i," is not safe to convert to a number."));return Number(i)}function Ra(i,t){return wt(i/t)+wt(i%t)/wt(t)}var Sl=Symbol.for("isArrowBigNum");function He(i,...t){return t.length===0?Object.setPrototypeOf(mt(this.TypedArray,i),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(i,...t),this.constructor.prototype)}He.prototype[Sl]=!0;He.prototype.toJSON=function(){return'"'.concat($r(this),'"')};He.prototype.valueOf=function(i){return La(this,i)};He.prototype.toString=function(){return $r(this)};He.prototype[Symbol.toPrimitive]=function(i="default"){switch(i){case"number":return La(this);case"string":return $r(this);case"default":return Il(this)}return $r(this)};function zr(...i){return He.apply(this,i)}function Wr(...i){return He.apply(this,i)}function On(...i){return He.apply(this,i)}Object.setPrototypeOf(zr.prototype,Object.create(Int32Array.prototype));Object.setPrototypeOf(Wr.prototype,Object.create(Uint32Array.prototype));Object.setPrototypeOf(On.prototype,Object.create(Uint32Array.prototype));Object.assign(zr.prototype,He.prototype,{constructor:zr,signed:!0,TypedArray:Int32Array,BigIntArray:BigInt64Array});Object.assign(Wr.prototype,He.prototype,{constructor:Wr,signed:!1,TypedArray:Uint32Array,BigIntArray:BigUint64Array});Object.assign(On.prototype,He.prototype,{constructor:On,signed:!0,TypedArray:Uint32Array,BigIntArray:BigUint64Array});var lw=BigInt(4294967296)*BigInt(4294967296),uw=lw-BigInt(1);function La(i,t){let{buffer:e,byteOffset:r,byteLength:c,signed:f}=i,_=new BigUint64Array(e,r,c/8),b=f&&_.at(-1)&BigInt(1)<<BigInt(63),g=BigInt(0),T=0;if(b){for(let D of _)g|=(D^uw)*(BigInt(1)<<BigInt(64*T++));g*=BigInt(-1),g-=BigInt(1)}else for(let D of _)g|=D*(BigInt(1)<<BigInt(64*T++));if(typeof t=="number"){let D=BigInt(Math.pow(10,t)),U=g/D,M=g%D;return wt(U)+wt(M)/wt(D)}return wt(g)}function $r(i){if(i.byteLength===8){let f=new i.BigIntArray(i.buffer,i.byteOffset,1);return"".concat(f[0])}if(!i.signed)return Ca(i);let t=new Uint16Array(i.buffer,i.byteOffset,i.byteLength/2);if(new Int16Array([t.at(-1)])[0]>=0)return Ca(i);t=t.slice();let r=1;for(let f=0;f<t.length;f++){let _=t[f],b=~_+r;t[f]=b,r&=_===0?1:0}let c=Ca(t);return"-".concat(c)}function Il(i){return i.byteLength===8?new i.BigIntArray(i.buffer,i.byteOffset,1)[0]:$r(i)}function Ca(i){let t="",e=new Uint32Array(2),r=new Uint16Array(i.buffer,i.byteOffset,i.byteLength/2),c=new Uint32Array((r=new Uint16Array(r).reverse()).buffer),f=-1,_=r.length-1;do{for(e[0]=r[f=0];f<_;)r[f++]=e[1]=e[0]/10,e[0]=(e[0]-e[1]*10<<16)+r[f];r[f]=e[1]=e[0]/10,e[0]=e[0]-e[1]*10,t="".concat(e[0]).concat(t)}while(c[0]||c[1]||c[2]||c[3]);return t!=null?t:"0"}var Un=class i{static new(t,e){switch(e){case!0:return new zr(t);case!1:return new Wr(t)}switch(t.constructor){case Int8Array:case Int16Array:case Int32Array:case BigInt64Array:return new zr(t)}return t.byteLength===16?new On(t):new Wr(t)}static signed(t){return new zr(t)}static unsigned(t){return new Wr(t)}static decimal(t){return new On(t)}constructor(t,e){return i.new(t,e)}};var Tl,jl,Dl,Bl,Fl,Al,xl,kl,El,Ol,Ul,Ml,Rl,Cl,Ll,Nl,Pl,Vl,Hl,zl,Wl,$l,z=class i{static isNull(t){return(t==null?void 0:t.typeId)===j.Null}static isInt(t){return(t==null?void 0:t.typeId)===j.Int}static isFloat(t){return(t==null?void 0:t.typeId)===j.Float}static isBinary(t){return(t==null?void 0:t.typeId)===j.Binary}static isLargeBinary(t){return(t==null?void 0:t.typeId)===j.LargeBinary}static isUtf8(t){return(t==null?void 0:t.typeId)===j.Utf8}static isLargeUtf8(t){return(t==null?void 0:t.typeId)===j.LargeUtf8}static isBool(t){return(t==null?void 0:t.typeId)===j.Bool}static isDecimal(t){return(t==null?void 0:t.typeId)===j.Decimal}static isDate(t){return(t==null?void 0:t.typeId)===j.Date}static isTime(t){return(t==null?void 0:t.typeId)===j.Time}static isTimestamp(t){return(t==null?void 0:t.typeId)===j.Timestamp}static isInterval(t){return(t==null?void 0:t.typeId)===j.Interval}static isDuration(t){return(t==null?void 0:t.typeId)===j.Duration}static isList(t){return(t==null?void 0:t.typeId)===j.List}static isStruct(t){return(t==null?void 0:t.typeId)===j.Struct}static isUnion(t){return(t==null?void 0:t.typeId)===j.Union}static isFixedSizeBinary(t){return(t==null?void 0:t.typeId)===j.FixedSizeBinary}static isFixedSizeList(t){return(t==null?void 0:t.typeId)===j.FixedSizeList}static isMap(t){return(t==null?void 0:t.typeId)===j.Map}static isDictionary(t){return(t==null?void 0:t.typeId)===j.Dictionary}static isDenseUnion(t){return i.isUnion(t)&&t.mode===Ut.Dense}static isSparseUnion(t){return i.isUnion(t)&&t.mode===Ut.Sparse}constructor(t){this.typeId=t}};Tl=Symbol.toStringTag;z[Tl]=(i=>(i.children=null,i.ArrayType=Array,i.OffsetArrayType=Int32Array,i[Symbol.toStringTag]="DataType"))(z.prototype);var ae=class extends z{constructor(){super(j.Null)}toString(){return"Null"}};jl=Symbol.toStringTag;ae[jl]=(i=>i[Symbol.toStringTag]="Null")(ae.prototype);var Zt=class extends z{constructor(t,e){super(j.Int),this.isSigned=t,this.bitWidth=e}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 ".concat(this[Symbol.toStringTag]," type"))}toString(){return"".concat(this.isSigned?"I":"Ui","nt").concat(this.bitWidth)}};Dl=Symbol.toStringTag;Zt[Dl]=(i=>(i.isSigned=null,i.bitWidth=null,i[Symbol.toStringTag]="Int"))(Zt.prototype);var Vs=class extends Zt{constructor(){super(!0,8)}get ArrayType(){return Int8Array}},Hs=class extends Zt{constructor(){super(!0,16)}get ArrayType(){return Int16Array}},oi=class extends Zt{constructor(){super(!0,32)}get ArrayType(){return Int32Array}},zs=class extends Zt{constructor(){super(!0,64)}get ArrayType(){return BigInt64Array}},Ws=class extends Zt{constructor(){super(!1,8)}get ArrayType(){return Uint8Array}},$s=class extends Zt{constructor(){super(!1,16)}get ArrayType(){return Uint16Array}},Ys=class extends Zt{constructor(){super(!1,32)}get ArrayType(){return Uint32Array}},Gs=class extends Zt{constructor(){super(!1,64)}get ArrayType(){return BigUint64Array}};Object.defineProperty(Vs.prototype,"ArrayType",{value:Int8Array});Object.defineProperty(Hs.prototype,"ArrayType",{value:Int16Array});Object.defineProperty(oi.prototype,"ArrayType",{value:Int32Array});Object.defineProperty(zs.prototype,"ArrayType",{value:BigInt64Array});Object.defineProperty(Ws.prototype,"ArrayType",{value:Uint8Array});Object.defineProperty($s.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(Ys.prototype,"ArrayType",{value:Uint32Array});Object.defineProperty(Gs.prototype,"ArrayType",{value:BigUint64Array});var Fe=class extends z{constructor(t){super(j.Float),this.precision=t}get ArrayType(){switch(this.precision){case Ot.HALF:return Uint16Array;case Ot.SINGLE:return Float32Array;case Ot.DOUBLE:return Float64Array}throw new Error("Unrecognized ".concat(this[Symbol.toStringTag]," type"))}toString(){return"Float".concat(this.precision<<5||16)}};Bl=Symbol.toStringTag;Fe[Bl]=(i=>(i.precision=null,i[Symbol.toStringTag]="Float"))(Fe.prototype);var Ks=class extends Fe{constructor(){super(Ot.HALF)}},qs=class extends Fe{constructor(){super(Ot.SINGLE)}},Js=class extends Fe{constructor(){super(Ot.DOUBLE)}};Object.defineProperty(Ks.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(qs.prototype,"ArrayType",{value:Float32Array});Object.defineProperty(Js.prototype,"ArrayType",{value:Float64Array});var bi=class extends z{constructor(){super(j.Binary)}toString(){return"Binary"}};Fl=Symbol.toStringTag;bi[Fl]=(i=>(i.ArrayType=Uint8Array,i[Symbol.toStringTag]="Binary"))(bi.prototype);var vi=class extends z{constructor(){super(j.LargeBinary)}toString(){return"LargeBinary"}};Al=Symbol.toStringTag;vi[Al]=(i=>(i.ArrayType=Uint8Array,i.OffsetArrayType=BigInt64Array,i[Symbol.toStringTag]="LargeBinary"))(vi.prototype);var gi=class extends z{constructor(){super(j.Utf8)}toString(){return"Utf8"}};xl=Symbol.toStringTag;gi[xl]=(i=>(i.ArrayType=Uint8Array,i[Symbol.toStringTag]="Utf8"))(gi.prototype);var wi=class extends z{constructor(){super(j.LargeUtf8)}toString(){return"LargeUtf8"}};kl=Symbol.toStringTag;wi[kl]=(i=>(i.ArrayType=Uint8Array,i.OffsetArrayType=BigInt64Array,i[Symbol.toStringTag]="LargeUtf8"))(wi.prototype);var Si=class extends z{constructor(){super(j.Bool)}toString(){return"Bool"}};El=Symbol.toStringTag;Si[El]=(i=>(i.ArrayType=Uint8Array,i[Symbol.toStringTag]="Bool"))(Si.prototype);var Ii=class extends z{constructor(t,e,r=128){super(j.Decimal),this.scale=t,this.precision=e,this.bitWidth=r}toString(){return"Decimal[".concat(this.precision,"e").concat(this.scale>0?"+":"").concat(this.scale,"]")}};Ol=Symbol.toStringTag;Ii[Ol]=(i=>(i.scale=null,i.precision=null,i.ArrayType=Uint32Array,i[Symbol.toStringTag]="Decimal"))(Ii.prototype);var Ti=class extends z{constructor(t){super(j.Date),this.unit=t}toString(){return"Date".concat((this.unit+1)*32,"<").concat($t[this.unit],">")}get ArrayType(){return this.unit===$t.DAY?Int32Array:BigInt64Array}};Ul=Symbol.toStringTag;Ti[Ul]=(i=>(i.unit=null,i[Symbol.toStringTag]="Date"))(Ti.prototype);var ji=class extends z{constructor(t,e){super(j.Time),this.unit=t,this.bitWidth=e}toString(){return"Time".concat(this.bitWidth,"<").concat(Y[this.unit],">")}get ArrayType(){switch(this.bitWidth){case 32:return Int32Array;case 64:return BigInt64Array}throw new Error("Unrecognized ".concat(this[Symbol.toStringTag]," type"))}};Ml=Symbol.toStringTag;ji[Ml]=(i=>(i.unit=null,i.bitWidth=null,i[Symbol.toStringTag]="Time"))(ji.prototype);var Di=class extends z{constructor(t,e){super(j.Timestamp),this.unit=t,this.timezone=e}toString(){return"Timestamp<".concat(Y[this.unit]).concat(this.timezone?", ".concat(this.timezone):"",">")}};Rl=Symbol.toStringTag;Di[Rl]=(i=>(i.unit=null,i.timezone=null,i.ArrayType=BigInt64Array,i[Symbol.toStringTag]="Timestamp"))(Di.prototype);var Bi=class extends z{constructor(t){super(j.Interval),this.unit=t}toString(){return"Interval<".concat(Jt[this.unit],">")}};Cl=Symbol.toStringTag;Bi[Cl]=(i=>(i.unit=null,i.ArrayType=Int32Array,i[Symbol.toStringTag]="Interval"))(Bi.prototype);var Fi=class extends z{constructor(t){super(j.Duration),this.unit=t}toString(){return"Duration<".concat(Y[this.unit],">")}};Ll=Symbol.toStringTag;Fi[Ll]=(i=>(i.unit=null,i.ArrayType=BigInt64Array,i[Symbol.toStringTag]="Duration"))(Fi.prototype);var ze=class extends z{constructor(t){super(j.List),this.children=[t]}toString(){return"List<".concat(this.valueType,">")}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}};Nl=Symbol.toStringTag;ze[Nl]=(i=>(i.children=null,i[Symbol.toStringTag]="List"))(ze.prototype);var Ct=class extends z{constructor(t){super(j.Struct),this.children=t}toString(){return"Struct<{".concat(this.children.map(t=>"".concat(t.name,":").concat(t.type)).join(", "),"}>")}};Pl=Symbol.toStringTag;Ct[Pl]=(i=>(i.children=null,i[Symbol.toStringTag]="Struct"))(Ct.prototype);var We=class extends z{constructor(t,e,r){super(j.Union),this.mode=t,this.children=r,this.typeIds=e=Int32Array.from(e),this.typeIdToChildIndex=e.reduce((c,f,_)=>(c[f]=_)&&c||c,Object.create(null))}toString(){return"".concat(this[Symbol.toStringTag],"<").concat(this.children.map(t=>"".concat(t.type)).join(" | "),">")}};Vl=Symbol.toStringTag;We[Vl]=(i=>(i.mode=null,i.typeIds=null,i.children=null,i.typeIdToChildIndex=null,i.ArrayType=Int8Array,i[Symbol.toStringTag]="Union"))(We.prototype);var Ai=class extends z{constructor(t){super(j.FixedSizeBinary),this.byteWidth=t}toString(){return"FixedSizeBinary[".concat(this.byteWidth,"]")}};Hl=Symbol.toStringTag;Ai[Hl]=(i=>(i.byteWidth=null,i.ArrayType=Uint8Array,i[Symbol.toStringTag]="FixedSizeBinary"))(Ai.prototype);var $e=class extends z{constructor(t,e){super(j.FixedSizeList),this.listSize=t,this.children=[e]}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}toString(){return"FixedSizeList[".concat(this.listSize,"]<").concat(this.valueType,">")}};zl=Symbol.toStringTag;$e[zl]=(i=>(i.children=null,i.listSize=null,i[Symbol.toStringTag]="FixedSizeList"))($e.prototype);var Ye=class extends z{constructor(t,e=!1){var r,c,f;if(super(j.Map),this.children=[t],this.keysSorted=e,t&&(t.name="entries",!((r=t==null?void 0:t.type)===null||r===void 0)&&r.children)){let _=(c=t==null?void 0:t.type)===null||c===void 0?void 0:c.children[0];_&&(_.name="key");let b=(f=t==null?void 0:t.type)===null||f===void 0?void 0:f.children[1];b&&(b.name="value")}}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<{".concat(this.children[0].type.children.map(t=>"".concat(t.name,":").concat(t.type)).join(", "),"}>")}};Wl=Symbol.toStringTag;Ye[Wl]=(i=>(i.children=null,i.keysSorted=null,i[Symbol.toStringTag]="Map_"))(Ye.prototype);var dw=(i=>()=>++i)(-1),ge=class extends z{constructor(t,e,r,c){super(j.Dictionary),this.indices=e,this.dictionary=t,this.isOrdered=c||!1,this.id=r==null?dw():wt(r)}get children(){return this.dictionary.children}get valueType(){return this.dictionary}get ArrayType(){return this.dictionary.ArrayType}toString(){return"Dictionary<".concat(this.indices,", ").concat(this.dictionary,">")}};$l=Symbol.toStringTag;ge[$l]=(i=>(i.id=null,i.indices=null,i.isOrdered=null,i.dictionary=null,i[Symbol.toStringTag]="Dictionary"))(ge.prototype);function we(i){let t=i;switch(i.typeId){case j.Decimal:return i.bitWidth/32;case j.Interval:return 1+t.unit;case j.FixedSizeList:return t.listSize;case j.FixedSizeBinary:return t.byteWidth;default:return 1}}var Z=class{visitMany(t,...e){return t.map((r,c)=>this.visit(r,...e.map(f=>f[c])))}visit(...t){return this.getVisitFn(t[0],!1).apply(this,t)}getVisitFn(t,e=!0){return fw(this,t,e)}getVisitFnByTypeId(t,e=!0){return Yr(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}visitLargeUtf8(t,...e){return null}visitBinary(t,...e){return null}visitLargeBinary(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}visitDuration(t,...e){return null}visitFixedSizeList(t,...e){return null}visitMap(t,...e){return null}};function fw(i,t,e=!0){return typeof t=="number"?Yr(i,t,e):typeof t=="string"&&t in j?Yr(i,j[t],e):t&&t instanceof z?Yr(i,Yl(t),e):t!=null&&t.type&&t.type instanceof z?Yr(i,Yl(t.type),e):Yr(i,j.NONE,e)}function Yr(i,t,e=!0){let r=null;switch(t){case j.Null:r=i.visitNull;break;case j.Bool:r=i.visitBool;break;case j.Int:r=i.visitInt;break;case j.Int8:r=i.visitInt8||i.visitInt;break;case j.Int16:r=i.visitInt16||i.visitInt;break;case j.Int32:r=i.visitInt32||i.visitInt;break;case j.Int64:r=i.visitInt64||i.visitInt;break;case j.Uint8:r=i.visitUint8||i.visitInt;break;case j.Uint16:r=i.visitUint16||i.visitInt;break;case j.Uint32:r=i.visitUint32||i.visitInt;break;case j.Uint64:r=i.visitUint64||i.visitInt;break;case j.Float:r=i.visitFloat;break;case j.Float16:r=i.visitFloat16||i.visitFloat;break;case j.Float32:r=i.visitFloat32||i.visitFloat;break;case j.Float64:r=i.visitFloat64||i.visitFloat;break;case j.Utf8:r=i.visitUtf8;break;case j.LargeUtf8:r=i.visitLargeUtf8;break;case j.Binary:r=i.visitBinary;break;case j.LargeBinary:r=i.visitLargeBinary;break;case j.FixedSizeBinary:r=i.visitFixedSizeBinary;break;case j.Date:r=i.visitDate;break;case j.DateDay:r=i.visitDateDay||i.visitDate;break;case j.DateMillisecond:r=i.visitDateMillisecond||i.visitDate;break;case j.Timestamp:r=i.visitTimestamp;break;case j.TimestampSecond:r=i.visitTimestampSecond||i.visitTimestamp;break;case j.TimestampMillisecond:r=i.visitTimestampMillisecond||i.visitTimestamp;break;case j.TimestampMicrosecond:r=i.visitTimestampMicrosecond||i.visitTimestamp;break;case j.TimestampNanosecond:r=i.visitTimestampNanosecond||i.visitTimestamp;break;case j.Time:r=i.visitTime;break;case j.TimeSecond:r=i.visitTimeSecond||i.visitTime;break;case j.TimeMillisecond:r=i.visitTimeMillisecond||i.visitTime;break;case j.TimeMicrosecond:r=i.visitTimeMicrosecond||i.visitTime;break;case j.TimeNanosecond:r=i.visitTimeNanosecond||i.visitTime;break;case j.Decimal:r=i.visitDecimal;break;case j.List:r=i.visitList;break;case j.Struct:r=i.visitStruct;break;case j.Union:r=i.visitUnion;break;case j.DenseUnion:r=i.visitDenseUnion||i.visitUnion;break;case j.SparseUnion:r=i.visitSparseUnion||i.visitUnion;break;case j.Dictionary:r=i.visitDictionary;break;case j.Interval:r=i.visitInterval;break;case j.IntervalDayTime:r=i.visitIntervalDayTime||i.visitInterval;break;case j.IntervalYearMonth:r=i.visitIntervalYearMonth||i.visitInterval;break;case j.Duration:r=i.visitDuration;break;case j.DurationSecond:r=i.visitDurationSecond||i.visitDuration;break;case j.DurationMillisecond:r=i.visitDurationMillisecond||i.visitDuration;break;case j.DurationMicrosecond:r=i.visitDurationMicrosecond||i.visitDuration;break;case j.DurationNanosecond:r=i.visitDurationNanosecond||i.visitDuration;break;case j.FixedSizeList:r=i.visitFixedSizeList;break;case j.Map:r=i.visitMap;break}if(typeof r=="function")return r;if(!e)return()=>null;throw new Error("Unrecognized type '".concat(j[t],"'"))}function Yl(i){switch(i.typeId){case j.Null:return j.Null;case j.Int:{let{bitWidth:t,isSigned:e}=i;switch(t){case 8:return e?j.Int8:j.Uint8;case 16:return e?j.Int16:j.Uint16;case 32:return e?j.Int32:j.Uint32;case 64:return e?j.Int64:j.Uint64}return j.Int}case j.Float:switch(i.precision){case Ot.HALF:return j.Float16;case Ot.SINGLE:return j.Float32;case Ot.DOUBLE:return j.Float64}return j.Float;case j.Binary:return j.Binary;case j.LargeBinary:return j.LargeBinary;case j.Utf8:return j.Utf8;case j.LargeUtf8:return j.LargeUtf8;case j.Bool:return j.Bool;case j.Decimal:return j.Decimal;case j.Time:switch(i.unit){case Y.SECOND:return j.TimeSecond;case Y.MILLISECOND:return j.TimeMillisecond;case Y.MICROSECOND:return j.TimeMicrosecond;case Y.NANOSECOND:return j.TimeNanosecond}return j.Time;case j.Timestamp:switch(i.unit){case Y.SECOND:return j.TimestampSecond;case Y.MILLISECOND:return j.TimestampMillisecond;case Y.MICROSECOND:return j.TimestampMicrosecond;case Y.NANOSECOND:return j.TimestampNanosecond}return j.Timestamp;case j.Date:switch(i.unit){case $t.DAY:return j.DateDay;case $t.MILLISECOND:return j.DateMillisecond}return j.Date;case j.Interval:switch(i.unit){case Jt.DAY_TIME:return j.IntervalDayTime;case Jt.YEAR_MONTH:return j.IntervalYearMonth}return j.Interval;case j.Duration:switch(i.unit){case Y.SECOND:return j.DurationSecond;case Y.MILLISECOND:return j.DurationMillisecond;case Y.MICROSECOND:return j.DurationMicrosecond;case Y.NANOSECOND:return j.DurationNanosecond}return j.Duration;case j.Map:return j.Map;case j.List:return j.List;case j.Struct:return j.Struct;case j.Union:switch(i.mode){case Ut.Dense:return j.DenseUnion;case Ut.Sparse:return j.SparseUnion}return j.Union;case j.FixedSizeBinary:return j.FixedSizeBinary;case j.FixedSizeList:return j.FixedSizeList;case j.Dictionary:return j.Dictionary}throw new Error("Unrecognized type '".concat(j[i.typeId],"'"))}Z.prototype.visitInt8=null;Z.prototype.visitInt16=null;Z.prototype.visitInt32=null;Z.prototype.visitInt64=null;Z.prototype.visitUint8=null;Z.prototype.visitUint16=null;Z.prototype.visitUint32=null;Z.prototype.visitUint64=null;Z.prototype.visitFloat16=null;Z.prototype.visitFloat32=null;Z.prototype.visitFloat64=null;Z.prototype.visitDateDay=null;Z.prototype.visitDateMillisecond=null;Z.prototype.visitTimestampSecond=null;Z.prototype.visitTimestampMillisecond=null;Z.prototype.visitTimestampMicrosecond=null;Z.prototype.visitTimestampNanosecond=null;Z.prototype.visitTimeSecond=null;Z.prototype.visitTimeMillisecond=null;Z.prototype.visitTimeMicrosecond=null;Z.prototype.visitTimeNanosecond=null;Z.prototype.visitDenseUnion=null;Z.prototype.visitSparseUnion=null;Z.prototype.visitIntervalDayTime=null;Z.prototype.visitIntervalYearMonth=null;Z.prototype.visitDuration=null;Z.prototype.visitDurationSecond=null;Z.prototype.visitDurationMillisecond=null;Z.prototype.visitDurationMicrosecond=null;Z.prototype.visitDurationNanosecond=null;var Pa={};$i(Pa,{float64ToUint16:()=>Mn,uint16ToFloat64:()=>Xs});var Gl=new Float64Array(1),Gr=new Uint32Array(Gl.buffer);function Xs(i){let t=(i&31744)>>10,e=(i&1023)/1024,r=Math.pow(-1,(i&32768)>>15);switch(t){case 31:return r*(e?Number.NaN:1/0);case 0:return r*(e?6103515625e-14*e:0)}return r*Math.pow(2,t-15)*(1+e)}function Mn(i){if(i!==i)return 32256;Gl[0]=i;let t=(Gr[1]&2147483648)>>16&65535,e=Gr[1]&2146435072,r=0;return e>=1089470464?Gr[0]>0?e=31744:(e=(e&2080374784)>>16,r=(Gr[1]&1048575)>>10):e<=1056964608?(r=1048576+(Gr[1]&1048575),r=1048576+(r<<(e>>20)-998)>>21,e=0):(e=e-1056964608>>10,r=(Gr[1]&1048575)+512>>10),t|e|r&65535}var rt=class extends Z{};function ut(i){return(t,e,r)=>{if(t.setValid(e,r!=null))return i(t,e,r)}}var hw=(i,t,e)=>{i[t]=Math.floor(e/864e5)},Kl=(i,t,e,r)=>{if(e+1<t.length){let c=wt(t[e]),f=wt(t[e+1]);i.set(r.subarray(0,f-c),c)}},pw=({offset:i,values:t},e,r)=>{let c=i+e;r?t[c>>3]|=1<<c%8:t[c>>3]&=~(1<<c%8)},xi=({values:i},t,e)=>{i[t]=e},Va=({values:i},t,e)=>{i[t]=e},ql=({values:i},t,e)=>{i[t]=Mn(e)},_w=(i,t,e)=>{switch(i.type.precision){case Ot.HALF:return ql(i,t,e);case Ot.SINGLE:case Ot.DOUBLE:return Va(i,t,e)}},Zs=({values:i},t,e)=>{hw(i,t,e.valueOf())},Qs=({values:i},t,e)=>{i[t]=BigInt(e)},Ha=({stride:i,values:t},e,r)=>{t.set(r.subarray(0,i),i*e)},Jl=({values:i,valueOffsets:t},e,r)=>Kl(i,t,e,r),Xl=({values:i,valueOffsets:t},e,r)=>Kl(i,t,e,ei(r)),za=(i,t,e)=>{i.type.unit===$t.DAY?Zs(i,t,e):Qs(i,t,e)},to=({values:i},t,e)=>{i[t]=BigInt(e/1e3)},eo=({values:i},t,e)=>{i[t]=BigInt(e)},io=({values:i},t,e)=>{i[t]=BigInt(e*1e3)},ro=({values:i},t,e)=>{i[t]=BigInt(e*1e6)},Wa=(i,t,e)=>{switch(i.type.unit){case Y.SECOND:return to(i,t,e);case Y.MILLISECOND:return eo(i,t,e);case Y.MICROSECOND:return io(i,t,e);case Y.NANOSECOND:return ro(i,t,e)}},no=({values:i},t,e)=>{i[t]=e},so=({values:i},t,e)=>{i[t]=e},oo=({values:i},t,e)=>{i[t]=e},ao=({values:i},t,e)=>{i[t]=e},$a=(i,t,e)=>{switch(i.type.unit){case Y.SECOND:return no(i,t,e);case Y.MILLISECOND:return so(i,t,e);case Y.MICROSECOND:return oo(i,t,e);case Y.NANOSECOND:return ao(i,t,e)}},Ya=({values:i,stride:t},e,r)=>{i.set(r.subarray(0,t),t*e)},yw=(i,t,e)=>{let r=i.children[0],c=i.valueOffsets,f=ie.getVisitFn(r);if(Array.isArray(e))for(let _=-1,b=c[t],g=c[t+1];b<g;)f(r,b++,e[++_]);else for(let _=-1,b=c[t],g=c[t+1];b<g;)f(r,b++,e.get(++_))},mw=(i,t,e)=>{let r=i.children[0],{valueOffsets:c}=i,f=ie.getVisitFn(r),{[t]:_,[t+1]:b}=c,g=e instanceof Map?e.entries():Object.entries(e);for(let T of g)if(f(r,_,T),++_>=b)break},bw=(i,t)=>(e,r,c,f)=>r&&e(r,i,t[f]),vw=(i,t)=>(e,r,c,f)=>r&&e(r,i,t.get(f)),gw=(i,t)=>(e,r,c,f)=>r&&e(r,i,t.get(c.name)),ww=(i,t)=>(e,r,c,f)=>r&&e(r,i,t[c.name]),Sw=(i,t,e)=>{let r=i.type.children.map(f=>ie.getVisitFn(f.type)),c=e instanceof Map?gw(t,e):e instanceof gt?vw(t,e):Array.isArray(e)?bw(t,e):ww(t,e);i.type.children.forEach((f,_)=>c(r[_],i.children[_],f,_))},Iw=(i,t,e)=>{i.type.mode===Ut.Dense?Zl(i,t,e):Ql(i,t,e)},Zl=(i,t,e)=>{let r=i.type.typeIdToChildIndex[i.typeIds[t]],c=i.children[r];ie.visit(c,i.valueOffsets[t],e)},Ql=(i,t,e)=>{let r=i.type.typeIdToChildIndex[i.typeIds[t]],c=i.children[r];ie.visit(c,t,e)},Tw=(i,t,e)=>{var r;(r=i.dictionary)===null||r===void 0||r.set(i.values[t],e)},Ga=(i,t,e)=>{i.type.unit===Jt.DAY_TIME?co(i,t,e):lo(i,t,e)},co=({values:i},t,e)=>{i.set(e.subarray(0,2),2*t)},lo=({values:i},t,e)=>{i[t]=e[0]*12+e[1]%12},uo=({values:i},t,e)=>{i[t]=e},fo=({values:i},t,e)=>{i[t]=e},ho=({values:i},t,e)=>{i[t]=e},po=({values:i},t,e)=>{i[t]=e},Ka=(i,t,e)=>{switch(i.type.unit){case Y.SECOND:return uo(i,t,e);case Y.MILLISECOND:return fo(i,t,e);case Y.MICROSECOND:return ho(i,t,e);case Y.NANOSECOND:return po(i,t,e)}},jw=(i,t,e)=>{let{stride:r}=i,c=i.children[0],f=ie.getVisitFn(c);if(Array.isArray(e))for(let _=-1,b=t*r;++_<r;)f(c,b+_,e[_]);else for(let _=-1,b=t*r;++_<r;)f(c,b+_,e.get(_))};rt.prototype.visitBool=ut(pw);rt.prototype.visitInt=ut(xi);rt.prototype.visitInt8=ut(xi);rt.prototype.visitInt16=ut(xi);rt.prototype.visitInt32=ut(xi);rt.prototype.visitInt64=ut(xi);rt.prototype.visitUint8=ut(xi);rt.prototype.visitUint16=ut(xi);rt.prototype.visitUint32=ut(xi);rt.prototype.visitUint64=ut(xi);rt.prototype.visitFloat=ut(_w);rt.prototype.visitFloat16=ut(ql);rt.prototype.visitFloat32=ut(Va);rt.prototype.visitFloat64=ut(Va);rt.prototype.visitUtf8=ut(Xl);rt.prototype.visitLargeUtf8=ut(Xl);rt.prototype.visitBinary=ut(Jl);rt.prototype.visitLargeBinary=ut(Jl);rt.prototype.visitFixedSizeBinary=ut(Ha);rt.prototype.visitDate=ut(za);rt.prototype.visitDateDay=ut(Zs);rt.prototype.visitDateMillisecond=ut(Qs);rt.prototype.visitTimestamp=ut(Wa);rt.prototype.visitTimestampSecond=ut(to);rt.prototype.visitTimestampMillisecond=ut(eo);rt.prototype.visitTimestampMicrosecond=ut(io);rt.prototype.visitTimestampNanosecond=ut(ro);rt.prototype.visitTime=ut($a);rt.prototype.visitTimeSecond=ut(no);rt.prototype.visitTimeMillisecond=ut(so);rt.prototype.visitTimeMicrosecond=ut(oo);rt.prototype.visitTimeNanosecond=ut(ao);rt.prototype.visitDecimal=ut(Ya);rt.prototype.visitList=ut(yw);rt.prototype.visitStruct=ut(Sw);rt.prototype.visitUnion=ut(Iw);rt.prototype.visitDenseUnion=ut(Zl);rt.prototype.visitSparseUnion=ut(Ql);rt.prototype.visitDictionary=ut(Tw);rt.prototype.visitInterval=ut(Ga);rt.prototype.visitIntervalDayTime=ut(co);rt.prototype.visitIntervalYearMonth=ut(lo);rt.prototype.visitDuration=ut(Ka);rt.prototype.visitDurationSecond=ut(uo);rt.prototype.visitDurationMillisecond=ut(fo);rt.prototype.visitDurationMicrosecond=ut(ho);rt.prototype.visitDurationNanosecond=ut(po);rt.prototype.visitFixedSizeList=ut(jw);rt.prototype.visitMap=ut(mw);var ie=new rt;var Ge=Symbol.for("parent"),Kr=Symbol.for("rowIndex"),tr=class{constructor(t,e){return this[Ge]=t,this[Kr]=e,new Proxy(this,new Ja)}toArray(){return Object.values(this.toJSON())}toJSON(){let t=this[Kr],e=this[Ge],r=e.type.children,c={};for(let f=-1,_=r.length;++f<_;)c[r[f].name]=Gt.visit(e.children[f],t);return c}toString(){return"{".concat([...this].map(([t,e])=>"".concat(Ve(t),": ").concat(Ve(e))).join(", "),"}")}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}[Symbol.iterator](){return new qa(this[Ge],this[Kr])}},qa=class{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(){let t=this.childIndex;return t<this.numChildren?(this.childIndex=t+1,{done:!1,value:[this.childFields[t].name,Gt.visit(this.children[t],this.rowIndex)]}):{done:!0,value:null}}};Object.defineProperties(tr.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[Ge]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Kr]:{writable:!0,enumerable:!1,configurable:!1,value:-1}});var Ja=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(t){return t[Ge].type.children.map(e=>e.name)}has(t,e){return t[Ge].type.children.findIndex(r=>r.name===e)!==-1}getOwnPropertyDescriptor(t,e){if(t[Ge].type.children.findIndex(r=>r.name===e)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(t,e){if(Reflect.has(t,e))return t[e];let r=t[Ge].type.children.findIndex(c=>c.name===e);if(r!==-1){let c=Gt.visit(t[Ge].children[r],t[Kr]);return Reflect.set(t,e,c),c}}set(t,e,r){let c=t[Ge].type.children.findIndex(f=>f.name===e);return c!==-1?(ie.visit(t[Ge].children[c],t[Kr],r),Reflect.set(t,e,r)):Reflect.has(t,e)||typeof e=="symbol"?Reflect.set(t,e,r):!1}};var Q=class extends Z{};function at(i){return(t,e)=>t.getValid(e)?i(t,e):null}var Dw=(i,t)=>864e5*i[t],Bw=(i,t)=>null,tu=(i,t,e)=>{if(e+1>=t.length)return null;let r=wt(t[e]),c=wt(t[e+1]);return i.subarray(r,c)},Fw=({offset:i,values:t},e)=>{let r=i+e;return(t[r>>3]&1<<r%8)!==0},eu=({values:i},t)=>Dw(i,t),iu=({values:i},t)=>wt(i[t]),er=({stride:i,values:t},e)=>t[i*e],Aw=({stride:i,values:t},e)=>Xs(t[i*e]),ru=({values:i},t)=>i[t],xw=({stride:i,values:t},e)=>t.subarray(i*e,i*(e+1)),nu=({values:i,valueOffsets:t},e)=>tu(i,t,e),su=({values:i,valueOffsets:t},e)=>{let r=tu(i,t,e);return r!==null?bn(r):null},kw=({values:i},t)=>i[t],Ew=({type:i,values:t},e)=>i.precision!==Ot.HALF?t[e]:Xs(t[e]),Ow=(i,t)=>i.type.unit===$t.DAY?eu(i,t):iu(i,t),ou=({values:i},t)=>1e3*wt(i[t]),au=({values:i},t)=>wt(i[t]),cu=({values:i},t)=>Ra(i[t],BigInt(1e3)),lu=({values:i},t)=>Ra(i[t],BigInt(1e6)),Uw=(i,t)=>{switch(i.type.unit){case Y.SECOND:return ou(i,t);case Y.MILLISECOND:return au(i,t);case Y.MICROSECOND:return cu(i,t);case Y.NANOSECOND:return lu(i,t)}},uu=({values:i},t)=>i[t],du=({values:i},t)=>i[t],fu=({values:i},t)=>i[t],hu=({values:i},t)=>i[t],Mw=(i,t)=>{switch(i.type.unit){case Y.SECOND:return uu(i,t);case Y.MILLISECOND:return du(i,t);case Y.MICROSECOND:return fu(i,t);case Y.NANOSECOND:return hu(i,t)}},Rw=({values:i,stride:t},e)=>Un.decimal(i.subarray(t*e,t*(e+1))),Cw=(i,t)=>{let{valueOffsets:e,stride:r,children:c}=i,{[t*r]:f,[t*r+1]:_}=e,g=c[0].slice(f,_-f);return new gt([g])},Lw=(i,t)=>{let{valueOffsets:e,children:r}=i,{[t]:c,[t+1]:f}=e,_=r[0];return new ai(_.slice(c,f-c))},Nw=(i,t)=>new tr(i,t),Pw=(i,t)=>i.type.mode===Ut.Dense?pu(i,t):_u(i,t),pu=(i,t)=>{let e=i.type.typeIdToChildIndex[i.typeIds[t]],r=i.children[e];return Gt.visit(r,i.valueOffsets[t])},_u=(i,t)=>{let e=i.type.typeIdToChildIndex[i.typeIds[t]],r=i.children[e];return Gt.visit(r,t)},Vw=(i,t)=>{var e;return(e=i.dictionary)===null||e===void 0?void 0:e.get(i.values[t])},Hw=(i,t)=>i.type.unit===Jt.DAY_TIME?yu(i,t):mu(i,t),yu=({values:i},t)=>i.subarray(2*t,2*(t+1)),mu=({values:i},t)=>{let e=i[t],r=new Int32Array(2);return r[0]=Math.trunc(e/12),r[1]=Math.trunc(e%12),r},bu=({values:i},t)=>i[t],vu=({values:i},t)=>i[t],gu=({values:i},t)=>i[t],wu=({values:i},t)=>i[t],zw=(i,t)=>{switch(i.type.unit){case Y.SECOND:return bu(i,t);case Y.MILLISECOND:return vu(i,t);case Y.MICROSECOND:return gu(i,t);case Y.NANOSECOND:return wu(i,t)}},Ww=(i,t)=>{let{stride:e,children:r}=i,f=r[0].slice(t*e,e);return new gt([f])};Q.prototype.visitNull=at(Bw);Q.prototype.visitBool=at(Fw);Q.prototype.visitInt=at(kw);Q.prototype.visitInt8=at(er);Q.prototype.visitInt16=at(er);Q.prototype.visitInt32=at(er);Q.prototype.visitInt64=at(ru);Q.prototype.visitUint8=at(er);Q.prototype.visitUint16=at(er);Q.prototype.visitUint32=at(er);Q.prototype.visitUint64=at(ru);Q.prototype.visitFloat=at(Ew);Q.prototype.visitFloat16=at(Aw);Q.prototype.visitFloat32=at(er);Q.prototype.visitFloat64=at(er);Q.prototype.visitUtf8=at(su);Q.prototype.visitLargeUtf8=at(su);Q.prototype.visitBinary=at(nu);Q.prototype.visitLargeBinary=at(nu);Q.prototype.visitFixedSizeBinary=at(xw);Q.prototype.visitDate=at(Ow);Q.prototype.visitDateDay=at(eu);Q.prototype.visitDateMillisecond=at(iu);Q.prototype.visitTimestamp=at(Uw);Q.prototype.visitTimestampSecond=at(ou);Q.prototype.visitTimestampMillisecond=at(au);Q.prototype.visitTimestampMicrosecond=at(cu);Q.prototype.visitTimestampNanosecond=at(lu);Q.prototype.visitTime=at(Mw);Q.prototype.visitTimeSecond=at(uu);Q.prototype.visitTimeMillisecond=at(du);Q.prototype.visitTimeMicrosecond=at(fu);Q.prototype.visitTimeNanosecond=at(hu);Q.prototype.visitDecimal=at(Rw);Q.prototype.visitList=at(Cw);Q.prototype.visitStruct=at(Nw);Q.prototype.visitUnion=at(Pw);Q.prototype.visitDenseUnion=at(pu);Q.prototype.visitSparseUnion=at(_u);Q.prototype.visitDictionary=at(Vw);Q.prototype.visitInterval=at(Hw);Q.prototype.visitIntervalDayTime=at(yu);Q.prototype.visitIntervalYearMonth=at(mu);Q.prototype.visitDuration=at(zw);Q.prototype.visitDurationSecond=at(bu);Q.prototype.visitDurationMillisecond=at(vu);Q.prototype.visitDurationMicrosecond=at(gu);Q.prototype.visitDurationNanosecond=at(wu);Q.prototype.visitFixedSizeList=at(Ww);Q.prototype.visitMap=at(Lw);var Gt=new Q;var ir=Symbol.for("keys"),Jr=Symbol.for("vals"),qr=Symbol.for("kKeysAsStrings"),Xa=Symbol.for("_kKeysAsStrings"),ai=class{constructor(t){return this[ir]=new gt([t.children[0]]).memoize(),this[Jr]=t.children[1],new Proxy(this,new Qa)}get[qr](){return this[Xa]||(this[Xa]=Array.from(this[ir].toArray(),String))}[Symbol.iterator](){return new Za(this[ir],this[Jr])}get size(){return this[ir].length}toArray(){return Object.values(this.toJSON())}toJSON(){let t=this[ir],e=this[Jr],r={};for(let c=-1,f=t.length;++c<f;)r[t.get(c)]=Gt.visit(e,c);return r}toString(){return"{".concat([...this].map(([t,e])=>"".concat(Ve(t),": ").concat(Ve(e))).join(", "),"}")}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}},Za=class{constructor(t,e){this.keys=t,this.vals=e,this.keyIndex=0,this.numKeys=t.length}[Symbol.iterator](){return this}next(){let t=this.keyIndex;return t===this.numKeys?{done:!0,value:null}:(this.keyIndex++,{done:!1,value:[this.keys.get(t),Gt.visit(this.vals,t)]})}},Qa=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(t){return t[qr]}has(t,e){return t[qr].includes(e)}getOwnPropertyDescriptor(t,e){if(t[qr].indexOf(e)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(t,e){if(Reflect.has(t,e))return t[e];let r=t[qr].indexOf(e);if(r!==-1){let c=Gt.visit(Reflect.get(t,Jr),r);return Reflect.set(t,e,c),c}}set(t,e,r){let c=t[qr].indexOf(e);return c!==-1?(ie.visit(Reflect.get(t,Jr),c,r),Reflect.set(t,e,r)):Reflect.has(t,e)?Reflect.set(t,e,r):!1}};Object.defineProperties(ai.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[ir]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Jr]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Xa]:{writable:!0,enumerable:!1,configurable:!1,value:null}});var Su;function Rn(i,t,e,r){let{length:c=0}=i,f=typeof t!="number"?0:t,_=typeof e!="number"?c:e;return f<0&&(f=(f%c+c)%c),_<0&&(_=(_%c+c)%c),_<f&&(Su=f,f=_,_=Su),_>c&&(_=c),r?r(i,f,_):[f,_]}var hr=(i,t)=>i<0?t+i:i,Iu=i=>i!==i;function rr(i){if(typeof i!=="object"||i===null)return Iu(i)?Iu:e=>e===i;if(i instanceof Date){let e=i.valueOf();return r=>r instanceof Date?r.valueOf()===e:!1}return ArrayBuffer.isView(i)?e=>e?ka(i,e):!1:i instanceof Map?Yw(i):Array.isArray(i)?$w(i):i instanceof gt?Gw(i):Kw(i,!0)}function $w(i){let t=[];for(let e=-1,r=i.length;++e<r;)t[e]=rr(i[e]);return _o(t)}function Yw(i){let t=-1,e=[];for(let r of i.values())e[++t]=rr(r);return _o(e)}function Gw(i){let t=[];for(let e=-1,r=i.length;++e<r;)t[e]=rr(i.get(e));return _o(t)}function Kw(i,t=!1){let e=Object.keys(i);if(!t&&e.length===0)return()=>!1;let r=[];for(let c=-1,f=e.length;++c<f;)r[c]=rr(i[e[c]]);return _o(r,e)}function _o(i,t){return e=>{if(!e||typeof e!="object")return!1;switch(e.constructor){case Array:return qw(i,e);case Map:return Tu(i,e,e.keys());case ai:case tr:case Object:case void 0:return Tu(i,e,t||Object.keys(e))}return e instanceof gt?Jw(i,e):!1}}function qw(i,t){let e=i.length;if(t.length!==e)return!1;for(let r=-1;++r<e;)if(!i[r](t[r]))return!1;return!0}function Jw(i,t){let e=i.length;if(t.length!==e)return!1;for(let r=-1;++r<e;)if(!i[r](t.get(r)))return!1;return!0}function Tu(i,t,e){let r=e[Symbol.iterator](),c=t instanceof Map?t.keys():Object.keys(t)[Symbol.iterator](),f=t instanceof Map?t.values():Object.values(t)[Symbol.iterator](),_=0,b=i.length,g=f.next(),T=r.next(),D=c.next();for(;_<b&&!T.done&&!D.done&&!g.done&&!(T.value!==D.value||!i[_](g.value));++_,T=r.next(),D=c.next(),g=f.next());return _===b&&T.done&&D.done&&g.done?!0:(r.return&&r.return(),c.return&&c.return(),f.return&&f.return(),!1)}var ec={};$i(ec,{BitIterator:()=>pr,getBit:()=>ju,getBool:()=>mo,packBools:()=>yr,popcnt_array:()=>Du,popcnt_bit_range:()=>Cn,popcnt_uint32:()=>yo,setBool:()=>Xw,truncateBitmap:()=>_r});function mo(i,t,e,r){return(e&1<<r)!==0}function ju(i,t,e,r){return(e&1<<r)>>r}function Xw(i,t,e){return e?!!(i[t>>3]|=1<<t%8)||!0:!(i[t>>3]&=~(1<<t%8))&&!1}function _r(i,t,e){let r=e.byteLength+7&-8;if(i>0||e.byteLength<r){let c=new Uint8Array(r);return c.set(i%8===0?e.subarray(i>>3):yr(new pr(e,i,t,null,mo)).subarray(0,r)),c}return e}function yr(i){let t=[],e=0,r=0,c=0;for(let _ of i)_&&(c|=1<<r),++r===8&&(t[e++]=c,c=r=0);(e===0||r>0)&&(t[e++]=c);let f=new Uint8Array(t.length+7&-8);return f.set(t),f}var pr=class{constructor(t,e,r,c,f){this.bytes=t,this.length=r,this.context=c,this.get=f,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 Cn(i,t,e){if(e-t<=0)return 0;if(e-t<8){let f=0;for(let _ of new pr(i,t,e-t,i,ju))f+=_;return f}let r=e>>3<<3,c=t+(t%8===0?0:8-t%8);return Cn(i,t,c)+Cn(i,r,e)+Du(i,c>>3,r-c>>3)}function Du(i,t,e){let r=0,c=Math.trunc(t),f=new DataView(i.buffer,i.byteOffset,i.byteLength),_=e===void 0?i.byteLength:c+e;for(;_-c>=4;)r+=yo(f.getUint32(c)),c+=4;for(;_-c>=2;)r+=yo(f.getUint16(c)),c+=2;for(;_-c>=1;)r+=yo(f.getUint8(c)),c+=1;return r}function yo(i){let t=Math.trunc(i);return t=t-(t>>>1&1431655765),t=(t&858993459)+(t>>>2&858993459),(t+(t>>>4)&252645135)*16843009>>>24}var Zw=-1,jt=class i{get typeId(){return this.type.typeId}get ArrayType(){return this.type.ArrayType}get buffers(){return[this.valueOffsets,this.values,this.nullBitmap,this.typeIds]}get nullable(){if(this._nullCount!==0){let{type:t}=this;return z.isSparseUnion(t)?this.children.some(e=>e.nullable):z.isDenseUnion(t)?this.children.some(e=>e.nullable):this.nullBitmap&&this.nullBitmap.byteLength>0}return!0}get byteLength(){let t=0,{valueOffsets:e,values:r,nullBitmap:c,typeIds:f}=this;return e&&(t+=e.byteLength),r&&(t+=r.byteLength),c&&(t+=c.byteLength),f&&(t+=f.byteLength),this.children.reduce((_,b)=>_+b.byteLength,t)}get nullCount(){if(z.isUnion(this.type))return this.children.reduce((r,c)=>r+c.nullCount,0);let t=this._nullCount,e;return t<=Zw&&(e=this.nullBitmap)&&(this._nullCount=t=e.length===0?0:this.length-Cn(e,this.offset,this.offset+this.length)),t}constructor(t,e,r,c,f,_=[],b){this.type=t,this.children=_,this.dictionary=b,this.offset=Math.floor(Math.max(e||0,0)),this.length=Math.floor(Math.max(r||0,0)),this._nullCount=Math.floor(Math.max(c||0,-1));let g;f instanceof i?(this.stride=f.stride,this.values=f.values,this.typeIds=f.typeIds,this.nullBitmap=f.nullBitmap,this.valueOffsets=f.valueOffsets):(this.stride=we(t),f&&((g=f[0])&&(this.valueOffsets=g),(g=f[1])&&(this.values=g),(g=f[2])&&(this.nullBitmap=g),(g=f[3])&&(this.typeIds=g)))}getValid(t){let{type:e}=this;if(z.isUnion(e)){let r=e,c=this.children[r.typeIdToChildIndex[this.typeIds[t]]],f=r.mode===Ut.Dense?this.valueOffsets[t]:t;return c.getValid(f)}if(this.nullable&&this.nullCount>0){let r=this.offset+t;return(this.nullBitmap[r>>3]&1<<r%8)!==0}return!0}setValid(t,e){let r,{type:c}=this;if(z.isUnion(c)){let f=c,_=this.children[f.typeIdToChildIndex[this.typeIds[t]]],b=f.mode===Ut.Dense?this.valueOffsets[t]:t;r=_.getValid(b),_.setValid(b,e)}else{let{nullBitmap:f}=this,{offset:_,length:b}=this,g=_+t,T=1<<g%8,D=g>>3;(!f||f.byteLength<=D)&&(f=new Uint8Array((_+b+63&-64)>>3).fill(255),this.nullCount>0?(f.set(_r(_,b,this.nullBitmap),0),Object.assign(this,{nullBitmap:f})):Object.assign(this,{nullBitmap:f,_nullCount:0}));let U=f[D];r=(U&T)!==0,f[D]=e?U|T:U&~T}return r!==!!e&&(this._nullCount=this.nullCount+(e?-1:1)),e}clone(t=this.type,e=this.offset,r=this.length,c=this._nullCount,f=this,_=this.children){return new i(t,e,r,c,f,_,this.dictionary)}slice(t,e){let{stride:r,typeId:c,children:f}=this,_=+(this._nullCount===0)-1,b=c===16?r:1,g=this._sliceBuffers(t,e,r,c);return this.clone(this.type,this.offset+t,e,_,g,f.length===0||this.valueOffsets?f:this._sliceChildren(f,b*t,b*e))}_changeLengthAndBackfillNullBitmap(t){if(this.typeId===j.Null)return this.clone(this.type,0,t,0);let{length:e,nullCount:r}=this,c=new Uint8Array((t+63&-64)>>3).fill(255,0,e>>3);c[e>>3]=(1<<e-(e&-8))-1,r>0&&c.set(_r(this.offset,e,this.nullBitmap),0);let f=this.buffers;return f[Be.VALIDITY]=c,this.clone(this.type,0,t,r+(t-e),f)}_sliceBuffers(t,e,r,c){let f,{buffers:_}=this;return(f=_[Be.TYPE])&&(_[Be.TYPE]=f.subarray(t,t+e)),(f=_[Be.OFFSET])&&(_[Be.OFFSET]=f.subarray(t,t+e+1))||(f=_[Be.DATA])&&(_[Be.DATA]=c===6?f:f.subarray(r*t,r*(t+e))),_}_sliceChildren(t,e,r){return t.map(c=>c.slice(e,r))}};jt.prototype.children=Object.freeze([]);var ic=class i extends Z{visit(t){return this.getVisitFn(t.type).call(this,t)}visitNull(t){let{["type"]:e,["offset"]:r=0,["length"]:c=0}=t;return new jt(e,r,c,c)}visitBool(t){let{["type"]:e,["offset"]:r=0}=t,c=ot(t.nullBitmap),f=mt(e.ArrayType,t.data),{["length"]:_=f.length>>3,["nullCount"]:b=t.nullBitmap?-1:0}=t;return new jt(e,r,_,b,[void 0,f,c])}visitInt(t){let{["type"]:e,["offset"]:r=0}=t,c=ot(t.nullBitmap),f=mt(e.ArrayType,t.data),{["length"]:_=f.length,["nullCount"]:b=t.nullBitmap?-1:0}=t;return new jt(e,r,_,b,[void 0,f,c])}visitFloat(t){let{["type"]:e,["offset"]:r=0}=t,c=ot(t.nullBitmap),f=mt(e.ArrayType,t.data),{["length"]:_=f.length,["nullCount"]:b=t.nullBitmap?-1:0}=t;return new jt(e,r,_,b,[void 0,f,c])}visitUtf8(t){let{["type"]:e,["offset"]:r=0}=t,c=ot(t.data),f=ot(t.nullBitmap),_=dr(t.valueOffsets),{["length"]:b=_.length-1,["nullCount"]:g=t.nullBitmap?-1:0}=t;return new jt(e,r,b,g,[_,c,f])}visitLargeUtf8(t){let{["type"]:e,["offset"]:r=0}=t,c=ot(t.data),f=ot(t.nullBitmap),_=Us(t.valueOffsets),{["length"]:b=_.length-1,["nullCount"]:g=t.nullBitmap?-1:0}=t;return new jt(e,r,b,g,[_,c,f])}visitBinary(t){let{["type"]:e,["offset"]:r=0}=t,c=ot(t.data),f=ot(t.nullBitmap),_=dr(t.valueOffsets),{["length"]:b=_.length-1,["nullCount"]:g=t.nullBitmap?-1:0}=t;return new jt(e,r,b,g,[_,c,f])}visitLargeBinary(t){let{["type"]:e,["offset"]:r=0}=t,c=ot(t.data),f=ot(t.nullBitmap),_=Us(t.valueOffsets),{["length"]:b=_.length-1,["nullCount"]:g=t.nullBitmap?-1:0}=t;return new jt(e,r,b,g,[_,c,f])}visitFixedSizeBinary(t){let{["type"]:e,["offset"]:r=0}=t,c=ot(t.nullBitmap),f=mt(e.ArrayType,t.data),{["length"]:_=f.length/we(e),["nullCount"]:b=t.nullBitmap?-1:0}=t;return new jt(e,r,_,b,[void 0,f,c])}visitDate(t){let{["type"]:e,["offset"]:r=0}=t,c=ot(t.nullBitmap),f=mt(e.ArrayType,t.data),{["length"]:_=f.length/we(e),["nullCount"]:b=t.nullBitmap?-1:0}=t;return new jt(e,r,_,b,[void 0,f,c])}visitTimestamp(t){let{["type"]:e,["offset"]:r=0}=t,c=ot(t.nullBitmap),f=mt(e.ArrayType,t.data),{["length"]:_=f.length/we(e),["nullCount"]:b=t.nullBitmap?-1:0}=t;return new jt(e,r,_,b,[void 0,f,c])}visitTime(t){let{["type"]:e,["offset"]:r=0}=t,c=ot(t.nullBitmap),f=mt(e.ArrayType,t.data),{["length"]:_=f.length/we(e),["nullCount"]:b=t.nullBitmap?-1:0}=t;return new jt(e,r,_,b,[void 0,f,c])}visitDecimal(t){let{["type"]:e,["offset"]:r=0}=t,c=ot(t.nullBitmap),f=mt(e.ArrayType,t.data),{["length"]:_=f.length/we(e),["nullCount"]:b=t.nullBitmap?-1:0}=t;return new jt(e,r,_,b,[void 0,f,c])}visitList(t){let{["type"]:e,["offset"]:r=0,["child"]:c}=t,f=ot(t.nullBitmap),_=dr(t.valueOffsets),{["length"]:b=_.length-1,["nullCount"]:g=t.nullBitmap?-1:0}=t;return new jt(e,r,b,g,[_,void 0,f],[c])}visitStruct(t){let{["type"]:e,["offset"]:r=0,["children"]:c=[]}=t,f=ot(t.nullBitmap),{length:_=c.reduce((g,{length:T})=>Math.max(g,T),0),nullCount:b=t.nullBitmap?-1:0}=t;return new jt(e,r,_,b,[void 0,void 0,f],c)}visitUnion(t){let{["type"]:e,["offset"]:r=0,["children"]:c=[]}=t,f=mt(e.ArrayType,t.typeIds),{["length"]:_=f.length,["nullCount"]:b=-1}=t;if(z.isSparseUnion(e))return new jt(e,r,_,b,[void 0,void 0,void 0,f],c);let g=dr(t.valueOffsets);return new jt(e,r,_,b,[g,void 0,void 0,f],c)}visitDictionary(t){let{["type"]:e,["offset"]:r=0}=t,c=ot(t.nullBitmap),f=mt(e.indices.ArrayType,t.data),{["dictionary"]:_=new gt([new i().visit({type:e.dictionary})])}=t,{["length"]:b=f.length,["nullCount"]:g=t.nullBitmap?-1:0}=t;return new jt(e,r,b,g,[void 0,f,c],[],_)}visitInterval(t){let{["type"]:e,["offset"]:r=0}=t,c=ot(t.nullBitmap),f=mt(e.ArrayType,t.data),{["length"]:_=f.length/we(e),["nullCount"]:b=t.nullBitmap?-1:0}=t;return new jt(e,r,_,b,[void 0,f,c])}visitDuration(t){let{["type"]:e,["offset"]:r=0}=t,c=ot(t.nullBitmap),f=mt(e.ArrayType,t.data),{["length"]:_=f.length,["nullCount"]:b=t.nullBitmap?-1:0}=t;return new jt(e,r,_,b,[void 0,f,c])}visitFixedSizeList(t){let{["type"]:e,["offset"]:r=0,["child"]:c=new i().visit({type:e.valueType})}=t,f=ot(t.nullBitmap),{["length"]:_=c.length/we(e),["nullCount"]:b=t.nullBitmap?-1:0}=t;return new jt(e,r,_,b,[void 0,void 0,f],[c])}visitMap(t){let{["type"]:e,["offset"]:r=0,["child"]:c=new i().visit({type:e.childType})}=t,f=ot(t.nullBitmap),_=dr(t.valueOffsets),{["length"]:b=_.length-1,["nullCount"]:g=t.nullBitmap?-1:0}=t;return new jt(e,r,b,g,[_,void 0,f],[c])}},Qw=new ic;function dt(i){return Qw.visit(i)}var Ln=class{constructor(t=0,e){this.numChunks=t,this.getChunkIterator=e,this.chunkIndex=0,this.chunkIterator=this.getChunkIterator(0)}next(){for(;this.chunkIndex<this.numChunks;){let t=this.chunkIterator.next();if(!t.done)return t;++this.chunkIndex<this.numChunks&&(this.chunkIterator=this.getChunkIterator(this.chunkIndex))}return{done:!0,value:null}}[Symbol.iterator](){return this}};function Bu(i){return i.some(t=>t.nullable)}function bo(i){return i.reduce((t,e)=>t+e.nullCount,0)}function vo(i){return i.reduce((t,e,r)=>(t[r+1]=t[r]+e.length,t),new Uint32Array(i.length+1))}function go(i,t,e,r){let c=[];for(let f=-1,_=i.length;++f<_;){let b=i[f],g=t[f],{length:T}=b;if(g>=r)break;if(e>=g+T)continue;if(g>=e&&g+T<=r){c.push(b);continue}let D=Math.max(0,e-g),U=Math.min(r-g,T);c.push(b.slice(D,U-D))}return c.length===0&&c.push(i[0].slice(0,0)),c}function rc(i,t,e,r){let c=0,f=0,_=t.length-1;do{if(c>=_-1)return e<t[_]?r(i,c,e-t[c]):null;f=c+Math.trunc((_-c)*.5),e<t[f]?_=f:c=f}while(c<_)}function Nn(i,t){return i.getValid(t)}function Xr(i){function t(e,r,c){return i(e[r],c)}return function(e){let r=this.data;return rc(r,this._offsets,e,t)}}function wo(i){let t;function e(r,c,f){return i(r[c],f,t)}return function(r,c){let f=this.data;t=c;let _=rc(f,this._offsets,r,e);return t=void 0,_}}function So(i){let t;function e(r,c,f){let _=f,b=0,g=0;for(let T=c-1,D=r.length;++T<D;){let U=r[T];if(~(b=i(U,t,_)))return g+b;_=0,g+=U.length}return-1}return function(r,c){t=r;let f=this.data,_=typeof c!="number"?e(f,0,0):rc(f,this._offsets,c,e);return t=void 0,_}}var tt=class extends Z{};function tS(i,t){return t===null&&i.length>0?0:-1}function eS(i,t){let{nullBitmap:e}=i;if(!e||i.nullCount<=0)return-1;let r=0;for(let c of new pr(e,i.offset+(t||0),i.length,e,mo)){if(!c)return r;++r}return-1}function ft(i,t,e){if(t===void 0)return-1;if(t===null)switch(i.typeId){case j.Union:break;case j.Dictionary:break;default:return eS(i,e)}let r=Gt.getVisitFn(i),c=rr(t);for(let f=(e||0)-1,_=i.length;++f<_;)if(c(r(i,f)))return f;return-1}function Fu(i,t,e){let r=Gt.getVisitFn(i),c=rr(t);for(let f=(e||0)-1,_=i.length;++f<_;)if(c(r(i,f)))return f;return-1}tt.prototype.visitNull=tS;tt.prototype.visitBool=ft;tt.prototype.visitInt=ft;tt.prototype.visitInt8=ft;tt.prototype.visitInt16=ft;tt.prototype.visitInt32=ft;tt.prototype.visitInt64=ft;tt.prototype.visitUint8=ft;tt.prototype.visitUint16=ft;tt.prototype.visitUint32=ft;tt.prototype.visitUint64=ft;tt.prototype.visitFloat=ft;tt.prototype.visitFloat16=ft;tt.prototype.visitFloat32=ft;tt.prototype.visitFloat64=ft;tt.prototype.visitUtf8=ft;tt.prototype.visitLargeUtf8=ft;tt.prototype.visitBinary=ft;tt.prototype.visitLargeBinary=ft;tt.prototype.visitFixedSizeBinary=ft;tt.prototype.visitDate=ft;tt.prototype.visitDateDay=ft;tt.prototype.visitDateMillisecond=ft;tt.prototype.visitTimestamp=ft;tt.prototype.visitTimestampSecond=ft;tt.prototype.visitTimestampMillisecond=ft;tt.prototype.visitTimestampMicrosecond=ft;tt.prototype.visitTimestampNanosecond=ft;tt.prototype.visitTime=ft;tt.prototype.visitTimeSecond=ft;tt.prototype.visitTimeMillisecond=ft;tt.prototype.visitTimeMicrosecond=ft;tt.prototype.visitTimeNanosecond=ft;tt.prototype.visitDecimal=ft;tt.prototype.visitList=ft;tt.prototype.visitStruct=ft;tt.prototype.visitUnion=ft;tt.prototype.visitDenseUnion=Fu;tt.prototype.visitSparseUnion=Fu;tt.prototype.visitDictionary=ft;tt.prototype.visitInterval=ft;tt.prototype.visitIntervalDayTime=ft;tt.prototype.visitIntervalYearMonth=ft;tt.prototype.visitDuration=ft;tt.prototype.visitDurationSecond=ft;tt.prototype.visitDurationMillisecond=ft;tt.prototype.visitDurationMicrosecond=ft;tt.prototype.visitDurationNanosecond=ft;tt.prototype.visitFixedSizeList=ft;tt.prototype.visitMap=ft;var mr=new tt;var et=class extends Z{};function ct(i){let{type:t}=i;if(i.nullCount===0&&i.stride===1&&(z.isInt(t)&&t.bitWidth!==64||z.isTime(t)&&t.bitWidth!==64||z.isFloat(t)&&t.precision!==Ot.HALF))return new Ln(i.data.length,r=>{let c=i.data[r];return c.values.subarray(0,c.length)[Symbol.iterator]()});let e=0;return new Ln(i.data.length,r=>{let f=i.data[r].length,_=i.slice(e,e+f);return e+=f,new nc(_)})}var nc=class{constructor(t){this.vector=t,this.index=0}next(){return this.index<this.vector.length?{value:this.vector.get(this.index++)}:{done:!0,value:null}}[Symbol.iterator](){return this}};et.prototype.visitNull=ct;et.prototype.visitBool=ct;et.prototype.visitInt=ct;et.prototype.visitInt8=ct;et.prototype.visitInt16=ct;et.prototype.visitInt32=ct;et.prototype.visitInt64=ct;et.prototype.visitUint8=ct;et.prototype.visitUint16=ct;et.prototype.visitUint32=ct;et.prototype.visitUint64=ct;et.prototype.visitFloat=ct;et.prototype.visitFloat16=ct;et.prototype.visitFloat32=ct;et.prototype.visitFloat64=ct;et.prototype.visitUtf8=ct;et.prototype.visitLargeUtf8=ct;et.prototype.visitBinary=ct;et.prototype.visitLargeBinary=ct;et.prototype.visitFixedSizeBinary=ct;et.prototype.visitDate=ct;et.prototype.visitDateDay=ct;et.prototype.visitDateMillisecond=ct;et.prototype.visitTimestamp=ct;et.prototype.visitTimestampSecond=ct;et.prototype.visitTimestampMillisecond=ct;et.prototype.visitTimestampMicrosecond=ct;et.prototype.visitTimestampNanosecond=ct;et.prototype.visitTime=ct;et.prototype.visitTimeSecond=ct;et.prototype.visitTimeMillisecond=ct;et.prototype.visitTimeMicrosecond=ct;et.prototype.visitTimeNanosecond=ct;et.prototype.visitDecimal=ct;et.prototype.visitList=ct;et.prototype.visitStruct=ct;et.prototype.visitUnion=ct;et.prototype.visitDenseUnion=ct;et.prototype.visitSparseUnion=ct;et.prototype.visitDictionary=ct;et.prototype.visitInterval=ct;et.prototype.visitIntervalDayTime=ct;et.prototype.visitIntervalYearMonth=ct;et.prototype.visitDuration=ct;et.prototype.visitDurationSecond=ct;et.prototype.visitDurationMillisecond=ct;et.prototype.visitDurationMicrosecond=ct;et.prototype.visitDurationNanosecond=ct;et.prototype.visitFixedSizeList=ct;et.prototype.visitMap=ct;var Zr=new et;var Au,xu={},ku={},gt=class i{constructor(t){var e,r,c;let f=t[0]instanceof i?t.flatMap(b=>b.data):t;if(f.length===0||f.some(b=>!(b instanceof jt)))throw new TypeError("Vector constructor expects an Array of Data instances.");let _=(e=f[0])===null||e===void 0?void 0:e.type;switch(f.length){case 0:this._offsets=[0];break;case 1:{let{get:b,set:g,indexOf:T}=xu[_.typeId],D=f[0];this.isValid=U=>Nn(D,U),this.get=U=>b(D,U),this.set=(U,M)=>g(D,U,M),this.indexOf=U=>T(D,U),this._offsets=[0,D.length];break}default:Object.setPrototypeOf(this,ku[_.typeId]),this._offsets=vo(f);break}this.data=f,this.type=_,this.stride=we(_),this.numChildren=(c=(r=_.children)===null||r===void 0?void 0:r.length)!==null&&c!==void 0?c:0,this.length=this._offsets.at(-1)}get byteLength(){return this.data.reduce((t,e)=>t+e.byteLength,0)}get nullable(){return Bu(this.data)}get nullCount(){return bo(this.data)}get ArrayType(){return this.type.ArrayType}get[Symbol.toStringTag](){return"".concat(this.VectorName,"<").concat(this.type[Symbol.toStringTag],">")}get VectorName(){return"".concat(j[this.type.typeId],"Vector")}isValid(t){return!1}get(t){return null}at(t){return this.get(hr(t,this.length))}set(t,e){}indexOf(t,e){return-1}includes(t,e){return this.indexOf(t,e)>-1}[Symbol.iterator](){return Zr.visit(this)}concat(...t){return new i(this.data.concat(t.flatMap(e=>e.data).flat(Number.POSITIVE_INFINITY)))}slice(t,e){return new i(Rn(this,t,e,({data:r,_offsets:c},f,_)=>go(r,c,f,_)))}toJSON(){return[...this]}toArray(){let{type:t,data:e,length:r,stride:c,ArrayType:f}=this;switch(t.typeId){case j.Int:case j.Float:case j.Decimal:case j.Time:case j.Timestamp:switch(e.length){case 0:return new f;case 1:return e[0].values.subarray(0,r*c);default:return e.reduce((_,{values:b,length:g})=>(_.array.set(b.subarray(0,g*c),_.offset),_.offset+=g*c,_),{array:new f(r*c),offset:0}).array}}return[...this]}toString(){return"[".concat([...this].join(","),"]")}getChild(t){var e;return this.getChildAt((e=this.type.children)===null||e===void 0?void 0:e.findIndex(r=>r.name===t))}getChildAt(t){return t>-1&&t<this.numChildren?new i(this.data.map(({children:e})=>e[t])):null}get isMemoized(){return z.isDictionary(this.type)?this.data[0].dictionary.isMemoized:!1}memoize(){if(z.isDictionary(this.type)){let t=new Io(this.data[0].dictionary),e=this.data.map(r=>{let c=r.clone();return c.dictionary=t,c});return new i(e)}return new Io(this)}unmemoize(){if(z.isDictionary(this.type)&&this.isMemoized){let t=this.data[0].dictionary.unmemoize(),e=this.data.map(r=>{let c=r.clone();return c.dictionary=t,c});return new i(e)}return this}};Au=Symbol.toStringTag;gt[Au]=(i=>{i.type=z.prototype,i.data=[],i.length=0,i.stride=1,i.numChildren=0,i._offsets=new Uint32Array([0]),i[Symbol.isConcatSpreadable]=!0;let t=Object.keys(j).map(e=>j[e]).filter(e=>typeof e=="number"&&e!==j.NONE);for(let e of t){let r=Gt.getVisitFnByTypeId(e),c=ie.getVisitFnByTypeId(e),f=mr.getVisitFnByTypeId(e);xu[e]={get:r,set:c,indexOf:f},ku[e]=Object.create(i,{isValid:{value:Xr(Nn)},get:{value:Xr(Gt.getVisitFnByTypeId(e))},set:{value:wo(ie.getVisitFnByTypeId(e))},indexOf:{value:So(mr.getVisitFnByTypeId(e))}})}return"Vector"})(gt.prototype);var Io=class i extends gt{constructor(t){super(t.data);let e=this.get,r=this.set,c=this.slice,f=new Array(this.length);Object.defineProperty(this,"get",{value(_){let b=f[_];if(b!==void 0)return b;let g=e.call(this,_);return f[_]=g,g}}),Object.defineProperty(this,"set",{value(_,b){r.call(this,_,b),f[_]=b}}),Object.defineProperty(this,"slice",{value:(_,b)=>new i(c.call(this,_,b))}),Object.defineProperty(this,"isMemoized",{value:!0}),Object.defineProperty(this,"unmemoize",{value:()=>new gt(this.data)}),Object.defineProperty(this,"memoize",{value:()=>this})}};function Eu(i){if(!i||i.length<=0)return function(c){return!0};let t="",e=i.filter(r=>r===r);return e.length>0&&(t="\n switch (x) {".concat(e.map(r=>"\n case ".concat(iS(r),":")).join(""),"\n return false;\n }")),i.length!==e.length&&(t="if (x !== x) return false;\n".concat(t)),new Function("x","".concat(t,"\nreturn true;"))}function iS(i){return typeof i!="bigint"?Ve(i):"".concat(Ve(i),"n")}function sc(i,t){let e=Math.ceil(i)*t-1;return(e-e%64+64||64)/t}function Ou(i,t=0){return i.length>=t?i.subarray(0,t):gn(new i.constructor(t),i,0)}var Ke=class{constructor(t,e=0,r=1){this.length=Math.ceil(e/r),this.buffer=new t(this.length),this.stride=r,this.BYTES_PER_ELEMENT=t.BYTES_PER_ELEMENT,this.ArrayType=t}get byteLength(){return Math.ceil(this.length*this.stride)*this.BYTES_PER_ELEMENT}get reservedLength(){return this.buffer.length/this.stride}get reservedByteLength(){return this.buffer.byteLength}set(t,e){return this}append(t){return this.set(this.length,t)}reserve(t){if(t>0){this.length+=t;let e=this.stride,r=this.length*e,c=this.buffer.length;r>=c&&this._resize(c===0?sc(r*1,this.BYTES_PER_ELEMENT):sc(r*2,this.BYTES_PER_ELEMENT))}return this}flush(t=this.length){t=sc(t*this.stride,this.BYTES_PER_ELEMENT);let e=Ou(this.buffer,t);return this.clear(),e}clear(){return this.length=0,this.buffer=new this.ArrayType,this}_resize(t){return this.buffer=Ou(this.buffer,t)}},ki=class extends Ke{last(){return this.get(this.length-1)}get(t){return this.buffer[t]}set(t,e){return this.reserve(t-this.length+1),this.buffer[t*this.stride]=e,this}},Qr=class extends ki{constructor(){super(Uint8Array,0,1/8),this.numValid=0}get numInvalid(){return this.length-this.numValid}get(t){return this.buffer[t>>3]>>t%8&1}set(t,e){let{buffer:r}=this.reserve(t-this.length+1),c=t>>3,f=t%8,_=r[c]>>f&1;return e?_===0&&(r[c]|=1<<f,++this.numValid):_===1&&(r[c]&=~(1<<f),--this.numValid),this}clear(){return this.numValid=0,super.clear()}},tn=class extends ki{constructor(t){super(t.OffsetArrayType,1,1)}append(t){return this.set(this.length-1,t)}set(t,e){let r=this.length-1,c=this.reserve(t-r+1).buffer;return r<t++&&r>=0&&c.fill(c[r],r,t),c[t]=c[t-1]+e,this}flush(t=this.length-1){return t>this.length&&this.set(t-1,this.BYTES_PER_ELEMENT>4?BigInt(0):0),super.flush(t+1)}};var Pt=class{static throughNode(t){throw new Error('"throughNode" not available in this environment')}static throughDOM(t){throw new Error('"throughDOM" not available in this environment')}constructor({type:t,nullValues:e}){this.length=0,this.finished=!1,this.type=t,this.children=[],this.nullValues=e,this.stride=we(t),this._nulls=new Qr,e&&e.length>0&&(this._isValid=Eu(e))}toVector(){return new gt([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,{_offsets:e,_values:r,_nulls:c,_typeIds:f,children:_}=this;return e&&(t+=e.byteLength),r&&(t+=r.byteLength),c&&(t+=c.byteLength),f&&(t+=f.byteLength),_.reduce((b,g)=>b+g.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((e,r)=>e+r.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,e){return this.setValid(t,this.isValid(e))&&this.setValue(t,e),this}setValue(t,e){this._setValue(this,t,e)}setValid(t,e){return this.length=this._nulls.set(t,+e).length,e}addChild(t,e="".concat(this.numChildren)){throw new Error('Cannot append children to non-nested type "'.concat(this.type,'"'))}getChildAt(t){return this.children[t]||null}flush(){let t,e,r,c,{type:f,length:_,nullCount:b,_typeIds:g,_offsets:T,_values:D,_nulls:U}=this;(e=g==null?void 0:g.flush(_))?c=T==null?void 0:T.flush(_):(c=T==null?void 0:T.flush(_))?t=D==null?void 0:D.flush(T.last()):t=D==null?void 0:D.flush(_),b>0&&(r=U==null?void 0:U.flush(_));let M=this.children.map(N=>N.flush());return this.clear(),dt({type:f,length:_,nullCount:b,children:M,child:M[0],data:t,typeIds:e,nullBitmap:r,valueOffsets:c})}finish(){this.finished=!0;for(let t of this.children)t.finish();return this}clear(){var t,e,r,c;this.length=0,(t=this._nulls)===null||t===void 0||t.clear(),(e=this._values)===null||e===void 0||e.clear(),(r=this._offsets)===null||r===void 0||r.clear(),(c=this._typeIds)===null||c===void 0||c.clear();for(let f of this.children)f.clear();return this}};Pt.prototype.length=1;Pt.prototype.stride=1;Pt.prototype.children=null;Pt.prototype.finished=!1;Pt.prototype.nullValues=null;Pt.prototype._isValid=()=>!0;var Kt=class extends Pt{constructor(t){super(t),this._values=new ki(this.ArrayType,0,this.stride)}setValue(t,e){let r=this._values;return r.reserve(t-r.length+1),super.setValue(t,e)}},de=class extends Pt{constructor(t){super(t),this._pendingLength=0,this._offsets=new tn(t.type)}setValue(t,e){let r=this._pending||(this._pending=new Map),c=r.get(t);c&&(this._pendingLength-=c.length),this._pendingLength+=e instanceof ai?e[ir].length:e.length,r.set(t,e)}setValid(t,e){return super.setValid(t,e)?!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(){let t=this._pending,e=this._pendingLength;return this._pendingLength=0,this._pending=void 0,t&&t.size>0&&this._flushPending(t,e),this}};var br=class{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,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 sizeOf(){return 24}static createBlock(t,e,r,c){return t.prep(8,24),t.writeInt64(BigInt(c!=null?c:0)),t.pad(4),t.writeInt32(r),t.writeInt64(BigInt(e!=null?e:0)),t.offset()}};var Se=class i{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsFooter(t,e){return(e||new i).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFooter(t,e){return t.setPosition(t.position()+4),(e||new i).__init(t.readInt32(t.position())+t.position(),t)}version(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):Bt.V1}schema(t){let e=this.bb.__offset(this.bb_pos,6);return e?(t||new ue).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}dictionaries(t,e){let r=this.bb.__offset(this.bb_pos,8);return r?(e||new br).__init(this.bb.__vector(this.bb_pos+r)+t*24,this.bb):null}dictionariesLength(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}recordBatches(t,e){let r=this.bb.__offset(this.bb_pos,10);return r?(e||new br).__init(this.bb.__vector(this.bb_pos+r)+t*24,this.bb):null}recordBatchesLength(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__vector_len(this.bb_pos+t):0}customMetadata(t,e){let r=this.bb.__offset(this.bb_pos,12);return r?(e||new Xt).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+t*4),this.bb):null}customMetadataLength(){let t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}static startFooter(t){t.startObject(5)}static addVersion(t,e){t.addFieldInt16(0,e,Bt.V1)}static addSchema(t,e){t.addFieldOffset(1,e,0)}static addDictionaries(t,e){t.addFieldOffset(2,e,0)}static startDictionariesVector(t,e){t.startVector(24,e,8)}static addRecordBatches(t,e){t.addFieldOffset(3,e,0)}static startRecordBatchesVector(t,e){t.startVector(24,e,8)}static addCustomMetadata(t,e){t.addFieldOffset(4,e,0)}static createCustomMetadataVector(t,e){t.startVector(4,e.length,4);for(let r=e.length-1;r>=0;r--)t.addOffset(e[r]);return t.endVector()}static startCustomMetadataVector(t,e){t.startVector(4,e,4)}static endFooter(t){return t.endObject()}static finishFooterBuffer(t,e){t.finish(e)}static finishSizePrefixedFooterBuffer(t,e){t.finish(e,void 0,!0)}};var At=class i{constructor(t=[],e,r,c=Bt.V5){this.fields=t||[],this.metadata=e||new Map,r||(r=oc(this.fields)),this.dictionaries=r,this.metadataVersion=c}get[Symbol.toStringTag](){return"Schema"}get names(){return this.fields.map(t=>t.name)}toString(){return"Schema<{ ".concat(this.fields.map((t,e)=>"".concat(e,": ").concat(t)).join(", ")," }>")}select(t){let e=new Set(t),r=this.fields.filter(c=>e.has(c.name));return new i(r,this.metadata)}selectAt(t){let e=t.map(r=>this.fields[r]).filter(Boolean);return new i(e,this.metadata)}assign(...t){let e=t[0]instanceof i?t[0]:Array.isArray(t[0])?new i(t[0]):new i(t),r=[...this.fields],c=To(To(new Map,this.metadata),e.metadata),f=e.fields.filter(b=>{let g=r.findIndex(T=>T.name===b.name);return~g?(r[g]=b.clone({metadata:To(To(new Map,r[g].metadata),b.metadata)}))&&!1:!0}),_=oc(f,new Map);return new i([...r,...f],c,new Map([...this.dictionaries,..._]))}};At.prototype.fields=null;At.prototype.metadata=null;At.prototype.dictionaries=null;var bt=class i{static new(...t){let[e,r,c,f]=t;return t[0]&&typeof t[0]=="object"&&({name:e}=t[0],r===void 0&&(r=t[0].type),c===void 0&&(c=t[0].nullable),f===void 0&&(f=t[0].metadata)),new i("".concat(e),r,c,f)}constructor(t,e,r=!1,c){this.name=t,this.type=e,this.nullable=r,this.metadata=c||new Map}get typeId(){return this.type.typeId}get[Symbol.toStringTag](){return"Field"}toString(){return"".concat(this.name,": ").concat(this.type)}clone(...t){let[e,r,c,f]=t;return!t[0]||typeof t[0]!="object"?[e=this.name,r=this.type,c=this.nullable,f=this.metadata]=t:{name:e=this.name,type:r=this.type,nullable:c=this.nullable,metadata:f=this.metadata}=t[0],i.new(e,r,c,f)}};bt.prototype.type=null;bt.prototype.name=null;bt.prototype.nullable=null;bt.prototype.metadata=null;function To(i,t){return new Map([...i||new Map,...t||new Map])}function oc(i,t=new Map){for(let e=-1,r=i.length;++e<r;){let f=i[e].type;if(z.isDictionary(f)){if(!t.has(f.id))t.set(f.id,f.dictionary);else if(t.get(f.id)!==f.dictionary)throw new Error("Cannot create Schema containing two different dictionaries with the same Id")}f.children&&f.children.length>0&&oc(f.children,t)}return t}var rS=fr,nS=be,Ei=class{static decode(t){t=new nS(ot(t));let e=Se.getRootAsFooter(t),r=At.decode(e.schema(),new Map,e.version());return new ac(r,e)}static encode(t){let e=new rS,r=At.encode(e,t.schema);Se.startRecordBatchesVector(e,t.numRecordBatches);for(let _ of[...t.recordBatches()].slice().reverse())Oi.encode(e,_);let c=e.endVector();Se.startDictionariesVector(e,t.numDictionaries);for(let _ of[...t.dictionaryBatches()].slice().reverse())Oi.encode(e,_);let f=e.endVector();return Se.startFooter(e),Se.addSchema(e,r),Se.addVersion(e,Bt.V5),Se.addRecordBatches(e,c),Se.addDictionaries(e,f),Se.finishFooterBuffer(e,Se.endFooter(e)),e.asUint8Array()}get numRecordBatches(){return this._recordBatches.length}get numDictionaries(){return this._dictionaryBatches.length}constructor(t,e=Bt.V5,r,c){this.schema=t,this.version=e,r&&(this._recordBatches=r),c&&(this._dictionaryBatches=c)}*recordBatches(){for(let t,e=-1,r=this.numRecordBatches;++e<r;)(t=this.getRecordBatch(e))&&(yield t)}*dictionaryBatches(){for(let t,e=-1,r=this.numDictionaries;++e<r;)(t=this.getDictionaryBatch(e))&&(yield t)}getRecordBatch(t){return t>=0&&t<this.numRecordBatches&&this._recordBatches[t]||null}getDictionaryBatch(t){return t>=0&&t<this.numDictionaries&&this._dictionaryBatches[t]||null}};var ac=class extends Ei{get numRecordBatches(){return this._footer.recordBatchesLength()}get numDictionaries(){return this._footer.dictionariesLength()}constructor(t,e){super(t,e.version()),this._footer=e}getRecordBatch(t){if(t>=0&&t<this.numRecordBatches){let e=this._footer.recordBatches(t);if(e)return Oi.decode(e)}return null}getDictionaryBatch(t){if(t>=0&&t<this.numDictionaries){let e=this._footer.dictionaries(t);if(e)return Oi.decode(e)}return null}},Oi=class i{static decode(t){return new i(t.metaDataLength(),t.bodyLength(),t.offset())}static encode(t,e){let{metaDataLength:r}=e,c=BigInt(e.offset),f=BigInt(e.bodyLength);return br.createBlock(t,c,r,f)}constructor(t,e,r){this.metaDataLength=t,this.offset=wt(r),this.bodyLength=wt(e)}};var Lt=Object.freeze({done:!0,value:void 0}),Pn=class{constructor(t){this._json=t}get schema(){return this._json.schema}get batches(){return this._json.batches||[]}get dictionaries(){return this._json.dictionaries||[]}},vr=class{tee(){return this._getDOMStream().tee()}pipe(t,e){return this._getNodeStream().pipe(t,e)}pipeTo(t,e){return this._getDOMStream().pipeTo(t,e)}pipeThrough(t,e){return this._getDOMStream().pipeThrough(t,e)}_getDOMStream(){return this._DOMStream||(this._DOMStream=this.toDOMStream())}_getNodeStream(){return this._nodeStream||(this._nodeStream=this.toNodeStream())}},jo=class extends vr{constructor(){super(),this._values=[],this.resolvers=[],this._closedPromise=new Promise(t=>this._closedPromiseResolve=t)}get closed(){return this._closedPromise}cancel(t){return V(this,void 0,void 0,function*(){yield 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){let{resolvers:t}=this;for(;t.length>0;)t.shift().resolve(Lt);this._closedPromiseResolve(),this._closedPromiseResolve=void 0}}[Symbol.asyncIterator](){return this}toDOMStream(t){return ee.toDOMStream(this._closedPromiseResolve||this._error?this:this._values,t)}toNodeStream(t){return ee.toNodeStream(this._closedPromiseResolve||this._error?this:this._values,t)}throw(t){return V(this,void 0,void 0,function*(){return yield this.abort(t),Lt})}return(t){return V(this,void 0,void 0,function*(){return yield this.close(),Lt})}read(t){return V(this,void 0,void 0,function*(){return(yield this.next(t,"read")).value})}peek(t){return V(this,void 0,void 0,function*(){return(yield 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((e,r)=>{this.resolvers.push({resolve:e,reject:r})}):Promise.resolve(Lt)}_ensureOpen(){if(this._closedPromiseResolve)return!0;throw new Error("AsyncQueue is closed")}};var ci=class extends jo{write(t){if((t=ot(t)).byteLength>0)return super.write(t)}toString(t=!1){return t?bn(this.toUint8Array(!0)):this.toUint8Array(!1).then(bn)}toUint8Array(t=!1){return t?me(this._values)[0]:V(this,void 0,void 0,function*(){var e,r,c,f;let _=[],b=0;try{for(var g=!0,T=Ue(this),D;D=yield T.next(),e=D.done,!e;g=!0){f=D.value,g=!1;let U=f;_.push(U),b+=U.byteLength}}catch(U){r={error:U}}finally{try{!g&&!e&&(c=T.return)&&(yield c.call(T))}finally{if(r)throw r.error}}return me(_,b)[0]})}},li=class{constructor(t){t&&(this.source=new cc(ee.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)}},Ae=class i{constructor(t){t instanceof i?this.source=t.source:t instanceof ci?this.source=new Ui(ee.fromAsyncIterable(t)):Os(t)?this.source=new Ui(ee.fromNodeStream(t)):vn(t)?this.source=new Ui(ee.fromDOMStream(t)):ks(t)?this.source=new Ui(ee.fromDOMStream(t.body)):Re(t)?this.source=new Ui(ee.fromIterable(t)):Me(t)?this.source=new Ui(ee.fromAsyncIterable(t)):je(t)&&(this.source=new Ui(ee.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)}},cc=class{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,e="read"){return this.source.next({cmd:e,size:t})}throw(t){return Object.create(this.source.throw&&this.source.throw(t)||Lt)}return(t){return Object.create(this.source.return&&this.source.return(t)||Lt)}},Ui=class{constructor(t){this.source=t,this._closedPromise=new Promise(e=>this._closedPromiseResolve=e)}cancel(t){return V(this,void 0,void 0,function*(){yield this.return(t)})}get closed(){return this._closedPromise}read(t){return V(this,void 0,void 0,function*(){return(yield this.next(t,"read")).value})}peek(t){return V(this,void 0,void 0,function*(){return(yield this.next(t,"peek")).value})}next(t){return V(this,arguments,void 0,function*(e,r="read"){return yield this.source.next({cmd:r,size:e})})}throw(t){return V(this,void 0,void 0,function*(){let e=this.source.throw&&(yield this.source.throw(t))||Lt;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(e)})}return(t){return V(this,void 0,void 0,function*(){let e=this.source.return&&(yield this.source.return(t))||Lt;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(e)})}};var Vn=class extends li{constructor(t,e){super(),this.position=0,this.buffer=ot(t),this.size=e===void 0?this.buffer.byteLength:e}readInt32(t){let{buffer:e,byteOffset:r}=this.readAt(t,4);return new DataView(e,r).getInt32(0,!0)}seek(t){return this.position=Math.min(t,this.size),t<this.size}read(t){let{buffer:e,size:r,position:c}=this;return e&&c<r?(typeof t!="number"&&(t=Number.POSITIVE_INFINITY),this.position=Math.min(r,c+Math.min(r-c,t)),e.subarray(c,this.position)):null}readAt(t,e){let r=this.buffer,c=Math.min(this.size,t+e);return r?r.subarray(t,c):new Uint8Array(e)}close(){this.buffer&&(this.buffer=null)}throw(t){return this.close(),{done:!0,value:t}}return(t){return this.close(),{done:!0,value:t}}},nr=class extends Ae{constructor(t,e){super(),this.position=0,this._handle=t,typeof e=="number"?this.size=e:this._pending=V(this,void 0,void 0,function*(){this.size=(yield t.stat()).size,delete this._pending})}readInt32(t){return V(this,void 0,void 0,function*(){let{buffer:e,byteOffset:r}=yield this.readAt(t,4);return new DataView(e,r).getInt32(0,!0)})}seek(t){return V(this,void 0,void 0,function*(){return this._pending&&(yield this._pending),this.position=Math.min(t,this.size),t<this.size})}read(t){return V(this,void 0,void 0,function*(){this._pending&&(yield this._pending);let{_handle:e,size:r,position:c}=this;if(e&&c<r){typeof t!="number"&&(t=Number.POSITIVE_INFINITY);let f=c,_=0,b=0,g=Math.min(r,f+Math.min(r-f,t)),T=new Uint8Array(Math.max(0,(this.position=g)-f));for(;(f+=b)<g&&(_+=b)<T.byteLength;)({bytesRead:b}=yield e.read(T,_,T.byteLength-_,f));return T}return null})}readAt(t,e){return V(this,void 0,void 0,function*(){this._pending&&(yield this._pending);let{_handle:r,size:c}=this;if(r&&t+e<c){let f=Math.min(c,t+e),_=new Uint8Array(f-t);return(yield r.read(_,0,e,t)).buffer}return new Uint8Array(e)})}close(){return V(this,void 0,void 0,function*(){let t=this._handle;this._handle=null,t&&(yield t.close())})}throw(t){return V(this,void 0,void 0,function*(){return yield this.close(),{done:!0,value:t}})}return(t){return V(this,void 0,void 0,function*(){return yield this.close(),{done:!0,value:t}})}};var uc={};$i(uc,{BaseInt64:()=>Hn,Int128:()=>zn,Int64:()=>Mi,Uint64:()=>zt});function en(i){return i<0&&(i=4294967295+i+1),"0x".concat(i.toString(16))}var rn=8,lc=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8],Hn=class{constructor(t){this.buffer=t}high(){return this.buffer[1]}low(){return this.buffer[0]}_times(t){let e=new Uint32Array([this.buffer[1]>>>16,this.buffer[1]&65535,this.buffer[0]>>>16,this.buffer[0]&65535]),r=new Uint32Array([t.buffer[1]>>>16,t.buffer[1]&65535,t.buffer[0]>>>16,t.buffer[0]&65535]),c=e[3]*r[3];this.buffer[0]=c&65535;let f=c>>>16;return c=e[2]*r[3],f+=c,c=e[3]*r[2]>>>0,f+=c,this.buffer[0]+=f<<16,this.buffer[1]=f>>>0<c?65536:0,this.buffer[1]+=f>>>16,this.buffer[1]+=e[1]*r[3]+e[2]*r[2]+e[3]*r[1],this.buffer[1]+=e[0]*r[3]+e[1]*r[2]+e[2]*r[1]+e[3]*r[0]<<16,this}_plus(t){let e=this.buffer[0]+t.buffer[0]>>>0;this.buffer[1]+=t.buffer[1],e<this.buffer[0]>>>0&&++this.buffer[1],this.buffer[0]=e}lessThan(t){return this.buffer[1]<t.buffer[1]||this.buffer[1]===t.buffer[1]&&this.buffer[0]<t.buffer[0]}equals(t){return this.buffer[1]===t.buffer[1]&&this.buffer[0]==t.buffer[0]}greaterThan(t){return t.lessThan(this)}hex(){return"".concat(en(this.buffer[1])," ").concat(en(this.buffer[0]))}},zt=class i extends Hn{times(t){return this._times(t),this}plus(t){return this._plus(t),this}static from(t,e=new Uint32Array(2)){return i.fromString(typeof t=="string"?t:t.toString(),e)}static fromNumber(t,e=new Uint32Array(2)){return i.fromString(t.toString(),e)}static fromString(t,e=new Uint32Array(2)){let r=t.length,c=new i(e);for(let f=0;f<r;){let _=rn<r-f?rn:r-f,b=new i(new Uint32Array([Number.parseInt(t.slice(f,f+_),10),0])),g=new i(new Uint32Array([lc[_],0]));c.times(g),c.plus(b),f+=_}return c}static convertArray(t){let e=new Uint32Array(t.length*2);for(let r=-1,c=t.length;++r<c;)i.from(t[r],new Uint32Array(e.buffer,e.byteOffset+2*r*4,2));return e}static multiply(t,e){return new i(new Uint32Array(t.buffer)).times(e)}static add(t,e){return new i(new Uint32Array(t.buffer)).plus(e)}},Mi=class i extends Hn{negate(){return this.buffer[0]=~this.buffer[0]+1,this.buffer[1]=~this.buffer[1],this.buffer[0]==0&&++this.buffer[1],this}times(t){return this._times(t),this}plus(t){return this._plus(t),this}lessThan(t){let e=this.buffer[1]<<0,r=t.buffer[1]<<0;return e<r||e===r&&this.buffer[0]<t.buffer[0]}static from(t,e=new Uint32Array(2)){return i.fromString(typeof t=="string"?t:t.toString(),e)}static fromNumber(t,e=new Uint32Array(2)){return i.fromString(t.toString(),e)}static fromString(t,e=new Uint32Array(2)){let r=t.startsWith("-"),c=t.length,f=new i(e);for(let _=r?1:0;_<c;){let b=rn<c-_?rn:c-_,g=new i(new Uint32Array([Number.parseInt(t.slice(_,_+b),10),0])),T=new i(new Uint32Array([lc[b],0]));f.times(T),f.plus(g),_+=b}return r?f.negate():f}static convertArray(t){let e=new Uint32Array(t.length*2);for(let r=-1,c=t.length;++r<c;)i.from(t[r],new Uint32Array(e.buffer,e.byteOffset+2*r*4,2));return e}static multiply(t,e){return new i(new Uint32Array(t.buffer)).times(e)}static add(t,e){return new i(new Uint32Array(t.buffer)).plus(e)}},zn=class i{constructor(t){this.buffer=t}high(){return new Mi(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2))}low(){return new Mi(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset,2))}negate(){return this.buffer[0]=~this.buffer[0]+1,this.buffer[1]=~this.buffer[1],this.buffer[2]=~this.buffer[2],this.buffer[3]=~this.buffer[3],this.buffer[0]==0&&++this.buffer[1],this.buffer[1]==0&&++this.buffer[2],this.buffer[2]==0&&++this.buffer[3],this}times(t){let e=new zt(new Uint32Array([this.buffer[3],0])),r=new zt(new Uint32Array([this.buffer[2],0])),c=new zt(new Uint32Array([this.buffer[1],0])),f=new zt(new Uint32Array([this.buffer[0],0])),_=new zt(new Uint32Array([t.buffer[3],0])),b=new zt(new Uint32Array([t.buffer[2],0])),g=new zt(new Uint32Array([t.buffer[1],0])),T=new zt(new Uint32Array([t.buffer[0],0])),D=zt.multiply(f,T);this.buffer[0]=D.low();let U=new zt(new Uint32Array([D.high(),0]));return D=zt.multiply(c,T),U.plus(D),D=zt.multiply(f,g),U.plus(D),this.buffer[1]=U.low(),this.buffer[3]=U.lessThan(D)?1:0,this.buffer[2]=U.high(),new zt(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2)).plus(zt.multiply(r,T)).plus(zt.multiply(c,g)).plus(zt.multiply(f,b)),this.buffer[3]+=zt.multiply(e,T).plus(zt.multiply(r,g)).plus(zt.multiply(c,b)).plus(zt.multiply(f,_)).low(),this}plus(t){let e=new Uint32Array(4);return e[3]=this.buffer[3]+t.buffer[3]>>>0,e[2]=this.buffer[2]+t.buffer[2]>>>0,e[1]=this.buffer[1]+t.buffer[1]>>>0,e[0]=this.buffer[0]+t.buffer[0]>>>0,e[0]<this.buffer[0]>>>0&&++e[1],e[1]<this.buffer[1]>>>0&&++e[2],e[2]<this.buffer[2]>>>0&&++e[3],this.buffer[3]=e[3],this.buffer[2]=e[2],this.buffer[1]=e[1],this.buffer[0]=e[0],this}hex(){return"".concat(en(this.buffer[3])," ").concat(en(this.buffer[2])," ").concat(en(this.buffer[1])," ").concat(en(this.buffer[0]))}static multiply(t,e){return new i(new Uint32Array(t.buffer)).times(e)}static add(t,e){return new i(new Uint32Array(t.buffer)).plus(e)}static from(t,e=new Uint32Array(4)){return i.fromString(typeof t=="string"?t:t.toString(),e)}static fromNumber(t,e=new Uint32Array(4)){return i.fromString(t.toString(),e)}static fromString(t,e=new Uint32Array(4)){let r=t.startsWith("-"),c=t.length,f=new i(e);for(let _=r?1:0;_<c;){let b=rn<c-_?rn:c-_,g=new i(new Uint32Array([Number.parseInt(t.slice(_,_+b),10),0,0,0])),T=new i(new Uint32Array([lc[b],0,0,0]));f.times(T),f.plus(g),_+=b}return r?f.negate():f}static convertArray(t){let e=new Uint32Array(t.length*4);for(let r=-1,c=t.length;++r<c;)i.from(t[r],new Uint32Array(e.buffer,e.byteOffset+4*4*r,4));return e}};var Wn=class extends Z{constructor(t,e,r,c,f=Bt.V5){super(),this.nodesIndex=-1,this.buffersIndex=-1,this.bytes=t,this.nodes=e,this.buffers=r,this.dictionaries=c,this.metadataVersion=f}visit(t){return super.visit(t instanceof bt?t.type:t)}visitNull(t,{length:e}=this.nextFieldNode()){return dt({type:t,length:e})}visitBool(t,{length:e,nullCount:r}=this.nextFieldNode()){return dt({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitInt(t,{length:e,nullCount:r}=this.nextFieldNode()){return dt({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitFloat(t,{length:e,nullCount:r}=this.nextFieldNode()){return dt({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitUtf8(t,{length:e,nullCount:r}=this.nextFieldNode()){return dt({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),valueOffsets:this.readOffsets(t),data:this.readData(t)})}visitLargeUtf8(t,{length:e,nullCount:r}=this.nextFieldNode()){return dt({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),valueOffsets:this.readOffsets(t),data:this.readData(t)})}visitBinary(t,{length:e,nullCount:r}=this.nextFieldNode()){return dt({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),valueOffsets:this.readOffsets(t),data:this.readData(t)})}visitLargeBinary(t,{length:e,nullCount:r}=this.nextFieldNode()){return dt({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),valueOffsets:this.readOffsets(t),data:this.readData(t)})}visitFixedSizeBinary(t,{length:e,nullCount:r}=this.nextFieldNode()){return dt({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitDate(t,{length:e,nullCount:r}=this.nextFieldNode()){return dt({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitTimestamp(t,{length:e,nullCount:r}=this.nextFieldNode()){return dt({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitTime(t,{length:e,nullCount:r}=this.nextFieldNode()){return dt({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitDecimal(t,{length:e,nullCount:r}=this.nextFieldNode()){return dt({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitList(t,{length:e,nullCount:r}=this.nextFieldNode()){return dt({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),valueOffsets:this.readOffsets(t),child:this.visit(t.children[0])})}visitStruct(t,{length:e,nullCount:r}=this.nextFieldNode()){return dt({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),children:this.visitMany(t.children)})}visitUnion(t,{length:e,nullCount:r}=this.nextFieldNode()){return this.metadataVersion<Bt.V5&&this.readNullBitmap(t,r),t.mode===Ut.Sparse?this.visitSparseUnion(t,{length:e,nullCount:r}):this.visitDenseUnion(t,{length:e,nullCount:r})}visitDenseUnion(t,{length:e,nullCount:r}=this.nextFieldNode()){return dt({type:t,length:e,nullCount:r,typeIds:this.readTypeIds(t),valueOffsets:this.readOffsets(t),children:this.visitMany(t.children)})}visitSparseUnion(t,{length:e,nullCount:r}=this.nextFieldNode()){return dt({type:t,length:e,nullCount:r,typeIds:this.readTypeIds(t),children:this.visitMany(t.children)})}visitDictionary(t,{length:e,nullCount:r}=this.nextFieldNode()){return dt({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t.indices),dictionary:this.readDictionary(t)})}visitInterval(t,{length:e,nullCount:r}=this.nextFieldNode()){return dt({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitDuration(t,{length:e,nullCount:r}=this.nextFieldNode()){return dt({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitFixedSizeList(t,{length:e,nullCount:r}=this.nextFieldNode()){return dt({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),child:this.visit(t.children[0])})}visitMap(t,{length:e,nullCount:r}=this.nextFieldNode()){return dt({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),valueOffsets:this.readOffsets(t),child:this.visit(t.children[0])})}nextFieldNode(){return this.nodes[++this.nodesIndex]}nextBufferRange(){return this.buffers[++this.buffersIndex]}readNullBitmap(t,e,r=this.nextBufferRange()){return e>0&&this.readData(t,r)||new Uint8Array(0)}readOffsets(t,e){return this.readData(t,e)}readTypeIds(t,e){return this.readData(t,e)}readData(t,{length:e,offset:r}=this.nextBufferRange()){return this.bytes.subarray(r,r+e)}readDictionary(t){return this.dictionaries.get(t.id)}},Do=class extends Wn{constructor(t,e,r,c,f){super(new Uint8Array(0),e,r,c,f),this.sources=t}readNullBitmap(t,e,{offset:r}=this.nextBufferRange()){return e<=0?new Uint8Array(0):yr(this.sources[r])}readOffsets(t,{offset:e}=this.nextBufferRange()){return mt(Uint8Array,mt(t.OffsetArrayType,this.sources[e]))}readTypeIds(t,{offset:e}=this.nextBufferRange()){return mt(Uint8Array,mt(t.ArrayType,this.sources[e]))}readData(t,{offset:e}=this.nextBufferRange()){let{sources:r}=this;return z.isTimestamp(t)?mt(Uint8Array,Mi.convertArray(r[e])):(z.isInt(t)||z.isTime(t))&&t.bitWidth===64||z.isDuration(t)?mt(Uint8Array,Mi.convertArray(r[e])):z.isDate(t)&&t.unit===$t.MILLISECOND?mt(Uint8Array,Mi.convertArray(r[e])):z.isDecimal(t)?mt(Uint8Array,zn.convertArray(r[e])):z.isBinary(t)||z.isLargeBinary(t)||z.isFixedSizeBinary(t)?sS(r[e]):z.isBool(t)?yr(r[e]):z.isUtf8(t)||z.isLargeUtf8(t)?ei(r[e].join("")):mt(Uint8Array,mt(t.ArrayType,r[e].map(c=>+c)))}};function sS(i){let t=i.join(""),e=new Uint8Array(t.length/2);for(let r=0;r<t.length;r+=2)e[r>>1]=Number.parseInt(t.slice(r,r+2),16);return e}var nn=class extends de{constructor(t){super(t),this._values=new Ke(Uint8Array)}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,e){return super.setValue(t,ot(e))}_flushPending(t,e){let r=this._offsets,c=this._values.reserve(e).buffer,f=0;for(let[_,b]of t)if(b===void 0)r.set(_,0);else{let g=b.length;c.set(b,f),r.set(_,g),f+=g}}};var sn=class extends de{constructor(t){super(t),this._values=new Ke(Uint8Array)}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,e){return super.setValue(t,ot(e))}_flushPending(t,e){let r=this._offsets,c=this._values.reserve(e).buffer,f=0;for(let[_,b]of t)if(b===void 0)r.set(_,BigInt(0));else{let g=b.length;c.set(b,f),r.set(_,BigInt(g)),f+=g}}};var Bo=class extends Pt{constructor(t){super(t),this._values=new Qr}setValue(t,e){this._values.set(t,+e)}};var gr=class extends Kt{};gr.prototype._setValue=za;var $n=class extends gr{};$n.prototype._setValue=Zs;var Yn=class extends gr{};Yn.prototype._setValue=Qs;var Gn=class extends Kt{};Gn.prototype._setValue=Ya;var Fo=class extends Pt{constructor({type:t,nullValues:e,dictionaryHashFunction:r}){super({type:new ge(t.dictionary,t.indices,t.id,t.isOrdered)}),this._nulls=null,this._dictionaryOffset=0,this._keysToIndices=Object.create(null),this.indices=wr({type:this.type.indices,nullValues:e}),this.dictionary=wr({type:this.type.dictionary,nullValues:null}),typeof r=="function"&&(this.valueToKey=r)}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,e){let r=this.indices;return e=r.setValid(t,e),this.length=r.length,e}setValue(t,e){let r=this._keysToIndices,c=this.valueToKey(e),f=r[c];return f===void 0&&(r[c]=f=this._dictionaryOffset+this.dictionary.append(e).length-1),this.indices.setValue(t,f)}flush(){let t=this.type,e=this._dictionary,r=this.dictionary.toVector(),c=this.indices.flush().clone(t);return c.dictionary=e?e.concat(r):r,this.finished||(this._dictionaryOffset+=r.length),this._dictionary=c.dictionary,this.clear(),c}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:"".concat(t)}};var Kn=class extends Kt{};Kn.prototype._setValue=Ha;var Ao=class extends Pt{setValue(t,e){let[r]=this.children,c=t*this.stride;for(let f=-1,_=e.length;++f<_;)r.set(c+f,e[f])}addChild(t,e="0"){if(this.numChildren>0)throw new Error("FixedSizeListBuilder can only have one child.");let r=this.children.push(t);return this.type=new $e(this.type.listSize,new bt(e,t.type,!0)),r}};var Sr=class extends Kt{setValue(t,e){this._values.set(t,e)}},xo=class extends Sr{setValue(t,e){super.setValue(t,Mn(e))}},ko=class extends Sr{},Eo=class extends Sr{};var Ir=class extends Kt{};Ir.prototype._setValue=Ga;var qn=class extends Ir{};qn.prototype._setValue=co;var Jn=class extends Ir{};Jn.prototype._setValue=lo;var Ri=class extends Kt{};Ri.prototype._setValue=Ka;var Xn=class extends Ri{};Xn.prototype._setValue=uo;var Zn=class extends Ri{};Zn.prototype._setValue=fo;var Qn=class extends Ri{};Qn.prototype._setValue=ho;var ts=class extends Ri{};ts.prototype._setValue=po;var xe=class extends Kt{setValue(t,e){this._values.set(t,e)}},Oo=class extends xe{},Uo=class extends xe{},Mo=class extends xe{},Ro=class extends xe{},Co=class extends xe{},Lo=class extends xe{},No=class extends xe{},Po=class extends xe{};var Vo=class extends de{constructor(t){super(t),this._offsets=new tn(t.type)}addChild(t,e="0"){if(this.numChildren>0)throw new Error("ListBuilder can only have one child.");return this.children[this.numChildren]=t,this.type=new ze(new bt(e,t.type,!0)),this.numChildren-1}_flushPending(t){let e=this._offsets,[r]=this.children;for(let[c,f]of t)if(typeof f>"u")e.set(c,0);else{let _=f,b=_.length,g=e.set(c,b).buffer[c];for(let T=-1;++T<b;)r.set(g+T,_[T])}}};var Ho=class extends de{set(t,e){return super.set(t,e)}setValue(t,e){let r=e instanceof Map?e:new Map(Object.entries(e)),c=this._pending||(this._pending=new Map),f=c.get(t);f&&(this._pendingLength-=f.size),this._pendingLength+=r.size,c.set(t,r)}addChild(t,e="".concat(this.numChildren)){if(this.numChildren>0)throw new Error("ListBuilder can only have one child.");return this.children[this.numChildren]=t,this.type=new Ye(new bt(e,t.type,!0),this.type.keysSorted),this.numChildren-1}_flushPending(t){let e=this._offsets,[r]=this.children;for(let[c,f]of t)if(f===void 0)e.set(c,0);else{let{[c]:_,[c+1]:b}=e.set(c,f.size).buffer;for(let g of f.entries())if(r.set(_,g),++_>=b)break}}};var zo=class extends Pt{setValue(t,e){}setValid(t,e){return this.length=Math.max(t+1,this.length),e}};var Wo=class extends Pt{setValue(t,e){let{children:r,type:c}=this;switch(Array.isArray(e)||e.constructor){case!0:return c.children.forEach((f,_)=>r[_].set(t,e[_]));case Map:return c.children.forEach((f,_)=>r[_].set(t,e.get(f.name)));default:return c.children.forEach((f,_)=>r[_].set(t,e[f.name]))}}setValid(t,e){return super.setValid(t,e)||this.children.forEach(r=>r.setValid(t,e)),e}addChild(t,e="".concat(this.numChildren)){let r=this.children.push(t);return this.type=new Ct([...this.type.children,new bt(e,t.type,!0)]),r}};var Ci=class extends Kt{};Ci.prototype._setValue=Wa;var es=class extends Ci{};es.prototype._setValue=to;var is=class extends Ci{};is.prototype._setValue=eo;var rs=class extends Ci{};rs.prototype._setValue=io;var ns=class extends Ci{};ns.prototype._setValue=ro;var Li=class extends Kt{};Li.prototype._setValue=$a;var ss=class extends Li{};ss.prototype._setValue=no;var os=class extends Li{};os.prototype._setValue=so;var as=class extends Li{};as.prototype._setValue=oo;var cs=class extends Li{};cs.prototype._setValue=ao;var on=class extends Pt{constructor(t){super(t),this._typeIds=new ki(Int8Array,0,1),typeof t.valueToChildTypeId=="function"&&(this._valueToChildTypeId=t.valueToChildTypeId)}get typeIdToChildIndex(){return this.type.typeIdToChildIndex}append(t,e){return this.set(this.length,t,e)}set(t,e,r){return r===void 0&&(r=this._valueToChildTypeId(this,e,t)),this.setValue(t,e,r),this}setValue(t,e,r){this._typeIds.set(t,r);let c=this.type.typeIdToChildIndex[r],f=this.children[c];f==null||f.set(t,e)}addChild(t,e="".concat(this.children.length)){let r=this.children.push(t),{type:{children:c,mode:f,typeIds:_}}=this,b=[...c,new bt(e,t.type)];return this.type=new We(f,[..._,r],b),r}_valueToChildTypeId(t,e,r){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.")}},$o=class extends on{},Yo=class extends on{constructor(t){super(t),this._offsets=new ki(Int32Array)}setValue(t,e,r){let c=this._typeIds.set(t,r).buffer[t],f=this.getChildAt(this.type.typeIdToChildIndex[c]),_=this._offsets.set(t,f.length).buffer[t];f==null||f.set(_,e)}};var ls=class extends de{constructor(t){super(t),this._values=new Ke(Uint8Array)}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,e){return super.setValue(t,ei(e))}_flushPending(t,e){}};ls.prototype._flushPending=nn.prototype._flushPending;var us=class extends de{constructor(t){super(t),this._values=new Ke(Uint8Array)}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,e){return super.setValue(t,ei(e))}_flushPending(t,e){}};us.prototype._flushPending=sn.prototype._flushPending;var dc=class extends Z{visitNull(){return zo}visitBool(){return Bo}visitInt(){return xe}visitInt8(){return Oo}visitInt16(){return Uo}visitInt32(){return Mo}visitInt64(){return Ro}visitUint8(){return Co}visitUint16(){return Lo}visitUint32(){return No}visitUint64(){return Po}visitFloat(){return Sr}visitFloat16(){return xo}visitFloat32(){return ko}visitFloat64(){return Eo}visitUtf8(){return ls}visitLargeUtf8(){return us}visitBinary(){return nn}visitLargeBinary(){return sn}visitFixedSizeBinary(){return Kn}visitDate(){return gr}visitDateDay(){return $n}visitDateMillisecond(){return Yn}visitTimestamp(){return Ci}visitTimestampSecond(){return es}visitTimestampMillisecond(){return is}visitTimestampMicrosecond(){return rs}visitTimestampNanosecond(){return ns}visitTime(){return Li}visitTimeSecond(){return ss}visitTimeMillisecond(){return os}visitTimeMicrosecond(){return as}visitTimeNanosecond(){return cs}visitDecimal(){return Gn}visitList(){return Vo}visitStruct(){return Wo}visitUnion(){return on}visitDenseUnion(){return Yo}visitSparseUnion(){return $o}visitDictionary(){return Fo}visitInterval(){return Ir}visitIntervalDayTime(){return qn}visitIntervalYearMonth(){return Jn}visitDuration(){return Ri}visitDurationSecond(){return Xn}visitDurationMillisecond(){return Zn}visitDurationMicrosecond(){return Qn}visitDurationNanosecond(){return ts}visitFixedSizeList(){return Ao}visitMap(){return Ho}},Uu=new dc;var it=class extends Z{compareSchemas(t,e){return t===e||e instanceof t.constructor&&this.compareManyFields(t.fields,e.fields)}compareManyFields(t,e){return t===e||Array.isArray(t)&&Array.isArray(e)&&t.length===e.length&&t.every((r,c)=>this.compareFields(r,e[c]))}compareFields(t,e){return t===e||e instanceof t.constructor&&t.name===e.name&&t.nullable===e.nullable&&this.visit(t.type,e.type)}};function ce(i,t){return t instanceof i.constructor}function Tr(i,t){return i===t||ce(i,t)}function Ni(i,t){return i===t||ce(i,t)&&i.bitWidth===t.bitWidth&&i.isSigned===t.isSigned}function Go(i,t){return i===t||ce(i,t)&&i.precision===t.precision}function oS(i,t){return i===t||ce(i,t)&&i.byteWidth===t.byteWidth}function fc(i,t){return i===t||ce(i,t)&&i.unit===t.unit}function ds(i,t){return i===t||ce(i,t)&&i.unit===t.unit&&i.timezone===t.timezone}function fs(i,t){return i===t||ce(i,t)&&i.unit===t.unit&&i.bitWidth===t.bitWidth}function aS(i,t){return i===t||ce(i,t)&&i.children.length===t.children.length&&ui.compareManyFields(i.children,t.children)}function cS(i,t){return i===t||ce(i,t)&&i.children.length===t.children.length&&ui.compareManyFields(i.children,t.children)}function hc(i,t){return i===t||ce(i,t)&&i.mode===t.mode&&i.typeIds.every((e,r)=>e===t.typeIds[r])&&ui.compareManyFields(i.children,t.children)}function lS(i,t){return i===t||ce(i,t)&&i.id===t.id&&i.isOrdered===t.isOrdered&&ui.visit(i.indices,t.indices)&&ui.visit(i.dictionary,t.dictionary)}function pc(i,t){return i===t||ce(i,t)&&i.unit===t.unit}function hs(i,t){return i===t||ce(i,t)&&i.unit===t.unit}function uS(i,t){return i===t||ce(i,t)&&i.listSize===t.listSize&&i.children.length===t.children.length&&ui.compareManyFields(i.children,t.children)}function dS(i,t){return i===t||ce(i,t)&&i.keysSorted===t.keysSorted&&i.children.length===t.children.length&&ui.compareManyFields(i.children,t.children)}it.prototype.visitNull=Tr;it.prototype.visitBool=Tr;it.prototype.visitInt=Ni;it.prototype.visitInt8=Ni;it.prototype.visitInt16=Ni;it.prototype.visitInt32=Ni;it.prototype.visitInt64=Ni;it.prototype.visitUint8=Ni;it.prototype.visitUint16=Ni;it.prototype.visitUint32=Ni;it.prototype.visitUint64=Ni;it.prototype.visitFloat=Go;it.prototype.visitFloat16=Go;it.prototype.visitFloat32=Go;it.prototype.visitFloat64=Go;it.prototype.visitUtf8=Tr;it.prototype.visitLargeUtf8=Tr;it.prototype.visitBinary=Tr;it.prototype.visitLargeBinary=Tr;it.prototype.visitFixedSizeBinary=oS;it.prototype.visitDate=fc;it.prototype.visitDateDay=fc;it.prototype.visitDateMillisecond=fc;it.prototype.visitTimestamp=ds;it.prototype.visitTimestampSecond=ds;it.prototype.visitTimestampMillisecond=ds;it.prototype.visitTimestampMicrosecond=ds;it.prototype.visitTimestampNanosecond=ds;it.prototype.visitTime=fs;it.prototype.visitTimeSecond=fs;it.prototype.visitTimeMillisecond=fs;it.prototype.visitTimeMicrosecond=fs;it.prototype.visitTimeNanosecond=fs;it.prototype.visitDecimal=Tr;it.prototype.visitList=aS;it.prototype.visitStruct=cS;it.prototype.visitUnion=hc;it.prototype.visitDenseUnion=hc;it.prototype.visitSparseUnion=hc;it.prototype.visitDictionary=lS;it.prototype.visitInterval=pc;it.prototype.visitIntervalDayTime=pc;it.prototype.visitIntervalYearMonth=pc;it.prototype.visitDuration=hs;it.prototype.visitDurationSecond=hs;it.prototype.visitDurationMillisecond=hs;it.prototype.visitDurationMicrosecond=hs;it.prototype.visitDurationNanosecond=hs;it.prototype.visitFixedSizeList=uS;it.prototype.visitMap=dS;var ui=new it;function jr(i,t){return ui.compareSchemas(i,t)}function Mu(i,t){return ui.compareFields(i,t)}function Ru(i,t){return ui.visit(i,t)}function wr(i){let t=i.type,e=new(Uu.getVisitFn(t)())(i);if(t.children&&t.children.length>0){let r=i.children||[],c={nullValues:i.nullValues},f=Array.isArray(r)?(_,b)=>r[b]||c:({name:_})=>r[_]||c;for(let[_,b]of t.children.entries()){let{type:g}=b,T=f(b,_);e.children.push(wr(Object.assign(Object.assign({},T),{type:g})))}}return e}function Ko(i,t){return fS(i,t.map(e=>e.data.concat()))}function fS(i,t){let e=[...i.fields],r=[],c={numBatches:t.reduce((U,M)=>Math.max(U,M.length),0)},f=0,_=0,b=-1,g=t.length,T,D=[];for(;c.numBatches-- >0;){for(_=Number.POSITIVE_INFINITY,b=-1;++b<g;)D[b]=T=t[b].shift(),_=Math.min(_,T?T.length:_);Number.isFinite(_)&&(D=hS(e,_,D,t,c),_>0&&(r[f++]=dt({type:new Ct(e),length:_,nullCount:0,children:D.slice()})))}return[i=i.assign(e),r.map(U=>new Yt(i,U))]}function hS(i,t,e,r,c){var f;let _=(t+63&-64)>>3;for(let b=-1,g=r.length;++b<g;){let T=e[b],D=T==null?void 0:T.length;if(D>=t)D===t?e[b]=T:(e[b]=T.slice(0,t),c.numBatches=Math.max(c.numBatches,r[b].unshift(T.slice(t,D-t))));else{let U=i[b];i[b]=U.clone({nullable:!0}),e[b]=(f=T==null?void 0:T._changeLengthAndBackfillNullBitmap(t))!==null&&f!==void 0?f:dt({type:U.type,length:t,nullCount:t,nullBitmap:new Uint8Array(_)})}}return e}var Cu,le=class i{constructor(...t){var e,r;if(t.length===0)return this.batches=[],this.schema=new At([]),this._offsets=[0],this;let c,f;t[0]instanceof At&&(c=t.shift()),t.at(-1)instanceof Uint32Array&&(f=t.pop());let _=g=>{if(g){if(g instanceof Yt)return[g];if(g instanceof i)return g.batches;if(g instanceof jt){if(g.type instanceof Ct)return[new Yt(new At(g.type.children),g)]}else{if(Array.isArray(g))return g.flatMap(T=>_(T));if(typeof g[Symbol.iterator]=="function")return[...g].flatMap(T=>_(T));if(typeof g=="object"){let T=Object.keys(g),D=T.map(N=>new gt([g[N]])),U=c!=null?c:new At(T.map((N,nt)=>new bt(String(N),D[nt].type,D[nt].nullable))),[,M]=Ko(U,D);return M.length===0?[new Yt(g)]:M}}}return[]},b=t.flatMap(g=>_(g));if(c=(r=c!=null?c:(e=b[0])===null||e===void 0?void 0:e.schema)!==null&&r!==void 0?r:new At([]),!(c instanceof At))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");for(let g of b){if(!(g instanceof Yt))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");if(!jr(c,g.schema))throw new TypeError("Table and inner RecordBatch schemas must be equivalent.")}this.schema=c,this.batches=b,this._offsets=f!=null?f:vo(this.data)}get data(){return this.batches.map(({data:t})=>t)}get numCols(){return this.schema.fields.length}get numRows(){return this.data.reduce((t,e)=>t+e.length,0)}get nullCount(){return this._nullCount===-1&&(this._nullCount=bo(this.data)),this._nullCount}isValid(t){return!1}get(t){return null}at(t){return this.get(hr(t,this.numRows))}set(t,e){}indexOf(t,e){return-1}[Symbol.iterator](){return this.batches.length>0?Zr.visit(new gt(this.data)):new Array(0)[Symbol.iterator]()}toArray(){return[...this]}toString(){return"[\n ".concat(this.toArray().join(",\n "),"\n]")}concat(...t){let e=this.schema,r=this.data.concat(t.flatMap(({data:c})=>c));return new i(e,r.map(c=>new Yt(e,c)))}slice(t,e){let r=this.schema;[t,e]=Rn({length:this.numRows},t,e);let c=go(this.data,this._offsets,t,e);return new i(r,c.map(f=>new Yt(r,f)))}getChild(t){return this.getChildAt(this.schema.fields.findIndex(e=>e.name===t))}getChildAt(t){if(t>-1&&t<this.schema.fields.length){let e=this.data.map(r=>r.children[t]);if(e.length===0){let{type:r}=this.schema.fields[t],c=dt({type:r,length:0,nullCount:0});e.push(c._changeLengthAndBackfillNullBitmap(this.numRows))}return new gt(e)}return null}setChild(t,e){var r;return this.setChildAt((r=this.schema.fields)===null||r===void 0?void 0:r.findIndex(c=>c.name===t),e)}setChildAt(t,e){let r=this.schema,c=[...this.batches];if(t>-1&&t<this.numCols){e||(e=new gt([dt({type:new ae,length:this.numRows})]));let f=r.fields.slice(),_=f[t].clone({type:e.type}),b=this.schema.fields.map((g,T)=>this.getChildAt(T));[f[t],b[t]]=[_,e],[r,c]=Ko(r,b)}return new i(r,c)}select(t){let e=this.schema.fields.reduce((r,c,f)=>r.set(c.name,f),new Map);return this.selectAt(t.map(r=>e.get(r)).filter(r=>r>-1))}selectAt(t){let e=this.schema.selectAt(t),r=this.batches.map(c=>c.selectAt(t));return new i(e,r)}assign(t){let e=this.schema.fields,[r,c]=t.schema.fields.reduce((b,g,T)=>{let[D,U]=b,M=e.findIndex(N=>N.name===g.name);return~M?U[M]=T:D.push(T),b},[[],[]]),f=this.schema.assign(t.schema),_=[...e.map((b,g)=>[g,c[g]]).map(([b,g])=>g===void 0?this.getChildAt(b):t.getChildAt(g)),...r.map(b=>t.getChildAt(b))].filter(Boolean);return new i(...Ko(f,_))}};Cu=Symbol.toStringTag;le[Cu]=(i=>(i.schema=null,i.batches=[],i._offsets=new Uint32Array([0]),i._nullCount=-1,i[Symbol.isConcatSpreadable]=!0,i.isValid=Xr(Nn),i.get=Xr(Gt.getVisitFn(j.Struct)),i.set=wo(ie.getVisitFn(j.Struct)),i.indexOf=So(mr.getVisitFn(j.Struct)),"Table"))(le.prototype);var Nu,Yt=class i{constructor(...t){switch(t.length){case 2:{if([this.schema]=t,!(this.schema instanceof At))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");if([,this.data=dt({nullCount:0,type:new Ct(this.schema.fields),children:this.schema.fields.map(e=>dt({type:e.type,nullCount:0}))})]=t,!(this.data instanceof jt))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");[this.schema,this.data]=Lu(this.schema,this.data.children);break}case 1:{let[e]=t,{fields:r,children:c,length:f}=Object.keys(e).reduce((g,T,D)=>(g.children[D]=e[T],g.length=Math.max(g.length,e[T].length),g.fields[D]=bt.new({name:T,type:e[T].type,nullable:!0}),g),{length:0,fields:new Array,children:new Array}),_=new At(r),b=dt({type:new Ct(r),length:f,children:c,nullCount:0});[this.schema,this.data]=Lu(_,b.children,f);break}default:throw new TypeError("RecordBatch constructor expects an Object mapping names to child Data, or a [Schema, Data] pair.")}}get dictionaries(){return this._dictionaries||(this._dictionaries=Pu(this.schema.fields,this.data.children))}get numCols(){return this.schema.fields.length}get numRows(){return this.data.length}get nullCount(){return this.data.nullCount}isValid(t){return this.data.getValid(t)}get(t){return Gt.visit(this.data,t)}at(t){return this.get(hr(t,this.numRows))}set(t,e){return ie.visit(this.data,t,e)}indexOf(t,e){return mr.visit(this.data,t,e)}[Symbol.iterator](){return Zr.visit(new gt([this.data]))}toArray(){return[...this]}concat(...t){return new le(this.schema,[this,...t])}slice(t,e){let[r]=new gt([this.data]).slice(t,e).data;return new i(this.schema,r)}getChild(t){var e;return this.getChildAt((e=this.schema.fields)===null||e===void 0?void 0:e.findIndex(r=>r.name===t))}getChildAt(t){return t>-1&&t<this.schema.fields.length?new gt([this.data.children[t]]):null}setChild(t,e){var r;return this.setChildAt((r=this.schema.fields)===null||r===void 0?void 0:r.findIndex(c=>c.name===t),e)}setChildAt(t,e){let r=this.schema,c=this.data;if(t>-1&&t<this.numCols){e||(e=new gt([dt({type:new ae,length:this.numRows})]));let f=r.fields.slice(),_=c.children.slice(),b=f[t].clone({type:e.type});[f[t],_[t]]=[b,e.data[0]],r=new At(f,new Map(this.schema.metadata)),c=dt({type:new Ct(f),children:_})}return new i(r,c)}select(t){let e=this.schema.select(t),r=new Ct(e.fields),c=[];for(let f of t){let _=this.schema.fields.findIndex(b=>b.name===f);~_&&(c[_]=this.data.children[_])}return new i(e,dt({type:r,length:this.numRows,children:c}))}selectAt(t){let e=this.schema.selectAt(t),r=t.map(f=>this.data.children[f]).filter(Boolean),c=dt({type:new Ct(e.fields),length:this.numRows,children:r});return new i(e,c)}};Nu=Symbol.toStringTag;Yt[Nu]=(i=>(i._nullCount=-1,i[Symbol.isConcatSpreadable]=!0,"RecordBatch"))(Yt.prototype);function Lu(i,t,e=t.reduce((r,c)=>Math.max(r,c.length),0)){var r;let c=[...i.fields],f=[...t],_=(e+63&-64)>>3;for(let[b,g]of i.fields.entries()){let T=t[b];(!T||T.length!==e)&&(c[b]=g.clone({nullable:!0}),f[b]=(r=T==null?void 0:T._changeLengthAndBackfillNullBitmap(e))!==null&&r!==void 0?r:dt({type:g.type,length:e,nullCount:e,nullBitmap:new Uint8Array(_)}))}return[i.assign(c),dt({type:new Ct(c),length:e,children:f})]}function Pu(i,t,e=new Map){var r,c;if(((r=i==null?void 0:i.length)!==null&&r!==void 0?r:0)>0&&(i==null?void 0:i.length)===(t==null?void 0:t.length))for(let f=-1,_=i.length;++f<_;){let{type:b}=i[f],g=t[f];for(let T of[g,...((c=g==null?void 0:g.dictionary)===null||c===void 0?void 0:c.data)||[]])Pu(b.children,T==null?void 0:T.children,e);if(z.isDictionary(b)){let{id:T}=b;if(!e.has(T))g!=null&&g.dictionary&&e.set(T,g.dictionary);else if(e.get(T)!==g.dictionary)throw new Error("Cannot create Schema containing two different dictionaries with the same Id")}}return e}var Dr=class extends Yt{constructor(t){let e=t.fields.map(c=>dt({type:c.type})),r=dt({type:new Ct(t.fields),nullCount:0,children:e});super(t,r)}};var qe=class i{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsMessage(t,e){return(e||new i).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsMessage(t,e){return t.setPosition(t.position()+4),(e||new i).__init(t.readInt32(t.position())+t.position(),t)}version(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):Bt.V1}headerType(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readUint8(this.bb_pos+t):vt.NONE}header(t){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__union(t,this.bb_pos+e):null}bodyLength(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt64(this.bb_pos+t):BigInt("0")}customMetadata(t,e){let r=this.bb.__offset(this.bb_pos,12);return r?(e||new Xt).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+t*4),this.bb):null}customMetadataLength(){let t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}static startMessage(t){t.startObject(5)}static addVersion(t,e){t.addFieldInt16(0,e,Bt.V1)}static addHeaderType(t,e){t.addFieldInt8(1,e,vt.NONE)}static addHeader(t,e){t.addFieldOffset(2,e,0)}static addBodyLength(t,e){t.addFieldInt64(3,e,BigInt("0"))}static addCustomMetadata(t,e){t.addFieldOffset(4,e,0)}static createCustomMetadataVector(t,e){t.startVector(4,e.length,4);for(let r=e.length-1;r>=0;r--)t.addOffset(e[r]);return t.endVector()}static startCustomMetadataVector(t,e){t.startVector(4,e,4)}static endMessage(t){return t.endObject()}static finishMessageBuffer(t,e){t.finish(e)}static finishSizePrefixedMessageBuffer(t,e){t.finish(e,void 0,!0)}static createMessage(t,e,r,c,f,_){return i.startMessage(t),i.addVersion(t,e),i.addHeaderType(t,r),i.addHeader(t,c),i.addBodyLength(t,f),i.addCustomMetadata(t,_),i.endMessage(t)}};var _c=class extends Z{visit(t,e){return t==null||e==null?void 0:super.visit(t,e)}visitNull(t,e){return xn.startNull(e),xn.endNull(e)}visitInt(t,e){return Ne.startInt(e),Ne.addBitWidth(e,t.bitWidth),Ne.addIsSigned(e,t.isSigned),Ne.endInt(e)}visitFloat(t,e){return Xi.startFloatingPoint(e),Xi.addPrecision(e,t.precision),Xi.endFloatingPoint(e)}visitBinary(t,e){return jn.startBinary(e),jn.endBinary(e)}visitLargeBinary(t,e){return Bn.startLargeBinary(e),Bn.endLargeBinary(e)}visitBool(t,e){return Dn.startBool(e),Dn.endBool(e)}visitUtf8(t,e){return En.startUtf8(e),En.endUtf8(e)}visitLargeUtf8(t,e){return Fn.startLargeUtf8(e),Fn.endLargeUtf8(e)}visitDecimal(t,e){return si.startDecimal(e),si.addScale(e,t.scale),si.addPrecision(e,t.precision),si.addBitWidth(e,t.bitWidth),si.endDecimal(e)}visitDate(t,e){return Gi.startDate(e),Gi.addUnit(e,t.unit),Gi.endDate(e)}visitTime(t,e){return yi.startTime(e),yi.addUnit(e,t.unit),yi.addBitWidth(e,t.bitWidth),yi.endTime(e)}visitTimestamp(t,e){let r=t.timezone&&e.createString(t.timezone)||void 0;return mi.startTimestamp(e),mi.addUnit(e,t.unit),r!==void 0&&mi.addTimezone(e,r),mi.endTimestamp(e)}visitInterval(t,e){return Zi.startInterval(e),Zi.addUnit(e,t.unit),Zi.endInterval(e)}visitDuration(t,e){return Ki.startDuration(e),Ki.addUnit(e,t.unit),Ki.endDuration(e)}visitList(t,e){return An.startList(e),An.endList(e)}visitStruct(t,e){return kn.startStruct_(e),kn.endStruct_(e)}visitUnion(t,e){Pe.startTypeIdsVector(e,t.typeIds.length);let r=Pe.createTypeIdsVector(e,t.typeIds);return Pe.startUnion(e),Pe.addMode(e,t.mode),Pe.addTypeIds(e,r),Pe.endUnion(e)}visitDictionary(t,e){let r=this.visit(t.indices,e);return ni.startDictionaryEncoding(e),ni.addId(e,BigInt(t.id)),ni.addIsOrdered(e,t.isOrdered),r!==void 0&&ni.addIndexType(e,r),ni.endDictionaryEncoding(e)}visitFixedSizeBinary(t,e){return qi.startFixedSizeBinary(e),qi.addByteWidth(e,t.byteWidth),qi.endFixedSizeBinary(e)}visitFixedSizeList(t,e){return Ji.startFixedSizeList(e),Ji.addListSize(e,t.listSize),Ji.endFixedSizeList(e)}visitMap(t,e){return Qi.startMap(e),Qi.addKeysSorted(e,t.keysSorted),Qi.endMap(e)}},qo=new _c;function Wu(i,t=new Map){return new At(_S(i,t),Jo(i.metadata),t)}function yc(i){return new re(i.count,Yu(i.columns),Gu(i.columns))}function $u(i){return new he(yc(i.data),i.id,i.isDelta)}function _S(i,t){return(i.fields||[]).filter(Boolean).map(e=>bt.fromJSON(e,t))}function Vu(i,t){return(i.children||[]).filter(Boolean).map(e=>bt.fromJSON(e,t))}function Yu(i){return(i||[]).reduce((t,e)=>[...t,new ke(e.count,yS(e.VALIDITY)),...Yu(e.children)],[])}function Gu(i,t=[]){for(let e=-1,r=(i||[]).length;++e<r;){let c=i[e];c.VALIDITY&&t.push(new fe(t.length,c.VALIDITY.length)),c.TYPE_ID&&t.push(new fe(t.length,c.TYPE_ID.length)),c.OFFSET&&t.push(new fe(t.length,c.OFFSET.length)),c.DATA&&t.push(new fe(t.length,c.DATA.length)),t=Gu(c.children,t)}return t}function yS(i){return(i||[]).reduce((t,e)=>t+ +(e===0),0)}function Ku(i,t){let e,r,c,f,_,b;return!t||!(f=i.dictionary)?(_=zu(i,Vu(i,t)),c=new bt(i.name,_,i.nullable,Jo(i.metadata))):t.has(e=f.id)?(r=(r=f.indexType)?Hu(r):new oi,b=new ge(t.get(e),r,e,f.isOrdered),c=new bt(i.name,b,i.nullable,Jo(i.metadata))):(r=(r=f.indexType)?Hu(r):new oi,t.set(e,_=zu(i,Vu(i,t))),b=new ge(_,r,e,f.isOrdered),c=new bt(i.name,b,i.nullable,Jo(i.metadata))),c||null}function Jo(i=[]){return new Map(i.map(({key:t,value:e})=>[t,e]))}function Hu(i){return new Zt(i.isSigned,i.bitWidth)}function zu(i,t){let e=i.type.name;switch(e){case"NONE":return new ae;case"null":return new ae;case"binary":return new bi;case"largebinary":return new vi;case"utf8":return new gi;case"largeutf8":return new wi;case"bool":return new Si;case"list":return new ze((t||[])[0]);case"struct":return new Ct(t||[]);case"struct_":return new Ct(t||[])}switch(e){case"int":{let r=i.type;return new Zt(r.isSigned,r.bitWidth)}case"floatingpoint":{let r=i.type;return new Fe(Ot[r.precision])}case"decimal":{let r=i.type;return new Ii(r.scale,r.precision,r.bitWidth)}case"date":{let r=i.type;return new Ti($t[r.unit])}case"time":{let r=i.type;return new ji(Y[r.unit],r.bitWidth)}case"timestamp":{let r=i.type;return new Di(Y[r.unit],r.timezone)}case"interval":{let r=i.type;return new Bi(Jt[r.unit])}case"duration":{let r=i.type;return new Fi(Y[r.unit])}case"union":{let r=i.type,[c,...f]=(r.mode+"").toLowerCase(),_=c.toUpperCase()+f.join("");return new We(Ut[_],r.typeIds||[],t||[])}case"fixedsizebinary":{let r=i.type;return new Ai(r.byteWidth)}case"fixedsizelist":{let r=i.type;return new $e(r.listSize,(t||[])[0])}case"map":{let r=i.type;return new Ye((t||[])[0],r.keysSorted)}}throw new Error('Unrecognized type: "'.concat(e,'"'))}var mS=fr,bS=be,pe=class i{static fromJSON(t,e){let r=new i(0,Bt.V5,e);return r._createHeader=vS(t,e),r}static decode(t){t=new bS(ot(t));let e=qe.getRootAsMessage(t),r=e.bodyLength(),c=e.version(),f=e.headerType(),_=new i(r,c,f);return _._createHeader=gS(e,f),_}static encode(t){let e=new mS,r=-1;return t.isSchema()?r=At.encode(e,t.header()):t.isRecordBatch()?r=re.encode(e,t.header()):t.isDictionaryBatch()&&(r=he.encode(e,t.header())),qe.startMessage(e),qe.addVersion(e,Bt.V5),qe.addHeader(e,r),qe.addHeaderType(e,t.headerType),qe.addBodyLength(e,BigInt(t.bodyLength)),qe.finishMessageBuffer(e,qe.endMessage(e)),e.asUint8Array()}static from(t,e=0){if(t instanceof At)return new i(0,Bt.V5,vt.Schema,t);if(t instanceof re)return new i(e,Bt.V5,vt.RecordBatch,t);if(t instanceof he)return new i(e,Bt.V5,vt.DictionaryBatch,t);throw new Error("Unrecognized Message header: ".concat(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===vt.Schema}isRecordBatch(){return this.headerType===vt.RecordBatch}isDictionaryBatch(){return this.headerType===vt.DictionaryBatch}constructor(t,e,r,c){this._version=e,this._headerType=r,this.body=new Uint8Array(0),c&&(this._createHeader=()=>c),this._bodyLength=wt(t)}},re=class{get nodes(){return this._nodes}get length(){return this._length}get buffers(){return this._buffers}constructor(t,e,r){this._nodes=e,this._buffers=r,this._length=wt(t)}},he=class{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,e,r=!1){this._data=t,this._isDelta=r,this._id=wt(e)}},fe=class{constructor(t,e){this.offset=wt(t),this.length=wt(e)}},ke=class{constructor(t,e){this.length=wt(t),this.nullCount=wt(e)}};function vS(i,t){return()=>{switch(t){case vt.Schema:return At.fromJSON(i);case vt.RecordBatch:return re.fromJSON(i);case vt.DictionaryBatch:return he.fromJSON(i)}throw new Error("Unrecognized Message type: { name: ".concat(vt[t],", type: ").concat(t," }"))}}function gS(i,t){return()=>{switch(t){case vt.Schema:return At.decode(i.header(new ue),new Map,i.version());case vt.RecordBatch:return re.decode(i.header(new ve),i.version());case vt.DictionaryBatch:return he.decode(i.header(new _i),i.version())}throw new Error("Unrecognized Message type: { name: ".concat(vt[t],", type: ").concat(t," }"))}}bt.encode=kS;bt.decode=AS;bt.fromJSON=Ku;At.encode=xS;At.decode=wS;At.fromJSON=Wu;re.encode=ES;re.decode=SS;re.fromJSON=yc;he.encode=OS;he.decode=IS;he.fromJSON=$u;ke.encode=US;ke.decode=jS;fe.encode=MS;fe.decode=TS;function wS(i,t=new Map,e=Bt.V5){let r=FS(i,t);return new At(r,Xo(i),t,e)}function SS(i,t=Bt.V5){if(i.compression()!==null)throw new Error("Record batch compression not implemented");return new re(i.length(),DS(i),BS(i,t))}function IS(i,t=Bt.V5){return new he(re.decode(i.data(),t),i.id(),i.isDelta())}function TS(i){return new fe(i.offset(),i.length())}function jS(i){return new ke(i.length(),i.nullCount())}function DS(i){let t=[];for(let e,r=-1,c=-1,f=i.nodesLength();++r<f;)(e=i.nodes(r))&&(t[++c]=ke.decode(e));return t}function BS(i,t){let e=[];for(let r,c=-1,f=-1,_=i.buffersLength();++c<_;)(r=i.buffers(c))&&(t<Bt.V4&&(r.bb_pos+=8*(c+1)),e[++f]=fe.decode(r));return e}function FS(i,t){let e=[];for(let r,c=-1,f=-1,_=i.fieldsLength();++c<_;)(r=i.fields(c))&&(e[++f]=bt.decode(r,t));return e}function qu(i,t){let e=[];for(let r,c=-1,f=-1,_=i.childrenLength();++c<_;)(r=i.children(c))&&(e[++f]=bt.decode(r,t));return e}function AS(i,t){let e,r,c,f,_,b;return!t||!(b=i.dictionary())?(c=Xu(i,qu(i,t)),r=new bt(i.name(),c,i.nullable(),Xo(i))):t.has(e=wt(b.id()))?(f=(f=b.indexType())?Ju(f):new oi,_=new ge(t.get(e),f,e,b.isOrdered()),r=new bt(i.name(),_,i.nullable(),Xo(i))):(f=(f=b.indexType())?Ju(f):new oi,t.set(e,c=Xu(i,qu(i,t))),_=new ge(c,f,e,b.isOrdered()),r=new bt(i.name(),_,i.nullable(),Xo(i))),r||null}function Xo(i){let t=new Map;if(i)for(let e,r,c=-1,f=Math.trunc(i.customMetadataLength());++c<f;)(e=i.customMetadata(c))&&(r=e.key())!=null&&t.set(r,e.value());return t}function Ju(i){return new Zt(i.isSigned(),i.bitWidth())}function Xu(i,t){let e=i.typeType();switch(e){case Mt.NONE:return new ae;case Mt.Null:return new ae;case Mt.Binary:return new bi;case Mt.LargeBinary:return new vi;case Mt.Utf8:return new gi;case Mt.LargeUtf8:return new wi;case Mt.Bool:return new Si;case Mt.List:return new ze((t||[])[0]);case Mt.Struct_:return new Ct(t||[])}switch(e){case Mt.Int:{let r=i.type(new Ne);return new Zt(r.isSigned(),r.bitWidth())}case Mt.FloatingPoint:{let r=i.type(new Xi);return new Fe(r.precision())}case Mt.Decimal:{let r=i.type(new si);return new Ii(r.scale(),r.precision(),r.bitWidth())}case Mt.Date:{let r=i.type(new Gi);return new Ti(r.unit())}case Mt.Time:{let r=i.type(new yi);return new ji(r.unit(),r.bitWidth())}case Mt.Timestamp:{let r=i.type(new mi);return new Di(r.unit(),r.timezone())}case Mt.Interval:{let r=i.type(new Zi);return new Bi(r.unit())}case Mt.Duration:{let r=i.type(new Ki);return new Fi(r.unit())}case Mt.Union:{let r=i.type(new Pe);return new We(r.mode(),r.typeIdsArray()||[],t||[])}case Mt.FixedSizeBinary:{let r=i.type(new qi);return new Ai(r.byteWidth())}case Mt.FixedSizeList:{let r=i.type(new Ji);return new $e(r.listSize(),(t||[])[0])}case Mt.Map:{let r=i.type(new Qi);return new Ye((t||[])[0],r.keysSorted())}}throw new Error('Unrecognized type: "'.concat(Mt[e],'" (').concat(e,")"))}function xS(i,t){let e=t.fields.map(f=>bt.encode(i,f));ue.startFieldsVector(i,e.length);let r=ue.createFieldsVector(i,e),c=t.metadata&&t.metadata.size>0?ue.createCustomMetadataVector(i,[...t.metadata].map(([f,_])=>{let b=i.createString("".concat(f)),g=i.createString("".concat(_));return Xt.startKeyValue(i),Xt.addKey(i,b),Xt.addValue(i,g),Xt.endKeyValue(i)})):-1;return ue.startSchema(i),ue.addFields(i,r),ue.addEndianness(i,RS?Yi.Little:Yi.Big),c!==-1&&ue.addCustomMetadata(i,c),ue.endSchema(i)}function kS(i,t){let e=-1,r=-1,c=-1,f=t.type,_=t.typeId;z.isDictionary(f)?(_=f.dictionary.typeId,c=qo.visit(f,i),r=qo.visit(f.dictionary,i)):r=qo.visit(f,i);let b=(f.children||[]).map(D=>bt.encode(i,D)),g=se.createChildrenVector(i,b),T=t.metadata&&t.metadata.size>0?se.createCustomMetadataVector(i,[...t.metadata].map(([D,U])=>{let M=i.createString("".concat(D)),N=i.createString("".concat(U));return Xt.startKeyValue(i),Xt.addKey(i,M),Xt.addValue(i,N),Xt.endKeyValue(i)})):-1;return t.name&&(e=i.createString(t.name)),se.startField(i),se.addType(i,r),se.addTypeType(i,_),se.addChildren(i,g),se.addNullable(i,!!t.nullable),e!==-1&&se.addName(i,e),c!==-1&&se.addDictionary(i,c),T!==-1&&se.addCustomMetadata(i,T),se.endField(i)}function ES(i,t){let e=t.nodes||[],r=t.buffers||[];ve.startNodesVector(i,e.length);for(let _ of e.slice().reverse())ke.encode(i,_);let c=i.endVector();ve.startBuffersVector(i,r.length);for(let _ of r.slice().reverse())fe.encode(i,_);let f=i.endVector();return ve.startRecordBatch(i),ve.addLength(i,BigInt(t.length)),ve.addNodes(i,c),ve.addBuffers(i,f),ve.endRecordBatch(i)}function OS(i,t){let e=re.encode(i,t.data);return _i.startDictionaryBatch(i),_i.addId(i,BigInt(t.id)),_i.addIsDelta(i,t.isDelta),_i.addData(i,e),_i.endDictionaryBatch(i)}function US(i,t){return Hr.createFieldNode(i,BigInt(t.length),BigInt(t.nullCount))}function MS(i,t){return Vr.createBuffer(i,BigInt(t.offset),BigInt(t.length))}var RS=(()=>{let i=new ArrayBuffer(2);return new DataView(i).setInt16(0,256,!0),new Int16Array(i)[0]===256})();var bc=i=>"Expected ".concat(vt[i]," Message in stream, but was null or length 0."),vc=i=>"Header pointer of flatbuffer-encoded ".concat(vt[i]," Message is null or length 0."),Zu=(i,t)=>"Expected to read ".concat(i," metadata bytes, but only read ").concat(t,"."),Qu=(i,t)=>"Expected to read ".concat(i," bytes for message body, but only read ").concat(t,"."),an=class{constructor(t){this.source=t instanceof li?t:new li(t)}[Symbol.iterator](){return this}next(){let t;return(t=this.readMetadataLength()).done?Lt:t.value===-1&&(t=this.readMetadataLength()).done?Lt:(t=this.readMetadata(t.value)).done?Lt:t}throw(t){return this.source.throw(t)}return(t){return this.source.return(t)}readMessage(t){let e;if((e=this.next()).done)return null;if(t!=null&&e.value.headerType!==t)throw new Error(bc(t));return e.value}readMessageBody(t){if(t<=0)return new Uint8Array(0);let e=ot(this.source.read(t));if(e.byteLength<t)throw new Error(Qu(t,e.byteLength));return e.byteOffset%8===0&&e.byteOffset+e.byteLength<=e.buffer.byteLength?e:e.slice()}readSchema(t=!1){let e=vt.Schema,r=this.readMessage(e),c=r==null?void 0:r.header();if(t&&!c)throw new Error(vc(e));return c}readMetadataLength(){let t=this.source.read(Zo),e=t&&new be(t),r=(e==null?void 0:e.readInt32(0))||0;return{done:r===0,value:r}}readMetadata(t){let e=this.source.read(t);if(!e)return Lt;if(e.byteLength<t)throw new Error(Zu(t,e.byteLength));return{done:!1,value:pe.decode(e)}}},ps=class{constructor(t,e){this.source=t instanceof Ae?t:xs(t)?new nr(t,e):new Ae(t)}[Symbol.asyncIterator](){return this}next(){return V(this,void 0,void 0,function*(){let t;return(t=yield this.readMetadataLength()).done?Lt:t.value===-1&&(t=yield this.readMetadataLength()).done?Lt:(t=yield this.readMetadata(t.value)).done?Lt:t})}throw(t){return V(this,void 0,void 0,function*(){return yield this.source.throw(t)})}return(t){return V(this,void 0,void 0,function*(){return yield this.source.return(t)})}readMessage(t){return V(this,void 0,void 0,function*(){let e;if((e=yield this.next()).done)return null;if(t!=null&&e.value.headerType!==t)throw new Error(bc(t));return e.value})}readMessageBody(t){return V(this,void 0,void 0,function*(){if(t<=0)return new Uint8Array(0);let e=ot(yield this.source.read(t));if(e.byteLength<t)throw new Error(Qu(t,e.byteLength));return e.byteOffset%8===0&&e.byteOffset+e.byteLength<=e.buffer.byteLength?e:e.slice()})}readSchema(){return V(this,arguments,void 0,function*(t=!1){let e=vt.Schema,r=yield this.readMessage(e),c=r==null?void 0:r.header();if(t&&!c)throw new Error(vc(e));return c})}readMetadataLength(){return V(this,void 0,void 0,function*(){let t=yield this.source.read(Zo),e=t&&new be(t),r=(e==null?void 0:e.readInt32(0))||0;return{done:r===0,value:r}})}readMetadata(t){return V(this,void 0,void 0,function*(){let e=yield this.source.read(t);if(!e)return Lt;if(e.byteLength<t)throw new Error(Zu(t,e.byteLength));return{done:!1,value:pe.decode(e)}})}},_s=class extends an{constructor(t){super(new Uint8Array(0)),this._schema=!1,this._body=[],this._batchIndex=0,this._dictionaryIndex=0,this._json=t instanceof Pn?t:new Pn(t)}next(){let{_json:t}=this;if(!this._schema)return this._schema=!0,{done:!1,value:pe.fromJSON(t.schema,vt.Schema)};if(this._dictionaryIndex<t.dictionaries.length){let e=t.dictionaries[this._dictionaryIndex++];return this._body=e.data.columns,{done:!1,value:pe.fromJSON(e,vt.DictionaryBatch)}}if(this._batchIndex<t.batches.length){let e=t.batches[this._batchIndex++];return this._body=e.columns,{done:!1,value:pe.fromJSON(e,vt.RecordBatch)}}return this._body=[],Lt}readMessageBody(t){return e(this._body);function e(r){return(r||[]).reduce((c,f)=>[...c,...f.VALIDITY&&[f.VALIDITY]||[],...f.TYPE_ID&&[f.TYPE_ID]||[],...f.OFFSET&&[f.OFFSET]||[],...f.DATA&&[f.DATA]||[],...e(f.children)],[])}}readMessage(t){let e;if((e=this.next()).done)return null;if(t!=null&&e.value.headerType!==t)throw new Error(bc(t));return e.value}readSchema(){let t=vt.Schema,e=this.readMessage(t),r=e==null?void 0:e.header();if(!e||!r)throw new Error(vc(t));return r}},Zo=4,mc="ARROW1",cn=new Uint8Array(mc.length);for(let i=0;i<mc.length;i+=1)cn[i]=mc.codePointAt(i);function Qo(i,t=0){for(let e=-1,r=cn.length;++e<r;)if(cn[e]!==i[t+e])return!1;return!0}var ln=cn.length,gc=ln+Zo,td=ln*2+Zo;var ne=class i extends vr{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){let e=this._impl.open(t);return Me(e)?e.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 ee.toDOMStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this})}toNodeStream(){return ee.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,e){throw new Error('"throughDOM" not available in this environment')}static from(t){return t instanceof i?t:Fs(t)?LS(t):xs(t)?VS(t):Me(t)?V(this,void 0,void 0,function*(){return yield i.from(yield t)}):ks(t)||vn(t)||Os(t)||je(t)?PS(new Ae(t)):NS(new li(t))}static readAll(t){return t instanceof i?t.isSync()?ed(t):id(t):Fs(t)||ArrayBuffer.isView(t)||Re(t)||As(t)?ed(t):id(t)}},di=class extends ne{constructor(t){super(t),this._impl=t}readAll(){return[...this]}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return ye(this,arguments,function*(){yield pt(yield*ur(Nr(Ue(this[Symbol.iterator]()))))})}},sr=class extends ne{constructor(t){super(t),this._impl=t}readAll(){return V(this,void 0,void 0,function*(){var t,e,r,c;let f=new Array;try{for(var _=!0,b=Ue(this),g;g=yield b.next(),t=g.done,!t;_=!0){c=g.value,_=!1;let T=c;f.push(T)}}catch(T){e={error:T}}finally{try{!_&&!t&&(r=b.return)&&(yield r.call(b))}finally{if(e)throw e.error}}return f})}[Symbol.iterator](){throw new Error("AsyncRecordBatchStreamReader is not Iterable")}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}},or=class extends di{constructor(t){super(t),this._impl=t}},ys=class extends sr{constructor(t){super(t),this._impl=t}},ta=class{get numDictionaries(){return this._dictionaryIndex}get numRecordBatches(){return this._recordBatchIndex}constructor(t=new Map){this.closed=!1,this.autoDestroy=!0,this._dictionaryIndex=0,this._recordBatchIndex=0,this.dictionaries=t}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,e){let r=this._loadVectors(t,e,this.schema.fields),c=dt({type:new Ct(this.schema.fields),length:t.length,children:r});return new Yt(this.schema,c)}_loadDictionaryBatch(t,e){let{id:r,isDelta:c}=t,{dictionaries:f,schema:_}=this,b=f.get(r),g=_.dictionaries.get(r),T=this._loadVectors(t.data,e,[g]);return(b&&c?b.concat(new gt(T)):new gt(T)).memoize()}_loadVectors(t,e,r){return new Wn(e,t.nodes,t.buffers,this.dictionaries,this.schema.metadataVersion).visitMany(r)}},un=class extends ta{constructor(t,e){super(e),this._reader=Fs(t)?new _s(this._handle=t):new an(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=rd(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):Lt}return(t){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.return(t):Lt}next(){if(this.closed)return Lt;let t,{_reader:e}=this;for(;t=this._readNextMessageAndValidate();)if(t.isSchema())this.reset(t.header());else if(t.isRecordBatch()){this._recordBatchIndex++;let r=t.header(),c=e.readMessageBody(t.bodyLength);return{done:!1,value:this._loadRecordBatch(r,c)}}else if(t.isDictionaryBatch()){this._dictionaryIndex++;let r=t.header(),c=e.readMessageBody(t.bodyLength),f=this._loadDictionaryBatch(r,c);this.dictionaries.set(r.id,f)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new Dr(this.schema)}):this.return()}_readNextMessageAndValidate(t){return this._reader.readMessage(t)}},dn=class extends ta{constructor(t,e){super(e),this._reader=new ps(this._handle=t)}isAsync(){return!0}isStream(){return!0}[Symbol.asyncIterator](){return this}cancel(){return V(this,void 0,void 0,function*(){!this.closed&&(this.closed=!0)&&(yield this.reset()._reader.return(),this._reader=null,this.dictionaries=null)})}open(t){return V(this,void 0,void 0,function*(){return this.closed||(this.autoDestroy=rd(this,t),this.schema||(this.schema=yield this._reader.readSchema())||(yield this.cancel())),this})}throw(t){return V(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.throw(t):Lt})}return(t){return V(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.return(t):Lt})}next(){return V(this,void 0,void 0,function*(){if(this.closed)return Lt;let t,{_reader:e}=this;for(;t=yield this._readNextMessageAndValidate();)if(t.isSchema())yield this.reset(t.header());else if(t.isRecordBatch()){this._recordBatchIndex++;let r=t.header(),c=yield e.readMessageBody(t.bodyLength);return{done:!1,value:this._loadRecordBatch(r,c)}}else if(t.isDictionaryBatch()){this._dictionaryIndex++;let r=t.header(),c=yield e.readMessageBody(t.bodyLength),f=this._loadDictionaryBatch(r,c);this.dictionaries.set(r.id,f)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new Dr(this.schema)}):yield this.return()})}_readNextMessageAndValidate(t){return V(this,void 0,void 0,function*(){return yield this._reader.readMessage(t)})}},ea=class extends un{get footer(){return this._footer}get numDictionaries(){return this._footer?this._footer.numDictionaries:0}get numRecordBatches(){return this._footer?this._footer.numRecordBatches:0}constructor(t,e){super(t instanceof Vn?t:new Vn(t),e)}isSync(){return!0}isFile(){return!0}open(t){if(!this.closed&&!this._footer){this.schema=(this._footer=this._readFooter()).schema;for(let e of this._footer.dictionaryBatches())e&&this._readDictionaryBatch(this._dictionaryIndex++)}return super.open(t)}readRecordBatch(t){var e;if(this.closed)return null;this._footer||this.open();let r=(e=this._footer)===null||e===void 0?void 0:e.getRecordBatch(t);if(r&&this._handle.seek(r.offset)){let c=this._reader.readMessage(vt.RecordBatch);if(c!=null&&c.isRecordBatch()){let f=c.header(),_=this._reader.readMessageBody(c.bodyLength);return this._loadRecordBatch(f,_)}}return null}_readDictionaryBatch(t){var e;let r=(e=this._footer)===null||e===void 0?void 0:e.getDictionaryBatch(t);if(r&&this._handle.seek(r.offset)){let c=this._reader.readMessage(vt.DictionaryBatch);if(c!=null&&c.isDictionaryBatch()){let f=c.header(),_=this._reader.readMessageBody(c.bodyLength),b=this._loadDictionaryBatch(f,_);this.dictionaries.set(f.id,b)}}}_readFooter(){let{_handle:t}=this,e=t.size-gc,r=t.readInt32(e),c=t.readAt(e-r,r);return Ei.decode(c)}_readNextMessageAndValidate(t){var e;if(this._footer||this.open(),this._footer&&this._recordBatchIndex<this.numRecordBatches){let r=(e=this._footer)===null||e===void 0?void 0:e.getRecordBatch(this._recordBatchIndex);if(r&&this._handle.seek(r.offset))return this._reader.readMessage(t)}return null}},wc=class extends dn{get footer(){return this._footer}get numDictionaries(){return this._footer?this._footer.numDictionaries:0}get numRecordBatches(){return this._footer?this._footer.numRecordBatches:0}constructor(t,...e){let r=typeof e[0]!="number"?e.shift():void 0,c=e[0]instanceof Map?e.shift():void 0;super(t instanceof nr?t:new nr(t,r),c)}isFile(){return!0}isAsync(){return!0}open(t){let e=Object.create(null,{open:{get:()=>super.open}});return V(this,void 0,void 0,function*(){if(!this.closed&&!this._footer){this.schema=(this._footer=yield this._readFooter()).schema;for(let r of this._footer.dictionaryBatches())r&&(yield this._readDictionaryBatch(this._dictionaryIndex++))}return yield e.open.call(this,t)})}readRecordBatch(t){return V(this,void 0,void 0,function*(){var e;if(this.closed)return null;this._footer||(yield this.open());let r=(e=this._footer)===null||e===void 0?void 0:e.getRecordBatch(t);if(r&&(yield this._handle.seek(r.offset))){let c=yield this._reader.readMessage(vt.RecordBatch);if(c!=null&&c.isRecordBatch()){let f=c.header(),_=yield this._reader.readMessageBody(c.bodyLength);return this._loadRecordBatch(f,_)}}return null})}_readDictionaryBatch(t){return V(this,void 0,void 0,function*(){var e;let r=(e=this._footer)===null||e===void 0?void 0:e.getDictionaryBatch(t);if(r&&(yield this._handle.seek(r.offset))){let c=yield this._reader.readMessage(vt.DictionaryBatch);if(c!=null&&c.isDictionaryBatch()){let f=c.header(),_=yield this._reader.readMessageBody(c.bodyLength),b=this._loadDictionaryBatch(f,_);this.dictionaries.set(f.id,b)}}})}_readFooter(){return V(this,void 0,void 0,function*(){let{_handle:t}=this;t._pending&&(yield t._pending);let e=t.size-gc,r=yield t.readInt32(e),c=yield t.readAt(e-r,r);return Ei.decode(c)})}_readNextMessageAndValidate(t){return V(this,void 0,void 0,function*(){if(this._footer||(yield this.open()),this._footer&&this._recordBatchIndex<this.numRecordBatches){let e=this._footer.getRecordBatch(this._recordBatchIndex);if(e&&(yield this._handle.seek(e.offset)))return yield this._reader.readMessage(t)}return null})}},Sc=class extends un{constructor(t,e){super(t,e)}_loadVectors(t,e,r){return new Do(e,t.nodes,t.buffers,this.dictionaries,this.schema.metadataVersion).visitMany(r)}};function rd(i,t){return t&&typeof t.autoDestroy=="boolean"?t.autoDestroy:i.autoDestroy}function*ed(i){let t=ne.from(i);try{if(!t.open({autoDestroy:!1}).closed)do yield t;while(!t.reset().open().closed)}finally{t.cancel()}}function id(i){return ye(this,arguments,function*(){let e=yield pt(ne.from(i));try{if(!(yield pt(e.open({autoDestroy:!1}))).closed)do yield yield pt(e);while(!(yield pt(e.reset().open())).closed)}finally{yield pt(e.cancel())}})}function LS(i){return new di(new Sc(i))}function NS(i){let t=i.peek(ln+7&-8);return t&&t.byteLength>=4?Qo(t)?new or(new ea(i.read())):new di(new un(i)):new di(new un(function*(){}()))}function PS(i){return V(this,void 0,void 0,function*(){let t=yield i.peek(ln+7&-8);return t&&t.byteLength>=4?Qo(t)?new or(new ea(yield i.read())):new sr(new dn(i)):new sr(new dn(function(){return ye(this,arguments,function*(){})}()))})}function VS(i){return V(this,void 0,void 0,function*(){let{size:t}=yield i.stat(),e=new nr(i,t);return t>=td&&Qo(yield e.readAt(0,ln+7&-8))?new ys(new wc(e)):new sr(new dn(e))})}var Ht=class i extends Z{static assemble(...t){let e=c=>c.flatMap(f=>Array.isArray(f)?e(f):f instanceof Yt?f.data.children:f.data),r=new i;return r.visitMany(e(t)),r}constructor(){super(),this._byteLength=0,this._nodes=[],this._buffers=[],this._bufferRegions=[]}visit(t){if(t instanceof gt)return this.visitMany(t.data),this;let{type:e}=t;if(!z.isDictionary(e)){let{length:r}=t;if(r>2147483647)throw new RangeError("Cannot write arrays larger than 2^31 - 1 in length");if(z.isUnion(e))this.nodes.push(new ke(r,0));else{let{nullCount:c}=t;z.isNull(e)||Je.call(this,c<=0?new Uint8Array(0):_r(t.offset,r,t.nullBitmap)),this.nodes.push(new ke(r,c))}}return super.visit(t)}visitNull(t){return this}visitDictionary(t){return this.visit(t.clone(t.type.indices))}get nodes(){return this._nodes}get buffers(){return this._buffers}get byteLength(){return this._byteLength}get bufferRegions(){return this._bufferRegions}};function Je(i){let t=i.byteLength+7&-8;return this.buffers.push(i),this.bufferRegions.push(new fe(this._byteLength,t)),this._byteLength+=t,this}function HS(i){var t;let{type:e,length:r,typeIds:c,valueOffsets:f}=i;if(Je.call(this,c),e.mode===Ut.Sparse)return Ic.call(this,i);if(e.mode===Ut.Dense){if(i.offset<=0)return Je.call(this,f),Ic.call(this,i);{let _=new Int32Array(r),b=Object.create(null),g=Object.create(null);for(let T,D,U=-1;++U<r;)(T=c[U])!==void 0&&((D=b[T])===void 0&&(D=b[T]=f[U]),_[U]=f[U]-D,g[T]=((t=g[T])!==null&&t!==void 0?t:0)+1);Je.call(this,_),this.visitMany(i.children.map((T,D)=>{let U=e.typeIds[D],M=b[U],N=g[U];return T.slice(M,Math.min(r,N))}))}}return this}function zS(i){let t;return i.nullCount>=i.length?Je.call(this,new Uint8Array(0)):(t=i.values)instanceof Uint8Array?Je.call(this,_r(i.offset,i.length,t)):Je.call(this,yr(i.values))}function Pi(i){return Je.call(this,i.values.subarray(0,i.length*i.stride))}function ia(i){let{length:t,values:e,valueOffsets:r}=i,c=wt(r[0]),f=wt(r[t]),_=Math.min(f-c,e.byteLength-c);return Je.call(this,Ms(-c,t+1,r)),Je.call(this,e.subarray(c,c+_)),this}function Tc(i){let{length:t,valueOffsets:e}=i;if(e){let{[0]:r,[t]:c}=e;return Je.call(this,Ms(-r,t+1,e)),this.visit(i.children[0].slice(r,c-r))}return this.visit(i.children[0])}function Ic(i){return this.visitMany(i.type.children.map((t,e)=>i.children[e]).filter(Boolean))[0]}Ht.prototype.visitBool=zS;Ht.prototype.visitInt=Pi;Ht.prototype.visitFloat=Pi;Ht.prototype.visitUtf8=ia;Ht.prototype.visitLargeUtf8=ia;Ht.prototype.visitBinary=ia;Ht.prototype.visitLargeBinary=ia;Ht.prototype.visitFixedSizeBinary=Pi;Ht.prototype.visitDate=Pi;Ht.prototype.visitTimestamp=Pi;Ht.prototype.visitTime=Pi;Ht.prototype.visitDecimal=Pi;Ht.prototype.visitList=Tc;Ht.prototype.visitStruct=Ic;Ht.prototype.visitUnion=HS;Ht.prototype.visitInterval=Pi;Ht.prototype.visitDuration=Pi;Ht.prototype.visitFixedSizeList=Tc;Ht.prototype.visitMap=Tc;var Br=class extends vr{static throughNode(t){throw new Error('"throughNode" not available in this environment')}static throughDOM(t,e){throw new Error('"throughDOM" not available in this environment')}constructor(t){super(),this._position=0,this._started=!1,this._sink=new ci,this._schema=null,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._seenDictionaries=new Map,this._dictionaryDeltaOffsets=new Map,oe(t)||(t={autoDestroy:!0,writeLegacyIpcFormat:!1}),this._autoDestroy=typeof t.autoDestroy=="boolean"?t.autoDestroy:!0,this._writeLegacyIpcFormat=typeof t.writeLegacyIpcFormat=="boolean"?t.writeLegacyIpcFormat:!1}toString(t=!1){return this._sink.toString(t)}toUint8Array(t=!1){return this._sink.toUint8Array(t)}writeAll(t){return Me(t)?t.then(e=>this.writeAll(e)):je(t)?Dc(this,t):jc(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,e=null){return t===this._sink||t instanceof ci?this._sink=t:(this._sink=new ci,t&&vl(t)?this.toDOMStream({type:"bytes"}).pipeTo(t):t&&gl(t)&&this.toNodeStream({objectMode:!1}).pipe(t)),this._started&&this._schema&&this._writeFooter(this._schema),this._started=!1,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._seenDictionaries=new Map,this._dictionaryDeltaOffsets=new Map,(!e||!jr(e,this._schema))&&(e==null?(this._position=0,this._schema=null):(this._started=!0,this._schema=e,this._writeSchema(e))),this}write(t){let e=null;if(this._sink){if(t==null)return this.finish()&&void 0;if(t instanceof le&&!(e=t.schema))return this.finish()&&void 0;if(t instanceof Yt&&!(e=t.schema))return this.finish()&&void 0}else throw new Error("RecordBatchWriter is closed");if(e&&!jr(e,this._schema)){if(this._started&&this._autoDestroy)return this.close();this.reset(this._sink,e)}t instanceof Yt?t instanceof Dr||this._writeRecordBatch(t):t instanceof le?this.writeAll(t.batches):Re(t)&&this.writeAll(t)}_writeMessage(t,e=8){let r=e-1,c=pe.encode(t),f=c.byteLength,_=this._writeLegacyIpcFormat?4:8,b=f+_+r&~r,g=b-f-_;return t.headerType===vt.RecordBatch?this._recordBatchBlocks.push(new Oi(b,t.bodyLength,this._position)):t.headerType===vt.DictionaryBatch&&this._dictionaryBlocks.push(new Oi(b,t.bodyLength,this._position)),this._writeLegacyIpcFormat||this._write(Int32Array.of(-1)),this._write(Int32Array.of(b-_)),f>0&&this._write(c),this._writePadding(g)}_write(t){if(this._started){let e=ot(t);e&&e.byteLength>0&&(this._sink.write(e),this._position+=e.byteLength)}return this}_writeSchema(t){return this._writeMessage(pe.from(t))}_writeFooter(t){return this._writeLegacyIpcFormat?this._write(Int32Array.of(0)):this._write(Int32Array.of(-1,0))}_writeMagic(){return this._write(cn)}_writePadding(t){return t>0?this._write(new Uint8Array(t)):this}_writeRecordBatch(t){let{byteLength:e,nodes:r,bufferRegions:c,buffers:f}=Ht.assemble(t),_=new re(t.numRows,r,c),b=pe.from(_,e);return this._writeDictionaries(t)._writeMessage(b)._writeBodyBuffers(f)}_writeDictionaryBatch(t,e,r=!1){let{byteLength:c,nodes:f,bufferRegions:_,buffers:b}=Ht.assemble(new gt([t])),g=new re(t.length,f,_),T=new he(g,e,r),D=pe.from(T,c);return this._writeMessage(D)._writeBodyBuffers(b)}_writeBodyBuffers(t){let e,r,c;for(let f=-1,_=t.length;++f<_;)(e=t[f])&&(r=e.byteLength)>0&&(this._write(e),(c=(r+7&-8)-r)>0&&this._writePadding(c));return this}_writeDictionaries(t){var e,r;for(let[c,f]of t.dictionaries){let _=(e=f==null?void 0:f.data)!==null&&e!==void 0?e:[],b=this._seenDictionaries.get(c),g=(r=this._dictionaryDeltaOffsets.get(c))!==null&&r!==void 0?r:0;if(!b||b.data[0]!==_[0])for(let[T,D]of _.entries())this._writeDictionaryBatch(D,c,T>0);else if(g<_.length)for(let T of _.slice(g))this._writeDictionaryBatch(T,c,!0);this._seenDictionaries.set(c,f),this._dictionaryDeltaOffsets.set(c,_.length)}return this}},Fr=class i extends Br{static writeAll(t,e){let r=new i(e);return Me(t)?t.then(c=>r.writeAll(c)):je(t)?Dc(r,t):jc(r,t)}},Ar=class i extends Br{static writeAll(t){let e=new i;return Me(t)?t.then(r=>e.writeAll(r)):je(t)?Dc(e,t):jc(e,t)}constructor(){super(),this._autoDestroy=!0}_writeSchema(t){return this._writeMagic()._writePadding(2)}_writeDictionaryBatch(t,e,r=!1){if(!r&&this._seenDictionaries.has(e))throw new Error("The Arrow File format does not support replacement dictionaries. ");return super._writeDictionaryBatch(t,e,r)}_writeFooter(t){let e=Ei.encode(new Ei(t,Bt.V5,this._recordBatchBlocks,this._dictionaryBlocks));return super._writeFooter(t)._write(e)._write(Int32Array.of(e.byteLength))._writeMagic()}};function jc(i,t){let e=t;t instanceof le&&(e=t.batches,i.reset(void 0,t.schema));for(let r of e)i.write(r);return i.finish()}function Dc(i,t){return V(this,void 0,void 0,function*(){var e,r,c,f,_,b,g;try{for(e=!0,r=Ue(t);c=yield r.next(),f=c.done,!f;e=!0){g=c.value,e=!1;let T=g;i.write(T)}}catch(T){_={error:T}}finally{try{!e&&!f&&(b=r.return)&&(yield b.call(r))}finally{if(_)throw _.error}}return i.finish()})}function nd(i,t){if(je(i))return $S(i,t);if(Re(i))return WS(i,t);throw new Error("toDOMStream() must be called with an Iterable or AsyncIterable")}function WS(i,t){let e=null,r=(t==null?void 0:t.type)==="bytes"||!1,c=(t==null?void 0:t.highWaterMark)||Math.pow(2,24);return new ReadableStream(Object.assign(Object.assign({},t),{start(_){f(_,e||(e=i[Symbol.iterator]()))},pull(_){e?f(_,e):_.close()},cancel(){(e!=null&&e.return&&e.return()||!0)&&(e=null)}}),Object.assign({highWaterMark:r?c:void 0},t));function f(_,b){let g,T=null,D=_.desiredSize||null;for(;!(T=b.next(r?D:null)).done;)if(ArrayBuffer.isView(T.value)&&(g=ot(T.value))&&(D!=null&&r&&(D=D-g.byteLength+1),T.value=g),_.enqueue(T.value),D!=null&&--D<=0)return;_.close()}}function $S(i,t){let e=null,r=(t==null?void 0:t.type)==="bytes"||!1,c=(t==null?void 0:t.highWaterMark)||Math.pow(2,24);return new ReadableStream(Object.assign(Object.assign({},t),{start(_){return V(this,void 0,void 0,function*(){yield f(_,e||(e=i[Symbol.asyncIterator]()))})},pull(_){return V(this,void 0,void 0,function*(){e?yield f(_,e):_.close()})},cancel(){return V(this,void 0,void 0,function*(){(e!=null&&e.return&&(yield e.return())||!0)&&(e=null)})}}),Object.assign({highWaterMark:r?c:void 0},t));function f(_,b){return V(this,void 0,void 0,function*(){let g,T=null,D=_.desiredSize||null;for(;!(T=yield b.next(r?D:null)).done;)if(ArrayBuffer.isView(T.value)&&(g=ot(T.value))&&(D!=null&&r&&(D=D-g.byteLength+1),T.value=g),_.enqueue(T.value),D!=null&&--D<=0)return;_.close()})}}function ad(i){return new Bc(i)}var Bc=class{constructor(t){this._numChunks=0,this._finished=!1,this._bufferedSize=0;let{["readableStrategy"]:e,["writableStrategy"]:r,["queueingStrategy"]:c="count"}=t,f=ml(t,["readableStrategy","writableStrategy","queueingStrategy"]);this._controller=null,this._builder=wr(f),this._getSize=c!=="bytes"?sd:od;let{["highWaterMark"]:_=c==="bytes"?Math.pow(2,14):1e3}=Object.assign({},e),{["highWaterMark"]:b=c==="bytes"?Math.pow(2,14):1e3}=Object.assign({},r);this.readable=new ReadableStream({cancel:()=>{this._builder.clear()},pull:g=>{this._maybeFlush(this._builder,this._controller=g)},start:g=>{this._maybeFlush(this._builder,this._controller=g)}},{highWaterMark:_,size:c!=="bytes"?sd:od}),this.writable=new WritableStream({abort:()=>{this._builder.clear()},write:()=>{this._maybeFlush(this._builder,this._controller)},close:()=>{this._maybeFlush(this._builder.finish(),this._controller)}},{highWaterMark:b,size:g=>this._writeValueAndReturnChunkSize(g)})}_writeValueAndReturnChunkSize(t){let e=this._bufferedSize;return this._bufferedSize=this._getSize(this._builder.append(t)),this._bufferedSize-e}_maybeFlush(t,e){e!=null&&(this._bufferedSize>=e.desiredSize&&++this._numChunks&&this._enqueue(e,t.toVector()),t.finished&&((t.length>0||this._numChunks===0)&&++this._numChunks&&this._enqueue(e,t.toVector()),!this._finished&&(this._finished=!0)&&this._enqueue(e,null)))}_enqueue(t,e){this._bufferedSize=0,this._controller=null,e==null?t.close():t.enqueue(e)}},sd=i=>{var t;return(t=i==null?void 0:i.length)!==null&&t!==void 0?t:0},od=i=>{var t;return(t=i==null?void 0:i.byteLength)!==null&&t!==void 0?t:0};function ra(i,t){let e=new ci,r=null,c=new ReadableStream({cancel(){return V(this,void 0,void 0,function*(){yield e.close()})},start(b){return V(this,void 0,void 0,function*(){yield _(b,r||(r=yield f()))})},pull(b){return V(this,void 0,void 0,function*(){r?yield _(b,r):b.close()})}});return{writable:new WritableStream(e,Object.assign({highWaterMark:Math.pow(2,14)},i)),readable:c};function f(){return V(this,void 0,void 0,function*(){return yield(yield ne.from(e)).open(t)})}function _(b,g){return V(this,void 0,void 0,function*(){let T=b.desiredSize,D=null;for(;!(D=yield g.next()).done;)if(b.enqueue(D.value),T!=null&&--T<=0)return;b.close()})}}function na(i,t){let e=new this(i),r=new Ae(e),c=new ReadableStream({cancel(){return V(this,void 0,void 0,function*(){yield r.cancel()})},pull(_){return V(this,void 0,void 0,function*(){yield f(_)})},start(_){return V(this,void 0,void 0,function*(){yield f(_)})}},Object.assign({highWaterMark:Math.pow(2,14)},t));return{writable:new WritableStream(e,i),readable:c};function f(_){return V(this,void 0,void 0,function*(){let b=null,g=_.desiredSize;for(;b=yield r.read(g||null);)if(_.enqueue(b),g!=null&&(g-=b.byteLength)<=0)return;_.close()})}}function sa(i,t="stream"){return(t==="stream"?Fr:Ar).writeAll(i).toUint8Array(!0)}var qS=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Na),uc),ec),Pa),Ea),tc),Ma),{compareSchemas:jr,compareFields:Mu,compareTypes:Ru});ee.toDOMStream=nd;Pt.throughDOM=ad;ne.throughDOM=ra;or.throughDOM=ra;di.throughDOM=ra;Br.throughDOM=na;Ar.throughDOM=na;Fr.throughDOM=na;function fn(i){switch(i.typeId){case j.Binary:return{sqlType:"binary"};case j.Bool:return{sqlType:"bool"};case j.Date:return{sqlType:"date"};case j.DateDay:return{sqlType:"date32[d]"};case j.DateMillisecond:return{sqlType:"date64[ms]"};case j.Decimal:{let t=i;return{sqlType:"decimal",precision:t.precision,scale:t.scale}}case j.Float:return{sqlType:"float"};case j.Float16:return{sqlType:"float16"};case j.Float32:return{sqlType:"float32"};case j.Float64:return{sqlType:"float64"};case j.Int:return{sqlType:"int32"};case j.Int16:return{sqlType:"int16"};case j.Int32:return{sqlType:"int32"};case j.Int64:return{sqlType:"int64"};case j.Uint16:return{sqlType:"uint16"};case j.Uint32:return{sqlType:"uint32"};case j.Uint64:return{sqlType:"uint64"};case j.Uint8:return{sqlType:"uint8"};case j.IntervalDayTime:return{sqlType:"interval[dt]"};case j.IntervalYearMonth:return{sqlType:"interval[m]"};case j.List:return{sqlType:"list",valueType:fn(i.valueType)};case j.FixedSizeBinary:return{sqlType:"fixedsizebinary",byteWidth:i.byteWidth};case j.Null:return{sqlType:"null"};case j.Utf8:return{sqlType:"utf8"};case j.Struct:return{sqlType:"struct",fields:i.children.map(e=>oa(e.name,e.type))};case j.Map:{let t=i;return{sqlType:"map",keyType:fn(t.keyType),valueType:fn(t.valueType)}}case j.Time:return{sqlType:"time[s]"};case j.TimeMicrosecond:return{sqlType:"time[us]"};case j.TimeMillisecond:return{sqlType:"time[ms]"};case j.TimeNanosecond:return{sqlType:"time[ns]"};case j.TimeSecond:return{sqlType:"time[s]"};case j.Timestamp:return{sqlType:"timestamp",timezone:i.timezone||void 0};case j.TimestampSecond:return{sqlType:"timestamp[s]",timezone:i.timezone||void 0};case j.TimestampMicrosecond:return{sqlType:"timestamp[us]",timezone:i.timezone||void 0};case j.TimestampNanosecond:return{sqlType:"timestamp[ns]",timezone:i.timezone||void 0};case j.TimestampMillisecond:return{sqlType:"timestamp[ms]",timezone:i.timezone||void 0}}throw new Error("unsupported arrow type: ".concat(i.toString()))}function oa(i,t){let e=fn(t);return e.name=i,e}var aa=class{constructor(t,e){this._bindings=t,this._conn=e}close(){this._bindings.disconnect(this._conn)}useUnsafe(t){return t(this._bindings,this._conn)}query(t){let e=this._bindings.runQuery(this._conn,t),r=ne.from(e);return console.assert(r.isSync()),console.assert(r.isFile()),new le(r)}async send(t,e=!1){let r=this._bindings.startPendingQuery(this._conn,t,e);for(;r==null;)r=await new Promise((_,b)=>{try{_(this._bindings.pollPendingQuery(this._conn))}catch(g){console.log(g),g.message.includes("worker is not set!")?b(new Error("Worker has been terminated")):b(g)}});let c=new ca(this._bindings,this._conn,r),f=ne.from(c);return console.assert(f.isSync()),console.assert(f.isStream()),f}cancelSent(){return this._bindings.cancelPendingQuery(this._conn)}getTableNames(t){return this._bindings.getTableNames(this._conn,t)}prepare(t){let e=this._bindings.createPrepared(this._conn,t);return new Fc(this._bindings,this._conn,e)}createScalarFunction(t,e,r){this._bindings.createScalarFunction(this._conn,t,e,r)}insertArrowTable(t,e){let r=sa(t,"stream");this.insertArrowFromIPCStream(r,e)}insertArrowFromIPCStream(t,e){this._bindings.insertArrowFromIPCStream(this._conn,t,e)}insertCSVFromPath(t,e){this._bindings.insertCSVFromPath(this._conn,t,e)}insertJSONFromPath(t,e){this._bindings.insertJSONFromPath(this._conn,t,e)}},ca=class{constructor(t,e,r){this.bindings=t;this.conn=e;this.header=r;this._first=!0,this._depleted=!1}next(){if(this._first)return this._first=!1,{done:!1,value:this.header};if(this._depleted)return{done:!0,value:null};let t=null;do t=this.bindings.fetchQueryResults(this.conn);while(t==null);return this._depleted=t.length==0,{done:this._depleted,value:t}}[Symbol.iterator](){return this}},Fc=class{constructor(t,e,r){this.bindings=t,this.connectionId=e,this.statementId=r}close(){this.bindings.closePrepared(this.connectionId,this.statementId)}query(...t){let e=this.bindings.runPrepared(this.connectionId,this.statementId,t),r=ne.from(e);return console.assert(r.isSync()),console.assert(r.isFile()),new le(r)}send(...t){let e=this.bindings.sendPrepared(this.connectionId,this.statementId,t),r=new ca(this.bindings,this.connectionId,e),c=ne.from(r);return console.assert(c.isSync()),console.assert(c.isStream()),c}};function ld(i){return i<=255}function ud(i){return i===256}var hd=new TextEncoder,dd=new TextDecoder("utf-8");function Ac(i,t,e){let r=hd.encode(e),c=i._malloc(r.byteLength),f=i.HEAPU8.subarray(c,c+r.byteLength);f.set(r),i.HEAPF64[(t>>3)+0]=1,i.HEAPF64[(t>>3)+1]=c,i.HEAPF64[(t>>3)+2]=f.byteLength}function kc(i){switch(i){case"UINT8":case"INT8":return 1;case"INT32":case"FLOAT":return 4;case"INT64":case"UINT64":case"DOUBLE":case"VARCHAR":return 8;default:return 0}}function xc(i,t,e,r){let c=i.HEAPU8.subarray(t,t+r*kc(e));switch(e){case"UINT8":return new Uint8Array(c.buffer,c.byteOffset,r);case"INT8":return new Int8Array(c.buffer,c.byteOffset,r);case"INT32":return new Int32Array(c.buffer,c.byteOffset,r);case"FLOAT":return new Float32Array(c.buffer,c.byteOffset,r);case"DOUBLE":return new Float64Array(c.buffer,c.byteOffset,r);case"VARCHAR":return new Float64Array(c.buffer,c.byteOffset,r);default:return new Array(0)}}function fd(i,t,e){let r=i.HEAPU8.subarray(t,t+e);return new Uint8Array(r.buffer,r.byteOffset,e)}function la(i,t,e){let r=i.HEAPU8.subarray(t,t+e*8);return new Float64Array(r.buffer,r.byteOffset,e)}function pd(i,t,e,r,c,f,_,b){try{let g=i._udfFunctions.get(r);if(!g){Ac(t,e,"Unknown UDF with id: "+r);return}let T=dd.decode(t.HEAPU8.subarray(c,c+f)),D=JSON.parse(T),U=la(t,_,b/8),M=O=>{var R;let W=null;switch(O.validityBuffer!==void 0&&(W=fd(t,U[O.validityBuffer],D.rows)),O.physicalType){case"VARCHAR":{if(O.dataBuffer===null||O.dataBuffer===void 0)throw new Error("malformed data view, expected data buffer for VARCHAR argument");if(O.lengthBuffer===null||O.lengthBuffer===void 0)throw new Error("malformed data view, expected data length buffer for VARCHAR argument");let J=xc(t,U[O.dataBuffer],O.physicalType,D.rows),E=[],X=la(t,U[O.lengthBuffer],D.rows);for(let st=0;st<D.rows;++st){if(W!=null&&!W[st]){E.push(null);continue}let C=t.HEAPU8.subarray(J[st],J[st]+X[st]),_t=dd.decode(C);E.push(_t)}return st=>E[st]}case"STRUCT":{let J={},E=[];for(let X=0;X<(((R=O.children)==null?void 0:R.length)||0);++X){let st=O.children[X],C=M(st);E.push(_t=>{J[st.name]=C(_t)})}return W!=null?X=>{if(!W[X])return null;for(let st of E)st(X);return J}:X=>{for(let st of E)st(X);return J}}default:{if(O.dataBuffer===void 0)throw new Error("malformed data view, expected data buffer for argument of type: "+O.physicalType);let J=xc(t,U[O.dataBuffer],O.physicalType,D.rows);return W!=null?E=>W[E]?J[E]:null:E=>J[E]}}},N=[];for(let O=0;O<D.args.length;++O)N.push(M(D.args[O]));let nt=D.rows*kc(D.ret.physicalType),Et=t._malloc(nt),Wt=xc(t,Et,D.ret.physicalType,D.rows),Vt=t._malloc(D.rows),kt=fd(t,Vt,D.rows);if(Wt.length==0||kt.length==0){Ac(t,e,"Can't create physical arrays for result");return}let Dt=Wt;D.ret.physicalType=="VARCHAR"&&(Dt=new Array(D.rows));let Qt=[];for(let O=0;O<D.args.length;++O)Qt.push(null);for(let O=0;O<D.rows;++O){for(let R=0;R<D.args.length;++R)Qt[R]=N[R](O);let W=g.func(...Qt);Dt[O]=W,kt[O]=W==null?0:1}let te=0;switch(D.ret.physicalType){case"VARCHAR":{let O=new Array(0);te=t._malloc(D.rows*kc("DOUBLE"));let W=la(t,te,D.rows),R=0;for(let st=0;st<D.rows;++st){let C=hd.encode(Dt[st]||"");O.push(C),W[st]=C.length,R+=C.length}let J=t._malloc(R),E=t.HEAPU8.subarray(J,J+R),X=0;for(let st=0;st<D.rows;++st){Wt[st]=X;let C=O[st];E.subarray(X,X+C.length).set(C),X+=C.length}}}let k=3*8,P=t._malloc(k),q=la(t,P,3);q[0]=Et,q[1]=Vt,q[2]=te,t.HEAPF64[(e>>3)+0]=0,t.HEAPF64[(e>>3)+1]=P,t.HEAPF64[(e>>3)+2]=0}catch(g){Ac(t,e,g.toString())}}function XS(){let i=new TextDecoder;return t=>(typeof SharedArrayBuffer<"u"&&t.buffer instanceof SharedArrayBuffer&&(t=new Uint8Array(t)),i.decode(t))}var ZS=XS();function Xe(i,t){console.error("FAIL WITH: ".concat(t)),i.ccall("duckdb_web_fail_with",null,["string"],[t])}function xr(i,t,e){let r=i.HEAPU8.subarray(t,t+e),c=new Uint8Array(new ArrayBuffer(r.byteLength));return c.set(r),c}function ht(i,t,e){return ZS(i.HEAPU8.subarray(t,t+e))}function xt(i,t,e,r){let c=i.stackSave(),f=i.stackAlloc(3*8);e.unshift("number"),r.unshift(f),i.ccall(t,null,e,r);let _=i.HEAPF64[(f>>3)+0],b=i.HEAPF64[(f>>3)+1],g=i.HEAPF64[(f>>3)+2];return i.stackRestore(c),[_,b,g]}function Rt(i){i.ccall("duckdb_web_clear_response",null,[],[])}var ua=class{constructor(t){let e=new Float64Array(t.buffer,t.byteOffset,t.byteLength/8),r=new Uint8Array(new ArrayBuffer(t.byteLength));r.set(t.subarray(7*8)),this.totalFileReadsCold=e[0],this.totalFileReadsAhead=e[1],this.totalFileReadsCached=e[2],this.totalFileWrites=e[3],this.totalPageAccesses=e[4],this.totalPageLoads=e[5],this.blockSize=e[6],this.blockStats=r}getBlockStats(t,e){return e=e||{file_reads_cold:0,file_reads_ahead:0,file_reads_cached:0,file_writes:0,page_accesses:0,page_loads:0},e.file_writes=this.blockStats[t*3+0]&15,e.file_reads_cold=this.blockStats[t*3+0]>>4,e.file_reads_ahead=this.blockStats[t*3+1]&15,e.file_reads_cached=this.blockStats[t*3+1]>>4,e.page_accesses=this.blockStats[t*3+1]&15,e.page_loads=this.blockStats[t*3+1]>>4,e}};var hn=new TextEncoder;var da=class{constructor(t,e){this._instance=null;this._initPromise=null;this._initPromiseResolver=()=>{};this.onInstantiationProgress=[];this._logger=t,this._runtime=e,this._nextUDFId=1}get logger(){return this._logger}get mod(){return this._instance}get pthread(){return this.mod.PThread||null}async instantiate(t=e=>{}){return this._instance!=null?this:(this._initPromise!=null&&(this.onInstantiationProgress.push(t),await this._initPromise),this._initPromise=new Promise(e=>{this._initPromiseResolver=e}),this.onInstantiationProgress=[t],this._instance=await this.instantiateImpl({print:console.log.bind(console),printErr:console.log.bind(console),onRuntimeInitialized:this._initPromiseResolver}),await this._initPromise,this._initPromise=null,this.onInstantiationProgress=this.onInstantiationProgress.filter(e=>e!=t),globalThis.DUCKDB_BINDINGS=this,this)}open(t){let[e,r,c]=xt(this.mod,"duckdb_web_open",["string"],[JSON.stringify(t)]);if(e!==0)throw new Error(ht(this.mod,r,c));Rt(this.mod)}reset(){let[t,e,r]=xt(this.mod,"duckdb_web_reset",[],[]);if(t!==0)throw new Error(ht(this.mod,e,r));Rt(this.mod)}getVersion(){let[t,e,r]=xt(this.mod,"duckdb_web_get_version",[],[]);if(t!==0)throw new Error(ht(this.mod,e,r));let c=ht(this.mod,e,r);return Rt(this.mod),c}getFeatureFlags(){return this.mod.ccall("duckdb_web_get_feature_flags","number",[],[])}tokenize(t){let e=hn.encode(t),r=this.mod._malloc(e.length);this.mod.HEAPU8.subarray(r,r+e.length).set(e);let[f,_,b]=xt(this.mod,"duckdb_web_tokenize_buffer",["number","number"],[r,e.length]);if(this.mod._free(r),f!==0)throw new Error(ht(this.mod,_,b));let g=ht(this.mod,_,b);return Rt(this.mod),JSON.parse(g)}connect(){let t=this.mod.ccall("duckdb_web_connect","number",[],[]);return new aa(this,t)}disconnect(t){if(this.mod.ccall("duckdb_web_disconnect",null,["number"],[t]),this.pthread)for(let e of[...this.pthread.runningWorkers,...this.pthread.unusedWorkers])e.postMessage({cmd:"dropUDFFunctions",connectionId:t})}runQuery(t,e){let r=hn.encode(e),c=this.mod._malloc(r.length);this.mod.HEAPU8.subarray(c,c+r.length).set(r);let[_,b,g]=xt(this.mod,"duckdb_web_query_run_buffer",["number","number","number"],[t,c,r.length]);if(this.mod._free(c),_!==0)throw new Error(ht(this.mod,b,g));let T=xr(this.mod,b,g);return Rt(this.mod),T}startPendingQuery(t,e,r=!1){let c=hn.encode(e),f=this.mod._malloc(c.length);this.mod.HEAPU8.subarray(f,f+c.length).set(c);let[b,g,T]=xt(this.mod,"duckdb_web_pending_query_start_buffer",["number","number","number","boolean"],[t,f,c.length,r]);if(this.mod._free(f),b!==0)throw new Error(ht(this.mod,g,T));if(g==0)return null;let D=xr(this.mod,g,T);return Rt(this.mod),D}pollPendingQuery(t){let[e,r,c]=xt(this.mod,"duckdb_web_pending_query_poll",["number"],[t]);if(e!==0)throw new Error(ht(this.mod,r,c));if(r==0)return null;let f=xr(this.mod,r,c);return Rt(this.mod),f}cancelPendingQuery(t){return this.mod.ccall("duckdb_web_pending_query_cancel","boolean",["number"],[t])}fetchQueryResults(t){let[e,r,c]=xt(this.mod,"duckdb_web_query_fetch_results",["number"],[t]);if(ud(e))return Rt(this.mod),null;if(!ld(e))throw new Error("Unexpected StatusCode from duckdb_web_query_fetch_results ("+e+") and with self reported error as"+ht(this.mod,r,c));if(e!==0)throw new Error(ht(this.mod,r,c));let f=xr(this.mod,r,c);return Rt(this.mod),f}getTableNames(t,e){let r=hn.encode(e),c=this.mod._malloc(r.length);this.mod.HEAPU8.subarray(c,c+r.length).set(r);let[_,b,g]=xt(this.mod,"duckdb_web_get_tablenames_buffer",["number","number","number"],[t,c,r.length]);if(this.mod._free(c),_!==0)throw new Error(ht(this.mod,b,g));let T=ht(this.mod,b,g);return Rt(this.mod),JSON.parse(T)}createScalarFunction(t,e,r,c){let f={functionId:this._nextUDFId,name:e,returnType:fn(r)},_={functionId:f.functionId,connectionId:t,name:e,returnType:r,func:c};this._nextUDFId+=1;let[b,g,T]=xt(this.mod,"duckdb_web_udf_scalar_create",["number","string"],[t,JSON.stringify(f)]);if(b!==0)throw new Error(ht(this.mod,g,T));if(Rt(this.mod),globalThis.DUCKDB_RUNTIME._udfFunctions=(globalThis.DUCKDB_RUNTIME._udfFunctions||new Map).set(_.functionId,_),this.pthread)for(let D of[...this.pthread.runningWorkers,...this.pthread.unusedWorkers])D.postMessage({cmd:"registerUDFFunction",udf:_})}createPrepared(t,e){let r=hn.encode(e),c=this.mod._malloc(r.length);this.mod.HEAPU8.subarray(c,c+r.length).set(r);let[_,b,g]=xt(this.mod,"duckdb_web_prepared_create_buffer",["number","number","number"],[t,c,r.length]);if(this.mod._free(c),_!==0)throw new Error(ht(this.mod,b,g));return Rt(this.mod),b}closePrepared(t,e){let[r,c,f]=xt(this.mod,"duckdb_web_prepared_close",["number","number"],[t,e]);if(r!==0)throw new Error(ht(this.mod,c,f));Rt(this.mod)}runPrepared(t,e,r){let[c,f,_]=xt(this.mod,"duckdb_web_prepared_run",["number","number","string"],[t,e,JSON.stringify(r)]);if(c!==0)throw new Error(ht(this.mod,f,_));let b=xr(this.mod,f,_);return Rt(this.mod),b}sendPrepared(t,e,r){let[c,f,_]=xt(this.mod,"duckdb_web_prepared_send",["number","number","string"],[t,e,JSON.stringify(r)]);if(c!==0)throw new Error(ht(this.mod,f,_));let b=xr(this.mod,f,_);return Rt(this.mod),b}insertArrowFromIPCStream(t,e,r){if(e.length==0)return;let c=this.mod._malloc(e.length);this.mod.HEAPU8.subarray(c,c+e.length).set(e);let _=r?JSON.stringify(r):"",[b,g,T]=xt(this.mod,"duckdb_web_insert_arrow_from_ipc_stream",["number","number","number","string"],[t,c,e.length,_]);if(this.mod._free(c),b!==0)throw new Error(ht(this.mod,g,T))}insertCSVFromPath(t,e,r){if(r.columns!==void 0){r.columnsFlat=[];for(let T in r.columns)r.columnsFlat.push(oa(T,r.columns[T]))}let c={...r};c.columns=c.columnsFlat,delete c.columnsFlat;let f=JSON.stringify(c),[_,b,g]=xt(this.mod,"duckdb_web_insert_csv_from_path",["number","string","string"],[t,e,f]);if(_!==0)throw new Error(ht(this.mod,b,g))}insertJSONFromPath(t,e,r){if(r.columns!==void 0){r.columnsFlat=[];for(let T in r.columns)r.columnsFlat.push(oa(T,r.columns[T]))}let c={...r};c.columns=c.columnsFlat,delete c.columnsFlat;let f=JSON.stringify(c),[_,b,g]=xt(this.mod,"duckdb_web_insert_json_from_path",["number","string","string"],[t,e,f]);if(_!==0)throw new Error(ht(this.mod,b,g))}globFiles(t){let[e,r,c]=xt(this.mod,"duckdb_web_fs_glob_file_infos",["string"],[t]);if(e!==0)throw new Error(ht(this.mod,r,c));let f=ht(this.mod,r,c);Rt(this.mod);let _=JSON.parse(f);return _==null?[]:_}registerFileURL(t,e,r,c=!1){e===void 0&&(e=t);let[f,_,b]=xt(this.mod,"duckdb_web_fs_register_file_url",["string","string"],[t,e,r,c]);if(f!==0)throw new Error(ht(this.mod,_,b));Rt(this.mod)}registerFileText(t,e){let r=hn.encode(e);this.registerFileBuffer(t,r)}registerFileBuffer(t,e){let r=this.mod._malloc(e.length);this.mod.HEAPU8.subarray(r,r+e.length).set(e);let[f,_,b]=xt(this.mod,"duckdb_web_fs_register_file_buffer",["string","number","number"],[t,r,e.length]);if(f!==0)throw new Error(ht(this.mod,_,b));Rt(this.mod)}async prepareFileHandle(t,e){if(e===3&&this._runtime.prepareFileHandles){let r=await this._runtime.prepareFileHandles([t],3);for(let c of r){let{handle:f,path:_,fromCached:b}=c;!b&&await this.registerFileHandleAsync(_,f,3,!0)}return}throw new Error("prepareFileHandle: unsupported protocol ".concat(e))}async prepareDBFileHandle(t,e){if(e===3&&this._runtime.prepareDBFileHandle){let r=await this._runtime.prepareDBFileHandle(t,3);for(let c of r){let{handle:f,path:_,fromCached:b}=c;!b&&await this.registerFileHandleAsync(_,f,3,!0)}return}throw new Error("prepareDBFileHandle: unsupported protocol ".concat(e))}async prepareFileHandleAsync(t,e,r,c){if(r===3&&!(e instanceof FileSystemSyncAccessHandle)){if(e instanceof FileSystemFileHandle){let f=e;try{e=await f.createSyncAccessHandle()}catch(_){throw new Error(_.message+":"+t)}}else if(t!=null)try{e=await(await(await navigator.storage.getDirectory()).getFileHandle(t)).createSyncAccessHandle()}catch(f){throw new Error(f.message+":"+t)}}return e}async registerFileHandleAsync(t,e,r,c){let f=await this.prepareFileHandleAsync(t,e,r,c);this.registerFileHandle(t,f,r,c)}registerFileHandle(t,e,r,c){var g;let[f,_,b]=xt(this.mod,"duckdb_web_fs_register_file_url",["string","string","number","boolean"],[t,t,r,c]);if(f!==0)throw new Error(ht(this.mod,_,b));/*PATCH_C1*/if(t.startsWith("opfs://")){let _alt="opfs:/"+t.slice(7);xt(this.mod,"duckdb_web_fs_register_file_url",["string","string","number","boolean"],[_alt,_alt,r,c])}if(Rt(this.mod),globalThis.DUCKDB_RUNTIME._files=(globalThis.DUCKDB_RUNTIME._files||new Map).set(t,e),t.startsWith("opfs://")&&globalThis.DUCKDB_RUNTIME._files.set("opfs:/"+t.slice(7),e),(g=globalThis.DUCKDB_RUNTIME._preparedHandles)!=null&&g[t]&&delete globalThis.DUCKDB_RUNTIME._preparedHandles[t],this.pthread){/*PATCH_D*/try{for(let T of this.pthread.runningWorkers)T.postMessage({cmd:"registerFileHandle",fileName:t,fileHandle:e})}catch(_e){};for(let T of this.pthread.unusedWorkers)T.postMessage({cmd:"dropFileHandle",fileName:t})}}dropFile(t){let[e,r,c]=xt(this.mod,"duckdb_web_fs_drop_file",["string"],[t]);if(e!==0)throw new Error(ht(this.mod,r,c));Rt(this.mod)}dropFiles(t){let e=[],r=-1;try{for(let b of t!=null?t:[])if(b!=null&&b.length>0){let g=this.mod.lengthBytesUTF8(b)+1,T=this.mod._malloc(g);if(!T)throw new Error("Failed to allocate memory for string: ".concat(b));this.mod.stringToUTF8(b,T,g),e.push(T)}if(r=this.mod._malloc(e.length*4),!r)throw new Error("Failed to allocate memory for pointers array");for(let b=0;b<e.length;b++)this.mod.HEAP32[(r>>2)+b]=e[b];let[c,f,_]=xt(this.mod,"duckdb_web_fs_drop_files",["number","number"],[r,e.length]);if(c!==0)throw new Error(ht(this.mod,f,_));Rt(this.mod)}finally{for(let c of e)this.mod._free(c);r>0&&this.mod._free(r)}}flushFiles(){this.mod.ccall("duckdb_web_flush_files",null,[],[])}copyFileToPath(t,e){let[r,c,f]=xt(this.mod,"duckdb_web_copy_file_to_path",["string","string"],[t,e]);if(r!==0)throw new Error(ht(this.mod,c,f));Rt(this.mod)}copyFileToBuffer(t){let[e,r,c]=xt(this.mod,"duckdb_web_copy_file_to_buffer",["string"],[t]);if(e!==0)throw new Error(ht(this.mod,r,c));let f=this.mod.HEAPU8.subarray(r,r+c),_=new Uint8Array(f.length);return _.set(f),Rt(this.mod),_}async registerOPFSFileName(t){if(t.startsWith("opfs://"))return this.prepareFileHandle(t,3);throw new Error("Not an OPFS file name: "+t)}collectFileStatistics(t,e){let[r,c,f]=xt(this.mod,"duckdb_web_collect_file_stats",["string","boolean"],[t,e]);if(r!==0)throw new Error(ht(this.mod,c,f))}exportFileStatistics(t){let[e,r,c]=xt(this.mod,"duckdb_web_export_file_stats",["string"],[t]);if(e!==0)throw new Error(ht(this.mod,r,c));return new ua(this.mod.HEAPU8.subarray(r,r+c))}};var fa=class{constructor(){this._bindings=null;this._nextMessageId=0}log(t){this.postMessage({messageId:this._nextMessageId++,requestId:0,type:"LOG",data:t},[])}sendOK(t){this.postMessage({messageId:this._nextMessageId++,requestId:t.messageId,type:"OK",data:null},[])}failWith(t,e){let r={name:e.name,message:e.message,stack:e.stack||void 0};this.postMessage({messageId:this._nextMessageId++,requestId:t.messageId,type:"ERROR",data:r},[])}async onMessage(t){switch(t.type){case"PING":this.sendOK(t);return;case"INSTANTIATE":this._bindings!=null&&this.failWith(t,new Error("duckdb already initialized"));try{this._bindings=await this.instantiate(t.data[0],t.data[1],e=>{this.postMessage({messageId:this._nextMessageId++,requestId:t.messageId,type:"INSTANTIATE_PROGRESS",data:e},[])}),this.sendOK(t)}catch(e){console.log(e),this._bindings=null,this.failWith(t,e)}return;default:break}if(!this._bindings)return this.failWith(t,new Error("duckdb is not initialized"));try{switch(t.type){case"GET_VERSION":this.postMessage({messageId:this._nextMessageId++,requestId:t.messageId,type:"VERSION_STRING",data:this._bindings.getVersion()},[]);break;case"GET_FEATURE_FLAGS":this.postMessage({messageId:this._nextMessageId++,requestId:t.messageId,type:"FEATURE_FLAGS",data:this._bindings.getFeatureFlags()},[]);break;case"RESET":this._bindings.reset(),this.sendOK(t);break;case"OPEN":{let e=t.data.path;e!=null&&e.startsWith("opfs://")&&(await this._bindings.prepareDBFileHandle(e,3),t.data.useDirectIO=!0),this._bindings.open(t.data),this.sendOK(t);break}case"DROP_FILE":this._bindings.dropFile(t.data),this.sendOK(t);break;case"DROP_FILES":this._bindings.dropFiles(t.data),this.sendOK(t);break;case"FLUSH_FILES":this._bindings.flushFiles(),this.sendOK(t);break;case"CONNECT":{let e=this._bindings.connect();this.postMessage({messageId:this._nextMessageId++,requestId:t.messageId,type:"CONNECTION_INFO",data:e.useUnsafe((r,c)=>c)},[]);break}case"DISCONNECT":this._bindings.disconnect(t.data),this.sendOK(t);break;case"CREATE_PREPARED":{let e=this._bindings.createPrepared(t.data[0],t.data[1]);this.postMessage({messageId:this._nextMessageId++,requestId:t.messageId,type:"PREPARED_STATEMENT_ID",data:e},[]);break}case"CLOSE_PREPARED":{this._bindings.closePrepared(t.data[0],t.data[1]),this.sendOK(t);break}case"RUN_PREPARED":{let e=this._bindings.runPrepared(t.data[0],t.data[1],t.data[2]);this.postMessage({messageId:this._nextMessageId++,requestId:t.messageId,type:"QUERY_RESULT",data:e},[e.buffer]);break}case"RUN_QUERY":{let e=this._bindings.runQuery(t.data[0],t.data[1]);this.postMessage({messageId:this._nextMessageId++,requestId:t.messageId,type:"QUERY_RESULT",data:e},[e.buffer]);break}case"SEND_PREPARED":{let e=this._bindings.sendPrepared(t.data[0],t.data[1],t.data[2]);this.postMessage({messageId:this._nextMessageId++,requestId:t.messageId,type:"QUERY_RESULT_HEADER",data:e},[e.buffer]);break}case"START_PENDING_QUERY":{let e=this._bindings.startPendingQuery(t.data[0],t.data[1],t.data[2]),r=[];e&&r.push(e.buffer),this.postMessage({messageId:this._nextMessageId++,requestId:t.messageId,type:"QUERY_RESULT_HEADER_OR_NULL",data:e},r);break}case"POLL_PENDING_QUERY":{let e=this._bindings.pollPendingQuery(t.data),r=[];e&&r.push(e.buffer),this.postMessage({messageId:this._nextMessageId++,requestId:t.messageId,type:"QUERY_RESULT_HEADER_OR_NULL",data:e},r);break}case"CANCEL_PENDING_QUERY":{let e=this._bindings.cancelPendingQuery(t.data);this.postMessage({messageId:this._nextMessageId++,requestId:t.messageId,type:"SUCCESS",data:e},[]);break}case"FETCH_QUERY_RESULTS":{let e=this._bindings.fetchQueryResults(t.data),r=e?[e.buffer]:[];this.postMessage({messageId:this._nextMessageId++,requestId:t.messageId,type:"QUERY_RESULT_CHUNK",data:e},r);break}case"GET_TABLE_NAMES":{let e=this._bindings.getTableNames(t.data[0],t.data[1]);this.postMessage({messageId:this._nextMessageId++,requestId:t.messageId,type:"TABLE_NAMES",data:e},[]);break}case"GLOB_FILE_INFOS":{let e=this._bindings.globFiles(t.data);this.postMessage({messageId:this._nextMessageId++,requestId:t.messageId,type:"FILE_INFOS",data:e},[]);break}case"REGISTER_FILE_URL":this._bindings.registerFileURL(t.data[0],t.data[1],t.data[2],t.data[3]),this.sendOK(t);break;case"REGISTER_FILE_BUFFER":this._bindings.registerFileBuffer(t.data[0],t.data[1]),this.sendOK(t);break;case"REGISTER_FILE_HANDLE":await this._bindings.registerFileHandleAsync(t.data[0],t.data[1],t.data[2],t.data[3]),this.sendOK(t);break;case"COPY_FILE_TO_PATH":this._bindings.copyFileToPath(t.data[0],t.data[1]),this.sendOK(t);break;case"COPY_FILE_TO_BUFFER":{let e=this._bindings.copyFileToBuffer(t.data);this.postMessage({messageId:this._nextMessageId++,requestId:t.messageId,type:"FILE_BUFFER",data:e},[]);break}case"COLLECT_FILE_STATISTICS":this._bindings.collectFileStatistics(t.data[0],t.data[1]),this.sendOK(t);break;case"REGISTER_OPFS_FILE_NAME":await this._bindings.registerOPFSFileName(t.data[0]),this.sendOK(t);break;case"EXPORT_FILE_STATISTICS":{this.postMessage({messageId:this._nextMessageId++,requestId:t.messageId,type:"FILE_STATISTICS",data:this._bindings.exportFileStatistics(t.data)},[]);break}case"INSERT_ARROW_FROM_IPC_STREAM":{this._bindings.insertArrowFromIPCStream(t.data[0],t.data[1],t.data[2]),this.sendOK(t);break}case"IMPORT_CSV_FROM_PATH":{this._bindings.insertCSVFromPath(t.data[0],t.data[1],t.data[2]),this.sendOK(t);break}case"IMPORT_JSON_FROM_PATH":{this._bindings.insertJSONFromPath(t.data[0],t.data[1],t.data[2]),this.sendOK(t);break}case"TOKENIZE":{let e=this._bindings.tokenize(t.data);this.postMessage({messageId:this._nextMessageId++,requestId:t.messageId,type:"SCRIPT_TOKENS",data:e},[]);break}}}catch(e){return console.log(e),this.failWith(t,e)}}};var gd=_l(vd());var ha=class extends da{constructor(t,e,r,c){super(t,e),this.mainModuleURL=r,this.pthreadWorkerURL=c}locateFile(t,e){if(t.endsWith(".wasm"))return this.mainModuleURL;if(t.endsWith(".worker.js")){if(!this.pthreadWorkerURL)throw new Error("Missing DuckDB worker URL!");return this.pthreadWorkerURL}throw new Error("WASM instantiation requested unexpected file: prefix=".concat(e," path=").concat(t))}instantiateWasm(t,e){globalThis.DUCKDB_RUNTIME=this._runtime;let r=this.onInstantiationProgress;if(WebAssembly.instantiateStreaming)if(typeof TransformStream=="function"){let f=(async()=>{var nt;let _=new Request(this.mainModuleURL),b=await fetch(_),g=b.headers.get("content-length"),T=g&&parseInt(g,10)||0,D=new Date,U={startedAt:D,updatedAt:D,bytesTotal:T||0,bytesLoaded:0},M={transform(Et,Wt){U.bytesLoaded+=Et.byteLength;let Vt=new Date;if(Vt.getTime()-U.updatedAt.getTime()<20){U.updatedAt=Vt,Wt.enqueue(Et);return}for(let kt of r)kt(U);Wt.enqueue(Et)}},N=new TransformStream(M);return new Response((nt=b.body)==null?void 0:nt.pipeThrough(N),b)})();WebAssembly.instantiateStreaming(f,t).then(_=>{e(_.instance,_.module)})}else{console.warn("instantiating without progress handler since transform streams are unavailable");let c=new Request(this.mainModuleURL);WebAssembly.instantiateStreaming(fetch(c),t).then(f=>{e(f.instance,f.module)})}else if(typeof XMLHttpRequest=="function"){let c=new XMLHttpRequest,f=this.mainModuleURL,_=new Date,b={startedAt:_,updatedAt:_,bytesTotal:0,bytesLoaded:0};c.open("GET",f),c.responseType="arraybuffer",c.onerror=g=>{throw this.logger.log({timestamp:new Date,level:4,origin:3,topic:5,event:2,value:"Failed to load WASM: "+g}),new Error(g.toString())},c.onprogress=g=>{b.bytesTotal=g.total,b.bytesLoaded=g.loaded;let T=new Date;if(T.getTime()-b.updatedAt.getTime()<20){b.updatedAt=T;return}for(let D of r)D(b)},c.onload=()=>{WebAssembly.instantiate(c.response,t).then(g=>{e(g.instance,g.module)}).catch(g=>{throw this.logger.log({timestamp:new Date,level:4,origin:3,topic:5,event:2,value:"Failed to instantiate WASM: "+g}),new Error(g)})},c.send()}else console.warn("instantiating with manual fetch since streaming instantiation and xhrs are unavailable"),(async()=>{let f=new Request(this.mainModuleURL),b=await(await fetch(f)).arrayBuffer();WebAssembly.instantiate(b,t).then(g=>{e(g.instance,g.module)})})();return[]}};var pa=class extends ha{constructor(t,e,r,c=null){super(t,e,r,c)}instantiateImpl(t){return(0,gd.default)({...t,instantiateWasm:this.instantiateWasm.bind(this),locateFile:this.locateFile.bind(this)})}};var ar=_l(Id()),Td=function(i,t,e){var r;return(r=i==null?void 0:i.endpoint)!=null&&r.startsWith("http")?new URL(i.endpoint).host:i!=null&&i.endpoint?"".concat(e,".").concat(i==null?void 0:i.endpoint):"".concat(e,".s3.amazonaws.com")};function t1(i,t,e){var f,_,b,g;let r=jd(t),c=r.path;if(Dd(i)){let T="";if(i!=null&&i.endpoint){let D=new URL(i.endpoint);D.pathname!=="/"&&(T=D.pathname)}c="".concat(T,"/").concat(r.bucket).concat(c)}return{url:c,query:"",host:Td(i,t,r.bucket),region:(f=i==null?void 0:i.region)!=null?f:"",service:"s3",method:e,accessKeyId:(_=i==null?void 0:i.accessKeyId)!=null?_:"",secretAccessKey:(b=i==null?void 0:i.secretAccessKey)!=null?b:"",sessionToken:(g=i==null?void 0:i.sessionToken)!=null?g:"",dateNow:new Date().toISOString().replace(/-/g,"").split("T")[0],datetimeNow:new Date().toISOString().replace(/-/g,"").replace(/:/g,"").split(".")[0]+"Z"}}function e1(i,t=!1){let e="0123456789ABCDEF",r="";for(let c=0;c<i.length;c++){let f=i[c];f>="A"&&f<="Z"||f>="a"&&f<="z"||f>="0"&&f<="9"||f=="_"||f=="-"||f=="~"||f=="."?r+=f:f=="/"?t?r+="%2F":r+=f:(r+="%",r+=e[f.charCodeAt(0)>>4],r+=e[f.charCodeAt(0)&15])}return r}function i1(i,t=null){var nt;let e=(nt=t==null?void 0:t.contentHash)!=null?nt:"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",r=new Map;r.set("x-amz-date",i.datetimeNow),r.set("x-amz-content-sha256",e),i.sessionToken&&r.set("x-amz-security-token",i.sessionToken);let c="";t!=null&&t.contentType&&(c+="content-type;"),c+="host;x-amz-content-sha256;x-amz-date",i.sessionToken&&(c+=";x-amz-security-token");let f=i.method+"\n"+e1(i.url)+"\n"+i.query;t!=null&&t.contentType&&(f+="\ncontent-type:"+(t==null?void 0:t.contentType)),f+="\nhost:"+i.host+"\nx-amz-content-sha256:"+e+"\nx-amz-date:"+i.datetimeNow,i.sessionToken&&i.sessionToken.length>0&&(f+="\nx-amz-security-token:"+i.sessionToken),f+="\n\n"+c+"\n"+e;let _=(0,ar.sha256)(f),b="AWS4-HMAC-SHA256\n"+i.datetimeNow+"\n"+i.dateNow+"/"+i.region+"/"+i.service+"/aws4_request\n"+_,g="AWS4"+i.secretAccessKey,T=ar.sha256.hmac.arrayBuffer(g,i.dateNow),D=ar.sha256.hmac.arrayBuffer(T,i.region),U=ar.sha256.hmac.arrayBuffer(D,i.service),M=ar.sha256.hmac.arrayBuffer(U,"aws4_request"),N=ar.sha256.hmac(M,b);return r.set("Authorization","AWS4-HMAC-SHA256 Credential="+i.accessKeyId+"/"+i.dateNow+"/"+i.region+"/"+i.service+"/aws4_request, SignedHeaders="+c+", Signature="+N),r}var r1=function(i,t,e,r=null,c=null){let f=t1(i,t,e),_={contentType:r,contentHash:c?ar.sha256.hex(c):null};return i1(f,_)};function Ze(i,t,e,r,c=null,f=null){(t!=null&&t.accessKeyId||t!=null&&t.sessionToken)&&(r1(t,e,r,c,f).forEach((b,g)=>{i.setRequestHeader(g,b)}),c&&i.setRequestHeader("content-type",c))}function jd(i){if(i.indexOf("s3://")!=0)throw new Error("URL needs to start with s3://");let t=i.indexOf("/",5);if(t==-1)throw new Error("URL needs to contain a '/' after the host");let e=i.substring(5,t);if(!e)throw new Error("URL needs to contain a bucket name");let r=i.substring(t);if(!r)throw new Error("URL needs to contain key");return{bucket:e,path:r}}function Dd(i){var t;return!!((t=i==null?void 0:i.endpoint)!=null&&t.startsWith("http"))}function Qe(i,t){let e=jd(t);return Dd(i)?"".concat(i==null?void 0:i.endpoint,"/").concat(e.bucket)+e.path:"https://"+Td(i,t,e.bucket)+e.path}var n1=7,Bd=/\/|\\/,lt={_files:new Map,_fileInfoCache:new Map,_udfFunctions:new Map,_globalFileInfo:null,_preparedHandles:{},_opfsRoot:null,getFileInfo(i,t){try{let e=lt._fileInfoCache.get(t),[r,c,f]=xt(i,"duckdb_web_fs_get_file_info_by_id",["number","number"],[t,(e==null?void 0:e.cacheEpoch)||0]);if(r!==0)return null;if(f===0)return e;let _=ht(i,c,f);Rt(i);try{let b=JSON.parse(_);if(b==null)return null;let g={...b,blob:null};return lt._fileInfoCache.set(t,g),!lt._files.has(g.fileName)&&(lt._preparedHandles[g.fileName]?(lt._files.set(g.fileName,lt._preparedHandles[g.fileName]),delete lt._preparedHandles[g.fileName]):g.fileName.startsWith("opfs:/")&&!g.fileName.startsWith("opfs://")&&lt._preparedHandles["opfs://"+g.fileName.slice(6)]&&(lt._files.set(g.fileName,lt._preparedHandles["opfs://"+g.fileName.slice(6)]),delete lt._preparedHandles["opfs://"+g.fileName.slice(6)])),g}catch(b){return console.warn(b),null}}catch(e){return console.log(e),null}},getGlobalFileInfo(i){var t;try{let[e,r,c]=xt(i,"duckdb_web_get_global_file_info",["number"],[((t=lt._globalFileInfo)==null?void 0:t.cacheEpoch)||0]);if(e!==0)return null;if(c===0)return lt._globalFileInfo;let f=ht(i,r,c);Rt(i);let _=JSON.parse(f);return _==null?null:(lt._globalFileInfo={..._,blob:null},lt._globalFileInfo)}catch(e){return console.log(e),null}},async assignOPFSRoot(){lt._opfsRoot||(lt._opfsRoot=await navigator.storage.getDirectory())},async prepareFileHandles(i,t){if(t===3){await lt.assignOPFSRoot();let e=async c=>{if(lt._files.has(c))return{path:c,handle:lt._files.get(c),fromCached:!0};let _=lt._opfsRoot,b=c.slice(n1),g=b;if(Bd.test(b)){let D=b.split(Bd);if(D.length===0)throw new Error("Invalid path ".concat(b));if(g=D[D.length-1],!g)throw new Error("Invalid path ".concat(b,". File Not Found."));D.pop();for(let U of D)_=await _.getDirectoryHandle(U,{create:!0})}let T=await _.getFileHandle(g,{create:!1}).catch(D=>{if((D==null?void 0:D.name)==="NotFoundError")return console.debug("File ".concat(c," does not exists yet, creating...")),_.getFileHandle(g,{create:!0});throw D});try{let D=await T.createSyncAccessHandle();return lt._preparedHandles[c]=D,/*PATCH_A*/c.startsWith("opfs://")&&(lt._preparedHandles["opfs:/"+c.slice(7)]=D),{path:c,handle:D,fromCached:!1}}catch(D){throw new Error(D.message+":"+name)}},r=[];for(let c of i){let f=await e(c);r.push(f)}return r}throw new Error("Unsupported protocol ".concat(t," for paths ").concat(i," with protocol ").concat(t))},async prepareDBFileHandle(i,t){if(t===3&&this.prepareFileHandles){let e=[i,"".concat(i,".wal")];return this.prepareFileHandles(e,t)}throw new Error("Unsupported protocol ".concat(t," for path ").concat(i," with protocol ").concat(t))},testPlatformFeature:(i,t)=>{switch(t){case 1:return typeof BigInt64Array<"u";default:return console.warn("test for unknown feature: ".concat(t)),!1}},getDefaultDataProtocol(i){return 2},openFile:(i,t,e)=>{var r,c,f,_,b,g;try{lt._fileInfoCache.delete(t);let T=lt.getFileInfo(i,t);switch(T==null?void 0:T.dataProtocol){case 4:case 5:{if(e&1&&e&2)throw new Error("Opening file ".concat(T.fileName," failed: cannot open file with both read and write flags set"));if(e&32)throw new Error("Opening file ".concat(T.fileName," failed: appending to HTTP/S3 files is not supported"));if(e&2){let M=new XMLHttpRequest;if(T.dataProtocol==5?(M.open("HEAD",Qe(T.s3Config,T.dataUrl),!1),Ze(M,T.s3Config,T.dataUrl,"HEAD")):M.open("HEAD",T.dataUrl,!1),M.send(null),M.status!=200&&M.status!=404)throw new Error("Opening file ".concat(T.fileName," failed: Unexpected return status from server (").concat(M.status,")"));if(M.status==404&&!(e&8||e&16))throw new Error("Opening file ".concat(T.fileName," failed: Cannot write to non-existent file without FILE_FLAGS_FILE_CREATE or FILE_FLAGS_FILE_CREATE_NEW flag."));let N=i._malloc(1),nt=new Uint8Array;i.HEAPU8.set(nt,N);let Et=i._malloc(3*8);return i.HEAPF64[(Et>>3)+0]=1,i.HEAPF64[(Et>>3)+1]=N,i.HEAPF64[(Et>>3)+2]=new Date().getTime()/1e3,Et}else if(!(e&1))throw new Error("Opening file ".concat(T.fileName," failed: unsupported file flags: ").concat(e));let D=null,U=null;if(!T.forceFullHttpReads&&(T.reliableHeadRequests||!T.allowFullHttpReads))try{let M=new XMLHttpRequest;T.dataProtocol==5?(M.open("HEAD",Qe(T.s3Config,T.dataUrl),!1),Ze(M,T.s3Config,T.dataUrl,"HEAD")):M.open("HEAD",T.dataUrl,!1),M.setRequestHeader("Range","bytes=0-"),M.send(null),D=null;try{D=M.getResponseHeader("Content-Length")}catch(N){console.warn("Failed to get Content-Length on request")}if(D!==null&&M.status==206){let N=i._malloc(24);i.HEAPF64[(N>>3)+0]=+D,i.HEAPF64[(N>>3)+1]=0;let nt=0;try{nt=new Date((r=M.getResponseHeader("Last-Modified"))!=null?r:"").getTime()/1e3}catch(Et){console.warn("Failed to get Last-Modified on request")}return i.HEAPF64[(N>>3)+2]=+nt,N}}catch(M){U=M,console.warn("HEAD request with range header failed: ".concat(M))}if(T.allowFullHttpReads){if(!T.forceFullHttpReads){let N=new XMLHttpRequest;T.dataProtocol==5?(N.open("GET",Qe(T.s3Config,T.dataUrl),!1),Ze(N,T.s3Config,T.dataUrl,"GET")):N.open("GET",T.dataUrl,!1),N.responseType="arraybuffer",N.setRequestHeader("Range","bytes=0-0"),N.send(null);let nt=null;try{nt=N.getResponseHeader("Content-Length")}catch(kt){console.warn("Failed to get Content-Length on request")}let Et=nt==null?void 0:nt.split("/")[1],Wt=nt,Vt=null;if(Et!==void 0)Vt=Et;else if(!T.reliableHeadRequests){let kt=new XMLHttpRequest;T.dataProtocol==5?(kt.open("HEAD",Qe(T.s3Config,T.dataUrl),!1),Ze(kt,T.s3Config,T.dataUrl,"HEAD")):kt.open("HEAD",T.dataUrl,!1),kt.setRequestHeader("Range","bytes=0-"),kt.send(null),D=null;try{D=kt.getResponseHeader("Content-Length")}catch(Dt){console.warn("Failed to get Content-Length on request")}D!==null&&+D>1&&(Vt=D)}if(N.status==206&&Wt!==null&&+Wt==1&&Vt!==null){let kt=i._malloc(24);i.HEAPF64[(kt>>3)+0]=+Vt,i.HEAPF64[(kt>>3)+1]=0;let Dt=0;try{Dt=new Date((c=N.getResponseHeader("Last-Modified"))!=null?c:"").getTime()/1e3}catch(Qt){console.warn("Failed to get Last-Modified on request")}return i.HEAPF64[(kt>>3)+2]=+Dt,kt}if(N.status==200&&Wt!==null&&D!==null&&+Wt==+D){console.warn("fall back to full HTTP read for: ".concat(T.dataUrl));let kt=i._malloc(N.response.byteLength),Dt=new Uint8Array(N.response,0,N.response.byteLength);i.HEAPU8.set(Dt,kt);let Qt=i._malloc(3*8);i.HEAPF64[(Qt>>3)+0]=N.response.byteLength,i.HEAPF64[(Qt>>3)+1]=kt;let te=0;try{te=new Date((f=N.getResponseHeader("Last-Modified"))!=null?f:"").getTime()/1e3}catch(k){console.warn("Failed to get Last-Modified on request")}return i.HEAPF64[(Qt>>3)+2]=+te,Qt}console.warn("falling back to full HTTP read for: ".concat(T.dataUrl))}let M=new XMLHttpRequest;if(T.dataProtocol==5?(M.open("GET",Qe(T.s3Config,T.dataUrl),!1),Ze(M,T.s3Config,T.dataUrl,"GET")):M.open("GET",T.dataUrl,!1),M.responseType="arraybuffer",M.send(null),M.status==200){let N=i._malloc(M.response.byteLength),nt=new Uint8Array(M.response,0,M.response.byteLength);i.HEAPU8.set(nt,N);let Et=i._malloc(3*8);i.HEAPF64[(Et>>3)+0]=M.response.byteLength,i.HEAPF64[(Et>>3)+1]=N;let Wt=0;try{Wt=new Date((_=M.getResponseHeader("Last-Modified"))!=null?_:"").getTime()/1e3}catch(Vt){console.warn("Failed to get Last-Modified on request")}return i.HEAPF64[(Et>>3)+2]=+Wt,Et}}if(U!=null)throw new Error("Reading file ".concat(T.fileName," failed with error: ").concat(U));return 0}case 2:{let D=(b=lt._files)==null?void 0:b.get(T.fileName);if(D){let N=i._malloc(24);return i.HEAPF64[(N>>3)+0]=D.size,i.HEAPF64[(N>>3)+1]=0,i.HEAPF64[(N>>3)+2]=0,N}if(e&128)return 0;console.warn("Buffering missing file: ".concat(T.fileName));let U=i._malloc(3*8),M=i._malloc(1);return i.HEAPF64[(U>>3)+0]=1,i.HEAPF64[(U>>3)+1]=M,i.HEAPF64[(U>>3)+2]=0,U}case 3:{let D=(g=lt._files)==null?void 0:g.get(T.fileName);if(!D)throw new Error("No OPFS access handle registered with name: ".concat(T.fileName));e&16&&D.truncate(0);let U=i._malloc(3*8),M=D.getSize();return i.HEAPF64[(U>>3)+0]=M,i.HEAPF64[(U>>3)+1]=0,i.HEAPF64[(U>>3)+2]=0,U}}}catch(T){console.error(T.toString()),Xe(i,T.toString())}return 0},glob:(i,t,e)=>{var r;try{let c=ht(i,t,e);if(c.startsWith("http")||c.startsWith("s3://")){let f=new XMLHttpRequest;if(c.startsWith("s3://")){let _=lt.getGlobalFileInfo(i);f.open("HEAD",Qe(_==null?void 0:_.s3Config,c),!1),Ze(f,_==null?void 0:_.s3Config,c,"HEAD")}else f.open("HEAD",c,!1);if(f.send(null),f.status!=200&&f.status!==206){if(!((r=lt.getGlobalFileInfo(i))!=null&&r.allowFullHttpReads))return console.log("HEAD request failed: ".concat(c,", with full http reads are disabled")),0;let _=new XMLHttpRequest;if(c.startsWith("s3://")){let g=lt.getGlobalFileInfo(i);_.open("GET",Qe(g==null?void 0:g.s3Config,c),!1),Ze(_,g==null?void 0:g.s3Config,c,"HEAD")}else _.open("GET",c,!1);if(_.setRequestHeader("Range","bytes=0-0"),_.send(null),_.status!=200&&_.status!==206)return console.log("HEAD and GET requests failed: ".concat(c)),0;let b=null;try{b=_.getResponseHeader("Content-Length")}catch(g){console.warn("Failed to get Content-Length on request")}b&&+b>1&&console.warn("Range request for ".concat(c," did not return a partial response: ").concat(_.status,' "').concat(_.statusText,'"'))}i.ccall("duckdb_web_fs_glob_add_path",null,["string"],[c])}else for(let[f]of lt._files.entries()||[])f.startsWith(c)&&i.ccall("duckdb_web_fs_glob_add_path",null,["string"],[f])}catch(c){return console.log(c),Xe(i,c.toString()),0}},checkFile:(i,t,e)=>{try{let r=ht(i,t,e);if(r.startsWith("http")||r.startsWith("s3://")){let c=new XMLHttpRequest;if(r.startsWith("s3://")){let f=lt.getGlobalFileInfo(i);c.open("HEAD",Qe(f==null?void 0:f.s3Config,r),!1),Ze(c,f==null?void 0:f.s3Config,r,"HEAD")}else c.open("HEAD",r,!1);return c.send(null),c.status==206||c.status==200}else return lt._files.has(r)}catch(r){return console.log(r),!1}return!1},syncFile:(i,t)=>{},closeFile:(i,t)=>{var r;let e=lt.getFileInfo(i,t);lt._fileInfoCache.delete(t);try{switch(e==null?void 0:e.dataProtocol){case 0:case 4:case 5:break;case 1:case 2:return;case 3:{let c=(r=lt._files)==null?void 0:r.get(e.fileName);if(!c)throw new Error("No OPFS access handle registered with name: ".concat(e.fileName));return c.flush()}}}catch(c){console.log(c),Xe(i,c.toString())}},dropFile:(i,t,e)=>{var f;let r=ht(i,t,e),c=(f=lt._files)==null?void 0:f.get(r);if(c){if(lt._files.delete(r),c instanceof FileSystemSyncAccessHandle)try{c.flush(),c.close()}catch(_){throw new Error("Cannot drop file with name: ".concat(r))}c instanceof Blob}},truncateFile:(i,t,e)=>{var c;let r=lt.getFileInfo(i,t);switch(r==null?void 0:r.dataProtocol){case 4:Xe(i,"Cannot truncate a http file");return;case 5:Xe(i,"Cannot truncate an s3 file");return;case 0:case 1:case 2:Xe(i,"truncateFile not implemented");return;case 3:{let f=(c=lt._files)==null?void 0:c.get(r.fileName);if(!f)throw new Error("No OPFS access handle registered with name: ".concat(r.fileName));return f.truncate(e)}}return 0},readFile(i,t,e,r,c){var f;if(r==0)return 0;try{let _=lt.getFileInfo(i,t);switch(_==null?void 0:_.dataProtocol){case 4:case 5:{if(!_.dataUrl)throw new Error("Missing data URL for file ".concat(t));try{let b=new XMLHttpRequest;if(_.dataProtocol==5?(b.open("GET",Qe(_==null?void 0:_.s3Config,_.dataUrl),!1),Ze(b,_==null?void 0:_.s3Config,_.dataUrl,"GET")):b.open("GET",_.dataUrl,!1),b.responseType="arraybuffer",b.setRequestHeader("Range","bytes=".concat(c,"-").concat(c+r-1)),b.send(null),b.status==206||b.status==200&&r==b.response.byteLength&&c==0){let g=new Uint8Array(b.response,0,Math.min(b.response.byteLength,r));return i.HEAPU8.set(g,e),g.byteLength}else if(b.status==200){console.warn("Range request for ".concat(_.dataUrl," did not return a partial response: ").concat(b.status,' "').concat(b.statusText,'"'));let g=new Uint8Array(b.response,c,Math.min(b.response.byteLength-c,r));return i.HEAPU8.set(g,e),g.byteLength}else throw new Error("Range request for ".concat(_.dataUrl," did returned non-success status: ").concat(b.status,' "').concat(b.statusText,'"'))}catch(b){throw console.log(b),new Error("Range request for ".concat(_.dataUrl," failed with error: ").concat(b,'"'))}}case 2:{let b=(f=lt._files)==null?void 0:f.get(_.fileName);if(!b)throw new Error("No HTML5 file registered with name: ".concat(_.fileName));let g=b.slice(c,c+r),T=new Uint8Array(new FileReaderSync().readAsArrayBuffer(g));return i.HEAPU8.set(T,e),T.byteLength}case 3:{let b=lt._files.get(_.fileName);if(!b)throw new Error("No OPFS access handle registered with name: ".concat(_.fileName));let g=i.HEAPU8.subarray(e,e+r);return b.read(g,{at:c})}}return 0}catch(_){return console.log(_),Xe(i,_.toString()),0}},writeFile:(i,t,e,r,c)=>{var _;let f=lt.getFileInfo(i,t);switch(f==null?void 0:f.dataProtocol){case 4:return Xe(i,"Cannot write to HTTP file"),0;case 5:{let b=i.HEAPU8.subarray(e,e+r),g=new XMLHttpRequest;return g.open("PUT",Qe(f==null?void 0:f.s3Config,f.dataUrl),!1),Ze(g,f==null?void 0:f.s3Config,f.dataUrl,"PUT","",b),g.send(b),g.status!==200?(Xe(i,"Failed writing file: HTTP "+g.status),0):r}case 2:return Xe(i,"cannot write using the html5 file reader api"),0;case 3:{let b=(_=lt._files)==null?void 0:_.get(f.fileName);if(!b)throw new Error("No OPFS access handle registered with name: ".concat(f.fileName));let g=i.HEAPU8.subarray(e,e+r);return b.write(g,{at:c})}}return 0},getLastFileModificationTime:(i,t)=>{var r;let e=lt.getFileInfo(i,t);switch(e==null?void 0:e.dataProtocol){case 2:{if(!((r=lt._files)==null?void 0:r.get(e.fileName)))throw Error("No handle available for file: ".concat(e.fileName));return 0}case 4:case 5:return new Date().getTime()/1e3}return 0},progressUpdate:(i,t,e)=>{postMessage&&postMessage({requestId:0,type:"PROGRESS_UPDATE",data:{status:i?"completed":"in-progress",percentage:t,repetitions:e}})},checkDirectory:(i,t,e)=>{let r=ht(i,t,e);return console.log("checkDirectory: ".concat(r)),!1},createDirectory:(i,t,e)=>{let r=ht(i,t,e);console.log("createDirectory: ".concat(r))},removeDirectory:(i,t,e)=>{let r=ht(i,t,e);console.log("removeDirectory: ".concat(r))},listDirectoryEntries:(i,t,e)=>{let r=ht(i,t,e);return console.log("listDirectoryEntries: ".concat(r)),!1},moveFile:(i,t,e,r,c)=>{var g,T;let f=ht(i,t,e),_=ht(i,r,c),b=(g=lt._files)==null?void 0:g.get(f);b!==void 0&&(lt._files.delete(b),lt._files.set(_,b));for(let[D,U]of((T=lt._fileInfoCache)==null?void 0:T.entries())||[])if(U.dataUrl==f){lt._fileInfoCache.delete(D);break}return!0},removeFile:(i,t,e)=>{},callScalarUDF:(i,t,e,r,c,f,_)=>{pd(lt,i,t,e,r,c,f,_)}};var Oc=class extends fa{postMessage(t,e){globalThis.postMessage(t,e)}async instantiate(t,e,r){return await new pa(this,lt,t,e).instantiate(r)}};function Fd(){let i=new Oc;globalThis.onmessage=async t=>{await i.onMessage(t.data)}}Fd();return Ag(s1);})();
2
- /*! Bundled license information:
3
-
4
- js-sha256/src/sha256.js:
5
- (**
6
- * [js-sha256]{@link https://github.com/emn178/js-sha256}
7
- *
8
- * @version 0.11.1
9
- * @author Chen, Yi-Cyuan [emn178@gmail.com]
10
- * @copyright Chen, Yi-Cyuan 2014-2025
11
- * @license MIT
12
- *)
13
- */
14
- //# sourceMappingURL=duckdb-browser-mvp.worker.js.map