@duckdb/duckdb-wasm 1.17.0 → 1.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/README.md +2 -2
  2. package/dist/duckdb-browser-blocking.cjs +11 -11
  3. package/dist/duckdb-browser-blocking.cjs.map +3 -3
  4. package/dist/duckdb-browser-blocking.mjs +11 -11
  5. package/dist/duckdb-browser-blocking.mjs.map +3 -3
  6. package/dist/duckdb-browser-coi.pthread.worker.js +10 -10
  7. package/dist/duckdb-browser-coi.pthread.worker.js.map +3 -3
  8. package/dist/duckdb-browser-coi.worker.js +10 -10
  9. package/dist/duckdb-browser-coi.worker.js.map +3 -3
  10. package/dist/duckdb-browser-eh.worker.js +8 -8
  11. package/dist/duckdb-browser-eh.worker.js.map +3 -3
  12. package/dist/duckdb-browser-mvp.worker.js +8 -8
  13. package/dist/duckdb-browser-mvp.worker.js.map +3 -3
  14. package/dist/duckdb-browser.cjs +1 -1
  15. package/dist/duckdb-browser.cjs.map +4 -4
  16. package/dist/duckdb-browser.mjs +1 -1
  17. package/dist/duckdb-browser.mjs.map +4 -4
  18. package/dist/duckdb-coi.wasm +0 -0
  19. package/dist/duckdb-eh.wasm +0 -0
  20. package/dist/duckdb-mvp.wasm +0 -0
  21. package/dist/duckdb-node-blocking.cjs +4 -4
  22. package/dist/duckdb-node-blocking.cjs.map +4 -4
  23. package/dist/duckdb-node-eh.worker.cjs +4 -4
  24. package/dist/duckdb-node-eh.worker.cjs.map +4 -4
  25. package/dist/duckdb-node-mvp.worker.cjs +3 -3
  26. package/dist/duckdb-node-mvp.worker.cjs.map +4 -4
  27. package/dist/duckdb-node.cjs +1 -1
  28. package/dist/duckdb-node.cjs.map +4 -4
  29. package/dist/img/duckdb_version_badge.svg +1 -1
  30. package/dist/tests-browser.js +1454 -1333
  31. package/dist/tests-browser.js.map +3 -3
  32. package/dist/tests-node.cjs +1482 -1345
  33. package/dist/tests-node.cjs.map +4 -4
  34. package/dist/types/src/bindings/bindings_base.d.ts +4 -4
  35. package/dist/types/src/bindings/bindings_interface.d.ts +3 -3
  36. package/dist/types/src/bindings/runtime.d.ts +6 -4
  37. package/dist/types/src/bindings/runtime_node.d.ts +1 -0
  38. package/dist/types/src/bindings/web_file.d.ts +2 -6
  39. package/dist/types/src/parallel/async_bindings.d.ts +3 -2
  40. package/dist/types/src/parallel/async_bindings_interface.d.ts +3 -2
  41. package/dist/types/src/parallel/worker_request.d.ts +3 -2
  42. package/dist/types/src/targets/duckdb-browser-blocking.d.ts +1 -0
  43. package/dist/types/src/targets/duckdb-node-blocking.d.ts +1 -0
  44. package/dist/types/src/targets/duckdb.d.ts +1 -1
  45. package/package.json +11 -11
@@ -1,15 +1,15 @@
1
- "use strict";var duckdb=(()=>{var yw=Object.create;var ms=Object.defineProperty;var _w=Object.getOwnPropertyDescriptor;var mw=Object.getOwnPropertyNames;var bw=Object.getPrototypeOf,vw=Object.prototype.hasOwnProperty;var gw=(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 new Error('Dynamic require of "'+i+'" is not supported')});var bs=(i,t)=>()=>(t||i((t={exports:{}}).exports,t),t.exports),pr=(i,t)=>{for(var e in t)ms(i,e,{get:t[e],enumerable:!0})},Cf=(i,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of mw(t))!vw.call(i,n)&&n!==e&&ms(i,n,{get:()=>t[n],enumerable:!(r=_w(t,n))||r.enumerable});return i};var Af=(i,t,e)=>(e=i!=null?yw(bw(i)):{},Cf(t||!i||!i.__esModule?ms(e,"default",{value:i,enumerable:!0}):e,i)),ww=i=>Cf(ms({},"__esModule",{value:!0}),i);var Gf=bs((_I,ws)=>{var xf,Ff,Bf,Tf,Df,Ef,kf,Of,Mf,vs,ha,Rf,Uf,Nf,Or,Lf,Pf,Vf,Hf,zf,Wf,$f,Yf,Xf,gs;(function(i){var t=typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:{};typeof define=="function"&&define.amd?define("tslib",["exports"],function(r){i(e(t,e(r)))}):typeof ws=="object"&&typeof ws.exports=="object"?i(e(t,e(ws.exports))):i(e(t));function e(r,n){return r!==t&&(typeof Object.create=="function"?Object.defineProperty(r,"__esModule",{value:!0}):r.__esModule=!0),function(o,c){return r[o]=n?n(o,c):c}}})(function(i){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(r[o]=n[o])};xf=function(r,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(r,n);function o(){this.constructor=r}r.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)},Ff=Object.assign||function(r){for(var n,o=1,c=arguments.length;o<c;o++){n=arguments[o];for(var p in n)Object.prototype.hasOwnProperty.call(n,p)&&(r[p]=n[p])}return r},Bf=function(r,n){var o={};for(var c in r)Object.prototype.hasOwnProperty.call(r,c)&&n.indexOf(c)<0&&(o[c]=r[c]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var p=0,c=Object.getOwnPropertySymbols(r);p<c.length;p++)n.indexOf(c[p])<0&&Object.prototype.propertyIsEnumerable.call(r,c[p])&&(o[c[p]]=r[c[p]]);return o},Tf=function(r,n,o,c){var p=arguments.length,b=p<3?n:c===null?c=Object.getOwnPropertyDescriptor(n,o):c,g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(r,n,o,c);else for(var A=r.length-1;A>=0;A--)(g=r[A])&&(b=(p<3?g(b):p>3?g(n,o,b):g(n,o))||b);return p>3&&b&&Object.defineProperty(n,o,b),b},Df=function(r,n){return function(o,c){n(o,c,r)}},Ef=function(r,n){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,n)},kf=function(r,n,o,c){function p(b){return b instanceof o?b:new o(function(g){g(b)})}return new(o||(o=Promise))(function(b,g){function A(k){try{F(c.next(k))}catch(lt){g(lt)}}function T(k){try{F(c.throw(k))}catch(lt){g(lt)}}function F(k){k.done?b(k.value):p(k.value).then(A,T)}F((c=c.apply(r,n||[])).next())})},Of=function(r,n){var o={label:0,sent:function(){if(b[0]&1)throw b[1];return b[1]},trys:[],ops:[]},c,p,b,g;return g={next:A(0),throw:A(1),return:A(2)},typeof Symbol=="function"&&(g[Symbol.iterator]=function(){return this}),g;function A(F){return function(k){return T([F,k])}}function T(F){if(c)throw new TypeError("Generator is already executing.");for(;o;)try{if(c=1,p&&(b=F[0]&2?p.return:F[0]?p.throw||((b=p.return)&&b.call(p),0):p.next)&&!(b=b.call(p,F[1])).done)return b;switch(p=0,b&&(F=[F[0]&2,b.value]),F[0]){case 0:case 1:b=F;break;case 4:return o.label++,{value:F[1],done:!1};case 5:o.label++,p=F[1],F=[0];continue;case 7:F=o.ops.pop(),o.trys.pop();continue;default:if(b=o.trys,!(b=b.length>0&&b[b.length-1])&&(F[0]===6||F[0]===2)){o=0;continue}if(F[0]===3&&(!b||F[1]>b[0]&&F[1]<b[3])){o.label=F[1];break}if(F[0]===6&&o.label<b[1]){o.label=b[1],b=F;break}if(b&&o.label<b[2]){o.label=b[2],o.ops.push(F);break}b[2]&&o.ops.pop(),o.trys.pop();continue}F=n.call(r,o)}catch(k){F=[6,k],p=0}finally{c=b=0}if(F[0]&5)throw F[1];return{value:F[0]?F[1]:void 0,done:!0}}},Mf=function(r,n){for(var o in r)o!=="default"&&!Object.prototype.hasOwnProperty.call(n,o)&&gs(n,r,o)},gs=Object.create?function(r,n,o,c){c===void 0&&(c=o);var p=Object.getOwnPropertyDescriptor(n,o);(!p||("get"in p?!n.__esModule:p.writable||p.configurable))&&(p={enumerable:!0,get:function(){return n[o]}}),Object.defineProperty(r,c,p)}:function(r,n,o,c){c===void 0&&(c=o),r[c]=n[o]},vs=function(r){var n=typeof Symbol=="function"&&Symbol.iterator,o=n&&r[n],c=0;if(o)return o.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&c>=r.length&&(r=void 0),{value:r&&r[c++],done:!r}}};throw new TypeError(n?"Object is not iterable.":"Symbol.iterator is not defined.")},ha=function(r,n){var o=typeof Symbol=="function"&&r[Symbol.iterator];if(!o)return r;var c=o.call(r),p,b=[],g;try{for(;(n===void 0||n-- >0)&&!(p=c.next()).done;)b.push(p.value)}catch(A){g={error:A}}finally{try{p&&!p.done&&(o=c.return)&&o.call(c)}finally{if(g)throw g.error}}return b},Rf=function(){for(var r=[],n=0;n<arguments.length;n++)r=r.concat(ha(arguments[n]));return r},Uf=function(){for(var r=0,n=0,o=arguments.length;n<o;n++)r+=arguments[n].length;for(var c=Array(r),p=0,n=0;n<o;n++)for(var b=arguments[n],g=0,A=b.length;g<A;g++,p++)c[p]=b[g];return c},Nf=function(r,n,o){if(o||arguments.length===2)for(var c=0,p=n.length,b;c<p;c++)(b||!(c in n))&&(b||(b=Array.prototype.slice.call(n,0,c)),b[c]=n[c]);return r.concat(b||Array.prototype.slice.call(n))},Or=function(r){return this instanceof Or?(this.v=r,this):new Or(r)},Lf=function(r,n,o){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var c=o.apply(r,n||[]),p,b=[];return p={},g("next"),g("throw"),g("return"),p[Symbol.asyncIterator]=function(){return this},p;function g(ct){c[ct]&&(p[ct]=function(mt){return new Promise(function(Dt,ae){b.push([ct,mt,Dt,ae])>1||A(ct,mt)})})}function A(ct,mt){try{T(c[ct](mt))}catch(Dt){lt(b[0][3],Dt)}}function T(ct){ct.value instanceof Or?Promise.resolve(ct.value.v).then(F,k):lt(b[0][2],ct)}function F(ct){A("next",ct)}function k(ct){A("throw",ct)}function lt(ct,mt){ct(mt),b.shift(),b.length&&A(b[0][0],b[0][1])}},Pf=function(r){var n,o;return n={},c("next"),c("throw",function(p){throw p}),c("return"),n[Symbol.iterator]=function(){return this},n;function c(p,b){n[p]=r[p]?function(g){return(o=!o)?{value:Or(r[p](g)),done:p==="return"}:b?b(g):g}:b}},Vf=function(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r[Symbol.asyncIterator],o;return n?n.call(r):(r=typeof vs=="function"?vs(r):r[Symbol.iterator](),o={},c("next"),c("throw"),c("return"),o[Symbol.asyncIterator]=function(){return this},o);function c(b){o[b]=r[b]&&function(g){return new Promise(function(A,T){g=r[b](g),p(A,T,g.done,g.value)})}}function p(b,g,A,T){Promise.resolve(T).then(function(F){b({value:F,done:A})},g)}},Hf=function(r,n){return Object.defineProperty?Object.defineProperty(r,"raw",{value:n}):r.raw=n,r};var e=Object.create?function(r,n){Object.defineProperty(r,"default",{enumerable:!0,value:n})}:function(r,n){r.default=n};zf=function(r){if(r&&r.__esModule)return r;var n={};if(r!=null)for(var o in r)o!=="default"&&Object.prototype.hasOwnProperty.call(r,o)&&gs(n,r,o);return e(n,r),n},Wf=function(r){return r&&r.__esModule?r:{default:r}},$f=function(r,n,o,c){if(o==="a"&&!c)throw new TypeError("Private accessor was defined without a getter");if(typeof n=="function"?r!==n||!c:!n.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return o==="m"?c:o==="a"?c.call(r):c?c.value:n.get(r)},Yf=function(r,n,o,c,p){if(c==="m")throw new TypeError("Private method is not writable");if(c==="a"&&!p)throw new TypeError("Private accessor was defined without a setter");if(typeof n=="function"?r!==n||!p:!n.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return c==="a"?p.call(r,o):p?p.value=o:n.set(r,o),o},Xf=function(r,n){if(n===null||typeof n!="object"&&typeof n!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof r=="function"?n===r:r.has(n)},i("__extends",xf),i("__assign",Ff),i("__rest",Bf),i("__decorate",Tf),i("__param",Df),i("__metadata",Ef),i("__awaiter",kf),i("__generator",Of),i("__exportStar",Mf),i("__createBinding",gs),i("__values",vs),i("__read",ha),i("__spread",Rf),i("__spreadArrays",Uf),i("__spreadArray",Nf),i("__await",Or),i("__asyncGenerator",Lf),i("__asyncDelegator",Pf),i("__asyncValues",Vf),i("__makeTemplateObject",Hf),i("__importStar",zf),i("__importDefault",Wf),i("__classPrivateFieldGet",$f),i("__classPrivateFieldSet",Yf),i("__classPrivateFieldIn",Xf)})});var dl=bs(()=>{});var Op=bs(()=>{});var Vp=bs((exports,module)=>{(function(){"use strict";var ERROR="input is invalid type",WINDOW=typeof window=="object",root=WINDOW?window:{};root.JS_SHA256_NO_WINDOW&&(WINDOW=!1);var WEB_WORKER=!WINDOW&&typeof self=="object",NODE_JS=!root.JS_SHA256_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;NODE_JS?root=global:WEB_WORKER&&(root=self);var COMMON_JS=!root.JS_SHA256_NO_COMMON_JS&&typeof module=="object"&&module.exports,AMD=typeof define=="function"&&define.amd,ARRAY_BUFFER=!root.JS_SHA256_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",HEX_CHARS="0123456789abcdef".split(""),EXTRA=[-2147483648,8388608,32768,128],SHIFT=[24,16,8,0],K=[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],OUTPUT_TYPES=["hex","array","digest","arrayBuffer"],blocks=[];(root.JS_SHA256_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(i){return Object.prototype.toString.call(i)==="[object Array]"}),ARRAY_BUFFER&&(root.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(i){return typeof i=="object"&&i.buffer&&i.buffer.constructor===ArrayBuffer});var createOutputMethod=function(i,t){return function(e){return new Sha256(t,!0).update(e)[i]()}},createMethod=function(i){var t=createOutputMethod("hex",i);NODE_JS&&(t=nodeWrap(t,i)),t.create=function(){return new Sha256(i)},t.update=function(n){return t.create().update(n)};for(var e=0;e<OUTPUT_TYPES.length;++e){var r=OUTPUT_TYPES[e];t[r]=createOutputMethod(r,i)}return t},nodeWrap=function(method,is224){var crypto=eval("require('crypto')"),Buffer=eval("require('buffer').Buffer"),algorithm=is224?"sha224":"sha256",nodeMethod=function(i){if(typeof i=="string")return crypto.createHash(algorithm).update(i,"utf8").digest("hex");if(i==null)throw new Error(ERROR);return i.constructor===ArrayBuffer&&(i=new Uint8Array(i)),Array.isArray(i)||ArrayBuffer.isView(i)||i.constructor===Buffer?crypto.createHash(algorithm).update(new Buffer(i)).digest("hex"):method(i)};return nodeMethod},createHmacOutputMethod=function(i,t){return function(e,r){return new HmacSha256(e,t,!0).update(r)[i]()}},createHmacMethod=function(i){var t=createHmacOutputMethod("hex",i);t.create=function(n){return new HmacSha256(n,i)},t.update=function(n,o){return t.create(n).update(o)};for(var e=0;e<OUTPUT_TYPES.length;++e){var r=OUTPUT_TYPES[e];t[r]=createHmacOutputMethod(r,i)}return t};function Sha256(i,t){t?(blocks[0]=blocks[16]=blocks[1]=blocks[2]=blocks[3]=blocks[4]=blocks[5]=blocks[6]=blocks[7]=blocks[8]=blocks[9]=blocks[10]=blocks[11]=blocks[12]=blocks[13]=blocks[14]=blocks[15]=0,this.blocks=blocks):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],i?(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=i}Sha256.prototype.update=function(i){if(!this.finalized){var t,e=typeof i;if(e!=="string"){if(e==="object"){if(i===null)throw new Error(ERROR);if(ARRAY_BUFFER&&i.constructor===ArrayBuffer)i=new Uint8Array(i);else if(!Array.isArray(i)&&(!ARRAY_BUFFER||!ArrayBuffer.isView(i)))throw new Error(ERROR)}else throw new Error(ERROR);t=!0}for(var r,n=0,o,c=i.length,p=this.blocks;n<c;){if(this.hashed&&(this.hashed=!1,p[0]=this.block,p[16]=p[1]=p[2]=p[3]=p[4]=p[5]=p[6]=p[7]=p[8]=p[9]=p[10]=p[11]=p[12]=p[13]=p[14]=p[15]=0),t)for(o=this.start;n<c&&o<64;++n)p[o>>2]|=i[n]<<SHIFT[o++&3];else for(o=this.start;n<c&&o<64;++n)r=i.charCodeAt(n),r<128?p[o>>2]|=r<<SHIFT[o++&3]:r<2048?(p[o>>2]|=(192|r>>6)<<SHIFT[o++&3],p[o>>2]|=(128|r&63)<<SHIFT[o++&3]):r<55296||r>=57344?(p[o>>2]|=(224|r>>12)<<SHIFT[o++&3],p[o>>2]|=(128|r>>6&63)<<SHIFT[o++&3],p[o>>2]|=(128|r&63)<<SHIFT[o++&3]):(r=65536+((r&1023)<<10|i.charCodeAt(++n)&1023),p[o>>2]|=(240|r>>18)<<SHIFT[o++&3],p[o>>2]|=(128|r>>12&63)<<SHIFT[o++&3],p[o>>2]|=(128|r>>6&63)<<SHIFT[o++&3],p[o>>2]|=(128|r&63)<<SHIFT[o++&3]);this.lastByteIndex=o,this.bytes+=o-this.start,o>=64?(this.block=p[16],this.start=o-64,this.hash(),this.hashed=!0):this.start=o}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},Sha256.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var i=this.blocks,t=this.lastByteIndex;i[16]=this.block,i[t>>2]|=EXTRA[t&3],this.block=i[16],t>=56&&(this.hashed||this.hash(),i[0]=this.block,i[16]=i[1]=i[2]=i[3]=i[4]=i[5]=i[6]=i[7]=i[8]=i[9]=i[10]=i[11]=i[12]=i[13]=i[14]=i[15]=0),i[14]=this.hBytes<<3|this.bytes>>>29,i[15]=this.bytes<<3,this.hash()}},Sha256.prototype.hash=function(){var i=this.h0,t=this.h1,e=this.h2,r=this.h3,n=this.h4,o=this.h5,c=this.h6,p=this.h7,b=this.blocks,g,A,T,F,k,lt,ct,mt,Dt,ae,he;for(g=16;g<64;++g)k=b[g-15],A=(k>>>7|k<<25)^(k>>>18|k<<14)^k>>>3,k=b[g-2],T=(k>>>17|k<<15)^(k>>>19|k<<13)^k>>>10,b[g]=b[g-16]+A+b[g-7]+T<<0;for(he=t&e,g=0;g<64;g+=4)this.first?(this.is224?(mt=300032,k=b[0]-1413257819,p=k-150054599<<0,r=k+24177077<<0):(mt=704751109,k=b[0]-210244248,p=k-1521486534<<0,r=k+143694565<<0),this.first=!1):(A=(i>>>2|i<<30)^(i>>>13|i<<19)^(i>>>22|i<<10),T=(n>>>6|n<<26)^(n>>>11|n<<21)^(n>>>25|n<<7),mt=i&t,F=mt^i&e^he,ct=n&o^~n&c,k=p+T+ct+K[g]+b[g],lt=A+F,p=r+k<<0,r=k+lt<<0),A=(r>>>2|r<<30)^(r>>>13|r<<19)^(r>>>22|r<<10),T=(p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7),Dt=r&i,F=Dt^r&t^mt,ct=p&n^~p&o,k=c+T+ct+K[g+1]+b[g+1],lt=A+F,c=e+k<<0,e=k+lt<<0,A=(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10),T=(c>>>6|c<<26)^(c>>>11|c<<21)^(c>>>25|c<<7),ae=e&r,F=ae^e&i^Dt,ct=c&p^~c&n,k=o+T+ct+K[g+2]+b[g+2],lt=A+F,o=t+k<<0,t=k+lt<<0,A=(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10),T=(o>>>6|o<<26)^(o>>>11|o<<21)^(o>>>25|o<<7),he=t&e,F=he^t&r^ae,ct=o&c^~o&p,k=n+T+ct+K[g+3]+b[g+3],lt=A+F,n=i+k<<0,i=k+lt<<0;this.h0=this.h0+i<<0,this.h1=this.h1+t<<0,this.h2=this.h2+e<<0,this.h3=this.h3+r<<0,this.h4=this.h4+n<<0,this.h5=this.h5+o<<0,this.h6=this.h6+c<<0,this.h7=this.h7+p<<0},Sha256.prototype.hex=function(){this.finalize();var i=this.h0,t=this.h1,e=this.h2,r=this.h3,n=this.h4,o=this.h5,c=this.h6,p=this.h7,b=HEX_CHARS[i>>28&15]+HEX_CHARS[i>>24&15]+HEX_CHARS[i>>20&15]+HEX_CHARS[i>>16&15]+HEX_CHARS[i>>12&15]+HEX_CHARS[i>>8&15]+HEX_CHARS[i>>4&15]+HEX_CHARS[i&15]+HEX_CHARS[t>>28&15]+HEX_CHARS[t>>24&15]+HEX_CHARS[t>>20&15]+HEX_CHARS[t>>16&15]+HEX_CHARS[t>>12&15]+HEX_CHARS[t>>8&15]+HEX_CHARS[t>>4&15]+HEX_CHARS[t&15]+HEX_CHARS[e>>28&15]+HEX_CHARS[e>>24&15]+HEX_CHARS[e>>20&15]+HEX_CHARS[e>>16&15]+HEX_CHARS[e>>12&15]+HEX_CHARS[e>>8&15]+HEX_CHARS[e>>4&15]+HEX_CHARS[e&15]+HEX_CHARS[r>>28&15]+HEX_CHARS[r>>24&15]+HEX_CHARS[r>>20&15]+HEX_CHARS[r>>16&15]+HEX_CHARS[r>>12&15]+HEX_CHARS[r>>8&15]+HEX_CHARS[r>>4&15]+HEX_CHARS[r&15]+HEX_CHARS[n>>28&15]+HEX_CHARS[n>>24&15]+HEX_CHARS[n>>20&15]+HEX_CHARS[n>>16&15]+HEX_CHARS[n>>12&15]+HEX_CHARS[n>>8&15]+HEX_CHARS[n>>4&15]+HEX_CHARS[n&15]+HEX_CHARS[o>>28&15]+HEX_CHARS[o>>24&15]+HEX_CHARS[o>>20&15]+HEX_CHARS[o>>16&15]+HEX_CHARS[o>>12&15]+HEX_CHARS[o>>8&15]+HEX_CHARS[o>>4&15]+HEX_CHARS[o&15]+HEX_CHARS[c>>28&15]+HEX_CHARS[c>>24&15]+HEX_CHARS[c>>20&15]+HEX_CHARS[c>>16&15]+HEX_CHARS[c>>12&15]+HEX_CHARS[c>>8&15]+HEX_CHARS[c>>4&15]+HEX_CHARS[c&15];return this.is224||(b+=HEX_CHARS[p>>28&15]+HEX_CHARS[p>>24&15]+HEX_CHARS[p>>20&15]+HEX_CHARS[p>>16&15]+HEX_CHARS[p>>12&15]+HEX_CHARS[p>>8&15]+HEX_CHARS[p>>4&15]+HEX_CHARS[p&15]),b},Sha256.prototype.toString=Sha256.prototype.hex,Sha256.prototype.digest=function(){this.finalize();var i=this.h0,t=this.h1,e=this.h2,r=this.h3,n=this.h4,o=this.h5,c=this.h6,p=this.h7,b=[i>>24&255,i>>16&255,i>>8&255,i&255,t>>24&255,t>>16&255,t>>8&255,t&255,e>>24&255,e>>16&255,e>>8&255,e&255,r>>24&255,r>>16&255,r>>8&255,r&255,n>>24&255,n>>16&255,n>>8&255,n&255,o>>24&255,o>>16&255,o>>8&255,o&255,c>>24&255,c>>16&255,c>>8&255,c&255];return this.is224||b.push(p>>24&255,p>>16&255,p>>8&255,p&255),b},Sha256.prototype.array=Sha256.prototype.digest,Sha256.prototype.arrayBuffer=function(){this.finalize();var i=new ArrayBuffer(this.is224?28:32),t=new DataView(i);return t.setUint32(0,this.h0),t.setUint32(4,this.h1),t.setUint32(8,this.h2),t.setUint32(12,this.h3),t.setUint32(16,this.h4),t.setUint32(20,this.h5),t.setUint32(24,this.h6),this.is224||t.setUint32(28,this.h7),i};function HmacSha256(i,t,e){var r,n=typeof i;if(n==="string"){var o=[],c=i.length,p=0,b;for(r=0;r<c;++r)b=i.charCodeAt(r),b<128?o[p++]=b:b<2048?(o[p++]=192|b>>6,o[p++]=128|b&63):b<55296||b>=57344?(o[p++]=224|b>>12,o[p++]=128|b>>6&63,o[p++]=128|b&63):(b=65536+((b&1023)<<10|i.charCodeAt(++r)&1023),o[p++]=240|b>>18,o[p++]=128|b>>12&63,o[p++]=128|b>>6&63,o[p++]=128|b&63);i=o}else if(n==="object"){if(i===null)throw new Error(ERROR);if(ARRAY_BUFFER&&i.constructor===ArrayBuffer)i=new Uint8Array(i);else if(!Array.isArray(i)&&(!ARRAY_BUFFER||!ArrayBuffer.isView(i)))throw new Error(ERROR)}else throw new Error(ERROR);i.length>64&&(i=new Sha256(t,!0).update(i).array());var g=[],A=[];for(r=0;r<64;++r){var T=i[r]||0;g[r]=92^T,A[r]=54^T}Sha256.call(this,t,e),this.update(A),this.oKeyPad=g,this.inner=!0,this.sharedMemory=e}HmacSha256.prototype=new Sha256,HmacSha256.prototype.finalize=function(){if(Sha256.prototype.finalize.call(this),this.inner){this.inner=!1;var i=this.array();Sha256.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(i),Sha256.prototype.finalize.call(this)}};var exports=createMethod();exports.sha256=exports,exports.sha224=createMethod(!0),exports.sha256.hmac=createHmacMethod(),exports.sha224.hmac=createHmacMethod(!0),COMMON_JS?module.exports=exports:(root.sha256=exports.sha256,root.sha224=exports.sha224,AMD&&define(function(){return exports}))})()});var fI={};pr(fI,{registerWorker:()=>Wp});var Kf=Af(Gf(),1),{__extends:mI,__assign:bI,__rest:Jf,__decorate:vI,__param:gI,__metadata:wI,__awaiter:O,__generator:jI,__exportStar:SI,__createBinding:II,__values:CI,__read:AI,__spread:xI,__spreadArrays:FI,__spreadArray:BI,__await:it,__asyncGenerator:_e,__asyncDelegator:Mr,__asyncValues:Ne,__makeTemplateObject:TI,__importStar:DI,__importDefault:EI,__classPrivateFieldGet:kI,__classPrivateFieldSet:OI,__classPrivateFieldIn:MI}=Kf.default;var va={};pr(va,{compareArrayLike:()=>ba,joinUint8Arrays:()=>Be,memcpy:()=>Ur,rebaseValueOffsets:()=>mn,toArrayBufferView:()=>rt,toArrayBufferViewAsyncIterator:()=>Ge,toArrayBufferViewIterator:()=>li,toBigInt64Array:()=>Fw,toBigUint64Array:()=>Dw,toFloat32Array:()=>Ew,toFloat32ArrayAsyncIterator:()=>Gw,toFloat32ArrayIterator:()=>Pw,toFloat64Array:()=>kw,toFloat64ArrayAsyncIterator:()=>Kw,toFloat64ArrayIterator:()=>Vw,toInt16Array:()=>xw,toInt16ArrayAsyncIterator:()=>Ww,toInt16ArrayIterator:()=>Rw,toInt32Array:()=>yr,toInt32ArrayAsyncIterator:()=>$w,toInt32ArrayIterator:()=>Uw,toInt8Array:()=>Aw,toInt8ArrayAsyncIterator:()=>zw,toInt8ArrayIterator:()=>Mw,toUint16Array:()=>Bw,toUint16ArrayAsyncIterator:()=>Yw,toUint16ArrayIterator:()=>Nw,toUint32Array:()=>Tw,toUint32ArrayAsyncIterator:()=>Xw,toUint32ArrayIterator:()=>Lw,toUint8Array:()=>Y,toUint8ArrayAsyncIterator:()=>ma,toUint8ArrayIterator:()=>_a,toUint8ClampedArray:()=>Ow,toUint8ClampedArrayAsyncIterator:()=>Jw,toUint8ClampedArrayIterator:()=>Hw});var jw=new TextDecoder("utf-8"),pn=i=>jw.decode(i),Sw=new TextEncoder,Gi=i=>Sw.encode(i);var[NI,js]=(()=>{let i=()=>{throw new Error("BigInt is not available in this environment")};function t(){throw i()}return t.asIntN=()=>{throw i()},t.asUintN=()=>{throw i()},typeof BigInt<"u"?[BigInt,!0]:[t,!1]})(),[yn,LI]=(()=>{let i=()=>{throw new Error("BigInt64Array is not available in this environment")};class t{static get BYTES_PER_ELEMENT(){return 8}static of(){throw i()}static from(){throw i()}constructor(){throw i()}}return typeof BigInt64Array<"u"?[BigInt64Array,!0]:[t,!1]})(),[Rr,PI]=(()=>{let i=()=>{throw new Error("BigUint64Array is not available in this environment")};class t{static get BYTES_PER_ELEMENT(){return 8}static of(){throw i()}static from(){throw i()}constructor(){throw i()}}return typeof BigUint64Array<"u"?[BigUint64Array,!0]:[t,!1]})();var Iw=i=>typeof i=="number",qf=i=>typeof i=="boolean",zt=i=>typeof i=="function",ce=i=>i!=null&&Object(i)===i,Ye=i=>ce(i)&&zt(i.then);var Xe=i=>ce(i)&&zt(i[Symbol.iterator]),Le=i=>ce(i)&&zt(i[Symbol.asyncIterator]),Ss=i=>ce(i)&&ce(i.schema);var Is=i=>ce(i)&&"done"in i&&"value"in i;var Cs=i=>ce(i)&&zt(i.stat)&&Iw(i.fd);var As=i=>ce(i)&&_n(i.body),xs=i=>"_getDOMStream"in i&&"_getNodeStream"in i,Zf=i=>ce(i)&&zt(i.abort)&&zt(i.getWriter)&&!xs(i),_n=i=>ce(i)&&zt(i.cancel)&&zt(i.getReader)&&!xs(i),Qf=i=>ce(i)&&zt(i.end)&&zt(i.write)&&qf(i.writable)&&!xs(i),Fs=i=>ce(i)&&zt(i.read)&&zt(i.pipe)&&qf(i.readable)&&!xs(i),th=i=>ce(i)&&zt(i.clear)&&zt(i.bytes)&&zt(i.position)&&zt(i.setPosition)&&zt(i.capacity)&&zt(i.getBufferIdentifier)&&zt(i.createLong);var ya=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:ArrayBuffer;function Cw(i){let t=i[0]?[i[0]]:[],e,r,n,o;for(let c,p,b=0,g=0,A=i.length;++b<A;){if(c=t[g],p=i[b],!c||!p||c.buffer!==p.buffer||p.byteOffset<c.byteOffset){p&&(t[++g]=p);continue}if({byteOffset:e,byteLength:n}=c,{byteOffset:r,byteLength:o}=p,e+n<r||r+o<e){p&&(t[++g]=p);continue}t[g]=new Uint8Array(c.buffer,e,r-e+o)}return t}function Ur(i,t,e=0,r=t.byteLength){let n=i.byteLength,o=new Uint8Array(i.buffer,i.byteOffset,n),c=new Uint8Array(t.buffer,t.byteOffset,Math.min(r,n));return o.set(c,e),i}function Be(i,t){let e=Cw(i),r=e.reduce((A,T)=>A+T.byteLength,0),n,o,c,p=0,b=-1,g=Math.min(t||Number.POSITIVE_INFINITY,r);for(let A=e.length;++b<A;){if(n=e[b],o=n.subarray(0,Math.min(n.length,g-p)),g<=p+o.length){o.length<n.length?e[b]=n.subarray(o.length):o.length===n.length&&b++,c?Ur(c,o,p):c=o;break}Ur(c||(c=new Uint8Array(g)),o,p),p+=o.length}return[c||new Uint8Array(0),e.slice(b),r-(c?c.byteLength:0)]}function rt(i,t){let e=Is(t)?t.value:t;return e instanceof i?i===Uint8Array?new i(e.buffer,e.byteOffset,e.byteLength):e:e?(typeof e=="string"&&(e=Gi(e)),e instanceof ArrayBuffer?new i(e):e instanceof ya?new i(e):th(e)?rt(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 Aw=i=>rt(Int8Array,i),xw=i=>rt(Int16Array,i),yr=i=>rt(Int32Array,i),Fw=i=>rt(yn,i),Y=i=>rt(Uint8Array,i),Bw=i=>rt(Uint16Array,i),Tw=i=>rt(Uint32Array,i),Dw=i=>rt(Rr,i),Ew=i=>rt(Float32Array,i),kw=i=>rt(Float64Array,i),Ow=i=>rt(Uint8ClampedArray,i),pa=i=>(i.next(),i);function*li(i,t){let e=function*(n){yield n},r=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof ya?e(t):Xe(t)?t:e(t);return yield*pa(function*(n){let o=null;do o=n.next(yield rt(i,o));while(!o.done)}(r[Symbol.iterator]())),new i}var Mw=i=>li(Int8Array,i),Rw=i=>li(Int16Array,i),Uw=i=>li(Int32Array,i),_a=i=>li(Uint8Array,i),Nw=i=>li(Uint16Array,i),Lw=i=>li(Uint32Array,i),Pw=i=>li(Float32Array,i),Vw=i=>li(Float64Array,i),Hw=i=>li(Uint8ClampedArray,i);function Ge(i,t){return _e(this,arguments,function*(){if(Ye(t))return yield it(yield it(yield*Mr(Ne(Ge(i,yield it(t))))));let r=function(c){return _e(this,arguments,function*(){yield yield it(yield it(c))})},n=function(c){return _e(this,arguments,function*(){yield it(yield*Mr(Ne(pa(function*(p){let b=null;do b=p.next(yield b==null?void 0:b.value);while(!b.done)}(c[Symbol.iterator]())))))})},o=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof ya?r(t):Xe(t)?n(t):Le(t)?t:r(t);return yield it(yield*Mr(Ne(pa(function(c){return _e(this,arguments,function*(){let p=null;do p=yield it(c.next(yield yield it(rt(i,p))));while(!p.done)})}(o[Symbol.asyncIterator]()))))),yield it(new i)})}var zw=i=>Ge(Int8Array,i),Ww=i=>Ge(Int16Array,i),$w=i=>Ge(Int32Array,i),ma=i=>Ge(Uint8Array,i),Yw=i=>Ge(Uint16Array,i),Xw=i=>Ge(Uint32Array,i),Gw=i=>Ge(Float32Array,i),Kw=i=>Ge(Float64Array,i),Jw=i=>Ge(Uint8ClampedArray,i);function mn(i,t,e){if(i!==0){e=e.slice(0,t+1);for(let r=-1;++r<=t;)e[r]+=i}return e}function ba(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 Qt={fromIterable(i){return Bs(qw(i))},fromAsyncIterable(i){return Bs(Zw(i))},fromDOMStream(i){return Bs(Qw(i))},fromNodeStream(i){return Bs(tj(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')}},Bs=i=>(i.next(),i);function*qw(i){let t,e=!1,r=[],n,o,c,p=0;function b(){return o==="peek"?Be(r,c)[0]:([n,r,p]=Be(r,c),n)}({cmd:o,size:c}=yield null);let g=_a(i)[Symbol.iterator]();try{do if({done:t,value:n}=Number.isNaN(c-p)?g.next():g.next(c-p),!t&&n.byteLength>0&&(r.push(n),p+=n.byteLength),t||c<=p)do({cmd:o,size:c}=yield b());while(c<p);while(!t)}catch(A){(e=!0)&&typeof g.throw=="function"&&g.throw(A)}finally{e===!1&&typeof g.return=="function"&&g.return(null)}return null}function Zw(i){return _e(this,arguments,function*(){let e,r=!1,n=[],o,c,p,b=0;function g(){return c==="peek"?Be(n,p)[0]:([o,n,b]=Be(n,p),o)}({cmd:c,size:p}=yield yield it(null));let A=ma(i)[Symbol.asyncIterator]();try{do if({done:e,value:o}=Number.isNaN(p-b)?yield it(A.next()):yield it(A.next(p-b)),!e&&o.byteLength>0&&(n.push(o),b+=o.byteLength),e||p<=b)do({cmd:c,size:p}=yield yield it(g()));while(p<b);while(!e)}catch(T){(r=!0)&&typeof A.throw=="function"&&(yield it(A.throw(T)))}finally{r===!1&&typeof A.return=="function"&&(yield it(A.return(new Uint8Array(0))))}return yield it(null)})}function Qw(i){return _e(this,arguments,function*(){let e=!1,r=!1,n=[],o,c,p,b=0;function g(){return c==="peek"?Be(n,p)[0]:([o,n,b]=Be(n,p),o)}({cmd:c,size:p}=yield yield it(null));let A=new wa(i);try{do if({done:e,value:o}=Number.isNaN(p-b)?yield it(A.read()):yield it(A.read(p-b)),!e&&o.byteLength>0&&(n.push(Y(o)),b+=o.byteLength),e||p<=b)do({cmd:c,size:p}=yield yield it(g()));while(p<b);while(!e)}catch(T){(r=!0)&&(yield it(A.cancel(T)))}finally{r===!1?yield it(A.cancel()):i.locked&&A.releaseLock()}return yield it(null)})}var wa=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 O(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 O(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=Y(e)),e})}},ga=(i,t)=>{let e=n=>r([t,n]),r;return[t,e,new Promise(n=>(r=n)&&i.once(t,e))]};function tj(i){return _e(this,arguments,function*(){let e=[],r="error",n=!1,o=null,c,p,b=0,g=[],A;function T(){return c==="peek"?Be(g,p)[0]:([A,g,b]=Be(g,p),A)}if({cmd:c,size:p}=yield yield it(null),i.isTTY)return yield yield it(new Uint8Array(0)),yield it(null);try{e[0]=ga(i,"end"),e[1]=ga(i,"error");do{if(e[2]=ga(i,"readable"),[r,o]=yield it(Promise.race(e.map(k=>k[2]))),r==="error")break;if((n=r==="end")||(Number.isFinite(p-b)?(A=Y(i.read(p-b)),A.byteLength<p-b&&(A=Y(i.read()))):A=Y(i.read()),A.byteLength>0&&(g.push(A),b+=A.byteLength)),n||p<=b)do({cmd:c,size:p}=yield yield it(T()));while(p<b)}while(!n)}finally{yield it(F(e,r==="error"?o:null))}return yield it(null);function F(k,lt){return A=g=null,new Promise((ct,mt)=>{for(let[Dt,ae]of k)i.off(Dt,ae);try{let Dt=i.destroy;Dt&&Dt.call(i,lt),lt=void 0}catch(Dt){lt=Dt||lt}finally{lt!=null?mt(lt):ct()}})}})}var Wt;(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"})(Wt||(Wt={}));var Ft;(function(i){i[i.Sparse=0]="Sparse",i[i.Dense=1]="Dense"})(Ft||(Ft={}));var It;(function(i){i[i.HALF=0]="HALF",i[i.SINGLE=1]="SINGLE",i[i.DOUBLE=2]="DOUBLE"})(It||(It={}));var te;(function(i){i[i.DAY=0]="DAY",i[i.MILLISECOND=1]="MILLISECOND"})(te||(te={}));var ot;(function(i){i[i.SECOND=0]="SECOND",i[i.MILLISECOND=1]="MILLISECOND",i[i.MICROSECOND=2]="MICROSECOND",i[i.NANOSECOND=3]="NANOSECOND"})(ot||(ot={}));var ue;(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"})(ue||(ue={}));var ut;(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"})(ut||(ut={}));var C;(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.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"})(C||(C={}));var Pe;(function(i){i[i.OFFSET=0]="OFFSET",i[i.DATA=1]="DATA",i[i.VALIDITY=2]="VALIDITY",i[i.TYPE=3]="TYPE"})(Pe||(Pe={}));var Na={};pr(Na,{clampIndex:()=>Wj,clampRange:()=>gn,createElementComparator:()=>Zi});function Ke(i){if(i===null)return"null";if(i===void 0)return"undefined";switch(typeof i){case"number":return`${i}`;case"bigint":return`${i}`;case"string":return`"${i}"`}return typeof i[Symbol.toPrimitive]=="function"?i[Symbol.toPrimitive]("string"):ArrayBuffer.isView(i)?i instanceof BigInt64Array||i instanceof BigUint64Array?`[${[...i].map(t=>Ke(t))}]`:`[${i}]`:ArrayBuffer.isView(i)?`[${i}]`:JSON.stringify(i,(t,e)=>typeof e=="bigint"?`${e}`:e)}var Sa={};pr(Sa,{BN:()=>_r,bignumToBigInt:()=>Ts,bignumToString:()=>Ki,isArrowBigNumSymbol:()=>eh});var eh=Symbol.for("isArrowBigNum");function Je(i,...t){return t.length===0?Object.setPrototypeOf(rt(this.TypedArray,i),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(i,...t),this.constructor.prototype)}Je.prototype[eh]=!0;Je.prototype.toJSON=function(){return`"${Ki(this)}"`};Je.prototype.valueOf=function(){return ih(this)};Je.prototype.toString=function(){return Ki(this)};Je.prototype[Symbol.toPrimitive]=function(i="default"){switch(i){case"number":return ih(this);case"string":return Ki(this);case"default":return Ts(this)}return Ki(this)};function Nr(...i){return Je.apply(this,i)}function Lr(...i){return Je.apply(this,i)}function bn(...i){return Je.apply(this,i)}Object.setPrototypeOf(Nr.prototype,Object.create(Int32Array.prototype));Object.setPrototypeOf(Lr.prototype,Object.create(Uint32Array.prototype));Object.setPrototypeOf(bn.prototype,Object.create(Uint32Array.prototype));Object.assign(Nr.prototype,Je.prototype,{constructor:Nr,signed:!0,TypedArray:Int32Array,BigIntArray:yn});Object.assign(Lr.prototype,Je.prototype,{constructor:Lr,signed:!1,TypedArray:Uint32Array,BigIntArray:Rr});Object.assign(bn.prototype,Je.prototype,{constructor:bn,signed:!0,TypedArray:Uint32Array,BigIntArray:Rr});function ih(i){let{buffer:t,byteOffset:e,length:r,signed:n}=i,o=new Rr(t,e,r),c=n&&o[o.length-1]&BigInt(1)<<BigInt(63),p=BigInt(c?1:0),b=BigInt(0);if(c){for(let g of o)p+=~g*(BigInt(1)<<BigInt(32)*b++);p*=BigInt(-1)}else for(let g of o)p+=g*(BigInt(1)<<BigInt(32)*b++);return p}var Ki,Ts;js?(Ts=i=>i.byteLength===8?new i.BigIntArray(i.buffer,i.byteOffset,1)[0]:ja(i),Ki=i=>i.byteLength===8?`${new i.BigIntArray(i.buffer,i.byteOffset,1)[0]}`:ja(i)):(Ki=ja,Ts=Ki);function ja(i){let t="",e=new Uint32Array(2),r=new Uint16Array(i.buffer,i.byteOffset,i.byteLength/2),n=new Uint32Array((r=new Uint16Array(r).reverse()).buffer),o=-1,c=r.length-1;do{for(e[0]=r[o=0];o<c;)r[o++]=e[1]=e[0]/10,e[0]=(e[0]-e[1]*10<<16)+r[o];r[o]=e[1]=e[0]/10,e[0]=e[0]-e[1]*10,t=`${e[0]}${t}`}while(n[0]||n[1]||n[2]||n[3]);return t||"0"}var _r=class{static new(t,e){switch(e){case!0:return new Nr(t);case!1:return new Lr(t)}switch(t.constructor){case Int8Array:case Int16Array:case Int32Array:case yn:return new Nr(t)}return t.byteLength===16?new bn(t):new Lr(t)}static signed(t){return new Nr(t)}static unsigned(t){return new Lr(t)}static decimal(t){return new bn(t)}constructor(t,e){return _r.new(t,e)}};var rh,nh,sh,oh,ah,lh,ch,uh,dh,fh,hh,ph,yh,_h,mh,bh,vh,gh,wh,N=class{static isNull(t){return(t==null?void 0:t.typeId)===C.Null}static isInt(t){return(t==null?void 0:t.typeId)===C.Int}static isFloat(t){return(t==null?void 0:t.typeId)===C.Float}static isBinary(t){return(t==null?void 0:t.typeId)===C.Binary}static isUtf8(t){return(t==null?void 0:t.typeId)===C.Utf8}static isBool(t){return(t==null?void 0:t.typeId)===C.Bool}static isDecimal(t){return(t==null?void 0:t.typeId)===C.Decimal}static isDate(t){return(t==null?void 0:t.typeId)===C.Date}static isTime(t){return(t==null?void 0:t.typeId)===C.Time}static isTimestamp(t){return(t==null?void 0:t.typeId)===C.Timestamp}static isInterval(t){return(t==null?void 0:t.typeId)===C.Interval}static isList(t){return(t==null?void 0:t.typeId)===C.List}static isStruct(t){return(t==null?void 0:t.typeId)===C.Struct}static isUnion(t){return(t==null?void 0:t.typeId)===C.Union}static isFixedSizeBinary(t){return(t==null?void 0:t.typeId)===C.FixedSizeBinary}static isFixedSizeList(t){return(t==null?void 0:t.typeId)===C.FixedSizeList}static isMap(t){return(t==null?void 0:t.typeId)===C.Map}static isDictionary(t){return(t==null?void 0:t.typeId)===C.Dictionary}static isDenseUnion(t){return N.isUnion(t)&&t.mode===Ft.Dense}static isSparseUnion(t){return N.isUnion(t)&&t.mode===Ft.Sparse}get typeId(){return C.NONE}};rh=Symbol.toStringTag;N[rh]=(i=>(i.children=null,i.ArrayType=Array,i[Symbol.toStringTag]="DataType"))(N.prototype);var de=class extends N{toString(){return"Null"}get typeId(){return C.Null}};nh=Symbol.toStringTag;de[nh]=(i=>i[Symbol.toStringTag]="Null")(de.prototype);var Ot=class extends N{constructor(t,e){super(),this.isSigned=t,this.bitWidth=e}get typeId(){return C.Int}get ArrayType(){switch(this.bitWidth){case 8:return this.isSigned?Int8Array:Uint8Array;case 16:return this.isSigned?Int16Array:Uint16Array;case 32:return this.isSigned?Int32Array:Uint32Array;case 64:return this.isSigned?BigInt64Array:BigUint64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}};sh=Symbol.toStringTag;Ot[sh]=(i=>(i.isSigned=null,i.bitWidth=null,i[Symbol.toStringTag]="Int"))(Ot.prototype);var Ds=class extends Ot{constructor(){super(!0,8)}get ArrayType(){return Int8Array}},Es=class extends Ot{constructor(){super(!0,16)}get ArrayType(){return Int16Array}},ci=class extends Ot{constructor(){super(!0,32)}get ArrayType(){return Int32Array}},ks=class extends Ot{constructor(){super(!0,64)}get ArrayType(){return BigInt64Array}},Os=class extends Ot{constructor(){super(!1,8)}get ArrayType(){return Uint8Array}},Ms=class extends Ot{constructor(){super(!1,16)}get ArrayType(){return Uint16Array}},Rs=class extends Ot{constructor(){super(!1,32)}get ArrayType(){return Uint32Array}},Us=class extends Ot{constructor(){super(!1,64)}get ArrayType(){return BigUint64Array}};Object.defineProperty(Ds.prototype,"ArrayType",{value:Int8Array});Object.defineProperty(Es.prototype,"ArrayType",{value:Int16Array});Object.defineProperty(ci.prototype,"ArrayType",{value:Int32Array});Object.defineProperty(ks.prototype,"ArrayType",{value:BigInt64Array});Object.defineProperty(Os.prototype,"ArrayType",{value:Uint8Array});Object.defineProperty(Ms.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(Rs.prototype,"ArrayType",{value:Uint32Array});Object.defineProperty(Us.prototype,"ArrayType",{value:BigUint64Array});var me=class extends N{constructor(t){super(),this.precision=t}get typeId(){return C.Float}get ArrayType(){switch(this.precision){case It.HALF:return Uint16Array;case It.SINGLE:return Float32Array;case It.DOUBLE:return Float64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`Float${this.precision<<5||16}`}};oh=Symbol.toStringTag;me[oh]=(i=>(i.precision=null,i[Symbol.toStringTag]="Float"))(me.prototype);var Ns=class extends me{constructor(){super(It.HALF)}},Ls=class extends me{constructor(){super(It.SINGLE)}},Ps=class extends me{constructor(){super(It.DOUBLE)}};Object.defineProperty(Ns.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(Ls.prototype,"ArrayType",{value:Float32Array});Object.defineProperty(Ps.prototype,"ArrayType",{value:Float64Array});var Fi=class extends N{constructor(){super()}get typeId(){return C.Binary}toString(){return"Binary"}};ah=Symbol.toStringTag;Fi[ah]=(i=>(i.ArrayType=Uint8Array,i[Symbol.toStringTag]="Binary"))(Fi.prototype);var Bi=class extends N{constructor(){super()}get typeId(){return C.Utf8}toString(){return"Utf8"}};lh=Symbol.toStringTag;Bi[lh]=(i=>(i.ArrayType=Uint8Array,i[Symbol.toStringTag]="Utf8"))(Bi.prototype);var Ti=class extends N{constructor(){super()}get typeId(){return C.Bool}toString(){return"Bool"}};ch=Symbol.toStringTag;Ti[ch]=(i=>(i.ArrayType=Uint8Array,i[Symbol.toStringTag]="Bool"))(Ti.prototype);var Di=class extends N{constructor(t,e,r=128){super(),this.scale=t,this.precision=e,this.bitWidth=r}get typeId(){return C.Decimal}toString(){return`Decimal[${this.precision}e${this.scale>0?"+":""}${this.scale}]`}};uh=Symbol.toStringTag;Di[uh]=(i=>(i.scale=null,i.precision=null,i.ArrayType=Uint32Array,i[Symbol.toStringTag]="Decimal"))(Di.prototype);var Ei=class extends N{constructor(t){super(),this.unit=t}get typeId(){return C.Date}toString(){return`Date${(this.unit+1)*32}<${te[this.unit]}>`}};dh=Symbol.toStringTag;Ei[dh]=(i=>(i.unit=null,i.ArrayType=Int32Array,i[Symbol.toStringTag]="Date"))(Ei.prototype);var qe=class extends N{constructor(t,e){super(),this.unit=t,this.bitWidth=e}get typeId(){return C.Time}toString(){return`Time${this.bitWidth}<${ot[this.unit]}>`}get ArrayType(){switch(this.bitWidth){case 32:return Int32Array;case 64:return BigInt64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}};fh=Symbol.toStringTag;qe[fh]=(i=>(i.unit=null,i.bitWidth=null,i[Symbol.toStringTag]="Time"))(qe.prototype);var ki=class extends N{constructor(t,e){super(),this.unit=t,this.timezone=e}get typeId(){return C.Timestamp}toString(){return`Timestamp<${ot[this.unit]}${this.timezone?`, ${this.timezone}`:""}>`}};hh=Symbol.toStringTag;ki[hh]=(i=>(i.unit=null,i.timezone=null,i.ArrayType=Int32Array,i[Symbol.toStringTag]="Timestamp"))(ki.prototype);var Oi=class extends N{constructor(t){super(),this.unit=t}get typeId(){return C.Interval}toString(){return`Interval<${ue[this.unit]}>`}};ph=Symbol.toStringTag;Oi[ph]=(i=>(i.unit=null,i.ArrayType=Int32Array,i[Symbol.toStringTag]="Interval"))(Oi.prototype);var Ze=class extends N{constructor(t){super(),this.children=[t]}get typeId(){return C.List}toString(){return`List<${this.valueType}>`}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}};yh=Symbol.toStringTag;Ze[yh]=(i=>(i.children=null,i[Symbol.toStringTag]="List"))(Ze.prototype);var gt=class extends N{constructor(t){super(),this.children=t}get typeId(){return C.Struct}toString(){return`Struct<{${this.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}};_h=Symbol.toStringTag;gt[_h]=(i=>(i.children=null,i[Symbol.toStringTag]="Struct"))(gt.prototype);var Qe=class extends N{constructor(t,e,r){super(),this.mode=t,this.children=r,this.typeIds=e=Int32Array.from(e),this.typeIdToChildIndex=e.reduce((n,o,c)=>(n[o]=c)&&n||n,Object.create(null))}get typeId(){return C.Union}toString(){return`${this[Symbol.toStringTag]}<${this.children.map(t=>`${t.type}`).join(" | ")}>`}};mh=Symbol.toStringTag;Qe[mh]=(i=>(i.mode=null,i.typeIds=null,i.children=null,i.typeIdToChildIndex=null,i.ArrayType=Int8Array,i[Symbol.toStringTag]="Union"))(Qe.prototype);var Mi=class extends N{constructor(t){super(),this.byteWidth=t}get typeId(){return C.FixedSizeBinary}toString(){return`FixedSizeBinary[${this.byteWidth}]`}};bh=Symbol.toStringTag;Mi[bh]=(i=>(i.byteWidth=null,i.ArrayType=Uint8Array,i[Symbol.toStringTag]="FixedSizeBinary"))(Mi.prototype);var ti=class extends N{constructor(t,e){super(),this.listSize=t,this.children=[e]}get typeId(){return C.FixedSizeList}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}toString(){return`FixedSizeList[${this.listSize}]<${this.valueType}>`}};vh=Symbol.toStringTag;ti[vh]=(i=>(i.children=null,i.listSize=null,i[Symbol.toStringTag]="FixedSizeList"))(ti.prototype);var ei=class extends N{constructor(t,e=!1){super(),this.children=[t],this.keysSorted=e}get typeId(){return C.Map}get keyType(){return this.children[0].type.children[0].type}get valueType(){return this.children[0].type.children[1].type}get childType(){return this.children[0].type}toString(){return`Map<{${this.children[0].type.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}};gh=Symbol.toStringTag;ei[gh]=(i=>(i.children=null,i.keysSorted=null,i[Symbol.toStringTag]="Map_"))(ei.prototype);var ej=(i=>()=>++i)(-1),Te=class extends N{constructor(t,e,r,n){super(),this.indices=e,this.dictionary=t,this.isOrdered=n||!1,this.id=r==null?ej():typeof r=="number"?r:r.low}get typeId(){return C.Dictionary}get children(){return this.dictionary.children}get valueType(){return this.dictionary}get ArrayType(){return this.dictionary.ArrayType}toString(){return`Dictionary<${this.indices}, ${this.dictionary}>`}};wh=Symbol.toStringTag;Te[wh]=(i=>(i.id=null,i.indices=null,i.isOrdered=null,i.dictionary=null,i[Symbol.toStringTag]="Dictionary"))(Te.prototype);function De(i){let t=i;switch(i.typeId){case C.Decimal:return i.bitWidth/32;case C.Timestamp:return 2;case C.Date:return 1+t.unit;case C.Interval:return 1+t.unit;case C.FixedSizeList:return t.listSize;case C.FixedSizeBinary:return t.byteWidth;default:return 1}}var V=class{visitMany(t,...e){return t.map((r,n)=>this.visit(r,...e.map(o=>o[n])))}visit(...t){return this.getVisitFn(t[0],!1).apply(this,t)}getVisitFn(t,e=!0){return ij(this,t,e)}getVisitFnByTypeId(t,e=!0){return Pr(this,t,e)}visitNull(t,...e){return null}visitBool(t,...e){return null}visitInt(t,...e){return null}visitFloat(t,...e){return null}visitUtf8(t,...e){return null}visitBinary(t,...e){return null}visitFixedSizeBinary(t,...e){return null}visitDate(t,...e){return null}visitTimestamp(t,...e){return null}visitTime(t,...e){return null}visitDecimal(t,...e){return null}visitList(t,...e){return null}visitStruct(t,...e){return null}visitUnion(t,...e){return null}visitDictionary(t,...e){return null}visitInterval(t,...e){return null}visitFixedSizeList(t,...e){return null}visitMap(t,...e){return null}};function ij(i,t,e=!0){return typeof t=="number"?Pr(i,t,e):typeof t=="string"&&t in C?Pr(i,C[t],e):t&&t instanceof N?Pr(i,jh(t),e):(t==null?void 0:t.type)&&t.type instanceof N?Pr(i,jh(t.type),e):Pr(i,C.NONE,e)}function Pr(i,t,e=!0){let r=null;switch(t){case C.Null:r=i.visitNull;break;case C.Bool:r=i.visitBool;break;case C.Int:r=i.visitInt;break;case C.Int8:r=i.visitInt8||i.visitInt;break;case C.Int16:r=i.visitInt16||i.visitInt;break;case C.Int32:r=i.visitInt32||i.visitInt;break;case C.Int64:r=i.visitInt64||i.visitInt;break;case C.Uint8:r=i.visitUint8||i.visitInt;break;case C.Uint16:r=i.visitUint16||i.visitInt;break;case C.Uint32:r=i.visitUint32||i.visitInt;break;case C.Uint64:r=i.visitUint64||i.visitInt;break;case C.Float:r=i.visitFloat;break;case C.Float16:r=i.visitFloat16||i.visitFloat;break;case C.Float32:r=i.visitFloat32||i.visitFloat;break;case C.Float64:r=i.visitFloat64||i.visitFloat;break;case C.Utf8:r=i.visitUtf8;break;case C.Binary:r=i.visitBinary;break;case C.FixedSizeBinary:r=i.visitFixedSizeBinary;break;case C.Date:r=i.visitDate;break;case C.DateDay:r=i.visitDateDay||i.visitDate;break;case C.DateMillisecond:r=i.visitDateMillisecond||i.visitDate;break;case C.Timestamp:r=i.visitTimestamp;break;case C.TimestampSecond:r=i.visitTimestampSecond||i.visitTimestamp;break;case C.TimestampMillisecond:r=i.visitTimestampMillisecond||i.visitTimestamp;break;case C.TimestampMicrosecond:r=i.visitTimestampMicrosecond||i.visitTimestamp;break;case C.TimestampNanosecond:r=i.visitTimestampNanosecond||i.visitTimestamp;break;case C.Time:r=i.visitTime;break;case C.TimeSecond:r=i.visitTimeSecond||i.visitTime;break;case C.TimeMillisecond:r=i.visitTimeMillisecond||i.visitTime;break;case C.TimeMicrosecond:r=i.visitTimeMicrosecond||i.visitTime;break;case C.TimeNanosecond:r=i.visitTimeNanosecond||i.visitTime;break;case C.Decimal:r=i.visitDecimal;break;case C.List:r=i.visitList;break;case C.Struct:r=i.visitStruct;break;case C.Union:r=i.visitUnion;break;case C.DenseUnion:r=i.visitDenseUnion||i.visitUnion;break;case C.SparseUnion:r=i.visitSparseUnion||i.visitUnion;break;case C.Dictionary:r=i.visitDictionary;break;case C.Interval:r=i.visitInterval;break;case C.IntervalDayTime:r=i.visitIntervalDayTime||i.visitInterval;break;case C.IntervalYearMonth:r=i.visitIntervalYearMonth||i.visitInterval;break;case C.FixedSizeList:r=i.visitFixedSizeList;break;case C.Map:r=i.visitMap;break}if(typeof r=="function")return r;if(!e)return()=>null;throw new Error(`Unrecognized type '${C[t]}'`)}function jh(i){switch(i.typeId){case C.Null:return C.Null;case C.Int:{let{bitWidth:t,isSigned:e}=i;switch(t){case 8:return e?C.Int8:C.Uint8;case 16:return e?C.Int16:C.Uint16;case 32:return e?C.Int32:C.Uint32;case 64:return e?C.Int64:C.Uint64}return C.Int}case C.Float:switch(i.precision){case It.HALF:return C.Float16;case It.SINGLE:return C.Float32;case It.DOUBLE:return C.Float64}return C.Float;case C.Binary:return C.Binary;case C.Utf8:return C.Utf8;case C.Bool:return C.Bool;case C.Decimal:return C.Decimal;case C.Time:switch(i.unit){case ot.SECOND:return C.TimeSecond;case ot.MILLISECOND:return C.TimeMillisecond;case ot.MICROSECOND:return C.TimeMicrosecond;case ot.NANOSECOND:return C.TimeNanosecond}return C.Time;case C.Timestamp:switch(i.unit){case ot.SECOND:return C.TimestampSecond;case ot.MILLISECOND:return C.TimestampMillisecond;case ot.MICROSECOND:return C.TimestampMicrosecond;case ot.NANOSECOND:return C.TimestampNanosecond}return C.Timestamp;case C.Date:switch(i.unit){case te.DAY:return C.DateDay;case te.MILLISECOND:return C.DateMillisecond}return C.Date;case C.Interval:switch(i.unit){case ue.DAY_TIME:return C.IntervalDayTime;case ue.YEAR_MONTH:return C.IntervalYearMonth}return C.Interval;case C.Map:return C.Map;case C.List:return C.List;case C.Struct:return C.Struct;case C.Union:switch(i.mode){case Ft.Dense:return C.DenseUnion;case Ft.Sparse:return C.SparseUnion}return C.Union;case C.FixedSizeBinary:return C.FixedSizeBinary;case C.FixedSizeList:return C.FixedSizeList;case C.Dictionary:return C.Dictionary}throw new Error(`Unrecognized type '${C[i.typeId]}'`)}V.prototype.visitInt8=null;V.prototype.visitInt16=null;V.prototype.visitInt32=null;V.prototype.visitInt64=null;V.prototype.visitUint8=null;V.prototype.visitUint16=null;V.prototype.visitUint32=null;V.prototype.visitUint64=null;V.prototype.visitFloat16=null;V.prototype.visitFloat32=null;V.prototype.visitFloat64=null;V.prototype.visitDateDay=null;V.prototype.visitDateMillisecond=null;V.prototype.visitTimestampSecond=null;V.prototype.visitTimestampMillisecond=null;V.prototype.visitTimestampMicrosecond=null;V.prototype.visitTimestampNanosecond=null;V.prototype.visitTimeSecond=null;V.prototype.visitTimeMillisecond=null;V.prototype.visitTimeMicrosecond=null;V.prototype.visitTimeNanosecond=null;V.prototype.visitDenseUnion=null;V.prototype.visitSparseUnion=null;V.prototype.visitIntervalDayTime=null;V.prototype.visitIntervalYearMonth=null;var Ia={};pr(Ia,{float64ToUint16:()=>vn,uint16ToFloat64:()=>Vs});var Sh=new Float64Array(1),Vr=new Uint32Array(Sh.buffer);function Vs(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 vn(i){if(i!==i)return 32256;Sh[0]=i;let t=(Vr[1]&2147483648)>>16&65535,e=Vr[1]&2146435072,r=0;return e>=1089470464?Vr[0]>0?e=31744:(e=(e&2080374784)>>16,r=(Vr[1]&1048575)>>10):e<=1056964608?(r=1048576+(Vr[1]&1048575),r=1048576+(r<<(e>>20)-998)>>21,e=0):(e=e-1056964608>>10,r=(Vr[1]&1048575)+512>>10),t|e|r&65535}var X=class extends V{};function et(i){return(t,e,r)=>{if(t.setValid(e,r!=null))return i(t,e,r)}}var rj=(i,t,e)=>{i[t]=Math.trunc(e/864e5)},Ca=(i,t,e)=>{i[t]=Math.trunc(e%4294967296),i[t+1]=Math.trunc(e/4294967296)},nj=(i,t,e)=>{i[t]=Math.trunc(e*1e3%4294967296),i[t+1]=Math.trunc(e*1e3/4294967296)},sj=(i,t,e)=>{i[t]=Math.trunc(e*1e6%4294967296),i[t+1]=Math.trunc(e*1e6/4294967296)},Ih=(i,t,e,r)=>{if(e+1<t.length){let{[e]:n,[e+1]:o}=t;i.set(r.subarray(0,o-n),n)}},oj=({offset:i,values:t},e,r)=>{let n=i+e;r?t[n>>3]|=1<<n%8:t[n>>3]&=~(1<<n%8)},Ri=({values:i},t,e)=>{i[t]=e},Aa=({values:i},t,e)=>{i[t]=e},Ch=({values:i},t,e)=>{i[t]=vn(e)},aj=(i,t,e)=>{switch(i.type.precision){case It.HALF:return Ch(i,t,e);case It.SINGLE:case It.DOUBLE:return Aa(i,t,e)}},Hs=({values:i},t,e)=>{rj(i,t,e.valueOf())},zs=({values:i},t,e)=>{Ca(i,t*2,e.valueOf())},xa=({stride:i,values:t},e,r)=>{t.set(r.subarray(0,i),i*e)},lj=({values:i,valueOffsets:t},e,r)=>Ih(i,t,e,r),cj=({values:i,valueOffsets:t},e,r)=>{Ih(i,t,e,Gi(r))},Fa=(i,t,e)=>{i.type.unit===te.DAY?Hs(i,t,e):zs(i,t,e)},Ws=({values:i},t,e)=>Ca(i,t*2,e/1e3),$s=({values:i},t,e)=>Ca(i,t*2,e),Ys=({values:i},t,e)=>nj(i,t*2,e),Xs=({values:i},t,e)=>sj(i,t*2,e),Ba=(i,t,e)=>{switch(i.type.unit){case ot.SECOND:return Ws(i,t,e);case ot.MILLISECOND:return $s(i,t,e);case ot.MICROSECOND:return Ys(i,t,e);case ot.NANOSECOND:return Xs(i,t,e)}},Gs=({values:i},t,e)=>{i[t]=e},Ks=({values:i},t,e)=>{i[t]=e},Js=({values:i},t,e)=>{i[t]=e},qs=({values:i},t,e)=>{i[t]=e},Ta=(i,t,e)=>{switch(i.type.unit){case ot.SECOND:return Gs(i,t,e);case ot.MILLISECOND:return Ks(i,t,e);case ot.MICROSECOND:return Js(i,t,e);case ot.NANOSECOND:return qs(i,t,e)}},Da=({values:i,stride:t},e,r)=>{i.set(r.subarray(0,t),t*e)},uj=(i,t,e)=>{let r=i.children[0],n=i.valueOffsets,o=ee.getVisitFn(r);if(Array.isArray(e))for(let c=-1,p=n[t],b=n[t+1];p<b;)o(r,p++,e[++c]);else for(let c=-1,p=n[t],b=n[t+1];p<b;)o(r,p++,e.get(++c))},dj=(i,t,e)=>{let r=i.children[0],{valueOffsets:n}=i,o=ee.getVisitFn(r),{[t]:c,[t+1]:p}=n,b=e instanceof Map?e.entries():Object.entries(e);for(let g of b)if(o(r,c,g),++c>=p)break},fj=(i,t)=>(e,r,n,o)=>r&&e(r,i,t[o]),hj=(i,t)=>(e,r,n,o)=>r&&e(r,i,t.get(o)),pj=(i,t)=>(e,r,n,o)=>r&&e(r,i,t.get(n.name)),yj=(i,t)=>(e,r,n,o)=>r&&e(r,i,t[n.name]),_j=(i,t,e)=>{let r=i.type.children.map(o=>ee.getVisitFn(o.type)),n=e instanceof Map?pj(t,e):e instanceof G?hj(t,e):Array.isArray(e)?fj(t,e):yj(t,e);i.type.children.forEach((o,c)=>n(r[c],i.children[c],o,c))},mj=(i,t,e)=>{i.type.mode===Ft.Dense?Ah(i,t,e):xh(i,t,e)},Ah=(i,t,e)=>{let r=i.type.typeIdToChildIndex[i.typeIds[t]],n=i.children[r];ee.visit(n,i.valueOffsets[t],e)},xh=(i,t,e)=>{let r=i.type.typeIdToChildIndex[i.typeIds[t]],n=i.children[r];ee.visit(n,t,e)},bj=(i,t,e)=>{var r;(r=i.dictionary)===null||r===void 0||r.set(i.values[t],e)},Ea=(i,t,e)=>{i.type.unit===ue.DAY_TIME?Zs(i,t,e):Qs(i,t,e)},Zs=({values:i},t,e)=>{i.set(e.subarray(0,2),2*t)},Qs=({values:i},t,e)=>{i[t]=e[0]*12+e[1]%12},vj=(i,t,e)=>{let{stride:r}=i,n=i.children[0],o=ee.getVisitFn(n);if(Array.isArray(e))for(let c=-1,p=t*r;++c<r;)o(n,p+c,e[c]);else for(let c=-1,p=t*r;++c<r;)o(n,p+c,e.get(c))};X.prototype.visitBool=et(oj);X.prototype.visitInt=et(Ri);X.prototype.visitInt8=et(Ri);X.prototype.visitInt16=et(Ri);X.prototype.visitInt32=et(Ri);X.prototype.visitInt64=et(Ri);X.prototype.visitUint8=et(Ri);X.prototype.visitUint16=et(Ri);X.prototype.visitUint32=et(Ri);X.prototype.visitUint64=et(Ri);X.prototype.visitFloat=et(aj);X.prototype.visitFloat16=et(Ch);X.prototype.visitFloat32=et(Aa);X.prototype.visitFloat64=et(Aa);X.prototype.visitUtf8=et(cj);X.prototype.visitBinary=et(lj);X.prototype.visitFixedSizeBinary=et(xa);X.prototype.visitDate=et(Fa);X.prototype.visitDateDay=et(Hs);X.prototype.visitDateMillisecond=et(zs);X.prototype.visitTimestamp=et(Ba);X.prototype.visitTimestampSecond=et(Ws);X.prototype.visitTimestampMillisecond=et($s);X.prototype.visitTimestampMicrosecond=et(Ys);X.prototype.visitTimestampNanosecond=et(Xs);X.prototype.visitTime=et(Ta);X.prototype.visitTimeSecond=et(Gs);X.prototype.visitTimeMillisecond=et(Ks);X.prototype.visitTimeMicrosecond=et(Js);X.prototype.visitTimeNanosecond=et(qs);X.prototype.visitDecimal=et(Da);X.prototype.visitList=et(uj);X.prototype.visitStruct=et(_j);X.prototype.visitUnion=et(mj);X.prototype.visitDenseUnion=et(Ah);X.prototype.visitSparseUnion=et(xh);X.prototype.visitDictionary=et(bj);X.prototype.visitInterval=et(Ea);X.prototype.visitIntervalDayTime=et(Zs);X.prototype.visitIntervalYearMonth=et(Qs);X.prototype.visitFixedSizeList=et(vj);X.prototype.visitMap=et(dj);var ee=new X;var ii=Symbol.for("parent"),Hr=Symbol.for("rowIndex"),Ji=class{constructor(t,e){return this[ii]=t,this[Hr]=e,new Proxy(this,new Oa)}toArray(){return Object.values(this.toJSON())}toJSON(){let t=this[Hr],e=this[ii],r=e.type.children,n={};for(let o=-1,c=r.length;++o<c;)n[r[o].name]=Ut.visit(e.children[o],t);return n}toString(){return`{${[...this].map(([t,e])=>`${Ke(t)}: ${Ke(e)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}[Symbol.iterator](){return new ka(this[ii],this[Hr])}},ka=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,Ut.visit(this.children[t],this.rowIndex)]}):{done:!0,value:null}}};Object.defineProperties(Ji.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[ii]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Hr]:{writable:!0,enumerable:!1,configurable:!1,value:-1}});var Oa=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(t){return t[ii].type.children.map(e=>e.name)}has(t,e){return t[ii].type.children.findIndex(r=>r.name===e)!==-1}getOwnPropertyDescriptor(t,e){if(t[ii].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[ii].type.children.findIndex(n=>n.name===e);if(r!==-1){let n=Ut.visit(t[ii].children[r],t[Hr]);return Reflect.set(t,e,n),n}}set(t,e,r){let n=t[ii].type.children.findIndex(o=>o.name===e);return n!==-1?(ee.visit(t[ii].children[n],t[Hr],r),Reflect.set(t,e,r)):Reflect.has(t,e)||typeof e=="symbol"?Reflect.set(t,e,r):!1}};var H=class extends V{};function q(i){return(t,e)=>t.getValid(e)?i(t,e):null}var gj=(i,t)=>864e5*i[t],Ma=(i,t)=>4294967296*i[t+1]+(i[t]>>>0),wj=(i,t)=>4294967296*(i[t+1]/1e3)+(i[t]>>>0)/1e3,jj=(i,t)=>4294967296*(i[t+1]/1e6)+(i[t]>>>0)/1e6,Fh=i=>new Date(i),Sj=(i,t)=>Fh(gj(i,t)),Ij=(i,t)=>Fh(Ma(i,t)),Cj=(i,t)=>null,Bh=(i,t,e)=>{if(e+1>=t.length)return null;let r=t[e],n=t[e+1];return i.subarray(r,n)},Aj=({offset:i,values:t},e)=>{let r=i+e;return(t[r>>3]&1<<r%8)!==0},Th=({values:i},t)=>Sj(i,t),Dh=({values:i},t)=>Ij(i,t*2),qi=({stride:i,values:t},e)=>t[i*e],xj=({stride:i,values:t},e)=>Vs(t[i*e]),Eh=({values:i},t)=>i[t],Fj=({stride:i,values:t},e)=>t.subarray(i*e,i*(e+1)),Bj=({values:i,valueOffsets:t},e)=>Bh(i,t,e),Tj=({values:i,valueOffsets:t},e)=>{let r=Bh(i,t,e);return r!==null?pn(r):null},Dj=({values:i},t)=>i[t],Ej=({type:i,values:t},e)=>i.precision!==It.HALF?t[e]:Vs(t[e]),kj=(i,t)=>i.type.unit===te.DAY?Th(i,t):Dh(i,t),kh=({values:i},t)=>1e3*Ma(i,t*2),Oh=({values:i},t)=>Ma(i,t*2),Mh=({values:i},t)=>wj(i,t*2),Rh=({values:i},t)=>jj(i,t*2),Oj=(i,t)=>{switch(i.type.unit){case ot.SECOND:return kh(i,t);case ot.MILLISECOND:return Oh(i,t);case ot.MICROSECOND:return Mh(i,t);case ot.NANOSECOND:return Rh(i,t)}},Uh=({values:i},t)=>i[t],Nh=({values:i},t)=>i[t],Lh=({values:i},t)=>i[t],Ph=({values:i},t)=>i[t],Mj=(i,t)=>{switch(i.type.unit){case ot.SECOND:return Uh(i,t);case ot.MILLISECOND:return Nh(i,t);case ot.MICROSECOND:return Lh(i,t);case ot.NANOSECOND:return Ph(i,t)}},Rj=({values:i,stride:t},e)=>_r.decimal(i.subarray(t*e,t*(e+1))),Uj=(i,t)=>{let{valueOffsets:e,stride:r,children:n}=i,{[t*r]:o,[t*r+1]:c}=e,b=n[0].slice(o,c-o);return new G([b])},Nj=(i,t)=>{let{valueOffsets:e,children:r}=i,{[t]:n,[t+1]:o}=e,c=r[0];return new ui(c.slice(n,o-n))},Lj=(i,t)=>new Ji(i,t),Pj=(i,t)=>i.type.mode===Ft.Dense?Vh(i,t):Hh(i,t),Vh=(i,t)=>{let e=i.type.typeIdToChildIndex[i.typeIds[t]],r=i.children[e];return Ut.visit(r,i.valueOffsets[t])},Hh=(i,t)=>{let e=i.type.typeIdToChildIndex[i.typeIds[t]],r=i.children[e];return Ut.visit(r,t)},Vj=(i,t)=>{var e;return(e=i.dictionary)===null||e===void 0?void 0:e.get(i.values[t])},Hj=(i,t)=>i.type.unit===ue.DAY_TIME?zh(i,t):Wh(i,t),zh=({values:i},t)=>i.subarray(2*t,2*(t+1)),Wh=({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},zj=(i,t)=>{let{stride:e,children:r}=i,o=r[0].slice(t*e,e);return new G([o])};H.prototype.visitNull=q(Cj);H.prototype.visitBool=q(Aj);H.prototype.visitInt=q(Dj);H.prototype.visitInt8=q(qi);H.prototype.visitInt16=q(qi);H.prototype.visitInt32=q(qi);H.prototype.visitInt64=q(Eh);H.prototype.visitUint8=q(qi);H.prototype.visitUint16=q(qi);H.prototype.visitUint32=q(qi);H.prototype.visitUint64=q(Eh);H.prototype.visitFloat=q(Ej);H.prototype.visitFloat16=q(xj);H.prototype.visitFloat32=q(qi);H.prototype.visitFloat64=q(qi);H.prototype.visitUtf8=q(Tj);H.prototype.visitBinary=q(Bj);H.prototype.visitFixedSizeBinary=q(Fj);H.prototype.visitDate=q(kj);H.prototype.visitDateDay=q(Th);H.prototype.visitDateMillisecond=q(Dh);H.prototype.visitTimestamp=q(Oj);H.prototype.visitTimestampSecond=q(kh);H.prototype.visitTimestampMillisecond=q(Oh);H.prototype.visitTimestampMicrosecond=q(Mh);H.prototype.visitTimestampNanosecond=q(Rh);H.prototype.visitTime=q(Mj);H.prototype.visitTimeSecond=q(Uh);H.prototype.visitTimeMillisecond=q(Nh);H.prototype.visitTimeMicrosecond=q(Lh);H.prototype.visitTimeNanosecond=q(Ph);H.prototype.visitDecimal=q(Rj);H.prototype.visitList=q(Uj);H.prototype.visitStruct=q(Lj);H.prototype.visitUnion=q(Pj);H.prototype.visitDenseUnion=q(Vh);H.prototype.visitSparseUnion=q(Hh);H.prototype.visitDictionary=q(Vj);H.prototype.visitInterval=q(Hj);H.prototype.visitIntervalDayTime=q(zh);H.prototype.visitIntervalYearMonth=q(Wh);H.prototype.visitFixedSizeList=q(zj);H.prototype.visitMap=q(Nj);var Ut=new H;var Ve=Symbol.for("keys"),zr=Symbol.for("vals"),ui=class{constructor(t){return this[Ve]=new G([t.children[0]]).memoize(),this[zr]=t.children[1],new Proxy(this,new Ua)}[Symbol.iterator](){return new Ra(this[Ve],this[zr])}get size(){return this[Ve].length}toArray(){return Object.values(this.toJSON())}toJSON(){let t=this[Ve],e=this[zr],r={};for(let n=-1,o=t.length;++n<o;)r[t.get(n)]=Ut.visit(e,n);return r}toString(){return`{${[...this].map(([t,e])=>`${Ke(t)}: ${Ke(e)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}},Ra=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),Ut.visit(this.vals,t)]})}},Ua=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(t){return t[Ve].toArray().map(String)}has(t,e){return t[Ve].includes(e)}getOwnPropertyDescriptor(t,e){if(t[Ve].indexOf(e)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(t,e){if(Reflect.has(t,e))return t[e];let r=t[Ve].indexOf(e);if(r!==-1){let n=Ut.visit(Reflect.get(t,zr),r);return Reflect.set(t,e,n),n}}set(t,e,r){let n=t[Ve].indexOf(e);return n!==-1?(ee.visit(Reflect.get(t,zr),n,r),Reflect.set(t,e,r)):Reflect.has(t,e)?Reflect.set(t,e,r):!1}};Object.defineProperties(ui.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[Ve]:{writable:!0,enumerable:!1,configurable:!1,value:null},[zr]:{writable:!0,enumerable:!1,configurable:!1,value:null}});function Wj(i,t,e){let r=i.length,n=t>-1?t:r+t%r;return e?e(i,n):n}var $h;function gn(i,t,e,r){let{length:n=0}=i,o=typeof t!="number"?0:t,c=typeof e!="number"?n:e;return o<0&&(o=(o%n+n)%n),c<0&&(c=(c%n+n)%n),c<o&&($h=o,o=c,c=$h),c>n&&(c=n),r?r(i,o,c):[o,c]}var Yh=i=>i!==i;function Zi(i){if(typeof i!=="object"||i===null)return Yh(i)?Yh: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?ba(i,e):!1:i instanceof Map?Yj(i):Array.isArray(i)?$j(i):i instanceof G?Xj(i):Gj(i,!0)}function $j(i){let t=[];for(let e=-1,r=i.length;++e<r;)t[e]=Zi(i[e]);return to(t)}function Yj(i){let t=-1,e=[];for(let r of i.values())e[++t]=Zi(r);return to(e)}function Xj(i){let t=[];for(let e=-1,r=i.length;++e<r;)t[e]=Zi(i.get(e));return to(t)}function Gj(i,t=!1){let e=Object.keys(i);if(!t&&e.length===0)return()=>!1;let r=[];for(let n=-1,o=e.length;++n<o;)r[n]=Zi(i[e[n]]);return to(r,e)}function to(i,t){return e=>{if(!e||typeof e!="object")return!1;switch(e.constructor){case Array:return Kj(i,e);case Map:return Xh(i,e,e.keys());case ui:case Ji:case Object:case void 0:return Xh(i,e,t||Object.keys(e))}return e instanceof G?Jj(i,e):!1}}function Kj(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 Jj(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 Xh(i,t,e){let r=e[Symbol.iterator](),n=t instanceof Map?t.keys():Object.keys(t)[Symbol.iterator](),o=t instanceof Map?t.values():Object.values(t)[Symbol.iterator](),c=0,p=i.length,b=o.next(),g=r.next(),A=n.next();for(;c<p&&!g.done&&!A.done&&!b.done&&!(g.value!==A.value||!i[c](b.value));++c,g=r.next(),A=n.next(),b=o.next());return c===p&&g.done&&A.done&&b.done?!0:(r.return&&r.return(),n.return&&n.return(),o.return&&o.return(),!1)}var La={};pr(La,{BitIterator:()=>mr,getBit:()=>Gh,getBool:()=>io,packBools:()=>br,popcnt_array:()=>Kh,popcnt_bit_range:()=>wn,popcnt_uint32:()=>eo,setBool:()=>qj,truncateBitmap:()=>Wr});function io(i,t,e,r){return(e&1<<r)!==0}function Gh(i,t,e,r){return(e&1<<r)>>r}function qj(i,t,e){return e?!!(i[t>>3]|=1<<t%8)||!0:!(i[t>>3]&=~(1<<t%8))&&!1}function Wr(i,t,e){let r=e.byteLength+7&-8;if(i>0||e.byteLength<r){let n=new Uint8Array(r);return n.set(i%8===0?e.subarray(i>>3):br(new mr(e,i,t,null,io)).subarray(0,r)),n}return e}function br(i){let t=[],e=0,r=0,n=0;for(let c of i)c&&(n|=1<<r),++r===8&&(t[e++]=n,n=r=0);(e===0||r>0)&&(t[e++]=n);let o=new Uint8Array(t.length+7&-8);return o.set(t),o}var mr=class{constructor(t,e,r,n,o){this.bytes=t,this.length=r,this.context=n,this.get=o,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 wn(i,t,e){if(e-t<=0)return 0;if(e-t<8){let o=0;for(let c of new mr(i,t,e-t,i,Gh))o+=c;return o}let r=e>>3<<3,n=t+(t%8===0?0:8-t%8);return wn(i,t,n)+wn(i,r,e)+Kh(i,n>>3,r-n>>3)}function Kh(i,t,e){let r=0,n=Math.trunc(t),o=new DataView(i.buffer,i.byteOffset,i.byteLength),c=e===void 0?i.byteLength:n+e;for(;c-n>=4;)r+=eo(o.getUint32(n)),n+=4;for(;c-n>=2;)r+=eo(o.getUint16(n)),n+=2;for(;c-n>=1;)r+=eo(o.getUint8(n)),n+=1;return r}function eo(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 Zj=-1,dt=class{constructor(t,e,r,n,o,c=[],p){this.type=t,this.children=c,this.dictionary=p,this.offset=Math.floor(Math.max(e||0,0)),this.length=Math.floor(Math.max(r||0,0)),this._nullCount=Math.floor(Math.max(n||0,-1));let b;o instanceof dt?(this.stride=o.stride,this.values=o.values,this.typeIds=o.typeIds,this.nullBitmap=o.nullBitmap,this.valueOffsets=o.valueOffsets):(this.stride=De(t),o&&((b=o[0])&&(this.valueOffsets=b),(b=o[1])&&(this.values=b),(b=o[2])&&(this.nullBitmap=b),(b=o[3])&&(this.typeIds=b))),this.nullable=this._nullCount!==0&&this.nullBitmap&&this.nullBitmap.byteLength>0}get typeId(){return this.type.typeId}get ArrayType(){return this.type.ArrayType}get buffers(){return[this.valueOffsets,this.values,this.nullBitmap,this.typeIds]}get byteLength(){let t=0,{valueOffsets:e,values:r,nullBitmap:n,typeIds:o}=this;return e&&(t+=e.byteLength),r&&(t+=r.byteLength),n&&(t+=n.byteLength),o&&(t+=o.byteLength),this.children.reduce((c,p)=>c+p.byteLength,t)}get nullCount(){let t=this._nullCount,e;return t<=Zj&&(e=this.nullBitmap)&&(this._nullCount=t=this.length-wn(e,this.offset,this.offset+this.length)),t}getValid(t){if(this.nullable&&this.nullCount>0){let e=this.offset+t;return(this.nullBitmap[e>>3]&1<<e%8)!==0}return!0}setValid(t,e){if(!this.nullable)return e;if(!this.nullBitmap||this.nullBitmap.byteLength<=t>>3){let{nullBitmap:b}=this._changeLengthAndBackfillNullBitmap(this.length);Object.assign(this,{nullBitmap:b,_nullCount:0})}let{nullBitmap:r,offset:n}=this,o=n+t>>3,c=(n+t)%8,p=r[o]>>c&1;return e?p===0&&(r[o]|=1<<c,this._nullCount=this.nullCount+1):p===1&&(r[o]&=~(1<<c),this._nullCount=this.nullCount-1),e}clone(t=this.type,e=this.offset,r=this.length,n=this._nullCount,o=this,c=this.children){return new dt(t,e,r,n,o,c,this.dictionary)}slice(t,e){let{stride:r,typeId:n,children:o}=this,c=+(this._nullCount===0)-1,p=n===16?r:1,b=this._sliceBuffers(t,e,r,n);return this.clone(this.type,this.offset+t,e,c,b,o.length===0||this.valueOffsets?o:this._sliceChildren(o,p*t,p*e))}_changeLengthAndBackfillNullBitmap(t){if(this.typeId===C.Null)return this.clone(this.type,0,t,0);let{length:e,nullCount:r}=this,n=new Uint8Array((t+63&-64)>>3).fill(255,0,e>>3);n[e>>3]=(1<<e-(e&-8))-1,r>0&&n.set(Wr(this.offset,e,this.nullBitmap),0);let o=this.buffers;return o[Pe.VALIDITY]=n,this.clone(this.type,0,t,r+(t-e),o)}_sliceBuffers(t,e,r,n){let o,{buffers:c}=this;return(o=c[Pe.TYPE])&&(c[Pe.TYPE]=o.subarray(t,t+e)),(o=c[Pe.OFFSET])&&(c[Pe.OFFSET]=o.subarray(t,t+e+1))||(o=c[Pe.DATA])&&(c[Pe.DATA]=n===6?o:o.subarray(r*t,r*(t+e))),c}_sliceChildren(t,e,r){return t.map(n=>n.slice(e,r))}};dt.prototype.children=Object.freeze([]);var vr=class extends V{visit(t){return this.getVisitFn(t.type).call(this,t)}visitNull(t){let{["type"]:e,["offset"]:r=0,["length"]:n=0}=t;return new dt(e,r,n,0)}visitBool(t){let{["type"]:e,["offset"]:r=0}=t,n=Y(t.nullBitmap),o=rt(e.ArrayType,t.data),{["length"]:c=o.length>>3,["nullCount"]:p=t.nullBitmap?-1:0}=t;return new dt(e,r,c,p,[void 0,o,n])}visitInt(t){let{["type"]:e,["offset"]:r=0}=t,n=Y(t.nullBitmap),o=rt(e.ArrayType,t.data),{["length"]:c=o.length,["nullCount"]:p=t.nullBitmap?-1:0}=t;return new dt(e,r,c,p,[void 0,o,n])}visitFloat(t){let{["type"]:e,["offset"]:r=0}=t,n=Y(t.nullBitmap),o=rt(e.ArrayType,t.data),{["length"]:c=o.length,["nullCount"]:p=t.nullBitmap?-1:0}=t;return new dt(e,r,c,p,[void 0,o,n])}visitUtf8(t){let{["type"]:e,["offset"]:r=0}=t,n=Y(t.data),o=Y(t.nullBitmap),c=yr(t.valueOffsets),{["length"]:p=c.length-1,["nullCount"]:b=t.nullBitmap?-1:0}=t;return new dt(e,r,p,b,[c,n,o])}visitBinary(t){let{["type"]:e,["offset"]:r=0}=t,n=Y(t.data),o=Y(t.nullBitmap),c=yr(t.valueOffsets),{["length"]:p=c.length-1,["nullCount"]:b=t.nullBitmap?-1:0}=t;return new dt(e,r,p,b,[c,n,o])}visitFixedSizeBinary(t){let{["type"]:e,["offset"]:r=0}=t,n=Y(t.nullBitmap),o=rt(e.ArrayType,t.data),{["length"]:c=o.length/De(e),["nullCount"]:p=t.nullBitmap?-1:0}=t;return new dt(e,r,c,p,[void 0,o,n])}visitDate(t){let{["type"]:e,["offset"]:r=0}=t,n=Y(t.nullBitmap),o=rt(e.ArrayType,t.data),{["length"]:c=o.length/De(e),["nullCount"]:p=t.nullBitmap?-1:0}=t;return new dt(e,r,c,p,[void 0,o,n])}visitTimestamp(t){let{["type"]:e,["offset"]:r=0}=t,n=Y(t.nullBitmap),o=rt(e.ArrayType,t.data),{["length"]:c=o.length/De(e),["nullCount"]:p=t.nullBitmap?-1:0}=t;return new dt(e,r,c,p,[void 0,o,n])}visitTime(t){let{["type"]:e,["offset"]:r=0}=t,n=Y(t.nullBitmap),o=rt(e.ArrayType,t.data),{["length"]:c=o.length/De(e),["nullCount"]:p=t.nullBitmap?-1:0}=t;return new dt(e,r,c,p,[void 0,o,n])}visitDecimal(t){let{["type"]:e,["offset"]:r=0}=t,n=Y(t.nullBitmap),o=rt(e.ArrayType,t.data),{["length"]:c=o.length/De(e),["nullCount"]:p=t.nullBitmap?-1:0}=t;return new dt(e,r,c,p,[void 0,o,n])}visitList(t){let{["type"]:e,["offset"]:r=0,["child"]:n}=t,o=Y(t.nullBitmap),c=yr(t.valueOffsets),{["length"]:p=c.length-1,["nullCount"]:b=t.nullBitmap?-1:0}=t;return new dt(e,r,p,b,[c,void 0,o],[n])}visitStruct(t){let{["type"]:e,["offset"]:r=0,["children"]:n=[]}=t,o=Y(t.nullBitmap),{length:c=n.reduce((b,{length:g})=>Math.max(b,g),0),nullCount:p=t.nullBitmap?-1:0}=t;return new dt(e,r,c,p,[void 0,void 0,o],n)}visitUnion(t){let{["type"]:e,["offset"]:r=0,["children"]:n=[]}=t,o=Y(t.nullBitmap),c=rt(e.ArrayType,t.typeIds),{["length"]:p=c.length,["nullCount"]:b=t.nullBitmap?-1:0}=t;if(N.isSparseUnion(e))return new dt(e,r,p,b,[void 0,void 0,o,c],n);let g=yr(t.valueOffsets);return new dt(e,r,p,b,[g,void 0,o,c],n)}visitDictionary(t){let{["type"]:e,["offset"]:r=0}=t,n=Y(t.nullBitmap),o=rt(e.indices.ArrayType,t.data),{["dictionary"]:c=new G([new vr().visit({type:e.dictionary})])}=t,{["length"]:p=o.length,["nullCount"]:b=t.nullBitmap?-1:0}=t;return new dt(e,r,p,b,[void 0,o,n],[],c)}visitInterval(t){let{["type"]:e,["offset"]:r=0}=t,n=Y(t.nullBitmap),o=rt(e.ArrayType,t.data),{["length"]:c=o.length/De(e),["nullCount"]:p=t.nullBitmap?-1:0}=t;return new dt(e,r,c,p,[void 0,o,n])}visitFixedSizeList(t){let{["type"]:e,["offset"]:r=0,["child"]:n=new vr().visit({type:e.valueType})}=t,o=Y(t.nullBitmap),{["length"]:c=n.length/De(e),["nullCount"]:p=t.nullBitmap?-1:0}=t;return new dt(e,r,c,p,[void 0,void 0,o],[n])}visitMap(t){let{["type"]:e,["offset"]:r=0,["child"]:n=new vr().visit({type:e.childType})}=t,o=Y(t.nullBitmap),c=yr(t.valueOffsets),{["length"]:p=c.length-1,["nullCount"]:b=t.nullBitmap?-1:0}=t;return new dt(e,r,p,b,[c,void 0,o],[n])}};function J(i){return new vr().visit(i)}var jn=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 ro(i){return i.reduce((t,e)=>t+e.nullCount,0)}function no(i){return i.reduce((t,e,r)=>(t[r+1]=t[r]+e.length,t),new Uint32Array(i.length+1))}function so(i,t,e,r){let n=[];for(let o=-1,c=i.length;++o<c;){let p=i[o],b=t[o],{length:g}=p;if(b>=r)break;if(e>=b+g)continue;if(b>=e&&b+g<=r){n.push(p);continue}let A=Math.max(0,e-b),T=Math.min(r-b,g);n.push(p.slice(A,T-A))}return n.length===0&&n.push(i[0].slice(0,0)),n}function Pa(i,t,e,r){let n=0,o=0,c=t.length-1;do{if(n>=c-1)return e<t[c]?r(i,n,e-t[n]):null;o=n+Math.trunc((c-n)*.5),e<t[o]?c=o:n=o}while(n<c)}function Sn(i,t){return i.getValid(t)}function Qi(i){function t(e,r,n){return i(e[r],n)}return function(e){let r=this.data;return Pa(r,this._offsets,e,t)}}function oo(i){let t;function e(r,n,o){return i(r[n],o,t)}return function(r,n){let o=this.data;t=n;let c=Pa(o,this._offsets,r,e);return t=void 0,c}}function ao(i){let t;function e(r,n,o){let c=o,p=0,b=0;for(let g=n-1,A=r.length;++g<A;){let T=r[g];if(~(p=i(T,t,c)))return b+p;c=0,b+=T.length}return-1}return function(r,n){t=r;let o=this.data,c=typeof n!="number"?e(o,0,0):Pa(o,this._offsets,n,e);return t=void 0,c}}var z=class extends V{};function Qj(i,t){return t===null&&i.length>0?0:-1}function tS(i,t){let{nullBitmap:e}=i;if(!e||i.nullCount<=0)return-1;let r=0;for(let n of new mr(e,i.offset+(t||0),i.length,e,io)){if(!n)return r;++r}return-1}function nt(i,t,e){if(t===void 0)return-1;if(t===null)return tS(i,e);let r=Ut.getVisitFn(i),n=Zi(t);for(let o=(e||0)-1,c=i.length;++o<c;)if(n(r(i,o)))return o;return-1}function Jh(i,t,e){let r=Ut.getVisitFn(i),n=Zi(t);for(let o=(e||0)-1,c=i.length;++o<c;)if(n(r(i,o)))return o;return-1}z.prototype.visitNull=Qj;z.prototype.visitBool=nt;z.prototype.visitInt=nt;z.prototype.visitInt8=nt;z.prototype.visitInt16=nt;z.prototype.visitInt32=nt;z.prototype.visitInt64=nt;z.prototype.visitUint8=nt;z.prototype.visitUint16=nt;z.prototype.visitUint32=nt;z.prototype.visitUint64=nt;z.prototype.visitFloat=nt;z.prototype.visitFloat16=nt;z.prototype.visitFloat32=nt;z.prototype.visitFloat64=nt;z.prototype.visitUtf8=nt;z.prototype.visitBinary=nt;z.prototype.visitFixedSizeBinary=nt;z.prototype.visitDate=nt;z.prototype.visitDateDay=nt;z.prototype.visitDateMillisecond=nt;z.prototype.visitTimestamp=nt;z.prototype.visitTimestampSecond=nt;z.prototype.visitTimestampMillisecond=nt;z.prototype.visitTimestampMicrosecond=nt;z.prototype.visitTimestampNanosecond=nt;z.prototype.visitTime=nt;z.prototype.visitTimeSecond=nt;z.prototype.visitTimeMillisecond=nt;z.prototype.visitTimeMicrosecond=nt;z.prototype.visitTimeNanosecond=nt;z.prototype.visitDecimal=nt;z.prototype.visitList=nt;z.prototype.visitStruct=nt;z.prototype.visitUnion=nt;z.prototype.visitDenseUnion=Jh;z.prototype.visitSparseUnion=Jh;z.prototype.visitDictionary=nt;z.prototype.visitInterval=nt;z.prototype.visitIntervalDayTime=nt;z.prototype.visitIntervalYearMonth=nt;z.prototype.visitFixedSizeList=nt;z.prototype.visitMap=nt;var gr=new z;var W=class extends V{};function Z(i){let{type:t}=i;if(i.nullCount===0&&i.stride===1&&(t.typeId===C.Timestamp||t instanceof Ot&&t.bitWidth!==64||t instanceof qe&&t.bitWidth!==64||t instanceof me&&t.precision!==It.HALF))return new jn(i.data.length,r=>{let n=i.data[r];return n.values.subarray(0,n.length)[Symbol.iterator]()});let e=0;return new jn(i.data.length,r=>{let o=i.data[r].length,c=i.slice(e,e+o);return e+=o,new Va(c)})}var Va=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}};W.prototype.visitNull=Z;W.prototype.visitBool=Z;W.prototype.visitInt=Z;W.prototype.visitInt8=Z;W.prototype.visitInt16=Z;W.prototype.visitInt32=Z;W.prototype.visitInt64=Z;W.prototype.visitUint8=Z;W.prototype.visitUint16=Z;W.prototype.visitUint32=Z;W.prototype.visitUint64=Z;W.prototype.visitFloat=Z;W.prototype.visitFloat16=Z;W.prototype.visitFloat32=Z;W.prototype.visitFloat64=Z;W.prototype.visitUtf8=Z;W.prototype.visitBinary=Z;W.prototype.visitFixedSizeBinary=Z;W.prototype.visitDate=Z;W.prototype.visitDateDay=Z;W.prototype.visitDateMillisecond=Z;W.prototype.visitTimestamp=Z;W.prototype.visitTimestampSecond=Z;W.prototype.visitTimestampMillisecond=Z;W.prototype.visitTimestampMicrosecond=Z;W.prototype.visitTimestampNanosecond=Z;W.prototype.visitTime=Z;W.prototype.visitTimeSecond=Z;W.prototype.visitTimeMillisecond=Z;W.prototype.visitTimeMicrosecond=Z;W.prototype.visitTimeNanosecond=Z;W.prototype.visitDecimal=Z;W.prototype.visitList=Z;W.prototype.visitStruct=Z;W.prototype.visitUnion=Z;W.prototype.visitDenseUnion=Z;W.prototype.visitSparseUnion=Z;W.prototype.visitDictionary=Z;W.prototype.visitInterval=Z;W.prototype.visitIntervalDayTime=Z;W.prototype.visitIntervalYearMonth=Z;W.prototype.visitFixedSizeList=Z;W.prototype.visitMap=Z;var $r=new W;var eS=(i,t)=>i+t,di=class extends V{visitNull(t,e){return 0}visitInt(t,e){return t.type.bitWidth/8}visitFloat(t,e){return t.type.ArrayType.BYTES_PER_ELEMENT}visitBool(t,e){return 1/8}visitDecimal(t,e){return t.type.bitWidth/8}visitDate(t,e){return(t.type.unit+1)*4}visitTime(t,e){return t.type.bitWidth/8}visitTimestamp(t,e){return t.type.unit===ot.SECOND?4:8}visitInterval(t,e){return(t.type.unit+1)*4}visitStruct(t,e){return t.children.reduce((r,n)=>r+Ee.visit(n,e),0)}visitFixedSizeBinary(t,e){return t.type.byteWidth}visitMap(t,e){return 8+t.children.reduce((r,n)=>r+Ee.visit(n,e),0)}visitDictionary(t,e){var r;return t.type.indices.bitWidth/8+(((r=t.dictionary)===null||r===void 0?void 0:r.getByteLength(t.values[e]))||0)}},iS=({valueOffsets:i},t)=>8+(i[t+1]-i[t]),rS=({valueOffsets:i},t)=>8+(i[t+1]-i[t]),nS=({valueOffsets:i,stride:t,children:e},r)=>{let n=e[0],{[r*t]:o}=i,{[r*t+1]:c}=i,p=Ee.getVisitFn(n.type),b=n.slice(o,c-o),g=8;for(let A=-1,T=c-o;++A<T;)g+=p(b,A);return g},sS=({stride:i,children:t},e)=>{let r=t[0],n=r.slice(e*i,i),o=Ee.getVisitFn(r.type),c=0;for(let p=-1,b=n.length;++p<b;)c+=o(n,p);return c},oS=(i,t)=>i.type.mode===Ft.Dense?qh(i,t):Zh(i,t),qh=({type:i,children:t,typeIds:e,valueOffsets:r},n)=>{let o=i.typeIdToChildIndex[e[n]];return 8+Ee.visit(t[o],r[n])},Zh=({children:i},t)=>4+Ee.visitMany(i,i.map(()=>t)).reduce(eS,0);di.prototype.visitUtf8=iS;di.prototype.visitBinary=rS;di.prototype.visitList=nS;di.prototype.visitFixedSizeList=sS;di.prototype.visitUnion=oS;di.prototype.visitDenseUnion=qh;di.prototype.visitSparseUnion=Zh;var Ee=new di;var Qh,tp={},ep={},G=class{constructor(t){var e,r,n;let o=t[0]instanceof G?t.flatMap(p=>p.data):t;if(o.length===0||o.some(p=>!(p instanceof dt)))throw new TypeError("Vector constructor expects an Array of Data instances.");let c=(e=o[0])===null||e===void 0?void 0:e.type;switch(o.length){case 0:this._offsets=[0];break;case 1:{let{get:p,set:b,indexOf:g,byteLength:A}=tp[c.typeId],T=o[0];this.isValid=F=>Sn(T,F),this.get=F=>p(T,F),this.set=(F,k)=>b(T,F,k),this.indexOf=F=>g(T,F),this.getByteLength=F=>A(T,F),this._offsets=[0,T.length];break}default:Object.setPrototypeOf(this,ep[c.typeId]),this._offsets=no(o);break}this.data=o,this.type=c,this.stride=De(c),this.numChildren=(n=(r=c.children)===null||r===void 0?void 0:r.length)!==null&&n!==void 0?n:0,this.length=this._offsets[this._offsets.length-1]}get byteLength(){return this._byteLength===-1&&(this._byteLength=this.data.reduce((t,e)=>t+e.byteLength,0)),this._byteLength}get nullCount(){return this._nullCount===-1&&(this._nullCount=ro(this.data)),this._nullCount}get ArrayType(){return this.type.ArrayType}get[Symbol.toStringTag](){return`${this.VectorName}<${this.type[Symbol.toStringTag]}>`}get VectorName(){return`${C[this.type.typeId]}Vector`}isValid(t){return!1}get(t){return null}set(t,e){}indexOf(t,e){return-1}includes(t,e){return this.indexOf(t,e)>0}getByteLength(t){return 0}[Symbol.iterator](){return $r.visit(this)}concat(...t){return new G(this.data.concat(t.flatMap(e=>e.data).flat(Number.POSITIVE_INFINITY)))}slice(t,e){return new G(gn(this,t,e,({data:r,_offsets:n},o,c)=>so(r,n,o,c)))}toJSON(){return[...this]}toArray(){let{type:t,data:e,length:r,stride:n,ArrayType:o}=this;switch(t.typeId){case C.Int:case C.Float:case C.Decimal:case C.Time:case C.Timestamp:switch(e.length){case 0:return new o;case 1:return e[0].values.subarray(0,r*n);default:return e.reduce((c,{values:p})=>(c.array.set(p,c.offset),c.offset+=p.length,c),{array:new o(r*n),offset:0}).array}}return[...this]}toString(){return`[${[...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 G(this.data.map(({children:e})=>e[t])):null}get isMemoized(){return N.isDictionary(this.type)?this.data[0].dictionary.isMemoized:!1}memoize(){if(N.isDictionary(this.type)){let t=new Yr(this.data[0].dictionary),e=this.data.map(r=>{let n=r.clone();return n.dictionary=t,n});return new G(e)}return new Yr(this)}unmemoize(){if(N.isDictionary(this.type)&&this.isMemoized){let t=this.data[0].dictionary.unmemoize(),e=this.data.map(r=>{let n=r.clone();return n.dictionary=t,n});return new G(e)}return this}};Qh=Symbol.toStringTag;G[Qh]=(i=>{i.type=N.prototype,i.data=[],i.length=0,i.stride=1,i.numChildren=0,i._nullCount=-1,i._byteLength=-1,i._offsets=new Uint32Array([0]),i[Symbol.isConcatSpreadable]=!0;let t=Object.keys(C).map(e=>C[e]).filter(e=>typeof e=="number"&&e!==C.NONE);for(let e of t){let r=Ut.getVisitFnByTypeId(e),n=ee.getVisitFnByTypeId(e),o=gr.getVisitFnByTypeId(e),c=Ee.getVisitFnByTypeId(e);tp[e]={get:r,set:n,indexOf:o,byteLength:c},ep[e]=Object.create(i,{isValid:{value:Qi(Sn)},get:{value:Qi(Ut.getVisitFnByTypeId(e))},set:{value:oo(ee.getVisitFnByTypeId(e))},indexOf:{value:ao(gr.getVisitFnByTypeId(e))},getByteLength:{value:Qi(Ee.getVisitFnByTypeId(e))}})}return"Vector"})(G.prototype);var Yr=class extends G{constructor(t){super(t.data);let e=this.get,r=this.set,n=this.slice,o=new Array(this.length);Object.defineProperty(this,"get",{value(c){let p=o[c];if(p!==void 0)return p;let b=e.call(this,c);return o[c]=b,b}}),Object.defineProperty(this,"set",{value(c,p){r.call(this,c,p),o[c]=p}}),Object.defineProperty(this,"slice",{value:(c,p)=>new Yr(n.call(this,c,p))}),Object.defineProperty(this,"isMemoized",{value:!0}),Object.defineProperty(this,"unmemoize",{value:()=>new G(this.data)}),Object.defineProperty(this,"memoize",{value:()=>this})}};function ip(i){if(!i||i.length<=0)return function(n){return!0};let t="",e=i.filter(r=>r===r);return e.length>0&&(t=`
1
+ "use strict";var duckdb=(()=>{var Bw=Object.create;var ws=Object.defineProperty;var Tw=Object.getOwnPropertyDescriptor;var Dw=Object.getOwnPropertyNames;var Ew=Object.getPrototypeOf,kw=Object.prototype.hasOwnProperty;var pa=(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 new Error('Dynamic require of "'+i+'" is not supported')});var js=(i,t)=>()=>(t||i((t={exports:{}}).exports,t),t.exports),mr=(i,t)=>{for(var e in t)ws(i,e,{get:t[e],enumerable:!0})},Tf=(i,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Dw(t))!kw.call(i,n)&&n!==e&&ws(i,n,{get:()=>t[n],enumerable:!(r=Tw(t,n))||r.enumerable});return i};var Df=(i,t,e)=>(e=i!=null?Bw(Ew(i)):{},Tf(t||!i||!i.__esModule?ws(e,"default",{value:i,enumerable:!0}):e,i)),Ow=i=>Tf(ws({},"__esModule",{value:!0}),i);var Qf=js((BI,Cs)=>{var Ef,kf,Of,Rf,Mf,Uf,Lf,Nf,Pf,Ss,ya,Vf,Hf,zf,Rr,Wf,$f,Yf,Xf,Gf,Kf,Jf,qf,Zf,Is;(function(i){var t=typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:{};typeof define=="function"&&define.amd?define("tslib",["exports"],function(r){i(e(t,e(r)))}):typeof Cs=="object"&&typeof Cs.exports=="object"?i(e(t,e(Cs.exports))):i(e(t));function e(r,n){return r!==t&&(typeof Object.create=="function"?Object.defineProperty(r,"__esModule",{value:!0}):r.__esModule=!0),function(o,u){return r[o]=n?n(o,u):u}}})(function(i){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(r[o]=n[o])};Ef=function(r,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(r,n);function o(){this.constructor=r}r.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)},kf=Object.assign||function(r){for(var n,o=1,u=arguments.length;o<u;o++){n=arguments[o];for(var h in n)Object.prototype.hasOwnProperty.call(n,h)&&(r[h]=n[h])}return r},Of=function(r,n){var o={};for(var u in r)Object.prototype.hasOwnProperty.call(r,u)&&n.indexOf(u)<0&&(o[u]=r[u]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var h=0,u=Object.getOwnPropertySymbols(r);h<u.length;h++)n.indexOf(u[h])<0&&Object.prototype.propertyIsEnumerable.call(r,u[h])&&(o[u[h]]=r[u[h]]);return o},Rf=function(r,n,o,u){var h=arguments.length,m=h<3?n:u===null?u=Object.getOwnPropertyDescriptor(n,o):u,g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(r,n,o,u);else for(var F=r.length-1;F>=0;F--)(g=r[F])&&(m=(h<3?g(m):h>3?g(n,o,m):g(n,o))||m);return h>3&&m&&Object.defineProperty(n,o,m),m},Mf=function(r,n){return function(o,u){n(o,u,r)}},Uf=function(r,n){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,n)},Lf=function(r,n,o,u){function h(m){return m instanceof o?m:new o(function(g){g(m)})}return new(o||(o=Promise))(function(m,g){function F(k){try{B(u.next(k))}catch(at){g(at)}}function D(k){try{B(u.throw(k))}catch(at){g(at)}}function B(k){k.done?m(k.value):h(k.value).then(F,D)}B((u=u.apply(r,n||[])).next())})},Nf=function(r,n){var o={label:0,sent:function(){if(m[0]&1)throw m[1];return m[1]},trys:[],ops:[]},u,h,m,g;return g={next:F(0),throw:F(1),return:F(2)},typeof Symbol=="function"&&(g[Symbol.iterator]=function(){return this}),g;function F(B){return function(k){return D([B,k])}}function D(B){if(u)throw new TypeError("Generator is already executing.");for(;o;)try{if(u=1,h&&(m=B[0]&2?h.return:B[0]?h.throw||((m=h.return)&&m.call(h),0):h.next)&&!(m=m.call(h,B[1])).done)return m;switch(h=0,m&&(B=[B[0]&2,m.value]),B[0]){case 0:case 1:m=B;break;case 4:return o.label++,{value:B[1],done:!1};case 5:o.label++,h=B[1],B=[0];continue;case 7:B=o.ops.pop(),o.trys.pop();continue;default:if(m=o.trys,!(m=m.length>0&&m[m.length-1])&&(B[0]===6||B[0]===2)){o=0;continue}if(B[0]===3&&(!m||B[1]>m[0]&&B[1]<m[3])){o.label=B[1];break}if(B[0]===6&&o.label<m[1]){o.label=m[1],m=B;break}if(m&&o.label<m[2]){o.label=m[2],o.ops.push(B);break}m[2]&&o.ops.pop(),o.trys.pop();continue}B=n.call(r,o)}catch(k){B=[6,k],h=0}finally{u=m=0}if(B[0]&5)throw B[1];return{value:B[0]?B[1]:void 0,done:!0}}},Pf=function(r,n){for(var o in r)o!=="default"&&!Object.prototype.hasOwnProperty.call(n,o)&&Is(n,r,o)},Is=Object.create?function(r,n,o,u){u===void 0&&(u=o);var h=Object.getOwnPropertyDescriptor(n,o);(!h||("get"in h?!n.__esModule:h.writable||h.configurable))&&(h={enumerable:!0,get:function(){return n[o]}}),Object.defineProperty(r,u,h)}:function(r,n,o,u){u===void 0&&(u=o),r[u]=n[o]},Ss=function(r){var n=typeof Symbol=="function"&&Symbol.iterator,o=n&&r[n],u=0;if(o)return o.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&u>=r.length&&(r=void 0),{value:r&&r[u++],done:!r}}};throw new TypeError(n?"Object is not iterable.":"Symbol.iterator is not defined.")},ya=function(r,n){var o=typeof Symbol=="function"&&r[Symbol.iterator];if(!o)return r;var u=o.call(r),h,m=[],g;try{for(;(n===void 0||n-- >0)&&!(h=u.next()).done;)m.push(h.value)}catch(F){g={error:F}}finally{try{h&&!h.done&&(o=u.return)&&o.call(u)}finally{if(g)throw g.error}}return m},Vf=function(){for(var r=[],n=0;n<arguments.length;n++)r=r.concat(ya(arguments[n]));return r},Hf=function(){for(var r=0,n=0,o=arguments.length;n<o;n++)r+=arguments[n].length;for(var u=Array(r),h=0,n=0;n<o;n++)for(var m=arguments[n],g=0,F=m.length;g<F;g++,h++)u[h]=m[g];return u},zf=function(r,n,o){if(o||arguments.length===2)for(var u=0,h=n.length,m;u<h;u++)(m||!(u in n))&&(m||(m=Array.prototype.slice.call(n,0,u)),m[u]=n[u]);return r.concat(m||Array.prototype.slice.call(n))},Rr=function(r){return this instanceof Rr?(this.v=r,this):new Rr(r)},Wf=function(r,n,o){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var u=o.apply(r,n||[]),h,m=[];return h={},g("next"),g("throw"),g("return"),h[Symbol.asyncIterator]=function(){return this},h;function g(ct){u[ct]&&(h[ct]=function(gt){return new Promise(function(Ot,ce){m.push([ct,gt,Ot,ce])>1||F(ct,gt)})})}function F(ct,gt){try{D(u[ct](gt))}catch(Ot){at(m[0][3],Ot)}}function D(ct){ct.value instanceof Rr?Promise.resolve(ct.value.v).then(B,k):at(m[0][2],ct)}function B(ct){F("next",ct)}function k(ct){F("throw",ct)}function at(ct,gt){ct(gt),m.shift(),m.length&&F(m[0][0],m[0][1])}},$f=function(r){var n,o;return n={},u("next"),u("throw",function(h){throw h}),u("return"),n[Symbol.iterator]=function(){return this},n;function u(h,m){n[h]=r[h]?function(g){return(o=!o)?{value:Rr(r[h](g)),done:h==="return"}:m?m(g):g}:m}},Yf=function(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r[Symbol.asyncIterator],o;return n?n.call(r):(r=typeof Ss=="function"?Ss(r):r[Symbol.iterator](),o={},u("next"),u("throw"),u("return"),o[Symbol.asyncIterator]=function(){return this},o);function u(m){o[m]=r[m]&&function(g){return new Promise(function(F,D){g=r[m](g),h(F,D,g.done,g.value)})}}function h(m,g,F,D){Promise.resolve(D).then(function(B){m({value:B,done:F})},g)}},Xf=function(r,n){return Object.defineProperty?Object.defineProperty(r,"raw",{value:n}):r.raw=n,r};var e=Object.create?function(r,n){Object.defineProperty(r,"default",{enumerable:!0,value:n})}:function(r,n){r.default=n};Gf=function(r){if(r&&r.__esModule)return r;var n={};if(r!=null)for(var o in r)o!=="default"&&Object.prototype.hasOwnProperty.call(r,o)&&Is(n,r,o);return e(n,r),n},Kf=function(r){return r&&r.__esModule?r:{default:r}},Jf=function(r,n,o,u){if(o==="a"&&!u)throw new TypeError("Private accessor was defined without a getter");if(typeof n=="function"?r!==n||!u:!n.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return o==="m"?u:o==="a"?u.call(r):u?u.value:n.get(r)},qf=function(r,n,o,u,h){if(u==="m")throw new TypeError("Private method is not writable");if(u==="a"&&!h)throw new TypeError("Private accessor was defined without a setter");if(typeof n=="function"?r!==n||!h:!n.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return u==="a"?h.call(r,o):h?h.value=o:n.set(r,o),o},Zf=function(r,n){if(n===null||typeof n!="object"&&typeof n!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof r=="function"?n===r:r.has(n)},i("__extends",Ef),i("__assign",kf),i("__rest",Of),i("__decorate",Rf),i("__param",Mf),i("__metadata",Uf),i("__awaiter",Lf),i("__generator",Nf),i("__exportStar",Pf),i("__createBinding",Is),i("__values",Ss),i("__read",ya),i("__spread",Vf),i("__spreadArrays",Hf),i("__spreadArray",zf),i("__await",Rr),i("__asyncGenerator",Wf),i("__asyncDelegator",$f),i("__asyncValues",Yf),i("__makeTemplateObject",Xf),i("__importStar",Gf),i("__importDefault",Kf),i("__classPrivateFieldGet",Jf),i("__classPrivateFieldSet",qf),i("__classPrivateFieldIn",Zf)})});var hl=js(()=>{});var Np=js(()=>{});var Yp=js((exports,module)=>{(function(){"use strict";var ERROR="input is invalid type",WINDOW=typeof window=="object",root=WINDOW?window:{};root.JS_SHA256_NO_WINDOW&&(WINDOW=!1);var WEB_WORKER=!WINDOW&&typeof self=="object",NODE_JS=!root.JS_SHA256_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;NODE_JS?root=global:WEB_WORKER&&(root=self);var COMMON_JS=!root.JS_SHA256_NO_COMMON_JS&&typeof module=="object"&&module.exports,AMD=typeof define=="function"&&define.amd,ARRAY_BUFFER=!root.JS_SHA256_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",HEX_CHARS="0123456789abcdef".split(""),EXTRA=[-2147483648,8388608,32768,128],SHIFT=[24,16,8,0],K=[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],OUTPUT_TYPES=["hex","array","digest","arrayBuffer"],blocks=[];(root.JS_SHA256_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(i){return Object.prototype.toString.call(i)==="[object Array]"}),ARRAY_BUFFER&&(root.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(i){return typeof i=="object"&&i.buffer&&i.buffer.constructor===ArrayBuffer});var createOutputMethod=function(i,t){return function(e){return new Sha256(t,!0).update(e)[i]()}},createMethod=function(i){var t=createOutputMethod("hex",i);NODE_JS&&(t=nodeWrap(t,i)),t.create=function(){return new Sha256(i)},t.update=function(n){return t.create().update(n)};for(var e=0;e<OUTPUT_TYPES.length;++e){var r=OUTPUT_TYPES[e];t[r]=createOutputMethod(r,i)}return t},nodeWrap=function(method,is224){var crypto=eval("require('crypto')"),Buffer=eval("require('buffer').Buffer"),algorithm=is224?"sha224":"sha256",nodeMethod=function(i){if(typeof i=="string")return crypto.createHash(algorithm).update(i,"utf8").digest("hex");if(i==null)throw new Error(ERROR);return i.constructor===ArrayBuffer&&(i=new Uint8Array(i)),Array.isArray(i)||ArrayBuffer.isView(i)||i.constructor===Buffer?crypto.createHash(algorithm).update(new Buffer(i)).digest("hex"):method(i)};return nodeMethod},createHmacOutputMethod=function(i,t){return function(e,r){return new HmacSha256(e,t,!0).update(r)[i]()}},createHmacMethod=function(i){var t=createHmacOutputMethod("hex",i);t.create=function(n){return new HmacSha256(n,i)},t.update=function(n,o){return t.create(n).update(o)};for(var e=0;e<OUTPUT_TYPES.length;++e){var r=OUTPUT_TYPES[e];t[r]=createHmacOutputMethod(r,i)}return t};function Sha256(i,t){t?(blocks[0]=blocks[16]=blocks[1]=blocks[2]=blocks[3]=blocks[4]=blocks[5]=blocks[6]=blocks[7]=blocks[8]=blocks[9]=blocks[10]=blocks[11]=blocks[12]=blocks[13]=blocks[14]=blocks[15]=0,this.blocks=blocks):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],i?(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=i}Sha256.prototype.update=function(i){if(!this.finalized){var t,e=typeof i;if(e!=="string"){if(e==="object"){if(i===null)throw new Error(ERROR);if(ARRAY_BUFFER&&i.constructor===ArrayBuffer)i=new Uint8Array(i);else if(!Array.isArray(i)&&(!ARRAY_BUFFER||!ArrayBuffer.isView(i)))throw new Error(ERROR)}else throw new Error(ERROR);t=!0}for(var r,n=0,o,u=i.length,h=this.blocks;n<u;){if(this.hashed&&(this.hashed=!1,h[0]=this.block,h[16]=h[1]=h[2]=h[3]=h[4]=h[5]=h[6]=h[7]=h[8]=h[9]=h[10]=h[11]=h[12]=h[13]=h[14]=h[15]=0),t)for(o=this.start;n<u&&o<64;++n)h[o>>2]|=i[n]<<SHIFT[o++&3];else for(o=this.start;n<u&&o<64;++n)r=i.charCodeAt(n),r<128?h[o>>2]|=r<<SHIFT[o++&3]:r<2048?(h[o>>2]|=(192|r>>6)<<SHIFT[o++&3],h[o>>2]|=(128|r&63)<<SHIFT[o++&3]):r<55296||r>=57344?(h[o>>2]|=(224|r>>12)<<SHIFT[o++&3],h[o>>2]|=(128|r>>6&63)<<SHIFT[o++&3],h[o>>2]|=(128|r&63)<<SHIFT[o++&3]):(r=65536+((r&1023)<<10|i.charCodeAt(++n)&1023),h[o>>2]|=(240|r>>18)<<SHIFT[o++&3],h[o>>2]|=(128|r>>12&63)<<SHIFT[o++&3],h[o>>2]|=(128|r>>6&63)<<SHIFT[o++&3],h[o>>2]|=(128|r&63)<<SHIFT[o++&3]);this.lastByteIndex=o,this.bytes+=o-this.start,o>=64?(this.block=h[16],this.start=o-64,this.hash(),this.hashed=!0):this.start=o}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},Sha256.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var i=this.blocks,t=this.lastByteIndex;i[16]=this.block,i[t>>2]|=EXTRA[t&3],this.block=i[16],t>=56&&(this.hashed||this.hash(),i[0]=this.block,i[16]=i[1]=i[2]=i[3]=i[4]=i[5]=i[6]=i[7]=i[8]=i[9]=i[10]=i[11]=i[12]=i[13]=i[14]=i[15]=0),i[14]=this.hBytes<<3|this.bytes>>>29,i[15]=this.bytes<<3,this.hash()}},Sha256.prototype.hash=function(){var i=this.h0,t=this.h1,e=this.h2,r=this.h3,n=this.h4,o=this.h5,u=this.h6,h=this.h7,m=this.blocks,g,F,D,B,k,at,ct,gt,Ot,ce,_e;for(g=16;g<64;++g)k=m[g-15],F=(k>>>7|k<<25)^(k>>>18|k<<14)^k>>>3,k=m[g-2],D=(k>>>17|k<<15)^(k>>>19|k<<13)^k>>>10,m[g]=m[g-16]+F+m[g-7]+D<<0;for(_e=t&e,g=0;g<64;g+=4)this.first?(this.is224?(gt=300032,k=m[0]-1413257819,h=k-150054599<<0,r=k+24177077<<0):(gt=704751109,k=m[0]-210244248,h=k-1521486534<<0,r=k+143694565<<0),this.first=!1):(F=(i>>>2|i<<30)^(i>>>13|i<<19)^(i>>>22|i<<10),D=(n>>>6|n<<26)^(n>>>11|n<<21)^(n>>>25|n<<7),gt=i&t,B=gt^i&e^_e,ct=n&o^~n&u,k=h+D+ct+K[g]+m[g],at=F+B,h=r+k<<0,r=k+at<<0),F=(r>>>2|r<<30)^(r>>>13|r<<19)^(r>>>22|r<<10),D=(h>>>6|h<<26)^(h>>>11|h<<21)^(h>>>25|h<<7),Ot=r&i,B=Ot^r&t^gt,ct=h&n^~h&o,k=u+D+ct+K[g+1]+m[g+1],at=F+B,u=e+k<<0,e=k+at<<0,F=(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10),D=(u>>>6|u<<26)^(u>>>11|u<<21)^(u>>>25|u<<7),ce=e&r,B=ce^e&i^Ot,ct=u&h^~u&n,k=o+D+ct+K[g+2]+m[g+2],at=F+B,o=t+k<<0,t=k+at<<0,F=(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10),D=(o>>>6|o<<26)^(o>>>11|o<<21)^(o>>>25|o<<7),_e=t&e,B=_e^t&r^ce,ct=o&u^~o&h,k=n+D+ct+K[g+3]+m[g+3],at=F+B,n=i+k<<0,i=k+at<<0;this.h0=this.h0+i<<0,this.h1=this.h1+t<<0,this.h2=this.h2+e<<0,this.h3=this.h3+r<<0,this.h4=this.h4+n<<0,this.h5=this.h5+o<<0,this.h6=this.h6+u<<0,this.h7=this.h7+h<<0},Sha256.prototype.hex=function(){this.finalize();var i=this.h0,t=this.h1,e=this.h2,r=this.h3,n=this.h4,o=this.h5,u=this.h6,h=this.h7,m=HEX_CHARS[i>>28&15]+HEX_CHARS[i>>24&15]+HEX_CHARS[i>>20&15]+HEX_CHARS[i>>16&15]+HEX_CHARS[i>>12&15]+HEX_CHARS[i>>8&15]+HEX_CHARS[i>>4&15]+HEX_CHARS[i&15]+HEX_CHARS[t>>28&15]+HEX_CHARS[t>>24&15]+HEX_CHARS[t>>20&15]+HEX_CHARS[t>>16&15]+HEX_CHARS[t>>12&15]+HEX_CHARS[t>>8&15]+HEX_CHARS[t>>4&15]+HEX_CHARS[t&15]+HEX_CHARS[e>>28&15]+HEX_CHARS[e>>24&15]+HEX_CHARS[e>>20&15]+HEX_CHARS[e>>16&15]+HEX_CHARS[e>>12&15]+HEX_CHARS[e>>8&15]+HEX_CHARS[e>>4&15]+HEX_CHARS[e&15]+HEX_CHARS[r>>28&15]+HEX_CHARS[r>>24&15]+HEX_CHARS[r>>20&15]+HEX_CHARS[r>>16&15]+HEX_CHARS[r>>12&15]+HEX_CHARS[r>>8&15]+HEX_CHARS[r>>4&15]+HEX_CHARS[r&15]+HEX_CHARS[n>>28&15]+HEX_CHARS[n>>24&15]+HEX_CHARS[n>>20&15]+HEX_CHARS[n>>16&15]+HEX_CHARS[n>>12&15]+HEX_CHARS[n>>8&15]+HEX_CHARS[n>>4&15]+HEX_CHARS[n&15]+HEX_CHARS[o>>28&15]+HEX_CHARS[o>>24&15]+HEX_CHARS[o>>20&15]+HEX_CHARS[o>>16&15]+HEX_CHARS[o>>12&15]+HEX_CHARS[o>>8&15]+HEX_CHARS[o>>4&15]+HEX_CHARS[o&15]+HEX_CHARS[u>>28&15]+HEX_CHARS[u>>24&15]+HEX_CHARS[u>>20&15]+HEX_CHARS[u>>16&15]+HEX_CHARS[u>>12&15]+HEX_CHARS[u>>8&15]+HEX_CHARS[u>>4&15]+HEX_CHARS[u&15];return this.is224||(m+=HEX_CHARS[h>>28&15]+HEX_CHARS[h>>24&15]+HEX_CHARS[h>>20&15]+HEX_CHARS[h>>16&15]+HEX_CHARS[h>>12&15]+HEX_CHARS[h>>8&15]+HEX_CHARS[h>>4&15]+HEX_CHARS[h&15]),m},Sha256.prototype.toString=Sha256.prototype.hex,Sha256.prototype.digest=function(){this.finalize();var i=this.h0,t=this.h1,e=this.h2,r=this.h3,n=this.h4,o=this.h5,u=this.h6,h=this.h7,m=[i>>24&255,i>>16&255,i>>8&255,i&255,t>>24&255,t>>16&255,t>>8&255,t&255,e>>24&255,e>>16&255,e>>8&255,e&255,r>>24&255,r>>16&255,r>>8&255,r&255,n>>24&255,n>>16&255,n>>8&255,n&255,o>>24&255,o>>16&255,o>>8&255,o&255,u>>24&255,u>>16&255,u>>8&255,u&255];return this.is224||m.push(h>>24&255,h>>16&255,h>>8&255,h&255),m},Sha256.prototype.array=Sha256.prototype.digest,Sha256.prototype.arrayBuffer=function(){this.finalize();var i=new ArrayBuffer(this.is224?28:32),t=new DataView(i);return t.setUint32(0,this.h0),t.setUint32(4,this.h1),t.setUint32(8,this.h2),t.setUint32(12,this.h3),t.setUint32(16,this.h4),t.setUint32(20,this.h5),t.setUint32(24,this.h6),this.is224||t.setUint32(28,this.h7),i};function HmacSha256(i,t,e){var r,n=typeof i;if(n==="string"){var o=[],u=i.length,h=0,m;for(r=0;r<u;++r)m=i.charCodeAt(r),m<128?o[h++]=m:m<2048?(o[h++]=192|m>>6,o[h++]=128|m&63):m<55296||m>=57344?(o[h++]=224|m>>12,o[h++]=128|m>>6&63,o[h++]=128|m&63):(m=65536+((m&1023)<<10|i.charCodeAt(++r)&1023),o[h++]=240|m>>18,o[h++]=128|m>>12&63,o[h++]=128|m>>6&63,o[h++]=128|m&63);i=o}else if(n==="object"){if(i===null)throw new Error(ERROR);if(ARRAY_BUFFER&&i.constructor===ArrayBuffer)i=new Uint8Array(i);else if(!Array.isArray(i)&&(!ARRAY_BUFFER||!ArrayBuffer.isView(i)))throw new Error(ERROR)}else throw new Error(ERROR);i.length>64&&(i=new Sha256(t,!0).update(i).array());var g=[],F=[];for(r=0;r<64;++r){var D=i[r]||0;g[r]=92^D,F[r]=54^D}Sha256.call(this,t,e),this.update(F),this.oKeyPad=g,this.inner=!0,this.sharedMemory=e}HmacSha256.prototype=new Sha256,HmacSha256.prototype.finalize=function(){if(Sha256.prototype.finalize.call(this),this.inner){this.inner=!1;var i=this.array();Sha256.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(i),Sha256.prototype.finalize.call(this)}};var exports=createMethod();exports.sha256=exports,exports.sha224=createMethod(!0),exports.sha256.hmac=createHmacMethod(),exports.sha224.hmac=createHmacMethod(!0),COMMON_JS?module.exports=exports:(root.sha256=exports.sha256,root.sha224=exports.sha224,AMD&&define(function(){return exports}))})()});var CI={};mr(CI,{registerWorker:()=>Kp});var th=Df(Qf(),1),{__extends:TI,__assign:DI,__rest:eh,__decorate:EI,__param:kI,__metadata:OI,__awaiter:O,__generator:RI,__exportStar:MI,__createBinding:UI,__values:LI,__read:NI,__spread:PI,__spreadArrays:VI,__spreadArray:HI,__await:it,__asyncGenerator:be,__asyncDelegator:Mr,__asyncValues:Ne,__makeTemplateObject:zI,__importStar:WI,__importDefault:$I,__classPrivateFieldGet:YI,__classPrivateFieldSet:XI,__classPrivateFieldIn:GI}=th.default;var wa={};mr(wa,{compareArrayLike:()=>ga,joinUint8Arrays:()=>De,memcpy:()=>Lr,rebaseValueOffsets:()=>wn,toArrayBufferView:()=>rt,toArrayBufferViewAsyncIterator:()=>Je,toArrayBufferViewIterator:()=>ui,toBigInt64Array:()=>Vw,toBigUint64Array:()=>Ww,toFloat32Array:()=>$w,toFloat32ArrayAsyncIterator:()=>aj,toFloat32ArrayIterator:()=>Qw,toFloat64Array:()=>Yw,toFloat64ArrayAsyncIterator:()=>lj,toFloat64ArrayIterator:()=>tj,toInt16Array:()=>Pw,toInt16ArrayAsyncIterator:()=>rj,toInt16ArrayIterator:()=>Kw,toInt32Array:()=>br,toInt32ArrayAsyncIterator:()=>nj,toInt32ArrayIterator:()=>Jw,toInt8Array:()=>Nw,toInt8ArrayAsyncIterator:()=>ij,toInt8ArrayIterator:()=>Gw,toUint16Array:()=>Hw,toUint16ArrayAsyncIterator:()=>sj,toUint16ArrayIterator:()=>qw,toUint32Array:()=>zw,toUint32ArrayAsyncIterator:()=>oj,toUint32ArrayIterator:()=>Zw,toUint8Array:()=>Y,toUint8ArrayAsyncIterator:()=>va,toUint8ArrayIterator:()=>ba,toUint8ClampedArray:()=>Xw,toUint8ClampedArrayAsyncIterator:()=>cj,toUint8ClampedArrayIterator:()=>ej});var Rw=new TextDecoder("utf-8"),bn=i=>Rw.decode(i),Mw=new TextEncoder,Ji=i=>Mw.encode(i);var[qI,As]=(()=>{let i=()=>{throw new Error("BigInt is not available in this environment")};function t(){throw i()}return t.asIntN=()=>{throw i()},t.asUintN=()=>{throw i()},typeof BigInt<"u"?[BigInt,!0]:[t,!1]})(),[vn,ZI]=(()=>{let i=()=>{throw new Error("BigInt64Array is not available in this environment")};class t{static get BYTES_PER_ELEMENT(){return 8}static of(){throw i()}static from(){throw i()}constructor(){throw i()}}return typeof BigInt64Array<"u"?[BigInt64Array,!0]:[t,!1]})(),[Ur,QI]=(()=>{let i=()=>{throw new Error("BigUint64Array is not available in this environment")};class t{static get BYTES_PER_ELEMENT(){return 8}static of(){throw i()}static from(){throw i()}constructor(){throw i()}}return typeof BigUint64Array<"u"?[BigUint64Array,!0]:[t,!1]})();var Uw=i=>typeof i=="number",ih=i=>typeof i=="boolean",zt=i=>typeof i=="function",fe=i=>i!=null&&Object(i)===i,Ge=i=>fe(i)&&zt(i.then);var Ke=i=>fe(i)&&zt(i[Symbol.iterator]),Pe=i=>fe(i)&&zt(i[Symbol.asyncIterator]),Fs=i=>fe(i)&&fe(i.schema);var xs=i=>fe(i)&&"done"in i&&"value"in i;var Bs=i=>fe(i)&&zt(i.stat)&&Uw(i.fd);var Ts=i=>fe(i)&&gn(i.body),Ds=i=>"_getDOMStream"in i&&"_getNodeStream"in i,rh=i=>fe(i)&&zt(i.abort)&&zt(i.getWriter)&&!Ds(i),gn=i=>fe(i)&&zt(i.cancel)&&zt(i.getReader)&&!Ds(i),nh=i=>fe(i)&&zt(i.end)&&zt(i.write)&&ih(i.writable)&&!Ds(i),Es=i=>fe(i)&&zt(i.read)&&zt(i.pipe)&&ih(i.readable)&&!Ds(i),sh=i=>fe(i)&&zt(i.clear)&&zt(i.bytes)&&zt(i.position)&&zt(i.setPosition)&&zt(i.capacity)&&zt(i.getBufferIdentifier)&&zt(i.createLong);var ma=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:ArrayBuffer;function Lw(i){let t=i[0]?[i[0]]:[],e,r,n,o;for(let u,h,m=0,g=0,F=i.length;++m<F;){if(u=t[g],h=i[m],!u||!h||u.buffer!==h.buffer||h.byteOffset<u.byteOffset){h&&(t[++g]=h);continue}if({byteOffset:e,byteLength:n}=u,{byteOffset:r,byteLength:o}=h,e+n<r||r+o<e){h&&(t[++g]=h);continue}t[g]=new Uint8Array(u.buffer,e,r-e+o)}return t}function Lr(i,t,e=0,r=t.byteLength){let n=i.byteLength,o=new Uint8Array(i.buffer,i.byteOffset,n),u=new Uint8Array(t.buffer,t.byteOffset,Math.min(r,n));return o.set(u,e),i}function De(i,t){let e=Lw(i),r=e.reduce((F,D)=>F+D.byteLength,0),n,o,u,h=0,m=-1,g=Math.min(t||Number.POSITIVE_INFINITY,r);for(let F=e.length;++m<F;){if(n=e[m],o=n.subarray(0,Math.min(n.length,g-h)),g<=h+o.length){o.length<n.length?e[m]=n.subarray(o.length):o.length===n.length&&m++,u?Lr(u,o,h):u=o;break}Lr(u||(u=new Uint8Array(g)),o,h),h+=o.length}return[u||new Uint8Array(0),e.slice(m),r-(u?u.byteLength:0)]}function rt(i,t){let e=xs(t)?t.value:t;return e instanceof i?i===Uint8Array?new i(e.buffer,e.byteOffset,e.byteLength):e:e?(typeof e=="string"&&(e=Ji(e)),e instanceof ArrayBuffer?new i(e):e instanceof ma?new i(e):sh(e)?rt(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 Nw=i=>rt(Int8Array,i),Pw=i=>rt(Int16Array,i),br=i=>rt(Int32Array,i),Vw=i=>rt(vn,i),Y=i=>rt(Uint8Array,i),Hw=i=>rt(Uint16Array,i),zw=i=>rt(Uint32Array,i),Ww=i=>rt(Ur,i),$w=i=>rt(Float32Array,i),Yw=i=>rt(Float64Array,i),Xw=i=>rt(Uint8ClampedArray,i),_a=i=>(i.next(),i);function*ui(i,t){let e=function*(n){yield n},r=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof ma?e(t):Ke(t)?t:e(t);return yield*_a(function*(n){let o=null;do o=n.next(yield rt(i,o));while(!o.done)}(r[Symbol.iterator]())),new i}var Gw=i=>ui(Int8Array,i),Kw=i=>ui(Int16Array,i),Jw=i=>ui(Int32Array,i),ba=i=>ui(Uint8Array,i),qw=i=>ui(Uint16Array,i),Zw=i=>ui(Uint32Array,i),Qw=i=>ui(Float32Array,i),tj=i=>ui(Float64Array,i),ej=i=>ui(Uint8ClampedArray,i);function Je(i,t){return be(this,arguments,function*(){if(Ge(t))return yield it(yield it(yield*Mr(Ne(Je(i,yield it(t))))));let r=function(u){return be(this,arguments,function*(){yield yield it(yield it(u))})},n=function(u){return be(this,arguments,function*(){yield it(yield*Mr(Ne(_a(function*(h){let m=null;do m=h.next(yield m==null?void 0:m.value);while(!m.done)}(u[Symbol.iterator]())))))})},o=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof ma?r(t):Ke(t)?n(t):Pe(t)?t:r(t);return yield it(yield*Mr(Ne(_a(function(u){return be(this,arguments,function*(){let h=null;do h=yield it(u.next(yield yield it(rt(i,h))));while(!h.done)})}(o[Symbol.asyncIterator]()))))),yield it(new i)})}var ij=i=>Je(Int8Array,i),rj=i=>Je(Int16Array,i),nj=i=>Je(Int32Array,i),va=i=>Je(Uint8Array,i),sj=i=>Je(Uint16Array,i),oj=i=>Je(Uint32Array,i),aj=i=>Je(Float32Array,i),lj=i=>Je(Float64Array,i),cj=i=>Je(Uint8ClampedArray,i);function wn(i,t,e){if(i!==0){e=e.slice(0,t+1);for(let r=-1;++r<=t;)e[r]+=i}return e}function ga(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 te={fromIterable(i){return ks(uj(i))},fromAsyncIterable(i){return ks(dj(i))},fromDOMStream(i){return ks(fj(i))},fromNodeStream(i){return ks(hj(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')}},ks=i=>(i.next(),i);function*uj(i){let t,e=!1,r=[],n,o,u,h=0;function m(){return o==="peek"?De(r,u)[0]:([n,r,h]=De(r,u),n)}({cmd:o,size:u}=yield null);let g=ba(i)[Symbol.iterator]();try{do if({done:t,value:n}=Number.isNaN(u-h)?g.next():g.next(u-h),!t&&n.byteLength>0&&(r.push(n),h+=n.byteLength),t||u<=h)do({cmd:o,size:u}=yield m());while(u<h);while(!t)}catch(F){(e=!0)&&typeof g.throw=="function"&&g.throw(F)}finally{e===!1&&typeof g.return=="function"&&g.return(null)}return null}function dj(i){return be(this,arguments,function*(){let e,r=!1,n=[],o,u,h,m=0;function g(){return u==="peek"?De(n,h)[0]:([o,n,m]=De(n,h),o)}({cmd:u,size:h}=yield yield it(null));let F=va(i)[Symbol.asyncIterator]();try{do if({done:e,value:o}=Number.isNaN(h-m)?yield it(F.next()):yield it(F.next(h-m)),!e&&o.byteLength>0&&(n.push(o),m+=o.byteLength),e||h<=m)do({cmd:u,size:h}=yield yield it(g()));while(h<m);while(!e)}catch(D){(r=!0)&&typeof F.throw=="function"&&(yield it(F.throw(D)))}finally{r===!1&&typeof F.return=="function"&&(yield it(F.return(new Uint8Array(0))))}return yield it(null)})}function fj(i){return be(this,arguments,function*(){let e=!1,r=!1,n=[],o,u,h,m=0;function g(){return u==="peek"?De(n,h)[0]:([o,n,m]=De(n,h),o)}({cmd:u,size:h}=yield yield it(null));let F=new Sa(i);try{do if({done:e,value:o}=Number.isNaN(h-m)?yield it(F.read()):yield it(F.read(h-m)),!e&&o.byteLength>0&&(n.push(Y(o)),m+=o.byteLength),e||h<=m)do({cmd:u,size:h}=yield yield it(g()));while(h<m);while(!e)}catch(D){(r=!0)&&(yield it(F.cancel(D)))}finally{r===!1?yield it(F.cancel()):i.locked&&F.releaseLock()}return yield it(null)})}var Sa=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 O(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 O(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=Y(e)),e})}},ja=(i,t)=>{let e=n=>r([t,n]),r;return[t,e,new Promise(n=>(r=n)&&i.once(t,e))]};function hj(i){return be(this,arguments,function*(){let e=[],r="error",n=!1,o=null,u,h,m=0,g=[],F;function D(){return u==="peek"?De(g,h)[0]:([F,g,m]=De(g,h),F)}if({cmd:u,size:h}=yield yield it(null),i.isTTY)return yield yield it(new Uint8Array(0)),yield it(null);try{e[0]=ja(i,"end"),e[1]=ja(i,"error");do{if(e[2]=ja(i,"readable"),[r,o]=yield it(Promise.race(e.map(k=>k[2]))),r==="error")break;if((n=r==="end")||(Number.isFinite(h-m)?(F=Y(i.read(h-m)),F.byteLength<h-m&&(F=Y(i.read()))):F=Y(i.read()),F.byteLength>0&&(g.push(F),m+=F.byteLength)),n||h<=m)do({cmd:u,size:h}=yield yield it(D()));while(h<m)}while(!n)}finally{yield it(B(e,r==="error"?o:null))}return yield it(null);function B(k,at){return F=g=null,new Promise((ct,gt)=>{for(let[Ot,ce]of k)i.off(Ot,ce);try{let Ot=i.destroy;Ot&&Ot.call(i,at),at=void 0}catch(Ot){at=Ot||at}finally{at!=null?gt(at):ct()}})}})}var Yt;(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"})(Yt||(Yt={}));var Dt;(function(i){i[i.Sparse=0]="Sparse",i[i.Dense=1]="Dense"})(Dt||(Dt={}));var xt;(function(i){i[i.HALF=0]="HALF",i[i.SINGLE=1]="SINGLE",i[i.DOUBLE=2]="DOUBLE"})(xt||(xt={}));var ee;(function(i){i[i.DAY=0]="DAY",i[i.MILLISECOND=1]="MILLISECOND"})(ee||(ee={}));var st;(function(i){i[i.SECOND=0]="SECOND",i[i.MILLISECOND=1]="MILLISECOND",i[i.MICROSECOND=2]="MICROSECOND",i[i.NANOSECOND=3]="NANOSECOND"})(st||(st={}));var he;(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"})(he||(he={}));var ft;(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"})(ft||(ft={}));var C;(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.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"})(C||(C={}));var Ve;(function(i){i[i.OFFSET=0]="OFFSET",i[i.DATA=1]="DATA",i[i.VALIDITY=2]="VALIDITY",i[i.TYPE=3]="TYPE"})(Ve||(Ve={}));var Pa={};mr(Pa,{clampIndex:()=>rS,clampRange:()=>In,createElementComparator:()=>tr});function qe(i){if(i===null)return"null";if(i===void 0)return"undefined";switch(typeof i){case"number":return`${i}`;case"bigint":return`${i}`;case"string":return`"${i}"`}return typeof i[Symbol.toPrimitive]=="function"?i[Symbol.toPrimitive]("string"):ArrayBuffer.isView(i)?i instanceof BigInt64Array||i instanceof BigUint64Array?`[${[...i].map(t=>qe(t))}]`:`[${i}]`:ArrayBuffer.isView(i)?`[${i}]`:JSON.stringify(i,(t,e)=>typeof e=="bigint"?`${e}`:e)}var Ca={};mr(Ca,{BN:()=>vr,bignumToBigInt:()=>Os,bignumToString:()=>qi,isArrowBigNumSymbol:()=>oh});var oh=Symbol.for("isArrowBigNum");function Ze(i,...t){return t.length===0?Object.setPrototypeOf(rt(this.TypedArray,i),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(i,...t),this.constructor.prototype)}Ze.prototype[oh]=!0;Ze.prototype.toJSON=function(){return`"${qi(this)}"`};Ze.prototype.valueOf=function(){return ah(this)};Ze.prototype.toString=function(){return qi(this)};Ze.prototype[Symbol.toPrimitive]=function(i="default"){switch(i){case"number":return ah(this);case"string":return qi(this);case"default":return Os(this)}return qi(this)};function Nr(...i){return Ze.apply(this,i)}function Pr(...i){return Ze.apply(this,i)}function jn(...i){return Ze.apply(this,i)}Object.setPrototypeOf(Nr.prototype,Object.create(Int32Array.prototype));Object.setPrototypeOf(Pr.prototype,Object.create(Uint32Array.prototype));Object.setPrototypeOf(jn.prototype,Object.create(Uint32Array.prototype));Object.assign(Nr.prototype,Ze.prototype,{constructor:Nr,signed:!0,TypedArray:Int32Array,BigIntArray:vn});Object.assign(Pr.prototype,Ze.prototype,{constructor:Pr,signed:!1,TypedArray:Uint32Array,BigIntArray:Ur});Object.assign(jn.prototype,Ze.prototype,{constructor:jn,signed:!0,TypedArray:Uint32Array,BigIntArray:Ur});function ah(i){let{buffer:t,byteOffset:e,length:r,signed:n}=i,o=new Ur(t,e,r),u=n&&o[o.length-1]&BigInt(1)<<BigInt(63),h=BigInt(u?1:0),m=BigInt(0);if(u){for(let g of o)h+=~g*(BigInt(1)<<BigInt(32)*m++);h*=BigInt(-1)}else for(let g of o)h+=g*(BigInt(1)<<BigInt(32)*m++);return h}var qi,Os;As?(Os=i=>i.byteLength===8?new i.BigIntArray(i.buffer,i.byteOffset,1)[0]:Ia(i),qi=i=>i.byteLength===8?`${new i.BigIntArray(i.buffer,i.byteOffset,1)[0]}`:Ia(i)):(qi=Ia,Os=qi);function Ia(i){let t="",e=new Uint32Array(2),r=new Uint16Array(i.buffer,i.byteOffset,i.byteLength/2),n=new Uint32Array((r=new Uint16Array(r).reverse()).buffer),o=-1,u=r.length-1;do{for(e[0]=r[o=0];o<u;)r[o++]=e[1]=e[0]/10,e[0]=(e[0]-e[1]*10<<16)+r[o];r[o]=e[1]=e[0]/10,e[0]=e[0]-e[1]*10,t=`${e[0]}${t}`}while(n[0]||n[1]||n[2]||n[3]);return t||"0"}var vr=class{static new(t,e){switch(e){case!0:return new Nr(t);case!1:return new Pr(t)}switch(t.constructor){case Int8Array:case Int16Array:case Int32Array:case vn:return new Nr(t)}return t.byteLength===16?new jn(t):new Pr(t)}static signed(t){return new Nr(t)}static unsigned(t){return new Pr(t)}static decimal(t){return new jn(t)}constructor(t,e){return vr.new(t,e)}};var lh,ch,uh,dh,fh,hh,ph,yh,_h,mh,bh,vh,gh,wh,jh,Sh,Ih,Ch,Ah,L=class{static isNull(t){return(t==null?void 0:t.typeId)===C.Null}static isInt(t){return(t==null?void 0:t.typeId)===C.Int}static isFloat(t){return(t==null?void 0:t.typeId)===C.Float}static isBinary(t){return(t==null?void 0:t.typeId)===C.Binary}static isUtf8(t){return(t==null?void 0:t.typeId)===C.Utf8}static isBool(t){return(t==null?void 0:t.typeId)===C.Bool}static isDecimal(t){return(t==null?void 0:t.typeId)===C.Decimal}static isDate(t){return(t==null?void 0:t.typeId)===C.Date}static isTime(t){return(t==null?void 0:t.typeId)===C.Time}static isTimestamp(t){return(t==null?void 0:t.typeId)===C.Timestamp}static isInterval(t){return(t==null?void 0:t.typeId)===C.Interval}static isList(t){return(t==null?void 0:t.typeId)===C.List}static isStruct(t){return(t==null?void 0:t.typeId)===C.Struct}static isUnion(t){return(t==null?void 0:t.typeId)===C.Union}static isFixedSizeBinary(t){return(t==null?void 0:t.typeId)===C.FixedSizeBinary}static isFixedSizeList(t){return(t==null?void 0:t.typeId)===C.FixedSizeList}static isMap(t){return(t==null?void 0:t.typeId)===C.Map}static isDictionary(t){return(t==null?void 0:t.typeId)===C.Dictionary}static isDenseUnion(t){return L.isUnion(t)&&t.mode===Dt.Dense}static isSparseUnion(t){return L.isUnion(t)&&t.mode===Dt.Sparse}get typeId(){return C.NONE}};lh=Symbol.toStringTag;L[lh]=(i=>(i.children=null,i.ArrayType=Array,i[Symbol.toStringTag]="DataType"))(L.prototype);var pe=class extends L{toString(){return"Null"}get typeId(){return C.Null}};ch=Symbol.toStringTag;pe[ch]=(i=>i[Symbol.toStringTag]="Null")(pe.prototype);var Mt=class extends L{constructor(t,e){super(),this.isSigned=t,this.bitWidth=e}get typeId(){return C.Int}get ArrayType(){switch(this.bitWidth){case 8:return this.isSigned?Int8Array:Uint8Array;case 16:return this.isSigned?Int16Array:Uint16Array;case 32:return this.isSigned?Int32Array:Uint32Array;case 64:return this.isSigned?BigInt64Array:BigUint64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}};uh=Symbol.toStringTag;Mt[uh]=(i=>(i.isSigned=null,i.bitWidth=null,i[Symbol.toStringTag]="Int"))(Mt.prototype);var Rs=class extends Mt{constructor(){super(!0,8)}get ArrayType(){return Int8Array}},Ms=class extends Mt{constructor(){super(!0,16)}get ArrayType(){return Int16Array}},di=class extends Mt{constructor(){super(!0,32)}get ArrayType(){return Int32Array}},Us=class extends Mt{constructor(){super(!0,64)}get ArrayType(){return BigInt64Array}},Ls=class extends Mt{constructor(){super(!1,8)}get ArrayType(){return Uint8Array}},Ns=class extends Mt{constructor(){super(!1,16)}get ArrayType(){return Uint16Array}},Ps=class extends Mt{constructor(){super(!1,32)}get ArrayType(){return Uint32Array}},Vs=class extends Mt{constructor(){super(!1,64)}get ArrayType(){return BigUint64Array}};Object.defineProperty(Rs.prototype,"ArrayType",{value:Int8Array});Object.defineProperty(Ms.prototype,"ArrayType",{value:Int16Array});Object.defineProperty(di.prototype,"ArrayType",{value:Int32Array});Object.defineProperty(Us.prototype,"ArrayType",{value:BigInt64Array});Object.defineProperty(Ls.prototype,"ArrayType",{value:Uint8Array});Object.defineProperty(Ns.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(Ps.prototype,"ArrayType",{value:Uint32Array});Object.defineProperty(Vs.prototype,"ArrayType",{value:BigUint64Array});var ve=class extends L{constructor(t){super(),this.precision=t}get typeId(){return C.Float}get ArrayType(){switch(this.precision){case xt.HALF:return Uint16Array;case xt.SINGLE:return Float32Array;case xt.DOUBLE:return Float64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`Float${this.precision<<5||16}`}};dh=Symbol.toStringTag;ve[dh]=(i=>(i.precision=null,i[Symbol.toStringTag]="Float"))(ve.prototype);var Hs=class extends ve{constructor(){super(xt.HALF)}},zs=class extends ve{constructor(){super(xt.SINGLE)}},Ws=class extends ve{constructor(){super(xt.DOUBLE)}};Object.defineProperty(Hs.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(zs.prototype,"ArrayType",{value:Float32Array});Object.defineProperty(Ws.prototype,"ArrayType",{value:Float64Array});var Bi=class extends L{constructor(){super()}get typeId(){return C.Binary}toString(){return"Binary"}};fh=Symbol.toStringTag;Bi[fh]=(i=>(i.ArrayType=Uint8Array,i[Symbol.toStringTag]="Binary"))(Bi.prototype);var Ti=class extends L{constructor(){super()}get typeId(){return C.Utf8}toString(){return"Utf8"}};hh=Symbol.toStringTag;Ti[hh]=(i=>(i.ArrayType=Uint8Array,i[Symbol.toStringTag]="Utf8"))(Ti.prototype);var Di=class extends L{constructor(){super()}get typeId(){return C.Bool}toString(){return"Bool"}};ph=Symbol.toStringTag;Di[ph]=(i=>(i.ArrayType=Uint8Array,i[Symbol.toStringTag]="Bool"))(Di.prototype);var Ei=class extends L{constructor(t,e,r=128){super(),this.scale=t,this.precision=e,this.bitWidth=r}get typeId(){return C.Decimal}toString(){return`Decimal[${this.precision}e${this.scale>0?"+":""}${this.scale}]`}};yh=Symbol.toStringTag;Ei[yh]=(i=>(i.scale=null,i.precision=null,i.ArrayType=Uint32Array,i[Symbol.toStringTag]="Decimal"))(Ei.prototype);var ki=class extends L{constructor(t){super(),this.unit=t}get typeId(){return C.Date}toString(){return`Date${(this.unit+1)*32}<${ee[this.unit]}>`}};_h=Symbol.toStringTag;ki[_h]=(i=>(i.unit=null,i.ArrayType=Int32Array,i[Symbol.toStringTag]="Date"))(ki.prototype);var Qe=class extends L{constructor(t,e){super(),this.unit=t,this.bitWidth=e}get typeId(){return C.Time}toString(){return`Time${this.bitWidth}<${st[this.unit]}>`}get ArrayType(){switch(this.bitWidth){case 32:return Int32Array;case 64:return BigInt64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}};mh=Symbol.toStringTag;Qe[mh]=(i=>(i.unit=null,i.bitWidth=null,i[Symbol.toStringTag]="Time"))(Qe.prototype);var Oi=class extends L{constructor(t,e){super(),this.unit=t,this.timezone=e}get typeId(){return C.Timestamp}toString(){return`Timestamp<${st[this.unit]}${this.timezone?`, ${this.timezone}`:""}>`}};bh=Symbol.toStringTag;Oi[bh]=(i=>(i.unit=null,i.timezone=null,i.ArrayType=Int32Array,i[Symbol.toStringTag]="Timestamp"))(Oi.prototype);var Ri=class extends L{constructor(t){super(),this.unit=t}get typeId(){return C.Interval}toString(){return`Interval<${he[this.unit]}>`}};vh=Symbol.toStringTag;Ri[vh]=(i=>(i.unit=null,i.ArrayType=Int32Array,i[Symbol.toStringTag]="Interval"))(Ri.prototype);var ti=class extends L{constructor(t){super(),this.children=[t]}get typeId(){return C.List}toString(){return`List<${this.valueType}>`}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}};gh=Symbol.toStringTag;ti[gh]=(i=>(i.children=null,i[Symbol.toStringTag]="List"))(ti.prototype);var St=class extends L{constructor(t){super(),this.children=t}get typeId(){return C.Struct}toString(){return`Struct<{${this.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}};wh=Symbol.toStringTag;St[wh]=(i=>(i.children=null,i[Symbol.toStringTag]="Struct"))(St.prototype);var ei=class extends L{constructor(t,e,r){super(),this.mode=t,this.children=r,this.typeIds=e=Int32Array.from(e),this.typeIdToChildIndex=e.reduce((n,o,u)=>(n[o]=u)&&n||n,Object.create(null))}get typeId(){return C.Union}toString(){return`${this[Symbol.toStringTag]}<${this.children.map(t=>`${t.type}`).join(" | ")}>`}};jh=Symbol.toStringTag;ei[jh]=(i=>(i.mode=null,i.typeIds=null,i.children=null,i.typeIdToChildIndex=null,i.ArrayType=Int8Array,i[Symbol.toStringTag]="Union"))(ei.prototype);var Mi=class extends L{constructor(t){super(),this.byteWidth=t}get typeId(){return C.FixedSizeBinary}toString(){return`FixedSizeBinary[${this.byteWidth}]`}};Sh=Symbol.toStringTag;Mi[Sh]=(i=>(i.byteWidth=null,i.ArrayType=Uint8Array,i[Symbol.toStringTag]="FixedSizeBinary"))(Mi.prototype);var ii=class extends L{constructor(t,e){super(),this.listSize=t,this.children=[e]}get typeId(){return C.FixedSizeList}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}toString(){return`FixedSizeList[${this.listSize}]<${this.valueType}>`}};Ih=Symbol.toStringTag;ii[Ih]=(i=>(i.children=null,i.listSize=null,i[Symbol.toStringTag]="FixedSizeList"))(ii.prototype);var ri=class extends L{constructor(t,e=!1){super(),this.children=[t],this.keysSorted=e}get typeId(){return C.Map}get keyType(){return this.children[0].type.children[0].type}get valueType(){return this.children[0].type.children[1].type}get childType(){return this.children[0].type}toString(){return`Map<{${this.children[0].type.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}};Ch=Symbol.toStringTag;ri[Ch]=(i=>(i.children=null,i.keysSorted=null,i[Symbol.toStringTag]="Map_"))(ri.prototype);var pj=(i=>()=>++i)(-1),Ee=class extends L{constructor(t,e,r,n){super(),this.indices=e,this.dictionary=t,this.isOrdered=n||!1,this.id=r==null?pj():typeof r=="number"?r:r.low}get typeId(){return C.Dictionary}get children(){return this.dictionary.children}get valueType(){return this.dictionary}get ArrayType(){return this.dictionary.ArrayType}toString(){return`Dictionary<${this.indices}, ${this.dictionary}>`}};Ah=Symbol.toStringTag;Ee[Ah]=(i=>(i.id=null,i.indices=null,i.isOrdered=null,i.dictionary=null,i[Symbol.toStringTag]="Dictionary"))(Ee.prototype);function ke(i){let t=i;switch(i.typeId){case C.Decimal:return i.bitWidth/32;case C.Timestamp:return 2;case C.Date:return 1+t.unit;case C.Interval:return 1+t.unit;case C.FixedSizeList:return t.listSize;case C.FixedSizeBinary:return t.byteWidth;default:return 1}}var P=class{visitMany(t,...e){return t.map((r,n)=>this.visit(r,...e.map(o=>o[n])))}visit(...t){return this.getVisitFn(t[0],!1).apply(this,t)}getVisitFn(t,e=!0){return yj(this,t,e)}getVisitFnByTypeId(t,e=!0){return Vr(this,t,e)}visitNull(t,...e){return null}visitBool(t,...e){return null}visitInt(t,...e){return null}visitFloat(t,...e){return null}visitUtf8(t,...e){return null}visitBinary(t,...e){return null}visitFixedSizeBinary(t,...e){return null}visitDate(t,...e){return null}visitTimestamp(t,...e){return null}visitTime(t,...e){return null}visitDecimal(t,...e){return null}visitList(t,...e){return null}visitStruct(t,...e){return null}visitUnion(t,...e){return null}visitDictionary(t,...e){return null}visitInterval(t,...e){return null}visitFixedSizeList(t,...e){return null}visitMap(t,...e){return null}};function yj(i,t,e=!0){return typeof t=="number"?Vr(i,t,e):typeof t=="string"&&t in C?Vr(i,C[t],e):t&&t instanceof L?Vr(i,Fh(t),e):(t==null?void 0:t.type)&&t.type instanceof L?Vr(i,Fh(t.type),e):Vr(i,C.NONE,e)}function Vr(i,t,e=!0){let r=null;switch(t){case C.Null:r=i.visitNull;break;case C.Bool:r=i.visitBool;break;case C.Int:r=i.visitInt;break;case C.Int8:r=i.visitInt8||i.visitInt;break;case C.Int16:r=i.visitInt16||i.visitInt;break;case C.Int32:r=i.visitInt32||i.visitInt;break;case C.Int64:r=i.visitInt64||i.visitInt;break;case C.Uint8:r=i.visitUint8||i.visitInt;break;case C.Uint16:r=i.visitUint16||i.visitInt;break;case C.Uint32:r=i.visitUint32||i.visitInt;break;case C.Uint64:r=i.visitUint64||i.visitInt;break;case C.Float:r=i.visitFloat;break;case C.Float16:r=i.visitFloat16||i.visitFloat;break;case C.Float32:r=i.visitFloat32||i.visitFloat;break;case C.Float64:r=i.visitFloat64||i.visitFloat;break;case C.Utf8:r=i.visitUtf8;break;case C.Binary:r=i.visitBinary;break;case C.FixedSizeBinary:r=i.visitFixedSizeBinary;break;case C.Date:r=i.visitDate;break;case C.DateDay:r=i.visitDateDay||i.visitDate;break;case C.DateMillisecond:r=i.visitDateMillisecond||i.visitDate;break;case C.Timestamp:r=i.visitTimestamp;break;case C.TimestampSecond:r=i.visitTimestampSecond||i.visitTimestamp;break;case C.TimestampMillisecond:r=i.visitTimestampMillisecond||i.visitTimestamp;break;case C.TimestampMicrosecond:r=i.visitTimestampMicrosecond||i.visitTimestamp;break;case C.TimestampNanosecond:r=i.visitTimestampNanosecond||i.visitTimestamp;break;case C.Time:r=i.visitTime;break;case C.TimeSecond:r=i.visitTimeSecond||i.visitTime;break;case C.TimeMillisecond:r=i.visitTimeMillisecond||i.visitTime;break;case C.TimeMicrosecond:r=i.visitTimeMicrosecond||i.visitTime;break;case C.TimeNanosecond:r=i.visitTimeNanosecond||i.visitTime;break;case C.Decimal:r=i.visitDecimal;break;case C.List:r=i.visitList;break;case C.Struct:r=i.visitStruct;break;case C.Union:r=i.visitUnion;break;case C.DenseUnion:r=i.visitDenseUnion||i.visitUnion;break;case C.SparseUnion:r=i.visitSparseUnion||i.visitUnion;break;case C.Dictionary:r=i.visitDictionary;break;case C.Interval:r=i.visitInterval;break;case C.IntervalDayTime:r=i.visitIntervalDayTime||i.visitInterval;break;case C.IntervalYearMonth:r=i.visitIntervalYearMonth||i.visitInterval;break;case C.FixedSizeList:r=i.visitFixedSizeList;break;case C.Map:r=i.visitMap;break}if(typeof r=="function")return r;if(!e)return()=>null;throw new Error(`Unrecognized type '${C[t]}'`)}function Fh(i){switch(i.typeId){case C.Null:return C.Null;case C.Int:{let{bitWidth:t,isSigned:e}=i;switch(t){case 8:return e?C.Int8:C.Uint8;case 16:return e?C.Int16:C.Uint16;case 32:return e?C.Int32:C.Uint32;case 64:return e?C.Int64:C.Uint64}return C.Int}case C.Float:switch(i.precision){case xt.HALF:return C.Float16;case xt.SINGLE:return C.Float32;case xt.DOUBLE:return C.Float64}return C.Float;case C.Binary:return C.Binary;case C.Utf8:return C.Utf8;case C.Bool:return C.Bool;case C.Decimal:return C.Decimal;case C.Time:switch(i.unit){case st.SECOND:return C.TimeSecond;case st.MILLISECOND:return C.TimeMillisecond;case st.MICROSECOND:return C.TimeMicrosecond;case st.NANOSECOND:return C.TimeNanosecond}return C.Time;case C.Timestamp:switch(i.unit){case st.SECOND:return C.TimestampSecond;case st.MILLISECOND:return C.TimestampMillisecond;case st.MICROSECOND:return C.TimestampMicrosecond;case st.NANOSECOND:return C.TimestampNanosecond}return C.Timestamp;case C.Date:switch(i.unit){case ee.DAY:return C.DateDay;case ee.MILLISECOND:return C.DateMillisecond}return C.Date;case C.Interval:switch(i.unit){case he.DAY_TIME:return C.IntervalDayTime;case he.YEAR_MONTH:return C.IntervalYearMonth}return C.Interval;case C.Map:return C.Map;case C.List:return C.List;case C.Struct:return C.Struct;case C.Union:switch(i.mode){case Dt.Dense:return C.DenseUnion;case Dt.Sparse:return C.SparseUnion}return C.Union;case C.FixedSizeBinary:return C.FixedSizeBinary;case C.FixedSizeList:return C.FixedSizeList;case C.Dictionary:return C.Dictionary}throw new Error(`Unrecognized type '${C[i.typeId]}'`)}P.prototype.visitInt8=null;P.prototype.visitInt16=null;P.prototype.visitInt32=null;P.prototype.visitInt64=null;P.prototype.visitUint8=null;P.prototype.visitUint16=null;P.prototype.visitUint32=null;P.prototype.visitUint64=null;P.prototype.visitFloat16=null;P.prototype.visitFloat32=null;P.prototype.visitFloat64=null;P.prototype.visitDateDay=null;P.prototype.visitDateMillisecond=null;P.prototype.visitTimestampSecond=null;P.prototype.visitTimestampMillisecond=null;P.prototype.visitTimestampMicrosecond=null;P.prototype.visitTimestampNanosecond=null;P.prototype.visitTimeSecond=null;P.prototype.visitTimeMillisecond=null;P.prototype.visitTimeMicrosecond=null;P.prototype.visitTimeNanosecond=null;P.prototype.visitDenseUnion=null;P.prototype.visitSparseUnion=null;P.prototype.visitIntervalDayTime=null;P.prototype.visitIntervalYearMonth=null;var Aa={};mr(Aa,{float64ToUint16:()=>Sn,uint16ToFloat64:()=>$s});var xh=new Float64Array(1),Hr=new Uint32Array(xh.buffer);function $s(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 Sn(i){if(i!==i)return 32256;xh[0]=i;let t=(Hr[1]&2147483648)>>16&65535,e=Hr[1]&2146435072,r=0;return e>=1089470464?Hr[0]>0?e=31744:(e=(e&2080374784)>>16,r=(Hr[1]&1048575)>>10):e<=1056964608?(r=1048576+(Hr[1]&1048575),r=1048576+(r<<(e>>20)-998)>>21,e=0):(e=e-1056964608>>10,r=(Hr[1]&1048575)+512>>10),t|e|r&65535}var X=class extends P{};function et(i){return(t,e,r)=>{if(t.setValid(e,r!=null))return i(t,e,r)}}var _j=(i,t,e)=>{i[t]=Math.trunc(e/864e5)},Fa=(i,t,e)=>{i[t]=Math.trunc(e%4294967296),i[t+1]=Math.trunc(e/4294967296)},mj=(i,t,e)=>{i[t]=Math.trunc(e*1e3%4294967296),i[t+1]=Math.trunc(e*1e3/4294967296)},bj=(i,t,e)=>{i[t]=Math.trunc(e*1e6%4294967296),i[t+1]=Math.trunc(e*1e6/4294967296)},Bh=(i,t,e,r)=>{if(e+1<t.length){let{[e]:n,[e+1]:o}=t;i.set(r.subarray(0,o-n),n)}},vj=({offset:i,values:t},e,r)=>{let n=i+e;r?t[n>>3]|=1<<n%8:t[n>>3]&=~(1<<n%8)},Ui=({values:i},t,e)=>{i[t]=e},xa=({values:i},t,e)=>{i[t]=e},Th=({values:i},t,e)=>{i[t]=Sn(e)},gj=(i,t,e)=>{switch(i.type.precision){case xt.HALF:return Th(i,t,e);case xt.SINGLE:case xt.DOUBLE:return xa(i,t,e)}},Ys=({values:i},t,e)=>{_j(i,t,e.valueOf())},Xs=({values:i},t,e)=>{Fa(i,t*2,e.valueOf())},Ba=({stride:i,values:t},e,r)=>{t.set(r.subarray(0,i),i*e)},wj=({values:i,valueOffsets:t},e,r)=>Bh(i,t,e,r),jj=({values:i,valueOffsets:t},e,r)=>{Bh(i,t,e,Ji(r))},Ta=(i,t,e)=>{i.type.unit===ee.DAY?Ys(i,t,e):Xs(i,t,e)},Gs=({values:i},t,e)=>Fa(i,t*2,e/1e3),Ks=({values:i},t,e)=>Fa(i,t*2,e),Js=({values:i},t,e)=>mj(i,t*2,e),qs=({values:i},t,e)=>bj(i,t*2,e),Da=(i,t,e)=>{switch(i.type.unit){case st.SECOND:return Gs(i,t,e);case st.MILLISECOND:return Ks(i,t,e);case st.MICROSECOND:return Js(i,t,e);case st.NANOSECOND:return qs(i,t,e)}},Zs=({values:i},t,e)=>{i[t]=e},Qs=({values:i},t,e)=>{i[t]=e},to=({values:i},t,e)=>{i[t]=e},eo=({values:i},t,e)=>{i[t]=e},Ea=(i,t,e)=>{switch(i.type.unit){case st.SECOND:return Zs(i,t,e);case st.MILLISECOND:return Qs(i,t,e);case st.MICROSECOND:return to(i,t,e);case st.NANOSECOND:return eo(i,t,e)}},ka=({values:i,stride:t},e,r)=>{i.set(r.subarray(0,t),t*e)},Sj=(i,t,e)=>{let r=i.children[0],n=i.valueOffsets,o=ie.getVisitFn(r);if(Array.isArray(e))for(let u=-1,h=n[t],m=n[t+1];h<m;)o(r,h++,e[++u]);else for(let u=-1,h=n[t],m=n[t+1];h<m;)o(r,h++,e.get(++u))},Ij=(i,t,e)=>{let r=i.children[0],{valueOffsets:n}=i,o=ie.getVisitFn(r),{[t]:u,[t+1]:h}=n,m=e instanceof Map?e.entries():Object.entries(e);for(let g of m)if(o(r,u,g),++u>=h)break},Cj=(i,t)=>(e,r,n,o)=>r&&e(r,i,t[o]),Aj=(i,t)=>(e,r,n,o)=>r&&e(r,i,t.get(o)),Fj=(i,t)=>(e,r,n,o)=>r&&e(r,i,t.get(n.name)),xj=(i,t)=>(e,r,n,o)=>r&&e(r,i,t[n.name]),Bj=(i,t,e)=>{let r=i.type.children.map(o=>ie.getVisitFn(o.type)),n=e instanceof Map?Fj(t,e):e instanceof G?Aj(t,e):Array.isArray(e)?Cj(t,e):xj(t,e);i.type.children.forEach((o,u)=>n(r[u],i.children[u],o,u))},Tj=(i,t,e)=>{i.type.mode===Dt.Dense?Dh(i,t,e):Eh(i,t,e)},Dh=(i,t,e)=>{let r=i.type.typeIdToChildIndex[i.typeIds[t]],n=i.children[r];ie.visit(n,i.valueOffsets[t],e)},Eh=(i,t,e)=>{let r=i.type.typeIdToChildIndex[i.typeIds[t]],n=i.children[r];ie.visit(n,t,e)},Dj=(i,t,e)=>{var r;(r=i.dictionary)===null||r===void 0||r.set(i.values[t],e)},Oa=(i,t,e)=>{i.type.unit===he.DAY_TIME?io(i,t,e):ro(i,t,e)},io=({values:i},t,e)=>{i.set(e.subarray(0,2),2*t)},ro=({values:i},t,e)=>{i[t]=e[0]*12+e[1]%12},Ej=(i,t,e)=>{let{stride:r}=i,n=i.children[0],o=ie.getVisitFn(n);if(Array.isArray(e))for(let u=-1,h=t*r;++u<r;)o(n,h+u,e[u]);else for(let u=-1,h=t*r;++u<r;)o(n,h+u,e.get(u))};X.prototype.visitBool=et(vj);X.prototype.visitInt=et(Ui);X.prototype.visitInt8=et(Ui);X.prototype.visitInt16=et(Ui);X.prototype.visitInt32=et(Ui);X.prototype.visitInt64=et(Ui);X.prototype.visitUint8=et(Ui);X.prototype.visitUint16=et(Ui);X.prototype.visitUint32=et(Ui);X.prototype.visitUint64=et(Ui);X.prototype.visitFloat=et(gj);X.prototype.visitFloat16=et(Th);X.prototype.visitFloat32=et(xa);X.prototype.visitFloat64=et(xa);X.prototype.visitUtf8=et(jj);X.prototype.visitBinary=et(wj);X.prototype.visitFixedSizeBinary=et(Ba);X.prototype.visitDate=et(Ta);X.prototype.visitDateDay=et(Ys);X.prototype.visitDateMillisecond=et(Xs);X.prototype.visitTimestamp=et(Da);X.prototype.visitTimestampSecond=et(Gs);X.prototype.visitTimestampMillisecond=et(Ks);X.prototype.visitTimestampMicrosecond=et(Js);X.prototype.visitTimestampNanosecond=et(qs);X.prototype.visitTime=et(Ea);X.prototype.visitTimeSecond=et(Zs);X.prototype.visitTimeMillisecond=et(Qs);X.prototype.visitTimeMicrosecond=et(to);X.prototype.visitTimeNanosecond=et(eo);X.prototype.visitDecimal=et(ka);X.prototype.visitList=et(Sj);X.prototype.visitStruct=et(Bj);X.prototype.visitUnion=et(Tj);X.prototype.visitDenseUnion=et(Dh);X.prototype.visitSparseUnion=et(Eh);X.prototype.visitDictionary=et(Dj);X.prototype.visitInterval=et(Oa);X.prototype.visitIntervalDayTime=et(io);X.prototype.visitIntervalYearMonth=et(ro);X.prototype.visitFixedSizeList=et(Ej);X.prototype.visitMap=et(Ij);var ie=new X;var ni=Symbol.for("parent"),zr=Symbol.for("rowIndex"),Zi=class{constructor(t,e){return this[ni]=t,this[zr]=e,new Proxy(this,new Ma)}toArray(){return Object.values(this.toJSON())}toJSON(){let t=this[zr],e=this[ni],r=e.type.children,n={};for(let o=-1,u=r.length;++o<u;)n[r[o].name]=Nt.visit(e.children[o],t);return n}toString(){return`{${[...this].map(([t,e])=>`${qe(t)}: ${qe(e)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}[Symbol.iterator](){return new Ra(this[ni],this[zr])}},Ra=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,Nt.visit(this.children[t],this.rowIndex)]}):{done:!0,value:null}}};Object.defineProperties(Zi.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[ni]:{writable:!0,enumerable:!1,configurable:!1,value:null},[zr]:{writable:!0,enumerable:!1,configurable:!1,value:-1}});var Ma=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(t){return t[ni].type.children.map(e=>e.name)}has(t,e){return t[ni].type.children.findIndex(r=>r.name===e)!==-1}getOwnPropertyDescriptor(t,e){if(t[ni].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[ni].type.children.findIndex(n=>n.name===e);if(r!==-1){let n=Nt.visit(t[ni].children[r],t[zr]);return Reflect.set(t,e,n),n}}set(t,e,r){let n=t[ni].type.children.findIndex(o=>o.name===e);return n!==-1?(ie.visit(t[ni].children[n],t[zr],r),Reflect.set(t,e,r)):Reflect.has(t,e)||typeof e=="symbol"?Reflect.set(t,e,r):!1}};var V=class extends P{};function q(i){return(t,e)=>t.getValid(e)?i(t,e):null}var kj=(i,t)=>864e5*i[t],Ua=(i,t)=>4294967296*i[t+1]+(i[t]>>>0),Oj=(i,t)=>4294967296*(i[t+1]/1e3)+(i[t]>>>0)/1e3,Rj=(i,t)=>4294967296*(i[t+1]/1e6)+(i[t]>>>0)/1e6,kh=i=>new Date(i),Mj=(i,t)=>kh(kj(i,t)),Uj=(i,t)=>kh(Ua(i,t)),Lj=(i,t)=>null,Oh=(i,t,e)=>{if(e+1>=t.length)return null;let r=t[e],n=t[e+1];return i.subarray(r,n)},Nj=({offset:i,values:t},e)=>{let r=i+e;return(t[r>>3]&1<<r%8)!==0},Rh=({values:i},t)=>Mj(i,t),Mh=({values:i},t)=>Uj(i,t*2),Qi=({stride:i,values:t},e)=>t[i*e],Pj=({stride:i,values:t},e)=>$s(t[i*e]),Uh=({values:i},t)=>i[t],Vj=({stride:i,values:t},e)=>t.subarray(i*e,i*(e+1)),Hj=({values:i,valueOffsets:t},e)=>Oh(i,t,e),zj=({values:i,valueOffsets:t},e)=>{let r=Oh(i,t,e);return r!==null?bn(r):null},Wj=({values:i},t)=>i[t],$j=({type:i,values:t},e)=>i.precision!==xt.HALF?t[e]:$s(t[e]),Yj=(i,t)=>i.type.unit===ee.DAY?Rh(i,t):Mh(i,t),Lh=({values:i},t)=>1e3*Ua(i,t*2),Nh=({values:i},t)=>Ua(i,t*2),Ph=({values:i},t)=>Oj(i,t*2),Vh=({values:i},t)=>Rj(i,t*2),Xj=(i,t)=>{switch(i.type.unit){case st.SECOND:return Lh(i,t);case st.MILLISECOND:return Nh(i,t);case st.MICROSECOND:return Ph(i,t);case st.NANOSECOND:return Vh(i,t)}},Hh=({values:i},t)=>i[t],zh=({values:i},t)=>i[t],Wh=({values:i},t)=>i[t],$h=({values:i},t)=>i[t],Gj=(i,t)=>{switch(i.type.unit){case st.SECOND:return Hh(i,t);case st.MILLISECOND:return zh(i,t);case st.MICROSECOND:return Wh(i,t);case st.NANOSECOND:return $h(i,t)}},Kj=({values:i,stride:t},e)=>vr.decimal(i.subarray(t*e,t*(e+1))),Jj=(i,t)=>{let{valueOffsets:e,stride:r,children:n}=i,{[t*r]:o,[t*r+1]:u}=e,m=n[0].slice(o,u-o);return new G([m])},qj=(i,t)=>{let{valueOffsets:e,children:r}=i,{[t]:n,[t+1]:o}=e,u=r[0];return new fi(u.slice(n,o-n))},Zj=(i,t)=>new Zi(i,t),Qj=(i,t)=>i.type.mode===Dt.Dense?Yh(i,t):Xh(i,t),Yh=(i,t)=>{let e=i.type.typeIdToChildIndex[i.typeIds[t]],r=i.children[e];return Nt.visit(r,i.valueOffsets[t])},Xh=(i,t)=>{let e=i.type.typeIdToChildIndex[i.typeIds[t]],r=i.children[e];return Nt.visit(r,t)},tS=(i,t)=>{var e;return(e=i.dictionary)===null||e===void 0?void 0:e.get(i.values[t])},eS=(i,t)=>i.type.unit===he.DAY_TIME?Gh(i,t):Kh(i,t),Gh=({values:i},t)=>i.subarray(2*t,2*(t+1)),Kh=({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},iS=(i,t)=>{let{stride:e,children:r}=i,o=r[0].slice(t*e,e);return new G([o])};V.prototype.visitNull=q(Lj);V.prototype.visitBool=q(Nj);V.prototype.visitInt=q(Wj);V.prototype.visitInt8=q(Qi);V.prototype.visitInt16=q(Qi);V.prototype.visitInt32=q(Qi);V.prototype.visitInt64=q(Uh);V.prototype.visitUint8=q(Qi);V.prototype.visitUint16=q(Qi);V.prototype.visitUint32=q(Qi);V.prototype.visitUint64=q(Uh);V.prototype.visitFloat=q($j);V.prototype.visitFloat16=q(Pj);V.prototype.visitFloat32=q(Qi);V.prototype.visitFloat64=q(Qi);V.prototype.visitUtf8=q(zj);V.prototype.visitBinary=q(Hj);V.prototype.visitFixedSizeBinary=q(Vj);V.prototype.visitDate=q(Yj);V.prototype.visitDateDay=q(Rh);V.prototype.visitDateMillisecond=q(Mh);V.prototype.visitTimestamp=q(Xj);V.prototype.visitTimestampSecond=q(Lh);V.prototype.visitTimestampMillisecond=q(Nh);V.prototype.visitTimestampMicrosecond=q(Ph);V.prototype.visitTimestampNanosecond=q(Vh);V.prototype.visitTime=q(Gj);V.prototype.visitTimeSecond=q(Hh);V.prototype.visitTimeMillisecond=q(zh);V.prototype.visitTimeMicrosecond=q(Wh);V.prototype.visitTimeNanosecond=q($h);V.prototype.visitDecimal=q(Kj);V.prototype.visitList=q(Jj);V.prototype.visitStruct=q(Zj);V.prototype.visitUnion=q(Qj);V.prototype.visitDenseUnion=q(Yh);V.prototype.visitSparseUnion=q(Xh);V.prototype.visitDictionary=q(tS);V.prototype.visitInterval=q(eS);V.prototype.visitIntervalDayTime=q(Gh);V.prototype.visitIntervalYearMonth=q(Kh);V.prototype.visitFixedSizeList=q(iS);V.prototype.visitMap=q(qj);var Nt=new V;var He=Symbol.for("keys"),Wr=Symbol.for("vals"),fi=class{constructor(t){return this[He]=new G([t.children[0]]).memoize(),this[Wr]=t.children[1],new Proxy(this,new Na)}[Symbol.iterator](){return new La(this[He],this[Wr])}get size(){return this[He].length}toArray(){return Object.values(this.toJSON())}toJSON(){let t=this[He],e=this[Wr],r={};for(let n=-1,o=t.length;++n<o;)r[t.get(n)]=Nt.visit(e,n);return r}toString(){return`{${[...this].map(([t,e])=>`${qe(t)}: ${qe(e)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}},La=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),Nt.visit(this.vals,t)]})}},Na=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(t){return t[He].toArray().map(String)}has(t,e){return t[He].includes(e)}getOwnPropertyDescriptor(t,e){if(t[He].indexOf(e)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(t,e){if(Reflect.has(t,e))return t[e];let r=t[He].indexOf(e);if(r!==-1){let n=Nt.visit(Reflect.get(t,Wr),r);return Reflect.set(t,e,n),n}}set(t,e,r){let n=t[He].indexOf(e);return n!==-1?(ie.visit(Reflect.get(t,Wr),n,r),Reflect.set(t,e,r)):Reflect.has(t,e)?Reflect.set(t,e,r):!1}};Object.defineProperties(fi.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[He]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Wr]:{writable:!0,enumerable:!1,configurable:!1,value:null}});function rS(i,t,e){let r=i.length,n=t>-1?t:r+t%r;return e?e(i,n):n}var Jh;function In(i,t,e,r){let{length:n=0}=i,o=typeof t!="number"?0:t,u=typeof e!="number"?n:e;return o<0&&(o=(o%n+n)%n),u<0&&(u=(u%n+n)%n),u<o&&(Jh=o,o=u,u=Jh),u>n&&(u=n),r?r(i,o,u):[o,u]}var qh=i=>i!==i;function tr(i){if(typeof i!=="object"||i===null)return qh(i)?qh: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?ga(i,e):!1:i instanceof Map?sS(i):Array.isArray(i)?nS(i):i instanceof G?oS(i):aS(i,!0)}function nS(i){let t=[];for(let e=-1,r=i.length;++e<r;)t[e]=tr(i[e]);return no(t)}function sS(i){let t=-1,e=[];for(let r of i.values())e[++t]=tr(r);return no(e)}function oS(i){let t=[];for(let e=-1,r=i.length;++e<r;)t[e]=tr(i.get(e));return no(t)}function aS(i,t=!1){let e=Object.keys(i);if(!t&&e.length===0)return()=>!1;let r=[];for(let n=-1,o=e.length;++n<o;)r[n]=tr(i[e[n]]);return no(r,e)}function no(i,t){return e=>{if(!e||typeof e!="object")return!1;switch(e.constructor){case Array:return lS(i,e);case Map:return Zh(i,e,e.keys());case fi:case Zi:case Object:case void 0:return Zh(i,e,t||Object.keys(e))}return e instanceof G?cS(i,e):!1}}function lS(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 cS(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 Zh(i,t,e){let r=e[Symbol.iterator](),n=t instanceof Map?t.keys():Object.keys(t)[Symbol.iterator](),o=t instanceof Map?t.values():Object.values(t)[Symbol.iterator](),u=0,h=i.length,m=o.next(),g=r.next(),F=n.next();for(;u<h&&!g.done&&!F.done&&!m.done&&!(g.value!==F.value||!i[u](m.value));++u,g=r.next(),F=n.next(),m=o.next());return u===h&&g.done&&F.done&&m.done?!0:(r.return&&r.return(),n.return&&n.return(),o.return&&o.return(),!1)}var Va={};mr(Va,{BitIterator:()=>gr,getBit:()=>Qh,getBool:()=>oo,packBools:()=>wr,popcnt_array:()=>tp,popcnt_bit_range:()=>Cn,popcnt_uint32:()=>so,setBool:()=>uS,truncateBitmap:()=>$r});function oo(i,t,e,r){return(e&1<<r)!==0}function Qh(i,t,e,r){return(e&1<<r)>>r}function uS(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 n=new Uint8Array(r);return n.set(i%8===0?e.subarray(i>>3):wr(new gr(e,i,t,null,oo)).subarray(0,r)),n}return e}function wr(i){let t=[],e=0,r=0,n=0;for(let u of i)u&&(n|=1<<r),++r===8&&(t[e++]=n,n=r=0);(e===0||r>0)&&(t[e++]=n);let o=new Uint8Array(t.length+7&-8);return o.set(t),o}var gr=class{constructor(t,e,r,n,o){this.bytes=t,this.length=r,this.context=n,this.get=o,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 o=0;for(let u of new gr(i,t,e-t,i,Qh))o+=u;return o}let r=e>>3<<3,n=t+(t%8===0?0:8-t%8);return Cn(i,t,n)+Cn(i,r,e)+tp(i,n>>3,r-n>>3)}function tp(i,t,e){let r=0,n=Math.trunc(t),o=new DataView(i.buffer,i.byteOffset,i.byteLength),u=e===void 0?i.byteLength:n+e;for(;u-n>=4;)r+=so(o.getUint32(n)),n+=4;for(;u-n>=2;)r+=so(o.getUint16(n)),n+=2;for(;u-n>=1;)r+=so(o.getUint8(n)),n+=1;return r}function so(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 dS=-1,ht=class{constructor(t,e,r,n,o,u=[],h){this.type=t,this.children=u,this.dictionary=h,this.offset=Math.floor(Math.max(e||0,0)),this.length=Math.floor(Math.max(r||0,0)),this._nullCount=Math.floor(Math.max(n||0,-1));let m;o instanceof ht?(this.stride=o.stride,this.values=o.values,this.typeIds=o.typeIds,this.nullBitmap=o.nullBitmap,this.valueOffsets=o.valueOffsets):(this.stride=ke(t),o&&((m=o[0])&&(this.valueOffsets=m),(m=o[1])&&(this.values=m),(m=o[2])&&(this.nullBitmap=m),(m=o[3])&&(this.typeIds=m))),this.nullable=this._nullCount!==0&&this.nullBitmap&&this.nullBitmap.byteLength>0}get typeId(){return this.type.typeId}get ArrayType(){return this.type.ArrayType}get buffers(){return[this.valueOffsets,this.values,this.nullBitmap,this.typeIds]}get byteLength(){let t=0,{valueOffsets:e,values:r,nullBitmap:n,typeIds:o}=this;return e&&(t+=e.byteLength),r&&(t+=r.byteLength),n&&(t+=n.byteLength),o&&(t+=o.byteLength),this.children.reduce((u,h)=>u+h.byteLength,t)}get nullCount(){let t=this._nullCount,e;return t<=dS&&(e=this.nullBitmap)&&(this._nullCount=t=this.length-Cn(e,this.offset,this.offset+this.length)),t}getValid(t){if(this.nullable&&this.nullCount>0){let e=this.offset+t;return(this.nullBitmap[e>>3]&1<<e%8)!==0}return!0}setValid(t,e){if(!this.nullable)return e;if(!this.nullBitmap||this.nullBitmap.byteLength<=t>>3){let{nullBitmap:m}=this._changeLengthAndBackfillNullBitmap(this.length);Object.assign(this,{nullBitmap:m,_nullCount:0})}let{nullBitmap:r,offset:n}=this,o=n+t>>3,u=(n+t)%8,h=r[o]>>u&1;return e?h===0&&(r[o]|=1<<u,this._nullCount=this.nullCount+1):h===1&&(r[o]&=~(1<<u),this._nullCount=this.nullCount-1),e}clone(t=this.type,e=this.offset,r=this.length,n=this._nullCount,o=this,u=this.children){return new ht(t,e,r,n,o,u,this.dictionary)}slice(t,e){let{stride:r,typeId:n,children:o}=this,u=+(this._nullCount===0)-1,h=n===16?r:1,m=this._sliceBuffers(t,e,r,n);return this.clone(this.type,this.offset+t,e,u,m,o.length===0||this.valueOffsets?o:this._sliceChildren(o,h*t,h*e))}_changeLengthAndBackfillNullBitmap(t){if(this.typeId===C.Null)return this.clone(this.type,0,t,0);let{length:e,nullCount:r}=this,n=new Uint8Array((t+63&-64)>>3).fill(255,0,e>>3);n[e>>3]=(1<<e-(e&-8))-1,r>0&&n.set($r(this.offset,e,this.nullBitmap),0);let o=this.buffers;return o[Ve.VALIDITY]=n,this.clone(this.type,0,t,r+(t-e),o)}_sliceBuffers(t,e,r,n){let o,{buffers:u}=this;return(o=u[Ve.TYPE])&&(u[Ve.TYPE]=o.subarray(t,t+e)),(o=u[Ve.OFFSET])&&(u[Ve.OFFSET]=o.subarray(t,t+e+1))||(o=u[Ve.DATA])&&(u[Ve.DATA]=n===6?o:o.subarray(r*t,r*(t+e))),u}_sliceChildren(t,e,r){return t.map(n=>n.slice(e,r))}};ht.prototype.children=Object.freeze([]);var jr=class extends P{visit(t){return this.getVisitFn(t.type).call(this,t)}visitNull(t){let{["type"]:e,["offset"]:r=0,["length"]:n=0}=t;return new ht(e,r,n,0)}visitBool(t){let{["type"]:e,["offset"]:r=0}=t,n=Y(t.nullBitmap),o=rt(e.ArrayType,t.data),{["length"]:u=o.length>>3,["nullCount"]:h=t.nullBitmap?-1:0}=t;return new ht(e,r,u,h,[void 0,o,n])}visitInt(t){let{["type"]:e,["offset"]:r=0}=t,n=Y(t.nullBitmap),o=rt(e.ArrayType,t.data),{["length"]:u=o.length,["nullCount"]:h=t.nullBitmap?-1:0}=t;return new ht(e,r,u,h,[void 0,o,n])}visitFloat(t){let{["type"]:e,["offset"]:r=0}=t,n=Y(t.nullBitmap),o=rt(e.ArrayType,t.data),{["length"]:u=o.length,["nullCount"]:h=t.nullBitmap?-1:0}=t;return new ht(e,r,u,h,[void 0,o,n])}visitUtf8(t){let{["type"]:e,["offset"]:r=0}=t,n=Y(t.data),o=Y(t.nullBitmap),u=br(t.valueOffsets),{["length"]:h=u.length-1,["nullCount"]:m=t.nullBitmap?-1:0}=t;return new ht(e,r,h,m,[u,n,o])}visitBinary(t){let{["type"]:e,["offset"]:r=0}=t,n=Y(t.data),o=Y(t.nullBitmap),u=br(t.valueOffsets),{["length"]:h=u.length-1,["nullCount"]:m=t.nullBitmap?-1:0}=t;return new ht(e,r,h,m,[u,n,o])}visitFixedSizeBinary(t){let{["type"]:e,["offset"]:r=0}=t,n=Y(t.nullBitmap),o=rt(e.ArrayType,t.data),{["length"]:u=o.length/ke(e),["nullCount"]:h=t.nullBitmap?-1:0}=t;return new ht(e,r,u,h,[void 0,o,n])}visitDate(t){let{["type"]:e,["offset"]:r=0}=t,n=Y(t.nullBitmap),o=rt(e.ArrayType,t.data),{["length"]:u=o.length/ke(e),["nullCount"]:h=t.nullBitmap?-1:0}=t;return new ht(e,r,u,h,[void 0,o,n])}visitTimestamp(t){let{["type"]:e,["offset"]:r=0}=t,n=Y(t.nullBitmap),o=rt(e.ArrayType,t.data),{["length"]:u=o.length/ke(e),["nullCount"]:h=t.nullBitmap?-1:0}=t;return new ht(e,r,u,h,[void 0,o,n])}visitTime(t){let{["type"]:e,["offset"]:r=0}=t,n=Y(t.nullBitmap),o=rt(e.ArrayType,t.data),{["length"]:u=o.length/ke(e),["nullCount"]:h=t.nullBitmap?-1:0}=t;return new ht(e,r,u,h,[void 0,o,n])}visitDecimal(t){let{["type"]:e,["offset"]:r=0}=t,n=Y(t.nullBitmap),o=rt(e.ArrayType,t.data),{["length"]:u=o.length/ke(e),["nullCount"]:h=t.nullBitmap?-1:0}=t;return new ht(e,r,u,h,[void 0,o,n])}visitList(t){let{["type"]:e,["offset"]:r=0,["child"]:n}=t,o=Y(t.nullBitmap),u=br(t.valueOffsets),{["length"]:h=u.length-1,["nullCount"]:m=t.nullBitmap?-1:0}=t;return new ht(e,r,h,m,[u,void 0,o],[n])}visitStruct(t){let{["type"]:e,["offset"]:r=0,["children"]:n=[]}=t,o=Y(t.nullBitmap),{length:u=n.reduce((m,{length:g})=>Math.max(m,g),0),nullCount:h=t.nullBitmap?-1:0}=t;return new ht(e,r,u,h,[void 0,void 0,o],n)}visitUnion(t){let{["type"]:e,["offset"]:r=0,["children"]:n=[]}=t,o=Y(t.nullBitmap),u=rt(e.ArrayType,t.typeIds),{["length"]:h=u.length,["nullCount"]:m=t.nullBitmap?-1:0}=t;if(L.isSparseUnion(e))return new ht(e,r,h,m,[void 0,void 0,o,u],n);let g=br(t.valueOffsets);return new ht(e,r,h,m,[g,void 0,o,u],n)}visitDictionary(t){let{["type"]:e,["offset"]:r=0}=t,n=Y(t.nullBitmap),o=rt(e.indices.ArrayType,t.data),{["dictionary"]:u=new G([new jr().visit({type:e.dictionary})])}=t,{["length"]:h=o.length,["nullCount"]:m=t.nullBitmap?-1:0}=t;return new ht(e,r,h,m,[void 0,o,n],[],u)}visitInterval(t){let{["type"]:e,["offset"]:r=0}=t,n=Y(t.nullBitmap),o=rt(e.ArrayType,t.data),{["length"]:u=o.length/ke(e),["nullCount"]:h=t.nullBitmap?-1:0}=t;return new ht(e,r,u,h,[void 0,o,n])}visitFixedSizeList(t){let{["type"]:e,["offset"]:r=0,["child"]:n=new jr().visit({type:e.valueType})}=t,o=Y(t.nullBitmap),{["length"]:u=n.length/ke(e),["nullCount"]:h=t.nullBitmap?-1:0}=t;return new ht(e,r,u,h,[void 0,void 0,o],[n])}visitMap(t){let{["type"]:e,["offset"]:r=0,["child"]:n=new jr().visit({type:e.childType})}=t,o=Y(t.nullBitmap),u=br(t.valueOffsets),{["length"]:h=u.length-1,["nullCount"]:m=t.nullBitmap?-1:0}=t;return new ht(e,r,h,m,[u,void 0,o],[n])}};function J(i){return new jr().visit(i)}var An=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 ao(i){return i.reduce((t,e)=>t+e.nullCount,0)}function lo(i){return i.reduce((t,e,r)=>(t[r+1]=t[r]+e.length,t),new Uint32Array(i.length+1))}function co(i,t,e,r){let n=[];for(let o=-1,u=i.length;++o<u;){let h=i[o],m=t[o],{length:g}=h;if(m>=r)break;if(e>=m+g)continue;if(m>=e&&m+g<=r){n.push(h);continue}let F=Math.max(0,e-m),D=Math.min(r-m,g);n.push(h.slice(F,D-F))}return n.length===0&&n.push(i[0].slice(0,0)),n}function Ha(i,t,e,r){let n=0,o=0,u=t.length-1;do{if(n>=u-1)return e<t[u]?r(i,n,e-t[n]):null;o=n+Math.trunc((u-n)*.5),e<t[o]?u=o:n=o}while(n<u)}function Fn(i,t){return i.getValid(t)}function er(i){function t(e,r,n){return i(e[r],n)}return function(e){let r=this.data;return Ha(r,this._offsets,e,t)}}function uo(i){let t;function e(r,n,o){return i(r[n],o,t)}return function(r,n){let o=this.data;t=n;let u=Ha(o,this._offsets,r,e);return t=void 0,u}}function fo(i){let t;function e(r,n,o){let u=o,h=0,m=0;for(let g=n-1,F=r.length;++g<F;){let D=r[g];if(~(h=i(D,t,u)))return m+h;u=0,m+=D.length}return-1}return function(r,n){t=r;let o=this.data,u=typeof n!="number"?e(o,0,0):Ha(o,this._offsets,n,e);return t=void 0,u}}var H=class extends P{};function fS(i,t){return t===null&&i.length>0?0:-1}function hS(i,t){let{nullBitmap:e}=i;if(!e||i.nullCount<=0)return-1;let r=0;for(let n of new gr(e,i.offset+(t||0),i.length,e,oo)){if(!n)return r;++r}return-1}function nt(i,t,e){if(t===void 0)return-1;if(t===null)return hS(i,e);let r=Nt.getVisitFn(i),n=tr(t);for(let o=(e||0)-1,u=i.length;++o<u;)if(n(r(i,o)))return o;return-1}function ep(i,t,e){let r=Nt.getVisitFn(i),n=tr(t);for(let o=(e||0)-1,u=i.length;++o<u;)if(n(r(i,o)))return o;return-1}H.prototype.visitNull=fS;H.prototype.visitBool=nt;H.prototype.visitInt=nt;H.prototype.visitInt8=nt;H.prototype.visitInt16=nt;H.prototype.visitInt32=nt;H.prototype.visitInt64=nt;H.prototype.visitUint8=nt;H.prototype.visitUint16=nt;H.prototype.visitUint32=nt;H.prototype.visitUint64=nt;H.prototype.visitFloat=nt;H.prototype.visitFloat16=nt;H.prototype.visitFloat32=nt;H.prototype.visitFloat64=nt;H.prototype.visitUtf8=nt;H.prototype.visitBinary=nt;H.prototype.visitFixedSizeBinary=nt;H.prototype.visitDate=nt;H.prototype.visitDateDay=nt;H.prototype.visitDateMillisecond=nt;H.prototype.visitTimestamp=nt;H.prototype.visitTimestampSecond=nt;H.prototype.visitTimestampMillisecond=nt;H.prototype.visitTimestampMicrosecond=nt;H.prototype.visitTimestampNanosecond=nt;H.prototype.visitTime=nt;H.prototype.visitTimeSecond=nt;H.prototype.visitTimeMillisecond=nt;H.prototype.visitTimeMicrosecond=nt;H.prototype.visitTimeNanosecond=nt;H.prototype.visitDecimal=nt;H.prototype.visitList=nt;H.prototype.visitStruct=nt;H.prototype.visitUnion=nt;H.prototype.visitDenseUnion=ep;H.prototype.visitSparseUnion=ep;H.prototype.visitDictionary=nt;H.prototype.visitInterval=nt;H.prototype.visitIntervalDayTime=nt;H.prototype.visitIntervalYearMonth=nt;H.prototype.visitFixedSizeList=nt;H.prototype.visitMap=nt;var Sr=new H;var z=class extends P{};function Z(i){let{type:t}=i;if(i.nullCount===0&&i.stride===1&&(t.typeId===C.Timestamp||t instanceof Mt&&t.bitWidth!==64||t instanceof Qe&&t.bitWidth!==64||t instanceof ve&&t.precision!==xt.HALF))return new An(i.data.length,r=>{let n=i.data[r];return n.values.subarray(0,n.length)[Symbol.iterator]()});let e=0;return new An(i.data.length,r=>{let o=i.data[r].length,u=i.slice(e,e+o);return e+=o,new za(u)})}var za=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}};z.prototype.visitNull=Z;z.prototype.visitBool=Z;z.prototype.visitInt=Z;z.prototype.visitInt8=Z;z.prototype.visitInt16=Z;z.prototype.visitInt32=Z;z.prototype.visitInt64=Z;z.prototype.visitUint8=Z;z.prototype.visitUint16=Z;z.prototype.visitUint32=Z;z.prototype.visitUint64=Z;z.prototype.visitFloat=Z;z.prototype.visitFloat16=Z;z.prototype.visitFloat32=Z;z.prototype.visitFloat64=Z;z.prototype.visitUtf8=Z;z.prototype.visitBinary=Z;z.prototype.visitFixedSizeBinary=Z;z.prototype.visitDate=Z;z.prototype.visitDateDay=Z;z.prototype.visitDateMillisecond=Z;z.prototype.visitTimestamp=Z;z.prototype.visitTimestampSecond=Z;z.prototype.visitTimestampMillisecond=Z;z.prototype.visitTimestampMicrosecond=Z;z.prototype.visitTimestampNanosecond=Z;z.prototype.visitTime=Z;z.prototype.visitTimeSecond=Z;z.prototype.visitTimeMillisecond=Z;z.prototype.visitTimeMicrosecond=Z;z.prototype.visitTimeNanosecond=Z;z.prototype.visitDecimal=Z;z.prototype.visitList=Z;z.prototype.visitStruct=Z;z.prototype.visitUnion=Z;z.prototype.visitDenseUnion=Z;z.prototype.visitSparseUnion=Z;z.prototype.visitDictionary=Z;z.prototype.visitInterval=Z;z.prototype.visitIntervalDayTime=Z;z.prototype.visitIntervalYearMonth=Z;z.prototype.visitFixedSizeList=Z;z.prototype.visitMap=Z;var Yr=new z;var pS=(i,t)=>i+t,hi=class extends P{visitNull(t,e){return 0}visitInt(t,e){return t.type.bitWidth/8}visitFloat(t,e){return t.type.ArrayType.BYTES_PER_ELEMENT}visitBool(t,e){return 1/8}visitDecimal(t,e){return t.type.bitWidth/8}visitDate(t,e){return(t.type.unit+1)*4}visitTime(t,e){return t.type.bitWidth/8}visitTimestamp(t,e){return t.type.unit===st.SECOND?4:8}visitInterval(t,e){return(t.type.unit+1)*4}visitStruct(t,e){return t.children.reduce((r,n)=>r+Oe.visit(n,e),0)}visitFixedSizeBinary(t,e){return t.type.byteWidth}visitMap(t,e){return 8+t.children.reduce((r,n)=>r+Oe.visit(n,e),0)}visitDictionary(t,e){var r;return t.type.indices.bitWidth/8+(((r=t.dictionary)===null||r===void 0?void 0:r.getByteLength(t.values[e]))||0)}},yS=({valueOffsets:i},t)=>8+(i[t+1]-i[t]),_S=({valueOffsets:i},t)=>8+(i[t+1]-i[t]),mS=({valueOffsets:i,stride:t,children:e},r)=>{let n=e[0],{[r*t]:o}=i,{[r*t+1]:u}=i,h=Oe.getVisitFn(n.type),m=n.slice(o,u-o),g=8;for(let F=-1,D=u-o;++F<D;)g+=h(m,F);return g},bS=({stride:i,children:t},e)=>{let r=t[0],n=r.slice(e*i,i),o=Oe.getVisitFn(r.type),u=0;for(let h=-1,m=n.length;++h<m;)u+=o(n,h);return u},vS=(i,t)=>i.type.mode===Dt.Dense?ip(i,t):rp(i,t),ip=({type:i,children:t,typeIds:e,valueOffsets:r},n)=>{let o=i.typeIdToChildIndex[e[n]];return 8+Oe.visit(t[o],r[n])},rp=({children:i},t)=>4+Oe.visitMany(i,i.map(()=>t)).reduce(pS,0);hi.prototype.visitUtf8=yS;hi.prototype.visitBinary=_S;hi.prototype.visitList=mS;hi.prototype.visitFixedSizeList=bS;hi.prototype.visitUnion=vS;hi.prototype.visitDenseUnion=ip;hi.prototype.visitSparseUnion=rp;var Oe=new hi;var np,sp={},op={},G=class{constructor(t){var e,r,n;let o=t[0]instanceof G?t.flatMap(h=>h.data):t;if(o.length===0||o.some(h=>!(h instanceof ht)))throw new TypeError("Vector constructor expects an Array of Data instances.");let u=(e=o[0])===null||e===void 0?void 0:e.type;switch(o.length){case 0:this._offsets=[0];break;case 1:{let{get:h,set:m,indexOf:g,byteLength:F}=sp[u.typeId],D=o[0];this.isValid=B=>Fn(D,B),this.get=B=>h(D,B),this.set=(B,k)=>m(D,B,k),this.indexOf=B=>g(D,B),this.getByteLength=B=>F(D,B),this._offsets=[0,D.length];break}default:Object.setPrototypeOf(this,op[u.typeId]),this._offsets=lo(o);break}this.data=o,this.type=u,this.stride=ke(u),this.numChildren=(n=(r=u.children)===null||r===void 0?void 0:r.length)!==null&&n!==void 0?n:0,this.length=this._offsets[this._offsets.length-1]}get byteLength(){return this._byteLength===-1&&(this._byteLength=this.data.reduce((t,e)=>t+e.byteLength,0)),this._byteLength}get nullCount(){return this._nullCount===-1&&(this._nullCount=ao(this.data)),this._nullCount}get ArrayType(){return this.type.ArrayType}get[Symbol.toStringTag](){return`${this.VectorName}<${this.type[Symbol.toStringTag]}>`}get VectorName(){return`${C[this.type.typeId]}Vector`}isValid(t){return!1}get(t){return null}set(t,e){}indexOf(t,e){return-1}includes(t,e){return this.indexOf(t,e)>0}getByteLength(t){return 0}[Symbol.iterator](){return Yr.visit(this)}concat(...t){return new G(this.data.concat(t.flatMap(e=>e.data).flat(Number.POSITIVE_INFINITY)))}slice(t,e){return new G(In(this,t,e,({data:r,_offsets:n},o,u)=>co(r,n,o,u)))}toJSON(){return[...this]}toArray(){let{type:t,data:e,length:r,stride:n,ArrayType:o}=this;switch(t.typeId){case C.Int:case C.Float:case C.Decimal:case C.Time:case C.Timestamp:switch(e.length){case 0:return new o;case 1:return e[0].values.subarray(0,r*n);default:return e.reduce((u,{values:h})=>(u.array.set(h,u.offset),u.offset+=h.length,u),{array:new o(r*n),offset:0}).array}}return[...this]}toString(){return`[${[...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 G(this.data.map(({children:e})=>e[t])):null}get isMemoized(){return L.isDictionary(this.type)?this.data[0].dictionary.isMemoized:!1}memoize(){if(L.isDictionary(this.type)){let t=new Xr(this.data[0].dictionary),e=this.data.map(r=>{let n=r.clone();return n.dictionary=t,n});return new G(e)}return new Xr(this)}unmemoize(){if(L.isDictionary(this.type)&&this.isMemoized){let t=this.data[0].dictionary.unmemoize(),e=this.data.map(r=>{let n=r.clone();return n.dictionary=t,n});return new G(e)}return this}};np=Symbol.toStringTag;G[np]=(i=>{i.type=L.prototype,i.data=[],i.length=0,i.stride=1,i.numChildren=0,i._nullCount=-1,i._byteLength=-1,i._offsets=new Uint32Array([0]),i[Symbol.isConcatSpreadable]=!0;let t=Object.keys(C).map(e=>C[e]).filter(e=>typeof e=="number"&&e!==C.NONE);for(let e of t){let r=Nt.getVisitFnByTypeId(e),n=ie.getVisitFnByTypeId(e),o=Sr.getVisitFnByTypeId(e),u=Oe.getVisitFnByTypeId(e);sp[e]={get:r,set:n,indexOf:o,byteLength:u},op[e]=Object.create(i,{isValid:{value:er(Fn)},get:{value:er(Nt.getVisitFnByTypeId(e))},set:{value:uo(ie.getVisitFnByTypeId(e))},indexOf:{value:fo(Sr.getVisitFnByTypeId(e))},getByteLength:{value:er(Oe.getVisitFnByTypeId(e))}})}return"Vector"})(G.prototype);var Xr=class extends G{constructor(t){super(t.data);let e=this.get,r=this.set,n=this.slice,o=new Array(this.length);Object.defineProperty(this,"get",{value(u){let h=o[u];if(h!==void 0)return h;let m=e.call(this,u);return o[u]=m,m}}),Object.defineProperty(this,"set",{value(u,h){r.call(this,u,h),o[u]=h}}),Object.defineProperty(this,"slice",{value:(u,h)=>new Xr(n.call(this,u,h))}),Object.defineProperty(this,"isMemoized",{value:!0}),Object.defineProperty(this,"unmemoize",{value:()=>new G(this.data)}),Object.defineProperty(this,"memoize",{value:()=>this})}};function ap(i){if(!i||i.length<=0)return function(n){return!0};let t="",e=i.filter(r=>r===r);return e.length>0&&(t=`
2
2
  switch (x) {${e.map(r=>`
3
- case ${aS(r)}:`).join("")}
3
+ case ${gS(r)}:`).join("")}
4
4
  return false;
5
5
  }`),i.length!==e.length&&(t=`if (x !== x) return false;
6
6
  ${t}`),new Function("x",`${t}
7
- return true;`)}function aS(i){return typeof i!="bigint"?Ke(i):js?`${Ke(i)}n`:`"${Ke(i)}"`}var Ha=(i,t)=>(i*t+63&-64||64)/t,lS=(i,t=0)=>i.length>=t?i.subarray(0,t):Ur(new i.constructor(t),i,0),tr=class{constructor(t,e=1){this.buffer=t,this.stride=e,this.BYTES_PER_ELEMENT=t.BYTES_PER_ELEMENT,this.ArrayType=t.constructor,this._resize(this.length=Math.trunc(t.length/e))}get byteLength(){return Math.trunc(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,n=this.buffer.length;r>=n&&this._resize(n===0?Ha(r*1,this.BYTES_PER_ELEMENT):Ha(r*2,this.BYTES_PER_ELEMENT))}return this}flush(t=this.length){t=Ha(t*this.stride,this.BYTES_PER_ELEMENT);let e=lS(this.buffer,t);return this.clear(),e}clear(){return this.length=0,this._resize(0),this}_resize(t){return this.buffer=Ur(new this.ArrayType(t),this.buffer)}};tr.prototype.offset=0;var Ui=class extends tr{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}},Xr=class extends Ui{constructor(t=new Uint8Array(0)){super(t,1/8),this.numValid=0}get numInvalid(){return this.length-this.numValid}get(t){return this.buffer[t>>3]>>t%8&1}set(t,e){let{buffer:r}=this.reserve(t-this.length+1),n=t>>3,o=t%8,c=r[n]>>o&1;return e?c===0&&(r[n]|=1<<o,++this.numValid):c===1&&(r[n]&=~(1<<o),--this.numValid),this}clear(){return this.numValid=0,super.clear()}},Gr=class extends Ui{constructor(t=new Int32Array(1)){super(t,1)}append(t){return this.set(this.length-1,t)}set(t,e){let r=this.length-1,n=this.reserve(t-r+1).buffer;return r<t++&&n.fill(n[r],r,t),n[t]=n[t-1]+e,this}flush(t=this.length-1){return t>this.length&&this.set(t-1,0),super.flush(t+1)}};var Ct=class{constructor({type:t,nullValues:e}){this.length=0,this.finished=!1,this.type=t,this.children=[],this.nullValues=e,this.stride=De(t),this._nulls=new Xr,e&&e.length>0&&(this._isValid=ip(e))}static throughNode(t){throw new Error('"throughNode" not available in this environment')}static throughDOM(t){throw new Error('"throughDOM" not available in this environment')}toVector(){return new G([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:n,_typeIds:o,children:c}=this;return e&&(t+=e.byteLength),r&&(t+=r.byteLength),n&&(t+=n.byteLength),o&&(t+=o.byteLength),c.reduce((p,b)=>p+b.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=`${this.numChildren}`){throw new Error(`Cannot append children to non-nested type "${this.type}"`)}getChildAt(t){return this.children[t]||null}flush(){let t,e,r,n,{type:o,length:c,nullCount:p,_typeIds:b,_offsets:g,_values:A,_nulls:T}=this;(e=b==null?void 0:b.flush(c))?n=g==null?void 0:g.flush(c):(n=g==null?void 0:g.flush(c))?t=A==null?void 0:A.flush(g.last()):t=A==null?void 0:A.flush(c),p>0&&(r=T==null?void 0:T.flush(c));let F=this.children.map(k=>k.flush());return this.clear(),J({type:o,length:c,nullCount:p,children:F,child:F[0],data:t,typeIds:e,nullBitmap:r,valueOffsets:n})}finish(){this.finished=!0;for(let t of this.children)t.finish();return this}clear(){var t,e,r,n;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(),(n=this._typeIds)===null||n===void 0||n.clear();for(let o of this.children)o.clear();return this}};Ct.prototype.length=1;Ct.prototype.stride=1;Ct.prototype.children=null;Ct.prototype.finished=!1;Ct.prototype.nullValues=null;Ct.prototype._isValid=()=>!0;var $t=class extends Ct{constructor(t){super(t),this._values=new Ui(new this.ArrayType(0),this.stride)}setValue(t,e){let r=this._values;return r.reserve(t-r.length+1),super.setValue(t,e)}},fi=class extends Ct{constructor(t){super(t),this._pendingLength=0,this._offsets=new Gr}setValue(t,e){let r=this._pending||(this._pending=new Map),n=r.get(t);n&&(this._pendingLength-=n.length),this._pendingLength+=e instanceof ui?e[Ve].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 wr=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,n){return t.prep(8,24),t.writeInt64(n),t.pad(4),t.writeInt32(r),t.writeInt64(e),t.offset()}};var hi=new Int32Array(2),lo=new Float32Array(hi.buffer),co=new Float64Array(hi.buffer),Kr=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1;var Nt=class{constructor(t,e){this.low=t|0,this.high=e|0}static create(t,e){return t==0&&e==0?Nt.ZERO:new Nt(t,e)}toFloat64(){return(this.low>>>0)+this.high*4294967296}equals(t){return this.low==t.low&&this.high==t.high}};Nt.ZERO=new Nt(0,0);var In;(function(i){i[i.UTF8_BYTES=1]="UTF8_BYTES",i[i.UTF16_STRING=2]="UTF16_STRING"})(In||(In={}));var fe=class{constructor(t){this.bytes_=t,this.position_=0}static allocate(t){return new fe(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 new Nt(this.readInt32(t),this.readInt32(t+4))}readUint64(t){return new Nt(this.readUint32(t),this.readUint32(t+4))}readFloat32(t){return hi[0]=this.readInt32(t),lo[0]}readFloat64(t){return hi[Kr?0:1]=this.readInt32(t),hi[Kr?1:0]=this.readInt32(t+4),co[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,e.low),this.writeInt32(t+4,e.high)}writeUint64(t,e){this.writeUint32(t,e.low),this.writeUint32(t+4,e.high)}writeFloat32(t,e){lo[0]=e,this.writeInt32(t,hi[0])}writeFloat64(t,e){co[0]=e,this.writeInt32(t,hi[Kr?0:1]),this.writeInt32(t+4,hi[Kr?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),n="",o=0;if(t+=4,e===In.UTF8_BYTES)return this.bytes_.subarray(t,t+r);for(;o<r;){let c,p=this.readUint8(t+o++);if(p<192)c=p;else{let b=this.readUint8(t+o++);if(p<224)c=(p&31)<<6|b&63;else{let g=this.readUint8(t+o++);if(p<240)c=(p&15)<<12|(b&63)<<6|g&63;else{let A=this.readUint8(t+o++);c=(p&7)<<18|(b&63)<<12|(g&63)<<6|A&63}}}c<65536?n+=String.fromCharCode(c):(c-=65536,n+=String.fromCharCode((c>>10)+55296,(c&(1<<10)-1)+56320))}return n}__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}createLong(t,e){return Nt.create(t,e)}createScalarList(t,e){let r=[];for(let n=0;n<e;++n)t(n)!==null&&r.push(t(n));return r}createObjList(t,e){let r=[];for(let n=0;n<e;++n){let o=t(n);o!==null&&r.push(o.unpack())}return r}};var Ni=class{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;let e;t?e=t:e=1024,this.bb=fe.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 n=this.bb.capacity();this.bb=Ni.growByteBuffer(this.bb),this.space+=this.bb.capacity()-n}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.equals(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 Error("FlatBuffers: struct must be serialized inline.")}notNested(){if(this.isNested)throw new Error("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,n=fe.allocate(r);return n.setPosition(r-e),n.bytes().set(t.bytes(),r-e),n}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 n=2;this.addInt16(t-this.object_start);let o=(r+n)*2;this.addInt16(o);let c=0,p=this.space;t:for(e=0;e<this.vtables.length;e++){let b=this.bb.capacity()-this.vtables[e];if(o==this.bb.readInt16(b)){for(let g=2;g<o;g+=2)if(this.bb.readInt16(p+g)!=this.bb.readInt16(b+g))continue t;c=this.vtables[e];break}}return c?(this.space=this.bb.capacity()-t,this.bb.writeInt32(this.space,c-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 n=r?4:0;if(e){let o=e;if(this.prep(this.minalign,4+4+n),o.length!=4)throw new Error("FlatBuffers: file identifier must be length "+4);for(let c=4-1;c>=0;c--)this.writeInt8(o.charCodeAt(c))}this.prep(this.minalign,4+n),this.addOffset(t),n&&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,n=r-this.bb.readInt32(r);if(!(this.bb.readInt16(n+e)!=0))throw new Error("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)return 0;let e;if(t instanceof Uint8Array)e=t;else{e=[];let r=0;for(;r<t.length;){let n,o=t.charCodeAt(r++);if(o<55296||o>=56320)n=o;else{let c=t.charCodeAt(r++);n=(o<<10)+c+(65536-(55296<<10)-56320)}n<128?e.push(n):(n<2048?e.push(n>>6&31|192):(n<65536?e.push(n>>12&15|224):e.push(n>>18&7|240,n>>12&63|128),e.push(n>>6&63|128)),e.push(n&63|128))}}this.addInt8(0),this.startVector(1,e.length,1),this.bb.setPosition(this.space-=e.length);for(let r=0,n=this.space,o=this.bb.bytes();r<e.length;r++)o[n++]=e[r];return this.endVector()}createLong(t,e){return Nt.create(t,e)}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 n=t[r];if(n!==null)e.push(this.createObjectOffset(n));else throw new Error("FlatBuffers: Argument for createObjectOffsetList cannot contain null.")}return e}createStructOffsetList(t,e){return e(this,t.length),this.createObjectOffsetList(t),this.endVector()}};var wt=class{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 wt).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsKeyValue(t,e){return t.setPosition(t.position()+4),(e||new wt).__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 wt.startKeyValue(t),wt.addKey(t,e),wt.addValue(t,r),wt.endKeyValue(t)}};var er;(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"})(er||(er={}));var ir;(function(i){i[i.Little=0]="Little",i[i.Big=1]="Big"})(ir||(ir={}));var Cn;(function(i){i[i.DenseArray=0]="DenseArray"})(Cn||(Cn={}));var Yt=class{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 Yt).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsInt(t,e){return t.setPosition(t.position()+4),(e||new Yt).__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 Yt.startInt(t),Yt.addBitWidth(t,e),Yt.addIsSigned(t,r),Yt.endInt(t)}};var ke=class{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 ke).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDictionaryEncoding(t,e){return t.setPosition(t.position()+4),(e||new ke).__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):this.bb.createLong(0,0)}indexType(t){let e=this.bb.__offset(this.bb_pos,6);return e?(t||new Yt).__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):Cn.DenseArray}static startDictionaryEncoding(t){t.startObject(4)}static addId(t,e){t.addFieldInt64(0,e,t.createLong(0,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,Cn.DenseArray)}static endDictionaryEncoding(t){return t.endObject()}};var pi=class{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 pi).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsBinary(t,e){return t.setPosition(t.position()+4),(e||new pi).__init(t.readInt32(t.position())+t.position(),t)}static startBinary(t){t.startObject(0)}static endBinary(t){return t.endObject()}static createBinary(t){return pi.startBinary(t),pi.endBinary(t)}};var yi=class{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 yi).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsBool(t,e){return t.setPosition(t.position()+4),(e||new yi).__init(t.readInt32(t.position())+t.position(),t)}static startBool(t){t.startObject(0)}static endBool(t){return t.endObject()}static createBool(t){return yi.startBool(t),yi.endBool(t)}};var An;(function(i){i[i.DAY=0]="DAY",i[i.MILLISECOND=1]="MILLISECOND"})(An||(An={}));var be=class{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 be).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDate(t,e){return t.setPosition(t.position()+4),(e||new be).__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):An.MILLISECOND}static startDate(t){t.startObject(1)}static addUnit(t,e){t.addFieldInt16(0,e,An.MILLISECOND)}static endDate(t){return t.endObject()}static createDate(t,e){return be.startDate(t),be.addUnit(t,e),be.endDate(t)}};var Xt=class{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 Xt).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDecimal(t,e){return t.setPosition(t.position()+4),(e||new Xt).__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,n){return Xt.startDecimal(t),Xt.addPrecision(t,e),Xt.addScale(t,r),Xt.addBitWidth(t,n),Xt.endDecimal(t)}};var rr;(function(i){i[i.SECOND=0]="SECOND",i[i.MILLISECOND=1]="MILLISECOND",i[i.MICROSECOND=2]="MICROSECOND",i[i.NANOSECOND=3]="NANOSECOND"})(rr||(rr={}));var ve=class{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 ve).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFixedSizeBinary(t,e){return t.setPosition(t.position()+4),(e||new ve).__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 ve.startFixedSizeBinary(t),ve.addByteWidth(t,e),ve.endFixedSizeBinary(t)}};var ge=class{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 ge).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFixedSizeList(t,e){return t.setPosition(t.position()+4),(e||new ge).__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 ge.startFixedSizeList(t),ge.addListSize(t,e),ge.endFixedSizeList(t)}};var xn;(function(i){i[i.HALF=0]="HALF",i[i.SINGLE=1]="SINGLE",i[i.DOUBLE=2]="DOUBLE"})(xn||(xn={}));var we=class{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 we).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFloatingPoint(t,e){return t.setPosition(t.position()+4),(e||new we).__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):xn.HALF}static startFloatingPoint(t){t.startObject(1)}static addPrecision(t,e){t.addFieldInt16(0,e,xn.HALF)}static endFloatingPoint(t){return t.endObject()}static createFloatingPoint(t,e){return we.startFloatingPoint(t),we.addPrecision(t,e),we.endFloatingPoint(t)}};var Fn;(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"})(Fn||(Fn={}));var je=class{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 je).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsInterval(t,e){return t.setPosition(t.position()+4),(e||new je).__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):Fn.YEAR_MONTH}static startInterval(t){t.startObject(1)}static addUnit(t,e){t.addFieldInt16(0,e,Fn.YEAR_MONTH)}static endInterval(t){return t.endObject()}static createInterval(t,e){return je.startInterval(t),je.addUnit(t,e),je.endInterval(t)}};var _i=class{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 Se=class{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 Se).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsMap(t,e){return t.setPosition(t.position()+4),(e||new Se).__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 Se.startMap(t),Se.addKeysSorted(t,e),Se.endMap(t)}};var mi=class{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 mi).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsNull(t,e){return t.setPosition(t.position()+4),(e||new mi).__init(t.readInt32(t.position())+t.position(),t)}static startNull(t){t.startObject(0)}static endNull(t){return t.endObject()}static createNull(t){return mi.startNull(t),mi.endNull(t)}};var bi=class{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 bi).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsStruct_(t,e){return t.setPosition(t.position()+4),(e||new bi).__init(t.readInt32(t.position())+t.position(),t)}static startStruct_(t){t.startObject(0)}static endStruct_(t){return t.endObject()}static createStruct_(t){return bi.startStruct_(t),bi.endStruct_(t)}};var re=class{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 re).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsTime(t,e){return t.setPosition(t.position()+4),(e||new re).__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):rr.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,rr.MILLISECOND)}static addBitWidth(t,e){t.addFieldInt32(1,e,32)}static endTime(t){return t.endObject()}static createTime(t,e,r){return re.startTime(t),re.addUnit(t,e),re.addBitWidth(t,r),re.endTime(t)}};var ne=class{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 ne).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsTimestamp(t,e){return t.setPosition(t.position()+4),(e||new ne).__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):rr.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,rr.SECOND)}static addTimezone(t,e){t.addFieldOffset(1,e,0)}static endTimestamp(t){return t.endObject()}static createTimestamp(t,e,r){return ne.startTimestamp(t),ne.addUnit(t,e),ne.addTimezone(t,r),ne.endTimestamp(t)}};var Bn;(function(i){i[i.Sparse=0]="Sparse",i[i.Dense=1]="Dense"})(Bn||(Bn={}));var Gt=class{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 Gt).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsUnion(t,e){return t.setPosition(t.position()+4),(e||new Gt).__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):Bn.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,Bn.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 Gt.startUnion(t),Gt.addMode(t,e),Gt.addTypeIds(t,r),Gt.endUnion(t)}};var vi=class{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 vi).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsUtf8(t,e){return t.setPosition(t.position()+4),(e||new vi).__init(t.readInt32(t.position())+t.position(),t)}static startUtf8(t){t.startObject(0)}static endUtf8(t){return t.endObject()}static createUtf8(t){return vi.startUtf8(t),vi.endUtf8(t)}};var At;(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"})(At||(At={}));var Lt=class{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 Lt).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsField(t,e){return t.setPosition(t.position()+4),(e||new Lt).__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):At.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 ke).__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 Lt).__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 wt).__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,At.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 Bt=class{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 Bt).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsSchema(t,e){return t.setPosition(t.position()+4),(e||new Bt).__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):ir.Little}fields(t,e){let r=this.bb.__offset(this.bb_pos,6);return r?(e||new Lt).__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 wt).__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):this.bb.createLong(0,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,ir.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,n,o){return Bt.startSchema(t),Bt.addEndianness(t,e),Bt.addFields(t,r),Bt.addCustomMetadata(t,n),Bt.addFeatures(t,o),Bt.endSchema(t)}};var se=class{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 se).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFooter(t,e){return t.setPosition(t.position()+4),(e||new se).__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):er.V1}schema(t){let e=this.bb.__offset(this.bb_pos,6);return e?(t||new Bt).__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 wr).__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 wr).__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 wt).__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,er.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{constructor(t=[],e,r){this.fields=t||[],this.metadata=e||new Map,r||(r=za(t)),this.dictionaries=r}get[Symbol.toStringTag](){return"Schema"}get names(){return this.fields.map(t=>t.name)}toString(){return`Schema<{ ${this.fields.map((t,e)=>`${e}: ${t}`).join(", ")} }>`}select(t){let e=new Set(t),r=this.fields.filter(n=>e.has(n.name));return new at(r,this.metadata)}selectAt(t){let e=t.map(r=>this.fields[r]).filter(Boolean);return new at(e,this.metadata)}assign(...t){let e=t[0]instanceof at?t[0]:Array.isArray(t[0])?new at(t[0]):new at(t),r=[...this.fields],n=fo(fo(new Map,this.metadata),e.metadata),o=e.fields.filter(p=>{let b=r.findIndex(g=>g.name===p.name);return~b?(r[b]=p.clone({metadata:fo(fo(new Map,r[b].metadata),p.metadata)}))&&!1:!0}),c=za(o,new Map);return new at([...r,...o],n,new Map([...this.dictionaries,...c]))}};at.prototype.fields=null;at.prototype.metadata=null;at.prototype.dictionaries=null;var Q=class{constructor(t,e,r=!1,n){this.name=t,this.type=e,this.nullable=r,this.metadata=n||new Map}static new(...t){let[e,r,n,o]=t;return t[0]&&typeof t[0]=="object"&&({name:e}=t[0],r===void 0&&(r=t[0].type),n===void 0&&(n=t[0].nullable),o===void 0&&(o=t[0].metadata)),new Q(`${e}`,r,n,o)}get typeId(){return this.type.typeId}get[Symbol.toStringTag](){return"Field"}toString(){return`${this.name}: ${this.type}`}clone(...t){let[e,r,n,o]=t;return!t[0]||typeof t[0]!="object"?[e=this.name,r=this.type,n=this.nullable,o=this.metadata]=t:{name:e=this.name,type:r=this.type,nullable:n=this.nullable,metadata:o=this.metadata}=t[0],Q.new(e,r,n,o)}};Q.prototype.type=null;Q.prototype.name=null;Q.prototype.nullable=null;Q.prototype.metadata=null;function fo(i,t){return new Map([...i||new Map,...t||new Map])}function za(i,t=new Map){for(let e=-1,r=i.length;++e<r;){let o=i[e].type;if(N.isDictionary(o)){if(!t.has(o.id))t.set(o.id,o.dictionary);else if(t.get(o.id)!==o.dictionary)throw new Error("Cannot create Schema containing two different dictionaries with the same Id")}o.children&&o.children.length>0&&za(o.children,t)}return t}var rp=Nt,cS=Ni,uS=fe,Li=class{constructor(t,e=Wt.V4,r,n){this.schema=t,this.version=e,r&&(this._recordBatches=r),n&&(this._dictionaryBatches=n)}static decode(t){t=new uS(Y(t));let e=se.getRootAsFooter(t),r=at.decode(e.schema());return new Wa(r,e)}static encode(t){let e=new cS,r=at.encode(e,t.schema);se.startRecordBatchesVector(e,t.numRecordBatches);for(let c of[...t.recordBatches()].slice().reverse())ni.encode(e,c);let n=e.endVector();se.startDictionariesVector(e,t.numDictionaries);for(let c of[...t.dictionaryBatches()].slice().reverse())ni.encode(e,c);let o=e.endVector();return se.startFooter(e),se.addSchema(e,r),se.addVersion(e,Wt.V4),se.addRecordBatches(e,n),se.addDictionaries(e,o),se.finishFooterBuffer(e,se.endFooter(e)),e.asUint8Array()}get numRecordBatches(){return this._recordBatches.length}get numDictionaries(){return this._dictionaryBatches.length}*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 Wa=class extends Li{constructor(t,e){super(t,e.version()),this._footer=e}get numRecordBatches(){return this._footer.recordBatchesLength()}get numDictionaries(){return this._footer.dictionariesLength()}getRecordBatch(t){if(t>=0&&t<this.numRecordBatches){let e=this._footer.recordBatches(t);if(e)return ni.decode(e)}return null}getDictionaryBatch(t){if(t>=0&&t<this.numDictionaries){let e=this._footer.dictionaries(t);if(e)return ni.decode(e)}return null}},ni=class{constructor(t,e,r){this.metaDataLength=t,this.offset=typeof r=="number"?r:r.low,this.bodyLength=typeof e=="number"?e:e.low}static decode(t){return new ni(t.metaDataLength(),t.bodyLength(),t.offset())}static encode(t,e){let{metaDataLength:r}=e,n=new rp(e.offset,0),o=new rp(e.bodyLength,0);return wr.createBlock(t,n,r,o)}};var jt=Object.freeze({done:!0,value:void 0}),Tn=class{constructor(t){this._json=t}get schema(){return this._json.schema}get batches(){return this._json.batches||[]}get dictionaries(){return this._json.dictionaries||[]}},jr=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())}},ho=class extends jr{constructor(){super(),this._values=[],this.resolvers=[],this._closedPromise=new Promise(t=>this._closedPromiseResolve=t)}get closed(){return this._closedPromise}cancel(t){return O(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(jt);this._closedPromiseResolve(),this._closedPromiseResolve=void 0}}[Symbol.asyncIterator](){return this}toDOMStream(t){return Qt.toDOMStream(this._closedPromiseResolve||this._error?this:this._values,t)}toNodeStream(t){return Qt.toNodeStream(this._closedPromiseResolve||this._error?this:this._values,t)}throw(t){return O(this,void 0,void 0,function*(){return yield this.abort(t),jt})}return(t){return O(this,void 0,void 0,function*(){return yield this.close(),jt})}read(t){return O(this,void 0,void 0,function*(){return(yield this.next(t,"read")).value})}peek(t){return O(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(jt)}_ensureOpen(){if(this._closedPromiseResolve)return!0;throw new Error("AsyncQueue is closed")}};var gi=class extends ho{write(t){if((t=Y(t)).byteLength>0)return super.write(t)}toString(t=!1){return t?pn(this.toUint8Array(!0)):this.toUint8Array(!1).then(pn)}toUint8Array(t=!1){return t?Be(this._values)[0]:(()=>O(this,void 0,void 0,function*(){var e,r;let n=[],o=0;try{for(var c=Ne(this),p;p=yield c.next(),!p.done;){let b=p.value;n.push(b),o+=b.byteLength}}catch(b){e={error:b}}finally{try{p&&!p.done&&(r=c.return)&&(yield r.call(c))}finally{if(e)throw e.error}}return Be(n,o)[0]}))()}},wi=class{constructor(t){t&&(this.source=new $a(Qt.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)}},Ie=class{constructor(t){t instanceof Ie?this.source=t.source:t instanceof gi?this.source=new Pi(Qt.fromAsyncIterable(t)):Fs(t)?this.source=new Pi(Qt.fromNodeStream(t)):_n(t)?this.source=new Pi(Qt.fromDOMStream(t)):As(t)?this.source=new Pi(Qt.fromDOMStream(t.body)):Xe(t)?this.source=new Pi(Qt.fromIterable(t)):Ye(t)?this.source=new Pi(Qt.fromAsyncIterable(t)):Le(t)&&(this.source=new Pi(Qt.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)}},$a=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)||jt)}return(t){return Object.create(this.source.return&&this.source.return(t)||jt)}},Pi=class{constructor(t){this.source=t,this._closedPromise=new Promise(e=>this._closedPromiseResolve=e)}cancel(t){return O(this,void 0,void 0,function*(){yield this.return(t)})}get closed(){return this._closedPromise}read(t){return O(this,void 0,void 0,function*(){return(yield this.next(t,"read")).value})}peek(t){return O(this,void 0,void 0,function*(){return(yield this.next(t,"peek")).value})}next(t,e="read"){return O(this,void 0,void 0,function*(){return yield this.source.next({cmd:e,size:t})})}throw(t){return O(this,void 0,void 0,function*(){let e=this.source.throw&&(yield this.source.throw(t))||jt;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(e)})}return(t){return O(this,void 0,void 0,function*(){let e=this.source.return&&(yield this.source.return(t))||jt;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(e)})}};var Dn=class extends wi{constructor(t,e){super(),this.position=0,this.buffer=Y(t),this.size=typeof e>"u"?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:n}=this;return e&&n<r?(typeof t!="number"&&(t=Number.POSITIVE_INFINITY),this.position=Math.min(r,n+Math.min(r-n,t)),e.subarray(n,this.position)):null}readAt(t,e){let r=this.buffer,n=Math.min(this.size,t+e);return r?r.subarray(t,n):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 Ie{constructor(t,e){super(),this.position=0,this._handle=t,typeof e=="number"?this.size=e:this._pending=(()=>O(this,void 0,void 0,function*(){this.size=(yield t.stat()).size,delete this._pending}))()}readInt32(t){return O(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 O(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 O(this,void 0,void 0,function*(){this._pending&&(yield this._pending);let{_handle:e,size:r,position:n}=this;if(e&&n<r){typeof t!="number"&&(t=Number.POSITIVE_INFINITY);let o=n,c=0,p=0,b=Math.min(r,o+Math.min(r-o,t)),g=new Uint8Array(Math.max(0,(this.position=b)-o));for(;(o+=p)<b&&(c+=p)<g.byteLength;)({bytesRead:p}=yield e.read(g,c,g.byteLength-c,o));return g}return null})}readAt(t,e){return O(this,void 0,void 0,function*(){this._pending&&(yield this._pending);let{_handle:r,size:n}=this;if(r&&t+e<n){let o=Math.min(n,t+e),c=new Uint8Array(o-t);return(yield r.read(c,0,e,t)).buffer}return new Uint8Array(e)})}close(){return O(this,void 0,void 0,function*(){let t=this._handle;this._handle=null,t&&(yield t.close())})}throw(t){return O(this,void 0,void 0,function*(){return yield this.close(),{done:!0,value:t}})}return(t){return O(this,void 0,void 0,function*(){return yield this.close(),{done:!0,value:t}})}};var Xa={};pr(Xa,{BaseInt64:()=>En,Int128:()=>Ce,Int64:()=>Kt,Uint64:()=>ft});function Jr(i){return i<0&&(i=4294967295+i+1),`0x${i.toString(16)}`}var qr=8,Ya=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8],En=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]),n=e[3]*r[3];this.buffer[0]=n&65535;let o=n>>>16;return n=e[2]*r[3],o+=n,n=e[3]*r[2]>>>0,o+=n,this.buffer[0]+=o<<16,this.buffer[1]=o>>>0<n?65536:0,this.buffer[1]+=o>>>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`${Jr(this.buffer[1])} ${Jr(this.buffer[0])}`}},ft=class extends En{times(t){return this._times(t),this}plus(t){return this._plus(t),this}static from(t,e=new Uint32Array(2)){return ft.fromString(typeof t=="string"?t:t.toString(),e)}static fromNumber(t,e=new Uint32Array(2)){return ft.fromString(t.toString(),e)}static fromString(t,e=new Uint32Array(2)){let r=t.length,n=new ft(e);for(let o=0;o<r;){let c=qr<r-o?qr:r-o,p=new ft(new Uint32Array([Number.parseInt(t.slice(o,o+c),10),0])),b=new ft(new Uint32Array([Ya[c],0]));n.times(b),n.plus(p),o+=c}return n}static convertArray(t){let e=new Uint32Array(t.length*2);for(let r=-1,n=t.length;++r<n;)ft.from(t[r],new Uint32Array(e.buffer,e.byteOffset+2*r*4,2));return e}static multiply(t,e){return new ft(new Uint32Array(t.buffer)).times(e)}static add(t,e){return new ft(new Uint32Array(t.buffer)).plus(e)}},Kt=class extends En{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 Kt.fromString(typeof t=="string"?t:t.toString(),e)}static fromNumber(t,e=new Uint32Array(2)){return Kt.fromString(t.toString(),e)}static fromString(t,e=new Uint32Array(2)){let r=t.startsWith("-"),n=t.length,o=new Kt(e);for(let c=r?1:0;c<n;){let p=qr<n-c?qr:n-c,b=new Kt(new Uint32Array([Number.parseInt(t.slice(c,c+p),10),0])),g=new Kt(new Uint32Array([Ya[p],0]));o.times(g),o.plus(b),c+=p}return r?o.negate():o}static convertArray(t){let e=new Uint32Array(t.length*2);for(let r=-1,n=t.length;++r<n;)Kt.from(t[r],new Uint32Array(e.buffer,e.byteOffset+2*r*4,2));return e}static multiply(t,e){return new Kt(new Uint32Array(t.buffer)).times(e)}static add(t,e){return new Kt(new Uint32Array(t.buffer)).plus(e)}},Ce=class{constructor(t){this.buffer=t}high(){return new Kt(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2))}low(){return new Kt(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 ft(new Uint32Array([this.buffer[3],0])),r=new ft(new Uint32Array([this.buffer[2],0])),n=new ft(new Uint32Array([this.buffer[1],0])),o=new ft(new Uint32Array([this.buffer[0],0])),c=new ft(new Uint32Array([t.buffer[3],0])),p=new ft(new Uint32Array([t.buffer[2],0])),b=new ft(new Uint32Array([t.buffer[1],0])),g=new ft(new Uint32Array([t.buffer[0],0])),A=ft.multiply(o,g);this.buffer[0]=A.low();let T=new ft(new Uint32Array([A.high(),0]));return A=ft.multiply(n,g),T.plus(A),A=ft.multiply(o,b),T.plus(A),this.buffer[1]=T.low(),this.buffer[3]=T.lessThan(A)?1:0,this.buffer[2]=T.high(),new ft(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2)).plus(ft.multiply(r,g)).plus(ft.multiply(n,b)).plus(ft.multiply(o,p)),this.buffer[3]+=ft.multiply(e,g).plus(ft.multiply(r,b)).plus(ft.multiply(n,p)).plus(ft.multiply(o,c)).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`${Jr(this.buffer[3])} ${Jr(this.buffer[2])} ${Jr(this.buffer[1])} ${Jr(this.buffer[0])}`}static multiply(t,e){return new Ce(new Uint32Array(t.buffer)).times(e)}static add(t,e){return new Ce(new Uint32Array(t.buffer)).plus(e)}static from(t,e=new Uint32Array(4)){return Ce.fromString(typeof t=="string"?t:t.toString(),e)}static fromNumber(t,e=new Uint32Array(4)){return Ce.fromString(t.toString(),e)}static fromString(t,e=new Uint32Array(4)){let r=t.startsWith("-"),n=t.length,o=new Ce(e);for(let c=r?1:0;c<n;){let p=qr<n-c?qr:n-c,b=new Ce(new Uint32Array([Number.parseInt(t.slice(c,c+p),10),0,0,0])),g=new Ce(new Uint32Array([Ya[p],0,0,0]));o.times(g),o.plus(b),c+=p}return r?o.negate():o}static convertArray(t){let e=new Uint32Array(t.length*4);for(let r=-1,n=t.length;++r<n;)Ce.from(t[r],new Uint32Array(e.buffer,e.byteOffset+4*4*r,4));return e}};var kn=class extends V{constructor(t,e,r,n){super(),this.nodesIndex=-1,this.buffersIndex=-1,this.bytes=t,this.nodes=e,this.buffers=r,this.dictionaries=n}visit(t){return super.visit(t instanceof Q?t.type:t)}visitNull(t,{length:e}=this.nextFieldNode()){return J({type:t,length:e})}visitBool(t,{length:e,nullCount:r}=this.nextFieldNode()){return J({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitInt(t,{length:e,nullCount:r}=this.nextFieldNode()){return J({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitFloat(t,{length:e,nullCount:r}=this.nextFieldNode()){return J({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitUtf8(t,{length:e,nullCount:r}=this.nextFieldNode()){return J({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 J({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 J({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitDate(t,{length:e,nullCount:r}=this.nextFieldNode()){return J({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitTimestamp(t,{length:e,nullCount:r}=this.nextFieldNode()){return J({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitTime(t,{length:e,nullCount:r}=this.nextFieldNode()){return J({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitDecimal(t,{length:e,nullCount:r}=this.nextFieldNode()){return J({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitList(t,{length:e,nullCount:r}=this.nextFieldNode()){return J({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 J({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),children:this.visitMany(t.children)})}visitUnion(t){return t.mode===Ft.Sparse?this.visitSparseUnion(t):this.visitDenseUnion(t)}visitDenseUnion(t,{length:e,nullCount:r}=this.nextFieldNode()){return J({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),typeIds:this.readTypeIds(t),valueOffsets:this.readOffsets(t),children:this.visitMany(t.children)})}visitSparseUnion(t,{length:e,nullCount:r}=this.nextFieldNode()){return J({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),typeIds:this.readTypeIds(t),children:this.visitMany(t.children)})}visitDictionary(t,{length:e,nullCount:r}=this.nextFieldNode()){return J({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 J({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitFixedSizeList(t,{length:e,nullCount:r}=this.nextFieldNode()){return J({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 J({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)}},po=class extends kn{constructor(t,e,r,n){super(new Uint8Array(0),e,r,n),this.sources=t}readNullBitmap(t,e,{offset:r}=this.nextBufferRange()){return e<=0?new Uint8Array(0):br(this.sources[r])}readOffsets(t,{offset:e}=this.nextBufferRange()){return rt(Uint8Array,rt(Int32Array,this.sources[e]))}readTypeIds(t,{offset:e}=this.nextBufferRange()){return rt(Uint8Array,rt(t.ArrayType,this.sources[e]))}readData(t,{offset:e}=this.nextBufferRange()){let{sources:r}=this;return N.isTimestamp(t)?rt(Uint8Array,Kt.convertArray(r[e])):(N.isInt(t)||N.isTime(t))&&t.bitWidth===64?rt(Uint8Array,Kt.convertArray(r[e])):N.isDate(t)&&t.unit===te.MILLISECOND?rt(Uint8Array,Kt.convertArray(r[e])):N.isDecimal(t)?rt(Uint8Array,Ce.convertArray(r[e])):N.isBinary(t)||N.isFixedSizeBinary(t)?dS(r[e]):N.isBool(t)?br(r[e]):N.isUtf8(t)?Gi(r[e].join("")):rt(Uint8Array,rt(t.ArrayType,r[e].map(n=>+n)))}};function dS(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 Zr=class extends fi{constructor(t){super(t),this._values=new tr(new Uint8Array(0))}get byteLength(){let t=this._pendingLength+this.length*4;return this._offsets&&(t+=this._offsets.byteLength),this._values&&(t+=this._values.byteLength),this._nulls&&(t+=this._nulls.byteLength),t}setValue(t,e){return super.setValue(t,Y(e))}_flushPending(t,e){let r=this._offsets,n=this._values.reserve(e).buffer,o=0;for(let[c,p]of t)if(p===void 0)r.set(c,0);else{let b=p.length;n.set(p,o),r.set(c,b),o+=b}}};var yo=class extends Ct{constructor(t){super(t),this._values=new Xr}setValue(t,e){this._values.set(t,+e)}};var Sr=class extends $t{};Sr.prototype._setValue=Fa;var On=class extends Sr{};On.prototype._setValue=Hs;var Mn=class extends Sr{};Mn.prototype._setValue=zs;var Rn=class extends $t{};Rn.prototype._setValue=Da;var _o=class extends Ct{constructor({type:t,nullValues:e,dictionaryHashFunction:r}){super({type:new Te(t.dictionary,t.indices,t.id,t.isOrdered)}),this._nulls=null,this._dictionaryOffset=0,this._keysToIndices=Object.create(null),this.indices=Ir({type:this.type.indices,nullValues:e}),this.dictionary=Ir({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,n=this.valueToKey(e),o=r[n];return o===void 0&&(r[n]=o=this._dictionaryOffset+this.dictionary.append(e).length-1),this.indices.setValue(t,o)}flush(){let t=this.type,e=this._dictionary,r=this.dictionary.toVector(),n=this.indices.flush().clone(t);return n.dictionary=e?e.concat(r):r,this.finished||(this._dictionaryOffset+=r.length),this._dictionary=n.dictionary,this.clear(),n}finish(){return this.indices.finish(),this.dictionary.finish(),this._dictionaryOffset=0,this._keysToIndices=Object.create(null),super.finish()}clear(){return this.indices.clear(),this.dictionary.clear(),super.clear()}valueToKey(t){return typeof t=="string"?t:`${t}`}};var Un=class extends $t{};Un.prototype._setValue=xa;var mo=class extends Ct{setValue(t,e){let[r]=this.children,n=t*this.stride;for(let o=-1,c=e.length;++o<c;)r.set(n+o,e[o])}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 ti(this.type.listSize,new Q(e,t.type,!0)),r}};var Cr=class extends $t{setValue(t,e){this._values.set(t,e)}},bo=class extends Cr{setValue(t,e){super.setValue(t,vn(e))}},vo=class extends Cr{},go=class extends Cr{};var Ar=class extends $t{};Ar.prototype._setValue=Ea;var Nn=class extends Ar{};Nn.prototype._setValue=Zs;var Ln=class extends Ar{};Ln.prototype._setValue=Qs;var ze=class extends $t{setValue(t,e){this._values.set(t,e)}},wo=class extends ze{},jo=class extends ze{},So=class extends ze{},Io=class extends ze{},Co=class extends ze{},Ao=class extends ze{},xo=class extends ze{},Fo=class extends ze{};var Bo=class extends fi{constructor(t){super(t),this._offsets=new Gr}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 Q(e,t.type,!0)),this.numChildren-1}_flushPending(t){let e=this._offsets,[r]=this.children;for(let[n,o]of t)if(o===void 0)e.set(n,0);else{let c=o.length,p=e.set(n,c).buffer[n];for(let b=-1;++b<c;)r.set(p+b,o[b])}}};var To=class extends fi{set(t,e){return super.set(t,e)}setValue(t,e){let r=e instanceof Map?e:new Map(Object.entries(e)),n=this._pending||(this._pending=new Map),o=n.get(t);o&&(this._pendingLength-=o.size),this._pendingLength+=r.size,n.set(t,r)}addChild(t,e=`${this.numChildren}`){if(this.numChildren>0)throw new Error("ListBuilder can only have one child.");return this.children[this.numChildren]=t,this.type=new ei(new Q(e,t.type,!0),this.type.keysSorted),this.numChildren-1}_flushPending(t){let e=this._offsets,[r]=this.children;for(let[n,o]of t)if(o===void 0)e.set(n,0);else{let{[n]:c,[n+1]:p}=e.set(n,o.size).buffer;for(let b of o.entries())if(r.set(c,b),++c>=p)break}}};var Do=class extends Ct{setValue(t,e){}setValid(t,e){return this.length=Math.max(t+1,this.length),e}};var Eo=class extends Ct{setValue(t,e){let{children:r,type:n}=this;switch(Array.isArray(e)||e.constructor){case!0:return n.children.forEach((o,c)=>r[c].set(t,e[c]));case Map:return n.children.forEach((o,c)=>r[c].set(t,e.get(o.name)));default:return n.children.forEach((o,c)=>r[c].set(t,e[o.name]))}}setValid(t,e){return super.setValid(t,e)||this.children.forEach(r=>r.setValid(t,e)),e}addChild(t,e=`${this.numChildren}`){let r=this.children.push(t);return this.type=new gt([...this.type.children,new Q(e,t.type,!0)]),r}};var Vi=class extends $t{};Vi.prototype._setValue=Ba;var Pn=class extends Vi{};Pn.prototype._setValue=Ws;var Vn=class extends Vi{};Vn.prototype._setValue=$s;var Hn=class extends Vi{};Hn.prototype._setValue=Ys;var zn=class extends Vi{};zn.prototype._setValue=Xs;var Hi=class extends $t{};Hi.prototype._setValue=Ta;var Wn=class extends Hi{};Wn.prototype._setValue=Gs;var $n=class extends Hi{};$n.prototype._setValue=Ks;var Yn=class extends Hi{};Yn.prototype._setValue=Js;var Xn=class extends Hi{};Xn.prototype._setValue=qs;var Qr=class extends Ct{constructor(t){super(t),this._typeIds=new Ui(new 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.setValid(t,this.isValid(e))&&this.setValue(t,e,r),this}setValue(t,e,r){this._typeIds.set(t,r);let n=this.type.typeIdToChildIndex[r],o=this.children[n];o==null||o.set(t,e)}addChild(t,e=`${this.children.length}`){let r=this.children.push(t),{type:{children:n,mode:o,typeIds:c}}=this,p=[...n,new Q(e,t.type)];return this.type=new Qe(o,[...c,r],p),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.")}},ko=class extends Qr{},Oo=class extends Qr{constructor(t){super(t),this._offsets=new Ui(new Int32Array(0))}setValue(t,e,r){let n=this._typeIds.set(t,r).buffer[t],o=this.getChildAt(this.type.typeIdToChildIndex[n]),c=this._offsets.set(t,o.length).buffer[t];o==null||o.set(c,e)}};var Gn=class extends fi{constructor(t){super(t),this._values=new tr(new Uint8Array(0))}get byteLength(){let t=this._pendingLength+this.length*4;return this._offsets&&(t+=this._offsets.byteLength),this._values&&(t+=this._values.byteLength),this._nulls&&(t+=this._nulls.byteLength),t}setValue(t,e){return super.setValue(t,Gi(e))}_flushPending(t,e){}};Gn.prototype._flushPending=Zr.prototype._flushPending;var Ga=class extends V{visitNull(){return Do}visitBool(){return yo}visitInt(){return ze}visitInt8(){return wo}visitInt16(){return jo}visitInt32(){return So}visitInt64(){return Io}visitUint8(){return Co}visitUint16(){return Ao}visitUint32(){return xo}visitUint64(){return Fo}visitFloat(){return Cr}visitFloat16(){return bo}visitFloat32(){return vo}visitFloat64(){return go}visitUtf8(){return Gn}visitBinary(){return Zr}visitFixedSizeBinary(){return Un}visitDate(){return Sr}visitDateDay(){return On}visitDateMillisecond(){return Mn}visitTimestamp(){return Vi}visitTimestampSecond(){return Pn}visitTimestampMillisecond(){return Vn}visitTimestampMicrosecond(){return Hn}visitTimestampNanosecond(){return zn}visitTime(){return Hi}visitTimeSecond(){return Wn}visitTimeMillisecond(){return $n}visitTimeMicrosecond(){return Yn}visitTimeNanosecond(){return Xn}visitDecimal(){return Rn}visitList(){return Bo}visitStruct(){return Eo}visitUnion(){return Qr}visitDenseUnion(){return Oo}visitSparseUnion(){return ko}visitDictionary(){return _o}visitInterval(){return Ar}visitIntervalDayTime(){return Nn}visitIntervalYearMonth(){return Ln}visitFixedSizeList(){return mo}visitMap(){return To}},np=new Ga;var $=class extends V{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,n)=>this.compareFields(r,e[n]))}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 Ae(i,t){return t instanceof i.constructor}function Kn(i,t){return i===t||Ae(i,t)}function zi(i,t){return i===t||Ae(i,t)&&i.bitWidth===t.bitWidth&&i.isSigned===t.isSigned}function Mo(i,t){return i===t||Ae(i,t)&&i.precision===t.precision}function fS(i,t){return i===t||Ae(i,t)&&i.byteWidth===t.byteWidth}function Ka(i,t){return i===t||Ae(i,t)&&i.unit===t.unit}function Jn(i,t){return i===t||Ae(i,t)&&i.unit===t.unit&&i.timezone===t.timezone}function qn(i,t){return i===t||Ae(i,t)&&i.unit===t.unit&&i.bitWidth===t.bitWidth}function hS(i,t){return i===t||Ae(i,t)&&i.children.length===t.children.length&&ji.compareManyFields(i.children,t.children)}function pS(i,t){return i===t||Ae(i,t)&&i.children.length===t.children.length&&ji.compareManyFields(i.children,t.children)}function Ja(i,t){return i===t||Ae(i,t)&&i.mode===t.mode&&i.typeIds.every((e,r)=>e===t.typeIds[r])&&ji.compareManyFields(i.children,t.children)}function yS(i,t){return i===t||Ae(i,t)&&i.id===t.id&&i.isOrdered===t.isOrdered&&ji.visit(i.indices,t.indices)&&ji.visit(i.dictionary,t.dictionary)}function qa(i,t){return i===t||Ae(i,t)&&i.unit===t.unit}function _S(i,t){return i===t||Ae(i,t)&&i.listSize===t.listSize&&i.children.length===t.children.length&&ji.compareManyFields(i.children,t.children)}function mS(i,t){return i===t||Ae(i,t)&&i.keysSorted===t.keysSorted&&i.children.length===t.children.length&&ji.compareManyFields(i.children,t.children)}$.prototype.visitNull=Kn;$.prototype.visitBool=Kn;$.prototype.visitInt=zi;$.prototype.visitInt8=zi;$.prototype.visitInt16=zi;$.prototype.visitInt32=zi;$.prototype.visitInt64=zi;$.prototype.visitUint8=zi;$.prototype.visitUint16=zi;$.prototype.visitUint32=zi;$.prototype.visitUint64=zi;$.prototype.visitFloat=Mo;$.prototype.visitFloat16=Mo;$.prototype.visitFloat32=Mo;$.prototype.visitFloat64=Mo;$.prototype.visitUtf8=Kn;$.prototype.visitBinary=Kn;$.prototype.visitFixedSizeBinary=fS;$.prototype.visitDate=Ka;$.prototype.visitDateDay=Ka;$.prototype.visitDateMillisecond=Ka;$.prototype.visitTimestamp=Jn;$.prototype.visitTimestampSecond=Jn;$.prototype.visitTimestampMillisecond=Jn;$.prototype.visitTimestampMicrosecond=Jn;$.prototype.visitTimestampNanosecond=Jn;$.prototype.visitTime=qn;$.prototype.visitTimeSecond=qn;$.prototype.visitTimeMillisecond=qn;$.prototype.visitTimeMicrosecond=qn;$.prototype.visitTimeNanosecond=qn;$.prototype.visitDecimal=Kn;$.prototype.visitList=hS;$.prototype.visitStruct=pS;$.prototype.visitUnion=Ja;$.prototype.visitDenseUnion=Ja;$.prototype.visitSparseUnion=Ja;$.prototype.visitDictionary=yS;$.prototype.visitInterval=qa;$.prototype.visitIntervalDayTime=qa;$.prototype.visitIntervalYearMonth=qa;$.prototype.visitFixedSizeList=_S;$.prototype.visitMap=mS;var ji=new $;function xr(i,t){return ji.compareSchemas(i,t)}function sp(i,t){return ji.compareFields(i,t)}function op(i,t){return ji.visit(i,t)}function Ir(i){let t=i.type,e=new(np.getVisitFn(t)())(i);if(t.children&&t.children.length>0){let r=i.children||[],n={nullValues:i.nullValues},o=Array.isArray(r)?(c,p)=>r[p]||n:({name:c})=>r[c]||n;for(let[c,p]of t.children.entries()){let{type:b}=p,g=o(p,c);e.children.push(Ir(Object.assign(Object.assign({},g),{type:b})))}}return e}function Ro(i,t){return bS(i,t.map(e=>e.data.concat()))}function bS(i,t){let e=[...i.fields],r=[],n={numBatches:t.reduce((T,F)=>Math.max(T,F.length),0)},o=0,c=0,p=-1,b=t.length,g,A=[];for(;n.numBatches-- >0;){for(c=Number.POSITIVE_INFINITY,p=-1;++p<b;)A[p]=g=t[p].shift(),c=Math.min(c,g?g.length:c);Number.isFinite(c)&&(A=vS(e,c,A,t,n),c>0&&(r[o++]=J({type:new gt(e),length:c,nullCount:0,children:A.slice()})))}return[i=i.assign(e),r.map(T=>new bt(i,T))]}function vS(i,t,e,r,n){var o;let c=(t+63&-64)>>3;for(let p=-1,b=r.length;++p<b;){let g=e[p],A=g==null?void 0:g.length;if(A>=t)A===t?e[p]=g:(e[p]=g.slice(0,t),n.numBatches=Math.max(n.numBatches,r[p].unshift(g.slice(t,A-t))));else{let T=i[p];i[p]=T.clone({nullable:!0}),e[p]=(o=g==null?void 0:g._changeLengthAndBackfillNullBitmap(t))!==null&&o!==void 0?o:J({type:T.type,length:t,nullCount:t,nullBitmap:new Uint8Array(c)})}}return e}var ap,Et=class{constructor(...t){var e,r;if(t.length===0)return this.batches=[],this.schema=new at([]),this._offsets=[0],this;let n,o;t[0]instanceof at&&(n=t.shift()),t[t.length-1]instanceof Uint32Array&&(o=t.pop());let c=b=>{if(b){if(b instanceof bt)return[b];if(b instanceof Et)return b.batches;if(b instanceof dt){if(b.type instanceof gt)return[new bt(new at(b.type.children),b)]}else{if(Array.isArray(b))return b.flatMap(g=>c(g));if(typeof b[Symbol.iterator]=="function")return[...b].flatMap(g=>c(g));if(typeof b=="object"){let g=Object.keys(b),A=g.map(k=>new G([b[k]])),T=new at(g.map((k,lt)=>new Q(String(k),A[lt].type))),[,F]=Ro(T,A);return F.length===0?[new bt(b)]:F}}}return[]},p=t.flatMap(b=>c(b));if(n=(r=n!=null?n:(e=p[0])===null||e===void 0?void 0:e.schema)!==null&&r!==void 0?r:new at([]),!(n instanceof at))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");for(let b of p){if(!(b instanceof bt))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");if(!xr(n,b.schema))throw new TypeError("Table and inner RecordBatch schemas must be equivalent.")}this.schema=n,this.batches=p,this._offsets=o!=null?o:no(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=ro(this.data)),this._nullCount}isValid(t){return!1}get(t){return null}set(t,e){}indexOf(t,e){return-1}getByteLength(t){return 0}[Symbol.iterator](){return this.batches.length>0?$r.visit(new G(this.data)):new Array(0)[Symbol.iterator]()}toArray(){return[...this]}toString(){return`[
7
+ return true;`)}function gS(i){return typeof i!="bigint"?qe(i):As?`${qe(i)}n`:`"${qe(i)}"`}var Wa=(i,t)=>(i*t+63&-64||64)/t,wS=(i,t=0)=>i.length>=t?i.subarray(0,t):Lr(new i.constructor(t),i,0),ir=class{constructor(t,e=1){this.buffer=t,this.stride=e,this.BYTES_PER_ELEMENT=t.BYTES_PER_ELEMENT,this.ArrayType=t.constructor,this._resize(this.length=Math.trunc(t.length/e))}get byteLength(){return Math.trunc(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,n=this.buffer.length;r>=n&&this._resize(n===0?Wa(r*1,this.BYTES_PER_ELEMENT):Wa(r*2,this.BYTES_PER_ELEMENT))}return this}flush(t=this.length){t=Wa(t*this.stride,this.BYTES_PER_ELEMENT);let e=wS(this.buffer,t);return this.clear(),e}clear(){return this.length=0,this._resize(0),this}_resize(t){return this.buffer=Lr(new this.ArrayType(t),this.buffer)}};ir.prototype.offset=0;var Li=class extends ir{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}},Gr=class extends Li{constructor(t=new Uint8Array(0)){super(t,1/8),this.numValid=0}get numInvalid(){return this.length-this.numValid}get(t){return this.buffer[t>>3]>>t%8&1}set(t,e){let{buffer:r}=this.reserve(t-this.length+1),n=t>>3,o=t%8,u=r[n]>>o&1;return e?u===0&&(r[n]|=1<<o,++this.numValid):u===1&&(r[n]&=~(1<<o),--this.numValid),this}clear(){return this.numValid=0,super.clear()}},Kr=class extends Li{constructor(t=new Int32Array(1)){super(t,1)}append(t){return this.set(this.length-1,t)}set(t,e){let r=this.length-1,n=this.reserve(t-r+1).buffer;return r<t++&&n.fill(n[r],r,t),n[t]=n[t-1]+e,this}flush(t=this.length-1){return t>this.length&&this.set(t-1,0),super.flush(t+1)}};var Bt=class{constructor({type:t,nullValues:e}){this.length=0,this.finished=!1,this.type=t,this.children=[],this.nullValues=e,this.stride=ke(t),this._nulls=new Gr,e&&e.length>0&&(this._isValid=ap(e))}static throughNode(t){throw new Error('"throughNode" not available in this environment')}static throughDOM(t){throw new Error('"throughDOM" not available in this environment')}toVector(){return new G([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:n,_typeIds:o,children:u}=this;return e&&(t+=e.byteLength),r&&(t+=r.byteLength),n&&(t+=n.byteLength),o&&(t+=o.byteLength),u.reduce((h,m)=>h+m.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=`${this.numChildren}`){throw new Error(`Cannot append children to non-nested type "${this.type}"`)}getChildAt(t){return this.children[t]||null}flush(){let t,e,r,n,{type:o,length:u,nullCount:h,_typeIds:m,_offsets:g,_values:F,_nulls:D}=this;(e=m==null?void 0:m.flush(u))?n=g==null?void 0:g.flush(u):(n=g==null?void 0:g.flush(u))?t=F==null?void 0:F.flush(g.last()):t=F==null?void 0:F.flush(u),h>0&&(r=D==null?void 0:D.flush(u));let B=this.children.map(k=>k.flush());return this.clear(),J({type:o,length:u,nullCount:h,children:B,child:B[0],data:t,typeIds:e,nullBitmap:r,valueOffsets:n})}finish(){this.finished=!0;for(let t of this.children)t.finish();return this}clear(){var t,e,r,n;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(),(n=this._typeIds)===null||n===void 0||n.clear();for(let o of this.children)o.clear();return this}};Bt.prototype.length=1;Bt.prototype.stride=1;Bt.prototype.children=null;Bt.prototype.finished=!1;Bt.prototype.nullValues=null;Bt.prototype._isValid=()=>!0;var Xt=class extends Bt{constructor(t){super(t),this._values=new Li(new this.ArrayType(0),this.stride)}setValue(t,e){let r=this._values;return r.reserve(t-r.length+1),super.setValue(t,e)}},pi=class extends Bt{constructor(t){super(t),this._pendingLength=0,this._offsets=new Kr}setValue(t,e){let r=this._pending||(this._pending=new Map),n=r.get(t);n&&(this._pendingLength-=n.length),this._pendingLength+=e instanceof fi?e[He].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 Ir=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,n){return t.prep(8,24),t.writeInt64(n),t.pad(4),t.writeInt32(r),t.writeInt64(e),t.offset()}};var yi=new Int32Array(2),ho=new Float32Array(yi.buffer),po=new Float64Array(yi.buffer),Jr=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1;var Pt=class{constructor(t,e){this.low=t|0,this.high=e|0}static create(t,e){return t==0&&e==0?Pt.ZERO:new Pt(t,e)}toFloat64(){return(this.low>>>0)+this.high*4294967296}equals(t){return this.low==t.low&&this.high==t.high}};Pt.ZERO=new Pt(0,0);var xn;(function(i){i[i.UTF8_BYTES=1]="UTF8_BYTES",i[i.UTF16_STRING=2]="UTF16_STRING"})(xn||(xn={}));var ye=class{constructor(t){this.bytes_=t,this.position_=0}static allocate(t){return new ye(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 new Pt(this.readInt32(t),this.readInt32(t+4))}readUint64(t){return new Pt(this.readUint32(t),this.readUint32(t+4))}readFloat32(t){return yi[0]=this.readInt32(t),ho[0]}readFloat64(t){return yi[Jr?0:1]=this.readInt32(t),yi[Jr?1:0]=this.readInt32(t+4),po[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,e.low),this.writeInt32(t+4,e.high)}writeUint64(t,e){this.writeUint32(t,e.low),this.writeUint32(t+4,e.high)}writeFloat32(t,e){ho[0]=e,this.writeInt32(t,yi[0])}writeFloat64(t,e){po[0]=e,this.writeInt32(t,yi[Jr?0:1]),this.writeInt32(t+4,yi[Jr?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),n="",o=0;if(t+=4,e===xn.UTF8_BYTES)return this.bytes_.subarray(t,t+r);for(;o<r;){let u,h=this.readUint8(t+o++);if(h<192)u=h;else{let m=this.readUint8(t+o++);if(h<224)u=(h&31)<<6|m&63;else{let g=this.readUint8(t+o++);if(h<240)u=(h&15)<<12|(m&63)<<6|g&63;else{let F=this.readUint8(t+o++);u=(h&7)<<18|(m&63)<<12|(g&63)<<6|F&63}}}u<65536?n+=String.fromCharCode(u):(u-=65536,n+=String.fromCharCode((u>>10)+55296,(u&(1<<10)-1)+56320))}return n}__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}createLong(t,e){return Pt.create(t,e)}createScalarList(t,e){let r=[];for(let n=0;n<e;++n)t(n)!==null&&r.push(t(n));return r}createObjList(t,e){let r=[];for(let n=0;n<e;++n){let o=t(n);o!==null&&r.push(o.unpack())}return r}};var Ni=class{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;let e;t?e=t:e=1024,this.bb=ye.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 n=this.bb.capacity();this.bb=Ni.growByteBuffer(this.bb),this.space+=this.bb.capacity()-n}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.equals(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 Error("FlatBuffers: struct must be serialized inline.")}notNested(){if(this.isNested)throw new Error("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,n=ye.allocate(r);return n.setPosition(r-e),n.bytes().set(t.bytes(),r-e),n}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 n=2;this.addInt16(t-this.object_start);let o=(r+n)*2;this.addInt16(o);let u=0,h=this.space;t:for(e=0;e<this.vtables.length;e++){let m=this.bb.capacity()-this.vtables[e];if(o==this.bb.readInt16(m)){for(let g=2;g<o;g+=2)if(this.bb.readInt16(h+g)!=this.bb.readInt16(m+g))continue t;u=this.vtables[e];break}}return u?(this.space=this.bb.capacity()-t,this.bb.writeInt32(this.space,u-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 n=r?4:0;if(e){let o=e;if(this.prep(this.minalign,4+4+n),o.length!=4)throw new Error("FlatBuffers: file identifier must be length "+4);for(let u=4-1;u>=0;u--)this.writeInt8(o.charCodeAt(u))}this.prep(this.minalign,4+n),this.addOffset(t),n&&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,n=r-this.bb.readInt32(r);if(!(this.bb.readInt16(n+e)!=0))throw new Error("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)return 0;let e;if(t instanceof Uint8Array)e=t;else{e=[];let r=0;for(;r<t.length;){let n,o=t.charCodeAt(r++);if(o<55296||o>=56320)n=o;else{let u=t.charCodeAt(r++);n=(o<<10)+u+(65536-(55296<<10)-56320)}n<128?e.push(n):(n<2048?e.push(n>>6&31|192):(n<65536?e.push(n>>12&15|224):e.push(n>>18&7|240,n>>12&63|128),e.push(n>>6&63|128)),e.push(n&63|128))}}this.addInt8(0),this.startVector(1,e.length,1),this.bb.setPosition(this.space-=e.length);for(let r=0,n=this.space,o=this.bb.bytes();r<e.length;r++)o[n++]=e[r];return this.endVector()}createLong(t,e){return Pt.create(t,e)}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 n=t[r];if(n!==null)e.push(this.createObjectOffset(n));else throw new Error("FlatBuffers: Argument for createObjectOffsetList cannot contain null.")}return e}createStructOffsetList(t,e){return e(this,t.length),this.createObjectOffsetList(t),this.endVector()}};var It=class{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 It).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsKeyValue(t,e){return t.setPosition(t.position()+4),(e||new It).__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 It.startKeyValue(t),It.addKey(t,e),It.addValue(t,r),It.endKeyValue(t)}};var rr;(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"})(rr||(rr={}));var nr;(function(i){i[i.Little=0]="Little",i[i.Big=1]="Big"})(nr||(nr={}));var Bn;(function(i){i[i.DenseArray=0]="DenseArray"})(Bn||(Bn={}));var Gt=class{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 Gt).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsInt(t,e){return t.setPosition(t.position()+4),(e||new Gt).__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 Gt.startInt(t),Gt.addBitWidth(t,e),Gt.addIsSigned(t,r),Gt.endInt(t)}};var Re=class{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 Re).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDictionaryEncoding(t,e){return t.setPosition(t.position()+4),(e||new Re).__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):this.bb.createLong(0,0)}indexType(t){let e=this.bb.__offset(this.bb_pos,6);return e?(t||new Gt).__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):Bn.DenseArray}static startDictionaryEncoding(t){t.startObject(4)}static addId(t,e){t.addFieldInt64(0,e,t.createLong(0,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,Bn.DenseArray)}static endDictionaryEncoding(t){return t.endObject()}};var _i=class{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 mi=class{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 mi).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsBool(t,e){return t.setPosition(t.position()+4),(e||new mi).__init(t.readInt32(t.position())+t.position(),t)}static startBool(t){t.startObject(0)}static endBool(t){return t.endObject()}static createBool(t){return mi.startBool(t),mi.endBool(t)}};var Tn;(function(i){i[i.DAY=0]="DAY",i[i.MILLISECOND=1]="MILLISECOND"})(Tn||(Tn={}));var ge=class{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 ge).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDate(t,e){return t.setPosition(t.position()+4),(e||new ge).__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):Tn.MILLISECOND}static startDate(t){t.startObject(1)}static addUnit(t,e){t.addFieldInt16(0,e,Tn.MILLISECOND)}static endDate(t){return t.endObject()}static createDate(t,e){return ge.startDate(t),ge.addUnit(t,e),ge.endDate(t)}};var Kt=class{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 Kt).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDecimal(t,e){return t.setPosition(t.position()+4),(e||new Kt).__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,n){return Kt.startDecimal(t),Kt.addPrecision(t,e),Kt.addScale(t,r),Kt.addBitWidth(t,n),Kt.endDecimal(t)}};var sr;(function(i){i[i.SECOND=0]="SECOND",i[i.MILLISECOND=1]="MILLISECOND",i[i.MICROSECOND=2]="MICROSECOND",i[i.NANOSECOND=3]="NANOSECOND"})(sr||(sr={}));var we=class{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 we).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFixedSizeBinary(t,e){return t.setPosition(t.position()+4),(e||new we).__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 we.startFixedSizeBinary(t),we.addByteWidth(t,e),we.endFixedSizeBinary(t)}};var je=class{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 je).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFixedSizeList(t,e){return t.setPosition(t.position()+4),(e||new je).__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 je.startFixedSizeList(t),je.addListSize(t,e),je.endFixedSizeList(t)}};var Dn;(function(i){i[i.HALF=0]="HALF",i[i.SINGLE=1]="SINGLE",i[i.DOUBLE=2]="DOUBLE"})(Dn||(Dn={}));var Se=class{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 Se).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFloatingPoint(t,e){return t.setPosition(t.position()+4),(e||new Se).__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):Dn.HALF}static startFloatingPoint(t){t.startObject(1)}static addPrecision(t,e){t.addFieldInt16(0,e,Dn.HALF)}static endFloatingPoint(t){return t.endObject()}static createFloatingPoint(t,e){return Se.startFloatingPoint(t),Se.addPrecision(t,e),Se.endFloatingPoint(t)}};var En;(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"})(En||(En={}));var Ie=class{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 Ie).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsInterval(t,e){return t.setPosition(t.position()+4),(e||new Ie).__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):En.YEAR_MONTH}static startInterval(t){t.startObject(1)}static addUnit(t,e){t.addFieldInt16(0,e,En.YEAR_MONTH)}static endInterval(t){return t.endObject()}static createInterval(t,e){return Ie.startInterval(t),Ie.addUnit(t,e),Ie.endInterval(t)}};var bi=class{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 bi).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsList(t,e){return t.setPosition(t.position()+4),(e||new bi).__init(t.readInt32(t.position())+t.position(),t)}static startList(t){t.startObject(0)}static endList(t){return t.endObject()}static createList(t){return bi.startList(t),bi.endList(t)}};var Ce=class{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 Ce).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsMap(t,e){return t.setPosition(t.position()+4),(e||new Ce).__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 Ce.startMap(t),Ce.addKeysSorted(t,e),Ce.endMap(t)}};var vi=class{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 vi).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsNull(t,e){return t.setPosition(t.position()+4),(e||new vi).__init(t.readInt32(t.position())+t.position(),t)}static startNull(t){t.startObject(0)}static endNull(t){return t.endObject()}static createNull(t){return vi.startNull(t),vi.endNull(t)}};var gi=class{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 gi).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsStruct_(t,e){return t.setPosition(t.position()+4),(e||new gi).__init(t.readInt32(t.position())+t.position(),t)}static startStruct_(t){t.startObject(0)}static endStruct_(t){return t.endObject()}static createStruct_(t){return gi.startStruct_(t),gi.endStruct_(t)}};var se=class{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 se).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsTime(t,e){return t.setPosition(t.position()+4),(e||new se).__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):sr.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,sr.MILLISECOND)}static addBitWidth(t,e){t.addFieldInt32(1,e,32)}static endTime(t){return t.endObject()}static createTime(t,e,r){return se.startTime(t),se.addUnit(t,e),se.addBitWidth(t,r),se.endTime(t)}};var oe=class{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 oe).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsTimestamp(t,e){return t.setPosition(t.position()+4),(e||new oe).__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):sr.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,sr.SECOND)}static addTimezone(t,e){t.addFieldOffset(1,e,0)}static endTimestamp(t){return t.endObject()}static createTimestamp(t,e,r){return oe.startTimestamp(t),oe.addUnit(t,e),oe.addTimezone(t,r),oe.endTimestamp(t)}};var kn;(function(i){i[i.Sparse=0]="Sparse",i[i.Dense=1]="Dense"})(kn||(kn={}));var Jt=class{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 Jt).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsUnion(t,e){return t.setPosition(t.position()+4),(e||new Jt).__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):kn.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,kn.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 Jt.startUnion(t),Jt.addMode(t,e),Jt.addTypeIds(t,r),Jt.endUnion(t)}};var wi=class{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 wi).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsUtf8(t,e){return t.setPosition(t.position()+4),(e||new wi).__init(t.readInt32(t.position())+t.position(),t)}static startUtf8(t){t.startObject(0)}static endUtf8(t){return t.endObject()}static createUtf8(t){return wi.startUtf8(t),wi.endUtf8(t)}};var Tt;(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"})(Tt||(Tt={}));var Vt=class{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 Vt).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsField(t,e){return t.setPosition(t.position()+4),(e||new Vt).__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):Tt.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 Re).__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 Vt).__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 It).__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,Tt.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 Et=class{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 Et).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsSchema(t,e){return t.setPosition(t.position()+4),(e||new Et).__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):nr.Little}fields(t,e){let r=this.bb.__offset(this.bb_pos,6);return r?(e||new Vt).__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 It).__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):this.bb.createLong(0,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,nr.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,n,o){return Et.startSchema(t),Et.addEndianness(t,e),Et.addFields(t,r),Et.addCustomMetadata(t,n),Et.addFeatures(t,o),Et.endSchema(t)}};var ae=class{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 ae).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFooter(t,e){return t.setPosition(t.position()+4),(e||new ae).__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):rr.V1}schema(t){let e=this.bb.__offset(this.bb_pos,6);return e?(t||new Et).__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 Ir).__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 Ir).__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 It).__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,rr.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 ot=class{constructor(t=[],e,r){this.fields=t||[],this.metadata=e||new Map,r||(r=$a(t)),this.dictionaries=r}get[Symbol.toStringTag](){return"Schema"}get names(){return this.fields.map(t=>t.name)}toString(){return`Schema<{ ${this.fields.map((t,e)=>`${e}: ${t}`).join(", ")} }>`}select(t){let e=new Set(t),r=this.fields.filter(n=>e.has(n.name));return new ot(r,this.metadata)}selectAt(t){let e=t.map(r=>this.fields[r]).filter(Boolean);return new ot(e,this.metadata)}assign(...t){let e=t[0]instanceof ot?t[0]:Array.isArray(t[0])?new ot(t[0]):new ot(t),r=[...this.fields],n=_o(_o(new Map,this.metadata),e.metadata),o=e.fields.filter(h=>{let m=r.findIndex(g=>g.name===h.name);return~m?(r[m]=h.clone({metadata:_o(_o(new Map,r[m].metadata),h.metadata)}))&&!1:!0}),u=$a(o,new Map);return new ot([...r,...o],n,new Map([...this.dictionaries,...u]))}};ot.prototype.fields=null;ot.prototype.metadata=null;ot.prototype.dictionaries=null;var Q=class{constructor(t,e,r=!1,n){this.name=t,this.type=e,this.nullable=r,this.metadata=n||new Map}static new(...t){let[e,r,n,o]=t;return t[0]&&typeof t[0]=="object"&&({name:e}=t[0],r===void 0&&(r=t[0].type),n===void 0&&(n=t[0].nullable),o===void 0&&(o=t[0].metadata)),new Q(`${e}`,r,n,o)}get typeId(){return this.type.typeId}get[Symbol.toStringTag](){return"Field"}toString(){return`${this.name}: ${this.type}`}clone(...t){let[e,r,n,o]=t;return!t[0]||typeof t[0]!="object"?[e=this.name,r=this.type,n=this.nullable,o=this.metadata]=t:{name:e=this.name,type:r=this.type,nullable:n=this.nullable,metadata:o=this.metadata}=t[0],Q.new(e,r,n,o)}};Q.prototype.type=null;Q.prototype.name=null;Q.prototype.nullable=null;Q.prototype.metadata=null;function _o(i,t){return new Map([...i||new Map,...t||new Map])}function $a(i,t=new Map){for(let e=-1,r=i.length;++e<r;){let o=i[e].type;if(L.isDictionary(o)){if(!t.has(o.id))t.set(o.id,o.dictionary);else if(t.get(o.id)!==o.dictionary)throw new Error("Cannot create Schema containing two different dictionaries with the same Id")}o.children&&o.children.length>0&&$a(o.children,t)}return t}var lp=Pt,jS=Ni,SS=ye,Pi=class{constructor(t,e=Yt.V4,r,n){this.schema=t,this.version=e,r&&(this._recordBatches=r),n&&(this._dictionaryBatches=n)}static decode(t){t=new SS(Y(t));let e=ae.getRootAsFooter(t),r=ot.decode(e.schema());return new Ya(r,e)}static encode(t){let e=new jS,r=ot.encode(e,t.schema);ae.startRecordBatchesVector(e,t.numRecordBatches);for(let u of[...t.recordBatches()].slice().reverse())oi.encode(e,u);let n=e.endVector();ae.startDictionariesVector(e,t.numDictionaries);for(let u of[...t.dictionaryBatches()].slice().reverse())oi.encode(e,u);let o=e.endVector();return ae.startFooter(e),ae.addSchema(e,r),ae.addVersion(e,Yt.V4),ae.addRecordBatches(e,n),ae.addDictionaries(e,o),ae.finishFooterBuffer(e,ae.endFooter(e)),e.asUint8Array()}get numRecordBatches(){return this._recordBatches.length}get numDictionaries(){return this._dictionaryBatches.length}*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 Ya=class extends Pi{constructor(t,e){super(t,e.version()),this._footer=e}get numRecordBatches(){return this._footer.recordBatchesLength()}get numDictionaries(){return this._footer.dictionariesLength()}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{constructor(t,e,r){this.metaDataLength=t,this.offset=typeof r=="number"?r:r.low,this.bodyLength=typeof e=="number"?e:e.low}static decode(t){return new oi(t.metaDataLength(),t.bodyLength(),t.offset())}static encode(t,e){let{metaDataLength:r}=e,n=new lp(e.offset,0),o=new lp(e.bodyLength,0);return Ir.createBlock(t,n,r,o)}};var Ct=Object.freeze({done:!0,value:void 0}),On=class{constructor(t){this._json=t}get schema(){return this._json.schema}get batches(){return this._json.batches||[]}get dictionaries(){return this._json.dictionaries||[]}},Cr=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())}},mo=class extends Cr{constructor(){super(),this._values=[],this.resolvers=[],this._closedPromise=new Promise(t=>this._closedPromiseResolve=t)}get closed(){return this._closedPromise}cancel(t){return O(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(Ct);this._closedPromiseResolve(),this._closedPromiseResolve=void 0}}[Symbol.asyncIterator](){return this}toDOMStream(t){return te.toDOMStream(this._closedPromiseResolve||this._error?this:this._values,t)}toNodeStream(t){return te.toNodeStream(this._closedPromiseResolve||this._error?this:this._values,t)}throw(t){return O(this,void 0,void 0,function*(){return yield this.abort(t),Ct})}return(t){return O(this,void 0,void 0,function*(){return yield this.close(),Ct})}read(t){return O(this,void 0,void 0,function*(){return(yield this.next(t,"read")).value})}peek(t){return O(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(Ct)}_ensureOpen(){if(this._closedPromiseResolve)return!0;throw new Error("AsyncQueue is closed")}};var ji=class extends mo{write(t){if((t=Y(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?De(this._values)[0]:(()=>O(this,void 0,void 0,function*(){var e,r;let n=[],o=0;try{for(var u=Ne(this),h;h=yield u.next(),!h.done;){let m=h.value;n.push(m),o+=m.byteLength}}catch(m){e={error:m}}finally{try{h&&!h.done&&(r=u.return)&&(yield r.call(u))}finally{if(e)throw e.error}}return De(n,o)[0]}))()}},Si=class{constructor(t){t&&(this.source=new Xa(te.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{constructor(t){t instanceof Ae?this.source=t.source:t instanceof ji?this.source=new Vi(te.fromAsyncIterable(t)):Es(t)?this.source=new Vi(te.fromNodeStream(t)):gn(t)?this.source=new Vi(te.fromDOMStream(t)):Ts(t)?this.source=new Vi(te.fromDOMStream(t.body)):Ke(t)?this.source=new Vi(te.fromIterable(t)):Ge(t)?this.source=new Vi(te.fromAsyncIterable(t)):Pe(t)&&(this.source=new Vi(te.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)}},Xa=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)||Ct)}return(t){return Object.create(this.source.return&&this.source.return(t)||Ct)}},Vi=class{constructor(t){this.source=t,this._closedPromise=new Promise(e=>this._closedPromiseResolve=e)}cancel(t){return O(this,void 0,void 0,function*(){yield this.return(t)})}get closed(){return this._closedPromise}read(t){return O(this,void 0,void 0,function*(){return(yield this.next(t,"read")).value})}peek(t){return O(this,void 0,void 0,function*(){return(yield this.next(t,"peek")).value})}next(t,e="read"){return O(this,void 0,void 0,function*(){return yield this.source.next({cmd:e,size:t})})}throw(t){return O(this,void 0,void 0,function*(){let e=this.source.throw&&(yield this.source.throw(t))||Ct;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(e)})}return(t){return O(this,void 0,void 0,function*(){let e=this.source.return&&(yield this.source.return(t))||Ct;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(e)})}};var Rn=class extends Si{constructor(t,e){super(),this.position=0,this.buffer=Y(t),this.size=typeof e>"u"?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:n}=this;return e&&n<r?(typeof t!="number"&&(t=Number.POSITIVE_INFINITY),this.position=Math.min(r,n+Math.min(r-n,t)),e.subarray(n,this.position)):null}readAt(t,e){let r=this.buffer,n=Math.min(this.size,t+e);return r?r.subarray(t,n):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}}},or=class extends Ae{constructor(t,e){super(),this.position=0,this._handle=t,typeof e=="number"?this.size=e:this._pending=(()=>O(this,void 0,void 0,function*(){this.size=(yield t.stat()).size,delete this._pending}))()}readInt32(t){return O(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 O(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 O(this,void 0,void 0,function*(){this._pending&&(yield this._pending);let{_handle:e,size:r,position:n}=this;if(e&&n<r){typeof t!="number"&&(t=Number.POSITIVE_INFINITY);let o=n,u=0,h=0,m=Math.min(r,o+Math.min(r-o,t)),g=new Uint8Array(Math.max(0,(this.position=m)-o));for(;(o+=h)<m&&(u+=h)<g.byteLength;)({bytesRead:h}=yield e.read(g,u,g.byteLength-u,o));return g}return null})}readAt(t,e){return O(this,void 0,void 0,function*(){this._pending&&(yield this._pending);let{_handle:r,size:n}=this;if(r&&t+e<n){let o=Math.min(n,t+e),u=new Uint8Array(o-t);return(yield r.read(u,0,e,t)).buffer}return new Uint8Array(e)})}close(){return O(this,void 0,void 0,function*(){let t=this._handle;this._handle=null,t&&(yield t.close())})}throw(t){return O(this,void 0,void 0,function*(){return yield this.close(),{done:!0,value:t}})}return(t){return O(this,void 0,void 0,function*(){return yield this.close(),{done:!0,value:t}})}};var Ka={};mr(Ka,{BaseInt64:()=>Mn,Int128:()=>Fe,Int64:()=>qt,Uint64:()=>pt});function qr(i){return i<0&&(i=4294967295+i+1),`0x${i.toString(16)}`}var Zr=8,Ga=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8],Mn=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]),n=e[3]*r[3];this.buffer[0]=n&65535;let o=n>>>16;return n=e[2]*r[3],o+=n,n=e[3]*r[2]>>>0,o+=n,this.buffer[0]+=o<<16,this.buffer[1]=o>>>0<n?65536:0,this.buffer[1]+=o>>>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`${qr(this.buffer[1])} ${qr(this.buffer[0])}`}},pt=class extends Mn{times(t){return this._times(t),this}plus(t){return this._plus(t),this}static from(t,e=new Uint32Array(2)){return pt.fromString(typeof t=="string"?t:t.toString(),e)}static fromNumber(t,e=new Uint32Array(2)){return pt.fromString(t.toString(),e)}static fromString(t,e=new Uint32Array(2)){let r=t.length,n=new pt(e);for(let o=0;o<r;){let u=Zr<r-o?Zr:r-o,h=new pt(new Uint32Array([Number.parseInt(t.slice(o,o+u),10),0])),m=new pt(new Uint32Array([Ga[u],0]));n.times(m),n.plus(h),o+=u}return n}static convertArray(t){let e=new Uint32Array(t.length*2);for(let r=-1,n=t.length;++r<n;)pt.from(t[r],new Uint32Array(e.buffer,e.byteOffset+2*r*4,2));return e}static multiply(t,e){return new pt(new Uint32Array(t.buffer)).times(e)}static add(t,e){return new pt(new Uint32Array(t.buffer)).plus(e)}},qt=class extends Mn{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 qt.fromString(typeof t=="string"?t:t.toString(),e)}static fromNumber(t,e=new Uint32Array(2)){return qt.fromString(t.toString(),e)}static fromString(t,e=new Uint32Array(2)){let r=t.startsWith("-"),n=t.length,o=new qt(e);for(let u=r?1:0;u<n;){let h=Zr<n-u?Zr:n-u,m=new qt(new Uint32Array([Number.parseInt(t.slice(u,u+h),10),0])),g=new qt(new Uint32Array([Ga[h],0]));o.times(g),o.plus(m),u+=h}return r?o.negate():o}static convertArray(t){let e=new Uint32Array(t.length*2);for(let r=-1,n=t.length;++r<n;)qt.from(t[r],new Uint32Array(e.buffer,e.byteOffset+2*r*4,2));return e}static multiply(t,e){return new qt(new Uint32Array(t.buffer)).times(e)}static add(t,e){return new qt(new Uint32Array(t.buffer)).plus(e)}},Fe=class{constructor(t){this.buffer=t}high(){return new qt(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2))}low(){return new qt(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 pt(new Uint32Array([this.buffer[3],0])),r=new pt(new Uint32Array([this.buffer[2],0])),n=new pt(new Uint32Array([this.buffer[1],0])),o=new pt(new Uint32Array([this.buffer[0],0])),u=new pt(new Uint32Array([t.buffer[3],0])),h=new pt(new Uint32Array([t.buffer[2],0])),m=new pt(new Uint32Array([t.buffer[1],0])),g=new pt(new Uint32Array([t.buffer[0],0])),F=pt.multiply(o,g);this.buffer[0]=F.low();let D=new pt(new Uint32Array([F.high(),0]));return F=pt.multiply(n,g),D.plus(F),F=pt.multiply(o,m),D.plus(F),this.buffer[1]=D.low(),this.buffer[3]=D.lessThan(F)?1:0,this.buffer[2]=D.high(),new pt(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2)).plus(pt.multiply(r,g)).plus(pt.multiply(n,m)).plus(pt.multiply(o,h)),this.buffer[3]+=pt.multiply(e,g).plus(pt.multiply(r,m)).plus(pt.multiply(n,h)).plus(pt.multiply(o,u)).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`${qr(this.buffer[3])} ${qr(this.buffer[2])} ${qr(this.buffer[1])} ${qr(this.buffer[0])}`}static multiply(t,e){return new Fe(new Uint32Array(t.buffer)).times(e)}static add(t,e){return new Fe(new Uint32Array(t.buffer)).plus(e)}static from(t,e=new Uint32Array(4)){return Fe.fromString(typeof t=="string"?t:t.toString(),e)}static fromNumber(t,e=new Uint32Array(4)){return Fe.fromString(t.toString(),e)}static fromString(t,e=new Uint32Array(4)){let r=t.startsWith("-"),n=t.length,o=new Fe(e);for(let u=r?1:0;u<n;){let h=Zr<n-u?Zr:n-u,m=new Fe(new Uint32Array([Number.parseInt(t.slice(u,u+h),10),0,0,0])),g=new Fe(new Uint32Array([Ga[h],0,0,0]));o.times(g),o.plus(m),u+=h}return r?o.negate():o}static convertArray(t){let e=new Uint32Array(t.length*4);for(let r=-1,n=t.length;++r<n;)Fe.from(t[r],new Uint32Array(e.buffer,e.byteOffset+4*4*r,4));return e}};var Un=class extends P{constructor(t,e,r,n){super(),this.nodesIndex=-1,this.buffersIndex=-1,this.bytes=t,this.nodes=e,this.buffers=r,this.dictionaries=n}visit(t){return super.visit(t instanceof Q?t.type:t)}visitNull(t,{length:e}=this.nextFieldNode()){return J({type:t,length:e})}visitBool(t,{length:e,nullCount:r}=this.nextFieldNode()){return J({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitInt(t,{length:e,nullCount:r}=this.nextFieldNode()){return J({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitFloat(t,{length:e,nullCount:r}=this.nextFieldNode()){return J({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitUtf8(t,{length:e,nullCount:r}=this.nextFieldNode()){return J({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 J({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 J({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitDate(t,{length:e,nullCount:r}=this.nextFieldNode()){return J({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitTimestamp(t,{length:e,nullCount:r}=this.nextFieldNode()){return J({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitTime(t,{length:e,nullCount:r}=this.nextFieldNode()){return J({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitDecimal(t,{length:e,nullCount:r}=this.nextFieldNode()){return J({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitList(t,{length:e,nullCount:r}=this.nextFieldNode()){return J({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 J({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),children:this.visitMany(t.children)})}visitUnion(t){return t.mode===Dt.Sparse?this.visitSparseUnion(t):this.visitDenseUnion(t)}visitDenseUnion(t,{length:e,nullCount:r}=this.nextFieldNode()){return J({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),typeIds:this.readTypeIds(t),valueOffsets:this.readOffsets(t),children:this.visitMany(t.children)})}visitSparseUnion(t,{length:e,nullCount:r}=this.nextFieldNode()){return J({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),typeIds:this.readTypeIds(t),children:this.visitMany(t.children)})}visitDictionary(t,{length:e,nullCount:r}=this.nextFieldNode()){return J({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 J({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitFixedSizeList(t,{length:e,nullCount:r}=this.nextFieldNode()){return J({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 J({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)}},bo=class extends Un{constructor(t,e,r,n){super(new Uint8Array(0),e,r,n),this.sources=t}readNullBitmap(t,e,{offset:r}=this.nextBufferRange()){return e<=0?new Uint8Array(0):wr(this.sources[r])}readOffsets(t,{offset:e}=this.nextBufferRange()){return rt(Uint8Array,rt(Int32Array,this.sources[e]))}readTypeIds(t,{offset:e}=this.nextBufferRange()){return rt(Uint8Array,rt(t.ArrayType,this.sources[e]))}readData(t,{offset:e}=this.nextBufferRange()){let{sources:r}=this;return L.isTimestamp(t)?rt(Uint8Array,qt.convertArray(r[e])):(L.isInt(t)||L.isTime(t))&&t.bitWidth===64?rt(Uint8Array,qt.convertArray(r[e])):L.isDate(t)&&t.unit===ee.MILLISECOND?rt(Uint8Array,qt.convertArray(r[e])):L.isDecimal(t)?rt(Uint8Array,Fe.convertArray(r[e])):L.isBinary(t)||L.isFixedSizeBinary(t)?IS(r[e]):L.isBool(t)?wr(r[e]):L.isUtf8(t)?Ji(r[e].join("")):rt(Uint8Array,rt(t.ArrayType,r[e].map(n=>+n)))}};function IS(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 Qr=class extends pi{constructor(t){super(t),this._values=new ir(new Uint8Array(0))}get byteLength(){let t=this._pendingLength+this.length*4;return this._offsets&&(t+=this._offsets.byteLength),this._values&&(t+=this._values.byteLength),this._nulls&&(t+=this._nulls.byteLength),t}setValue(t,e){return super.setValue(t,Y(e))}_flushPending(t,e){let r=this._offsets,n=this._values.reserve(e).buffer,o=0;for(let[u,h]of t)if(h===void 0)r.set(u,0);else{let m=h.length;n.set(h,o),r.set(u,m),o+=m}}};var vo=class extends Bt{constructor(t){super(t),this._values=new Gr}setValue(t,e){this._values.set(t,+e)}};var Ar=class extends Xt{};Ar.prototype._setValue=Ta;var Ln=class extends Ar{};Ln.prototype._setValue=Ys;var Nn=class extends Ar{};Nn.prototype._setValue=Xs;var Pn=class extends Xt{};Pn.prototype._setValue=ka;var go=class extends Bt{constructor({type:t,nullValues:e,dictionaryHashFunction:r}){super({type:new Ee(t.dictionary,t.indices,t.id,t.isOrdered)}),this._nulls=null,this._dictionaryOffset=0,this._keysToIndices=Object.create(null),this.indices=Fr({type:this.type.indices,nullValues:e}),this.dictionary=Fr({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,n=this.valueToKey(e),o=r[n];return o===void 0&&(r[n]=o=this._dictionaryOffset+this.dictionary.append(e).length-1),this.indices.setValue(t,o)}flush(){let t=this.type,e=this._dictionary,r=this.dictionary.toVector(),n=this.indices.flush().clone(t);return n.dictionary=e?e.concat(r):r,this.finished||(this._dictionaryOffset+=r.length),this._dictionary=n.dictionary,this.clear(),n}finish(){return this.indices.finish(),this.dictionary.finish(),this._dictionaryOffset=0,this._keysToIndices=Object.create(null),super.finish()}clear(){return this.indices.clear(),this.dictionary.clear(),super.clear()}valueToKey(t){return typeof t=="string"?t:`${t}`}};var Vn=class extends Xt{};Vn.prototype._setValue=Ba;var wo=class extends Bt{setValue(t,e){let[r]=this.children,n=t*this.stride;for(let o=-1,u=e.length;++o<u;)r.set(n+o,e[o])}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 ii(this.type.listSize,new Q(e,t.type,!0)),r}};var xr=class extends Xt{setValue(t,e){this._values.set(t,e)}},jo=class extends xr{setValue(t,e){super.setValue(t,Sn(e))}},So=class extends xr{},Io=class extends xr{};var Br=class extends Xt{};Br.prototype._setValue=Oa;var Hn=class extends Br{};Hn.prototype._setValue=io;var zn=class extends Br{};zn.prototype._setValue=ro;var We=class extends Xt{setValue(t,e){this._values.set(t,e)}},Co=class extends We{},Ao=class extends We{},Fo=class extends We{},xo=class extends We{},Bo=class extends We{},To=class extends We{},Do=class extends We{},Eo=class extends We{};var ko=class extends pi{constructor(t){super(t),this._offsets=new Kr}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 ti(new Q(e,t.type,!0)),this.numChildren-1}_flushPending(t){let e=this._offsets,[r]=this.children;for(let[n,o]of t)if(o===void 0)e.set(n,0);else{let u=o.length,h=e.set(n,u).buffer[n];for(let m=-1;++m<u;)r.set(h+m,o[m])}}};var Oo=class extends pi{set(t,e){return super.set(t,e)}setValue(t,e){let r=e instanceof Map?e:new Map(Object.entries(e)),n=this._pending||(this._pending=new Map),o=n.get(t);o&&(this._pendingLength-=o.size),this._pendingLength+=r.size,n.set(t,r)}addChild(t,e=`${this.numChildren}`){if(this.numChildren>0)throw new Error("ListBuilder can only have one child.");return this.children[this.numChildren]=t,this.type=new ri(new Q(e,t.type,!0),this.type.keysSorted),this.numChildren-1}_flushPending(t){let e=this._offsets,[r]=this.children;for(let[n,o]of t)if(o===void 0)e.set(n,0);else{let{[n]:u,[n+1]:h}=e.set(n,o.size).buffer;for(let m of o.entries())if(r.set(u,m),++u>=h)break}}};var Ro=class extends Bt{setValue(t,e){}setValid(t,e){return this.length=Math.max(t+1,this.length),e}};var Mo=class extends Bt{setValue(t,e){let{children:r,type:n}=this;switch(Array.isArray(e)||e.constructor){case!0:return n.children.forEach((o,u)=>r[u].set(t,e[u]));case Map:return n.children.forEach((o,u)=>r[u].set(t,e.get(o.name)));default:return n.children.forEach((o,u)=>r[u].set(t,e[o.name]))}}setValid(t,e){return super.setValid(t,e)||this.children.forEach(r=>r.setValid(t,e)),e}addChild(t,e=`${this.numChildren}`){let r=this.children.push(t);return this.type=new St([...this.type.children,new Q(e,t.type,!0)]),r}};var Hi=class extends Xt{};Hi.prototype._setValue=Da;var Wn=class extends Hi{};Wn.prototype._setValue=Gs;var $n=class extends Hi{};$n.prototype._setValue=Ks;var Yn=class extends Hi{};Yn.prototype._setValue=Js;var Xn=class extends Hi{};Xn.prototype._setValue=qs;var zi=class extends Xt{};zi.prototype._setValue=Ea;var Gn=class extends zi{};Gn.prototype._setValue=Zs;var Kn=class extends zi{};Kn.prototype._setValue=Qs;var Jn=class extends zi{};Jn.prototype._setValue=to;var qn=class extends zi{};qn.prototype._setValue=eo;var tn=class extends Bt{constructor(t){super(t),this._typeIds=new Li(new 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.setValid(t,this.isValid(e))&&this.setValue(t,e,r),this}setValue(t,e,r){this._typeIds.set(t,r);let n=this.type.typeIdToChildIndex[r],o=this.children[n];o==null||o.set(t,e)}addChild(t,e=`${this.children.length}`){let r=this.children.push(t),{type:{children:n,mode:o,typeIds:u}}=this,h=[...n,new Q(e,t.type)];return this.type=new ei(o,[...u,r],h),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.")}},Uo=class extends tn{},Lo=class extends tn{constructor(t){super(t),this._offsets=new Li(new Int32Array(0))}setValue(t,e,r){let n=this._typeIds.set(t,r).buffer[t],o=this.getChildAt(this.type.typeIdToChildIndex[n]),u=this._offsets.set(t,o.length).buffer[t];o==null||o.set(u,e)}};var Zn=class extends pi{constructor(t){super(t),this._values=new ir(new Uint8Array(0))}get byteLength(){let t=this._pendingLength+this.length*4;return this._offsets&&(t+=this._offsets.byteLength),this._values&&(t+=this._values.byteLength),this._nulls&&(t+=this._nulls.byteLength),t}setValue(t,e){return super.setValue(t,Ji(e))}_flushPending(t,e){}};Zn.prototype._flushPending=Qr.prototype._flushPending;var Ja=class extends P{visitNull(){return Ro}visitBool(){return vo}visitInt(){return We}visitInt8(){return Co}visitInt16(){return Ao}visitInt32(){return Fo}visitInt64(){return xo}visitUint8(){return Bo}visitUint16(){return To}visitUint32(){return Do}visitUint64(){return Eo}visitFloat(){return xr}visitFloat16(){return jo}visitFloat32(){return So}visitFloat64(){return Io}visitUtf8(){return Zn}visitBinary(){return Qr}visitFixedSizeBinary(){return Vn}visitDate(){return Ar}visitDateDay(){return Ln}visitDateMillisecond(){return Nn}visitTimestamp(){return Hi}visitTimestampSecond(){return Wn}visitTimestampMillisecond(){return $n}visitTimestampMicrosecond(){return Yn}visitTimestampNanosecond(){return Xn}visitTime(){return zi}visitTimeSecond(){return Gn}visitTimeMillisecond(){return Kn}visitTimeMicrosecond(){return Jn}visitTimeNanosecond(){return qn}visitDecimal(){return Pn}visitList(){return ko}visitStruct(){return Mo}visitUnion(){return tn}visitDenseUnion(){return Lo}visitSparseUnion(){return Uo}visitDictionary(){return go}visitInterval(){return Br}visitIntervalDayTime(){return Hn}visitIntervalYearMonth(){return zn}visitFixedSizeList(){return wo}visitMap(){return Oo}},cp=new Ja;var W=class extends P{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,n)=>this.compareFields(r,e[n]))}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 xe(i,t){return t instanceof i.constructor}function Qn(i,t){return i===t||xe(i,t)}function Wi(i,t){return i===t||xe(i,t)&&i.bitWidth===t.bitWidth&&i.isSigned===t.isSigned}function No(i,t){return i===t||xe(i,t)&&i.precision===t.precision}function CS(i,t){return i===t||xe(i,t)&&i.byteWidth===t.byteWidth}function qa(i,t){return i===t||xe(i,t)&&i.unit===t.unit}function ts(i,t){return i===t||xe(i,t)&&i.unit===t.unit&&i.timezone===t.timezone}function es(i,t){return i===t||xe(i,t)&&i.unit===t.unit&&i.bitWidth===t.bitWidth}function AS(i,t){return i===t||xe(i,t)&&i.children.length===t.children.length&&Ii.compareManyFields(i.children,t.children)}function FS(i,t){return i===t||xe(i,t)&&i.children.length===t.children.length&&Ii.compareManyFields(i.children,t.children)}function Za(i,t){return i===t||xe(i,t)&&i.mode===t.mode&&i.typeIds.every((e,r)=>e===t.typeIds[r])&&Ii.compareManyFields(i.children,t.children)}function xS(i,t){return i===t||xe(i,t)&&i.id===t.id&&i.isOrdered===t.isOrdered&&Ii.visit(i.indices,t.indices)&&Ii.visit(i.dictionary,t.dictionary)}function Qa(i,t){return i===t||xe(i,t)&&i.unit===t.unit}function BS(i,t){return i===t||xe(i,t)&&i.listSize===t.listSize&&i.children.length===t.children.length&&Ii.compareManyFields(i.children,t.children)}function TS(i,t){return i===t||xe(i,t)&&i.keysSorted===t.keysSorted&&i.children.length===t.children.length&&Ii.compareManyFields(i.children,t.children)}W.prototype.visitNull=Qn;W.prototype.visitBool=Qn;W.prototype.visitInt=Wi;W.prototype.visitInt8=Wi;W.prototype.visitInt16=Wi;W.prototype.visitInt32=Wi;W.prototype.visitInt64=Wi;W.prototype.visitUint8=Wi;W.prototype.visitUint16=Wi;W.prototype.visitUint32=Wi;W.prototype.visitUint64=Wi;W.prototype.visitFloat=No;W.prototype.visitFloat16=No;W.prototype.visitFloat32=No;W.prototype.visitFloat64=No;W.prototype.visitUtf8=Qn;W.prototype.visitBinary=Qn;W.prototype.visitFixedSizeBinary=CS;W.prototype.visitDate=qa;W.prototype.visitDateDay=qa;W.prototype.visitDateMillisecond=qa;W.prototype.visitTimestamp=ts;W.prototype.visitTimestampSecond=ts;W.prototype.visitTimestampMillisecond=ts;W.prototype.visitTimestampMicrosecond=ts;W.prototype.visitTimestampNanosecond=ts;W.prototype.visitTime=es;W.prototype.visitTimeSecond=es;W.prototype.visitTimeMillisecond=es;W.prototype.visitTimeMicrosecond=es;W.prototype.visitTimeNanosecond=es;W.prototype.visitDecimal=Qn;W.prototype.visitList=AS;W.prototype.visitStruct=FS;W.prototype.visitUnion=Za;W.prototype.visitDenseUnion=Za;W.prototype.visitSparseUnion=Za;W.prototype.visitDictionary=xS;W.prototype.visitInterval=Qa;W.prototype.visitIntervalDayTime=Qa;W.prototype.visitIntervalYearMonth=Qa;W.prototype.visitFixedSizeList=BS;W.prototype.visitMap=TS;var Ii=new W;function Tr(i,t){return Ii.compareSchemas(i,t)}function up(i,t){return Ii.compareFields(i,t)}function dp(i,t){return Ii.visit(i,t)}function Fr(i){let t=i.type,e=new(cp.getVisitFn(t)())(i);if(t.children&&t.children.length>0){let r=i.children||[],n={nullValues:i.nullValues},o=Array.isArray(r)?(u,h)=>r[h]||n:({name:u})=>r[u]||n;for(let[u,h]of t.children.entries()){let{type:m}=h,g=o(h,u);e.children.push(Fr(Object.assign(Object.assign({},g),{type:m})))}}return e}function Po(i,t){return DS(i,t.map(e=>e.data.concat()))}function DS(i,t){let e=[...i.fields],r=[],n={numBatches:t.reduce((D,B)=>Math.max(D,B.length),0)},o=0,u=0,h=-1,m=t.length,g,F=[];for(;n.numBatches-- >0;){for(u=Number.POSITIVE_INFINITY,h=-1;++h<m;)F[h]=g=t[h].shift(),u=Math.min(u,g?g.length:u);Number.isFinite(u)&&(F=ES(e,u,F,t,n),u>0&&(r[o++]=J({type:new St(e),length:u,nullCount:0,children:F.slice()})))}return[i=i.assign(e),r.map(D=>new jt(i,D))]}function ES(i,t,e,r,n){var o;let u=(t+63&-64)>>3;for(let h=-1,m=r.length;++h<m;){let g=e[h],F=g==null?void 0:g.length;if(F>=t)F===t?e[h]=g:(e[h]=g.slice(0,t),n.numBatches=Math.max(n.numBatches,r[h].unshift(g.slice(t,F-t))));else{let D=i[h];i[h]=D.clone({nullable:!0}),e[h]=(o=g==null?void 0:g._changeLengthAndBackfillNullBitmap(t))!==null&&o!==void 0?o:J({type:D.type,length:t,nullCount:t,nullBitmap:new Uint8Array(u)})}}return e}var fp,Rt=class{constructor(...t){var e,r;if(t.length===0)return this.batches=[],this.schema=new ot([]),this._offsets=[0],this;let n,o;t[0]instanceof ot&&(n=t.shift()),t[t.length-1]instanceof Uint32Array&&(o=t.pop());let u=m=>{if(m){if(m instanceof jt)return[m];if(m instanceof Rt)return m.batches;if(m instanceof ht){if(m.type instanceof St)return[new jt(new ot(m.type.children),m)]}else{if(Array.isArray(m))return m.flatMap(g=>u(g));if(typeof m[Symbol.iterator]=="function")return[...m].flatMap(g=>u(g));if(typeof m=="object"){let g=Object.keys(m),F=g.map(k=>new G([m[k]])),D=new ot(g.map((k,at)=>new Q(String(k),F[at].type))),[,B]=Po(D,F);return B.length===0?[new jt(m)]:B}}}return[]},h=t.flatMap(m=>u(m));if(n=(r=n!=null?n:(e=h[0])===null||e===void 0?void 0:e.schema)!==null&&r!==void 0?r:new ot([]),!(n instanceof ot))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");for(let m of h){if(!(m instanceof jt))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");if(!Tr(n,m.schema))throw new TypeError("Table and inner RecordBatch schemas must be equivalent.")}this.schema=n,this.batches=h,this._offsets=o!=null?o:lo(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=ao(this.data)),this._nullCount}isValid(t){return!1}get(t){return null}set(t,e){}indexOf(t,e){return-1}getByteLength(t){return 0}[Symbol.iterator](){return this.batches.length>0?Yr.visit(new G(this.data)):new Array(0)[Symbol.iterator]()}toArray(){return[...this]}toString(){return`[
8
8
  ${this.toArray().join(`,
9
9
  `)}
10
- ]`}concat(...t){let e=this.schema,r=this.data.concat(t.flatMap(({data:n})=>n));return new Et(e,r.map(n=>new bt(e,n)))}slice(t,e){let r=this.schema;[t,e]=gn({length:this.numRows},t,e);let n=so(this.data,this._offsets,t,e);return new Et(r,n.map(o=>new bt(r,o)))}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],n=J({type:r,length:0,nullCount:0});e.push(n._changeLengthAndBackfillNullBitmap(this.numRows))}return new G(e)}return null}setChild(t,e){var r;return this.setChildAt((r=this.schema.fields)===null||r===void 0?void 0:r.findIndex(n=>n.name===t),e)}setChildAt(t,e){let r=this.schema,n=[...this.batches];if(t>-1&&t<this.numCols){e||(e=new G([J({type:new de,length:this.numRows})]));let o=r.fields.slice(),c=o[t].clone({type:e.type}),p=this.schema.fields.map((b,g)=>this.getChildAt(g));[o[t],p[t]]=[c,e],[r,n]=Ro(r,p)}return new Et(r,n)}select(t){let e=this.schema.fields.reduce((r,n,o)=>r.set(n.name,o),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(n=>n.selectAt(t));return new Et(e,r)}assign(t){let e=this.schema.fields,[r,n]=t.schema.fields.reduce((p,b,g)=>{let[A,T]=p,F=e.findIndex(k=>k.name===b.name);return~F?T[F]=g:A.push(g),p},[[],[]]),o=this.schema.assign(t.schema),c=[...e.map((p,b)=>[b,n[b]]).map(([p,b])=>b===void 0?this.getChildAt(p):t.getChildAt(b)),...r.map(p=>t.getChildAt(p))].filter(Boolean);return new Et(...Ro(o,c))}};ap=Symbol.toStringTag;Et[ap]=(i=>(i.schema=null,i.batches=[],i._offsets=new Uint32Array([0]),i._nullCount=-1,i[Symbol.isConcatSpreadable]=!0,i.isValid=Qi(Sn),i.get=Qi(Ut.getVisitFn(C.Struct)),i.set=oo(ee.getVisitFn(C.Struct)),i.indexOf=ao(gr.getVisitFn(C.Struct)),i.getByteLength=Qi(Ee.getVisitFn(C.Struct)),"Table"))(Et.prototype);var cp,bt=class{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=J({nullCount:0,type:new gt(this.schema.fields),children:this.schema.fields.map(e=>J({type:e.type,nullCount:0}))})]=t,!(this.data instanceof dt))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");[this.schema,this.data]=lp(this.schema,this.data.children);break}case 1:{let[e]=t,{fields:r,children:n,length:o}=Object.keys(e).reduce((b,g,A)=>(b.children[A]=e[g],b.length=Math.max(b.length,e[g].length),b.fields[A]=Q.new({name:g,type:e[g].type,nullable:!0}),b),{length:0,fields:new Array,children:new Array}),c=new at(r),p=J({type:new gt(r),length:o,children:n,nullCount:0});[this.schema,this.data]=lp(c,p.children,o);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=up(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 Ut.visit(this.data,t)}set(t,e){return ee.visit(this.data,t,e)}indexOf(t,e){return gr.visit(this.data,t,e)}getByteLength(t){return Ee.visit(this.data,t)}[Symbol.iterator](){return $r.visit(new G([this.data]))}toArray(){return[...this]}concat(...t){return new Et(this.schema,[this,...t])}slice(t,e){let[r]=new G([this.data]).slice(t,e).data;return new bt(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 G([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(n=>n.name===t),e)}setChildAt(t,e){let r=this.schema,n=this.data;if(t>-1&&t<this.numCols){e||(e=new G([J({type:new de,length:this.numRows})]));let o=r.fields.slice(),c=n.children.slice(),p=o[t].clone({type:e.type});[o[t],c[t]]=[p,e.data[0]],r=new at(o,new Map(this.schema.metadata)),n=J({type:new gt(o),children:c})}return new bt(r,n)}select(t){let e=this.schema.select(t),r=new gt(e.fields),n=[];for(let o of t){let c=this.schema.fields.findIndex(p=>p.name===o);~c&&(n[c]=this.data.children[c])}return new bt(e,J({type:r,length:this.numRows,children:n}))}selectAt(t){let e=this.schema.selectAt(t),r=t.map(o=>this.data.children[o]).filter(Boolean),n=J({type:new gt(e.fields),length:this.numRows,children:r});return new bt(e,n)}};cp=Symbol.toStringTag;bt[cp]=(i=>(i._nullCount=-1,i[Symbol.isConcatSpreadable]=!0,"RecordBatch"))(bt.prototype);function lp(i,t,e=t.reduce((r,n)=>Math.max(r,n.length),0)){var r;let n=[...i.fields],o=[...t],c=(e+63&-64)>>3;for(let[p,b]of i.fields.entries()){let g=t[p];(!g||g.length!==e)&&(n[p]=b.clone({nullable:!0}),o[p]=(r=g==null?void 0:g._changeLengthAndBackfillNullBitmap(e))!==null&&r!==void 0?r:J({type:b.type,length:e,nullCount:e,nullBitmap:new Uint8Array(c)}))}return[i.assign(n),J({type:new gt(n),length:e,children:o})]}function up(i,t,e=new Map){for(let r=-1,n=i.length;++r<n;){let c=i[r].type,p=t[r];if(N.isDictionary(c)){if(!e.has(c.id))p.dictionary&&e.set(c.id,p.dictionary);else if(e.get(c.id)!==p.dictionary)throw new Error("Cannot create Schema containing two different dictionaries with the same Id")}c.children&&c.children.length>0&&up(c.children,p.children,e)}return e}var Fr=class extends bt{constructor(t){let e=t.fields.map(n=>J({type:n.type})),r=J({type:new gt(t.fields),nullCount:0,children:e});super(t,r)}};var Zn;(function(i){i[i.BUFFER=0]="BUFFER"})(Zn||(Zn={}));var Qn;(function(i){i[i.LZ4_FRAME=0]="LZ4_FRAME",i[i.ZSTD=1]="ZSTD"})(Qn||(Qn={}));var si=class{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 si).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsBodyCompression(t,e){return t.setPosition(t.position()+4),(e||new si).__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):Qn.LZ4_FRAME}method(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt8(this.bb_pos+t):Zn.BUFFER}static startBodyCompression(t){t.startObject(2)}static addCodec(t,e){t.addFieldInt8(0,e,Qn.LZ4_FRAME)}static addMethod(t,e){t.addFieldInt8(1,e,Zn.BUFFER)}static endBodyCompression(t){return t.endObject()}static createBodyCompression(t,e,r){return si.startBodyCompression(t),si.addCodec(t,e),si.addMethod(t,r),si.endBodyCompression(t)}};var tn=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(r),t.writeInt64(e),t.offset()}};var en=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(r),t.writeInt64(e),t.offset()}};var oe=class{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 oe).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsRecordBatch(t,e){return t.setPosition(t.position()+4),(e||new oe).__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):this.bb.createLong(0,0)}nodes(t,e){let r=this.bb.__offset(this.bb_pos,6);return r?(e||new en).__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 tn).__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 si).__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,t.createLong(0,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 We=class{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 We).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDictionaryBatch(t,e){return t.setPosition(t.position()+4),(e||new We).__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):this.bb.createLong(0,0)}data(t){let e=this.bb.__offset(this.bb_pos,6);return e?(t||new oe).__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,t.createLong(0,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 rn;(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"})(rn||(rn={}));var Mt=class{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 Mt).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsMessage(t,e){return t.setPosition(t.position()+4),(e||new Mt).__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):er.V1}headerType(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readUint8(this.bb_pos+t):rn.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):this.bb.createLong(0,0)}customMetadata(t,e){let r=this.bb.__offset(this.bb_pos,12);return r?(e||new wt).__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,er.V1)}static addHeaderType(t,e){t.addFieldInt8(1,e,rn.NONE)}static addHeader(t,e){t.addFieldOffset(2,e,0)}static addBodyLength(t,e){t.addFieldInt64(3,e,t.createLong(0,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,n,o,c){return Mt.startMessage(t),Mt.addVersion(t,e),Mt.addHeaderType(t,r),Mt.addHeader(t,n),Mt.addBodyLength(t,o),Mt.addCustomMetadata(t,c),Mt.endMessage(t)}};var wS=Nt,Za=class extends V{visit(t,e){return t==null||e==null?void 0:super.visit(t,e)}visitNull(t,e){return mi.startNull(e),mi.endNull(e)}visitInt(t,e){return Yt.startInt(e),Yt.addBitWidth(e,t.bitWidth),Yt.addIsSigned(e,t.isSigned),Yt.endInt(e)}visitFloat(t,e){return we.startFloatingPoint(e),we.addPrecision(e,t.precision),we.endFloatingPoint(e)}visitBinary(t,e){return pi.startBinary(e),pi.endBinary(e)}visitBool(t,e){return yi.startBool(e),yi.endBool(e)}visitUtf8(t,e){return vi.startUtf8(e),vi.endUtf8(e)}visitDecimal(t,e){return Xt.startDecimal(e),Xt.addScale(e,t.scale),Xt.addPrecision(e,t.precision),Xt.addBitWidth(e,t.bitWidth),Xt.endDecimal(e)}visitDate(t,e){return be.startDate(e),be.addUnit(e,t.unit),be.endDate(e)}visitTime(t,e){return re.startTime(e),re.addUnit(e,t.unit),re.addBitWidth(e,t.bitWidth),re.endTime(e)}visitTimestamp(t,e){let r=t.timezone&&e.createString(t.timezone)||void 0;return ne.startTimestamp(e),ne.addUnit(e,t.unit),r!==void 0&&ne.addTimezone(e,r),ne.endTimestamp(e)}visitInterval(t,e){return je.startInterval(e),je.addUnit(e,t.unit),je.endInterval(e)}visitList(t,e){return _i.startList(e),_i.endList(e)}visitStruct(t,e){return bi.startStruct_(e),bi.endStruct_(e)}visitUnion(t,e){Gt.startTypeIdsVector(e,t.typeIds.length);let r=Gt.createTypeIdsVector(e,t.typeIds);return Gt.startUnion(e),Gt.addMode(e,t.mode),Gt.addTypeIds(e,r),Gt.endUnion(e)}visitDictionary(t,e){let r=this.visit(t.indices,e);return ke.startDictionaryEncoding(e),ke.addId(e,new wS(t.id,0)),ke.addIsOrdered(e,t.isOrdered),r!==void 0&&ke.addIndexType(e,r),ke.endDictionaryEncoding(e)}visitFixedSizeBinary(t,e){return ve.startFixedSizeBinary(e),ve.addByteWidth(e,t.byteWidth),ve.endFixedSizeBinary(e)}visitFixedSizeList(t,e){return ge.startFixedSizeList(e),ge.addListSize(e,t.listSize),ge.endFixedSizeList(e)}visitMap(t,e){return Se.startMap(e),Se.addKeysSorted(e,t.keysSorted),Se.endMap(e)}},Uo=new Za;function pp(i,t=new Map){return new at(jS(i,t),No(i.customMetadata),t)}function Qa(i){return new ie(i.count,_p(i.columns),mp(i.columns))}function yp(i){return new Fe(Qa(i.data),i.id,i.isDelta)}function jS(i,t){return(i.fields||[]).filter(Boolean).map(e=>Q.fromJSON(e,t))}function dp(i,t){return(i.children||[]).filter(Boolean).map(e=>Q.fromJSON(e,t))}function _p(i){return(i||[]).reduce((t,e)=>[...t,new oi(e.count,SS(e.VALIDITY)),..._p(e.children)],[])}function mp(i,t=[]){for(let e=-1,r=(i||[]).length;++e<r;){let n=i[e];n.VALIDITY&&t.push(new xe(t.length,n.VALIDITY.length)),n.TYPE&&t.push(new xe(t.length,n.TYPE.length)),n.OFFSET&&t.push(new xe(t.length,n.OFFSET.length)),n.DATA&&t.push(new xe(t.length,n.DATA.length)),t=mp(n.children,t)}return t}function SS(i){return(i||[]).reduce((t,e)=>t+ +(e===0),0)}function bp(i,t){let e,r,n,o,c,p;return!t||!(o=i.dictionary)?(c=hp(i,dp(i,t)),n=new Q(i.name,c,i.nullable,No(i.customMetadata))):t.has(e=o.id)?(r=(r=o.indexType)?fp(r):new ci,p=new Te(t.get(e),r,e,o.isOrdered),n=new Q(i.name,p,i.nullable,No(i.customMetadata))):(r=(r=o.indexType)?fp(r):new ci,t.set(e,c=hp(i,dp(i,t))),p=new Te(c,r,e,o.isOrdered),n=new Q(i.name,p,i.nullable,No(i.customMetadata))),n||null}function No(i){return new Map(Object.entries(i||{}))}function fp(i){return new Ot(i.isSigned,i.bitWidth)}function hp(i,t){let e=i.type.name;switch(e){case"NONE":return new de;case"null":return new de;case"binary":return new Fi;case"utf8":return new Bi;case"bool":return new Ti;case"list":return new Ze((t||[])[0]);case"struct":return new gt(t||[]);case"struct_":return new gt(t||[])}switch(e){case"int":{let r=i.type;return new Ot(r.isSigned,r.bitWidth)}case"floatingpoint":{let r=i.type;return new me(It[r.precision])}case"decimal":{let r=i.type;return new Di(r.scale,r.precision,r.bitWidth)}case"date":{let r=i.type;return new Ei(te[r.unit])}case"time":{let r=i.type;return new qe(ot[r.unit],r.bitWidth)}case"timestamp":{let r=i.type;return new ki(ot[r.unit],r.timezone)}case"interval":{let r=i.type;return new Oi(ue[r.unit])}case"union":{let r=i.type;return new Qe(Ft[r.mode],r.typeIds||[],t||[])}case"fixedsizebinary":{let r=i.type;return new Mi(r.byteWidth)}case"fixedsizelist":{let r=i.type;return new ti(r.listSize,(t||[])[0])}case"map":{let r=i.type;return new ei((t||[])[0],r.keysSorted)}}throw new Error(`Unrecognized type: "${e}"`)}var Br=Nt,IS=Ni,CS=fe,Pt=class{constructor(t,e,r,n){this._version=e,this._headerType=r,this.body=new Uint8Array(0),n&&(this._createHeader=()=>n),this._bodyLength=typeof t=="number"?t:t.low}static fromJSON(t,e){let r=new Pt(0,Wt.V4,e);return r._createHeader=AS(t,e),r}static decode(t){t=new CS(Y(t));let e=Mt.getRootAsMessage(t),r=e.bodyLength(),n=e.version(),o=e.headerType(),c=new Pt(r,n,o);return c._createHeader=xS(e,o),c}static encode(t){let e=new IS,r=-1;return t.isSchema()?r=at.encode(e,t.header()):t.isRecordBatch()?r=ie.encode(e,t.header()):t.isDictionaryBatch()&&(r=Fe.encode(e,t.header())),Mt.startMessage(e),Mt.addVersion(e,Wt.V4),Mt.addHeader(e,r),Mt.addHeaderType(e,t.headerType),Mt.addBodyLength(e,new Br(t.bodyLength,0)),Mt.finishMessageBuffer(e,Mt.endMessage(e)),e.asUint8Array()}static from(t,e=0){if(t instanceof at)return new Pt(0,Wt.V4,ut.Schema,t);if(t instanceof ie)return new Pt(e,Wt.V4,ut.RecordBatch,t);if(t instanceof Fe)return new Pt(e,Wt.V4,ut.DictionaryBatch,t);throw new Error(`Unrecognized Message header: ${t}`)}get type(){return this.headerType}get version(){return this._version}get headerType(){return this._headerType}get bodyLength(){return this._bodyLength}header(){return this._createHeader()}isSchema(){return this.headerType===ut.Schema}isRecordBatch(){return this.headerType===ut.RecordBatch}isDictionaryBatch(){return this.headerType===ut.DictionaryBatch}},ie=class{constructor(t,e,r){this._nodes=e,this._buffers=r,this._length=typeof t=="number"?t:t.low}get nodes(){return this._nodes}get length(){return this._length}get buffers(){return this._buffers}},Fe=class{constructor(t,e,r=!1){this._data=t,this._isDelta=r,this._id=typeof e=="number"?e:e.low}get id(){return this._id}get data(){return this._data}get isDelta(){return this._isDelta}get length(){return this.data.length}get nodes(){return this.data.nodes}get buffers(){return this.data.buffers}},xe=class{constructor(t,e){this.offset=typeof t=="number"?t:t.low,this.length=typeof e=="number"?e:e.low}},oi=class{constructor(t,e){this.length=typeof t=="number"?t:t.low,this.nullCount=typeof e=="number"?e:e.low}};function AS(i,t){return()=>{switch(t){case ut.Schema:return at.fromJSON(i);case ut.RecordBatch:return ie.fromJSON(i);case ut.DictionaryBatch:return Fe.fromJSON(i)}throw new Error(`Unrecognized Message type: { name: ${ut[t]}, type: ${t} }`)}}function xS(i,t){return()=>{switch(t){case ut.Schema:return at.decode(i.header(new Bt));case ut.RecordBatch:return ie.decode(i.header(new oe),i.version());case ut.DictionaryBatch:return Fe.decode(i.header(new We),i.version())}throw new Error(`Unrecognized Message type: { name: ${ut[t]}, type: ${t} }`)}}Q.encode=NS;Q.decode=RS;Q.fromJSON=bp;at.encode=US;at.decode=FS;at.fromJSON=pp;ie.encode=LS;ie.decode=BS;ie.fromJSON=Qa;Fe.encode=PS;Fe.decode=TS;Fe.fromJSON=yp;oi.encode=VS;oi.decode=ES;xe.encode=HS;xe.decode=DS;function FS(i,t=new Map){let e=MS(i,t);return new at(e,Lo(i),t)}function BS(i,t=Wt.V4){if(i.compression()!==null)throw new Error("Record batch compression not implemented");return new ie(i.length(),kS(i),OS(i,t))}function TS(i,t=Wt.V4){return new Fe(ie.decode(i.data(),t),i.id(),i.isDelta())}function DS(i){return new xe(i.offset(),i.length())}function ES(i){return new oi(i.length(),i.nullCount())}function kS(i){let t=[];for(let e,r=-1,n=-1,o=i.nodesLength();++r<o;)(e=i.nodes(r))&&(t[++n]=oi.decode(e));return t}function OS(i,t){let e=[];for(let r,n=-1,o=-1,c=i.buffersLength();++n<c;)(r=i.buffers(n))&&(t<Wt.V4&&(r.bb_pos+=8*(n+1)),e[++o]=xe.decode(r));return e}function MS(i,t){let e=[];for(let r,n=-1,o=-1,c=i.fieldsLength();++n<c;)(r=i.fields(n))&&(e[++o]=Q.decode(r,t));return e}function vp(i,t){let e=[];for(let r,n=-1,o=-1,c=i.childrenLength();++n<c;)(r=i.children(n))&&(e[++o]=Q.decode(r,t));return e}function RS(i,t){let e,r,n,o,c,p;return!t||!(p=i.dictionary())?(n=wp(i,vp(i,t)),r=new Q(i.name(),n,i.nullable(),Lo(i))):t.has(e=p.id().low)?(o=(o=p.indexType())?gp(o):new ci,c=new Te(t.get(e),o,e,p.isOrdered()),r=new Q(i.name(),c,i.nullable(),Lo(i))):(o=(o=p.indexType())?gp(o):new ci,t.set(e,n=wp(i,vp(i,t))),c=new Te(n,o,e,p.isOrdered()),r=new Q(i.name(),c,i.nullable(),Lo(i))),r||null}function Lo(i){let t=new Map;if(i)for(let e,r,n=-1,o=Math.trunc(i.customMetadataLength());++n<o;)(e=i.customMetadata(n))&&(r=e.key())!=null&&t.set(r,e.value());return t}function gp(i){return new Ot(i.isSigned(),i.bitWidth())}function wp(i,t){let e=i.typeType();switch(e){case At.NONE:return new de;case At.Null:return new de;case At.Binary:return new Fi;case At.Utf8:return new Bi;case At.Bool:return new Ti;case At.List:return new Ze((t||[])[0]);case At.Struct_:return new gt(t||[])}switch(e){case At.Int:{let r=i.type(new Yt);return new Ot(r.isSigned(),r.bitWidth())}case At.FloatingPoint:{let r=i.type(new we);return new me(r.precision())}case At.Decimal:{let r=i.type(new Xt);return new Di(r.scale(),r.precision(),r.bitWidth())}case At.Date:{let r=i.type(new be);return new Ei(r.unit())}case At.Time:{let r=i.type(new re);return new qe(r.unit(),r.bitWidth())}case At.Timestamp:{let r=i.type(new ne);return new ki(r.unit(),r.timezone())}case At.Interval:{let r=i.type(new je);return new Oi(r.unit())}case At.Union:{let r=i.type(new Gt);return new Qe(r.mode(),r.typeIdsArray()||[],t||[])}case At.FixedSizeBinary:{let r=i.type(new ve);return new Mi(r.byteWidth())}case At.FixedSizeList:{let r=i.type(new ge);return new ti(r.listSize(),(t||[])[0])}case At.Map:{let r=i.type(new Se);return new ei((t||[])[0],r.keysSorted())}}throw new Error(`Unrecognized type: "${At[e]}" (${e})`)}function US(i,t){let e=t.fields.map(o=>Q.encode(i,o));Bt.startFieldsVector(i,e.length);let r=Bt.createFieldsVector(i,e),n=t.metadata&&t.metadata.size>0?Bt.createCustomMetadataVector(i,[...t.metadata].map(([o,c])=>{let p=i.createString(`${o}`),b=i.createString(`${c}`);return wt.startKeyValue(i),wt.addKey(i,p),wt.addValue(i,b),wt.endKeyValue(i)})):-1;return Bt.startSchema(i),Bt.addFields(i,r),Bt.addEndianness(i,zS?ir.Little:ir.Big),n!==-1&&Bt.addCustomMetadata(i,n),Bt.endSchema(i)}function NS(i,t){let e=-1,r=-1,n=-1,o=t.type,c=t.typeId;N.isDictionary(o)?(c=o.dictionary.typeId,n=Uo.visit(o,i),r=Uo.visit(o.dictionary,i)):r=Uo.visit(o,i);let p=(o.children||[]).map(A=>Q.encode(i,A)),b=Lt.createChildrenVector(i,p),g=t.metadata&&t.metadata.size>0?Lt.createCustomMetadataVector(i,[...t.metadata].map(([A,T])=>{let F=i.createString(`${A}`),k=i.createString(`${T}`);return wt.startKeyValue(i),wt.addKey(i,F),wt.addValue(i,k),wt.endKeyValue(i)})):-1;return t.name&&(e=i.createString(t.name)),Lt.startField(i),Lt.addType(i,r),Lt.addTypeType(i,c),Lt.addChildren(i,b),Lt.addNullable(i,!!t.nullable),e!==-1&&Lt.addName(i,e),n!==-1&&Lt.addDictionary(i,n),g!==-1&&Lt.addCustomMetadata(i,g),Lt.endField(i)}function LS(i,t){let e=t.nodes||[],r=t.buffers||[];oe.startNodesVector(i,e.length);for(let c of e.slice().reverse())oi.encode(i,c);let n=i.endVector();oe.startBuffersVector(i,r.length);for(let c of r.slice().reverse())xe.encode(i,c);let o=i.endVector();return oe.startRecordBatch(i),oe.addLength(i,new Br(t.length,0)),oe.addNodes(i,n),oe.addBuffers(i,o),oe.endRecordBatch(i)}function PS(i,t){let e=ie.encode(i,t.data);return We.startDictionaryBatch(i),We.addId(i,new Br(t.id,0)),We.addIsDelta(i,t.isDelta),We.addData(i,e),We.endDictionaryBatch(i)}function VS(i,t){return en.createFieldNode(i,new Br(t.length,0),new Br(t.nullCount,0))}function HS(i,t){return tn.createBuffer(i,new Br(t.offset,0),new Br(t.length,0))}var zS=(()=>{let i=new ArrayBuffer(2);return new DataView(i).setInt16(0,256,!0),new Int16Array(i)[0]===256})();var el=i=>`Expected ${ut[i]} Message in stream, but was null or length 0.`,il=i=>`Header pointer of flatbuffer-encoded ${ut[i]} Message is null or length 0.`,jp=(i,t)=>`Expected to read ${i} metadata bytes, but only read ${t}.`,Sp=(i,t)=>`Expected to read ${i} bytes for message body, but only read ${t}.`,nn=class{constructor(t){this.source=t instanceof wi?t:new wi(t)}[Symbol.iterator](){return this}next(){let t;return(t=this.readMetadataLength()).done?jt:t.value===-1&&(t=this.readMetadataLength()).done?jt:(t=this.readMetadata(t.value)).done?jt: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(el(t));return e.value}readMessageBody(t){if(t<=0)return new Uint8Array(0);let e=Y(this.source.read(t));if(e.byteLength<t)throw new Error(Sp(t,e.byteLength));return e.byteOffset%8===0&&e.byteOffset+e.byteLength<=e.buffer.byteLength?e:e.slice()}readSchema(t=!1){let e=ut.Schema,r=this.readMessage(e),n=r==null?void 0:r.header();if(t&&!n)throw new Error(il(e));return n}readMetadataLength(){let t=this.source.read(Po),e=t&&new fe(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 jt;if(e.byteLength<t)throw new Error(jp(t,e.byteLength));return{done:!1,value:Pt.decode(e)}}},ts=class{constructor(t,e){this.source=t instanceof Ie?t:Cs(t)?new nr(t,e):new Ie(t)}[Symbol.asyncIterator](){return this}next(){return O(this,void 0,void 0,function*(){let t;return(t=yield this.readMetadataLength()).done?jt:t.value===-1&&(t=yield this.readMetadataLength()).done?jt:(t=yield this.readMetadata(t.value)).done?jt:t})}throw(t){return O(this,void 0,void 0,function*(){return yield this.source.throw(t)})}return(t){return O(this,void 0,void 0,function*(){return yield this.source.return(t)})}readMessage(t){return O(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(el(t));return e.value})}readMessageBody(t){return O(this,void 0,void 0,function*(){if(t<=0)return new Uint8Array(0);let e=Y(yield this.source.read(t));if(e.byteLength<t)throw new Error(Sp(t,e.byteLength));return e.byteOffset%8===0&&e.byteOffset+e.byteLength<=e.buffer.byteLength?e:e.slice()})}readSchema(t=!1){return O(this,void 0,void 0,function*(){let e=ut.Schema,r=yield this.readMessage(e),n=r==null?void 0:r.header();if(t&&!n)throw new Error(il(e));return n})}readMetadataLength(){return O(this,void 0,void 0,function*(){let t=yield this.source.read(Po),e=t&&new fe(t),r=(e==null?void 0:e.readInt32(0))||0;return{done:r===0,value:r}})}readMetadata(t){return O(this,void 0,void 0,function*(){let e=yield this.source.read(t);if(!e)return jt;if(e.byteLength<t)throw new Error(jp(t,e.byteLength));return{done:!1,value:Pt.decode(e)}})}},es=class extends nn{constructor(t){super(new Uint8Array(0)),this._schema=!1,this._body=[],this._batchIndex=0,this._dictionaryIndex=0,this._json=t instanceof Tn?t:new Tn(t)}next(){let{_json:t}=this;if(!this._schema){this._schema=!0;let e=Pt.fromJSON(t.schema,ut.Schema);return{done:!1,value:e}}if(this._dictionaryIndex<t.dictionaries.length){let e=t.dictionaries[this._dictionaryIndex++];this._body=e.data.columns;let r=Pt.fromJSON(e,ut.DictionaryBatch);return{done:!1,value:r}}if(this._batchIndex<t.batches.length){let e=t.batches[this._batchIndex++];this._body=e.columns;let r=Pt.fromJSON(e,ut.RecordBatch);return{done:!1,value:r}}return this._body=[],jt}readMessageBody(t){return e(this._body);function e(r){return(r||[]).reduce((n,o)=>[...n,...o.VALIDITY&&[o.VALIDITY]||[],...o.TYPE&&[o.TYPE]||[],...o.OFFSET&&[o.OFFSET]||[],...o.DATA&&[o.DATA]||[],...e(o.children)],[])}}readMessage(t){let e;if((e=this.next()).done)return null;if(t!=null&&e.value.headerType!==t)throw new Error(el(t));return e.value}readSchema(){let t=ut.Schema,e=this.readMessage(t),r=e==null?void 0:e.header();if(!e||!r)throw new Error(il(t));return r}},Po=4,tl="ARROW1",sn=new Uint8Array(tl.length);for(let i=0;i<tl.length;i+=1)sn[i]=tl.codePointAt(i);function Vo(i,t=0){for(let e=-1,r=sn.length;++e<r;)if(sn[e]!==i[t+e])return!1;return!0}var on=sn.length,rl=on+Po,Ip=on*2+Po;var Rt=class extends jr{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 Ye(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 Qt.toDOMStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this})}toNodeStream(){return Qt.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 Rt?t:Ss(t)?$S(t):Cs(t)?GS(t):Ye(t)?(()=>O(this,void 0,void 0,function*(){return yield Rt.from(yield t)}))():As(t)||_n(t)||Fs(t)||Le(t)?XS(new Ie(t)):YS(new wi(t))}static readAll(t){return t instanceof Rt?t.isSync()?Cp(t):Ap(t):Ss(t)||ArrayBuffer.isView(t)||Xe(t)||Is(t)?Cp(t):Ap(t)}},Si=class extends Rt{constructor(t){super(t),this._impl=t}readAll(){return[...this]}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return _e(this,arguments,function*(){yield it(yield*Mr(Ne(this[Symbol.iterator]())))})}},sr=class extends Rt{constructor(t){super(t),this._impl=t}readAll(){var t,e;return O(this,void 0,void 0,function*(){let r=new Array;try{for(var n=Ne(this),o;o=yield n.next(),!o.done;){let c=o.value;r.push(c)}}catch(c){t={error:c}}finally{try{o&&!o.done&&(e=n.return)&&(yield e.call(n))}finally{if(t)throw t.error}}return r})}[Symbol.iterator](){throw new Error("AsyncRecordBatchStreamReader is not Iterable")}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}},or=class extends Si{constructor(t){super(t),this._impl=t}},is=class extends sr{constructor(t){super(t),this._impl=t}},Ho=class{constructor(t=new Map){this.closed=!1,this.autoDestroy=!0,this._dictionaryIndex=0,this._recordBatchIndex=0,this.dictionaries=t}get numDictionaries(){return this._dictionaryIndex}get numRecordBatches(){return this._recordBatchIndex}isSync(){return!1}isAsync(){return!1}isFile(){return!1}isStream(){return!1}reset(t){return this._dictionaryIndex=0,this._recordBatchIndex=0,this.schema=t,this.dictionaries=new Map,this}_loadRecordBatch(t,e){let r=this._loadVectors(t,e,this.schema.fields),n=J({type:new gt(this.schema.fields),length:t.length,children:r});return new bt(this.schema,n)}_loadDictionaryBatch(t,e){let{id:r,isDelta:n}=t,{dictionaries:o,schema:c}=this,p=o.get(r);if(n||!p){let b=c.dictionaries.get(r),g=this._loadVectors(t.data,e,[b]);return(p&&n?p.concat(new G(g)):new G(g)).memoize()}return p.memoize()}_loadVectors(t,e,r){return new kn(e,t.nodes,t.buffers,this.dictionaries).visitMany(r)}},an=class extends Ho{constructor(t,e){super(e),this._reader=Ss(t)?new es(this._handle=t):new nn(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=xp(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):jt}return(t){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.return(t):jt}next(){if(this.closed)return jt;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(),n=e.readMessageBody(t.bodyLength),o=this._loadRecordBatch(r,n);return{done:!1,value:o}}else if(t.isDictionaryBatch()){this._dictionaryIndex++;let r=t.header(),n=e.readMessageBody(t.bodyLength),o=this._loadDictionaryBatch(r,n);this.dictionaries.set(r.id,o)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new Fr(this.schema)}):this.return()}_readNextMessageAndValidate(t){return this._reader.readMessage(t)}},ln=class extends Ho{constructor(t,e){super(e),this._reader=new ts(this._handle=t)}isAsync(){return!0}isStream(){return!0}[Symbol.asyncIterator](){return this}cancel(){return O(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 O(this,void 0,void 0,function*(){return this.closed||(this.autoDestroy=xp(this,t),this.schema||(this.schema=yield this._reader.readSchema())||(yield this.cancel())),this})}throw(t){return O(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.throw(t):jt})}return(t){return O(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.return(t):jt})}next(){return O(this,void 0,void 0,function*(){if(this.closed)return jt;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(),n=yield e.readMessageBody(t.bodyLength),o=this._loadRecordBatch(r,n);return{done:!1,value:o}}else if(t.isDictionaryBatch()){this._dictionaryIndex++;let r=t.header(),n=yield e.readMessageBody(t.bodyLength),o=this._loadDictionaryBatch(r,n);this.dictionaries.set(r.id,o)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new Fr(this.schema)}):yield this.return()})}_readNextMessageAndValidate(t){return O(this,void 0,void 0,function*(){return yield this._reader.readMessage(t)})}},zo=class extends an{constructor(t,e){super(t instanceof Dn?t:new Dn(t),e)}get footer(){return this._footer}get numDictionaries(){return this._footer?this._footer.numDictionaries:0}get numRecordBatches(){return this._footer?this._footer.numRecordBatches:0}isSync(){return!0}isFile(){return!0}open(t){if(!this.closed&&!this._footer){this.schema=(this._footer=this._readFooter()).schema;for(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 n=this._reader.readMessage(ut.RecordBatch);if(n!=null&&n.isRecordBatch()){let o=n.header(),c=this._reader.readMessageBody(n.bodyLength);return this._loadRecordBatch(o,c)}}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 n=this._reader.readMessage(ut.DictionaryBatch);if(n!=null&&n.isDictionaryBatch()){let o=n.header(),c=this._reader.readMessageBody(n.bodyLength),p=this._loadDictionaryBatch(o,c);this.dictionaries.set(o.id,p)}}}_readFooter(){let{_handle:t}=this,e=t.size-rl,r=t.readInt32(e),n=t.readAt(e-r,r);return Li.decode(n)}_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}},nl=class extends ln{constructor(t,...e){let r=typeof e[0]!="number"?e.shift():void 0,n=e[0]instanceof Map?e.shift():void 0;super(t instanceof nr?t:new nr(t,r),n)}get footer(){return this._footer}get numDictionaries(){return this._footer?this._footer.numDictionaries:0}get numRecordBatches(){return this._footer?this._footer.numRecordBatches:0}isFile(){return!0}isAsync(){return!0}open(t){let e=Object.create(null,{open:{get:()=>super.open}});return O(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){var e;return O(this,void 0,void 0,function*(){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 n=yield this._reader.readMessage(ut.RecordBatch);if(n!=null&&n.isRecordBatch()){let o=n.header(),c=yield this._reader.readMessageBody(n.bodyLength);return this._loadRecordBatch(o,c)}}return null})}_readDictionaryBatch(t){var e;return O(this,void 0,void 0,function*(){let r=(e=this._footer)===null||e===void 0?void 0:e.getDictionaryBatch(t);if(r&&(yield this._handle.seek(r.offset))){let n=yield this._reader.readMessage(ut.DictionaryBatch);if(n!=null&&n.isDictionaryBatch()){let o=n.header(),c=yield this._reader.readMessageBody(n.bodyLength),p=this._loadDictionaryBatch(o,c);this.dictionaries.set(o.id,p)}}})}_readFooter(){return O(this,void 0,void 0,function*(){let{_handle:t}=this;t._pending&&(yield t._pending);let e=t.size-rl,r=yield t.readInt32(e),n=yield t.readAt(e-r,r);return Li.decode(n)})}_readNextMessageAndValidate(t){return O(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})}},sl=class extends an{constructor(t,e){super(t,e)}_loadVectors(t,e,r){return new po(e,t.nodes,t.buffers,this.dictionaries).visitMany(r)}};function xp(i,t){return t&&typeof t.autoDestroy=="boolean"?t.autoDestroy:i.autoDestroy}function*Cp(i){let t=Rt.from(i);try{if(!t.open({autoDestroy:!1}).closed)do yield t;while(!t.reset().open().closed)}finally{t.cancel()}}function Ap(i){return _e(this,arguments,function*(){let e=yield it(Rt.from(i));try{if(!(yield it(e.open({autoDestroy:!1}))).closed)do yield yield it(e);while(!(yield it(e.reset().open())).closed)}finally{yield it(e.cancel())}})}function $S(i){return new Si(new sl(i))}function YS(i){let t=i.peek(on+7&-8);return t&&t.byteLength>=4?Vo(t)?new or(new zo(i.read())):new Si(new an(i)):new Si(new an(function*(){}()))}function XS(i){return O(this,void 0,void 0,function*(){let t=yield i.peek(on+7&-8);return t&&t.byteLength>=4?Vo(t)?new or(new zo(yield i.read())):new sr(new ln(i)):new sr(new ln(function(){return _e(this,arguments,function*(){})}()))})}function GS(i){return O(this,void 0,void 0,function*(){let{size:t}=yield i.stat(),e=new nr(i,t);return t>=Ip&&Vo(yield e.readAt(0,on+7&-8))?new is(new nl(e)):new sr(new ln(e))})}var Tt=class extends V{constructor(){super(),this._byteLength=0,this._nodes=[],this._buffers=[],this._bufferRegions=[]}static assemble(...t){let e=n=>n.flatMap(o=>Array.isArray(o)?e(o):o instanceof bt?o.data.children:o.data),r=new Tt;return r.visitMany(e(t)),r}visit(t){if(t instanceof G)return this.visitMany(t.data),this;let{type:e}=t;if(!N.isDictionary(e)){let{length:r,nullCount:n}=t;if(r>2147483647)throw new RangeError("Cannot write arrays larger than 2^31 - 1 in length");N.isNull(e)||ai.call(this,n<=0?new Uint8Array(0):Wr(t.offset,r,t.nullBitmap)),this.nodes.push(new oi(r,n))}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 ai(i){let t=i.byteLength+7&-8;return this.buffers.push(i),this.bufferRegions.push(new xe(this._byteLength,t)),this._byteLength+=t,this}function KS(i){let{type:t,length:e,typeIds:r,valueOffsets:n}=i;if(ai.call(this,r),t.mode===Ft.Sparse)return ol.call(this,i);if(t.mode===Ft.Dense){if(i.offset<=0)return ai.call(this,n),ol.call(this,i);{let o=r.reduce((A,T)=>Math.max(A,T),r[0]),c=new Int32Array(o+1),p=new Int32Array(o+1).fill(-1),b=new Int32Array(e),g=mn(-n[0],e,n);for(let A,T,F=-1;++F<e;)(T=p[A=r[F]])===-1&&(T=p[A]=g[A]),b[F]=g[F]-T,++c[A];ai.call(this,b);for(let A,T=-1,F=t.children.length;++T<F;)if(A=i.children[T]){let k=t.typeIds[T],lt=Math.min(e,c[k]);this.visit(A.slice(p[k],lt))}}}return this}function JS(i){let t;return i.nullCount>=i.length?ai.call(this,new Uint8Array(0)):(t=i.values)instanceof Uint8Array?ai.call(this,Wr(i.offset,i.length,t)):ai.call(this,br(i.values))}function ar(i){return ai.call(this,i.values.subarray(0,i.length*i.stride))}function Fp(i){let{length:t,values:e,valueOffsets:r}=i,n=r[0],o=r[t],c=Math.min(o-n,e.byteLength-n);return ai.call(this,mn(-r[0],t,r)),ai.call(this,e.subarray(n,n+c)),this}function al(i){let{length:t,valueOffsets:e}=i;return e&&ai.call(this,mn(e[0],t,e)),this.visit(i.children[0])}function ol(i){return this.visitMany(i.type.children.map((t,e)=>i.children[e]).filter(Boolean))[0]}Tt.prototype.visitBool=JS;Tt.prototype.visitInt=ar;Tt.prototype.visitFloat=ar;Tt.prototype.visitUtf8=Fp;Tt.prototype.visitBinary=Fp;Tt.prototype.visitFixedSizeBinary=ar;Tt.prototype.visitDate=ar;Tt.prototype.visitTimestamp=ar;Tt.prototype.visitTime=ar;Tt.prototype.visitDecimal=ar;Tt.prototype.visitList=al;Tt.prototype.visitStruct=ol;Tt.prototype.visitUnion=KS;Tt.prototype.visitInterval=ar;Tt.prototype.visitFixedSizeList=al;Tt.prototype.visitMap=al;var Tr=class extends jr{constructor(t){super(),this._position=0,this._started=!1,this._sink=new gi,this._schema=null,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._dictionaryDeltaOffsets=new Map,ce(t)||(t={autoDestroy:!0,writeLegacyIpcFormat:!1}),this._autoDestroy=typeof t.autoDestroy=="boolean"?t.autoDestroy:!0,this._writeLegacyIpcFormat=typeof t.writeLegacyIpcFormat=="boolean"?t.writeLegacyIpcFormat:!1}static throughNode(t){throw new Error('"throughNode" not available in this environment')}static throughDOM(t,e){throw new Error('"throughDOM" not available in this environment')}toString(t=!1){return this._sink.toString(t)}toUint8Array(t=!1){return this._sink.toUint8Array(t)}writeAll(t){return Ye(t)?t.then(e=>this.writeAll(e)):Le(t)?cl(this,t):ll(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 gi?this._sink=t:(this._sink=new gi,t&&Zf(t)?this.toDOMStream({type:"bytes"}).pipeTo(t):t&&Qf(t)&&this.toNodeStream({objectMode:!1}).pipe(t)),this._started&&this._schema&&this._writeFooter(this._schema),this._started=!1,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._dictionaryDeltaOffsets=new Map,(!e||!xr(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 Et&&!(e=t.schema))return this.finish()&&void 0;if(t instanceof bt&&!(e=t.schema))return this.finish()&&void 0}else throw new Error("RecordBatchWriter is closed");if(e&&!xr(e,this._schema)){if(this._started&&this._autoDestroy)return this.close();this.reset(this._sink,e)}t instanceof bt?t instanceof Fr||this._writeRecordBatch(t):t instanceof Et?this.writeAll(t.batches):Xe(t)&&this.writeAll(t)}_writeMessage(t,e=8){let r=e-1,n=Pt.encode(t),o=n.byteLength,c=this._writeLegacyIpcFormat?4:8,p=o+c+r&~r,b=p-o-c;return t.headerType===ut.RecordBatch?this._recordBatchBlocks.push(new ni(p,t.bodyLength,this._position)):t.headerType===ut.DictionaryBatch&&this._dictionaryBlocks.push(new ni(p,t.bodyLength,this._position)),this._writeLegacyIpcFormat||this._write(Int32Array.of(-1)),this._write(Int32Array.of(p-c)),o>0&&this._write(n),this._writePadding(b)}_write(t){if(this._started){let e=Y(t);e&&e.byteLength>0&&(this._sink.write(e),this._position+=e.byteLength)}return this}_writeSchema(t){return this._writeMessage(Pt.from(t))}_writeFooter(t){return this._writeLegacyIpcFormat?this._write(Int32Array.of(0)):this._write(Int32Array.of(-1,0))}_writeMagic(){return this._write(sn)}_writePadding(t){return t>0?this._write(new Uint8Array(t)):this}_writeRecordBatch(t){let{byteLength:e,nodes:r,bufferRegions:n,buffers:o}=Tt.assemble(t),c=new ie(t.numRows,r,n),p=Pt.from(c,e);return this._writeDictionaries(t)._writeMessage(p)._writeBodyBuffers(o)}_writeDictionaryBatch(t,e,r=!1){this._dictionaryDeltaOffsets.set(e,t.length+(this._dictionaryDeltaOffsets.get(e)||0));let{byteLength:n,nodes:o,bufferRegions:c,buffers:p}=Tt.assemble(new G([t])),b=new ie(t.length,o,c),g=new Fe(b,e,r),A=Pt.from(g,n);return this._writeMessage(A)._writeBodyBuffers(p)}_writeBodyBuffers(t){let e,r,n;for(let o=-1,c=t.length;++o<c;)(e=t[o])&&(r=e.byteLength)>0&&(this._write(e),(n=(r+7&-8)-r)>0&&this._writePadding(n));return this}_writeDictionaries(t){for(let[e,r]of t.dictionaries){let n=this._dictionaryDeltaOffsets.get(e)||0;if(n===0||(r=r==null?void 0:r.slice(n)).length>0)for(let o of r.data)this._writeDictionaryBatch(o,e,n>0),n+=o.length}return this}},Wi=class extends Tr{static writeAll(t,e){let r=new Wi(e);return Ye(t)?t.then(n=>r.writeAll(n)):Le(t)?cl(r,t):ll(r,t)}},$i=class extends Tr{static writeAll(t){let e=new $i;return Ye(t)?t.then(r=>e.writeAll(r)):Le(t)?cl(e,t):ll(e,t)}constructor(){super(),this._autoDestroy=!0}_writeSchema(t){return this._writeMagic()._writePadding(2)}_writeFooter(t){let e=Li.encode(new Li(t,Wt.V4,this._recordBatchBlocks,this._dictionaryBlocks));return super._writeFooter(t)._write(e)._write(Int32Array.of(e.byteLength))._writeMagic()}};function ll(i,t){let e=t;t instanceof Et&&(e=t.batches,i.reset(void 0,t.schema));for(let r of e)i.write(r);return i.finish()}function cl(i,t){var e,r,n,o;return O(this,void 0,void 0,function*(){try{for(e=Ne(t);r=yield e.next(),!r.done;){let c=r.value;i.write(c)}}catch(c){n={error:c}}finally{try{r&&!r.done&&(o=e.return)&&(yield o.call(e))}finally{if(n)throw n.error}}return i.finish()})}function Bp(i,t){if(Le(i))return ZS(i,t);if(Xe(i))return qS(i,t);throw new Error("toDOMStream() must be called with an Iterable or AsyncIterable")}function qS(i,t){let e=null,r=(t==null?void 0:t.type)==="bytes"||!1,n=(t==null?void 0:t.highWaterMark)||Math.pow(2,24);return new ReadableStream(Object.assign(Object.assign({},t),{start(c){o(c,e||(e=i[Symbol.iterator]()))},pull(c){e?o(c,e):c.close()},cancel(){((e==null?void 0:e.return)&&e.return()||!0)&&(e=null)}}),Object.assign({highWaterMark:r?n:void 0},t));function o(c,p){let b,g=null,A=c.desiredSize||null;for(;!(g=p.next(r?A:null)).done;)if(ArrayBuffer.isView(g.value)&&(b=Y(g.value))&&(A!=null&&r&&(A=A-b.byteLength+1),g.value=b),c.enqueue(g.value),A!=null&&--A<=0)return;c.close()}}function ZS(i,t){let e=null,r=(t==null?void 0:t.type)==="bytes"||!1,n=(t==null?void 0:t.highWaterMark)||Math.pow(2,24);return new ReadableStream(Object.assign(Object.assign({},t),{start(c){return O(this,void 0,void 0,function*(){yield o(c,e||(e=i[Symbol.asyncIterator]()))})},pull(c){return O(this,void 0,void 0,function*(){e?yield o(c,e):c.close()})},cancel(){return O(this,void 0,void 0,function*(){((e==null?void 0:e.return)&&(yield e.return())||!0)&&(e=null)})}}),Object.assign({highWaterMark:r?n:void 0},t));function o(c,p){return O(this,void 0,void 0,function*(){let b,g=null,A=c.desiredSize||null;for(;!(g=yield p.next(r?A:null)).done;)if(ArrayBuffer.isView(g.value)&&(b=Y(g.value))&&(A!=null&&r&&(A=A-b.byteLength+1),g.value=b),c.enqueue(g.value),A!=null&&--A<=0)return;c.close()})}}function Ep(i){return new ul(i)}var ul=class{constructor(t){this._numChunks=0,this._finished=!1,this._bufferedSize=0;let{["readableStrategy"]:e,["writableStrategy"]:r,["queueingStrategy"]:n="count"}=t,o=Jf(t,["readableStrategy","writableStrategy","queueingStrategy"]);this._controller=null,this._builder=Ir(o),this._getSize=n!=="bytes"?Tp:Dp;let{["highWaterMark"]:c=n==="bytes"?Math.pow(2,14):1e3}=Object.assign({},e),{["highWaterMark"]:p=n==="bytes"?Math.pow(2,14):1e3}=Object.assign({},r);this.readable=new ReadableStream({cancel:()=>{this._builder.clear()},pull:b=>{this._maybeFlush(this._builder,this._controller=b)},start:b=>{this._maybeFlush(this._builder,this._controller=b)}},{highWaterMark:c,size:n!=="bytes"?Tp:Dp}),this.writable=new WritableStream({abort:()=>{this._builder.clear()},write:()=>{this._maybeFlush(this._builder,this._controller)},close:()=>{this._maybeFlush(this._builder.finish(),this._controller)}},{highWaterMark:p,size:b=>this._writeValueAndReturnChunkSize(b)})}_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)}},Tp=i=>{var t;return(t=i==null?void 0:i.length)!==null&&t!==void 0?t:0},Dp=i=>{var t;return(t=i==null?void 0:i.byteLength)!==null&&t!==void 0?t:0};function Wo(i,t){let e=new gi,r=null,n=new ReadableStream({cancel(){return O(this,void 0,void 0,function*(){yield e.close()})},start(p){return O(this,void 0,void 0,function*(){yield c(p,r||(r=yield o()))})},pull(p){return O(this,void 0,void 0,function*(){r?yield c(p,r):p.close()})}});return{writable:new WritableStream(e,Object.assign({highWaterMark:Math.pow(2,14)},i)),readable:n};function o(){return O(this,void 0,void 0,function*(){return yield(yield Rt.from(e)).open(t)})}function c(p,b){return O(this,void 0,void 0,function*(){let g=p.desiredSize,A=null;for(;!(A=yield b.next()).done;)if(p.enqueue(A.value),g!=null&&--g<=0)return;p.close()})}}function $o(i,t){let e=new this(i),r=new Ie(e),n=new ReadableStream({cancel(){return O(this,void 0,void 0,function*(){yield r.cancel()})},pull(c){return O(this,void 0,void 0,function*(){yield o(c)})},start(c){return O(this,void 0,void 0,function*(){yield o(c)})}},Object.assign({highWaterMark:Math.pow(2,14)},t));return{writable:new WritableStream(e,i),readable:n};function o(c){return O(this,void 0,void 0,function*(){let p=null,b=c.desiredSize;for(;p=yield r.read(b||null);)if(c.enqueue(p),b!=null&&(b-=p.byteLength)<=0)return;c.close()})}}function Yo(i,t="stream"){return(t==="stream"?Wi:$i).writeAll(i).toUint8Array(!0)}var iI=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Sa),Xa),La),Ia),va),Na),{compareSchemas:xr,compareFields:sp,compareTypes:op});Qt.toDOMStream=Bp;Ct.throughDOM=Ep;Rt.throughDOM=Wo;or.throughDOM=Wo;Si.throughDOM=Wo;Tr.throughDOM=$o;$i.throughDOM=$o;Wi.throughDOM=$o;function cn(i){switch(i.typeId){case C.Binary:return{sqlType:"binary"};case C.Bool:return{sqlType:"bool"};case C.Date:return{sqlType:"date"};case C.DateDay:return{sqlType:"date32[d]"};case C.DateMillisecond:return{sqlType:"date64[ms]"};case C.Decimal:{let t=i;return{sqlType:"decimal",precision:t.precision,scale:t.scale}}case C.Float:return{sqlType:"float"};case C.Float16:return{sqlType:"float16"};case C.Float32:return{sqlType:"float32"};case C.Float64:return{sqlType:"float64"};case C.Int:return{sqlType:"int32"};case C.Int16:return{sqlType:"int16"};case C.Int32:return{sqlType:"int32"};case C.Int64:return{sqlType:"int64"};case C.Uint16:return{sqlType:"uint16"};case C.Uint32:return{sqlType:"uint32"};case C.Uint64:return{sqlType:"uint64"};case C.Uint8:return{sqlType:"uint8"};case C.IntervalDayTime:return{sqlType:"interval[dt]"};case C.IntervalYearMonth:return{sqlType:"interval[m]"};case C.List:return{sqlType:"list",valueType:cn(i.valueType)};case C.FixedSizeBinary:return{sqlType:"fixedsizebinary",byteWidth:i.byteWidth};case C.Null:return{sqlType:"null"};case C.Utf8:return{sqlType:"utf8"};case C.Struct:return{sqlType:"struct",fields:i.children.map(e=>Xo(e.name,e.type))};case C.Map:{let t=i;return{sqlType:"map",keyType:cn(t.keyType),valueType:cn(t.valueType)}}case C.Time:return{sqlType:"time[s]"};case C.TimeMicrosecond:return{sqlType:"time[us]"};case C.TimeMillisecond:return{sqlType:"time[ms]"};case C.TimeNanosecond:return{sqlType:"time[ns]"};case C.TimeSecond:return{sqlType:"time[s]"};case C.Timestamp:return{sqlType:"timestamp",timezone:i.timezone||void 0};case C.TimestampSecond:return{sqlType:"timestamp[s]",timezone:i.timezone||void 0};case C.TimestampMicrosecond:return{sqlType:"timestamp[us]",timezone:i.timezone||void 0};case C.TimestampNanosecond:return{sqlType:"timestamp[ns]",timezone:i.timezone||void 0};case C.TimestampMillisecond:return{sqlType:"timestamp[ms]",timezone:i.timezone||void 0}}throw new Error(`unsupported arrow type: ${i.toString()}`)}function Xo(i,t){let e=cn(t);return e.name=i,e}var Go=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){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":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(),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,n)=>n)},[]);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]),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);this.postMessage({messageId:this._nextMessageId++,requestId:t.messageId,type:"QUERY_RESULT_CHUNK",data:e},[e.buffer]);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]),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":this._bindings.registerFileHandle(t.data[0],t.data[1]),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"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 this.failWith(t,e)}}};var Mp={},rI=(()=>{var i=Mp.url;return function(t){t=t||{};var e=typeof t<"u"?t:{},r,n;e.ready=new Promise(function(s,a){r=s,n=a});var o=Object.assign({},e),c=[],p="./this.program",b=(s,a)=>{throw a},g=typeof window=="object",A=typeof importScripts=="function",T=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",F="";function k(s){return e.locateFile?e.locateFile(s,F):F+s}var lt,ct,mt,Dt;function ae(s){if(s instanceof ys)return;Oe("exiting due to exception: "+s)}var he,Yi,dr;T?(A?F=dl().dirname(F)+"/":F=__dirname+"/",dr=()=>{Yi||(he=Op(),Yi=dl())},lt=function(a,l){return dr(),a=Yi.normalize(a),he.readFileSync(a,l?void 0:"utf8")},mt=s=>{var a=lt(s,!0);return a.buffer||(a=new Uint8Array(a)),a},ct=(s,a,l)=>{dr(),s=Yi.normalize(s),he.readFile(s,function(u,d){u?l(u):a(d.buffer)})},process.argv.length>1&&(p=process.argv[1].replace(/\\/g,"/")),c=process.argv.slice(2),process.on("uncaughtException",function(s){if(!(s instanceof ys))throw s}),process.on("unhandledRejection",function(s){throw s}),b=(s,a)=>{if(Fl())throw process.exitCode=s,a;ae(a),process.exit(s)},e.inspect=function(){return"[Emscripten Module object]"}):(g||A)&&(A?F=self.location.href:typeof document<"u"&&document.currentScript&&(F=document.currentScript.src),i&&(F=i),F.indexOf("blob:")!==0?F=F.substr(0,F.replace(/[?#].*/,"").lastIndexOf("/")+1):F="",lt=s=>{var a=new XMLHttpRequest;return a.open("GET",s,!1),a.send(null),a.responseText},A&&(mt=s=>{var a=new XMLHttpRequest;return a.open("GET",s,!1),a.responseType="arraybuffer",a.send(null),new Uint8Array(a.response)}),ct=(s,a,l)=>{var u=new XMLHttpRequest;u.open("GET",s,!0),u.responseType="arraybuffer",u.onload=()=>{if(u.status==200||u.status==0&&u.response){a(u.response);return}l()},u.onerror=l,u.send(null)},Dt=s=>document.title=s);var ia=e.print||console.log.bind(console),Oe=e.printErr||console.warn.bind(console);Object.assign(e,o),o=null,e.arguments&&(c=e.arguments),e.thisProgram&&(p=e.thisProgram),e.quit&&(b=e.quit);var Er=0,R=s=>{Er=s},le=()=>Er,Jt;e.wasmBinary&&(Jt=e.wasmBinary);var pe=e.noExitRuntime||!0;typeof WebAssembly!="object"&&Me("no native wasm support detected");var Vt,Ht=!1,pt;function ye(s,a){s||Me(a)}function kr(s){var a=e["_"+s];return a}function $p(s,a,l,u,d){var f={string:function(E){var st=0;if(E!=null&&E!==0){var yt=(E.length<<2)+1;st=da(yt),ra(E,st,yt)}return st},array:function(E){var st=da(E.length);return gl(E,st),st}};function h(E){return a==="string"?Ci(E):a==="boolean"?Boolean(E):E}var y=kr(s),_=[],m=0;if(u)for(var v=0;v<u.length;v++){var I=f[l[v]];I?(m===0&&(m=j()),_[v]=I(u[v])):_[v]=u[v]}var x=y.apply(null,_);function D(E){return m!==0&&S(m),h(E)}return x=D(x),x}var ml=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function bl(s,a,l){a>>>=0;for(var u=a+l,d=a;s[d]&&!(d>=u);)++d;if(d-a>16&&s.buffer&&ml)return ml.decode(s.subarray(a,d));for(var f="";a<d;){var h=s[a++];if(!(h&128)){f+=String.fromCharCode(h);continue}var y=s[a++]&63;if((h&224)==192){f+=String.fromCharCode((h&31)<<6|y);continue}var _=s[a++]&63;if((h&240)==224?h=(h&15)<<12|y<<6|_:h=(h&7)<<18|y<<12|_<<6|s[a++]&63,h<65536)f+=String.fromCharCode(h);else{var m=h-65536;f+=String.fromCharCode(55296|m>>10,56320|m&1023)}}return f}function Ci(s,a){return s>>>=0,s?bl(Xi,s,a):""}function vl(s,a,l,u){if(l>>>=0,!(u>0))return 0;for(var d=l,f=l+u-1,h=0;h<s.length;++h){var y=s.charCodeAt(h);if(y>=55296&&y<=57343){var _=s.charCodeAt(++h);y=65536+((y&1023)<<10)|_&1023}if(y<=127){if(l>=f)break;a[l++>>>0]=y}else if(y<=2047){if(l+1>=f)break;a[l++>>>0]=192|y>>6,a[l++>>>0]=128|y&63}else if(y<=65535){if(l+2>=f)break;a[l++>>>0]=224|y>>12,a[l++>>>0]=128|y>>6&63,a[l++>>>0]=128|y&63}else{if(l+3>=f)break;a[l++>>>0]=240|y>>18,a[l++>>>0]=128|y>>12&63,a[l++>>>0]=128|y>>6&63,a[l++>>>0]=128|y&63}}return a[l>>>0]=0,l-d}function ra(s,a,l){return vl(s,Xi,a,l)}function Yp(s){for(var a=0,l=0;l<s.length;++l){var u=s.charCodeAt(l);u>=55296&&u<=57343&&(u=65536+((u&1023)<<10)|s.charCodeAt(++l)&1023),u<=127?++a:u<=2047?a+=2:u<=65535?a+=3:a+=4}return a}function gl(s,a){Ai.set(s,a>>>0)}function Xp(s,a,l){for(var u=0;u<s.length;++u)Ai[a++>>>0]=s.charCodeAt(u);l||(Ai[a>>>0]=0)}var wl,Ai,Xi,un,jl,M,Gp,Kp,Jp;function Sl(s){wl=s,e.HEAP8=Ai=new Int8Array(s),e.HEAP16=un=new Int16Array(s),e.HEAP32=M=new Int32Array(s),e.HEAPU8=Xi=new Uint8Array(s),e.HEAPU16=jl=new Uint16Array(s),e.HEAPU32=Gp=new Uint32Array(s),e.HEAPF32=Kp=new Float32Array(s),e.HEAPF64=Jp=new Float64Array(s)}var hI=e.INITIAL_MEMORY||16777216,Il,Cl=[],Al=[],qp=[],xl=[],Zp=!1;function Fl(){return pe}function Qp(){if(e.preRun)for(typeof e.preRun=="function"&&(e.preRun=[e.preRun]);e.preRun.length;)ry(e.preRun.shift());rs(Cl)}function ty(){Zp=!0,rs(Al)}function ey(){rs(qp)}function iy(){if(e.postRun)for(typeof e.postRun=="function"&&(e.postRun=[e.postRun]);e.postRun.length;)sy(e.postRun.shift());rs(xl)}function ry(s){Cl.unshift(s)}function ny(s){Al.unshift(s)}function sy(s){xl.unshift(s)}var fr=0,na=null,dn=null;function oy(s){fr++,e.monitorRunDependencies&&e.monitorRunDependencies(fr)}function ay(s){if(fr--,e.monitorRunDependencies&&e.monitorRunDependencies(fr),fr==0&&(na!==null&&(clearInterval(na),na=null),dn)){var a=dn;dn=null,a()}}function Me(s){e.onAbort&&e.onAbort(s),s="Aborted("+s+")",Oe(s),Ht=!0,pt=1,s+=". Build with -sASSERTIONS for more info.";var a=new WebAssembly.RuntimeError(s);throw n(a),a}var ly="data:application/octet-stream;base64,";function Bl(s){return s.startsWith(ly)}var Re;e.locateFile?(Re="./duckdb-mvp.wasm",Bl(Re)||(Re=k(Re))):Re=new URL("./duckdb-mvp.wasm",Mp.url).toString();function Tl(s){try{if(s==Re&&Jt)return new Uint8Array(Jt);if(mt)return mt(s);throw"both async and sync fetching of the wasm failed"}catch(a){Me(a)}}function cy(){return!Jt&&(g||A)&&typeof fetch=="function"?fetch(Re,{credentials:"same-origin"}).then(function(s){if(!s.ok)throw"failed to load wasm binary file at '"+Re+"'";return s.arrayBuffer()}).catch(function(){return Tl(Re)}):Promise.resolve().then(function(){return Tl(Re)})}function uy(){var s={a:z_};function a(h,y){var _=h.exports;e.asm=_,Vt=e.asm.df,Sl(Vt.buffer),Il=e.asm.dg,ny(e.asm.ef),ay("wasm-instantiate")}oy("wasm-instantiate");function l(h){a(h.instance)}function u(h){return cy().then(function(y){return WebAssembly.instantiate(y,s)}).then(function(y){return y}).then(h,function(y){Oe("failed to asynchronously prepare wasm: "+y),Me(y)})}function d(){return!Jt&&typeof WebAssembly.instantiateStreaming=="function"&&!Bl(Re)&&typeof fetch=="function"?fetch(Re,{credentials:"same-origin"}).then(function(h){var y=WebAssembly.instantiateStreaming(h,s);return y.then(l,function(_){return Oe("wasm streaming compile failed: "+_),Oe("falling back to ArrayBuffer instantiation"),u(l)})}):u(l)}if(e.instantiateWasm)try{var f=e.instantiateWasm(s,a);return f}catch(h){return Oe("Module.instantiateWasm callback failed with error: "+h),!1}return d().catch(n),{}}function rs(s){for(;s.length>0;){var a=s.shift();if(typeof a=="function"){a(e);continue}var l=a.func;typeof l=="number"?a.arg===void 0?U(l)():U(l)(a.arg):l(a.arg===void 0?null:a.arg)}}var ns=[];function U(s){var a=ns[s];return a||(s>=ns.length&&(ns.length=s+1),ns[s]=a=Il.get(s)),a}function dy(s){if(s instanceof ys||s=="unwind")return pt;b(1,s)}function fy(s,a,l,u){Me("Assertion failed: "+Ci(s)+", at: "+[a?Ci(a):"unknown filename",l,u?Ci(u):"unknown function"])}function hy(s){return hs(s+24)+24}var ss=[];function py(s){s.add_ref()}var os=0;function yy(s){var a=new xi(s);return a.get_caught()||(a.set_caught(!0),os--),a.set_rethrown(!1),ss.push(a),py(a),a.get_exception_ptr()}var $e=0;function xi(s){this.excPtr=s,this.ptr=s-24,this.set_type=function(a){M[this.ptr+4>>>2]=a},this.get_type=function(){return M[this.ptr+4>>>2]},this.set_destructor=function(a){M[this.ptr+8>>>2]=a},this.get_destructor=function(){return M[this.ptr+8>>>2]},this.set_refcount=function(a){M[this.ptr>>>2]=a},this.set_caught=function(a){a=a?1:0,Ai[this.ptr+12>>>0]=a},this.get_caught=function(){return Ai[this.ptr+12>>>0]!=0},this.set_rethrown=function(a){a=a?1:0,Ai[this.ptr+13>>>0]=a},this.get_rethrown=function(){return Ai[this.ptr+13>>>0]!=0},this.init=function(a,l){this.set_adjusted_ptr(0),this.set_type(a),this.set_destructor(l),this.set_refcount(0),this.set_caught(!1),this.set_rethrown(!1)},this.add_ref=function(){var a=M[this.ptr>>>2];M[this.ptr>>>2]=a+1},this.release_ref=function(){var a=M[this.ptr>>>2];return M[this.ptr>>>2]=a-1,a===1},this.set_adjusted_ptr=function(a){M[this.ptr+16>>>2]=a},this.get_adjusted_ptr=function(){return M[this.ptr+16>>>2]},this.get_exception_ptr=function(){var a=Hl(this.get_type());if(a)return M[this.excPtr>>>2];var l=this.get_adjusted_ptr();return l!==0?l:this.excPtr}}function Dl(s){return Vl(new xi(s).ptr)}function _y(s){if(s.release_ref()&&!s.get_rethrown()){var a=s.get_destructor();a&&U(a)(s.excPtr),Dl(s.excPtr)}}function my(){w(0);var s=ss.pop();_y(s),$e=0}function by(s){throw $e||($e=s),s}function vy(){var s=$e;if(!s)return R(0),0;var a=new xi(s);a.set_adjusted_ptr(s);var l=a.get_type();if(!l)return R(0),s|0;for(var u=Array.prototype.slice.call(arguments),d=0;d<u.length;d++){var f=u[d];if(f===0||f===l)break;var h=a.ptr+16;if(hr(f,l,h))return R(f),s|0}return R(l),s|0}function gy(){var s=$e;if(!s)return R(0),0;var a=new xi(s);a.set_adjusted_ptr(s);var l=a.get_type();if(!l)return R(0),s|0;for(var u=Array.prototype.slice.call(arguments),d=0;d<u.length;d++){var f=u[d];if(f===0||f===l)break;var h=a.ptr+16;if(hr(f,l,h))return R(f),s|0}return R(l),s|0}function wy(){var s=$e;if(!s)return R(0),0;var a=new xi(s);a.set_adjusted_ptr(s);var l=a.get_type();if(!l)return R(0),s|0;for(var u=Array.prototype.slice.call(arguments),d=0;d<u.length;d++){var f=u[d];if(f===0||f===l)break;var h=a.ptr+16;if(hr(f,l,h))return R(f),s|0}return R(l),s|0}function jy(){var s=$e;if(!s)return R(0),0;var a=new xi(s);a.set_adjusted_ptr(s);var l=a.get_type();if(!l)return R(0),s|0;for(var u=Array.prototype.slice.call(arguments),d=0;d<u.length;d++){var f=u[d];if(f===0||f===l)break;var h=a.ptr+16;if(hr(f,l,h))return R(f),s|0}return R(l),s|0}function Sy(){var s=$e;if(!s)return R(0),0;var a=new xi(s);a.set_adjusted_ptr(s);var l=a.get_type();if(!l)return R(0),s|0;for(var u=Array.prototype.slice.call(arguments),d=0;d<u.length;d++){var f=u[d];if(f===0||f===l)break;var h=a.ptr+16;if(hr(f,l,h))return R(f),s|0}return R(l),s|0}function Iy(){var s=$e;if(!s)return R(0),0;var a=new xi(s);a.set_adjusted_ptr(s);var l=a.get_type();if(!l)return R(0),s|0;for(var u=Array.prototype.slice.call(arguments),d=0;d<u.length;d++){var f=u[d];if(f===0||f===l)break;var h=a.ptr+16;if(hr(f,l,h))return R(f),s|0}return R(l),s|0}function Cy(){var s=ss.pop();s||Me("no exception to throw");var a=s.excPtr;throw s.get_rethrown()||(ss.push(s),s.set_rethrown(!0),s.set_caught(!1),os++),$e=a,a}function Ay(s,a,l){var u=new xi(s);throw u.init(a,l),$e=s,os++,s}function xy(){return os}var qt={buffers:[null,[],[]],printChar:function(s,a){var l=qt.buffers[s];a===0||a===10?((s===1?ia:Oe)(bl(l,0)),l.length=0):l.push(a)},varargs:void 0,get:function(){qt.varargs+=4;var s=M[qt.varargs-4>>>2];return s},getStr:function(s){var a=Ci(s);return a}};function Fy(s,a,l,u,d){}function By(){Oe("missing function: $SOCKFS"),Me(-1)}function El(){Oe("missing function: $FS"),Me(-1)}function fn(s){var a=By.getSocket(s);if(!a)throw new El.ErrnoError(8);return a}function sa(s){return(s&255)+"."+(s>>8&255)+"."+(s>>16&255)+"."+(s>>24&255)}function kl(s){var a="",l=0,u=0,d=0,f=0,h=0,y=0,_=[s[0]&65535,s[0]>>16,s[1]&65535,s[1]>>16,s[2]&65535,s[2]>>16,s[3]&65535,s[3]>>16],m=!0,v="";for(y=0;y<5;y++)if(_[y]!==0){m=!1;break}if(m){if(v=sa(_[6]|_[7]<<16),_[5]===-1)return a="::ffff:",a+=v,a;if(_[5]===0)return a="::",v==="0.0.0.0"&&(v=""),v==="0.0.0.1"&&(v="1"),a+=v,a}for(l=0;l<8;l++)_[l]===0&&(l-d>1&&(h=0),d=l,h++),h>u&&(u=h,f=l-u+1);for(l=0;l<8;l++){if(u>1&&_[l]===0&&l>=f&&l<f+u){l===f&&(a+=":",f===0&&(a+=":"));continue}a+=Number(ua(_[l]&65535)).toString(16),a+=l<7?":":""}return a}function Ol(s,a){var l=un[s>>>1],u=ua(jl[s+2>>>1]),d;switch(l){case 2:if(a!==16)return{errno:28};d=M[s+4>>>2],d=sa(d);break;case 10:if(a!==28)return{errno:28};d=[M[s+8>>>2],M[s+12>>>2],M[s+16>>>2],M[s+20>>>2]],d=kl(d);break;default:return{errno:5}}return{family:l,addr:d,port:u}}function as(s){for(var a=s.split("."),l=0;l<4;l++){var u=Number(a[l]);if(isNaN(u))return null;a[l]=u}return(a[0]|a[1]<<8|a[2]<<16|a[3]<<24)>>>0}function ls(s){return parseInt(s)}function oa(s){var a,l,u,d,f=/^((?=.*::)(?!.*::.+::)(::)?([\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,h=[];if(!f.test(s))return null;if(s==="::")return[0,0,0,0,0,0,0,0];for(s.startsWith("::")?s=s.replace("::","Z:"):s=s.replace("::",":Z:"),s.indexOf(".")>0?(s=s.replace(new RegExp("[.]","g"),":"),a=s.split(":"),a[a.length-4]=ls(a[a.length-4])+ls(a[a.length-3])*256,a[a.length-3]=ls(a[a.length-2])+ls(a[a.length-1])*256,a=a.slice(0,a.length-2)):a=s.split(":"),u=0,d=0,l=0;l<a.length;l++)if(typeof a[l]=="string")if(a[l]==="Z"){for(d=0;d<8-a.length+1;d++)h[l+d]=0;u=d-1}else h[l+u]=fs(parseInt(a[l],16));else h[l+u]=a[l];return[h[1]<<16|h[0],h[3]<<16|h[2],h[5]<<16|h[4],h[7]<<16|h[6]]}var Ue={address_map:{id:1,addrs:{},names:{}},lookup_name:function(s){var a=as(s);if(a!==null||(a=oa(s),a!==null))return s;var l;if(Ue.address_map.addrs[s])l=Ue.address_map.addrs[s];else{var u=Ue.address_map.id++;ye(u<65535,"exceeded max address mappings of 65535"),l="172.29."+(u&255)+"."+(u&65280),Ue.address_map.names[l]=s,Ue.address_map.addrs[s]=l}return l},lookup_addr:function(s){return Ue.address_map.names[s]?Ue.address_map.names[s]:null}};function Ml(s,a,l){if(l&&s===0)return null;var u=Ol(s,a);if(u.errno)throw new El.ErrnoError(u.errno);return u.addr=Ue.lookup_addr(u.addr)||u.addr,u}function Ty(s,a,l){var u=fn(s),d=Ml(a,l);return u.sock_ops.bind(u,d.addr,d.port),0}function Dy(s,a,l){var u=fn(s),d=Ml(a,l);return u.sock_ops.connect(u,d.addr,d.port),0}function Ey(s,a,l,u){return a=qt.getStr(a),a=qt.calculateAt(s,a),qt.doAccess(a,l)}function ky(s,a,l){return qt.varargs=l,0}function Oy(s,a){}function My(s,a,l){}function Ry(s,a,l){}function Rl(s,a){Xi.fill(0,s,s+a)}function aa(s,a,l,u,d){switch(a){case 2:l=as(l),Rl(s,16),d&&(M[d>>>2]=16),un[s>>>1]=a,M[s+4>>>2]=l,un[s+2>>>1]=fs(u);break;case 10:l=oa(l),Rl(s,28),d&&(M[d>>>2]=28),M[s>>>2]=a,M[s+8>>>2]=l[0],M[s+12>>>2]=l[1],M[s+16>>>2]=l[2],M[s+20>>>2]=l[3],un[s+2>>>1]=fs(u);break;default:return 5}return 0}function Uy(s,a,l){var u=fn(s);if(!u.daddr)return-53;var d=aa(a,u.family,Ue.lookup_name(u.daddr),u.dport,l);return 0}function Ny(s,a,l,u,d){var f=fn(s);return a===1&&l===4?(M[u>>>2]=f.error,M[d>>>2]=4,f.error=null,0):-50}function Ly(s,a,l){return qt.varargs=l,0}function Py(s,a){}function Vy(s,a,l){}function Hy(s,a,l,u){}function zy(s,a,l,u){qt.varargs=u}function Wy(s,a,l,u,d,f){var h=fn(s),y=h.sock_ops.recvmsg(h,l);if(!y)return 0;if(d)var _=aa(d,h.family,Ue.lookup_name(y.addr),y.port,f);return Xi.set(y.buffer,a>>>0),y.buffer.byteLength}function $y(s,a,l,u){}function Yy(s){}function Xy(s,a,l,u,d,f){}function Gy(s,a,l){}function Ky(s,a){}function Jy(s,a,l){}function qy(s){}var Ul="To use dlopen, you need enable dynamic linking, see https://github.com/emscripten-core/emscripten/wiki/Linking";function Zy(s,a){Me(Ul)}function Qy(s,a){Me(Ul)}function t_(){return Date.now()}var e_=!0;function i_(){return e_}function r_(){Me("")}function n_(s,a){return globalThis.DUCKDB_RUNTIME.createDirectory(e,s,a)}function s_(s,a){return globalThis.DUCKDB_RUNTIME.checkDirectory(e,s,a)}function o_(s,a){return globalThis.DUCKDB_RUNTIME.listDirectoryEntries(e,s,a)}function a_(s,a){return globalThis.DUCKDB_RUNTIME.removeDirectory(e,s,a)}function l_(s){return globalThis.DUCKDB_RUNTIME.closeFile(e,s)}function c_(s,a){return globalThis.DUCKDB_RUNTIME.checkFile(e,s,a)}function u_(s){return globalThis.DUCKDB_RUNTIME.getLastFileModificationTime(e,s)}function d_(s,a,l,u){return globalThis.DUCKDB_RUNTIME.moveFile(e,s,a,l,u)}function f_(s,a){return globalThis.DUCKDB_RUNTIME.openFile(e,s,a)}function h_(s,a,l,u){return globalThis.DUCKDB_RUNTIME.readFile(e,s,a,l,u)}function p_(s,a){return globalThis.DUCKDB_RUNTIME.truncateFile(e,s,a)}function y_(s,a,l,u){return globalThis.DUCKDB_RUNTIME.writeFile(e,s,a,l,u)}function __(s,a){return globalThis.DUCKDB_RUNTIME.glob(e,s,a)}function m_(s){return globalThis.DUCKDB_RUNTIME.testPlatformFeature(e,s)}function b_(s,a,l,u,d,f){return globalThis.DUCKDB_RUNTIME.callScalarUDF(e,s,a,l,u,d,f)}function Nl(){return 4294901760}var la;T?la=()=>{var s=process.hrtime();return s[0]*1e3+s[1]/1e6}:la=()=>performance.now();function v_(s,a,l){Xi.copyWithin(s>>>0,a>>>0,a+l>>>0)}function g_(s){try{return Vt.grow(s-wl.byteLength+65535>>>16),Sl(Vt.buffer),1}catch(a){}}function w_(s){var a=Xi.length;s=s>>>0;var l=Nl();if(s>l)return!1;let u=(_,m)=>_+(m-_%m)%m;for(var d=1;d<=4;d*=2){var f=a*(1+.2/d);f=Math.min(f,s+100663296);var h=Math.min(l,u(Math.max(s,f),65536)),y=g_(h);if(y)return!0}return!1}var ca={};function j_(){return p||"./this.program"}function hn(){if(!hn.strings){var s=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",a={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:s,_:j_()};for(var l in ca)ca[l]===void 0?delete a[l]:a[l]=ca[l];var u=[];for(var l in a)u.push(l+"="+a[l]);hn.strings=u}return hn.strings}function S_(s,a){var l=0;return hn().forEach(function(u,d){var f=a+l;M[s+d*4>>>2]=f,Xp(u,f),l+=u.length+1}),0}function I_(s,a){var l=hn();M[s>>>2]=l.length;var u=0;return l.forEach(function(d){u+=d.length+1}),M[a>>>2]=u,0}function C_(s){return 0}function A_(s,a,l,u,d,f){var h=qt.getStreamFromFD(s),y=qt.doReadv(h,a,l,u);return M[f>>>2]=y,0}function x_(s,a,l,u,d,f){var h=qt.getStreamFromFD(s),y=qt.doWritev(h,a,l,u);return M[f>>>2]=y,0}function F_(s,a,l,u){var d=qt.getStreamFromFD(s),f=qt.doReadv(d,a,l);return M[u>>>2]=f,0}function B_(s,a,l,u,d){}function T_(s){var a=qt.getStreamFromFD(s);return a.stream_ops&&a.stream_ops.fsync?-a.stream_ops.fsync(a):0}function D_(s,a,l,u){for(var d=0,f=0;f<l;f++){var h=M[a>>>2],y=M[a+4>>>2];a+=8;for(var _=0;_<y;_++)qt.printChar(s,Xi[h+_>>>0]);d+=y}return M[u>>>2]=d,0}function E_(){return le()}function k_(s,a,l,u){var d=0,f=0,h=0,y=0,_=0,m=0,v;function I(x,D,E,st,yt,kt){var B,L,xt,Zt;return L=x===10?28:16,yt=x===10?kl(yt):sa(yt),B=hs(L),Zt=aa(B,x,yt,kt),ye(!Zt),xt=hs(32),M[xt+4>>>2]=x,M[xt+8>>>2]=D,M[xt+12>>>2]=E,M[xt+24>>>2]=st,M[xt+20>>>2]=B,x===10?M[xt+16>>>2]=28:M[xt+16>>>2]=16,M[xt+28>>>2]=0,xt}if(l&&(h=M[l>>>2],y=M[l+4>>>2],_=M[l+8>>>2],m=M[l+12>>>2]),_&&!m&&(m=_===2?17:6),!_&&m&&(_=m===17?2:1),m===0&&(m=6),_===0&&(_=1),!s&&!a)return-2;if(h&-1088||l!==0&&M[l>>>2]&2&&!s)return-1;if(h&32)return-2;if(_!==0&&_!==1&&_!==2)return-7;if(y!==0&&y!==2&&y!==10)return-6;if(a&&(a=Ci(a),f=parseInt(a,10),isNaN(f)))return h&1024?-2:-8;if(!s)return y===0&&(y=2),(h&1)===0&&(y===2?d=ds(2130706433):d=[0,0,0,1]),v=I(y,_,m,null,d,f),M[u>>>2]=v,0;if(s=Ci(s),d=as(s),d!==null)if(y===0||y===2)y=2;else if(y===10&&h&8)d=[0,0,ds(65535),d],y=10;else return-2;else if(d=oa(s),d!==null)if(y===0||y===10)y=10;else return-2;return d!=null?(v=I(y,_,m,s,d,f),M[u>>>2]=v,0):h&4?-2:(s=Ue.lookup_name(s),d=as(s),y===0?y=2:y===10&&(d=[0,0,ds(65535),d]),v=I(y,_,m,null,d,f),M[u>>>2]=v,0)}function O_(){if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function"){var s=new Uint8Array(1);return function(){return crypto.getRandomValues(s),s[0]}}else if(T)try{var a=gw("crypto");return function(){return a.randomBytes(1)[0]}}catch(l){}return function(){Me("randomDevice")}}function cs(s,a){cs.randomDevice||(cs.randomDevice=O_());for(var l=0;l<a;l++)Ai[s+l>>>0]=cs.randomDevice();return 0}function M_(s,a,l,u,d,f,h){var y=Ol(s,a);if(y.errno)return-6;var _=y.port,m=y.addr,v=!1;if(l&&u){var I;if(h&1||!(I=Ue.lookup_addr(m))){if(h&8)return-2}else m=I;var x=ra(m,l,u);x+1>=u&&(v=!0)}if(d&&f){_=""+_;var x=ra(_,d,f);x+1>=f&&(v=!0)}return v?-12:0}function R_(s){return s}function U_(s){R(s)}function us(s){return s%4===0&&(s%100!==0||s%400===0)}function N_(s,a){for(var l=0,u=0;u<=a;l+=s[u++]);return l}var Ll=[31,29,31,30,31,30,31,31,30,31,30,31],Pl=[31,28,31,30,31,30,31,31,30,31,30,31];function L_(s,a){for(var l=new Date(s.getTime());a>0;){var u=us(l.getFullYear()),d=l.getMonth(),f=(u?Ll:Pl)[d];if(a>f-l.getDate())a-=f-l.getDate()+1,l.setDate(1),d<11?l.setMonth(d+1):(l.setMonth(0),l.setFullYear(l.getFullYear()+1));else return l.setDate(l.getDate()+a),l}return l}function P_(s,a,l,u){var d=M[u+40>>>2],f={tm_sec:M[u>>>2],tm_min:M[u+4>>>2],tm_hour:M[u+8>>>2],tm_mday:M[u+12>>>2],tm_mon:M[u+16>>>2],tm_year:M[u+20>>>2],tm_wday:M[u+24>>>2],tm_yday:M[u+28>>>2],tm_isdst:M[u+32>>>2],tm_gmtoff:M[u+36>>>2],tm_zone:d?Ci(d):""},h=Ci(l),y={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var _ in y)h=h.replace(new RegExp(_,"g"),y[_]);var m=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],v=["January","February","March","April","May","June","July","August","September","October","November","December"];function I(B,L,xt){for(var Zt=typeof B=="number"?B.toString():B||"";Zt.length<L;)Zt=xt[0]+Zt;return Zt}function x(B,L){return I(B,L,"0")}function D(B,L){function xt(_s){return _s<0?-1:_s>0?1:0}var Zt;return(Zt=xt(B.getFullYear()-L.getFullYear()))===0&&(Zt=xt(B.getMonth()-L.getMonth()))===0&&(Zt=xt(B.getDate()-L.getDate())),Zt}function E(B){switch(B.getDay()){case 0:return new Date(B.getFullYear()-1,11,29);case 1:return B;case 2:return new Date(B.getFullYear(),0,3);case 3:return new Date(B.getFullYear(),0,2);case 4:return new Date(B.getFullYear(),0,1);case 5:return new Date(B.getFullYear()-1,11,31);case 6:return new Date(B.getFullYear()-1,11,30)}}function st(B){var L=L_(new Date(B.tm_year+1900,0,1),B.tm_yday),xt=new Date(L.getFullYear(),0,4),Zt=new Date(L.getFullYear()+1,0,4),_s=E(xt),pw=E(Zt);return D(_s,L)<=0?D(pw,L)<=0?L.getFullYear()+1:L.getFullYear():L.getFullYear()-1}var yt={"%a":function(B){return m[B.tm_wday].substring(0,3)},"%A":function(B){return m[B.tm_wday]},"%b":function(B){return v[B.tm_mon].substring(0,3)},"%B":function(B){return v[B.tm_mon]},"%C":function(B){var L=B.tm_year+1900;return x(L/100|0,2)},"%d":function(B){return x(B.tm_mday,2)},"%e":function(B){return I(B.tm_mday,2," ")},"%g":function(B){return st(B).toString().substring(2)},"%G":function(B){return st(B)},"%H":function(B){return x(B.tm_hour,2)},"%I":function(B){var L=B.tm_hour;return L==0?L=12:L>12&&(L-=12),x(L,2)},"%j":function(B){return x(B.tm_mday+N_(us(B.tm_year+1900)?Ll:Pl,B.tm_mon-1),3)},"%m":function(B){return x(B.tm_mon+1,2)},"%M":function(B){return x(B.tm_min,2)},"%n":function(){return`
11
- `},"%p":function(B){return B.tm_hour>=0&&B.tm_hour<12?"AM":"PM"},"%S":function(B){return x(B.tm_sec,2)},"%t":function(){return" "},"%u":function(B){return B.tm_wday||7},"%U":function(B){var L=B.tm_yday+7-B.tm_wday;return x(Math.floor(L/7),2)},"%V":function(B){var L=Math.floor((B.tm_yday+7-(B.tm_wday+6)%7)/7);if((B.tm_wday+371-B.tm_yday-2)%7<=2&&L++,L){if(L==53){var Zt=(B.tm_wday+371-B.tm_yday)%7;Zt!=4&&(Zt!=3||!us(B.tm_year))&&(L=1)}}else{L=52;var xt=(B.tm_wday+7-B.tm_yday-1)%7;(xt==4||xt==5&&us(B.tm_year%400-1))&&L++}return x(L,2)},"%w":function(B){return B.tm_wday},"%W":function(B){var L=B.tm_yday+7-(B.tm_wday+6)%7;return x(Math.floor(L/7),2)},"%y":function(B){return(B.tm_year+1900).toString().substring(2)},"%Y":function(B){return B.tm_year+1900},"%z":function(B){var L=B.tm_gmtoff,xt=L>=0;return L=Math.abs(L)/60,L=L/60*100+L%60,(xt?"+":"-")+String("0000"+L).slice(-4)},"%Z":function(B){return B.tm_zone},"%%":function(){return"%"}};h=h.replace(/%%/g,"\0\0");for(var _ in yt)h.includes(_)&&(h=h.replace(new RegExp(_,"g"),yt[_](f)));h=h.replace(/\0\0/g,"%");var kt=H_(h,!1);return kt.length>a?0:(gl(kt,s),kt.length-1)}function V_(s,a,l,u){return P_(s,a,l,u)}function H_(s,a,l){var u=l>0?l:Yp(s)+1,d=new Array(u),f=vl(s,d,0,d.length);return a&&(d.length=f),d}var z_={p:fy,j:hy,C:yy,H:my,b:vy,n:gy,G:wy,U:jy,Z:Sy,ya:Iy,i:Dl,ja:Cy,w:Ay,J:xy,e:by,Fa:Fy,Ha:Ty,Ga:Dy,cf:Ey,V:ky,Ua:Oy,Fe:My,Qa:Ry,Ba:Uy,Ea:Ny,Wa:Ly,Ra:Py,Va:Vy,Sa:Hy,pa:zy,Ca:Wy,af:$y,na:Yy,Da:Xy,ma:Gy,Ta:Ky,oa:Jy,Ja:qy,La:Zy,Ka:Qy,Ya:t_,Xa:i_,ea:r_,Ve:n_,We:s_,Te:o_,Ue:a_,wa:l_,Re:c_,Ye:u_,Se:d_,Ze:f_,la:h_,Xe:p_,xa:y_,Qe:__,va:m_,_e:b_,Za:Nl,Ce:la,Cb:v_,vd:w_,$a:S_,ab:I_,aa:C_,Ee:A_,Ab:x_,ra:F_,Ne:B_,bf:T_,ka:D_,a:E_,Ia:k_,Pa:cs,Aa:M_,ta:Bb,O:ab,$:Vm,T:jb,Yb:_0,ua:Fb,ba:rb,sa:Pm,Zb:y0,x:Xm,ha:ob,t:cb,ca:vb,ia:sb,u:lb,d:km,ga:Ib,R:fb,c:Om,X:mb,Qb:I0,Nb:x0,h:Rm,Ma:Sb,Lb:B0,m:Lm,qa:tb,o:Um,Na:bb,y:Km,z:Wm,Q:hb,Y:nb,fa:$m,A:Jm,B:Ym,I:wb,r:db,$b:h0,gc:o0,Fc:Mg,ne:tv,ac:f0,Mb:F0,Xb:m0,hc:s0,oe:Qb,_d:yv,gb:nw,Je:Mb,$d:pv,Wd:vv,cc:u0,Ie:Rb,Vb:v0,Ed:Uv,cb:lw,bb:cw,me:ev,ae:hv,Db:U0,bd:dg,pe:Zb,Jc:Dg,Wb:b0,Kb:T0,te:Gb,je:nv,be:fv,Xd:bv,Td:jv,ge:av,sb:Y0,le:iv,ze:Hb,ee:cv,Dd:Nv,Ob:A0,Pb:C0,Eb:R0,he:ov,fb:sw,Gd:Mv,He:Ub,ke:rv,Ud:wv,se:Kb,qd:Jv,ob:J0,ic:n0,ce:dv,ie:sv,Cd:Lv,pd:qv,od:Zv,id:ng,Xc:mg,xc:zg,jd:rg,uc:Yg,fd:ag,yc:Hg,Be:Pb,Mc:Fg,Lc:Bg,Me:Eb,Le:kb,cd:ug,Pe:Tb,Nd:Fv,Hc:kg,bc:d0,Kc:Tg,Ib:E0,Zc:yg,dc:c0,Jb:D0,Pd:Av,Jd:Ev,Sc:jg,Hb:k0,zc:Vg,fc:a0,_b:p0,Ld:Tv,zd:Hv,Tc:wg,Gc:Og,Qd:Cv,wd:$v,db:aw,Bc:Lg,Ac:Pg,td:Xv,ue:Xb,jc:r0,Cc:Ng,qc:Jg,kc:i0,lc:e0,pc:qg,v:Dm,k:Mm,D:ub,wb:H0,L:pb,xb:V0,f:Em,S:Hm,_:gb,g:zm,l:Nm,$e:xb,s:ib,q:Qm,za:Cb,F:Gm,M:eb,W:_b,N:qm,P:Ab,Oa:yb,da:Zm,nd:Qv,vb:z0,Fd:Rv,sc:Gg,vc:$g,zb:L0,Rb:S0,qb:G0,xe:Wb,Ic:Eg,dd:cg,mb:Z0,gd:og,hd:sg,rc:Kg,_c:pg,Uc:gg,rd:Kv,Tb:w0,Sb:j0,we:$b,ed:lg,md:tg,ad:fg,Qc:Ig,Fb:M0,eb:ow,Gb:O0,ec:l0,pb:K0,qe:qb,Sd:Sv,Ub:g0,Oc:Ag,Wc:bg,kd:ig,Yc:_g,nb:q0,De:Lb,Ge:Nb,Ke:Ob,Vd:gv,lb:Q0,yd:zv,mc:t0,Rc:Sg,xd:Wv,sd:Gv,Kd:Dv,rb:X0,de:uv,kb:tw,Pc:Cg,tb:$0,Oe:Db,ye:zb,Ad:Vv,nc:Qg,fe:lv,ve:Yb,re:Jb,Bd:Pv,Zd:_v,Yd:mv,ud:Yv,yb:P0,Hd:Ov,Ec:Rg,Nc:xg,ld:eg,jb:ew,Vc:vg,ub:W0,Id:kv,$c:hg,hb:rw,ib:iw,Dc:Ug,Ae:Vb,Od:xv,Bb:N0,tc:Xg,wc:Wg,oc:Zg,Rd:Iv,Md:Bv,E:R_,K:U_,_a:V_},pI=uy(),W_=e.___wasm_call_ctors=function(){return(W_=e.___wasm_call_ctors=e.asm.ef).apply(null,arguments)},$_=e._main=function(){return($_=e._main=e.asm.ff).apply(null,arguments)},Y_=e._duckdb_web_fs_glob_add_path=function(){return(Y_=e._duckdb_web_fs_glob_add_path=e.asm.gf).apply(null,arguments)},X_=e._duckdb_web_clear_response=function(){return(X_=e._duckdb_web_clear_response=e.asm.hf).apply(null,arguments)},G_=e._duckdb_web_fail_with=function(){return(G_=e._duckdb_web_fail_with=e.asm.jf).apply(null,arguments)},K_=e._duckdb_web_reset=function(){return(K_=e._duckdb_web_reset=e.asm.kf).apply(null,arguments)},J_=e._duckdb_web_connect=function(){return(J_=e._duckdb_web_connect=e.asm.lf).apply(null,arguments)},q_=e._duckdb_web_disconnect=function(){return(q_=e._duckdb_web_disconnect=e.asm.mf).apply(null,arguments)},Z_=e._duckdb_web_flush_files=function(){return(Z_=e._duckdb_web_flush_files=e.asm.nf).apply(null,arguments)},Q_=e._duckdb_web_flush_file=function(){return(Q_=e._duckdb_web_flush_file=e.asm.of).apply(null,arguments)},tm=e._duckdb_web_open=function(){return(tm=e._duckdb_web_open=e.asm.pf).apply(null,arguments)},em=e._duckdb_web_get_global_file_info=function(){return(em=e._duckdb_web_get_global_file_info=e.asm.qf).apply(null,arguments)},im=e._duckdb_web_collect_file_stats=function(){return(im=e._duckdb_web_collect_file_stats=e.asm.rf).apply(null,arguments)},rm=e._duckdb_web_export_file_stats=function(){return(rm=e._duckdb_web_export_file_stats=e.asm.sf).apply(null,arguments)},nm=e._duckdb_web_fs_drop_file=function(){return(nm=e._duckdb_web_fs_drop_file=e.asm.tf).apply(null,arguments)},sm=e._duckdb_web_fs_drop_files=function(){return(sm=e._duckdb_web_fs_drop_files=e.asm.uf).apply(null,arguments)},om=e._duckdb_web_fs_glob_file_infos=function(){return(om=e._duckdb_web_fs_glob_file_infos=e.asm.vf).apply(null,arguments)},am=e._duckdb_web_fs_get_file_info_by_id=function(){return(am=e._duckdb_web_fs_get_file_info_by_id=e.asm.wf).apply(null,arguments)},lm=e._duckdb_web_fs_get_file_info_by_name=function(){return(lm=e._duckdb_web_fs_get_file_info_by_name=e.asm.xf).apply(null,arguments)},cm=e._duckdb_web_fs_set_file_descriptor=function(){return(cm=e._duckdb_web_fs_set_file_descriptor=e.asm.yf).apply(null,arguments)},um=e._duckdb_web_fs_register_file_url=function(){return(um=e._duckdb_web_fs_register_file_url=e.asm.zf).apply(null,arguments)},dm=e._duckdb_web_fs_register_file_buffer=function(){return(dm=e._duckdb_web_fs_register_file_buffer=e.asm.Af).apply(null,arguments)},fm=e._duckdb_web_copy_file_to_buffer=function(){return(fm=e._duckdb_web_copy_file_to_buffer=e.asm.Bf).apply(null,arguments)},hm=e._duckdb_web_copy_file_to_path=function(){return(hm=e._duckdb_web_copy_file_to_path=e.asm.Cf).apply(null,arguments)},pm=e._duckdb_web_get_version=function(){return(pm=e._duckdb_web_get_version=e.asm.Df).apply(null,arguments)},ym=e._duckdb_web_get_feature_flags=function(){return(ym=e._duckdb_web_get_feature_flags=e.asm.Ef).apply(null,arguments)},_m=e._duckdb_web_tokenize=function(){return(_m=e._duckdb_web_tokenize=e.asm.Ff).apply(null,arguments)},mm=e._duckdb_web_udf_scalar_create=function(){return(mm=e._duckdb_web_udf_scalar_create=e.asm.Gf).apply(null,arguments)},bm=e._duckdb_web_prepared_create=function(){return(bm=e._duckdb_web_prepared_create=e.asm.Hf).apply(null,arguments)},vm=e._duckdb_web_prepared_close=function(){return(vm=e._duckdb_web_prepared_close=e.asm.If).apply(null,arguments)},gm=e._duckdb_web_prepared_run=function(){return(gm=e._duckdb_web_prepared_run=e.asm.Jf).apply(null,arguments)},wm=e._duckdb_web_prepared_send=function(){return(wm=e._duckdb_web_prepared_send=e.asm.Kf).apply(null,arguments)},jm=e._duckdb_web_query_run=function(){return(jm=e._duckdb_web_query_run=e.asm.Lf).apply(null,arguments)},Sm=e._duckdb_web_pending_query_start=function(){return(Sm=e._duckdb_web_pending_query_start=e.asm.Mf).apply(null,arguments)},Im=e._duckdb_web_pending_query_poll=function(){return(Im=e._duckdb_web_pending_query_poll=e.asm.Nf).apply(null,arguments)},Cm=e._duckdb_web_pending_query_cancel=function(){return(Cm=e._duckdb_web_pending_query_cancel=e.asm.Of).apply(null,arguments)},Am=e._duckdb_web_query_fetch_results=function(){return(Am=e._duckdb_web_query_fetch_results=e.asm.Pf).apply(null,arguments)},xm=e._duckdb_web_get_tablenames=function(){return(xm=e._duckdb_web_get_tablenames=e.asm.Qf).apply(null,arguments)},Fm=e._duckdb_web_insert_arrow_from_ipc_stream=function(){return(Fm=e._duckdb_web_insert_arrow_from_ipc_stream=e.asm.Rf).apply(null,arguments)},Bm=e._duckdb_web_insert_csv_from_path=function(){return(Bm=e._duckdb_web_insert_csv_from_path=e.asm.Sf).apply(null,arguments)},Tm=e._duckdb_web_insert_json_from_path=function(){return(Tm=e._duckdb_web_insert_json_from_path=e.asm.Tf).apply(null,arguments)},ds=e._htonl=function(){return(ds=e._htonl=e.asm.Uf).apply(null,arguments)},fs=e._htons=function(){return(fs=e._htons=e.asm.Vf).apply(null,arguments)},ua=e._ntohs=function(){return(ua=e._ntohs=e.asm.Wf).apply(null,arguments)},hs=e._malloc=function(){return(hs=e._malloc=e.asm.Xf).apply(null,arguments)},Vl=e._free=function(){return(Vl=e._free=e.asm.Yf).apply(null,arguments)},w=e._setThrew=function(){return(w=e._setThrew=e.asm.Zf).apply(null,arguments)},j=e.stackSave=function(){return(j=e.stackSave=e.asm._f).apply(null,arguments)},S=e.stackRestore=function(){return(S=e.stackRestore=e.asm.$f).apply(null,arguments)},da=e.stackAlloc=function(){return(da=e.stackAlloc=e.asm.ag).apply(null,arguments)},hr=e.___cxa_can_catch=function(){return(hr=e.___cxa_can_catch=e.asm.bg).apply(null,arguments)},Hl=e.___cxa_is_pointer_type=function(){return(Hl=e.___cxa_is_pointer_type=e.asm.cg).apply(null,arguments)},zl=e.dynCall_jiiii=function(){return(zl=e.dynCall_jiiii=e.asm.eg).apply(null,arguments)},Wl=e.dynCall_iiiiij=function(){return(Wl=e.dynCall_iiiiij=e.asm.fg).apply(null,arguments)},$l=e.dynCall_iiiiijj=function(){return($l=e.dynCall_iiiiijj=e.asm.gg).apply(null,arguments)},Yl=e.dynCall_iiiiiijj=function(){return(Yl=e.dynCall_iiiiiijj=e.asm.hg).apply(null,arguments)},Xl=e.dynCall_viijii=function(){return(Xl=e.dynCall_viijii=e.asm.ig).apply(null,arguments)},Gl=e.dynCall_j=function(){return(Gl=e.dynCall_j=e.asm.jg).apply(null,arguments)},Kl=e.dynCall_ji=function(){return(Kl=e.dynCall_ji=e.asm.kg).apply(null,arguments)},Jl=e.dynCall_iij=function(){return(Jl=e.dynCall_iij=e.asm.lg).apply(null,arguments)},ql=e.dynCall_viij=function(){return(ql=e.dynCall_viij=e.asm.mg).apply(null,arguments)},Zl=e.dynCall_viijji=function(){return(Zl=e.dynCall_viijji=e.asm.ng).apply(null,arguments)},Ql=e.dynCall_viijj=function(){return(Ql=e.dynCall_viijj=e.asm.og).apply(null,arguments)},tc=e.dynCall_viiijj=function(){return(tc=e.dynCall_viiijj=e.asm.pg).apply(null,arguments)},ec=e.dynCall_viiji=function(){return(ec=e.dynCall_viiji=e.asm.qg).apply(null,arguments)},ic=e.dynCall_vijjj=function(){return(ic=e.dynCall_vijjj=e.asm.rg).apply(null,arguments)},rc=e.dynCall_iiijj=function(){return(rc=e.dynCall_iiijj=e.asm.sg).apply(null,arguments)},nc=e.dynCall_viiij=function(){return(nc=e.dynCall_viiij=e.asm.tg).apply(null,arguments)},sc=e.dynCall_viijij=function(){return(sc=e.dynCall_viijij=e.asm.ug).apply(null,arguments)},oc=e.dynCall_viiiij=function(){return(oc=e.dynCall_viiiij=e.asm.vg).apply(null,arguments)},ac=e.dynCall_jj=function(){return(ac=e.dynCall_jj=e.asm.wg).apply(null,arguments)},lc=e.dynCall_viji=function(){return(lc=e.dynCall_viji=e.asm.xg).apply(null,arguments)},cc=e.dynCall_iiij=function(){return(cc=e.dynCall_iiij=e.asm.yg).apply(null,arguments)},uc=e.dynCall_vij=function(){return(uc=e.dynCall_vij=e.asm.zg).apply(null,arguments)},dc=e.dynCall_iiiij=function(){return(dc=e.dynCall_iiiij=e.asm.Ag).apply(null,arguments)},fc=e.dynCall_jii=function(){return(fc=e.dynCall_jii=e.asm.Bg).apply(null,arguments)},hc=e.dynCall_iiiji=function(){return(hc=e.dynCall_iiiji=e.asm.Cg).apply(null,arguments)},pc=e.dynCall_iijj=function(){return(pc=e.dynCall_iijj=e.asm.Dg).apply(null,arguments)},yc=e.dynCall_iiijii=function(){return(yc=e.dynCall_iiijii=e.asm.Eg).apply(null,arguments)},_c=e.dynCall_iiiiji=function(){return(_c=e.dynCall_iiiiji=e.asm.Fg).apply(null,arguments)},mc=e.dynCall_iiiiiji=function(){return(mc=e.dynCall_iiiiiji=e.asm.Gg).apply(null,arguments)},bc=e.dynCall_jiii=function(){return(bc=e.dynCall_jiii=e.asm.Hg).apply(null,arguments)},vc=e.dynCall_jij=function(){return(vc=e.dynCall_jij=e.asm.Ig).apply(null,arguments)},gc=e.dynCall_vijj=function(){return(gc=e.dynCall_vijj=e.asm.Jg).apply(null,arguments)},wc=e.dynCall_vijij=function(){return(wc=e.dynCall_vijij=e.asm.Kg).apply(null,arguments)},jc=e.dynCall_iiijjjj=function(){return(jc=e.dynCall_iiijjjj=e.asm.Lg).apply(null,arguments)},Sc=e.dynCall_iiijiiii=function(){return(Sc=e.dynCall_iiijiiii=e.asm.Mg).apply(null,arguments)},Ic=e.dynCall_jiiij=function(){return(Ic=e.dynCall_jiiij=e.asm.Ng).apply(null,arguments)},Cc=e.dynCall_jiiiii=function(){return(Cc=e.dynCall_jiiiii=e.asm.Og).apply(null,arguments)},Ac=e.dynCall_iiiiijjiijj=function(){return(Ac=e.dynCall_iiiiijjiijj=e.asm.Pg).apply(null,arguments)},xc=e.dynCall_viijiiji=function(){return(xc=e.dynCall_viijiiji=e.asm.Qg).apply(null,arguments)},Fc=e.dynCall_iiijjii=function(){return(Fc=e.dynCall_iiijjii=e.asm.Rg).apply(null,arguments)},Bc=e.dynCall_iiijji=function(){return(Bc=e.dynCall_iiijji=e.asm.Sg).apply(null,arguments)},Tc=e.dynCall_iijjii=function(){return(Tc=e.dynCall_iijjii=e.asm.Tg).apply(null,arguments)},Dc=e.dynCall_vijii=function(){return(Dc=e.dynCall_vijii=e.asm.Ug).apply(null,arguments)},Ec=e.dynCall_vjjijij=function(){return(Ec=e.dynCall_vjjijij=e.asm.Vg).apply(null,arguments)},kc=e.dynCall_vijjji=function(){return(kc=e.dynCall_vijjji=e.asm.Wg).apply(null,arguments)},Oc=e.dynCall_vjjii=function(){return(Oc=e.dynCall_vjjii=e.asm.Xg).apply(null,arguments)},Mc=e.dynCall_viiiiiji=function(){return(Mc=e.dynCall_viiiiiji=e.asm.Yg).apply(null,arguments)},Rc=e.dynCall_jiiiji=function(){return(Rc=e.dynCall_jiiiji=e.asm.Zg).apply(null,arguments)},Uc=e.dynCall_viijjii=function(){return(Uc=e.dynCall_viijjii=e.asm._g).apply(null,arguments)},Nc=e.dynCall_iiiijj=function(){return(Nc=e.dynCall_iiiijj=e.asm.$g).apply(null,arguments)},Lc=e.dynCall_viiiijj=function(){return(Lc=e.dynCall_viiiijj=e.asm.ah).apply(null,arguments)},Pc=e.dynCall_jijjij=function(){return(Pc=e.dynCall_jijjij=e.asm.bh).apply(null,arguments)},Vc=e.dynCall_jiijii=function(){return(Vc=e.dynCall_jiijii=e.asm.ch).apply(null,arguments)},Hc=e.dynCall_jijiii=function(){return(Hc=e.dynCall_jijiii=e.asm.dh).apply(null,arguments)},zc=e.dynCall_viijiiiii=function(){return(zc=e.dynCall_viijiiiii=e.asm.eh).apply(null,arguments)},Wc=e.dynCall_viijiiij=function(){return(Wc=e.dynCall_viijiiij=e.asm.fh).apply(null,arguments)},$c=e.dynCall_vijiiiji=function(){return($c=e.dynCall_vijiiiji=e.asm.gh).apply(null,arguments)},Yc=e.dynCall_jiiji=function(){return(Yc=e.dynCall_jiiji=e.asm.hh).apply(null,arguments)},Xc=e.dynCall_viiijij=function(){return(Xc=e.dynCall_viiijij=e.asm.ih).apply(null,arguments)},Gc=e.dynCall_viijiij=function(){return(Gc=e.dynCall_viijiij=e.asm.jh).apply(null,arguments)},Kc=e.dynCall_viiiiijj=function(){return(Kc=e.dynCall_viiiiijj=e.asm.kh).apply(null,arguments)},Jc=e.dynCall_viiijji=function(){return(Jc=e.dynCall_viiijji=e.asm.lh).apply(null,arguments)},qc=e.dynCall_iijji=function(){return(qc=e.dynCall_iijji=e.asm.mh).apply(null,arguments)},Zc=e.dynCall_iijii=function(){return(Zc=e.dynCall_iijii=e.asm.nh).apply(null,arguments)},Qc=e.dynCall_iiji=function(){return(Qc=e.dynCall_iiji=e.asm.oh).apply(null,arguments)},tu=e.dynCall_vijijj=function(){return(tu=e.dynCall_vijijj=e.asm.ph).apply(null,arguments)},eu=e.dynCall_viiijjj=function(){return(eu=e.dynCall_viiijjj=e.asm.qh).apply(null,arguments)},iu=e.dynCall_iji=function(){return(iu=e.dynCall_iji=e.asm.rh).apply(null,arguments)},ru=e.dynCall_vijiiii=function(){return(ru=e.dynCall_vijiiii=e.asm.sh).apply(null,arguments)},nu=e.dynCall_iijjijj=function(){return(nu=e.dynCall_iijjijj=e.asm.th).apply(null,arguments)},su=e.dynCall_viiijii=function(){return(su=e.dynCall_viiijii=e.asm.uh).apply(null,arguments)},ou=e.dynCall_viiiiiij=function(){return(ou=e.dynCall_viiiiiij=e.asm.vh).apply(null,arguments)},au=e.dynCall_viiiijiiiii=function(){return(au=e.dynCall_viiiijiiiii=e.asm.wh).apply(null,arguments)},lu=e.dynCall_viiiijiiii=function(){return(lu=e.dynCall_viiiijiiii=e.asm.xh).apply(null,arguments)},cu=e.dynCall_ijji=function(){return(cu=e.dynCall_ijji=e.asm.yh).apply(null,arguments)},uu=e.dynCall_iiijiii=function(){return(uu=e.dynCall_iiijiii=e.asm.zh).apply(null,arguments)},du=e.dynCall_iiiiijii=function(){return(du=e.dynCall_iiiiijii=e.asm.Ah).apply(null,arguments)},fu=e.dynCall_viijiii=function(){return(fu=e.dynCall_viijiii=e.asm.Bh).apply(null,arguments)},hu=e.dynCall_iiijiij=function(){return(hu=e.dynCall_iiijiij=e.asm.Ch).apply(null,arguments)},pu=e.dynCall_vijiii=function(){return(pu=e.dynCall_vijiii=e.asm.Dh).apply(null,arguments)},yu=e.dynCall_iijjiii=function(){return(yu=e.dynCall_iijjiii=e.asm.Eh).apply(null,arguments)},_u=e.dynCall_iijjiiii=function(){return(_u=e.dynCall_iijjiiii=e.asm.Fh).apply(null,arguments)},mu=e.dynCall_viiiji=function(){return(mu=e.dynCall_viiiji=e.asm.Gh).apply(null,arguments)},bu=e.dynCall_iijiiii=function(){return(bu=e.dynCall_iijiiii=e.asm.Hh).apply(null,arguments)},vu=e.dynCall_viiiijii=function(){return(vu=e.dynCall_viiiijii=e.asm.Ih).apply(null,arguments)},gu=e.dynCall_iiiijiii=function(){return(gu=e.dynCall_iiiijiii=e.asm.Jh).apply(null,arguments)},wu=e.dynCall_iiijij=function(){return(wu=e.dynCall_iiijij=e.asm.Kh).apply(null,arguments)},ju=e.dynCall_iiijjji=function(){return(ju=e.dynCall_iiijjji=e.asm.Lh).apply(null,arguments)},Su=e.dynCall_viijjji=function(){return(Su=e.dynCall_viijjji=e.asm.Mh).apply(null,arguments)},Iu=e.dynCall_viiijjji=function(){return(Iu=e.dynCall_viiijjji=e.asm.Nh).apply(null,arguments)},Cu=e.dynCall_viiijiii=function(){return(Cu=e.dynCall_viiijiii=e.asm.Oh).apply(null,arguments)},Au=e.dynCall_vijji=function(){return(Au=e.dynCall_vijji=e.asm.Ph).apply(null,arguments)},xu=e.dynCall_viiiijij=function(){return(xu=e.dynCall_viiiijij=e.asm.Qh).apply(null,arguments)},Fu=e.dynCall_jiiiij=function(){return(Fu=e.dynCall_jiiiij=e.asm.Rh).apply(null,arguments)},Bu=e.dynCall_jiiijii=function(){return(Bu=e.dynCall_jiiijii=e.asm.Sh).apply(null,arguments)},Tu=e.dynCall_jiijiii=function(){return(Tu=e.dynCall_jiijiii=e.asm.Th).apply(null,arguments)},Du=e.dynCall_viiijjij=function(){return(Du=e.dynCall_viiijjij=e.asm.Uh).apply(null,arguments)},Eu=e.dynCall_vijijjiij=function(){return(Eu=e.dynCall_vijijjiij=e.asm.Vh).apply(null,arguments)},ku=e.dynCall_viiijjiij=function(){return(ku=e.dynCall_viiijjiij=e.asm.Wh).apply(null,arguments)},Ou=e.dynCall_viiiijijji=function(){return(Ou=e.dynCall_viiiijijji=e.asm.Xh).apply(null,arguments)},Mu=e.dynCall_viijiiiij=function(){return(Mu=e.dynCall_viijiiiij=e.asm.Yh).apply(null,arguments)},Ru=e.dynCall_viiijiiiijjj=function(){return(Ru=e.dynCall_viiijiiiijjj=e.asm.Zh).apply(null,arguments)},Uu=e.dynCall_viijijiiiijjj=function(){return(Uu=e.dynCall_viijijiiiijjj=e.asm._h).apply(null,arguments)},Nu=e.dynCall_iijjj=function(){return(Nu=e.dynCall_iijjj=e.asm.$h).apply(null,arguments)},Lu=e.dynCall_vijijiiiijjj=function(){return(Lu=e.dynCall_vijijiiiijjj=e.asm.ai).apply(null,arguments)},Pu=e.dynCall_jd=function(){return(Pu=e.dynCall_jd=e.asm.bi).apply(null,arguments)},Vu=e.dynCall_jf=function(){return(Vu=e.dynCall_jf=e.asm.ci).apply(null,arguments)},Hu=e.dynCall_iiiiiiji=function(){return(Hu=e.dynCall_iiiiiiji=e.asm.di).apply(null,arguments)},zu=e.dynCall_iiiiiiiiji=function(){return(zu=e.dynCall_iiiiiiiiji=e.asm.ei).apply(null,arguments)},Wu=e.dynCall_vijiji=function(){return(Wu=e.dynCall_vijiji=e.asm.fi).apply(null,arguments)},$u=e.dynCall_vijjij=function(){return($u=e.dynCall_vijjij=e.asm.gi).apply(null,arguments)},Yu=e.dynCall_viiiijiiiiiiii=function(){return(Yu=e.dynCall_viiiijiiiiiiii=e.asm.hi).apply(null,arguments)},Xu=e.dynCall_ij=function(){return(Xu=e.dynCall_ij=e.asm.ii).apply(null,arguments)},Gu=e.dynCall_jjj=function(){return(Gu=e.dynCall_jjj=e.asm.ji).apply(null,arguments)},Ku=e.dynCall_jjiji=function(){return(Ku=e.dynCall_jjiji=e.asm.ki).apply(null,arguments)},Ju=e.dynCall_jijij=function(){return(Ju=e.dynCall_jijij=e.asm.li).apply(null,arguments)},qu=e.dynCall_jijj=function(){return(qu=e.dynCall_jijj=e.asm.mi).apply(null,arguments)},Zu=e.dynCall_jiiijj=function(){return(Zu=e.dynCall_jiiijj=e.asm.ni).apply(null,arguments)},Qu=e.dynCall_vjii=function(){return(Qu=e.dynCall_vjii=e.asm.oi).apply(null,arguments)},td=e.dynCall_jjjjjjd=function(){return(td=e.dynCall_jjjjjjd=e.asm.pi).apply(null,arguments)},ed=e.dynCall_ijii=function(){return(ed=e.dynCall_ijii=e.asm.qi).apply(null,arguments)},id=e.dynCall_vjiiii=function(){return(id=e.dynCall_vjiiii=e.asm.ri).apply(null,arguments)},rd=e.dynCall_viiiiijiiii=function(){return(rd=e.dynCall_viiiiijiiii=e.asm.si).apply(null,arguments)},nd=e.dynCall_viiiiijiii=function(){return(nd=e.dynCall_viiiiijiii=e.asm.ti).apply(null,arguments)},sd=e.dynCall_vjiiiji=function(){return(sd=e.dynCall_vjiiiji=e.asm.ui).apply(null,arguments)},od=e.dynCall_viijjj=function(){return(od=e.dynCall_viijjj=e.asm.vi).apply(null,arguments)},ad=e.dynCall_viijiiiiii=function(){return(ad=e.dynCall_viijiiiiii=e.asm.wi).apply(null,arguments)},ld=e.dynCall_jjjji=function(){return(ld=e.dynCall_jjjji=e.asm.xi).apply(null,arguments)},cd=e.dynCall_jjjii=function(){return(cd=e.dynCall_jjjii=e.asm.yi).apply(null,arguments)},ud=e.dynCall_jji=function(){return(ud=e.dynCall_jji=e.asm.zi).apply(null,arguments)},dd=e.dynCall_viiiiji=function(){return(dd=e.dynCall_viiiiji=e.asm.Ai).apply(null,arguments)},fd=e.dynCall_iijiji=function(){return(fd=e.dynCall_iijiji=e.asm.Bi).apply(null,arguments)},hd=e.dynCall_iiiiiij=function(){return(hd=e.dynCall_iiiiiij=e.asm.Ci).apply(null,arguments)},pd=e.dynCall_iiiiiiiiiiji=function(){return(pd=e.dynCall_iiiiiiiiiiji=e.asm.Di).apply(null,arguments)},yd=e.dynCall_iiiiiiiij=function(){return(yd=e.dynCall_iiiiiiiij=e.asm.Ei).apply(null,arguments)},_d=e.dynCall_jiiijjj=function(){return(_d=e.dynCall_jiiijjj=e.asm.Fi).apply(null,arguments)},md=e.dynCall_viiijijj=function(){return(md=e.dynCall_viiijijj=e.asm.Gi).apply(null,arguments)},bd=e.dynCall_jiiiiji=function(){return(bd=e.dynCall_jiiiiji=e.asm.Hi).apply(null,arguments)},vd=e.dynCall_iiiiijij=function(){return(vd=e.dynCall_iiiiijij=e.asm.Ii).apply(null,arguments)},gd=e.dynCall_jiiiiiii=function(){return(gd=e.dynCall_jiiiiiii=e.asm.Ji).apply(null,arguments)},wd=e.dynCall_fiijii=function(){return(wd=e.dynCall_fiijii=e.asm.Ki).apply(null,arguments)},jd=e.dynCall_diijii=function(){return(jd=e.dynCall_diijii=e.asm.Li).apply(null,arguments)},Sd=e.dynCall_iiiiiiijii=function(){return(Sd=e.dynCall_iiiiiiijii=e.asm.Mi).apply(null,arguments)},Id=e.dynCall_jiij=function(){return(Id=e.dynCall_jiij=e.asm.Ni).apply(null,arguments)},Cd=e.dynCall_iiiijjii=function(){return(Cd=e.dynCall_iiiijjii=e.asm.Oi).apply(null,arguments)},Ad=e.dynCall_iiiiijji=function(){return(Ad=e.dynCall_iiiiijji=e.asm.Pi).apply(null,arguments)},xd=e.dynCall_viiijjii=function(){return(xd=e.dynCall_viiijjii=e.asm.Qi).apply(null,arguments)},Fd=e.dynCall_viiiijji=function(){return(Fd=e.dynCall_viiiijji=e.asm.Ri).apply(null,arguments)},Bd=e.dynCall_viiiijjii=function(){return(Bd=e.dynCall_viiiijjii=e.asm.Si).apply(null,arguments)},Td=e.dynCall_viiiiijji=function(){return(Td=e.dynCall_viiiiijji=e.asm.Ti).apply(null,arguments)},Dd=e.dynCall_iiidj=function(){return(Dd=e.dynCall_iiidj=e.asm.Ui).apply(null,arguments)},Ed=e.dynCall_iiiiiiij=function(){return(Ed=e.dynCall_iiiiiiij=e.asm.Vi).apply(null,arguments)},kd=e.dynCall_iiiiiiiiiiiij=function(){return(kd=e.dynCall_iiiiiiiiiiiij=e.asm.Wi).apply(null,arguments)},Od=e.dynCall_iiijjiiji=function(){return(Od=e.dynCall_iiijjiiji=e.asm.Xi).apply(null,arguments)},Md=e.dynCall_iiijjiij=function(){return(Md=e.dynCall_iiijjiij=e.asm.Yi).apply(null,arguments)},Rd=e.dynCall_iiidjiij=function(){return(Rd=e.dynCall_iiidjiij=e.asm.Zi).apply(null,arguments)},Ud=e.dynCall_iiiiiiiji=function(){return(Ud=e.dynCall_iiiiiiiji=e.asm._i).apply(null,arguments)},Nd=e.dynCall_iiiidjj=function(){return(Nd=e.dynCall_iiiidjj=e.asm.$i).apply(null,arguments)},Ld=e.dynCall_iiiijjj=function(){return(Ld=e.dynCall_iiiijjj=e.asm.aj).apply(null,arguments)},Pd=e.dynCall_jiiiiiijii=function(){return(Pd=e.dynCall_jiiiiiijii=e.asm.bj).apply(null,arguments)},Vd=e.dynCall_iiiijji=function(){return(Vd=e.dynCall_iiiijji=e.asm.cj).apply(null,arguments)},Hd=e.dynCall_jiiiiii=function(){return(Hd=e.dynCall_jiiiiii=e.asm.dj).apply(null,arguments)},zd=e.dynCall_jiijjjii=function(){return(zd=e.dynCall_jiijjjii=e.asm.ej).apply(null,arguments)},Wd=e.dynCall_jiiiijii=function(){return(Wd=e.dynCall_jiiiijii=e.asm.fj).apply(null,arguments)},$d=e.dynCall_jiiiiijiiii=function(){return($d=e.dynCall_jiiiiijiiii=e.asm.gj).apply(null,arguments)},Yd=e.dynCall_jiiijiii=function(){return(Yd=e.dynCall_jiiijiii=e.asm.hj).apply(null,arguments)},Xd=e.dynCall_viiijijiji=function(){return(Xd=e.dynCall_viiijijiji=e.asm.ij).apply(null,arguments)},Gd=e.dynCall_iiijjj=function(){return(Gd=e.dynCall_iiijjj=e.asm.jj).apply(null,arguments)},Kd=e.dynCall_iiiijii=function(){return(Kd=e.dynCall_iiiijii=e.asm.kj).apply(null,arguments)},Jd=e.dynCall_vj=function(){return(Jd=e.dynCall_vj=e.asm.lj).apply(null,arguments)},qd=e.dynCall_iijiii=function(){return(qd=e.dynCall_iijiii=e.asm.mj).apply(null,arguments)},Zd=e.dynCall_vijiijj=function(){return(Zd=e.dynCall_vijiijj=e.asm.nj).apply(null,arguments)},Qd=e.dynCall_vifiijj=function(){return(Qd=e.dynCall_vifiijj=e.asm.oj).apply(null,arguments)},tf=e.dynCall_vidiijj=function(){return(tf=e.dynCall_vidiijj=e.asm.pj).apply(null,arguments)},ef=e.dynCall_viiiiij=function(){return(ef=e.dynCall_viiiiij=e.asm.qj).apply(null,arguments)},rf=e.dynCall_ijjiii=function(){return(rf=e.dynCall_ijjiii=e.asm.rj).apply(null,arguments)},nf=e.dynCall_vijijjji=function(){return(nf=e.dynCall_vijijjji=e.asm.sj).apply(null,arguments)},sf=e.dynCall_viijiijj=function(){return(sf=e.dynCall_viijiijj=e.asm.tj).apply(null,arguments)},of=e.dynCall_viijijj=function(){return(of=e.dynCall_viijijj=e.asm.uj).apply(null,arguments)},af=e.dynCall_viiiiijjji=function(){return(af=e.dynCall_viiiiijjji=e.asm.vj).apply(null,arguments)},lf=e.dynCall_iiijiijj=function(){return(lf=e.dynCall_iiijiijj=e.asm.wj).apply(null,arguments)},cf=e.dynCall_viiijijjj=function(){return(cf=e.dynCall_viiijijjj=e.asm.xj).apply(null,arguments)},uf=e.dynCall_iijiijj=function(){return(uf=e.dynCall_iijiijj=e.asm.yj).apply(null,arguments)},df=e.dynCall_viiijjjji=function(){return(df=e.dynCall_viiijjjji=e.asm.zj).apply(null,arguments)},ff=e.dynCall_viiiijiii=function(){return(ff=e.dynCall_viiiijiii=e.asm.Aj).apply(null,arguments)},hf=e.dynCall_viijiiii=function(){return(hf=e.dynCall_viijiiii=e.asm.Bj).apply(null,arguments)},pf=e.dynCall_vijjiiii=function(){return(pf=e.dynCall_vijjiiii=e.asm.Cj).apply(null,arguments)},yf=e.dynCall_vijijjiiiii=function(){return(yf=e.dynCall_vijijjiiiii=e.asm.Dj).apply(null,arguments)},_f=e.dynCall_vijjiiiii=function(){return(_f=e.dynCall_vijjiiiii=e.asm.Ej).apply(null,arguments)},mf=e.dynCall_iiiiiijji=function(){return(mf=e.dynCall_iiiiiijji=e.asm.Fj).apply(null,arguments)},bf=e.dynCall_iiiiijjj=function(){return(bf=e.dynCall_iiiiijjj=e.asm.Gj).apply(null,arguments)},vf=e.dynCall_jijiiii=function(){return(vf=e.dynCall_jijiiii=e.asm.Hj).apply(null,arguments)},gf=e.dynCall_viiijiji=function(){return(gf=e.dynCall_viiijiji=e.asm.Ij).apply(null,arguments)},wf=e.dynCall_iiijjjii=function(){return(wf=e.dynCall_iiijjjii=e.asm.Jj).apply(null,arguments)},jf=e.dynCall_iiiiijjji=function(){return(jf=e.dynCall_iiiiijjji=e.asm.Kj).apply(null,arguments)},Sf=e.dynCall_viijiji=function(){return(Sf=e.dynCall_viijiji=e.asm.Lj).apply(null,arguments)};function Dm(s){var a=j();try{U(s)()}catch(l){if(S(a),l!==l+0)throw l;w(1,0)}}function Em(s,a,l){var u=j();try{U(s)(a,l)}catch(d){if(S(u),d!==d+0)throw d;w(1,0)}}function km(s,a){var l=j();try{return U(s)(a)}catch(u){if(S(l),u!==u+0)throw u;w(1,0)}}function Om(s,a,l){var u=j();try{return U(s)(a,l)}catch(d){if(S(u),d!==d+0)throw d;w(1,0)}}function Mm(s,a){var l=j();try{U(s)(a)}catch(u){if(S(l),u!==u+0)throw u;w(1,0)}}function Rm(s,a,l,u){var d=j();try{return U(s)(a,l,u)}catch(f){if(S(d),f!==f+0)throw f;w(1,0)}}function Um(s,a,l,u,d,f){var h=j();try{return U(s)(a,l,u,d,f)}catch(y){if(S(h),y!==y+0)throw y;w(1,0)}}function Nm(s,a,l,u,d){var f=j();try{U(s)(a,l,u,d)}catch(h){if(S(f),h!==h+0)throw h;w(1,0)}}function Lm(s,a,l,u,d){var f=j();try{return U(s)(a,l,u,d)}catch(h){if(S(f),h!==h+0)throw h;w(1,0)}}function Pm(s,a,l,u){var d=j();try{return U(s)(a,l,u)}catch(f){if(S(d),f!==f+0)throw f;w(1,0)}}function Vm(s,a,l,u){var d=j();try{return U(s)(a,l,u)}catch(f){if(S(d),f!==f+0)throw f;w(1,0)}}function Hm(s,a,l,u){var d=j();try{U(s)(a,l,u)}catch(f){if(S(d),f!==f+0)throw f;w(1,0)}}function zm(s,a,l,u){var d=j();try{U(s)(a,l,u)}catch(f){if(S(d),f!==f+0)throw f;w(1,0)}}function Wm(s,a,l,u,d,f,h,y){var _=j();try{return U(s)(a,l,u,d,f,h,y)}catch(m){if(S(_),m!==m+0)throw m;w(1,0)}}function $m(s,a,l,u,d,f,h,y,_,m,v){var I=j();try{return U(s)(a,l,u,d,f,h,y,_,m,v)}catch(x){if(S(I),x!==x+0)throw x;w(1,0)}}function Ym(s,a,l,u,d,f,h,y,_,m,v,I,x){var D=j();try{return U(s)(a,l,u,d,f,h,y,_,m,v,I,x)}catch(E){if(S(D),E!==E+0)throw E;w(1,0)}}function Xm(s){var a=j();try{return U(s)()}catch(l){if(S(a),l!==l+0)throw l;w(1,0)}}function Gm(s,a,l,u,d,f,h,y){var _=j();try{U(s)(a,l,u,d,f,h,y)}catch(m){if(S(_),m!==m+0)throw m;w(1,0)}}function Km(s,a,l,u,d,f,h){var y=j();try{return U(s)(a,l,u,d,f,h)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function Jm(s,a,l,u,d,f,h,y,_,m,v,I){var x=j();try{return U(s)(a,l,u,d,f,h,y,_,m,v,I)}catch(D){if(S(x),D!==D+0)throw D;w(1,0)}}function qm(s,a,l,u,d,f,h,y,_,m,v){var I=j();try{U(s)(a,l,u,d,f,h,y,_,m,v)}catch(x){if(S(I),x!==x+0)throw x;w(1,0)}}function Zm(s,a,l,u,d,f,h,y,_,m,v,I,x,D,E,st){var yt=j();try{U(s)(a,l,u,d,f,h,y,_,m,v,I,x,D,E,st)}catch(kt){if(S(yt),kt!==kt+0)throw kt;w(1,0)}}function Qm(s,a,l,u,d,f,h){var y=j();try{U(s)(a,l,u,d,f,h)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function tb(s,a,l,u,d,f){var h=j();try{return U(s)(a,l,u,d,f)}catch(y){if(S(h),y!==y+0)throw y;w(1,0)}}function eb(s,a,l,u,d,f,h,y,_){var m=j();try{U(s)(a,l,u,d,f,h,y,_)}catch(v){if(S(m),v!==v+0)throw v;w(1,0)}}function ib(s,a,l,u,d,f){var h=j();try{U(s)(a,l,u,d,f)}catch(y){if(S(h),y!==y+0)throw y;w(1,0)}}function rb(s,a){var l=j();try{return U(s)(a)}catch(u){if(S(l),u!==u+0)throw u;w(1,0)}}function nb(s,a,l,u,d,f,h,y,_,m){var v=j();try{return U(s)(a,l,u,d,f,h,y,_,m)}catch(I){if(S(v),I!==I+0)throw I;w(1,0)}}function sb(s,a){var l=j();try{return U(s)(a)}catch(u){if(S(l),u!==u+0)throw u;w(1,0)}}function ob(s,a){var l=j();try{return U(s)(a)}catch(u){if(S(l),u!==u+0)throw u;w(1,0)}}function ab(s,a){var l=j();try{return U(s)(a)}catch(u){if(S(l),u!==u+0)throw u;w(1,0)}}function lb(s,a,l){var u=j();try{return U(s)(a,l)}catch(d){if(S(u),d!==d+0)throw d;w(1,0)}}function cb(s,a,l){var u=j();try{return U(s)(a,l)}catch(d){if(S(u),d!==d+0)throw d;w(1,0)}}function ub(s,a,l){var u=j();try{U(s)(a,l)}catch(d){if(S(u),d!==d+0)throw d;w(1,0)}}function db(s,a,l,u,d,f,h,y,_,m,v,I,x,D,E,st,yt,kt){var B=j();try{return U(s)(a,l,u,d,f,h,y,_,m,v,I,x,D,E,st,yt,kt)}catch(L){if(S(B),L!==L+0)throw L;w(1,0)}}function fb(s,a,l,u,d){var f=j();try{return U(s)(a,l,u,d)}catch(h){if(S(f),h!==h+0)throw h;w(1,0)}}function hb(s,a,l,u,d,f,h,y,_){var m=j();try{return U(s)(a,l,u,d,f,h,y,_)}catch(v){if(S(m),v!==v+0)throw v;w(1,0)}}function pb(s,a,l){var u=j();try{U(s)(a,l)}catch(d){if(S(u),d!==d+0)throw d;w(1,0)}}function yb(s,a,l,u,d,f,h,y,_,m,v,I,x,D){var E=j();try{U(s)(a,l,u,d,f,h,y,_,m,v,I,x,D)}catch(st){if(S(E),st!==st+0)throw st;w(1,0)}}function _b(s,a,l,u,d,f,h,y,_,m){var v=j();try{U(s)(a,l,u,d,f,h,y,_,m)}catch(I){if(S(v),I!==I+0)throw I;w(1,0)}}function mb(s,a,l,u){var d=j();try{return U(s)(a,l,u)}catch(f){if(S(d),f!==f+0)throw f;w(1,0)}}function bb(s,a,l,u,d,f,h,y){var _=j();try{return U(s)(a,l,u,d,f,h,y)}catch(m){if(S(_),m!==m+0)throw m;w(1,0)}}function vb(s,a,l,u,d){var f=j();try{return U(s)(a,l,u,d)}catch(h){if(S(f),h!==h+0)throw h;w(1,0)}}function gb(s,a,l,u,d,f){var h=j();try{U(s)(a,l,u,d,f)}catch(y){if(S(h),y!==y+0)throw y;w(1,0)}}function wb(s,a,l,u,d,f,h,y,_,m,v,I,x,D,E,st,yt){var kt=j();try{return U(s)(a,l,u,d,f,h,y,_,m,v,I,x,D,E,st,yt)}catch(B){if(S(kt),B!==B+0)throw B;w(1,0)}}function jb(s,a,l,u,d,f,h){var y=j();try{return U(s)(a,l,u,d,f,h)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function Sb(s,a,l,u,d){var f=j();try{return U(s)(a,l,u,d)}catch(h){if(S(f),h!==h+0)throw h;w(1,0)}}function Ib(s,a,l){var u=j();try{return U(s)(a,l)}catch(d){if(S(u),d!==d+0)throw d;w(1,0)}}function Cb(s,a,l,u,d,f,h,y,_,m,v){var I=j();try{U(s)(a,l,u,d,f,h,y,_,m,v)}catch(x){if(S(I),x!==x+0)throw x;w(1,0)}}function Ab(s,a,l,u,d,f,h,y,_,m,v,I){var x=j();try{U(s)(a,l,u,d,f,h,y,_,m,v,I)}catch(D){if(S(x),D!==D+0)throw D;w(1,0)}}function xb(s,a,l,u,d,f,h,y,_,m){var v=j();try{U(s)(a,l,u,d,f,h,y,_,m)}catch(I){if(S(v),I!==I+0)throw I;w(1,0)}}function Fb(s){var a=j();try{return U(s)()}catch(l){if(S(a),l!==l+0)throw l;w(1,0)}}function Bb(s){var a=j();try{return U(s)()}catch(l){if(S(a),l!==l+0)throw l;w(1,0)}}function Tb(s,a,l,u,d){var f=j();try{return zl(s,a,l,u,d)}catch(h){if(S(f),h!==h+0)throw h;w(1,0)}}function Db(s,a,l,u,d,f,h){var y=j();try{Ql(s,a,l,u,d,f,h)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function Eb(s,a){var l=j();try{return Kl(s,a)}catch(u){if(S(l),u!==u+0)throw u;w(1,0)}}function kb(s,a,l){var u=j();try{return fc(s,a,l)}catch(d){if(S(u),d!==d+0)throw d;w(1,0)}}function Ob(s,a,l,u,d,f,h){var y=j();try{Xl(s,a,l,u,d,f,h)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function Mb(s,a,l,u,d,f,h){var y=j();try{return Wl(s,a,l,u,d,f,h)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function Rb(s,a,l,u,d,f,h,y,_){var m=j();try{return $l(s,a,l,u,d,f,h,y,_)}catch(v){if(S(m),v!==v+0)throw v;w(1,0)}}function Ub(s,a,l,u){var d=j();try{return Jl(s,a,l,u)}catch(f){if(S(d),f!==f+0)throw f;w(1,0)}}function Nb(s,a,l,u,d,f){var h=j();try{ec(s,a,l,u,d,f)}catch(y){if(S(h),y!==y+0)throw y;w(1,0)}}function Lb(s,a,l,u,d){var f=j();try{ql(s,a,l,u,d)}catch(h){if(S(f),h!==h+0)throw h;w(1,0)}}function Pb(s){var a=j();try{return Gl(s)}catch(l){if(S(a),l!==l+0)throw l;w(1,0)}}function Vb(s,a,l,u,d,f,h,y){var _=j();try{ic(s,a,l,u,d,f,h,y)}catch(m){if(S(_),m!==m+0)throw m;w(1,0)}}function Hb(s,a,l,u,d,f,h){var y=j();try{return rc(s,a,l,u,d,f,h)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function zb(s,a,l,u,d,f,h,y){var _=j();try{Zl(s,a,l,u,d,f,h,y)}catch(m){if(S(_),m!==m+0)throw m;w(1,0)}}function Wb(s,a,l,u,d,f,h){var y=j();try{oc(s,a,l,u,d,f,h)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function $b(s,a,l,u,d,f){var h=j();try{nc(s,a,l,u,d,f)}catch(y){if(S(h),y!==y+0)throw y;w(1,0)}}function Yb(s,a,l,u){var d=j();try{uc(s,a,l,u)}catch(f){if(S(d),f!==f+0)throw f;w(1,0)}}function Xb(s,a,l){var u=j();try{return ac(s,a,l)}catch(d){if(S(u),d!==d+0)throw d;w(1,0)}}function Gb(s,a,l,u,d){var f=j();try{return cc(s,a,l,u,d)}catch(h){if(S(f),h!==h+0)throw h;w(1,0)}}function Kb(s,a,l,u,d,f,h){var y=j();try{return qd(s,a,l,u,d,f,h)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function Jb(s,a,l,u,d){var f=j();try{lc(s,a,l,u,d)}catch(h){if(S(f),h!==h+0)throw h;w(1,0)}}function qb(s,a,l,u,d,f,h,y){var _=j();try{tc(s,a,l,u,d,f,h,y)}catch(m){if(S(_),m!==m+0)throw m;w(1,0)}}function Zb(s,a,l,u,d,f,h,y){var _=j();try{return Nc(s,a,l,u,d,f,h,y)}catch(m){if(S(_),m!==m+0)throw m;w(1,0)}}function Qb(s,a,l,u,d,f,h,y,_){var m=j();try{return Hu(s,a,l,u,d,f,h,y,_)}catch(v){if(S(m),v!==v+0)throw v;w(1,0)}}function tv(s,a,l,u,d,f,h,y,_,m,v){var I=j();try{return zu(s,a,l,u,d,f,h,y,_,m,v)}catch(x){if(S(I),x!==x+0)throw x;w(1,0)}}function ev(s,a,l,u,d,f){var h=j();try{return dc(s,a,l,u,d,f)}catch(y){if(S(h),y!==y+0)throw y;w(1,0)}}function iv(s,a,l,u,d,f,h,y){var _=j();try{return wu(s,a,l,u,d,f,h,y)}catch(m){if(S(_),m!==m+0)throw m;w(1,0)}}function rv(s,a,l,u,d){var f=j();try{return Qc(s,a,l,u,d)}catch(h){if(S(f),h!==h+0)throw h;w(1,0)}}function nv(s,a,l,u,d,f){var h=j();try{return hc(s,a,l,u,d,f)}catch(y){if(S(h),y!==y+0)throw y;w(1,0)}}function sv(s,a,l,u,d,f,h){var y=j();try{return qc(s,a,l,u,d,f,h)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function ov(s,a,l,u,d,f,h,y,_,m){var v=j();try{return ju(s,a,l,u,d,f,h,y,_,m)}catch(I){if(S(v),I!==I+0)throw I;w(1,0)}}function av(s,a,l,u,d,f,h,y,_){var m=j();try{return hu(s,a,l,u,d,f,h,y,_)}catch(v){if(S(m),v!==v+0)throw v;w(1,0)}}function lv(s,a,l,u,d,f,h,y,_,m){var v=j();try{Su(s,a,l,u,d,f,h,y,_,m)}catch(I){if(S(v),I!==I+0)throw I;w(1,0)}}function cv(s,a,l,u,d,f,h,y){var _=j();try{return Bc(s,a,l,u,d,f,h,y)}catch(m){if(S(_),m!==m+0)throw m;w(1,0)}}function uv(s,a,l,u,d,f,h,y){var _=j();try{sc(s,a,l,u,d,f,h,y)}catch(m){if(S(_),m!==m+0)throw m;w(1,0)}}function dv(s,a,l,u,d,f){var h=j();try{return pc(s,a,l,u,d,f)}catch(y){if(S(h),y!==y+0)throw y;w(1,0)}}function fv(s,a,l,u,d,f,h){var y=j();try{return yc(s,a,l,u,d,f,h)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function hv(s,a,l,u,d,f,h){var y=j();try{return _c(s,a,l,u,d,f,h)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function pv(s,a,l,u,d,f,h,y){var _=j();try{return mc(s,a,l,u,d,f,h,y)}catch(m){if(S(_),m!==m+0)throw m;w(1,0)}}function yv(s,a,l,u,d,f,h,y,_,m){var v=j();try{return Yl(s,a,l,u,d,f,h,y,_,m)}catch(I){if(S(v),I!==I+0)throw I;w(1,0)}}function _v(s,a,l,u,d,f,h){var y=j();try{pu(s,a,l,u,d,f,h)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function mv(s,a,l,u,d,f,h,y){var _=j();try{ru(s,a,l,u,d,f,h,y)}catch(m){if(S(_),m!==m+0)throw m;w(1,0)}}function bv(s,a,l,u,d,f,h,y){var _=j();try{return uu(s,a,l,u,d,f,h,y)}catch(m){if(S(_),m!==m+0)throw m;w(1,0)}}function vv(s,a,l,u,d,f,h,y,_){var m=j();try{return du(s,a,l,u,d,f,h,y,_)}catch(v){if(S(m),v!==v+0)throw v;w(1,0)}}function gv(s,a,l,u,d,f,h,y){var _=j();try{fu(s,a,l,u,d,f,h,y)}catch(m){if(S(_),m!==m+0)throw m;w(1,0)}}function wv(s,a,l,u,d,f){var h=j();try{return Zc(s,a,l,u,d,f)}catch(y){if(S(h),y!==y+0)throw y;w(1,0)}}function jv(s,a,l,u,d,f,h,y,_){var m=j();try{return Sc(s,a,l,u,d,f,h,y,_)}catch(v){if(S(m),v!==v+0)throw v;w(1,0)}}function Sv(s,a,l,u,d,f,h,y,_){var m=j();try{Jc(s,a,l,u,d,f,h,y,_)}catch(v){if(S(m),v!==v+0)throw v;w(1,0)}}function Iv(s,a,l,u,d,f,h){var y=j();try{Oc(s,a,l,u,d,f,h)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function Cv(s,a,l,u){var d=j();try{return vc(s,a,l,u)}catch(f){if(S(d),f!==f+0)throw f;w(1,0)}}function Av(s,a,l,u,d,f){var h=j();try{return Ic(s,a,l,u,d,f)}catch(y){if(S(h),y!==y+0)throw y;w(1,0)}}function xv(s,a,l,u,d,f,h,y,_){var m=j();try{kc(s,a,l,u,d,f,h,y,_)}catch(v){if(S(m),v!==v+0)throw v;w(1,0)}}function Fv(s,a,l,u,d,f){var h=j();try{return Cc(s,a,l,u,d,f)}catch(y){if(S(h),y!==y+0)throw y;w(1,0)}}function Bv(s,a,l,u,d,f,h,y,_,m,v){var I=j();try{Ec(s,a,l,u,d,f,h,y,_,m,v)}catch(x){if(S(I),x!==x+0)throw x;w(1,0)}}function Tv(s,a,l,u,d,f){var h=j();try{return Yc(s,a,l,u,d,f)}catch(y){if(S(h),y!==y+0)throw y;w(1,0)}}function Dv(s,a,l,u,d,f,h,y,_,m){var v=j();try{xc(s,a,l,u,d,f,h,y,_,m)}catch(I){if(S(v),I!==I+0)throw I;w(1,0)}}function Ev(s,a,l,u,d,f,h){var y=j();try{return Rc(s,a,l,u,d,f,h)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function kv(s,a,l,u,d,f){var h=j();try{gc(s,a,l,u,d,f)}catch(y){if(S(h),y!==y+0)throw y;w(1,0)}}function Ov(s,a,l,u,d,f,h){var y=j();try{wc(s,a,l,u,d,f,h)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function Mv(s,a,l,u,d,f,h,y,_,m,v){var I=j();try{return jc(s,a,l,u,d,f,h,y,_,m,v)}catch(x){if(S(I),x!==x+0)throw x;w(1,0)}}function Rv(s,a,l,u,d,f,h,y,_){var m=j();try{Mc(s,a,l,u,d,f,h,y,_)}catch(v){if(S(m),v!==v+0)throw v;w(1,0)}}function Uv(s,a,l,u,d,f,h,y,_,m,v,I,x,D,E){var st=j();try{return Ac(s,a,l,u,d,f,h,y,_,m,v,I,x,D,E)}catch(yt){if(S(st),yt!==yt+0)throw yt;w(1,0)}}function Nv(s,a,l,u,d,f,h,y,_){var m=j();try{return Fc(s,a,l,u,d,f,h,y,_)}catch(v){if(S(m),v!==v+0)throw v;w(1,0)}}function Lv(s,a,l,u,d,f,h,y){var _=j();try{return Tc(s,a,l,u,d,f,h,y)}catch(m){if(S(_),m!==m+0)throw m;w(1,0)}}function Pv(s,a,l,u,d,f){var h=j();try{Dc(s,a,l,u,d,f)}catch(y){if(S(h),y!==y+0)throw y;w(1,0)}}function Vv(s,a,l,u,d,f,h,y,_){var m=j();try{Uc(s,a,l,u,d,f,h,y,_)}catch(v){if(S(m),v!==v+0)throw v;w(1,0)}}function Hv(s,a,l,u,d,f,h){var y=j();try{return Vc(s,a,l,u,d,f,h)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function zv(s,a,l,u,d,f,h,y,_,m){var v=j();try{zc(s,a,l,u,d,f,h,y,_,m)}catch(I){if(S(v),I!==I+0)throw I;w(1,0)}}function Wv(s,a,l,u,d,f,h,y,_,m){var v=j();try{Wc(s,a,l,u,d,f,h,y,_,m)}catch(I){if(S(v),I!==I+0)throw I;w(1,0)}}function $v(s,a,l,u,d,f,h){var y=j();try{return Hc(s,a,l,u,d,f,h)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function Yv(s,a,l,u,d,f,h,y,_,m){var v=j();try{$c(s,a,l,u,d,f,h,y,_,m)}catch(I){if(S(v),I!==I+0)throw I;w(1,0)}}function Xv(s,a,l,u,d,f,h,y,_){var m=j();try{return Pc(s,a,l,u,d,f,h,y,_)}catch(v){if(S(m),v!==v+0)throw v;w(1,0)}}function Gv(s,a,l,u,d,f,h,y,_){var m=j();try{Gc(s,a,l,u,d,f,h,y,_)}catch(v){if(S(m),v!==v+0)throw v;w(1,0)}}function Kv(s,a,l,u,d,f,h,y,_){var m=j();try{Lc(s,a,l,u,d,f,h,y,_)}catch(v){if(S(m),v!==v+0)throw v;w(1,0)}}function Jv(s,a,l,u,d,f,h,y){var _=j();try{return bu(s,a,l,u,d,f,h,y)}catch(m){if(S(_),m!==m+0)throw m;w(1,0)}}function qv(s,a,l,u,d,f,h,y,_){var m=j();try{return yu(s,a,l,u,d,f,h,y,_)}catch(v){if(S(m),v!==v+0)throw v;w(1,0)}}function Zv(s,a,l,u,d,f,h,y,_,m){var v=j();try{return _u(s,a,l,u,d,f,h,y,_,m)}catch(I){if(S(v),I!==I+0)throw I;w(1,0)}}function Qv(s,a,l,u,d,f,h,y,_){var m=j();try{ou(s,a,l,u,d,f,h,y,_)}catch(v){if(S(m),v!==v+0)throw v;w(1,0)}}function tg(s,a,l,u,d,f,h,y){var _=j();try{su(s,a,l,u,d,f,h,y)}catch(m){if(S(_),m!==m+0)throw m;w(1,0)}}function eg(s,a,l,u,d,f,h,y,_){var m=j();try{tu(s,a,l,u,d,f,h,y,_)}catch(v){if(S(m),v!==v+0)throw v;w(1,0)}}function ig(s,a,l,u,d,f,h,y,_,m){var v=j();try{eu(s,a,l,u,d,f,h,y,_,m)}catch(I){if(S(v),I!==I+0)throw I;w(1,0)}}function rg(s,a,l,u){var d=j();try{return iu(s,a,l,u)}catch(f){if(S(d),f!==f+0)throw f;w(1,0)}}function ng(s,a,l,u,d,f,h,y,_,m,v){var I=j();try{return nu(s,a,l,u,d,f,h,y,_,m,v)}catch(x){if(S(I),x!==x+0)throw x;w(1,0)}}function sg(s,a,l,u,d,f,h,y,_,m,v,I){var x=j();try{au(s,a,l,u,d,f,h,y,_,m,v,I)}catch(D){if(S(x),D!==D+0)throw D;w(1,0)}}function og(s,a,l,u,d,f,h,y,_,m,v){var I=j();try{lu(s,a,l,u,d,f,h,y,_,m,v)}catch(x){if(S(I),x!==x+0)throw x;w(1,0)}}function ag(s,a,l,u,d,f){var h=j();try{return cu(s,a,l,u,d,f)}catch(y){if(S(h),y!==y+0)throw y;w(1,0)}}function lg(s,a,l,u,d,f,h){var y=j();try{mu(s,a,l,u,d,f,h)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function cg(s,a,l,u,d,f,h,y,_){var m=j();try{vu(s,a,l,u,d,f,h,y,_)}catch(v){if(S(m),v!==v+0)throw v;w(1,0)}}function ug(s,a,l,u){var d=j();try{return bc(s,a,l,u)}catch(f){if(S(d),f!==f+0)throw f;w(1,0)}}function dg(s,a,l,u,d,f,h,y,_){var m=j();try{return gu(s,a,l,u,d,f,h,y,_)}catch(v){if(S(m),v!==v+0)throw v;w(1,0)}}function fg(s,a,l,u,d,f,h,y,_){var m=j();try{Cu(s,a,l,u,d,f,h,y,_)}catch(v){if(S(m),v!==v+0)throw v;w(1,0)}}function hg(s,a,l,u,d,f,h){var y=j();try{Au(s,a,l,u,d,f,h)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function pg(s,a,l,u,d,f,h,y,_,m){var v=j();try{xu(s,a,l,u,d,f,h,y,_,m)}catch(I){if(S(v),I!==I+0)throw I;w(1,0)}}function yg(s,a,l,u,d,f,h){var y=j();try{return Fu(s,a,l,u,d,f,h)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function _g(s,a,l,u,d,f,h,y,_,m,v){var I=j();try{Iu(s,a,l,u,d,f,h,y,_,m,v)}catch(x){if(S(I),x!==x+0)throw x;w(1,0)}}function mg(s,a,l,u,d,f,h,y){var _=j();try{return Nu(s,a,l,u,d,f,h,y)}catch(m){if(S(_),m!==m+0)throw m;w(1,0)}}function bg(s,a,l,u,d,f,h,y,_,m,v){var I=j();try{Du(s,a,l,u,d,f,h,y,_,m,v)}catch(x){if(S(I),x!==x+0)throw x;w(1,0)}}function vg(s,a,l,u,d,f,h,y,_,m,v,I,x){var D=j();try{Eu(s,a,l,u,d,f,h,y,_,m,v,I,x)}catch(E){if(S(D),E!==E+0)throw E;w(1,0)}}function gg(s,a,l,u,d,f,h,y,_,m,v,I,x){var D=j();try{Ou(s,a,l,u,d,f,h,y,_,m,v,I,x)}catch(E){if(S(D),E!==E+0)throw E;w(1,0)}}function wg(s,a,l,u,d,f,h,y){var _=j();try{return Tu(s,a,l,u,d,f,h,y)}catch(m){if(S(_),m!==m+0)throw m;w(1,0)}}function jg(s,a,l,u,d,f,h,y){var _=j();try{return Bu(s,a,l,u,d,f,h,y)}catch(m){if(S(_),m!==m+0)throw m;w(1,0)}}function Sg(s,a,l,u,d,f,h,y,_,m,v){var I=j();try{Mu(s,a,l,u,d,f,h,y,_,m,v)}catch(x){if(S(I),x!==x+0)throw x;w(1,0)}}function Ig(s,a,l,u,d,f,h,y,_,m,v,I,x,D,E,st){var yt=j();try{Ru(s,a,l,u,d,f,h,y,_,m,v,I,x,D,E,st)}catch(kt){if(S(yt),kt!==kt+0)throw kt;w(1,0)}}function Cg(s,a,l,u,d,f,h,y,_,m,v,I,x,D,E,st,yt,kt){var B=j();try{Uu(s,a,l,u,d,f,h,y,_,m,v,I,x,D,E,st,yt,kt)}catch(L){if(S(B),L!==L+0)throw L;w(1,0)}}function Ag(s,a,l,u,d,f,h,y,_,m,v,I){var x=j();try{ku(s,a,l,u,d,f,h,y,_,m,v,I)}catch(D){if(S(x),D!==D+0)throw D;w(1,0)}}function xg(s,a,l,u,d,f,h,y,_,m,v,I,x,D,E,st,yt){var kt=j();try{Lu(s,a,l,u,d,f,h,y,_,m,v,I,x,D,E,st,yt)}catch(B){if(S(kt),B!==B+0)throw B;w(1,0)}}function Fg(s,a){var l=j();try{return Pu(s,a)}catch(u){if(S(l),u!==u+0)throw u;w(1,0)}}function Bg(s,a){var l=j();try{return Vu(s,a)}catch(u){if(S(l),u!==u+0)throw u;w(1,0)}}function Tg(s,a,l,u,d,f,h,y,_,m,v){var I=j();try{return Pd(s,a,l,u,d,f,h,y,_,m,v)}catch(x){if(S(I),x!==x+0)throw x;w(1,0)}}function Dg(s,a,l,u,d,f,h,y,_){var m=j();try{return Vd(s,a,l,u,d,f,h,y,_)}catch(v){if(S(m),v!==v+0)throw v;w(1,0)}}function Eg(s,a,l,u,d,f,h,y){var _=j();try{dd(s,a,l,u,d,f,h,y)}catch(m){if(S(_),m!==m+0)throw m;w(1,0)}}function kg(s,a,l,u,d,f,h){var y=j();try{return Hd(s,a,l,u,d,f,h)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function Og(s,a,l,u,d,f,h,y,_,m,v){var I=j();try{return zd(s,a,l,u,d,f,h,y,_,m,v)}catch(x){if(S(I),x!==x+0)throw x;w(1,0)}}function Mg(s,a,l,u,d,f,h,y,_,m){var v=j();try{return yd(s,a,l,u,d,f,h,y,_,m)}catch(I){if(S(v),I!==I+0)throw I;w(1,0)}}function Rg(s,a,l,u,d,f,h,y){var _=j();try{Wu(s,a,l,u,d,f,h,y)}catch(m){if(S(_),m!==m+0)throw m;w(1,0)}}function Ug(s,a,l,u,d,f,h,y,_){var m=j();try{$u(s,a,l,u,d,f,h,y,_)}catch(v){if(S(m),v!==v+0)throw v;w(1,0)}}function Ng(s,a,l,u,d,f,h){var y=j();try{return Ku(s,a,l,u,d,f,h)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function Lg(s,a,l,u,d,f,h){var y=j();try{return Ju(s,a,l,u,d,f,h)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function Pg(s,a,l,u,d,f){var h=j();try{return qu(s,a,l,u,d,f)}catch(y){if(S(h),y!==y+0)throw y;w(1,0)}}function Vg(s,a,l,u,d,f,h,y){var _=j();try{return Zu(s,a,l,u,d,f,h,y)}catch(m){if(S(_),m!==m+0)throw m;w(1,0)}}function Hg(s,a,l,u,d,f,h,y){var _=j();try{return rf(s,a,l,u,d,f,h,y)}catch(m){if(S(_),m!==m+0)throw m;w(1,0)}}function zg(s,a,l){var u=j();try{return Xu(s,a,l)}catch(d){if(S(u),d!==d+0)throw d;w(1,0)}}function Wg(s,a,l,u,d,f,h){var y=j();try{id(s,a,l,u,d,f,h)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function $g(s,a,l,u,d,f,h,y,_,m,v,I){var x=j();try{rd(s,a,l,u,d,f,h,y,_,m,v,I)}catch(D){if(S(x),D!==D+0)throw D;w(1,0)}}function Yg(s,a,l,u,d){var f=j();try{return ed(s,a,l,u,d)}catch(h){if(S(f),h!==h+0)throw h;w(1,0)}}function Xg(s,a,l,u,d){var f=j();try{Qu(s,a,l,u,d)}catch(h){if(S(f),h!==h+0)throw h;w(1,0)}}function Gg(s,a,l,u,d,f,h,y,_,m,v){var I=j();try{nd(s,a,l,u,d,f,h,y,_,m,v)}catch(x){if(S(I),x!==x+0)throw x;w(1,0)}}function Kg(s,a,l,u,d,f,h,y,_,m,v,I,x,D,E){var st=j();try{Yu(s,a,l,u,d,f,h,y,_,m,v,I,x,D,E)}catch(yt){if(S(st),yt!==yt+0)throw yt;w(1,0)}}function Jg(s,a,l,u,d){var f=j();try{return Gu(s,a,l,u,d)}catch(h){if(S(f),h!==h+0)throw h;w(1,0)}}function qg(s,a,l,u,d,f,h,y,_,m,v,I){var x=j();try{return td(s,a,l,u,d,f,h,y,_,m,v,I)}catch(D){if(S(x),D!==D+0)throw D;w(1,0)}}function Zg(s,a,l,u,d,f,h,y,_){var m=j();try{sd(s,a,l,u,d,f,h,y,_)}catch(v){if(S(m),v!==v+0)throw v;w(1,0)}}function Qg(s,a,l,u,d,f,h,y,_){var m=j();try{od(s,a,l,u,d,f,h,y,_)}catch(v){if(S(m),v!==v+0)throw v;w(1,0)}}function t0(s,a,l,u,d,f,h,y,_,m,v){var I=j();try{ad(s,a,l,u,d,f,h,y,_,m,v)}catch(x){if(S(I),x!==x+0)throw x;w(1,0)}}function e0(s,a,l,u,d,f,h,y){var _=j();try{return ld(s,a,l,u,d,f,h,y)}catch(m){if(S(_),m!==m+0)throw m;w(1,0)}}function i0(s,a,l,u,d,f,h){var y=j();try{return cd(s,a,l,u,d,f,h)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function r0(s,a,l,u){var d=j();try{return ud(s,a,l,u)}catch(f){if(S(d),f!==f+0)throw f;w(1,0)}}function n0(s,a,l,u,d,f,h,y){var _=j();try{return fd(s,a,l,u,d,f,h,y)}catch(m){if(S(_),m!==m+0)throw m;w(1,0)}}function s0(s,a,l,u,d,f,h,y){var _=j();try{return hd(s,a,l,u,d,f,h,y)}catch(m){if(S(_),m!==m+0)throw m;w(1,0)}}function o0(s,a,l,u,d,f,h,y,_,m,v,I,x){var D=j();try{return pd(s,a,l,u,d,f,h,y,_,m,v,I,x)}catch(E){if(S(D),E!==E+0)throw E;w(1,0)}}function a0(s,a,l,u,d,f,h,y,_,m){var v=j();try{return _d(s,a,l,u,d,f,h,y,_,m)}catch(I){if(S(v),I!==I+0)throw I;w(1,0)}}function l0(s,a,l,u,d,f,h,y,_,m,v){var I=j();try{md(s,a,l,u,d,f,h,y,_,m,v)}catch(x){if(S(I),x!==x+0)throw x;w(1,0)}}function c0(s,a,l,u,d,f,h,y){var _=j();try{return bd(s,a,l,u,d,f,h,y)}catch(m){if(S(_),m!==m+0)throw m;w(1,0)}}function u0(s,a,l,u,d,f,h,y,_,m){var v=j();try{return vd(s,a,l,u,d,f,h,y,_,m)}catch(I){if(S(v),I!==I+0)throw I;w(1,0)}}function d0(s,a,l,u,d,f,h,y){var _=j();try{return gd(s,a,l,u,d,f,h,y)}catch(m){if(S(_),m!==m+0)throw m;w(1,0)}}function f0(s,a,l,u,d,f,h,y,_){var m=j();try{return Ed(s,a,l,u,d,f,h,y,_)}catch(v){if(S(m),v!==v+0)throw v;w(1,0)}}function h0(s,a,l,u,d,f,h,y,_,m,v,I,x,D){var E=j();try{return kd(s,a,l,u,d,f,h,y,_,m,v,I,x,D)}catch(st){if(S(E),st!==st+0)throw st;w(1,0)}}function p0(s,a,l,u,d){var f=j();try{return Id(s,a,l,u,d)}catch(h){if(S(f),h!==h+0)throw h;w(1,0)}}function y0(s,a,l,u,d,f,h){var y=j();try{return wd(s,a,l,u,d,f,h)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function _0(s,a,l,u,d,f,h){var y=j();try{return jd(s,a,l,u,d,f,h)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function m0(s,a,l,u,d,f,h,y,_,m,v){var I=j();try{return Sd(s,a,l,u,d,f,h,y,_,m,v)}catch(x){if(S(I),x!==x+0)throw x;w(1,0)}}function b0(s,a,l,u,d,f,h,y,_,m){var v=j();try{return Cd(s,a,l,u,d,f,h,y,_,m)}catch(I){if(S(v),I!==I+0)throw I;w(1,0)}}function v0(s,a,l,u,d,f,h,y,_,m){var v=j();try{return Ad(s,a,l,u,d,f,h,y,_,m)}catch(I){if(S(v),I!==I+0)throw I;w(1,0)}}function g0(s,a,l,u,d,f,h,y,_,m){var v=j();try{xd(s,a,l,u,d,f,h,y,_,m)}catch(I){if(S(v),I!==I+0)throw I;w(1,0)}}function w0(s,a,l,u,d,f,h,y,_,m){var v=j();try{Fd(s,a,l,u,d,f,h,y,_,m)}catch(I){if(S(v),I!==I+0)throw I;w(1,0)}}function j0(s,a,l,u,d,f,h,y,_,m,v){var I=j();try{Bd(s,a,l,u,d,f,h,y,_,m,v)}catch(x){if(S(I),x!==x+0)throw x;w(1,0)}}function S0(s,a,l,u,d,f,h,y,_,m,v){var I=j();try{Td(s,a,l,u,d,f,h,y,_,m,v)}catch(x){if(S(I),x!==x+0)throw x;w(1,0)}}function I0(s,a,l,u,d,f){var h=j();try{return Dd(s,a,l,u,d,f)}catch(y){if(S(h),y!==y+0)throw y;w(1,0)}}function C0(s,a,l,u,d,f,h,y,_,m,v,I){var x=j();try{return Od(s,a,l,u,d,f,h,y,_,m,v,I)}catch(D){if(S(x),D!==D+0)throw D;w(1,0)}}function A0(s,a,l,u,d,f,h,y,_,m,v){var I=j();try{return Md(s,a,l,u,d,f,h,y,_,m,v)}catch(x){if(S(I),x!==x+0)throw x;w(1,0)}}function x0(s,a,l,u,d,f,h,y,_,m){var v=j();try{return Rd(s,a,l,u,d,f,h,y,_,m)}catch(I){if(S(v),I!==I+0)throw I;w(1,0)}}function F0(s,a,l,u,d,f,h,y,_,m){var v=j();try{return Ud(s,a,l,u,d,f,h,y,_,m)}catch(I){if(S(v),I!==I+0)throw I;w(1,0)}}function B0(s,a,l,u,d,f,h,y,_){var m=j();try{return Nd(s,a,l,u,d,f,h,y,_)}catch(v){if(S(m),v!==v+0)throw v;w(1,0)}}function T0(s,a,l,u,d,f,h,y,_,m){var v=j();try{return Ld(s,a,l,u,d,f,h,y,_,m)}catch(I){if(S(v),I!==I+0)throw I;w(1,0)}}function D0(s,a,l,u,d,f,h,y,_){var m=j();try{return Wd(s,a,l,u,d,f,h,y,_)}catch(v){if(S(m),v!==v+0)throw v;w(1,0)}}function E0(s,a,l,u,d,f,h,y,_,m,v,I){var x=j();try{return $d(s,a,l,u,d,f,h,y,_,m,v,I)}catch(D){if(S(x),D!==D+0)throw D;w(1,0)}}function k0(s,a,l,u,d,f,h,y,_){var m=j();try{return Yd(s,a,l,u,d,f,h,y,_)}catch(v){if(S(m),v!==v+0)throw v;w(1,0)}}function O0(s,a,l,u,d,f,h,y,_,m,v,I,x){var D=j();try{Xd(s,a,l,u,d,f,h,y,_,m,v,I,x)}catch(E){if(S(D),E!==E+0)throw E;w(1,0)}}function M0(s,a,l,u,d,f,h,y,_){var m=j();try{Xc(s,a,l,u,d,f,h,y,_)}catch(v){if(S(m),v!==v+0)throw v;w(1,0)}}function R0(s,a,l,u,d,f,h,y,_){var m=j();try{return Gd(s,a,l,u,d,f,h,y,_)}catch(v){if(S(m),v!==v+0)throw v;w(1,0)}}function U0(s,a,l,u,d,f,h,y){var _=j();try{return Kd(s,a,l,u,d,f,h,y)}catch(m){if(S(_),m!==m+0)throw m;w(1,0)}}function N0(s,a,l){var u=j();try{Jd(s,a,l)}catch(d){if(S(u),d!==d+0)throw d;w(1,0)}}function L0(s,a,l,u,d,f,h,y,_,m){var v=j();try{Kc(s,a,l,u,d,f,h,y,_,m)}catch(I){if(S(v),I!==I+0)throw I;w(1,0)}}function P0(s,a,l,u,d,f,h,y,_,m){var v=j();try{Zd(s,a,l,u,d,f,h,y,_,m)}catch(I){if(S(v),I!==I+0)throw I;w(1,0)}}function V0(s,a,l,u,d,f,h,y,_){var m=j();try{Qd(s,a,l,u,d,f,h,y,_)}catch(v){if(S(m),v!==v+0)throw v;w(1,0)}}function H0(s,a,l,u,d,f,h,y,_){var m=j();try{tf(s,a,l,u,d,f,h,y,_)}catch(v){if(S(m),v!==v+0)throw v;w(1,0)}}function z0(s,a,l,u,d,f,h,y){var _=j();try{ef(s,a,l,u,d,f,h,y)}catch(m){if(S(_),m!==m+0)throw m;w(1,0)}}function W0(s,a,l,u,d,f,h,y,_,m,v,I){var x=j();try{nf(s,a,l,u,d,f,h,y,_,m,v,I)}catch(D){if(S(x),D!==D+0)throw D;w(1,0)}}function $0(s,a,l,u,d,f,h,y,_,m){var v=j();try{of(s,a,l,u,d,f,h,y,_,m)}catch(I){if(S(v),I!==I+0)throw I;w(1,0)}}function Y0(s,a,l,u,d,f,h,y,_,m,v){var I=j();try{return lf(s,a,l,u,d,f,h,y,_,m,v)}catch(x){if(S(I),x!==x+0)throw x;w(1,0)}}function X0(s,a,l,u,d,f,h,y,_,m,v){var I=j();try{sf(s,a,l,u,d,f,h,y,_,m,v)}catch(x){if(S(I),x!==x+0)throw x;w(1,0)}}function G0(s,a,l,u,d,f,h,y,_,m,v,I,x){var D=j();try{af(s,a,l,u,d,f,h,y,_,m,v,I,x)}catch(E){if(S(D),E!==E+0)throw E;w(1,0)}}function K0(s,a,l,u,d,f,h,y,_,m,v,I,x){var D=j();try{cf(s,a,l,u,d,f,h,y,_,m,v,I,x)}catch(E){if(S(D),E!==E+0)throw E;w(1,0)}}function J0(s,a,l,u,d,f,h,y,_,m){var v=j();try{return uf(s,a,l,u,d,f,h,y,_,m)}catch(I){if(S(v),I!==I+0)throw I;w(1,0)}}function q0(s,a,l,u,d,f,h,y,_,m,v,I,x){var D=j();try{df(s,a,l,u,d,f,h,y,_,m,v,I,x)}catch(E){if(S(D),E!==E+0)throw E;w(1,0)}}function Z0(s,a,l,u,d,f,h,y,_,m){var v=j();try{ff(s,a,l,u,d,f,h,y,_,m)}catch(I){if(S(v),I!==I+0)throw I;w(1,0)}}function Q0(s,a,l,u,d,f,h,y,_){var m=j();try{hf(s,a,l,u,d,f,h,y,_)}catch(v){if(S(m),v!==v+0)throw v;w(1,0)}}function tw(s,a,l,u,d,f,h,y,_){var m=j();try{Sf(s,a,l,u,d,f,h,y,_)}catch(v){if(S(m),v!==v+0)throw v;w(1,0)}}function ew(s,a,l,u,d,f,h,y,_,m,v,I,x,D){var E=j();try{yf(s,a,l,u,d,f,h,y,_,m,v,I,x,D)}catch(st){if(S(E),st!==st+0)throw st;w(1,0)}}function iw(s,a,l,u,d,f,h,y,_,m,v){var I=j();try{_f(s,a,l,u,d,f,h,y,_,m,v)}catch(x){if(S(I),x!==x+0)throw x;w(1,0)}}function rw(s,a,l,u,d,f,h,y,_,m){var v=j();try{pf(s,a,l,u,d,f,h,y,_,m)}catch(I){if(S(v),I!==I+0)throw I;w(1,0)}}function nw(s,a,l,u,d,f,h,y,_,m,v){var I=j();try{return mf(s,a,l,u,d,f,h,y,_,m,v)}catch(x){if(S(I),x!==x+0)throw x;w(1,0)}}function sw(s,a,l,u,d,f,h,y,_,m,v){var I=j();try{return wf(s,a,l,u,d,f,h,y,_,m,v)}catch(x){if(S(I),x!==x+0)throw x;w(1,0)}}function ow(s,a,l,u,d,f,h,y,_,m){var v=j();try{gf(s,a,l,u,d,f,h,y,_,m)}catch(I){if(S(v),I!==I+0)throw I;w(1,0)}}function aw(s,a,l,u,d,f,h,y){var _=j();try{return vf(s,a,l,u,d,f,h,y)}catch(m){if(S(_),m!==m+0)throw m;w(1,0)}}function lw(s,a,l,u,d,f,h,y,_,m,v){var I=j();try{return bf(s,a,l,u,d,f,h,y,_,m,v)}catch(x){if(S(I),x!==x+0)throw x;w(1,0)}}function cw(s,a,l,u,d,f,h,y,_,m,v,I){var x=j();try{return jf(s,a,l,u,d,f,h,y,_,m,v,I)}catch(D){if(S(x),D!==D+0)throw D;w(1,0)}}e.ccall=$p;var ps;function ys(s){this.name="ExitStatus",this.message="Program terminated with exit("+s+")",this.status=s}var uw=!1;dn=function s(){ps||fa(),ps||(dn=s)};function dw(s){var a=e._main,l=0,u=0;try{var d=a(l,u);return fw(d,!0),d}catch(f){return dy(f)}finally{uw=!0}}function fa(s){if(s=s||c,fr>0||(Qp(),fr>0))return;function a(){ps||(ps=!0,e.calledRun=!0,!Ht&&(ty(),ey(),r(e),e.onRuntimeInitialized&&e.onRuntimeInitialized(),If&&dw(s),iy()))}e.setStatus?(e.setStatus("Running..."),setTimeout(function(){setTimeout(function(){e.setStatus("")},1),a()},1)):a()}e.run=fa;function fw(s,a){pt=s,hw(s)}function hw(s){pt=s,Fl()||(e.onExit&&e.onExit(s),Ht=!0),b(s,new ys(s))}if(e.preInit)for(typeof e.preInit=="function"&&(e.preInit=[e.preInit]);e.preInit.length>0;)e.preInit.pop()();var If=!0;return e.noInitialRun&&(If=!1),fa(),t.ready}})(),Rp=rI;var Ko=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=Rt.from(e);return console.assert(r.isSync()),console.assert(r.isFile()),new Et(r)}async send(t){let e=this._bindings.startPendingQuery(this._conn,t);for(;e==null;)e=await new Promise((o,c)=>{try{o(this._bindings.pollPendingQuery(this._conn))}catch(p){c(p)}});let r=new Jo(this._bindings,this._conn,e),n=Rt.from(r);return console.assert(n.isSync()),console.assert(n.isStream()),n}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 fl(this._bindings,this._conn,e)}createScalarFunction(t,e,r){this._bindings.createScalarFunction(this._conn,t,e,r)}insertArrowTable(t,e){let r=Yo(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)}},Jo=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=this.bindings.fetchQueryResults(this.conn);return this._depleted=t.length==0,{done:this._depleted,value:t}}[Symbol.iterator](){return this}},fl=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=Rt.from(e);return console.assert(r.isSync()),console.assert(r.isFile()),new Et(r)}send(...t){let e=this.bindings.sendPrepared(this.connectionId,this.statementId,t),r=new Jo(this.bindings,this.connectionId,e),n=Rt.from(r);return console.assert(n.isSync()),console.assert(n.isStream()),n}};var Lp=new TextEncoder,Up=new TextDecoder("utf-8");function hl(i,t,e){let r=Lp.encode(e),n=i._malloc(r.byteLength),o=i.HEAPU8.subarray(n,n+r.byteLength);o.set(r),i.HEAPF64[(t>>3)+0]=1,i.HEAPF64[(t>>3)+1]=n,i.HEAPF64[(t>>3)+2]=o.byteLength}function yl(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 pl(i,t,e,r){let n=i.HEAPU8.subarray(t,t+r*yl(e));switch(e){case"UINT8":return new Uint8Array(n.buffer,n.byteOffset,r);case"INT8":return new Int8Array(n.buffer,n.byteOffset,r);case"INT32":return new Int32Array(n.buffer,n.byteOffset,r);case"FLOAT":return new Float32Array(n.buffer,n.byteOffset,r);case"DOUBLE":return new Float64Array(n.buffer,n.byteOffset,r);case"VARCHAR":return new Float64Array(n.buffer,n.byteOffset,r);default:return new Array(0)}}function Np(i,t,e){let r=i.HEAPU8.subarray(t,t+e);return new Uint8Array(r.buffer,r.byteOffset,e)}function qo(i,t,e){let r=i.HEAPU8.subarray(t,t+e*8);return new Float64Array(r.buffer,r.byteOffset,e)}function Pp(i,t,e,r,n,o,c,p){try{let b=i._udfFunctions.get(r);if(!b){hl(t,e,"Unknown UDF with id: "+r);return}let g=Up.decode(t.HEAPU8.subarray(n,n+o)),A=JSON.parse(g),T=qo(t,c,p/8),F=R=>{var Jt;let le=null;switch(R.validityBuffer!==void 0&&(le=Np(t,T[R.validityBuffer],A.rows)),R.physicalType){case"VARCHAR":{if(R.dataBuffer===null||R.dataBuffer===void 0)throw new Error("malformed data view, expected data buffer for VARCHAR argument");if(R.lengthBuffer===null||R.lengthBuffer===void 0)throw new Error("malformed data view, expected data length buffer for VARCHAR argument");let pe=pl(t,T[R.dataBuffer],R.physicalType,A.rows),Vt=[],Ht=qo(t,T[R.lengthBuffer],A.rows);for(let pt=0;pt<A.rows;++pt){if(le!=null&&!le[pt]){Vt.push(null);continue}let ye=t.HEAPU8.subarray(pe[pt],pe[pt]+Ht[pt]),kr=Up.decode(ye);Vt.push(kr)}return pt=>Vt[pt]}case"STRUCT":{let pe={},Vt=[];for(let Ht=0;Ht<(((Jt=R.children)==null?void 0:Jt.length)||0);++Ht){let pt=R.children[Ht],ye=F(pt);Vt.push(kr=>{pe[pt.name]=ye(kr)})}return le!=null?Ht=>{if(!le[Ht])return null;for(let pt of Vt)pt(Ht);return pe}:Ht=>{for(let pt of Vt)pt(Ht);return pe}}default:{if(R.dataBuffer===void 0)throw new Error("malformed data view, expected data buffer for argument of type: "+R.physicalType);let pe=pl(t,T[R.dataBuffer],R.physicalType,A.rows);return le!=null?Vt=>le[Vt]?pe[Vt]:null:Vt=>pe[Vt]}}},k=[];for(let R=0;R<A.args.length;++R)k.push(F(A.args[R]));let lt=A.rows*yl(A.ret.physicalType),ct=t._malloc(lt),mt=pl(t,ct,A.ret.physicalType,A.rows),Dt=t._malloc(A.rows),ae=Np(t,Dt,A.rows);if(mt.length==0||ae.length==0){hl(t,e,"Can't create physical arrays for result");return}let he=mt;A.ret.physicalType=="VARCHAR"&&(he=new Array(A.rows));let Yi=[];for(let R=0;R<A.args.length;++R)Yi.push(null);for(let R=0;R<A.rows;++R){for(let Jt=0;Jt<A.args.length;++Jt)Yi[Jt]=k[Jt](R);let le=b.func(...Yi);he[R]=le,ae[R]=le==null?0:1}let dr=0;switch(A.ret.physicalType){case"VARCHAR":{let R=new Array(0);dr=t._malloc(A.rows*yl("DOUBLE"));let le=qo(t,dr,A.rows),Jt=0;for(let pt=0;pt<A.rows;++pt){let ye=Lp.encode(he[pt]||"");R.push(ye),le[pt]=ye.length,Jt+=ye.length}let pe=t._malloc(Jt),Vt=t.HEAPU8.subarray(pe,pe+Jt),Ht=0;for(let pt=0;pt<A.rows;++pt){mt[pt]=Ht;let ye=R[pt];Vt.subarray(Ht,Ht+ye.length).set(ye),Ht+=ye.length}}}let ia=3*8,Oe=t._malloc(ia),Er=qo(t,Oe,3);Er[0]=ct,Er[1]=Dt,Er[2]=dr,t.HEAPF64[(e>>3)+0]=0,t.HEAPF64[(e>>3)+1]=Oe,t.HEAPF64[(e>>3)+2]=0}catch(b){hl(t,e,b.toString())}}function sI(){let i=new TextDecoder;return t=>(typeof SharedArrayBuffer<"u"&&t.buffer instanceof SharedArrayBuffer&&(t=new Uint8Array(t)),i.decode(t))}var oI=sI();function Ii(i,t){i.ccall("duckdb_web_fail_with",null,["string"],[t])}function Dr(i,t,e){let r=i.HEAPU8.subarray(t,t+e),n=new Uint8Array(new ArrayBuffer(r.byteLength));return n.set(r),n}function tt(i,t,e){return oI(i.HEAPU8.subarray(t,t+e))}function ht(i,t,e,r){let n=i.stackSave(),o=i.stackAlloc(3*8);e.unshift("number"),r.unshift(o),i.ccall(t,null,e,r);let c=i.HEAPF64[(o>>3)+0],p=i.HEAPF64[(o>>3)+1],b=i.HEAPF64[(o>>3)+2];return i.stackRestore(n),[c,p,b]}function St(i){i.ccall("duckdb_web_clear_response",null,[],[])}var Zo=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 aI=new TextEncoder;var Qo=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),this)}open(t){let[e,r,n]=ht(this.mod,"duckdb_web_open",["string"],[JSON.stringify(t)]);if(e!==0)throw new Error(tt(this.mod,r,n));St(this.mod)}reset(){let[t,e,r]=ht(this.mod,"duckdb_web_reset",[],[]);if(t!==0)throw new Error(tt(this.mod,e,r));St(this.mod)}getVersion(){let[t,e,r]=ht(this.mod,"duckdb_web_get_version",[],[]);if(t!==0)throw new Error(tt(this.mod,e,r));let n=tt(this.mod,e,r);return St(this.mod),n}getFeatureFlags(){return this.mod.ccall("duckdb_web_get_feature_flags","number",[],[])}tokenize(t){let[e,r,n]=ht(this.mod,"duckdb_web_tokenize",["string"],[t]);if(e!==0)throw new Error(tt(this.mod,r,n));let o=tt(this.mod,r,n);return St(this.mod),JSON.parse(o)}connect(){let t=this.mod.ccall("duckdb_web_connect","number",[],[]);return new Ko(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,n,o]=ht(this.mod,"duckdb_web_query_run",["number","string"],[t,e]);if(r!==0)throw new Error(tt(this.mod,n,o));let c=Dr(this.mod,n,o);return St(this.mod),c}startPendingQuery(t,e){let[r,n,o]=ht(this.mod,"duckdb_web_pending_query_start",["number","string"],[t,e]);if(r!==0)throw new Error(tt(this.mod,n,o));if(n==0)return null;let c=Dr(this.mod,n,o);return St(this.mod),c}pollPendingQuery(t){let[e,r,n]=ht(this.mod,"duckdb_web_pending_query_poll",["number"],[t]);if(e!==0)throw new Error(tt(this.mod,r,n));if(r==0)return null;let o=Dr(this.mod,r,n);return St(this.mod),o}cancelPendingQuery(t){return this.mod.ccall("duckdb_web_pending_query_cancel","boolean",["number"],[t])}fetchQueryResults(t){let[e,r,n]=ht(this.mod,"duckdb_web_query_fetch_results",["number"],[t]);if(e!==0)throw new Error(tt(this.mod,r,n));let o=Dr(this.mod,r,n);return St(this.mod),o}getTableNames(t,e){let[r,n,o]=ht(this.mod,"duckdb_web_get_tablenames",["number","string"],[t,e]);if(r!==0)throw new Error(tt(this.mod,n,o));let c=tt(this.mod,n,o);return St(this.mod),JSON.parse(c)}createScalarFunction(t,e,r,n){let o={functionId:this._nextUDFId,name:e,returnType:cn(r)},c={functionId:o.functionId,connectionId:t,name:e,returnType:r,func:n};this._nextUDFId+=1;let[p,b,g]=ht(this.mod,"duckdb_web_udf_scalar_create",["number","string"],[t,JSON.stringify(o)]);if(p!==0)throw new Error(tt(this.mod,b,g));if(St(this.mod),globalThis.DUCKDB_RUNTIME._udfFunctions=(globalThis.DUCKDB_RUNTIME._udfFunctions||new Map).set(c.functionId,c),this.pthread)for(let A of[...this.pthread.runningWorkers,...this.pthread.unusedWorkers])A.postMessage({cmd:"registerUDFFunction",udf:c})}createPrepared(t,e){let[r,n,o]=ht(this.mod,"duckdb_web_prepared_create",["number","string"],[t,e]);if(r!==0)throw new Error(tt(this.mod,n,o));return St(this.mod),n}closePrepared(t,e){let[r,n,o]=ht(this.mod,"duckdb_web_prepared_close",["number","number"],[t,e]);if(r!==0)throw new Error(tt(this.mod,n,o));St(this.mod)}runPrepared(t,e,r){let[n,o,c]=ht(this.mod,"duckdb_web_prepared_run",["number","number","string"],[t,e,JSON.stringify(r)]);if(n!==0)throw new Error(tt(this.mod,o,c));let p=Dr(this.mod,o,c);return St(this.mod),p}sendPrepared(t,e,r){let[n,o,c]=ht(this.mod,"duckdb_web_prepared_send",["number","number","string"],[t,e,JSON.stringify(r)]);if(n!==0)throw new Error(tt(this.mod,o,c));let p=Dr(this.mod,o,c);return St(this.mod),p}insertArrowFromIPCStream(t,e,r){if(e.length==0)return;let n=this.mod._malloc(e.length);this.mod.HEAPU8.subarray(n,n+e.length).set(e);let c=r?JSON.stringify(r):"",[p,b,g]=ht(this.mod,"duckdb_web_insert_arrow_from_ipc_stream",["number","number","number","string"],[t,n,e.length,c]);if(p!==0)throw new Error(tt(this.mod,b,g))}insertCSVFromPath(t,e,r){if(r.columns!==void 0){r.columnsFlat=[];for(let g in r.columns)r.columnsFlat.push(Xo(g,r.columns[g]))}let n={...r};n.columns=n.columnsFlat,delete n.columnsFlat;let o=JSON.stringify(n),[c,p,b]=ht(this.mod,"duckdb_web_insert_csv_from_path",["number","string","string"],[t,e,o]);if(c!==0)throw new Error(tt(this.mod,p,b))}insertJSONFromPath(t,e,r){if(r.columns!==void 0){r.columnsFlat=[];for(let g in r.columns)r.columnsFlat.push(Xo(g,r.columns[g]))}let n={...r};n.columns=n.columnsFlat,delete n.columnsFlat;let o=JSON.stringify(n),[c,p,b]=ht(this.mod,"duckdb_web_insert_json_from_path",["number","string","string"],[t,e,o]);if(c!==0)throw new Error(tt(this.mod,p,b))}globFiles(t){let[e,r,n]=ht(this.mod,"duckdb_web_fs_glob_file_infos",["string"],[t]);if(e!==0)throw new Error(tt(this.mod,r,n));let o=tt(this.mod,r,n);St(this.mod);let c=JSON.parse(o);return c==null?[]:c}registerFileURL(t,e){e===void 0&&(e=t);let[r,n,o]=ht(this.mod,"duckdb_web_fs_register_file_url",["string","string","number"],[t,e,-1]);if(r!==0)throw new Error(tt(this.mod,n,o));St(this.mod)}registerFileText(t,e){let r=aI.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[o,c,p]=ht(this.mod,"duckdb_web_fs_register_file_buffer",["string","number","number"],[t,r,e.length]);if(o!==0)throw new Error(tt(this.mod,c,p));St(this.mod)}registerFileHandle(t,e){let[r,n,o]=ht(this.mod,"duckdb_web_fs_register_file_url",["string","string","number"],[t,t,-1]);if(r!==0)throw new Error(tt(this.mod,n,o));if(St(this.mod),globalThis.DUCKDB_RUNTIME._files=(globalThis.DUCKDB_RUNTIME._files||new Map).set(t,e),this.pthread){for(let c of this.pthread.runningWorkers)c.postMessage({cmd:"registerFileHandle",fileName:t,fileHandle:e});for(let c of this.pthread.unusedWorkers)c.postMessage({cmd:"dropFileHandle",fileName:t})}}dropFile(t){let[e,r,n]=ht(this.mod,"duckdb_web_fs_drop_file",["string"],[t]);if(e!==0)throw new Error(tt(this.mod,r,n));St(this.mod)}dropFiles(){let[t,e,r]=ht(this.mod,"duckdb_web_fs_drop_files",[],[]);if(t!==0)throw new Error(tt(this.mod,e,r));St(this.mod)}flushFiles(){this.mod.ccall("duckdb_web_flush_files",null,[],[])}copyFileToPath(t,e){let[r,n,o]=ht(this.mod,"duckdb_web_copy_file_to_path",["string","string"],[t,e]);if(r!==0)throw new Error(tt(this.mod,n,o));St(this.mod)}copyFileToBuffer(t){let[e,r,n]=ht(this.mod,"duckdb_web_copy_file_to_buffer",["string"],[t]);if(e!==0)throw new Error(tt(this.mod,r,n));let o=this.mod.HEAPU8.subarray(r,r+n),c=new Uint8Array(o.length);return c.set(o),St(this.mod),c}collectFileStatistics(t,e){let[r,n,o]=ht(this.mod,"duckdb_web_collect_file_stats",["string","boolean"],[t,e]);if(r!==0)throw new Error(tt(this.mod,n,o))}exportFileStatistics(t){let[e,r,n]=ht(this.mod,"duckdb_web_export_file_stats",["string"],[t]);if(e!==0)throw new Error(tt(this.mod,r,n));return new Zo(this.mod.HEAPU8.subarray(r,r+n))}};var ta=class extends Qo{constructor(e,r,n,o){super(e,r);this.mainModuleURL=n,this.pthreadWorkerURL=o}locateFile(e,r){if(e.endsWith(".wasm"))return this.mainModuleURL;if(e.endsWith(".worker.js")){if(!this.pthreadWorkerURL)throw new Error("Missing DuckDB worker URL!");return this.pthreadWorkerURL}throw new Error(`WASM instantiation requested unexpected file: prefix=${r} path=${e}`)}instantiateWasm(e,r){globalThis.DUCKDB_RUNTIME=this._runtime;let n=this.onInstantiationProgress;if(WebAssembly.instantiateStreaming)if(typeof TransformStream=="function"){let c=(async()=>{var ct;let p=new Request(this.mainModuleURL),b=await fetch(p),g=b.headers.get("content-length"),A=g&&parseInt(g,10)||0,T=new Date,F={startedAt:T,updatedAt:T,bytesTotal:A||0,bytesLoaded:0},k={transform(mt,Dt){F.bytesLoaded+=mt.byteLength;let ae=new Date;if(ae.getTime()-F.updatedAt.getTime()<20){F.updatedAt=ae,Dt.enqueue(mt);return}for(let he of n)he(F);Dt.enqueue(mt)}},lt=new TransformStream(k);return new Response((ct=b.body)==null?void 0:ct.pipeThrough(lt),b)})();WebAssembly.instantiateStreaming(c,e).then(p=>{r(p.instance,p.module)})}else{console.warn("instantiating without progress handler since transform streams are unavailable");let o=new Request(this.mainModuleURL);WebAssembly.instantiateStreaming(fetch(o),e).then(c=>{r(c.instance,c.module)})}else if(typeof XMLHttpRequest=="function"){let o=new XMLHttpRequest,c=this.mainModuleURL,p=new Date,b={startedAt:p,updatedAt:p,bytesTotal:0,bytesLoaded:0};o.open("GET",c),o.responseType="arraybuffer",o.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())},o.onprogress=g=>{b.bytesTotal=g.total,b.bytesLoaded=g.loaded;let A=new Date;if(A.getTime()-b.updatedAt.getTime()<20){b.updatedAt=A;return}for(let T of n)T(b)},o.onload=()=>{WebAssembly.instantiate(o.response,e).then(g=>{r(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)})},o.send()}else console.warn("instantiating with manual fetch since streaming instantiation and xhrs are unavailable"),(async()=>{let c=new Request(this.mainModuleURL),b=await(await fetch(c)).arrayBuffer();WebAssembly.instantiate(b,e).then(g=>{r(g.instance,g.module)})})();return[]}};var ea=class extends ta{constructor(t,e,r,n=null){super(t,e,r,n)}instantiateImpl(t){return Rp({...t,instantiateWasm:this.instantiateWasm.bind(this),locateFile:this.locateFile.bind(this)})}};var lr=Af(Vp()),Hp=function(i,t,e){var r;if((r=i==null?void 0:i.endpoint)!=null&&r.startsWith("http")){let n=`${i==null?void 0:i.endpoint}`,o=n.indexOf("://")+3;return n.substring(o)}else return i!=null&&i.endpoint?`${e}.${i==null?void 0:i.endpoint}`:`${e}.s3.amazonaws.com`};function lI(i,t,e){var n,o,c,p;let r=zp(t);return{url:r.path,query:"",host:Hp(i,t,r.bucket),region:(n=i==null?void 0:i.region)!=null?n:"",service:"s3",method:e,accessKeyId:(o=i==null?void 0:i.accessKeyId)!=null?o:"",secretAccessKey:(c=i==null?void 0:i.secretAccessKey)!=null?c:"",sessionToken:(p=i==null?void 0:i.sessionToken)!=null?p:"",dateNow:new Date().toISOString().replace(/-/g,"").split("T")[0],datetimeNow:new Date().toISOString().replace(/-/g,"").replace(/:/g,"").split(".")[0]+"Z"}}function cI(i,t=!1){let e="0123456789ABCDEF",r="";for(let n=0;n<i.length;n++){let o=i[n];o>="A"&&o<="Z"||o>="a"&&o<="z"||o>="0"&&o<="9"||o=="_"||o=="-"||o=="~"||o=="."?r+=o:o=="/"?t?r+="%2F":r+=o:(r+="%",r+=e[o.charCodeAt(0)>>4],r+=e[o.charCodeAt(0)&15])}return r}function uI(i,t=null){var lt;let e=(lt=t==null?void 0:t.contentHash)!=null?lt:"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 n="";t!=null&&t.contentType&&(n+="content-type;"),n+="host;x-amz-content-sha256;x-amz-date",i.sessionToken&&(n+=";x-amz-security-token");let o=i.method+`
12
- `+cI(i.url)+`
10
+ ]`}concat(...t){let e=this.schema,r=this.data.concat(t.flatMap(({data:n})=>n));return new Rt(e,r.map(n=>new jt(e,n)))}slice(t,e){let r=this.schema;[t,e]=In({length:this.numRows},t,e);let n=co(this.data,this._offsets,t,e);return new Rt(r,n.map(o=>new jt(r,o)))}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],n=J({type:r,length:0,nullCount:0});e.push(n._changeLengthAndBackfillNullBitmap(this.numRows))}return new G(e)}return null}setChild(t,e){var r;return this.setChildAt((r=this.schema.fields)===null||r===void 0?void 0:r.findIndex(n=>n.name===t),e)}setChildAt(t,e){let r=this.schema,n=[...this.batches];if(t>-1&&t<this.numCols){e||(e=new G([J({type:new pe,length:this.numRows})]));let o=r.fields.slice(),u=o[t].clone({type:e.type}),h=this.schema.fields.map((m,g)=>this.getChildAt(g));[o[t],h[t]]=[u,e],[r,n]=Po(r,h)}return new Rt(r,n)}select(t){let e=this.schema.fields.reduce((r,n,o)=>r.set(n.name,o),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(n=>n.selectAt(t));return new Rt(e,r)}assign(t){let e=this.schema.fields,[r,n]=t.schema.fields.reduce((h,m,g)=>{let[F,D]=h,B=e.findIndex(k=>k.name===m.name);return~B?D[B]=g:F.push(g),h},[[],[]]),o=this.schema.assign(t.schema),u=[...e.map((h,m)=>[m,n[m]]).map(([h,m])=>m===void 0?this.getChildAt(h):t.getChildAt(m)),...r.map(h=>t.getChildAt(h))].filter(Boolean);return new Rt(...Po(o,u))}};fp=Symbol.toStringTag;Rt[fp]=(i=>(i.schema=null,i.batches=[],i._offsets=new Uint32Array([0]),i._nullCount=-1,i[Symbol.isConcatSpreadable]=!0,i.isValid=er(Fn),i.get=er(Nt.getVisitFn(C.Struct)),i.set=uo(ie.getVisitFn(C.Struct)),i.indexOf=fo(Sr.getVisitFn(C.Struct)),i.getByteLength=er(Oe.getVisitFn(C.Struct)),"Table"))(Rt.prototype);var pp,jt=class{constructor(...t){switch(t.length){case 2:{if([this.schema]=t,!(this.schema instanceof ot))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");if([,this.data=J({nullCount:0,type:new St(this.schema.fields),children:this.schema.fields.map(e=>J({type:e.type,nullCount:0}))})]=t,!(this.data instanceof ht))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");[this.schema,this.data]=hp(this.schema,this.data.children);break}case 1:{let[e]=t,{fields:r,children:n,length:o}=Object.keys(e).reduce((m,g,F)=>(m.children[F]=e[g],m.length=Math.max(m.length,e[g].length),m.fields[F]=Q.new({name:g,type:e[g].type,nullable:!0}),m),{length:0,fields:new Array,children:new Array}),u=new ot(r),h=J({type:new St(r),length:o,children:n,nullCount:0});[this.schema,this.data]=hp(u,h.children,o);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=yp(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 Nt.visit(this.data,t)}set(t,e){return ie.visit(this.data,t,e)}indexOf(t,e){return Sr.visit(this.data,t,e)}getByteLength(t){return Oe.visit(this.data,t)}[Symbol.iterator](){return Yr.visit(new G([this.data]))}toArray(){return[...this]}concat(...t){return new Rt(this.schema,[this,...t])}slice(t,e){let[r]=new G([this.data]).slice(t,e).data;return new jt(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 G([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(n=>n.name===t),e)}setChildAt(t,e){let r=this.schema,n=this.data;if(t>-1&&t<this.numCols){e||(e=new G([J({type:new pe,length:this.numRows})]));let o=r.fields.slice(),u=n.children.slice(),h=o[t].clone({type:e.type});[o[t],u[t]]=[h,e.data[0]],r=new ot(o,new Map(this.schema.metadata)),n=J({type:new St(o),children:u})}return new jt(r,n)}select(t){let e=this.schema.select(t),r=new St(e.fields),n=[];for(let o of t){let u=this.schema.fields.findIndex(h=>h.name===o);~u&&(n[u]=this.data.children[u])}return new jt(e,J({type:r,length:this.numRows,children:n}))}selectAt(t){let e=this.schema.selectAt(t),r=t.map(o=>this.data.children[o]).filter(Boolean),n=J({type:new St(e.fields),length:this.numRows,children:r});return new jt(e,n)}};pp=Symbol.toStringTag;jt[pp]=(i=>(i._nullCount=-1,i[Symbol.isConcatSpreadable]=!0,"RecordBatch"))(jt.prototype);function hp(i,t,e=t.reduce((r,n)=>Math.max(r,n.length),0)){var r;let n=[...i.fields],o=[...t],u=(e+63&-64)>>3;for(let[h,m]of i.fields.entries()){let g=t[h];(!g||g.length!==e)&&(n[h]=m.clone({nullable:!0}),o[h]=(r=g==null?void 0:g._changeLengthAndBackfillNullBitmap(e))!==null&&r!==void 0?r:J({type:m.type,length:e,nullCount:e,nullBitmap:new Uint8Array(u)}))}return[i.assign(n),J({type:new St(n),length:e,children:o})]}function yp(i,t,e=new Map){for(let r=-1,n=i.length;++r<n;){let u=i[r].type,h=t[r];if(L.isDictionary(u)){if(!e.has(u.id))h.dictionary&&e.set(u.id,h.dictionary);else if(e.get(u.id)!==h.dictionary)throw new Error("Cannot create Schema containing two different dictionaries with the same Id")}u.children&&u.children.length>0&&yp(u.children,h.children,e)}return e}var Dr=class extends jt{constructor(t){let e=t.fields.map(n=>J({type:n.type})),r=J({type:new St(t.fields),nullCount:0,children:e});super(t,r)}};var is;(function(i){i[i.BUFFER=0]="BUFFER"})(is||(is={}));var rs;(function(i){i[i.LZ4_FRAME=0]="LZ4_FRAME",i[i.ZSTD=1]="ZSTD"})(rs||(rs={}));var ai=class{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 ai).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsBodyCompression(t,e){return t.setPosition(t.position()+4),(e||new ai).__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):rs.LZ4_FRAME}method(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt8(this.bb_pos+t):is.BUFFER}static startBodyCompression(t){t.startObject(2)}static addCodec(t,e){t.addFieldInt8(0,e,rs.LZ4_FRAME)}static addMethod(t,e){t.addFieldInt8(1,e,is.BUFFER)}static endBodyCompression(t){return t.endObject()}static createBodyCompression(t,e,r){return ai.startBodyCompression(t),ai.addCodec(t,e),ai.addMethod(t,r),ai.endBodyCompression(t)}};var en=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(r),t.writeInt64(e),t.offset()}};var rn=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(r),t.writeInt64(e),t.offset()}};var le=class{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 le).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsRecordBatch(t,e){return t.setPosition(t.position()+4),(e||new le).__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):this.bb.createLong(0,0)}nodes(t,e){let r=this.bb.__offset(this.bb_pos,6);return r?(e||new rn).__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 en).__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 ai).__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,t.createLong(0,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 $e=class{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 $e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDictionaryBatch(t,e){return t.setPosition(t.position()+4),(e||new $e).__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):this.bb.createLong(0,0)}data(t){let e=this.bb.__offset(this.bb_pos,6);return e?(t||new le).__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,t.createLong(0,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 nn;(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"})(nn||(nn={}));var Ut=class{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 Ut).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsMessage(t,e){return t.setPosition(t.position()+4),(e||new Ut).__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):rr.V1}headerType(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readUint8(this.bb_pos+t):nn.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):this.bb.createLong(0,0)}customMetadata(t,e){let r=this.bb.__offset(this.bb_pos,12);return r?(e||new It).__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,rr.V1)}static addHeaderType(t,e){t.addFieldInt8(1,e,nn.NONE)}static addHeader(t,e){t.addFieldOffset(2,e,0)}static addBodyLength(t,e){t.addFieldInt64(3,e,t.createLong(0,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,n,o,u){return Ut.startMessage(t),Ut.addVersion(t,e),Ut.addHeaderType(t,r),Ut.addHeader(t,n),Ut.addBodyLength(t,o),Ut.addCustomMetadata(t,u),Ut.endMessage(t)}};var OS=Pt,tl=class extends P{visit(t,e){return t==null||e==null?void 0:super.visit(t,e)}visitNull(t,e){return vi.startNull(e),vi.endNull(e)}visitInt(t,e){return Gt.startInt(e),Gt.addBitWidth(e,t.bitWidth),Gt.addIsSigned(e,t.isSigned),Gt.endInt(e)}visitFloat(t,e){return Se.startFloatingPoint(e),Se.addPrecision(e,t.precision),Se.endFloatingPoint(e)}visitBinary(t,e){return _i.startBinary(e),_i.endBinary(e)}visitBool(t,e){return mi.startBool(e),mi.endBool(e)}visitUtf8(t,e){return wi.startUtf8(e),wi.endUtf8(e)}visitDecimal(t,e){return Kt.startDecimal(e),Kt.addScale(e,t.scale),Kt.addPrecision(e,t.precision),Kt.addBitWidth(e,t.bitWidth),Kt.endDecimal(e)}visitDate(t,e){return ge.startDate(e),ge.addUnit(e,t.unit),ge.endDate(e)}visitTime(t,e){return se.startTime(e),se.addUnit(e,t.unit),se.addBitWidth(e,t.bitWidth),se.endTime(e)}visitTimestamp(t,e){let r=t.timezone&&e.createString(t.timezone)||void 0;return oe.startTimestamp(e),oe.addUnit(e,t.unit),r!==void 0&&oe.addTimezone(e,r),oe.endTimestamp(e)}visitInterval(t,e){return Ie.startInterval(e),Ie.addUnit(e,t.unit),Ie.endInterval(e)}visitList(t,e){return bi.startList(e),bi.endList(e)}visitStruct(t,e){return gi.startStruct_(e),gi.endStruct_(e)}visitUnion(t,e){Jt.startTypeIdsVector(e,t.typeIds.length);let r=Jt.createTypeIdsVector(e,t.typeIds);return Jt.startUnion(e),Jt.addMode(e,t.mode),Jt.addTypeIds(e,r),Jt.endUnion(e)}visitDictionary(t,e){let r=this.visit(t.indices,e);return Re.startDictionaryEncoding(e),Re.addId(e,new OS(t.id,0)),Re.addIsOrdered(e,t.isOrdered),r!==void 0&&Re.addIndexType(e,r),Re.endDictionaryEncoding(e)}visitFixedSizeBinary(t,e){return we.startFixedSizeBinary(e),we.addByteWidth(e,t.byteWidth),we.endFixedSizeBinary(e)}visitFixedSizeList(t,e){return je.startFixedSizeList(e),je.addListSize(e,t.listSize),je.endFixedSizeList(e)}visitMap(t,e){return Ce.startMap(e),Ce.addKeysSorted(e,t.keysSorted),Ce.endMap(e)}},Vo=new tl;function vp(i,t=new Map){return new ot(RS(i,t),Ho(i.customMetadata),t)}function el(i){return new re(i.count,wp(i.columns),jp(i.columns))}function gp(i){return new Te(el(i.data),i.id,i.isDelta)}function RS(i,t){return(i.fields||[]).filter(Boolean).map(e=>Q.fromJSON(e,t))}function _p(i,t){return(i.children||[]).filter(Boolean).map(e=>Q.fromJSON(e,t))}function wp(i){return(i||[]).reduce((t,e)=>[...t,new li(e.count,MS(e.VALIDITY)),...wp(e.children)],[])}function jp(i,t=[]){for(let e=-1,r=(i||[]).length;++e<r;){let n=i[e];n.VALIDITY&&t.push(new Be(t.length,n.VALIDITY.length)),n.TYPE&&t.push(new Be(t.length,n.TYPE.length)),n.OFFSET&&t.push(new Be(t.length,n.OFFSET.length)),n.DATA&&t.push(new Be(t.length,n.DATA.length)),t=jp(n.children,t)}return t}function MS(i){return(i||[]).reduce((t,e)=>t+ +(e===0),0)}function Sp(i,t){let e,r,n,o,u,h;return!t||!(o=i.dictionary)?(u=bp(i,_p(i,t)),n=new Q(i.name,u,i.nullable,Ho(i.customMetadata))):t.has(e=o.id)?(r=(r=o.indexType)?mp(r):new di,h=new Ee(t.get(e),r,e,o.isOrdered),n=new Q(i.name,h,i.nullable,Ho(i.customMetadata))):(r=(r=o.indexType)?mp(r):new di,t.set(e,u=bp(i,_p(i,t))),h=new Ee(u,r,e,o.isOrdered),n=new Q(i.name,h,i.nullable,Ho(i.customMetadata))),n||null}function Ho(i){return new Map(Object.entries(i||{}))}function mp(i){return new Mt(i.isSigned,i.bitWidth)}function bp(i,t){let e=i.type.name;switch(e){case"NONE":return new pe;case"null":return new pe;case"binary":return new Bi;case"utf8":return new Ti;case"bool":return new Di;case"list":return new ti((t||[])[0]);case"struct":return new St(t||[]);case"struct_":return new St(t||[])}switch(e){case"int":{let r=i.type;return new Mt(r.isSigned,r.bitWidth)}case"floatingpoint":{let r=i.type;return new ve(xt[r.precision])}case"decimal":{let r=i.type;return new Ei(r.scale,r.precision,r.bitWidth)}case"date":{let r=i.type;return new ki(ee[r.unit])}case"time":{let r=i.type;return new Qe(st[r.unit],r.bitWidth)}case"timestamp":{let r=i.type;return new Oi(st[r.unit],r.timezone)}case"interval":{let r=i.type;return new Ri(he[r.unit])}case"union":{let r=i.type;return new ei(Dt[r.mode],r.typeIds||[],t||[])}case"fixedsizebinary":{let r=i.type;return new Mi(r.byteWidth)}case"fixedsizelist":{let r=i.type;return new ii(r.listSize,(t||[])[0])}case"map":{let r=i.type;return new ri((t||[])[0],r.keysSorted)}}throw new Error(`Unrecognized type: "${e}"`)}var Er=Pt,US=Ni,LS=ye,Ht=class{constructor(t,e,r,n){this._version=e,this._headerType=r,this.body=new Uint8Array(0),n&&(this._createHeader=()=>n),this._bodyLength=typeof t=="number"?t:t.low}static fromJSON(t,e){let r=new Ht(0,Yt.V4,e);return r._createHeader=NS(t,e),r}static decode(t){t=new LS(Y(t));let e=Ut.getRootAsMessage(t),r=e.bodyLength(),n=e.version(),o=e.headerType(),u=new Ht(r,n,o);return u._createHeader=PS(e,o),u}static encode(t){let e=new US,r=-1;return t.isSchema()?r=ot.encode(e,t.header()):t.isRecordBatch()?r=re.encode(e,t.header()):t.isDictionaryBatch()&&(r=Te.encode(e,t.header())),Ut.startMessage(e),Ut.addVersion(e,Yt.V4),Ut.addHeader(e,r),Ut.addHeaderType(e,t.headerType),Ut.addBodyLength(e,new Er(t.bodyLength,0)),Ut.finishMessageBuffer(e,Ut.endMessage(e)),e.asUint8Array()}static from(t,e=0){if(t instanceof ot)return new Ht(0,Yt.V4,ft.Schema,t);if(t instanceof re)return new Ht(e,Yt.V4,ft.RecordBatch,t);if(t instanceof Te)return new Ht(e,Yt.V4,ft.DictionaryBatch,t);throw new Error(`Unrecognized Message header: ${t}`)}get type(){return this.headerType}get version(){return this._version}get headerType(){return this._headerType}get bodyLength(){return this._bodyLength}header(){return this._createHeader()}isSchema(){return this.headerType===ft.Schema}isRecordBatch(){return this.headerType===ft.RecordBatch}isDictionaryBatch(){return this.headerType===ft.DictionaryBatch}},re=class{constructor(t,e,r){this._nodes=e,this._buffers=r,this._length=typeof t=="number"?t:t.low}get nodes(){return this._nodes}get length(){return this._length}get buffers(){return this._buffers}},Te=class{constructor(t,e,r=!1){this._data=t,this._isDelta=r,this._id=typeof e=="number"?e:e.low}get id(){return this._id}get data(){return this._data}get isDelta(){return this._isDelta}get length(){return this.data.length}get nodes(){return this.data.nodes}get buffers(){return this.data.buffers}},Be=class{constructor(t,e){this.offset=typeof t=="number"?t:t.low,this.length=typeof e=="number"?e:e.low}},li=class{constructor(t,e){this.length=typeof t=="number"?t:t.low,this.nullCount=typeof e=="number"?e:e.low}};function NS(i,t){return()=>{switch(t){case ft.Schema:return ot.fromJSON(i);case ft.RecordBatch:return re.fromJSON(i);case ft.DictionaryBatch:return Te.fromJSON(i)}throw new Error(`Unrecognized Message type: { name: ${ft[t]}, type: ${t} }`)}}function PS(i,t){return()=>{switch(t){case ft.Schema:return ot.decode(i.header(new Et));case ft.RecordBatch:return re.decode(i.header(new le),i.version());case ft.DictionaryBatch:return Te.decode(i.header(new $e),i.version())}throw new Error(`Unrecognized Message type: { name: ${ft[t]}, type: ${t} }`)}}Q.encode=qS;Q.decode=KS;Q.fromJSON=Sp;ot.encode=JS;ot.decode=VS;ot.fromJSON=vp;re.encode=ZS;re.decode=HS;re.fromJSON=el;Te.encode=QS;Te.decode=zS;Te.fromJSON=gp;li.encode=tI;li.decode=$S;Be.encode=eI;Be.decode=WS;function VS(i,t=new Map){let e=GS(i,t);return new ot(e,zo(i),t)}function HS(i,t=Yt.V4){if(i.compression()!==null)throw new Error("Record batch compression not implemented");return new re(i.length(),YS(i),XS(i,t))}function zS(i,t=Yt.V4){return new Te(re.decode(i.data(),t),i.id(),i.isDelta())}function WS(i){return new Be(i.offset(),i.length())}function $S(i){return new li(i.length(),i.nullCount())}function YS(i){let t=[];for(let e,r=-1,n=-1,o=i.nodesLength();++r<o;)(e=i.nodes(r))&&(t[++n]=li.decode(e));return t}function XS(i,t){let e=[];for(let r,n=-1,o=-1,u=i.buffersLength();++n<u;)(r=i.buffers(n))&&(t<Yt.V4&&(r.bb_pos+=8*(n+1)),e[++o]=Be.decode(r));return e}function GS(i,t){let e=[];for(let r,n=-1,o=-1,u=i.fieldsLength();++n<u;)(r=i.fields(n))&&(e[++o]=Q.decode(r,t));return e}function Ip(i,t){let e=[];for(let r,n=-1,o=-1,u=i.childrenLength();++n<u;)(r=i.children(n))&&(e[++o]=Q.decode(r,t));return e}function KS(i,t){let e,r,n,o,u,h;return!t||!(h=i.dictionary())?(n=Ap(i,Ip(i,t)),r=new Q(i.name(),n,i.nullable(),zo(i))):t.has(e=h.id().low)?(o=(o=h.indexType())?Cp(o):new di,u=new Ee(t.get(e),o,e,h.isOrdered()),r=new Q(i.name(),u,i.nullable(),zo(i))):(o=(o=h.indexType())?Cp(o):new di,t.set(e,n=Ap(i,Ip(i,t))),u=new Ee(n,o,e,h.isOrdered()),r=new Q(i.name(),u,i.nullable(),zo(i))),r||null}function zo(i){let t=new Map;if(i)for(let e,r,n=-1,o=Math.trunc(i.customMetadataLength());++n<o;)(e=i.customMetadata(n))&&(r=e.key())!=null&&t.set(r,e.value());return t}function Cp(i){return new Mt(i.isSigned(),i.bitWidth())}function Ap(i,t){let e=i.typeType();switch(e){case Tt.NONE:return new pe;case Tt.Null:return new pe;case Tt.Binary:return new Bi;case Tt.Utf8:return new Ti;case Tt.Bool:return new Di;case Tt.List:return new ti((t||[])[0]);case Tt.Struct_:return new St(t||[])}switch(e){case Tt.Int:{let r=i.type(new Gt);return new Mt(r.isSigned(),r.bitWidth())}case Tt.FloatingPoint:{let r=i.type(new Se);return new ve(r.precision())}case Tt.Decimal:{let r=i.type(new Kt);return new Ei(r.scale(),r.precision(),r.bitWidth())}case Tt.Date:{let r=i.type(new ge);return new ki(r.unit())}case Tt.Time:{let r=i.type(new se);return new Qe(r.unit(),r.bitWidth())}case Tt.Timestamp:{let r=i.type(new oe);return new Oi(r.unit(),r.timezone())}case Tt.Interval:{let r=i.type(new Ie);return new Ri(r.unit())}case Tt.Union:{let r=i.type(new Jt);return new ei(r.mode(),r.typeIdsArray()||[],t||[])}case Tt.FixedSizeBinary:{let r=i.type(new we);return new Mi(r.byteWidth())}case Tt.FixedSizeList:{let r=i.type(new je);return new ii(r.listSize(),(t||[])[0])}case Tt.Map:{let r=i.type(new Ce);return new ri((t||[])[0],r.keysSorted())}}throw new Error(`Unrecognized type: "${Tt[e]}" (${e})`)}function JS(i,t){let e=t.fields.map(o=>Q.encode(i,o));Et.startFieldsVector(i,e.length);let r=Et.createFieldsVector(i,e),n=t.metadata&&t.metadata.size>0?Et.createCustomMetadataVector(i,[...t.metadata].map(([o,u])=>{let h=i.createString(`${o}`),m=i.createString(`${u}`);return It.startKeyValue(i),It.addKey(i,h),It.addValue(i,m),It.endKeyValue(i)})):-1;return Et.startSchema(i),Et.addFields(i,r),Et.addEndianness(i,iI?nr.Little:nr.Big),n!==-1&&Et.addCustomMetadata(i,n),Et.endSchema(i)}function qS(i,t){let e=-1,r=-1,n=-1,o=t.type,u=t.typeId;L.isDictionary(o)?(u=o.dictionary.typeId,n=Vo.visit(o,i),r=Vo.visit(o.dictionary,i)):r=Vo.visit(o,i);let h=(o.children||[]).map(F=>Q.encode(i,F)),m=Vt.createChildrenVector(i,h),g=t.metadata&&t.metadata.size>0?Vt.createCustomMetadataVector(i,[...t.metadata].map(([F,D])=>{let B=i.createString(`${F}`),k=i.createString(`${D}`);return It.startKeyValue(i),It.addKey(i,B),It.addValue(i,k),It.endKeyValue(i)})):-1;return t.name&&(e=i.createString(t.name)),Vt.startField(i),Vt.addType(i,r),Vt.addTypeType(i,u),Vt.addChildren(i,m),Vt.addNullable(i,!!t.nullable),e!==-1&&Vt.addName(i,e),n!==-1&&Vt.addDictionary(i,n),g!==-1&&Vt.addCustomMetadata(i,g),Vt.endField(i)}function ZS(i,t){let e=t.nodes||[],r=t.buffers||[];le.startNodesVector(i,e.length);for(let u of e.slice().reverse())li.encode(i,u);let n=i.endVector();le.startBuffersVector(i,r.length);for(let u of r.slice().reverse())Be.encode(i,u);let o=i.endVector();return le.startRecordBatch(i),le.addLength(i,new Er(t.length,0)),le.addNodes(i,n),le.addBuffers(i,o),le.endRecordBatch(i)}function QS(i,t){let e=re.encode(i,t.data);return $e.startDictionaryBatch(i),$e.addId(i,new Er(t.id,0)),$e.addIsDelta(i,t.isDelta),$e.addData(i,e),$e.endDictionaryBatch(i)}function tI(i,t){return rn.createFieldNode(i,new Er(t.length,0),new Er(t.nullCount,0))}function eI(i,t){return en.createBuffer(i,new Er(t.offset,0),new Er(t.length,0))}var iI=(()=>{let i=new ArrayBuffer(2);return new DataView(i).setInt16(0,256,!0),new Int16Array(i)[0]===256})();var rl=i=>`Expected ${ft[i]} Message in stream, but was null or length 0.`,nl=i=>`Header pointer of flatbuffer-encoded ${ft[i]} Message is null or length 0.`,Fp=(i,t)=>`Expected to read ${i} metadata bytes, but only read ${t}.`,xp=(i,t)=>`Expected to read ${i} bytes for message body, but only read ${t}.`,sn=class{constructor(t){this.source=t instanceof Si?t:new Si(t)}[Symbol.iterator](){return this}next(){let t;return(t=this.readMetadataLength()).done?Ct:t.value===-1&&(t=this.readMetadataLength()).done?Ct:(t=this.readMetadata(t.value)).done?Ct: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(rl(t));return e.value}readMessageBody(t){if(t<=0)return new Uint8Array(0);let e=Y(this.source.read(t));if(e.byteLength<t)throw new Error(xp(t,e.byteLength));return e.byteOffset%8===0&&e.byteOffset+e.byteLength<=e.buffer.byteLength?e:e.slice()}readSchema(t=!1){let e=ft.Schema,r=this.readMessage(e),n=r==null?void 0:r.header();if(t&&!n)throw new Error(nl(e));return n}readMetadataLength(){let t=this.source.read(Wo),e=t&&new ye(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 Ct;if(e.byteLength<t)throw new Error(Fp(t,e.byteLength));return{done:!1,value:Ht.decode(e)}}},ns=class{constructor(t,e){this.source=t instanceof Ae?t:Bs(t)?new or(t,e):new Ae(t)}[Symbol.asyncIterator](){return this}next(){return O(this,void 0,void 0,function*(){let t;return(t=yield this.readMetadataLength()).done?Ct:t.value===-1&&(t=yield this.readMetadataLength()).done?Ct:(t=yield this.readMetadata(t.value)).done?Ct:t})}throw(t){return O(this,void 0,void 0,function*(){return yield this.source.throw(t)})}return(t){return O(this,void 0,void 0,function*(){return yield this.source.return(t)})}readMessage(t){return O(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(rl(t));return e.value})}readMessageBody(t){return O(this,void 0,void 0,function*(){if(t<=0)return new Uint8Array(0);let e=Y(yield this.source.read(t));if(e.byteLength<t)throw new Error(xp(t,e.byteLength));return e.byteOffset%8===0&&e.byteOffset+e.byteLength<=e.buffer.byteLength?e:e.slice()})}readSchema(t=!1){return O(this,void 0,void 0,function*(){let e=ft.Schema,r=yield this.readMessage(e),n=r==null?void 0:r.header();if(t&&!n)throw new Error(nl(e));return n})}readMetadataLength(){return O(this,void 0,void 0,function*(){let t=yield this.source.read(Wo),e=t&&new ye(t),r=(e==null?void 0:e.readInt32(0))||0;return{done:r===0,value:r}})}readMetadata(t){return O(this,void 0,void 0,function*(){let e=yield this.source.read(t);if(!e)return Ct;if(e.byteLength<t)throw new Error(Fp(t,e.byteLength));return{done:!1,value:Ht.decode(e)}})}},ss=class extends sn{constructor(t){super(new Uint8Array(0)),this._schema=!1,this._body=[],this._batchIndex=0,this._dictionaryIndex=0,this._json=t instanceof On?t:new On(t)}next(){let{_json:t}=this;if(!this._schema)return this._schema=!0,{done:!1,value:Ht.fromJSON(t.schema,ft.Schema)};if(this._dictionaryIndex<t.dictionaries.length){let e=t.dictionaries[this._dictionaryIndex++];return this._body=e.data.columns,{done:!1,value:Ht.fromJSON(e,ft.DictionaryBatch)}}if(this._batchIndex<t.batches.length){let e=t.batches[this._batchIndex++];return this._body=e.columns,{done:!1,value:Ht.fromJSON(e,ft.RecordBatch)}}return this._body=[],Ct}readMessageBody(t){return e(this._body);function e(r){return(r||[]).reduce((n,o)=>[...n,...o.VALIDITY&&[o.VALIDITY]||[],...o.TYPE&&[o.TYPE]||[],...o.OFFSET&&[o.OFFSET]||[],...o.DATA&&[o.DATA]||[],...e(o.children)],[])}}readMessage(t){let e;if((e=this.next()).done)return null;if(t!=null&&e.value.headerType!==t)throw new Error(rl(t));return e.value}readSchema(){let t=ft.Schema,e=this.readMessage(t),r=e==null?void 0:e.header();if(!e||!r)throw new Error(nl(t));return r}},Wo=4,il="ARROW1",on=new Uint8Array(il.length);for(let i=0;i<il.length;i+=1)on[i]=il.codePointAt(i);function $o(i,t=0){for(let e=-1,r=on.length;++e<r;)if(on[e]!==i[t+e])return!1;return!0}var an=on.length,sl=an+Wo,Bp=an*2+Wo;var Lt=class extends Cr{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 Ge(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 te.toDOMStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this})}toNodeStream(){return te.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 Lt?t:Fs(t)?nI(t):Bs(t)?aI(t):Ge(t)?(()=>O(this,void 0,void 0,function*(){return yield Lt.from(yield t)}))():Ts(t)||gn(t)||Es(t)||Pe(t)?oI(new Ae(t)):sI(new Si(t))}static readAll(t){return t instanceof Lt?t.isSync()?Tp(t):Dp(t):Fs(t)||ArrayBuffer.isView(t)||Ke(t)||xs(t)?Tp(t):Dp(t)}},Ci=class extends Lt{constructor(t){super(t),this._impl=t}readAll(){return[...this]}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return be(this,arguments,function*(){yield it(yield*Mr(Ne(this[Symbol.iterator]())))})}},ar=class extends Lt{constructor(t){super(t),this._impl=t}readAll(){var t,e;return O(this,void 0,void 0,function*(){let r=new Array;try{for(var n=Ne(this),o;o=yield n.next(),!o.done;){let u=o.value;r.push(u)}}catch(u){t={error:u}}finally{try{o&&!o.done&&(e=n.return)&&(yield e.call(n))}finally{if(t)throw t.error}}return r})}[Symbol.iterator](){throw new Error("AsyncRecordBatchStreamReader is not Iterable")}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}},lr=class extends Ci{constructor(t){super(t),this._impl=t}},os=class extends ar{constructor(t){super(t),this._impl=t}},Yo=class{constructor(t=new Map){this.closed=!1,this.autoDestroy=!0,this._dictionaryIndex=0,this._recordBatchIndex=0,this.dictionaries=t}get numDictionaries(){return this._dictionaryIndex}get numRecordBatches(){return this._recordBatchIndex}isSync(){return!1}isAsync(){return!1}isFile(){return!1}isStream(){return!1}reset(t){return this._dictionaryIndex=0,this._recordBatchIndex=0,this.schema=t,this.dictionaries=new Map,this}_loadRecordBatch(t,e){let r=this._loadVectors(t,e,this.schema.fields),n=J({type:new St(this.schema.fields),length:t.length,children:r});return new jt(this.schema,n)}_loadDictionaryBatch(t,e){let{id:r,isDelta:n}=t,{dictionaries:o,schema:u}=this,h=o.get(r);if(n||!h){let m=u.dictionaries.get(r),g=this._loadVectors(t.data,e,[m]);return(h&&n?h.concat(new G(g)):new G(g)).memoize()}return h.memoize()}_loadVectors(t,e,r){return new Un(e,t.nodes,t.buffers,this.dictionaries).visitMany(r)}},ln=class extends Yo{constructor(t,e){super(e),this._reader=Fs(t)?new ss(this._handle=t):new sn(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=Ep(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):Ct}return(t){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.return(t):Ct}next(){if(this.closed)return Ct;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(),n=e.readMessageBody(t.bodyLength);return{done:!1,value:this._loadRecordBatch(r,n)}}else if(t.isDictionaryBatch()){this._dictionaryIndex++;let r=t.header(),n=e.readMessageBody(t.bodyLength),o=this._loadDictionaryBatch(r,n);this.dictionaries.set(r.id,o)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new Dr(this.schema)}):this.return()}_readNextMessageAndValidate(t){return this._reader.readMessage(t)}},cn=class extends Yo{constructor(t,e){super(e),this._reader=new ns(this._handle=t)}isAsync(){return!0}isStream(){return!0}[Symbol.asyncIterator](){return this}cancel(){return O(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 O(this,void 0,void 0,function*(){return this.closed||(this.autoDestroy=Ep(this,t),this.schema||(this.schema=yield this._reader.readSchema())||(yield this.cancel())),this})}throw(t){return O(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.throw(t):Ct})}return(t){return O(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.return(t):Ct})}next(){return O(this,void 0,void 0,function*(){if(this.closed)return Ct;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(),n=yield e.readMessageBody(t.bodyLength);return{done:!1,value:this._loadRecordBatch(r,n)}}else if(t.isDictionaryBatch()){this._dictionaryIndex++;let r=t.header(),n=yield e.readMessageBody(t.bodyLength),o=this._loadDictionaryBatch(r,n);this.dictionaries.set(r.id,o)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new Dr(this.schema)}):yield this.return()})}_readNextMessageAndValidate(t){return O(this,void 0,void 0,function*(){return yield this._reader.readMessage(t)})}},Xo=class extends ln{constructor(t,e){super(t instanceof Rn?t:new Rn(t),e)}get footer(){return this._footer}get numDictionaries(){return this._footer?this._footer.numDictionaries:0}get numRecordBatches(){return this._footer?this._footer.numRecordBatches:0}isSync(){return!0}isFile(){return!0}open(t){if(!this.closed&&!this._footer){this.schema=(this._footer=this._readFooter()).schema;for(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 n=this._reader.readMessage(ft.RecordBatch);if(n!=null&&n.isRecordBatch()){let o=n.header(),u=this._reader.readMessageBody(n.bodyLength);return this._loadRecordBatch(o,u)}}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 n=this._reader.readMessage(ft.DictionaryBatch);if(n!=null&&n.isDictionaryBatch()){let o=n.header(),u=this._reader.readMessageBody(n.bodyLength),h=this._loadDictionaryBatch(o,u);this.dictionaries.set(o.id,h)}}}_readFooter(){let{_handle:t}=this,e=t.size-sl,r=t.readInt32(e),n=t.readAt(e-r,r);return Pi.decode(n)}_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}},ol=class extends cn{constructor(t,...e){let r=typeof e[0]!="number"?e.shift():void 0,n=e[0]instanceof Map?e.shift():void 0;super(t instanceof or?t:new or(t,r),n)}get footer(){return this._footer}get numDictionaries(){return this._footer?this._footer.numDictionaries:0}get numRecordBatches(){return this._footer?this._footer.numRecordBatches:0}isFile(){return!0}isAsync(){return!0}open(t){let e=Object.create(null,{open:{get:()=>super.open}});return O(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){var e;return O(this,void 0,void 0,function*(){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 n=yield this._reader.readMessage(ft.RecordBatch);if(n!=null&&n.isRecordBatch()){let o=n.header(),u=yield this._reader.readMessageBody(n.bodyLength);return this._loadRecordBatch(o,u)}}return null})}_readDictionaryBatch(t){var e;return O(this,void 0,void 0,function*(){let r=(e=this._footer)===null||e===void 0?void 0:e.getDictionaryBatch(t);if(r&&(yield this._handle.seek(r.offset))){let n=yield this._reader.readMessage(ft.DictionaryBatch);if(n!=null&&n.isDictionaryBatch()){let o=n.header(),u=yield this._reader.readMessageBody(n.bodyLength),h=this._loadDictionaryBatch(o,u);this.dictionaries.set(o.id,h)}}})}_readFooter(){return O(this,void 0,void 0,function*(){let{_handle:t}=this;t._pending&&(yield t._pending);let e=t.size-sl,r=yield t.readInt32(e),n=yield t.readAt(e-r,r);return Pi.decode(n)})}_readNextMessageAndValidate(t){return O(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})}},al=class extends ln{constructor(t,e){super(t,e)}_loadVectors(t,e,r){return new bo(e,t.nodes,t.buffers,this.dictionaries).visitMany(r)}};function Ep(i,t){return t&&typeof t.autoDestroy=="boolean"?t.autoDestroy:i.autoDestroy}function*Tp(i){let t=Lt.from(i);try{if(!t.open({autoDestroy:!1}).closed)do yield t;while(!t.reset().open().closed)}finally{t.cancel()}}function Dp(i){return be(this,arguments,function*(){let e=yield it(Lt.from(i));try{if(!(yield it(e.open({autoDestroy:!1}))).closed)do yield yield it(e);while(!(yield it(e.reset().open())).closed)}finally{yield it(e.cancel())}})}function nI(i){return new Ci(new al(i))}function sI(i){let t=i.peek(an+7&-8);return t&&t.byteLength>=4?$o(t)?new lr(new Xo(i.read())):new Ci(new ln(i)):new Ci(new ln(function*(){}()))}function oI(i){return O(this,void 0,void 0,function*(){let t=yield i.peek(an+7&-8);return t&&t.byteLength>=4?$o(t)?new lr(new Xo(yield i.read())):new ar(new cn(i)):new ar(new cn(function(){return be(this,arguments,function*(){})}()))})}function aI(i){return O(this,void 0,void 0,function*(){let{size:t}=yield i.stat(),e=new or(i,t);return t>=Bp&&$o(yield e.readAt(0,an+7&-8))?new os(new ol(e)):new ar(new cn(e))})}var kt=class extends P{constructor(){super(),this._byteLength=0,this._nodes=[],this._buffers=[],this._bufferRegions=[]}static assemble(...t){let e=n=>n.flatMap(o=>Array.isArray(o)?e(o):o instanceof jt?o.data.children:o.data),r=new kt;return r.visitMany(e(t)),r}visit(t){if(t instanceof G)return this.visitMany(t.data),this;let{type:e}=t;if(!L.isDictionary(e)){let{length:r,nullCount:n}=t;if(r>2147483647)throw new RangeError("Cannot write arrays larger than 2^31 - 1 in length");L.isNull(e)||ci.call(this,n<=0?new Uint8Array(0):$r(t.offset,r,t.nullBitmap)),this.nodes.push(new li(r,n))}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 ci(i){let t=i.byteLength+7&-8;return this.buffers.push(i),this.bufferRegions.push(new Be(this._byteLength,t)),this._byteLength+=t,this}function lI(i){let{type:t,length:e,typeIds:r,valueOffsets:n}=i;if(ci.call(this,r),t.mode===Dt.Sparse)return ll.call(this,i);if(t.mode===Dt.Dense){if(i.offset<=0)return ci.call(this,n),ll.call(this,i);{let o=r.reduce((F,D)=>Math.max(F,D),r[0]),u=new Int32Array(o+1),h=new Int32Array(o+1).fill(-1),m=new Int32Array(e),g=wn(-n[0],e,n);for(let F,D,B=-1;++B<e;)(D=h[F=r[B]])===-1&&(D=h[F]=g[F]),m[B]=g[B]-D,++u[F];ci.call(this,m);for(let F,D=-1,B=t.children.length;++D<B;)if(F=i.children[D]){let k=t.typeIds[D],at=Math.min(e,u[k]);this.visit(F.slice(h[k],at))}}}return this}function cI(i){let t;return i.nullCount>=i.length?ci.call(this,new Uint8Array(0)):(t=i.values)instanceof Uint8Array?ci.call(this,$r(i.offset,i.length,t)):ci.call(this,wr(i.values))}function cr(i){return ci.call(this,i.values.subarray(0,i.length*i.stride))}function kp(i){let{length:t,values:e,valueOffsets:r}=i,n=r[0],o=r[t],u=Math.min(o-n,e.byteLength-n);return ci.call(this,wn(-r[0],t,r)),ci.call(this,e.subarray(n,n+u)),this}function cl(i){let{length:t,valueOffsets:e}=i;return e&&ci.call(this,wn(e[0],t,e)),this.visit(i.children[0])}function ll(i){return this.visitMany(i.type.children.map((t,e)=>i.children[e]).filter(Boolean))[0]}kt.prototype.visitBool=cI;kt.prototype.visitInt=cr;kt.prototype.visitFloat=cr;kt.prototype.visitUtf8=kp;kt.prototype.visitBinary=kp;kt.prototype.visitFixedSizeBinary=cr;kt.prototype.visitDate=cr;kt.prototype.visitTimestamp=cr;kt.prototype.visitTime=cr;kt.prototype.visitDecimal=cr;kt.prototype.visitList=cl;kt.prototype.visitStruct=ll;kt.prototype.visitUnion=lI;kt.prototype.visitInterval=cr;kt.prototype.visitFixedSizeList=cl;kt.prototype.visitMap=cl;var kr=class extends Cr{constructor(t){super(),this._position=0,this._started=!1,this._sink=new ji,this._schema=null,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._dictionaryDeltaOffsets=new Map,fe(t)||(t={autoDestroy:!0,writeLegacyIpcFormat:!1}),this._autoDestroy=typeof t.autoDestroy=="boolean"?t.autoDestroy:!0,this._writeLegacyIpcFormat=typeof t.writeLegacyIpcFormat=="boolean"?t.writeLegacyIpcFormat:!1}static throughNode(t){throw new Error('"throughNode" not available in this environment')}static throughDOM(t,e){throw new Error('"throughDOM" not available in this environment')}toString(t=!1){return this._sink.toString(t)}toUint8Array(t=!1){return this._sink.toUint8Array(t)}writeAll(t){return Ge(t)?t.then(e=>this.writeAll(e)):Pe(t)?dl(this,t):ul(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 ji?this._sink=t:(this._sink=new ji,t&&rh(t)?this.toDOMStream({type:"bytes"}).pipeTo(t):t&&nh(t)&&this.toNodeStream({objectMode:!1}).pipe(t)),this._started&&this._schema&&this._writeFooter(this._schema),this._started=!1,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._dictionaryDeltaOffsets=new Map,(!e||!Tr(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 Rt&&!(e=t.schema))return this.finish()&&void 0;if(t instanceof jt&&!(e=t.schema))return this.finish()&&void 0}else throw new Error("RecordBatchWriter is closed");if(e&&!Tr(e,this._schema)){if(this._started&&this._autoDestroy)return this.close();this.reset(this._sink,e)}t instanceof jt?t instanceof Dr||this._writeRecordBatch(t):t instanceof Rt?this.writeAll(t.batches):Ke(t)&&this.writeAll(t)}_writeMessage(t,e=8){let r=e-1,n=Ht.encode(t),o=n.byteLength,u=this._writeLegacyIpcFormat?4:8,h=o+u+r&~r,m=h-o-u;return t.headerType===ft.RecordBatch?this._recordBatchBlocks.push(new oi(h,t.bodyLength,this._position)):t.headerType===ft.DictionaryBatch&&this._dictionaryBlocks.push(new oi(h,t.bodyLength,this._position)),this._writeLegacyIpcFormat||this._write(Int32Array.of(-1)),this._write(Int32Array.of(h-u)),o>0&&this._write(n),this._writePadding(m)}_write(t){if(this._started){let e=Y(t);e&&e.byteLength>0&&(this._sink.write(e),this._position+=e.byteLength)}return this}_writeSchema(t){return this._writeMessage(Ht.from(t))}_writeFooter(t){return this._writeLegacyIpcFormat?this._write(Int32Array.of(0)):this._write(Int32Array.of(-1,0))}_writeMagic(){return this._write(on)}_writePadding(t){return t>0?this._write(new Uint8Array(t)):this}_writeRecordBatch(t){let{byteLength:e,nodes:r,bufferRegions:n,buffers:o}=kt.assemble(t),u=new re(t.numRows,r,n),h=Ht.from(u,e);return this._writeDictionaries(t)._writeMessage(h)._writeBodyBuffers(o)}_writeDictionaryBatch(t,e,r=!1){this._dictionaryDeltaOffsets.set(e,t.length+(this._dictionaryDeltaOffsets.get(e)||0));let{byteLength:n,nodes:o,bufferRegions:u,buffers:h}=kt.assemble(new G([t])),m=new re(t.length,o,u),g=new Te(m,e,r),F=Ht.from(g,n);return this._writeMessage(F)._writeBodyBuffers(h)}_writeBodyBuffers(t){let e,r,n;for(let o=-1,u=t.length;++o<u;)(e=t[o])&&(r=e.byteLength)>0&&(this._write(e),(n=(r+7&-8)-r)>0&&this._writePadding(n));return this}_writeDictionaries(t){for(let[e,r]of t.dictionaries){let n=this._dictionaryDeltaOffsets.get(e)||0;if(n===0||(r=r==null?void 0:r.slice(n)).length>0)for(let o of r.data)this._writeDictionaryBatch(o,e,n>0),n+=o.length}return this}},$i=class extends kr{static writeAll(t,e){let r=new $i(e);return Ge(t)?t.then(n=>r.writeAll(n)):Pe(t)?dl(r,t):ul(r,t)}},Yi=class extends kr{static writeAll(t){let e=new Yi;return Ge(t)?t.then(r=>e.writeAll(r)):Pe(t)?dl(e,t):ul(e,t)}constructor(){super(),this._autoDestroy=!0}_writeSchema(t){return this._writeMagic()._writePadding(2)}_writeFooter(t){let e=Pi.encode(new Pi(t,Yt.V4,this._recordBatchBlocks,this._dictionaryBlocks));return super._writeFooter(t)._write(e)._write(Int32Array.of(e.byteLength))._writeMagic()}};function ul(i,t){let e=t;t instanceof Rt&&(e=t.batches,i.reset(void 0,t.schema));for(let r of e)i.write(r);return i.finish()}function dl(i,t){var e,r,n,o;return O(this,void 0,void 0,function*(){try{for(e=Ne(t);r=yield e.next(),!r.done;){let u=r.value;i.write(u)}}catch(u){n={error:u}}finally{try{r&&!r.done&&(o=e.return)&&(yield o.call(e))}finally{if(n)throw n.error}}return i.finish()})}function Op(i,t){if(Pe(i))return dI(i,t);if(Ke(i))return uI(i,t);throw new Error("toDOMStream() must be called with an Iterable or AsyncIterable")}function uI(i,t){let e=null,r=(t==null?void 0:t.type)==="bytes"||!1,n=(t==null?void 0:t.highWaterMark)||Math.pow(2,24);return new ReadableStream(Object.assign(Object.assign({},t),{start(u){o(u,e||(e=i[Symbol.iterator]()))},pull(u){e?o(u,e):u.close()},cancel(){((e==null?void 0:e.return)&&e.return()||!0)&&(e=null)}}),Object.assign({highWaterMark:r?n:void 0},t));function o(u,h){let m,g=null,F=u.desiredSize||null;for(;!(g=h.next(r?F:null)).done;)if(ArrayBuffer.isView(g.value)&&(m=Y(g.value))&&(F!=null&&r&&(F=F-m.byteLength+1),g.value=m),u.enqueue(g.value),F!=null&&--F<=0)return;u.close()}}function dI(i,t){let e=null,r=(t==null?void 0:t.type)==="bytes"||!1,n=(t==null?void 0:t.highWaterMark)||Math.pow(2,24);return new ReadableStream(Object.assign(Object.assign({},t),{start(u){return O(this,void 0,void 0,function*(){yield o(u,e||(e=i[Symbol.asyncIterator]()))})},pull(u){return O(this,void 0,void 0,function*(){e?yield o(u,e):u.close()})},cancel(){return O(this,void 0,void 0,function*(){((e==null?void 0:e.return)&&(yield e.return())||!0)&&(e=null)})}}),Object.assign({highWaterMark:r?n:void 0},t));function o(u,h){return O(this,void 0,void 0,function*(){let m,g=null,F=u.desiredSize||null;for(;!(g=yield h.next(r?F:null)).done;)if(ArrayBuffer.isView(g.value)&&(m=Y(g.value))&&(F!=null&&r&&(F=F-m.byteLength+1),g.value=m),u.enqueue(g.value),F!=null&&--F<=0)return;u.close()})}}function Up(i){return new fl(i)}var fl=class{constructor(t){this._numChunks=0,this._finished=!1,this._bufferedSize=0;let{["readableStrategy"]:e,["writableStrategy"]:r,["queueingStrategy"]:n="count"}=t,o=eh(t,["readableStrategy","writableStrategy","queueingStrategy"]);this._controller=null,this._builder=Fr(o),this._getSize=n!=="bytes"?Rp:Mp;let{["highWaterMark"]:u=n==="bytes"?Math.pow(2,14):1e3}=Object.assign({},e),{["highWaterMark"]:h=n==="bytes"?Math.pow(2,14):1e3}=Object.assign({},r);this.readable=new ReadableStream({cancel:()=>{this._builder.clear()},pull:m=>{this._maybeFlush(this._builder,this._controller=m)},start:m=>{this._maybeFlush(this._builder,this._controller=m)}},{highWaterMark:u,size:n!=="bytes"?Rp:Mp}),this.writable=new WritableStream({abort:()=>{this._builder.clear()},write:()=>{this._maybeFlush(this._builder,this._controller)},close:()=>{this._maybeFlush(this._builder.finish(),this._controller)}},{highWaterMark:h,size:m=>this._writeValueAndReturnChunkSize(m)})}_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)}},Rp=i=>{var t;return(t=i==null?void 0:i.length)!==null&&t!==void 0?t:0},Mp=i=>{var t;return(t=i==null?void 0:i.byteLength)!==null&&t!==void 0?t:0};function Go(i,t){let e=new ji,r=null,n=new ReadableStream({cancel(){return O(this,void 0,void 0,function*(){yield e.close()})},start(h){return O(this,void 0,void 0,function*(){yield u(h,r||(r=yield o()))})},pull(h){return O(this,void 0,void 0,function*(){r?yield u(h,r):h.close()})}});return{writable:new WritableStream(e,Object.assign({highWaterMark:Math.pow(2,14)},i)),readable:n};function o(){return O(this,void 0,void 0,function*(){return yield(yield Lt.from(e)).open(t)})}function u(h,m){return O(this,void 0,void 0,function*(){let g=h.desiredSize,F=null;for(;!(F=yield m.next()).done;)if(h.enqueue(F.value),g!=null&&--g<=0)return;h.close()})}}function Ko(i,t){let e=new this(i),r=new Ae(e),n=new ReadableStream({cancel(){return O(this,void 0,void 0,function*(){yield r.cancel()})},pull(u){return O(this,void 0,void 0,function*(){yield o(u)})},start(u){return O(this,void 0,void 0,function*(){yield o(u)})}},Object.assign({highWaterMark:Math.pow(2,14)},t));return{writable:new WritableStream(e,i),readable:n};function o(u){return O(this,void 0,void 0,function*(){let h=null,m=u.desiredSize;for(;h=yield r.read(m||null);)if(u.enqueue(h),m!=null&&(m-=h.byteLength)<=0)return;u.close()})}}function Jo(i,t="stream"){return(t==="stream"?$i:Yi).writeAll(i).toUint8Array(!0)}var yI=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Ca),Ka),Va),Aa),wa),Pa),{compareSchemas:Tr,compareFields:up,compareTypes:dp});te.toDOMStream=Op;Bt.throughDOM=Up;Lt.throughDOM=Go;lr.throughDOM=Go;Ci.throughDOM=Go;kr.throughDOM=Ko;Yi.throughDOM=Ko;$i.throughDOM=Ko;function un(i){switch(i.typeId){case C.Binary:return{sqlType:"binary"};case C.Bool:return{sqlType:"bool"};case C.Date:return{sqlType:"date"};case C.DateDay:return{sqlType:"date32[d]"};case C.DateMillisecond:return{sqlType:"date64[ms]"};case C.Decimal:{let t=i;return{sqlType:"decimal",precision:t.precision,scale:t.scale}}case C.Float:return{sqlType:"float"};case C.Float16:return{sqlType:"float16"};case C.Float32:return{sqlType:"float32"};case C.Float64:return{sqlType:"float64"};case C.Int:return{sqlType:"int32"};case C.Int16:return{sqlType:"int16"};case C.Int32:return{sqlType:"int32"};case C.Int64:return{sqlType:"int64"};case C.Uint16:return{sqlType:"uint16"};case C.Uint32:return{sqlType:"uint32"};case C.Uint64:return{sqlType:"uint64"};case C.Uint8:return{sqlType:"uint8"};case C.IntervalDayTime:return{sqlType:"interval[dt]"};case C.IntervalYearMonth:return{sqlType:"interval[m]"};case C.List:return{sqlType:"list",valueType:un(i.valueType)};case C.FixedSizeBinary:return{sqlType:"fixedsizebinary",byteWidth:i.byteWidth};case C.Null:return{sqlType:"null"};case C.Utf8:return{sqlType:"utf8"};case C.Struct:return{sqlType:"struct",fields:i.children.map(e=>qo(e.name,e.type))};case C.Map:{let t=i;return{sqlType:"map",keyType:un(t.keyType),valueType:un(t.valueType)}}case C.Time:return{sqlType:"time[s]"};case C.TimeMicrosecond:return{sqlType:"time[us]"};case C.TimeMillisecond:return{sqlType:"time[ms]"};case C.TimeNanosecond:return{sqlType:"time[ns]"};case C.TimeSecond:return{sqlType:"time[s]"};case C.Timestamp:return{sqlType:"timestamp",timezone:i.timezone||void 0};case C.TimestampSecond:return{sqlType:"timestamp[s]",timezone:i.timezone||void 0};case C.TimestampMicrosecond:return{sqlType:"timestamp[us]",timezone:i.timezone||void 0};case C.TimestampNanosecond:return{sqlType:"timestamp[ns]",timezone:i.timezone||void 0};case C.TimestampMillisecond:return{sqlType:"timestamp[ms]",timezone:i.timezone||void 0}}throw new Error(`unsupported arrow type: ${i.toString()}`)}function qo(i,t){let e=un(t);return e.name=i,e}var Zo=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){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":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(),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,n)=>n)},[]);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]),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);this.postMessage({messageId:this._nextMessageId++,requestId:t.messageId,type:"QUERY_RESULT_CHUNK",data:e},[e.buffer]);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":this._bindings.registerFileHandle(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"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 this.failWith(t,e)}}};var Pp={};var _I=(()=>{var i=Pp.url;return function(t){t=t||{};var e=typeof t<"u"?t:{},r,n;e.ready=new Promise(function(s,a){r=s,n=a});var o=Object.assign({},e),u=[],h="./this.program",m=(s,a)=>{throw a},g=typeof window=="object",F=typeof importScripts=="function",D=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",B="";function k(s){return e.locateFile?e.locateFile(s,B):B+s}var at,ct,gt,Ot;function ce(s){if(s instanceof as)return;Ye("exiting due to exception: "+s)}if(D){F?B=hl().dirname(B)+"/":B=__dirname+"/";var _e,hr;typeof pa=="function"&&(_e=Np(),hr=hl()),at=(s,a)=>(s=hr.normalize(s),_e.readFileSync(s,a?void 0:"utf8")),gt=s=>{var a=at(s,!0);return a.buffer||(a=new Uint8Array(a)),a},ct=(s,a,l)=>{s=hr.normalize(s),_e.readFile(s,function(c,d){c?l(c):a(d.buffer)})},process.argv.length>1&&(h=process.argv[1].replace(/\\/g,"/")),u=process.argv.slice(2),process.on("uncaughtException",function(s){if(!(s instanceof as))throw s}),process.on("unhandledRejection",function(s){throw s}),m=(s,a)=>{if(Al())throw process.exitCode=s,a;ce(a),process.exit(s)},e.inspect=function(){return"[Emscripten Module object]"}}else(g||F)&&(F?B=self.location.href:typeof document<"u"&&document.currentScript&&(B=document.currentScript.src),i&&(B=i),B.indexOf("blob:")!==0?B=B.substr(0,B.replace(/[?#].*/,"").lastIndexOf("/")+1):B="",at=s=>{var a=new XMLHttpRequest;return a.open("GET",s,!1),a.send(null),a.responseText},F&&(gt=s=>{var a=new XMLHttpRequest;return a.open("GET",s,!1),a.responseType="arraybuffer",a.send(null),new Uint8Array(a.response)}),ct=(s,a,l)=>{var c=new XMLHttpRequest;c.open("GET",s,!0),c.responseType="arraybuffer",c.onload=()=>{if(c.status==200||c.status==0&&c.response){a(c.response);return}l()},c.onerror=l,c.send(null)},Ot=s=>document.title=s);var dn=e.print||console.log.bind(console),Ye=e.printErr||console.warn.bind(console);Object.assign(e,o),o=null,e.arguments&&(u=e.arguments),e.thisProgram&&(h=e.thisProgram),e.quit&&(m=e.quit);var Xi;e.wasmBinary&&(Xi=e.wasmBinary);var fn=e.noExitRuntime||!0;typeof WebAssembly!="object"&&Me("no native wasm support detected");var lt,Zt=!1,ne;function ue(s,a){s||Me(a)}var Qt=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function Wt(s,a,l){a>>>=0;for(var c=a+l,d=a;s[d]&&!(d>=c);)++d;if(d-a>16&&s.buffer&&Qt)return Qt.decode(s.subarray(a,d));for(var f="";a<d;){var p=s[a++];if(!(p&128)){f+=String.fromCharCode(p);continue}var y=s[a++]&63;if((p&224)==192){f+=String.fromCharCode((p&31)<<6|y);continue}var _=s[a++]&63;if((p&240)==224?p=(p&15)<<12|y<<6|_:p=(p&7)<<18|y<<12|_<<6|s[a++]&63,p<65536)f+=String.fromCharCode(p);else{var b=p-65536;f+=String.fromCharCode(55296|b>>10,56320|b&1023)}}return f}function dt(s,a){return s>>>=0,s?Wt(Ki,s,a):""}function me(s,a,l,c){if(l>>>=0,!(c>0))return 0;for(var d=l,f=l+c-1,p=0;p<s.length;++p){var y=s.charCodeAt(p);if(y>=55296&&y<=57343){var _=s.charCodeAt(++p);y=65536+((y&1023)<<10)|_&1023}if(y<=127){if(l>=f)break;a[l++>>>0]=y}else if(y<=2047){if(l+1>=f)break;a[l++>>>0]=192|y>>6,a[l++>>>0]=128|y&63}else if(y<=65535){if(l+2>=f)break;a[l++>>>0]=224|y>>12,a[l++>>>0]=128|y>>6&63,a[l++>>>0]=128|y&63}else{if(l+3>=f)break;a[l++>>>0]=240|y>>18,a[l++>>>0]=128|y>>12&63,a[l++>>>0]=128|y>>6&63,a[l++>>>0]=128|y&63}}return a[l>>>0]=0,l-d}function Gi(s,a,l){return me(s,Ki,a,l)}function Jp(s){for(var a=0,l=0;l<s.length;++l){var c=s.charCodeAt(l);c<=127?a++:c<=2047?a+=2:c>=55296&&c<=57343?(a+=4,++l):a+=3}return a}var vl,Fi,Ki,hn,gl,R,$t,qp,Zp;function wl(s){vl=s,e.HEAP8=Fi=new Int8Array(s),e.HEAP16=hn=new Int16Array(s),e.HEAP32=R=new Int32Array(s),e.HEAPU8=Ki=new Uint8Array(s),e.HEAPU16=gl=new Uint16Array(s),e.HEAPU32=$t=new Uint32Array(s),e.HEAPF32=qp=new Float32Array(s),e.HEAPF64=Zp=new Float64Array(s)}var AI=e.INITIAL_MEMORY||16777216,jl,Sl=[],Il=[],Qp=[],Cl=[],ty=!1;function Al(){return fn}function ey(){if(e.preRun)for(typeof e.preRun=="function"&&(e.preRun=[e.preRun]);e.preRun.length;)sy(e.preRun.shift());ls(Sl)}function iy(){ty=!0,ls(Il)}function ry(){ls(Qp)}function ny(){if(e.postRun)for(typeof e.postRun=="function"&&(e.postRun=[e.postRun]);e.postRun.length;)ay(e.postRun.shift());ls(Cl)}function sy(s){Sl.unshift(s)}function oy(s){Il.unshift(s)}function ay(s){Cl.unshift(s)}var pr=0,oa=null,pn=null;function ly(s){pr++,e.monitorRunDependencies&&e.monitorRunDependencies(pr)}function cy(s){if(pr--,e.monitorRunDependencies&&e.monitorRunDependencies(pr),pr==0&&(oa!==null&&(clearInterval(oa),oa=null),pn)){var a=pn;pn=null,a()}}function Me(s){e.onAbort&&e.onAbort(s),s="Aborted("+s+")",Ye(s),Zt=!0,ne=1,s+=". Build with -sASSERTIONS for more info.";var a=new WebAssembly.RuntimeError(s);throw n(a),a}var uy="data:application/octet-stream;base64,";function Fl(s){return s.startsWith(uy)}var Ue;e.locateFile?(Ue="./duckdb-mvp.wasm",Fl(Ue)||(Ue=k(Ue))):Ue=new URL("./duckdb-mvp.wasm",Pp.url).toString();function xl(s){try{if(s==Ue&&Xi)return new Uint8Array(Xi);if(gt)return gt(s);throw"both async and sync fetching of the wasm failed"}catch(a){Me(a)}}function dy(){return!Xi&&(g||F)&&typeof fetch=="function"?fetch(Ue,{credentials:"same-origin"}).then(function(s){if(!s.ok)throw"failed to load wasm binary file at '"+Ue+"'";return s.arrayBuffer()}).catch(function(){return xl(Ue)}):Promise.resolve().then(function(){return xl(Ue)})}function fy(){var s={a:Z_};function a(p,y){var _=p.exports;e.asm=_,lt=e.asm.kf,wl(lt.buffer),jl=e.asm.nf,oy(e.asm.lf),cy("wasm-instantiate")}ly("wasm-instantiate");function l(p){a(p.instance)}function c(p){return dy().then(function(y){return WebAssembly.instantiate(y,s)}).then(function(y){return y}).then(p,function(y){Ye("failed to asynchronously prepare wasm: "+y),Me(y)})}function d(){return!Xi&&typeof WebAssembly.instantiateStreaming=="function"&&!Fl(Ue)&&!D&&typeof fetch=="function"?fetch(Ue,{credentials:"same-origin"}).then(function(p){var y=WebAssembly.instantiateStreaming(p,s);return y.then(l,function(_){return Ye("wasm streaming compile failed: "+_),Ye("falling back to ArrayBuffer instantiation"),c(l)})}):c(l)}if(e.instantiateWasm)try{var f=e.instantiateWasm(s,a);return f}catch(p){Ye("Module.instantiateWasm callback failed with error: "+p),n(p)}return d().catch(n),{}}function as(s){this.name="ExitStatus",this.message="Program terminated with exit("+s+")",this.status=s}function ls(s){for(;s.length>0;)s.shift()(e)}function hy(s,a,l,c){Me("Assertion failed: "+dt(s)+", at: "+[a?dt(a):"unknown filename",l,c?dt(c):"unknown function"])}function py(s){return bs(s+24)+24}var cs=[];function yy(s){s.add_ref()}var us=0;function _y(s){var a=new xi(s);return a.get_caught()||(a.set_caught(!0),us--),a.set_rethrown(!1),cs.push(a),yy(a),a.get_exception_ptr()}var Xe=0;function xi(s){this.excPtr=s,this.ptr=s-24,this.set_type=function(a){$t[this.ptr+4>>>2]=a},this.get_type=function(){return $t[this.ptr+4>>>2]},this.set_destructor=function(a){$t[this.ptr+8>>>2]=a},this.get_destructor=function(){return $t[this.ptr+8>>>2]},this.set_refcount=function(a){R[this.ptr>>>2]=a},this.set_caught=function(a){a=a?1:0,Fi[this.ptr+12>>>0]=a},this.get_caught=function(){return Fi[this.ptr+12>>>0]!=0},this.set_rethrown=function(a){a=a?1:0,Fi[this.ptr+13>>>0]=a},this.get_rethrown=function(){return Fi[this.ptr+13>>>0]!=0},this.init=function(a,l){this.set_adjusted_ptr(0),this.set_type(a),this.set_destructor(l),this.set_refcount(0),this.set_caught(!1),this.set_rethrown(!1)},this.add_ref=function(){var a=R[this.ptr>>>2];R[this.ptr>>>2]=a+1},this.release_ref=function(){var a=R[this.ptr>>>2];return R[this.ptr>>>2]=a-1,a===1},this.set_adjusted_ptr=function(a){$t[this.ptr+16>>>2]=a},this.get_adjusted_ptr=function(){return $t[this.ptr+16>>>2]},this.get_exception_ptr=function(){var a=Vl(this.get_type());if(a)return $t[this.excPtr>>>2];var l=this.get_adjusted_ptr();return l!==0?l:this.excPtr}}function Bl(s){return Pl(new xi(s).ptr)}var ds=[];function U(s){var a=ds[s];return a||(s>=ds.length&&(ds.length=s+1),ds[s]=a=jl.get(s)),a}function my(s){if(s.release_ref()&&!s.get_rethrown()){var a=s.get_destructor();a&&U(a)(s.excPtr),Bl(s.excPtr)}}function by(){w(0);var s=cs.pop();my(s),Xe=0}function vy(s){throw Xe||(Xe=s),s}function gy(){var s=Xe;if(!s)return Ft(0),0;var a=new xi(s);a.set_adjusted_ptr(s);var l=a.get_type();if(!l)return Ft(0),s;for(var c=0;c<arguments.length;c++){var d=arguments[c];if(d===0||d===l)break;var f=a.ptr+16;if(_r(d,l,f))return Ft(d),s}return Ft(l),s}function wy(){var s=Xe;if(!s)return Ft(0),0;var a=new xi(s);a.set_adjusted_ptr(s);var l=a.get_type();if(!l)return Ft(0),s;for(var c=0;c<arguments.length;c++){var d=arguments[c];if(d===0||d===l)break;var f=a.ptr+16;if(_r(d,l,f))return Ft(d),s}return Ft(l),s}function jy(){var s=Xe;if(!s)return Ft(0),0;var a=new xi(s);a.set_adjusted_ptr(s);var l=a.get_type();if(!l)return Ft(0),s;for(var c=0;c<arguments.length;c++){var d=arguments[c];if(d===0||d===l)break;var f=a.ptr+16;if(_r(d,l,f))return Ft(d),s}return Ft(l),s}function Sy(){var s=Xe;if(!s)return Ft(0),0;var a=new xi(s);a.set_adjusted_ptr(s);var l=a.get_type();if(!l)return Ft(0),s;for(var c=0;c<arguments.length;c++){var d=arguments[c];if(d===0||d===l)break;var f=a.ptr+16;if(_r(d,l,f))return Ft(d),s}return Ft(l),s}function Iy(){var s=Xe;if(!s)return Ft(0),0;var a=new xi(s);a.set_adjusted_ptr(s);var l=a.get_type();if(!l)return Ft(0),s;for(var c=0;c<arguments.length;c++){var d=arguments[c];if(d===0||d===l)break;var f=a.ptr+16;if(_r(d,l,f))return Ft(d),s}return Ft(l),s}function Cy(){var s=Xe;if(!s)return Ft(0),0;var a=new xi(s);a.set_adjusted_ptr(s);var l=a.get_type();if(!l)return Ft(0),s;for(var c=0;c<arguments.length;c++){var d=arguments[c];if(d===0||d===l)break;var f=a.ptr+16;if(_r(d,l,f))return Ft(d),s}return Ft(l),s}function Ay(){var s=cs.pop();s||Me("no exception to throw");var a=s.excPtr;throw s.get_rethrown()||(cs.push(s),s.set_rethrown(!0),s.set_caught(!1),us++),Xe=a,a}function Fy(s,a,l){var c=new xi(s);throw c.init(a,l),Xe=s,us++,s}function xy(){return us}var yr={varargs:void 0,get:function(){yr.varargs+=4;var s=R[yr.varargs-4>>>2];return s},getStr:function(s){var a=dt(s);return a}};function By(s,a,l,c,d){for(var f=0,p=a?R[a>>>2]:0,y=a?R[a+4>>>2]:0,_=l?R[l>>>2]:0,b=l?R[l+4>>>2]:0,v=c?R[c>>>2]:0,I=c?R[c+4>>>2]:0,A=0,T=0,E=0,$=0,ut=0,wt=0,x=(a?R[a>>>2]:0)|(l?R[l>>>2]:0)|(c?R[c>>>2]:0),M=(a?R[a+4>>>2]:0)|(l?R[l+4>>>2]:0)|(c?R[c+4>>>2]:0),vt=function(Aw,Fw,xw,Bf){return Aw<32?Fw&Bf:xw&Bf},mt=0;mt<s;mt++){var de=1<<mt%32;if(!!vt(mt,x,M,de)){var mn=yr.getStreamFromFD(mt),gs=yr.DEFAULT_POLLMASK;mn.stream_ops.poll&&(gs=mn.stream_ops.poll(mn)),gs&1&&vt(mt,p,y,de)&&(mt<32?A=A|de:T=T|de,f++),gs&4&&vt(mt,_,b,de)&&(mt<32?E=E|de:$=$|de,f++),gs&2&&vt(mt,v,I,de)&&(mt<32?ut=ut|de:wt=wt|de,f++)}}return a&&(R[a>>>2]=A,R[a+4>>>2]=T),l&&(R[l>>>2]=E,R[l+4>>>2]=$),c&&(R[c>>>2]=ut,R[c+4>>>2]=wt),f}function Ty(){Ye("missing function: $SOCKFS"),Me(-1)}function Tl(){Ye("missing function: $FS"),Me(-1)}function yn(s){var a=Ty.getSocket(s);if(!a)throw new Tl.ErrnoError(8);return a}function aa(s){return(s&255)+"."+(s>>8&255)+"."+(s>>16&255)+"."+(s>>24&255)}function Dl(s){var a="",l=0,c=0,d=0,f=0,p=0,y=0,_=[s[0]&65535,s[0]>>16,s[1]&65535,s[1]>>16,s[2]&65535,s[2]>>16,s[3]&65535,s[3]>>16],b=!0,v="";for(y=0;y<5;y++)if(_[y]!==0){b=!1;break}if(b){if(v=aa(_[6]|_[7]<<16),_[5]===-1)return a="::ffff:",a+=v,a;if(_[5]===0)return a="::",v==="0.0.0.0"&&(v=""),v==="0.0.0.1"&&(v="1"),a+=v,a}for(l=0;l<8;l++)_[l]===0&&(l-d>1&&(p=0),d=l,p++),p>c&&(c=p,f=l-c+1);for(l=0;l<8;l++){if(c>1&&_[l]===0&&l>=f&&l<f+c){l===f&&(a+=":",f===0&&(a+=":"));continue}a+=Number(fa(_[l]&65535)).toString(16),a+=l<7?":":""}return a}function El(s,a){var l=hn[s>>>1],c=fa(gl[s+2>>>1]),d;switch(l){case 2:if(a!==16)return{errno:28};d=R[s+4>>>2],d=aa(d);break;case 10:if(a!==28)return{errno:28};d=[R[s+8>>>2],R[s+12>>>2],R[s+16>>>2],R[s+20>>>2]],d=Dl(d);break;default:return{errno:5}}return{family:l,addr:d,port:c}}function fs(s){for(var a=s.split("."),l=0;l<4;l++){var c=Number(a[l]);if(isNaN(c))return null;a[l]=c}return(a[0]|a[1]<<8|a[2]<<16|a[3]<<24)>>>0}function hs(s){return parseInt(s)}function la(s){var a,l,c,d,f=/^((?=.*::)(?!.*::.+::)(::)?([\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,p=[];if(!f.test(s))return null;if(s==="::")return[0,0,0,0,0,0,0,0];for(s.startsWith("::")?s=s.replace("::","Z:"):s=s.replace("::",":Z:"),s.indexOf(".")>0?(s=s.replace(new RegExp("[.]","g"),":"),a=s.split(":"),a[a.length-4]=hs(a[a.length-4])+hs(a[a.length-3])*256,a[a.length-3]=hs(a[a.length-2])+hs(a[a.length-1])*256,a=a.slice(0,a.length-2)):a=s.split(":"),c=0,d=0,l=0;l<a.length;l++)if(typeof a[l]=="string")if(a[l]==="Z"){for(d=0;d<8-a.length+1;d++)p[l+d]=0;c=d-1}else p[l+c]=ms(parseInt(a[l],16));else p[l+c]=a[l];return[p[1]<<16|p[0],p[3]<<16|p[2],p[5]<<16|p[4],p[7]<<16|p[6]]}var Le={address_map:{id:1,addrs:{},names:{}},lookup_name:function(s){var a=fs(s);if(a!==null||(a=la(s),a!==null))return s;var l;if(Le.address_map.addrs[s])l=Le.address_map.addrs[s];else{var c=Le.address_map.id++;ue(c<65535,"exceeded max address mappings of 65535"),l="172.29."+(c&255)+"."+(c&65280),Le.address_map.names[l]=s,Le.address_map.addrs[s]=l}return l},lookup_addr:function(s){return Le.address_map.names[s]?Le.address_map.names[s]:null}};function kl(s,a,l){if(l&&s===0)return null;var c=El(s,a);if(c.errno)throw new Tl.ErrnoError(c.errno);return c.addr=Le.lookup_addr(c.addr)||c.addr,c}function Dy(s,a,l){var c=yn(s),d=kl(a,l);return c.sock_ops.bind(c,d.addr,d.port),0}function Ey(s,a,l){var c=yn(s),d=kl(a,l);return c.sock_ops.connect(c,d.addr,d.port),0}function ky(s,a,l,c){}function Oy(s,a,l){return yr.varargs=l,0}function Ry(s,a){}function My(s,a,l){}function Uy(s,a,l){}function Ol(s,a){return Ki.fill(0,s,s+a),s}function ca(s,a,l,c,d){switch(a){case 2:l=fs(l),Ol(s,16),d&&(R[d>>>2]=16),hn[s>>>1]=a,R[s+4>>>2]=l,hn[s+2>>>1]=ms(c);break;case 10:l=la(l),Ol(s,28),d&&(R[d>>>2]=28),R[s>>>2]=a,R[s+8>>>2]=l[0],R[s+12>>>2]=l[1],R[s+16>>>2]=l[2],R[s+20>>>2]=l[3],hn[s+2>>>1]=ms(c);break;default:return 5}return 0}function Ly(s,a,l){var c=yn(s);if(!c.daddr)return-53;var d=ca(a,c.family,Le.lookup_name(c.daddr),c.dport,l);return 0}function Ny(s,a,l,c,d){var f=yn(s);return a===1&&l===4?(R[c>>>2]=f.error,R[d>>>2]=4,f.error=null,0):-50}function Py(s,a,l){return yr.varargs=l,0}function Vy(s,a){}function Hy(s,a,l){}function zy(s,a,l,c){}function Wy(s,a,l,c){yr.varargs=c}function $y(s,a,l,c,d,f){var p=yn(s),y=p.sock_ops.recvmsg(p,l);if(!y)return 0;if(d)var _=ca(d,p.family,Le.lookup_name(y.addr),y.port,f);return Ki.set(y.buffer,a>>>0),y.buffer.byteLength}function Yy(s,a,l,c){}function Xy(s){}function Gy(s,a,l,c,d,f){}function Ky(s,a,l){}function Jy(s,a){}function qy(s,a,l){}function Zy(s){}var Rl="To use dlopen, you need enable dynamic linking, see https://github.com/emscripten-core/emscripten/wiki/Linking";function Qy(s,a){Me(Rl)}function t_(s,a){Me(Rl)}var e_=!0;function i_(){return e_}function r_(){Me("")}function n_(s,a){return globalThis.DUCKDB_RUNTIME.createDirectory(e,s,a)}function s_(s,a){return globalThis.DUCKDB_RUNTIME.checkDirectory(e,s,a)}function o_(s,a){return globalThis.DUCKDB_RUNTIME.listDirectoryEntries(e,s,a)}function a_(s,a){return globalThis.DUCKDB_RUNTIME.removeDirectory(e,s,a)}function l_(s){return globalThis.DUCKDB_RUNTIME.closeFile(e,s)}function c_(s,a){return globalThis.DUCKDB_RUNTIME.checkFile(e,s,a)}function u_(s){return globalThis.DUCKDB_RUNTIME.getLastFileModificationTime(e,s)}function d_(s,a,l,c){return globalThis.DUCKDB_RUNTIME.moveFile(e,s,a,l,c)}function f_(s,a){return globalThis.DUCKDB_RUNTIME.openFile(e,s,a)}function h_(s,a,l,c){return globalThis.DUCKDB_RUNTIME.readFile(e,s,a,l,c)}function p_(s,a){return globalThis.DUCKDB_RUNTIME.truncateFile(e,s,a)}function y_(s,a,l,c){return globalThis.DUCKDB_RUNTIME.writeFile(e,s,a,l,c)}function __(s){return globalThis.DUCKDB_RUNTIME.getDefaultDataProtocol(s)}function m_(s,a){return globalThis.DUCKDB_RUNTIME.glob(e,s,a)}function b_(s){return globalThis.DUCKDB_RUNTIME.testPlatformFeature(e,s)}function v_(s,a,l,c,d,f){return globalThis.DUCKDB_RUNTIME.callScalarUDF(e,s,a,l,c,d,f)}function g_(){return Date.now()}function Ml(){return 4294901760}function w_(){return Ml()}var ua;D?ua=()=>{var s=process.hrtime();return s[0]*1e3+s[1]/1e6}:ua=()=>performance.now();function j_(s,a,l){Ki.copyWithin(s>>>0,a>>>0,a+l>>>0)}function S_(s){try{return lt.grow(s-vl.byteLength+65535>>>16),wl(lt.buffer),1}catch(a){}}function I_(s){var a=Ki.length;s=s>>>0;var l=Ml();if(s>l)return!1;let c=(_,b)=>_+(b-_%b)%b;for(var d=1;d<=4;d*=2){var f=a*(1+.2/d);f=Math.min(f,s+100663296);var p=Math.min(l,c(Math.max(s,f),65536)),y=S_(p);if(y)return!0}return!1}var da={};function C_(){return h||"./this.program"}function _n(){if(!_n.strings){var s=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",a={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:s,_:C_()};for(var l in da)da[l]===void 0?delete a[l]:a[l]=da[l];var c=[];for(var l in a)c.push(l+"="+a[l]);_n.strings=c}return _n.strings}function A_(s,a,l){for(var c=0;c<s.length;++c)Fi[a++>>>0]=s.charCodeAt(c);l||(Fi[a>>>0]=0)}function F_(s,a){var l=0;return _n().forEach(function(c,d){var f=a+l;$t[s+d*4>>>2]=f,A_(c,f),l+=c.length+1}),0}function x_(s,a){var l=_n();$t[s>>>2]=l.length;var c=0;return l.forEach(function(d){c+=d.length+1}),$t[a>>>2]=c,0}function B_(s){return 52}function T_(s,a,l,c,d,f){return 52}function D_(s,a,l,c,d,f){return 52}function E_(s,a,l,c){return 52}function k_(s,a,l,c,d){return 70}function O_(s){return 52}var R_=[null,[],[]];function M_(s,a){var l=R_[s];a===0||a===10?((s===1?dn:Ye)(Wt(l,0)),l.length=0):l.push(a)}function U_(s,a,l,c){for(var d=0,f=0;f<l;f++){var p=$t[a>>>2],y=$t[a+4>>>2];a+=8;for(var _=0;_<y;_++)M_(s,Ki[p+_>>>0]);d+=y}return $t[c>>>2]=d,0}function L_(s,a,l,c){var d=0,f=0,p=0,y=0,_=0,b=0,v;function I(A,T,E,$,ut,wt){var x,M,vt,mt;return M=A===10?28:16,ut=A===10?Dl(ut):aa(ut),x=bs(M),mt=ca(x,A,ut,wt),ue(!mt),vt=bs(32),R[vt+4>>>2]=A,R[vt+8>>>2]=T,R[vt+12>>>2]=E,R[vt+24>>>2]=$,$t[vt+20>>>2]=x,A===10?R[vt+16>>>2]=28:R[vt+16>>>2]=16,R[vt+28>>>2]=0,vt}if(l&&(p=R[l>>>2],y=R[l+4>>>2],_=R[l+8>>>2],b=R[l+12>>>2]),_&&!b&&(b=_===2?17:6),!_&&b&&(_=b===17?2:1),b===0&&(b=6),_===0&&(_=1),!s&&!a)return-2;if(p&-1088||l!==0&&R[l>>>2]&2&&!s)return-1;if(p&32)return-2;if(_!==0&&_!==1&&_!==2)return-7;if(y!==0&&y!==2&&y!==10)return-6;if(a&&(a=dt(a),f=parseInt(a,10),isNaN(f)))return p&1024?-2:-8;if(!s)return y===0&&(y=2),(p&1)===0&&(y===2?d=_s(2130706433):d=[0,0,0,1]),v=I(y,_,b,null,d,f),$t[c>>>2]=v,0;if(s=dt(s),d=fs(s),d!==null)if(y===0||y===2)y=2;else if(y===10&&p&8)d=[0,0,_s(65535),d],y=10;else return-2;else if(d=la(s),d!==null)if(y===0||y===10)y=10;else return-2;return d!=null?(v=I(y,_,b,s,d,f),$t[c>>>2]=v,0):p&4?-2:(s=Le.lookup_name(s),d=fs(s),y===0?y=2:y===10&&(d=[0,0,_s(65535),d]),v=I(y,_,b,null,d,f),$t[c>>>2]=v,0)}function N_(){if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function"){var s=new Uint8Array(1);return()=>(crypto.getRandomValues(s),s[0])}else if(D)try{var a=pa("crypto");return()=>a.randomBytes(1)[0]}catch(l){}return()=>Me("randomDevice")}function ps(s,a){ps.randomDevice||(ps.randomDevice=N_());for(var l=0;l<a;l++)Fi[s+l>>>0]=ps.randomDevice();return 0}function P_(s,a,l,c,d,f,p){var y=El(s,a);if(y.errno)return-6;var _=y.port,b=y.addr,v=!1;if(l&&c){var I;if(p&1||!(I=Le.lookup_addr(b))){if(p&8)return-2}else b=I;var A=Gi(b,l,c);A+1>=c&&(v=!0)}if(d&&f){_=""+_;var A=Gi(_,d,f);A+1>=f&&(v=!0)}return v?-12:0}function V_(s){return s}function ys(s){return s%4===0&&(s%100!==0||s%400===0)}function H_(s,a){for(var l=0,c=0;c<=a;l+=s[c++]);return l}var Ul=[31,29,31,30,31,30,31,31,30,31,30,31],Ll=[31,28,31,30,31,30,31,31,30,31,30,31];function z_(s,a){for(var l=new Date(s.getTime());a>0;){var c=ys(l.getFullYear()),d=l.getMonth(),f=(c?Ul:Ll)[d];if(a>f-l.getDate())a-=f-l.getDate()+1,l.setDate(1),d<11?l.setMonth(d+1):(l.setMonth(0),l.setFullYear(l.getFullYear()+1));else return l.setDate(l.getDate()+a),l}return l}function W_(s,a,l){var c=l>0?l:Jp(s)+1,d=new Array(c),f=me(s,d,0,d.length);return a&&(d.length=f),d}function Nl(s,a){Fi.set(s,a>>>0)}function $_(s,a,l,c){var d=R[c+40>>>2],f={tm_sec:R[c>>>2],tm_min:R[c+4>>>2],tm_hour:R[c+8>>>2],tm_mday:R[c+12>>>2],tm_mon:R[c+16>>>2],tm_year:R[c+20>>>2],tm_wday:R[c+24>>>2],tm_yday:R[c+28>>>2],tm_isdst:R[c+32>>>2],tm_gmtoff:R[c+36>>>2],tm_zone:d?dt(d):""},p=dt(l),y={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var _ in y)p=p.replace(new RegExp(_,"g"),y[_]);var b=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],v=["January","February","March","April","May","June","July","August","September","October","November","December"];function I(x,M,vt){for(var mt=typeof x=="number"?x.toString():x||"";mt.length<M;)mt=vt[0]+mt;return mt}function A(x,M){return I(x,M,"0")}function T(x,M){function vt(de){return de<0?-1:de>0?1:0}var mt;return(mt=vt(x.getFullYear()-M.getFullYear()))===0&&(mt=vt(x.getMonth()-M.getMonth()))===0&&(mt=vt(x.getDate()-M.getDate())),mt}function E(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 $(x){var M=z_(new Date(x.tm_year+1900,0,1),x.tm_yday),vt=new Date(M.getFullYear(),0,4),mt=new Date(M.getFullYear()+1,0,4),de=E(vt),mn=E(mt);return T(de,M)<=0?T(mn,M)<=0?M.getFullYear()+1:M.getFullYear():M.getFullYear()-1}var ut={"%a":function(x){return b[x.tm_wday].substring(0,3)},"%A":function(x){return b[x.tm_wday]},"%b":function(x){return v[x.tm_mon].substring(0,3)},"%B":function(x){return v[x.tm_mon]},"%C":function(x){var M=x.tm_year+1900;return A(M/100|0,2)},"%d":function(x){return A(x.tm_mday,2)},"%e":function(x){return I(x.tm_mday,2," ")},"%g":function(x){return $(x).toString().substring(2)},"%G":function(x){return $(x)},"%H":function(x){return A(x.tm_hour,2)},"%I":function(x){var M=x.tm_hour;return M==0?M=12:M>12&&(M-=12),A(M,2)},"%j":function(x){return A(x.tm_mday+H_(ys(x.tm_year+1900)?Ul:Ll,x.tm_mon-1),3)},"%m":function(x){return A(x.tm_mon+1,2)},"%M":function(x){return A(x.tm_min,2)},"%n":function(){return`
11
+ `},"%p":function(x){return x.tm_hour>=0&&x.tm_hour<12?"AM":"PM"},"%S":function(x){return A(x.tm_sec,2)},"%t":function(){return" "},"%u":function(x){return x.tm_wday||7},"%U":function(x){var M=x.tm_yday+7-x.tm_wday;return A(Math.floor(M/7),2)},"%V":function(x){var M=Math.floor((x.tm_yday+7-(x.tm_wday+6)%7)/7);if((x.tm_wday+371-x.tm_yday-2)%7<=2&&M++,M){if(M==53){var mt=(x.tm_wday+371-x.tm_yday)%7;mt!=4&&(mt!=3||!ys(x.tm_year))&&(M=1)}}else{M=52;var vt=(x.tm_wday+7-x.tm_yday-1)%7;(vt==4||vt==5&&ys(x.tm_year%400-1))&&M++}return A(M,2)},"%w":function(x){return x.tm_wday},"%W":function(x){var M=x.tm_yday+7-(x.tm_wday+6)%7;return A(Math.floor(M/7),2)},"%y":function(x){return(x.tm_year+1900).toString().substring(2)},"%Y":function(x){return x.tm_year+1900},"%z":function(x){var M=x.tm_gmtoff,vt=M>=0;return M=Math.abs(M)/60,M=M/60*100+M%60,(vt?"+":"-")+String("0000"+M).slice(-4)},"%Z":function(x){return x.tm_zone},"%%":function(){return"%"}};p=p.replace(/%%/g,"\0\0");for(var _ in ut)p.includes(_)&&(p=p.replace(new RegExp(_,"g"),ut[_](f)));p=p.replace(/\0\0/g,"%");var wt=W_(p,!1);return wt.length>a?0:(Nl(wt,s),wt.length-1)}function Y_(s,a,l,c,d){return $_(s,a,l,c)}function X_(s){ne=s,Al()||(e.onExit&&e.onExit(s),Zt=!0),m(s,new as(s))}function G_(s,a){ne=s,X_(s)}function K_(s){if(s instanceof as||s=="unwind")return ne;m(1,s)}function J_(s){var a=e["_"+s];return a}function q_(s,a,l,c,d){var f={string:E=>{var $=0;if(E!=null&&E!==0){var ut=(E.length<<2)+1;$=ha(ut),Gi(E,$,ut)}return $},array:E=>{var $=ha(E.length);return Nl(E,$),$}};function p(E){return a==="string"?dt(E):a==="boolean"?Boolean(E):E}var y=J_(s),_=[],b=0;if(c)for(var v=0;v<c.length;v++){var I=f[l[v]];I?(b===0&&(b=j()),_[v]=I(c[v])):_[v]=c[v]}var A=y.apply(null,_);function T(E){return b!==0&&S(b),p(E)}return A=T(A),A}var Z_={p:hy,i:py,B:_y,G:by,a:gy,m:wy,F:jy,R:Sy,V:Iy,xa:Cy,h:Bl,ga:Ay,w:Fy,I:xy,d:vy,Ca:By,Ga:Dy,Fa:Ey,gf:ky,T:Oy,Ta:Ry,Ie:My,Pa:Uy,Aa:Ly,Ba:Ny,Va:Py,Qa:Vy,Ua:Hy,Ra:zy,oa:Wy,Da:$y,ef:Yy,ma:Xy,Ea:Gy,ja:Ky,Sa:Jy,na:qy,Ia:Zy,Ka:Qy,Ja:t_,Wa:i_,ba:r_,Ze:n_,_e:s_,Xe:o_,Ye:a_,va:l_,Ve:c_,eb:u_,We:d_,af:f_,ea:h_,$e:p_,wa:y_,bf:__,Ue:m_,ua:b_,cf:v_,Xa:g_,Ya:w_,Re:ua,Hb:j_,Ad:I_,bb:F_,mb:x_,Z:B_,He:T_,yb:D_,qa:E_,Qe:k_,ff:O_,ha:U_,Ha:L_,Oa:ps,za:P_,sa:Pb,M:_b,_:Tb,ia:Km,S:Db,Zb:T0,ta:Nb,$:db,ra:Gm,_b:B0,v:eb,ka:yb,t:vb,aa:Fb,la:pb,u:bb,c:Vm,fa:kb,P:gb,b:Hm,X:Cb,Ub:R0,Pb:P0,g:Wm,La:Eb,Nb:H0,l:Xm,pa:lb,n:$m,Ma:Ab,x:rb,y:Zm,O:fb,U:hb,da:Qm,z:nb,A:tb,H:Bb,s:mb,bc:A0,Tb:M0,jc:b0,qe:fv,Lb:W0,cc:C0,Ob:V0,$b:x0,_d:Tv,re:dv,Hc:Gg,Sb:U0,db:gw,jd:bg,Me:Yb,Yb:D0,Qd:Pv,Yc:Dg,fc:j0,Le:Xb,Cb:Z0,_a:Iw,pe:hv,ac:F0,Xb:E0,vd:og,se:uv,hd:gg,id:vg,Mb:z0,Db:q0,we:ov,fe:Sv,Zd:Dv,Rd:Nv,Nd:zv,ke:bv,pb:uw,De:Qb,ge:jv,gd:wg,Qb:N0,Rb:L0,Bb:Q0,je:vv,cb:ww,sd:cg,Ke:Gb,ne:yv,me:_v,ve:av,Vd:Rv,kb:pw,kc:m0,$d:Bv,Xd:kv,Wd:Ov,Md:Wv,Ld:$v,Ed:Zv,Uc:Rg,yc:r0,Gd:Jv,vc:o0,Bd:eg,zc:i0,Ge:Jb,Jc:Yg,Ic:Xg,Pe:zb,Oe:Wb,oe:pv,Te:Vb,xd:ng,Ec:qg,dc:I0,Gc:Kg,Ib:X0,Wc:kg,gc:w0,Jb:Y0,rd:ug,ld:_g,Pc:Pg,Gb:G0,Ab:tw,ic:v0,be:Fv,nd:pg,ed:Sg,Qc:Ng,Dc:Zg,ae:xv,bd:Ag,$a:Sw,_c:Bg,rb:lw,ad:Fg,xe:sv,lc:_0,Ac:e0,rc:u0,mc:y0,nc:p0,qc:d0,o:Nm,hf:Mb,jf:Rb,j:zm,D:jb,ub:sw,J:wb,vb:nw,e:Pm,Q:Jm,Y:xb,f:qm,k:Ym,df:Lb,r:ub,q:ab,ya:Ob,C:ib,L:cb,W:Ib,K:sb,N:Ub,Na:Sb,ca:ob,Kd:Yv,Wb:k0,tb:ow,kd:mg,tc:l0,wc:s0,xb:iw,nb:fw,ze:rv,Fc:Jg,wd:sg,Vb:O0,Cd:tg,Dd:Qv,sc:c0,Rc:Lg,Ae:iv,Kb:$0,ye:nv,zd:ig,Jd:Xv,Zc:Tg,Nc:Hg,Eb:J0,ab:jw,Fb:K0,hc:g0,lb:hw,te:cv,de:Cv,fd:jg,Lc:Wg,Tc:Mg,Hd:Kv,Vc:Og,jb:yw,Fe:qb,Je:Kb,Ne:$b,yd:rg,Pd:Vv,Od:Hv,oc:h0,Oc:Vg,dd:Ig,$c:xg,md:yg,ob:dw,ee:Iv,ib:_w,Mc:zg,qb:cw,Se:Hb,Ce:tv,ec:S0,le:mv,he:wv,ie:gv,pd:fg,Fd:qv,Be:ev,ue:lv,ud:ag,Yd:Ev,Sd:Lv,Td:Uv,cd:Cg,wb:rw,td:lg,Cc:Qg,Kc:$g,Id:Gv,hb:mw,Sc:Ug,sb:aw,Ud:Mv,Xc:Eg,fb:vw,gb:bw,Bc:t0,Ee:Zb,qd:dg,zb:ew,uc:a0,xc:n0,pc:f0,ce:Av,od:hg,E:V_,Za:Y_},FI=fy(),Q_=e.___wasm_call_ctors=function(){return(Q_=e.___wasm_call_ctors=e.asm.lf).apply(null,arguments)},tm=e._main=function(){return(tm=e._main=e.asm.mf).apply(null,arguments)},em=e._duckdb_web_fs_glob_add_path=function(){return(em=e._duckdb_web_fs_glob_add_path=e.asm.of).apply(null,arguments)},im=e._duckdb_web_clear_response=function(){return(im=e._duckdb_web_clear_response=e.asm.pf).apply(null,arguments)},rm=e._duckdb_web_fail_with=function(){return(rm=e._duckdb_web_fail_with=e.asm.qf).apply(null,arguments)},nm=e._duckdb_web_reset=function(){return(nm=e._duckdb_web_reset=e.asm.rf).apply(null,arguments)},sm=e._duckdb_web_connect=function(){return(sm=e._duckdb_web_connect=e.asm.sf).apply(null,arguments)},om=e._duckdb_web_disconnect=function(){return(om=e._duckdb_web_disconnect=e.asm.tf).apply(null,arguments)},am=e._duckdb_web_flush_files=function(){return(am=e._duckdb_web_flush_files=e.asm.uf).apply(null,arguments)},lm=e._duckdb_web_flush_file=function(){return(lm=e._duckdb_web_flush_file=e.asm.vf).apply(null,arguments)},cm=e._duckdb_web_open=function(){return(cm=e._duckdb_web_open=e.asm.wf).apply(null,arguments)},um=e._duckdb_web_get_global_file_info=function(){return(um=e._duckdb_web_get_global_file_info=e.asm.xf).apply(null,arguments)},dm=e._duckdb_web_collect_file_stats=function(){return(dm=e._duckdb_web_collect_file_stats=e.asm.yf).apply(null,arguments)},fm=e._duckdb_web_export_file_stats=function(){return(fm=e._duckdb_web_export_file_stats=e.asm.zf).apply(null,arguments)},hm=e._duckdb_web_fs_drop_file=function(){return(hm=e._duckdb_web_fs_drop_file=e.asm.Af).apply(null,arguments)},pm=e._duckdb_web_fs_drop_files=function(){return(pm=e._duckdb_web_fs_drop_files=e.asm.Bf).apply(null,arguments)},ym=e._duckdb_web_fs_glob_file_infos=function(){return(ym=e._duckdb_web_fs_glob_file_infos=e.asm.Cf).apply(null,arguments)},_m=e._duckdb_web_fs_get_file_info_by_id=function(){return(_m=e._duckdb_web_fs_get_file_info_by_id=e.asm.Df).apply(null,arguments)},mm=e._duckdb_web_fs_get_file_info_by_name=function(){return(mm=e._duckdb_web_fs_get_file_info_by_name=e.asm.Ef).apply(null,arguments)},bm=e._duckdb_web_fs_register_file_url=function(){return(bm=e._duckdb_web_fs_register_file_url=e.asm.Ff).apply(null,arguments)},vm=e._duckdb_web_fs_register_file_buffer=function(){return(vm=e._duckdb_web_fs_register_file_buffer=e.asm.Gf).apply(null,arguments)},gm=e._duckdb_web_copy_file_to_buffer=function(){return(gm=e._duckdb_web_copy_file_to_buffer=e.asm.Hf).apply(null,arguments)},wm=e._duckdb_web_copy_file_to_path=function(){return(wm=e._duckdb_web_copy_file_to_path=e.asm.If).apply(null,arguments)},jm=e._duckdb_web_get_version=function(){return(jm=e._duckdb_web_get_version=e.asm.Jf).apply(null,arguments)},Sm=e._duckdb_web_get_feature_flags=function(){return(Sm=e._duckdb_web_get_feature_flags=e.asm.Kf).apply(null,arguments)},Im=e._duckdb_web_tokenize=function(){return(Im=e._duckdb_web_tokenize=e.asm.Lf).apply(null,arguments)},Cm=e._duckdb_web_udf_scalar_create=function(){return(Cm=e._duckdb_web_udf_scalar_create=e.asm.Mf).apply(null,arguments)},Am=e._duckdb_web_prepared_create=function(){return(Am=e._duckdb_web_prepared_create=e.asm.Nf).apply(null,arguments)},Fm=e._duckdb_web_prepared_close=function(){return(Fm=e._duckdb_web_prepared_close=e.asm.Of).apply(null,arguments)},xm=e._duckdb_web_prepared_run=function(){return(xm=e._duckdb_web_prepared_run=e.asm.Pf).apply(null,arguments)},Bm=e._duckdb_web_prepared_send=function(){return(Bm=e._duckdb_web_prepared_send=e.asm.Qf).apply(null,arguments)},Tm=e._duckdb_web_query_run=function(){return(Tm=e._duckdb_web_query_run=e.asm.Rf).apply(null,arguments)},Dm=e._duckdb_web_pending_query_start=function(){return(Dm=e._duckdb_web_pending_query_start=e.asm.Sf).apply(null,arguments)},Em=e._duckdb_web_pending_query_poll=function(){return(Em=e._duckdb_web_pending_query_poll=e.asm.Tf).apply(null,arguments)},km=e._duckdb_web_pending_query_cancel=function(){return(km=e._duckdb_web_pending_query_cancel=e.asm.Uf).apply(null,arguments)},Om=e._duckdb_web_query_fetch_results=function(){return(Om=e._duckdb_web_query_fetch_results=e.asm.Vf).apply(null,arguments)},Rm=e._duckdb_web_get_tablenames=function(){return(Rm=e._duckdb_web_get_tablenames=e.asm.Wf).apply(null,arguments)},Mm=e._duckdb_web_insert_arrow_from_ipc_stream=function(){return(Mm=e._duckdb_web_insert_arrow_from_ipc_stream=e.asm.Xf).apply(null,arguments)},Um=e._duckdb_web_insert_csv_from_path=function(){return(Um=e._duckdb_web_insert_csv_from_path=e.asm.Yf).apply(null,arguments)},Lm=e._duckdb_web_insert_json_from_path=function(){return(Lm=e._duckdb_web_insert_json_from_path=e.asm.Zf).apply(null,arguments)},_s=e._htonl=function(){return(_s=e._htonl=e.asm._f).apply(null,arguments)},ms=e._htons=function(){return(ms=e._htons=e.asm.$f).apply(null,arguments)},fa=e._ntohs=function(){return(fa=e._ntohs=e.asm.ag).apply(null,arguments)},bs=e._malloc=function(){return(bs=e._malloc=e.asm.bg).apply(null,arguments)},Pl=e._free=function(){return(Pl=e._free=e.asm.cg).apply(null,arguments)},w=e._setThrew=function(){return(w=e._setThrew=e.asm.dg).apply(null,arguments)},Ft=e.setTempRet0=function(){return(Ft=e.setTempRet0=e.asm.eg).apply(null,arguments)},j=e.stackSave=function(){return(j=e.stackSave=e.asm.fg).apply(null,arguments)},S=e.stackRestore=function(){return(S=e.stackRestore=e.asm.gg).apply(null,arguments)},ha=e.stackAlloc=function(){return(ha=e.stackAlloc=e.asm.hg).apply(null,arguments)},_r=e.___cxa_can_catch=function(){return(_r=e.___cxa_can_catch=e.asm.ig).apply(null,arguments)},Vl=e.___cxa_is_pointer_type=function(){return(Vl=e.___cxa_is_pointer_type=e.asm.jg).apply(null,arguments)},Hl=e.dynCall_jiiii=function(){return(Hl=e.dynCall_jiiii=e.asm.kg).apply(null,arguments)},zl=e.dynCall_iiiiij=function(){return(zl=e.dynCall_iiiiij=e.asm.lg).apply(null,arguments)},Wl=e.dynCall_iiiiijj=function(){return(Wl=e.dynCall_iiiiijj=e.asm.mg).apply(null,arguments)},$l=e.dynCall_viijii=function(){return($l=e.dynCall_viijii=e.asm.ng).apply(null,arguments)},Yl=e.dynCall_j=function(){return(Yl=e.dynCall_j=e.asm.og).apply(null,arguments)},Xl=e.dynCall_ji=function(){return(Xl=e.dynCall_ji=e.asm.pg).apply(null,arguments)},Gl=e.dynCall_iij=function(){return(Gl=e.dynCall_iij=e.asm.qg).apply(null,arguments)},Kl=e.dynCall_viij=function(){return(Kl=e.dynCall_viij=e.asm.rg).apply(null,arguments)},Jl=e.dynCall_viijji=function(){return(Jl=e.dynCall_viijji=e.asm.sg).apply(null,arguments)},ql=e.dynCall_viijj=function(){return(ql=e.dynCall_viijj=e.asm.tg).apply(null,arguments)},Zl=e.dynCall_viiijj=function(){return(Zl=e.dynCall_viiijj=e.asm.ug).apply(null,arguments)},Ql=e.dynCall_viiji=function(){return(Ql=e.dynCall_viiji=e.asm.vg).apply(null,arguments)},tc=e.dynCall_vijjj=function(){return(tc=e.dynCall_vijjj=e.asm.wg).apply(null,arguments)},ec=e.dynCall_iiijj=function(){return(ec=e.dynCall_iiijj=e.asm.xg).apply(null,arguments)},ic=e.dynCall_viiij=function(){return(ic=e.dynCall_viiij=e.asm.yg).apply(null,arguments)},rc=e.dynCall_viijij=function(){return(rc=e.dynCall_viijij=e.asm.zg).apply(null,arguments)},nc=e.dynCall_viiiij=function(){return(nc=e.dynCall_viiiij=e.asm.Ag).apply(null,arguments)},sc=e.dynCall_jj=function(){return(sc=e.dynCall_jj=e.asm.Bg).apply(null,arguments)},oc=e.dynCall_viji=function(){return(oc=e.dynCall_viji=e.asm.Cg).apply(null,arguments)},ac=e.dynCall_iiij=function(){return(ac=e.dynCall_iiij=e.asm.Dg).apply(null,arguments)},lc=e.dynCall_vij=function(){return(lc=e.dynCall_vij=e.asm.Eg).apply(null,arguments)},cc=e.dynCall_iiiij=function(){return(cc=e.dynCall_iiiij=e.asm.Fg).apply(null,arguments)},uc=e.dynCall_iiji=function(){return(uc=e.dynCall_iiji=e.asm.Gg).apply(null,arguments)},dc=e.dynCall_iiiji=function(){return(dc=e.dynCall_iiiji=e.asm.Hg).apply(null,arguments)},fc=e.dynCall_iijj=function(){return(fc=e.dynCall_iijj=e.asm.Ig).apply(null,arguments)},hc=e.dynCall_iiiiiiijj=function(){return(hc=e.dynCall_iiiiiiijj=e.asm.Jg).apply(null,arguments)},pc=e.dynCall_iiiijj=function(){return(pc=e.dynCall_iiiijj=e.asm.Kg).apply(null,arguments)},yc=e.dynCall_iiijii=function(){return(yc=e.dynCall_iiijii=e.asm.Lg).apply(null,arguments)},_c=e.dynCall_jii=function(){return(_c=e.dynCall_jii=e.asm.Mg).apply(null,arguments)},mc=e.dynCall_jiii=function(){return(mc=e.dynCall_jiii=e.asm.Ng).apply(null,arguments)},bc=e.dynCall_jij=function(){return(bc=e.dynCall_jij=e.asm.Og).apply(null,arguments)},vc=e.dynCall_iiiiiji=function(){return(vc=e.dynCall_iiiiiji=e.asm.Pg).apply(null,arguments)},gc=e.dynCall_iijji=function(){return(gc=e.dynCall_iijji=e.asm.Qg).apply(null,arguments)},wc=e.dynCall_iijii=function(){return(wc=e.dynCall_iijii=e.asm.Rg).apply(null,arguments)},jc=e.dynCall_iijjii=function(){return(jc=e.dynCall_iijjii=e.asm.Sg).apply(null,arguments)},Sc=e.dynCall_vijj=function(){return(Sc=e.dynCall_vijj=e.asm.Tg).apply(null,arguments)},Ic=e.dynCall_vijijj=function(){return(Ic=e.dynCall_vijijj=e.asm.Ug).apply(null,arguments)},Cc=e.dynCall_viiijjj=function(){return(Cc=e.dynCall_viiijjj=e.asm.Vg).apply(null,arguments)},Ac=e.dynCall_iji=function(){return(Ac=e.dynCall_iji=e.asm.Wg).apply(null,arguments)},Fc=e.dynCall_viijjji=function(){return(Fc=e.dynCall_viijjji=e.asm.Xg).apply(null,arguments)},xc=e.dynCall_vijiiii=function(){return(xc=e.dynCall_vijiiii=e.asm.Yg).apply(null,arguments)},Bc=e.dynCall_viiijii=function(){return(Bc=e.dynCall_viiijii=e.asm.Zg).apply(null,arguments)},Tc=e.dynCall_viiiiiij=function(){return(Tc=e.dynCall_viiiiiij=e.asm._g).apply(null,arguments)},Dc=e.dynCall_iijjijj=function(){return(Dc=e.dynCall_iijjijj=e.asm.$g).apply(null,arguments)},Ec=e.dynCall_viiiijiiiii=function(){return(Ec=e.dynCall_viiiijiiiii=e.asm.ah).apply(null,arguments)},kc=e.dynCall_viiiijiiii=function(){return(kc=e.dynCall_viiiijiiii=e.asm.bh).apply(null,arguments)},Oc=e.dynCall_ijji=function(){return(Oc=e.dynCall_ijji=e.asm.ch).apply(null,arguments)},Rc=e.dynCall_iiijiii=function(){return(Rc=e.dynCall_iiijiii=e.asm.dh).apply(null,arguments)},Mc=e.dynCall_iiiiijii=function(){return(Mc=e.dynCall_iiiiijii=e.asm.eh).apply(null,arguments)},Uc=e.dynCall_viijiiii=function(){return(Uc=e.dynCall_viijiiii=e.asm.fh).apply(null,arguments)},Lc=e.dynCall_viijiiiii=function(){return(Lc=e.dynCall_viijiiiii=e.asm.gh).apply(null,arguments)},Nc=e.dynCall_iiijiij=function(){return(Nc=e.dynCall_iiijiij=e.asm.hh).apply(null,arguments)},Pc=e.dynCall_vijiii=function(){return(Pc=e.dynCall_vijiii=e.asm.ih).apply(null,arguments)},Vc=e.dynCall_iijjiii=function(){return(Vc=e.dynCall_iijjiii=e.asm.jh).apply(null,arguments)},Hc=e.dynCall_iijjiiii=function(){return(Hc=e.dynCall_iijjiiii=e.asm.kh).apply(null,arguments)},zc=e.dynCall_viiiji=function(){return(zc=e.dynCall_viiiji=e.asm.lh).apply(null,arguments)},Wc=e.dynCall_viijiii=function(){return(Wc=e.dynCall_viijiii=e.asm.mh).apply(null,arguments)},$c=e.dynCall_vijiiiii=function(){return($c=e.dynCall_vijiiiii=e.asm.nh).apply(null,arguments)},Yc=e.dynCall_jiiiii=function(){return(Yc=e.dynCall_jiiiii=e.asm.oh).apply(null,arguments)},Xc=e.dynCall_iijiiii=function(){return(Xc=e.dynCall_iijiiii=e.asm.ph).apply(null,arguments)},Gc=e.dynCall_vjjii=function(){return(Gc=e.dynCall_vjjii=e.asm.qh).apply(null,arguments)},Kc=e.dynCall_viiiijii=function(){return(Kc=e.dynCall_viiiijii=e.asm.rh).apply(null,arguments)},Jc=e.dynCall_iiiijiii=function(){return(Jc=e.dynCall_iiiijiii=e.asm.sh).apply(null,arguments)},qc=e.dynCall_vijii=function(){return(qc=e.dynCall_vijii=e.asm.th).apply(null,arguments)},Zc=e.dynCall_vijij=function(){return(Zc=e.dynCall_vijij=e.asm.uh).apply(null,arguments)},Qc=e.dynCall_iiijjjj=function(){return(Qc=e.dynCall_iiijjjj=e.asm.vh).apply(null,arguments)},tu=e.dynCall_jiij=function(){return(tu=e.dynCall_jiij=e.asm.wh).apply(null,arguments)},eu=e.dynCall_viijjj=function(){return(eu=e.dynCall_viijjj=e.asm.xh).apply(null,arguments)},iu=e.dynCall_jiiij=function(){return(iu=e.dynCall_jiiij=e.asm.yh).apply(null,arguments)},ru=e.dynCall_iiiiiijjiijjj=function(){return(ru=e.dynCall_iiiiiijjiijjj=e.asm.zh).apply(null,arguments)},nu=e.dynCall_viijiiji=function(){return(nu=e.dynCall_viijiiji=e.asm.Ah).apply(null,arguments)},su=e.dynCall_iiiijjii=function(){return(su=e.dynCall_iiiijjii=e.asm.Bh).apply(null,arguments)},ou=e.dynCall_iiiijji=function(){return(ou=e.dynCall_iiiijji=e.asm.Ch).apply(null,arguments)},au=e.dynCall_iiijjii=function(){return(au=e.dynCall_iiijjii=e.asm.Dh).apply(null,arguments)},lu=e.dynCall_vjjijij=function(){return(lu=e.dynCall_vjjijij=e.asm.Eh).apply(null,arguments)},cu=e.dynCall_vijjji=function(){return(cu=e.dynCall_vijjji=e.asm.Fh).apply(null,arguments)},uu=e.dynCall_viiiiiji=function(){return(uu=e.dynCall_viiiiiji=e.asm.Gh).apply(null,arguments)},du=e.dynCall_jiiiji=function(){return(du=e.dynCall_jiiiji=e.asm.Hh).apply(null,arguments)},fu=e.dynCall_viiijjii=function(){return(fu=e.dynCall_viiijjii=e.asm.Ih).apply(null,arguments)},hu=e.dynCall_jijij=function(){return(hu=e.dynCall_jijij=e.asm.Jh).apply(null,arguments)},pu=e.dynCall_viiiijj=function(){return(pu=e.dynCall_viiiijj=e.asm.Kh).apply(null,arguments)},yu=e.dynCall_jijjij=function(){return(yu=e.dynCall_jijjij=e.asm.Lh).apply(null,arguments)},_u=e.dynCall_jiijii=function(){return(_u=e.dynCall_jiijii=e.asm.Mh).apply(null,arguments)},mu=e.dynCall_jijiii=function(){return(mu=e.dynCall_jijiii=e.asm.Nh).apply(null,arguments)},bu=e.dynCall_viijiiij=function(){return(bu=e.dynCall_viijiiij=e.asm.Oh).apply(null,arguments)},vu=e.dynCall_vijiiiji=function(){return(vu=e.dynCall_vijiiiji=e.asm.Ph).apply(null,arguments)},gu=e.dynCall_jiiji=function(){return(gu=e.dynCall_jiiji=e.asm.Qh).apply(null,arguments)},wu=e.dynCall_viiijij=function(){return(wu=e.dynCall_viiijij=e.asm.Rh).apply(null,arguments)},ju=e.dynCall_viijiij=function(){return(ju=e.dynCall_viijiij=e.asm.Sh).apply(null,arguments)},Su=e.dynCall_viiiiijj=function(){return(Su=e.dynCall_viiiiijj=e.asm.Th).apply(null,arguments)},Iu=e.dynCall_viiijji=function(){return(Iu=e.dynCall_viiijji=e.asm.Uh).apply(null,arguments)},Cu=e.dynCall_viijjiij=function(){return(Cu=e.dynCall_viijjiij=e.asm.Vh).apply(null,arguments)},Au=e.dynCall_iiijiiji=function(){return(Au=e.dynCall_iiijiiji=e.asm.Wh).apply(null,arguments)},Fu=e.dynCall_iiijjji=function(){return(Fu=e.dynCall_iiijjji=e.asm.Xh).apply(null,arguments)},xu=e.dynCall_viijjiijjj=function(){return(xu=e.dynCall_viijjiijjj=e.asm.Yh).apply(null,arguments)},Bu=e.dynCall_viijjiijj=function(){return(Bu=e.dynCall_viijjiijj=e.asm.Zh).apply(null,arguments)},Tu=e.dynCall_iiijji=function(){return(Tu=e.dynCall_iiijji=e.asm._h).apply(null,arguments)},Du=e.dynCall_viiijiii=function(){return(Du=e.dynCall_viiijiii=e.asm.$h).apply(null,arguments)},Eu=e.dynCall_iiiiijiii=function(){return(Eu=e.dynCall_iiiiijiii=e.asm.ai).apply(null,arguments)},ku=e.dynCall_vijji=function(){return(ku=e.dynCall_vijji=e.asm.bi).apply(null,arguments)},Ou=e.dynCall_jiiiij=function(){return(Ou=e.dynCall_jiiiij=e.asm.ci).apply(null,arguments)},Ru=e.dynCall_viiijjji=function(){return(Ru=e.dynCall_viiijjji=e.asm.di).apply(null,arguments)},Mu=e.dynCall_jiiijii=function(){return(Mu=e.dynCall_jiiijii=e.asm.ei).apply(null,arguments)},Uu=e.dynCall_jiijiii=function(){return(Uu=e.dynCall_jiijiii=e.asm.fi).apply(null,arguments)},Lu=e.dynCall_viiijjij=function(){return(Lu=e.dynCall_viiijjij=e.asm.gi).apply(null,arguments)},Nu=e.dynCall_vijijjiij=function(){return(Nu=e.dynCall_vijijjiij=e.asm.hi).apply(null,arguments)},Pu=e.dynCall_viiijjiij=function(){return(Pu=e.dynCall_viiijjiij=e.asm.ii).apply(null,arguments)},Vu=e.dynCall_viiiijijji=function(){return(Vu=e.dynCall_viiiijijji=e.asm.ji).apply(null,arguments)},Hu=e.dynCall_viijiiiij=function(){return(Hu=e.dynCall_viijiiiij=e.asm.ki).apply(null,arguments)},zu=e.dynCall_viiijiiiijjj=function(){return(zu=e.dynCall_viiijiiiijjj=e.asm.li).apply(null,arguments)},Wu=e.dynCall_viijijiiiijjj=function(){return(Wu=e.dynCall_viijijiiiijjj=e.asm.mi).apply(null,arguments)},$u=e.dynCall_iijjj=function(){return($u=e.dynCall_iijjj=e.asm.ni).apply(null,arguments)},Yu=e.dynCall_vijijiiiijjj=function(){return(Yu=e.dynCall_vijijiiiijjj=e.asm.oi).apply(null,arguments)},Xu=e.dynCall_jd=function(){return(Xu=e.dynCall_jd=e.asm.pi).apply(null,arguments)},Gu=e.dynCall_jf=function(){return(Gu=e.dynCall_jf=e.asm.qi).apply(null,arguments)},Ku=e.dynCall_iiiiiij=function(){return(Ku=e.dynCall_iiiiiij=e.asm.ri).apply(null,arguments)},Ju=e.dynCall_iiiiiiiij=function(){return(Ju=e.dynCall_iiiiiiiij=e.asm.si).apply(null,arguments)},qu=e.dynCall_iiiiiiji=function(){return(qu=e.dynCall_iiiiiiji=e.asm.ti).apply(null,arguments)},Zu=e.dynCall_vijiji=function(){return(Zu=e.dynCall_vijiji=e.asm.ui).apply(null,arguments)},Qu=e.dynCall_vijjij=function(){return(Qu=e.dynCall_vijjij=e.asm.vi).apply(null,arguments)},td=e.dynCall_viiiijiiiiiiii=function(){return(td=e.dynCall_viiiijiiiiiiii=e.asm.wi).apply(null,arguments)},ed=e.dynCall_ij=function(){return(ed=e.dynCall_ij=e.asm.xi).apply(null,arguments)},id=e.dynCall_jjj=function(){return(id=e.dynCall_jjj=e.asm.yi).apply(null,arguments)},rd=e.dynCall_jjiji=function(){return(rd=e.dynCall_jjiji=e.asm.zi).apply(null,arguments)},nd=e.dynCall_vjii=function(){return(nd=e.dynCall_vjii=e.asm.Ai).apply(null,arguments)},sd=e.dynCall_jjjjjjd=function(){return(sd=e.dynCall_jjjjjjd=e.asm.Bi).apply(null,arguments)},od=e.dynCall_ijii=function(){return(od=e.dynCall_ijii=e.asm.Ci).apply(null,arguments)},ad=e.dynCall_vjiiii=function(){return(ad=e.dynCall_vjiiii=e.asm.Di).apply(null,arguments)},ld=e.dynCall_viiiiijiiii=function(){return(ld=e.dynCall_viiiiijiiii=e.asm.Ei).apply(null,arguments)},cd=e.dynCall_viiiiijiii=function(){return(cd=e.dynCall_viiiiijiii=e.asm.Fi).apply(null,arguments)},ud=e.dynCall_vjiiiji=function(){return(ud=e.dynCall_vjiiiji=e.asm.Gi).apply(null,arguments)},dd=e.dynCall_viijiiiiii=function(){return(dd=e.dynCall_viijiiiiii=e.asm.Hi).apply(null,arguments)},fd=e.dynCall_jjjji=function(){return(fd=e.dynCall_jjjji=e.asm.Ii).apply(null,arguments)},hd=e.dynCall_jjjii=function(){return(hd=e.dynCall_jjjii=e.asm.Ji).apply(null,arguments)},pd=e.dynCall_jji=function(){return(pd=e.dynCall_jji=e.asm.Ki).apply(null,arguments)},yd=e.dynCall_viiiiji=function(){return(yd=e.dynCall_viiiiji=e.asm.Li).apply(null,arguments)},_d=e.dynCall_iijiji=function(){return(_d=e.dynCall_iijiji=e.asm.Mi).apply(null,arguments)},md=e.dynCall_viijjii=function(){return(md=e.dynCall_viijjii=e.asm.Ni).apply(null,arguments)},bd=e.dynCall_iiiiiiiiiiji=function(){return(bd=e.dynCall_iiiiiiiiiiji=e.asm.Oi).apply(null,arguments)},vd=e.dynCall_jiiijjj=function(){return(vd=e.dynCall_jiiijjj=e.asm.Pi).apply(null,arguments)},gd=e.dynCall_viiijijj=function(){return(gd=e.dynCall_viiijijj=e.asm.Qi).apply(null,arguments)},wd=e.dynCall_jiiiiji=function(){return(wd=e.dynCall_jiiiiji=e.asm.Ri).apply(null,arguments)},jd=e.dynCall_iiiiijij=function(){return(jd=e.dynCall_iiiiijij=e.asm.Si).apply(null,arguments)},Sd=e.dynCall_jiiiiiii=function(){return(Sd=e.dynCall_jiiiiiii=e.asm.Ti).apply(null,arguments)},Id=e.dynCall_fiijii=function(){return(Id=e.dynCall_fiijii=e.asm.Ui).apply(null,arguments)},Cd=e.dynCall_diijii=function(){return(Cd=e.dynCall_diijii=e.asm.Vi).apply(null,arguments)},Ad=e.dynCall_iiiiiiijii=function(){return(Ad=e.dynCall_iiiiiiijii=e.asm.Wi).apply(null,arguments)},Fd=e.dynCall_iiiiji=function(){return(Fd=e.dynCall_iiiiji=e.asm.Xi).apply(null,arguments)},xd=e.dynCall_iiiijii=function(){return(xd=e.dynCall_iiiijii=e.asm.Yi).apply(null,arguments)},Bd=e.dynCall_viiiiiiji=function(){return(Bd=e.dynCall_viiiiiiji=e.asm.Zi).apply(null,arguments)},Td=e.dynCall_viiiijiii=function(){return(Td=e.dynCall_viiiijiii=e.asm._i).apply(null,arguments)},Dd=e.dynCall_iiidj=function(){return(Dd=e.dynCall_iiidj=e.asm.$i).apply(null,arguments)},Ed=e.dynCall_iiiiiiij=function(){return(Ed=e.dynCall_iiiiiiij=e.asm.aj).apply(null,arguments)},kd=e.dynCall_iiiiiiiiiiiij=function(){return(kd=e.dynCall_iiiiiiiiiiiij=e.asm.bj).apply(null,arguments)},Od=e.dynCall_iiiiiiiiiij=function(){return(Od=e.dynCall_iiiiiiiiiij=e.asm.cj).apply(null,arguments)},Rd=e.dynCall_iiiiiijii=function(){return(Rd=e.dynCall_iiiiiijii=e.asm.dj).apply(null,arguments)},Md=e.dynCall_iiijjiiji=function(){return(Md=e.dynCall_iiijjiiji=e.asm.ej).apply(null,arguments)},Ud=e.dynCall_iiijjiij=function(){return(Ud=e.dynCall_iiijjiij=e.asm.fj).apply(null,arguments)},Ld=e.dynCall_iiidjiij=function(){return(Ld=e.dynCall_iiidjiij=e.asm.gj).apply(null,arguments)},Nd=e.dynCall_iiiiiiiji=function(){return(Nd=e.dynCall_iiiiiiiji=e.asm.hj).apply(null,arguments)},Pd=e.dynCall_iiiidjj=function(){return(Pd=e.dynCall_iiiidjj=e.asm.ij).apply(null,arguments)},Vd=e.dynCall_iiiijjj=function(){return(Vd=e.dynCall_iiiijjj=e.asm.jj).apply(null,arguments)},Hd=e.dynCall_iiiiiiiiji=function(){return(Hd=e.dynCall_iiiiiiiiji=e.asm.kj).apply(null,arguments)},zd=e.dynCall_jiiiiiijii=function(){return(zd=e.dynCall_jiiiiiijii=e.asm.lj).apply(null,arguments)},Wd=e.dynCall_viiiijji=function(){return(Wd=e.dynCall_viiiijji=e.asm.mj).apply(null,arguments)},$d=e.dynCall_jiiiiii=function(){return($d=e.dynCall_jiiiiii=e.asm.nj).apply(null,arguments)},Yd=e.dynCall_jiijjjii=function(){return(Yd=e.dynCall_jiijjjii=e.asm.oj).apply(null,arguments)},Xd=e.dynCall_jiiiijii=function(){return(Xd=e.dynCall_jiiiijii=e.asm.pj).apply(null,arguments)},Gd=e.dynCall_jiiiiijiiii=function(){return(Gd=e.dynCall_jiiiiijiiii=e.asm.qj).apply(null,arguments)},Kd=e.dynCall_jiiijiii=function(){return(Kd=e.dynCall_jiiijiii=e.asm.rj).apply(null,arguments)},Jd=e.dynCall_viiijijiji=function(){return(Jd=e.dynCall_viiijijiji=e.asm.sj).apply(null,arguments)},qd=e.dynCall_iiiiijjj=function(){return(qd=e.dynCall_iiiiijjj=e.asm.tj).apply(null,arguments)},Zd=e.dynCall_iiiijjjj=function(){return(Zd=e.dynCall_iiiijjjj=e.asm.uj).apply(null,arguments)},Qd=e.dynCall_iiijjj=function(){return(Qd=e.dynCall_iiijjj=e.asm.vj).apply(null,arguments)},tf=e.dynCall_jiiijj=function(){return(tf=e.dynCall_jiiijj=e.asm.wj).apply(null,arguments)},ef=e.dynCall_vj=function(){return(ef=e.dynCall_vj=e.asm.xj).apply(null,arguments)},rf=e.dynCall_ijjiii=function(){return(rf=e.dynCall_ijjiii=e.asm.yj).apply(null,arguments)},nf=e.dynCall_iijiii=function(){return(nf=e.dynCall_iijiii=e.asm.zj).apply(null,arguments)},sf=e.dynCall_vijiijj=function(){return(sf=e.dynCall_vijiijj=e.asm.Aj).apply(null,arguments)},of=e.dynCall_vifiijj=function(){return(of=e.dynCall_vifiijj=e.asm.Bj).apply(null,arguments)},af=e.dynCall_vidiijj=function(){return(af=e.dynCall_vidiijj=e.asm.Cj).apply(null,arguments)},lf=e.dynCall_viiiiij=function(){return(lf=e.dynCall_viiiiij=e.asm.Dj).apply(null,arguments)},cf=e.dynCall_vijijjji=function(){return(cf=e.dynCall_vijijjji=e.asm.Ej).apply(null,arguments)},uf=e.dynCall_jijj=function(){return(uf=e.dynCall_jijj=e.asm.Fj).apply(null,arguments)},df=e.dynCall_viijiijj=function(){return(df=e.dynCall_viijiijj=e.asm.Gj).apply(null,arguments)},ff=e.dynCall_viijijj=function(){return(ff=e.dynCall_viijijj=e.asm.Hj).apply(null,arguments)},hf=e.dynCall_viiiiijjji=function(){return(hf=e.dynCall_viiiiijjji=e.asm.Ij).apply(null,arguments)},pf=e.dynCall_iiijiijj=function(){return(pf=e.dynCall_iiijiijj=e.asm.Jj).apply(null,arguments)},yf=e.dynCall_viiijijjj=function(){return(yf=e.dynCall_viiijijjj=e.asm.Kj).apply(null,arguments)},_f=e.dynCall_iijiijj=function(){return(_f=e.dynCall_iijiijj=e.asm.Lj).apply(null,arguments)},mf=e.dynCall_viiijjjji=function(){return(mf=e.dynCall_viiijjjji=e.asm.Mj).apply(null,arguments)},bf=e.dynCall_vijjiii=function(){return(bf=e.dynCall_vijjiii=e.asm.Nj).apply(null,arguments)},vf=e.dynCall_vijijjiiiii=function(){return(vf=e.dynCall_vijijjiiiii=e.asm.Oj).apply(null,arguments)},gf=e.dynCall_vijjiiiii=function(){return(gf=e.dynCall_vijjiiiii=e.asm.Pj).apply(null,arguments)},wf=e.dynCall_iiiiiijji=function(){return(wf=e.dynCall_iiiiiijji=e.asm.Qj).apply(null,arguments)},jf=e.dynCall_jijiiii=function(){return(jf=e.dynCall_jijiiii=e.asm.Rj).apply(null,arguments)},Sf=e.dynCall_viiijiji=function(){return(Sf=e.dynCall_viiijiji=e.asm.Sj).apply(null,arguments)},If=e.dynCall_iiijjjii=function(){return(If=e.dynCall_iiijjjii=e.asm.Tj).apply(null,arguments)},Cf=e.dynCall_iiiiijjji=function(){return(Cf=e.dynCall_iiiiijjji=e.asm.Uj).apply(null,arguments)},Af=e.dynCall_viijiji=function(){return(Af=e.dynCall_viijiji=e.asm.Vj).apply(null,arguments)};function Nm(s){var a=j();try{U(s)()}catch(l){if(S(a),l!==l+0)throw l;w(1,0)}}function Pm(s,a,l){var c=j();try{U(s)(a,l)}catch(d){if(S(c),d!==d+0)throw d;w(1,0)}}function Vm(s,a){var l=j();try{return U(s)(a)}catch(c){if(S(l),c!==c+0)throw c;w(1,0)}}function Hm(s,a,l){var c=j();try{return U(s)(a,l)}catch(d){if(S(c),d!==d+0)throw d;w(1,0)}}function zm(s,a){var l=j();try{U(s)(a)}catch(c){if(S(l),c!==c+0)throw c;w(1,0)}}function Wm(s,a,l,c){var d=j();try{return U(s)(a,l,c)}catch(f){if(S(d),f!==f+0)throw f;w(1,0)}}function $m(s,a,l,c,d,f){var p=j();try{return U(s)(a,l,c,d,f)}catch(y){if(S(p),y!==y+0)throw y;w(1,0)}}function Ym(s,a,l,c,d){var f=j();try{U(s)(a,l,c,d)}catch(p){if(S(f),p!==p+0)throw p;w(1,0)}}function Xm(s,a,l,c,d){var f=j();try{return U(s)(a,l,c,d)}catch(p){if(S(f),p!==p+0)throw p;w(1,0)}}function Gm(s,a,l,c){var d=j();try{return U(s)(a,l,c)}catch(f){if(S(d),f!==f+0)throw f;w(1,0)}}function Km(s,a,l,c){var d=j();try{return U(s)(a,l,c)}catch(f){if(S(d),f!==f+0)throw f;w(1,0)}}function Jm(s,a,l,c){var d=j();try{U(s)(a,l,c)}catch(f){if(S(d),f!==f+0)throw f;w(1,0)}}function qm(s,a,l,c){var d=j();try{U(s)(a,l,c)}catch(f){if(S(d),f!==f+0)throw f;w(1,0)}}function Zm(s,a,l,c,d,f,p,y){var _=j();try{return U(s)(a,l,c,d,f,p,y)}catch(b){if(S(_),b!==b+0)throw b;w(1,0)}}function Qm(s,a,l,c,d,f,p,y,_,b,v){var I=j();try{return U(s)(a,l,c,d,f,p,y,_,b,v)}catch(A){if(S(I),A!==A+0)throw A;w(1,0)}}function tb(s,a,l,c,d,f,p,y,_,b,v,I,A){var T=j();try{return U(s)(a,l,c,d,f,p,y,_,b,v,I,A)}catch(E){if(S(T),E!==E+0)throw E;w(1,0)}}function eb(s){var a=j();try{return U(s)()}catch(l){if(S(a),l!==l+0)throw l;w(1,0)}}function ib(s,a,l,c,d,f,p,y){var _=j();try{U(s)(a,l,c,d,f,p,y)}catch(b){if(S(_),b!==b+0)throw b;w(1,0)}}function rb(s,a,l,c,d,f,p){var y=j();try{return U(s)(a,l,c,d,f,p)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function nb(s,a,l,c,d,f,p,y,_,b,v,I){var A=j();try{return U(s)(a,l,c,d,f,p,y,_,b,v,I)}catch(T){if(S(A),T!==T+0)throw T;w(1,0)}}function sb(s,a,l,c,d,f,p,y,_,b,v){var I=j();try{U(s)(a,l,c,d,f,p,y,_,b,v)}catch(A){if(S(I),A!==A+0)throw A;w(1,0)}}function ob(s,a,l,c,d,f,p,y,_,b,v,I,A,T,E,$){var ut=j();try{U(s)(a,l,c,d,f,p,y,_,b,v,I,A,T,E,$)}catch(wt){if(S(ut),wt!==wt+0)throw wt;w(1,0)}}function ab(s,a,l,c,d,f,p){var y=j();try{U(s)(a,l,c,d,f,p)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function lb(s,a,l,c,d,f){var p=j();try{return U(s)(a,l,c,d,f)}catch(y){if(S(p),y!==y+0)throw y;w(1,0)}}function cb(s,a,l,c,d,f,p,y,_){var b=j();try{U(s)(a,l,c,d,f,p,y,_)}catch(v){if(S(b),v!==v+0)throw v;w(1,0)}}function ub(s,a,l,c,d,f){var p=j();try{U(s)(a,l,c,d,f)}catch(y){if(S(p),y!==y+0)throw y;w(1,0)}}function db(s,a){var l=j();try{return U(s)(a)}catch(c){if(S(l),c!==c+0)throw c;w(1,0)}}function fb(s,a,l,c,d,f,p,y,_){var b=j();try{return U(s)(a,l,c,d,f,p,y,_)}catch(v){if(S(b),v!==v+0)throw v;w(1,0)}}function hb(s,a,l,c,d,f,p,y,_,b){var v=j();try{return U(s)(a,l,c,d,f,p,y,_,b)}catch(I){if(S(v),I!==I+0)throw I;w(1,0)}}function pb(s,a){var l=j();try{return U(s)(a)}catch(c){if(S(l),c!==c+0)throw c;w(1,0)}}function yb(s,a){var l=j();try{return U(s)(a)}catch(c){if(S(l),c!==c+0)throw c;w(1,0)}}function _b(s,a){var l=j();try{return U(s)(a)}catch(c){if(S(l),c!==c+0)throw c;w(1,0)}}function mb(s,a,l,c,d,f,p,y,_,b,v,I,A,T,E,$,ut,wt){var x=j();try{return U(s)(a,l,c,d,f,p,y,_,b,v,I,A,T,E,$,ut,wt)}catch(M){if(S(x),M!==M+0)throw M;w(1,0)}}function bb(s,a,l){var c=j();try{return U(s)(a,l)}catch(d){if(S(c),d!==d+0)throw d;w(1,0)}}function vb(s,a,l){var c=j();try{return U(s)(a,l)}catch(d){if(S(c),d!==d+0)throw d;w(1,0)}}function gb(s,a,l,c,d){var f=j();try{return U(s)(a,l,c,d)}catch(p){if(S(f),p!==p+0)throw p;w(1,0)}}function wb(s,a,l){var c=j();try{U(s)(a,l)}catch(d){if(S(c),d!==d+0)throw d;w(1,0)}}function jb(s,a,l){var c=j();try{U(s)(a,l)}catch(d){if(S(c),d!==d+0)throw d;w(1,0)}}function Sb(s,a,l,c,d,f,p,y,_,b,v,I,A,T){var E=j();try{U(s)(a,l,c,d,f,p,y,_,b,v,I,A,T)}catch($){if(S(E),$!==$+0)throw $;w(1,0)}}function Ib(s,a,l,c,d,f,p,y,_,b){var v=j();try{U(s)(a,l,c,d,f,p,y,_,b)}catch(I){if(S(v),I!==I+0)throw I;w(1,0)}}function Cb(s,a,l,c){var d=j();try{return U(s)(a,l,c)}catch(f){if(S(d),f!==f+0)throw f;w(1,0)}}function Ab(s,a,l,c,d,f,p,y){var _=j();try{return U(s)(a,l,c,d,f,p,y)}catch(b){if(S(_),b!==b+0)throw b;w(1,0)}}function Fb(s,a,l,c,d){var f=j();try{return U(s)(a,l,c,d)}catch(p){if(S(f),p!==p+0)throw p;w(1,0)}}function xb(s,a,l,c,d,f){var p=j();try{U(s)(a,l,c,d,f)}catch(y){if(S(p),y!==y+0)throw y;w(1,0)}}function Bb(s,a,l,c,d,f,p,y,_,b,v,I,A,T,E,$,ut){var wt=j();try{return U(s)(a,l,c,d,f,p,y,_,b,v,I,A,T,E,$,ut)}catch(x){if(S(wt),x!==x+0)throw x;w(1,0)}}function Tb(s,a,l){var c=j();try{return U(s)(a,l)}catch(d){if(S(c),d!==d+0)throw d;w(1,0)}}function Db(s,a,l,c,d,f,p){var y=j();try{return U(s)(a,l,c,d,f,p)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function Eb(s,a,l,c,d){var f=j();try{return U(s)(a,l,c,d)}catch(p){if(S(f),p!==p+0)throw p;w(1,0)}}function kb(s,a,l){var c=j();try{return U(s)(a,l)}catch(d){if(S(c),d!==d+0)throw d;w(1,0)}}function Ob(s,a,l,c,d,f,p,y,_,b,v){var I=j();try{U(s)(a,l,c,d,f,p,y,_,b,v)}catch(A){if(S(I),A!==A+0)throw A;w(1,0)}}function Rb(s,a,l,c){var d=j();try{U(s)(a,l,c)}catch(f){if(S(d),f!==f+0)throw f;w(1,0)}}function Mb(s,a,l,c){var d=j();try{U(s)(a,l,c)}catch(f){if(S(d),f!==f+0)throw f;w(1,0)}}function Ub(s,a,l,c,d,f,p,y,_,b,v,I){var A=j();try{U(s)(a,l,c,d,f,p,y,_,b,v,I)}catch(T){if(S(A),T!==T+0)throw T;w(1,0)}}function Lb(s,a,l,c,d,f,p,y,_,b){var v=j();try{U(s)(a,l,c,d,f,p,y,_,b)}catch(I){if(S(v),I!==I+0)throw I;w(1,0)}}function Nb(s){var a=j();try{return U(s)()}catch(l){if(S(a),l!==l+0)throw l;w(1,0)}}function Pb(s){var a=j();try{return U(s)()}catch(l){if(S(a),l!==l+0)throw l;w(1,0)}}function Vb(s,a,l,c,d){var f=j();try{return Hl(s,a,l,c,d)}catch(p){if(S(f),p!==p+0)throw p;w(1,0)}}function Hb(s,a,l,c,d,f,p){var y=j();try{ql(s,a,l,c,d,f,p)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function zb(s,a){var l=j();try{return Xl(s,a)}catch(c){if(S(l),c!==c+0)throw c;w(1,0)}}function Wb(s,a,l){var c=j();try{return _c(s,a,l)}catch(d){if(S(c),d!==d+0)throw d;w(1,0)}}function $b(s,a,l,c,d,f,p){var y=j();try{$l(s,a,l,c,d,f,p)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function Yb(s,a,l,c,d,f,p){var y=j();try{return zl(s,a,l,c,d,f,p)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function Xb(s,a,l,c,d,f,p,y,_){var b=j();try{return Wl(s,a,l,c,d,f,p,y,_)}catch(v){if(S(b),v!==v+0)throw v;w(1,0)}}function Gb(s,a,l,c){var d=j();try{return Gl(s,a,l,c)}catch(f){if(S(d),f!==f+0)throw f;w(1,0)}}function Kb(s,a,l,c,d,f){var p=j();try{Ql(s,a,l,c,d,f)}catch(y){if(S(p),y!==y+0)throw y;w(1,0)}}function Jb(s){var a=j();try{return Yl(s)}catch(l){if(S(a),l!==l+0)throw l;w(1,0)}}function qb(s,a,l,c,d){var f=j();try{Kl(s,a,l,c,d)}catch(p){if(S(f),p!==p+0)throw p;w(1,0)}}function Zb(s,a,l,c,d,f,p,y){var _=j();try{tc(s,a,l,c,d,f,p,y)}catch(b){if(S(_),b!==b+0)throw b;w(1,0)}}function Qb(s,a,l,c,d,f,p){var y=j();try{return ec(s,a,l,c,d,f,p)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function tv(s,a,l,c,d,f,p,y){var _=j();try{Jl(s,a,l,c,d,f,p,y)}catch(b){if(S(_),b!==b+0)throw b;w(1,0)}}function ev(s,a,l,c){var d=j();try{lc(s,a,l,c)}catch(f){if(S(d),f!==f+0)throw f;w(1,0)}}function iv(s,a,l,c,d,f,p,y,_){var b=j();try{pu(s,a,l,c,d,f,p,y,_)}catch(v){if(S(b),v!==v+0)throw v;w(1,0)}}function rv(s,a,l,c,d,f,p){var y=j();try{nc(s,a,l,c,d,f,p)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function nv(s,a,l,c,d,f){var p=j();try{ic(s,a,l,c,d,f)}catch(y){if(S(p),y!==y+0)throw y;w(1,0)}}function sv(s,a,l){var c=j();try{return sc(s,a,l)}catch(d){if(S(c),d!==d+0)throw d;w(1,0)}}function ov(s,a,l,c,d){var f=j();try{return ac(s,a,l,c,d)}catch(p){if(S(f),p!==p+0)throw p;w(1,0)}}function av(s,a,l,c,d,f,p){var y=j();try{return nf(s,a,l,c,d,f,p)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function lv(s,a,l,c,d){var f=j();try{oc(s,a,l,c,d)}catch(p){if(S(f),p!==p+0)throw p;w(1,0)}}function cv(s,a,l,c,d,f,p,y){var _=j();try{Zl(s,a,l,c,d,f,p,y)}catch(b){if(S(_),b!==b+0)throw b;w(1,0)}}function uv(s,a,l,c,d,f,p,y){var _=j();try{return pc(s,a,l,c,d,f,p,y)}catch(b){if(S(_),b!==b+0)throw b;w(1,0)}}function dv(s,a,l,c,d,f,p,y){var _=j();try{return Ku(s,a,l,c,d,f,p,y)}catch(b){if(S(_),b!==b+0)throw b;w(1,0)}}function fv(s,a,l,c,d,f,p,y,_,b){var v=j();try{return Ju(s,a,l,c,d,f,p,y,_,b)}catch(I){if(S(v),I!==I+0)throw I;w(1,0)}}function hv(s,a,l,c,d,f){var p=j();try{return cc(s,a,l,c,d,f)}catch(y){if(S(p),y!==y+0)throw y;w(1,0)}}function pv(s,a,l,c){var d=j();try{return mc(s,a,l,c)}catch(f){if(S(d),f!==f+0)throw f;w(1,0)}}function yv(s,a,l,c,d){var f=j();try{return uc(s,a,l,c,d)}catch(p){if(S(f),p!==p+0)throw p;w(1,0)}}function _v(s,a,l,c,d,f){var p=j();try{return wc(s,a,l,c,d,f)}catch(y){if(S(p),y!==y+0)throw y;w(1,0)}}function mv(s,a,l,c,d,f,p,y,_,b,v){var I=j();try{Cu(s,a,l,c,d,f,p,y,_,b,v)}catch(A){if(S(I),A!==A+0)throw A;w(1,0)}}function bv(s,a,l,c,d,f,p,y,_,b){var v=j();try{return Au(s,a,l,c,d,f,p,y,_,b)}catch(I){if(S(v),I!==I+0)throw I;w(1,0)}}function vv(s,a,l,c,d,f,p,y,_,b){var v=j();try{return Fu(s,a,l,c,d,f,p,y,_,b)}catch(I){if(S(v),I!==I+0)throw I;w(1,0)}}function gv(s,a,l,c,d,f,p,y,_,b,v,I,A,T,E){var $=j();try{xu(s,a,l,c,d,f,p,y,_,b,v,I,A,T,E)}catch(ut){if(S($),ut!==ut+0)throw ut;w(1,0)}}function wv(s,a,l,c,d,f,p,y,_,b,v,I,A){var T=j();try{Bu(s,a,l,c,d,f,p,y,_,b,v,I,A)}catch(E){if(S(T),E!==E+0)throw E;w(1,0)}}function jv(s,a,l,c,d,f,p,y){var _=j();try{return Tu(s,a,l,c,d,f,p,y)}catch(b){if(S(_),b!==b+0)throw b;w(1,0)}}function Sv(s,a,l,c,d,f){var p=j();try{return dc(s,a,l,c,d,f)}catch(y){if(S(p),y!==y+0)throw y;w(1,0)}}function Iv(s,a,l,c,d,f,p,y){var _=j();try{rc(s,a,l,c,d,f,p,y)}catch(b){if(S(_),b!==b+0)throw b;w(1,0)}}function Cv(s,a,l,c,d,f,p,y,_){var b=j();try{Iu(s,a,l,c,d,f,p,y,_)}catch(v){if(S(b),v!==v+0)throw v;w(1,0)}}function Av(s,a,l,c,d,f,p){var y=j();try{Gc(s,a,l,c,d,f,p)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function Fv(s,a,l,c,d){var f=j();try{return tu(s,a,l,c,d)}catch(p){if(S(f),p!==p+0)throw p;w(1,0)}}function xv(s,a,l,c){var d=j();try{return bc(s,a,l,c)}catch(f){if(S(d),f!==f+0)throw f;w(1,0)}}function Bv(s,a,l,c,d,f){var p=j();try{return fc(s,a,l,c,d,f)}catch(y){if(S(p),y!==y+0)throw y;w(1,0)}}function Tv(s,a,l,c,d,f,p,y,_,b,v){var I=j();try{return hc(s,a,l,c,d,f,p,y,_,b,v)}catch(A){if(S(I),A!==A+0)throw A;w(1,0)}}function Dv(s,a,l,c,d,f,p){var y=j();try{return yc(s,a,l,c,d,f,p)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function Ev(s,a,l,c,d,f,p){var y=j();try{Pc(s,a,l,c,d,f,p)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function kv(s,a,l,c,d,f,p){var y=j();try{return gc(s,a,l,c,d,f,p)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function Ov(s,a,l,c,d,f,p,y){var _=j();try{return jc(s,a,l,c,d,f,p,y)}catch(b){if(S(_),b!==b+0)throw b;w(1,0)}}function Rv(s,a,l,c,d,f,p,y){var _=j();try{return Xc(s,a,l,c,d,f,p,y)}catch(b){if(S(_),b!==b+0)throw b;w(1,0)}}function Mv(s,a,l,c,d,f){var p=j();try{Sc(s,a,l,c,d,f)}catch(y){if(S(p),y!==y+0)throw y;w(1,0)}}function Uv(s,a,l,c,d,f,p,y,_){var b=j();try{$c(s,a,l,c,d,f,p,y,_)}catch(v){if(S(b),v!==v+0)throw v;w(1,0)}}function Lv(s,a,l,c,d,f,p,y){var _=j();try{xc(s,a,l,c,d,f,p,y)}catch(b){if(S(_),b!==b+0)throw b;w(1,0)}}function Nv(s,a,l,c,d,f,p,y){var _=j();try{return Rc(s,a,l,c,d,f,p,y)}catch(b){if(S(_),b!==b+0)throw b;w(1,0)}}function Pv(s,a,l,c,d,f,p,y,_){var b=j();try{return Mc(s,a,l,c,d,f,p,y,_)}catch(v){if(S(b),v!==v+0)throw v;w(1,0)}}function Vv(s,a,l,c,d,f,p,y,_){var b=j();try{Uc(s,a,l,c,d,f,p,y,_)}catch(v){if(S(b),v!==v+0)throw v;w(1,0)}}function Hv(s,a,l,c,d,f,p,y,_,b){var v=j();try{Lc(s,a,l,c,d,f,p,y,_,b)}catch(I){if(S(v),I!==I+0)throw I;w(1,0)}}function zv(s,a,l,c,d,f,p,y,_){var b=j();try{return Nc(s,a,l,c,d,f,p,y,_)}catch(v){if(S(b),v!==v+0)throw v;w(1,0)}}function Wv(s,a,l,c,d,f,p,y,_){var b=j();try{return Vc(s,a,l,c,d,f,p,y,_)}catch(v){if(S(b),v!==v+0)throw v;w(1,0)}}function $v(s,a,l,c,d,f,p,y,_,b){var v=j();try{return Hc(s,a,l,c,d,f,p,y,_,b)}catch(I){if(S(v),I!==I+0)throw I;w(1,0)}}function Yv(s,a,l,c,d,f,p,y,_){var b=j();try{Tc(s,a,l,c,d,f,p,y,_)}catch(v){if(S(b),v!==v+0)throw v;w(1,0)}}function Xv(s,a,l,c,d,f,p,y){var _=j();try{Bc(s,a,l,c,d,f,p,y)}catch(b){if(S(_),b!==b+0)throw b;w(1,0)}}function Gv(s,a,l,c,d,f,p,y,_){var b=j();try{Ic(s,a,l,c,d,f,p,y,_)}catch(v){if(S(b),v!==v+0)throw v;w(1,0)}}function Kv(s,a,l,c,d,f,p,y,_,b){var v=j();try{Cc(s,a,l,c,d,f,p,y,_,b)}catch(I){if(S(v),I!==I+0)throw I;w(1,0)}}function Jv(s,a,l,c){var d=j();try{return Ac(s,a,l,c)}catch(f){if(S(d),f!==f+0)throw f;w(1,0)}}function qv(s,a,l,c,d,f,p,y,_,b){var v=j();try{Fc(s,a,l,c,d,f,p,y,_,b)}catch(I){if(S(v),I!==I+0)throw I;w(1,0)}}function Zv(s,a,l,c,d,f,p,y,_,b,v){var I=j();try{return Dc(s,a,l,c,d,f,p,y,_,b,v)}catch(A){if(S(I),A!==A+0)throw A;w(1,0)}}function Qv(s,a,l,c,d,f,p,y,_,b,v,I){var A=j();try{Ec(s,a,l,c,d,f,p,y,_,b,v,I)}catch(T){if(S(A),T!==T+0)throw T;w(1,0)}}function tg(s,a,l,c,d,f,p,y,_,b,v){var I=j();try{kc(s,a,l,c,d,f,p,y,_,b,v)}catch(A){if(S(I),A!==A+0)throw A;w(1,0)}}function eg(s,a,l,c,d,f){var p=j();try{return Oc(s,a,l,c,d,f)}catch(y){if(S(p),y!==y+0)throw y;w(1,0)}}function ig(s,a,l,c,d,f,p){var y=j();try{zc(s,a,l,c,d,f,p)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function rg(s,a,l,c,d,f,p,y){var _=j();try{Wc(s,a,l,c,d,f,p,y)}catch(b){if(S(_),b!==b+0)throw b;w(1,0)}}function ng(s,a,l,c,d,f){var p=j();try{return Yc(s,a,l,c,d,f)}catch(y){if(S(p),y!==y+0)throw y;w(1,0)}}function sg(s,a,l,c,d,f,p,y,_){var b=j();try{Kc(s,a,l,c,d,f,p,y,_)}catch(v){if(S(b),v!==v+0)throw v;w(1,0)}}function og(s,a,l,c,d,f,p,y,_){var b=j();try{return Jc(s,a,l,c,d,f,p,y,_)}catch(v){if(S(b),v!==v+0)throw v;w(1,0)}}function ag(s,a,l,c,d,f){var p=j();try{qc(s,a,l,c,d,f)}catch(y){if(S(p),y!==y+0)throw y;w(1,0)}}function lg(s,a,l,c,d,f,p){var y=j();try{Zc(s,a,l,c,d,f,p)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function cg(s,a,l,c,d,f,p,y,_,b,v){var I=j();try{return Qc(s,a,l,c,d,f,p,y,_,b,v)}catch(A){if(S(I),A!==A+0)throw A;w(1,0)}}function ug(s,a,l,c,d,f){var p=j();try{return iu(s,a,l,c,d,f)}catch(y){if(S(p),y!==y+0)throw y;w(1,0)}}function dg(s,a,l,c,d,f,p,y,_){var b=j();try{cu(s,a,l,c,d,f,p,y,_)}catch(v){if(S(b),v!==v+0)throw v;w(1,0)}}function fg(s,a,l,c,d,f,p,y,_){var b=j();try{eu(s,a,l,c,d,f,p,y,_)}catch(v){if(S(b),v!==v+0)throw v;w(1,0)}}function hg(s,a,l,c,d,f,p,y,_,b,v){var I=j();try{lu(s,a,l,c,d,f,p,y,_,b,v)}catch(A){if(S(I),A!==A+0)throw A;w(1,0)}}function pg(s,a,l,c,d,f){var p=j();try{return gu(s,a,l,c,d,f)}catch(y){if(S(p),y!==y+0)throw y;w(1,0)}}function yg(s,a,l,c,d,f,p,y,_,b){var v=j();try{nu(s,a,l,c,d,f,p,y,_,b)}catch(I){if(S(v),I!==I+0)throw I;w(1,0)}}function _g(s,a,l,c,d,f,p){var y=j();try{return du(s,a,l,c,d,f,p)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function mg(s,a,l,c,d,f,p,y,_){var b=j();try{uu(s,a,l,c,d,f,p,y,_)}catch(v){if(S(b),v!==v+0)throw v;w(1,0)}}function bg(s,a,l,c,d,f,p,y,_,b,v,I,A,T,E,$,ut,wt){var x=j();try{return ru(s,a,l,c,d,f,p,y,_,b,v,I,A,T,E,$,ut,wt)}catch(M){if(S(x),M!==M+0)throw M;w(1,0)}}function vg(s,a,l,c,d,f,p,y,_,b){var v=j();try{return su(s,a,l,c,d,f,p,y,_,b)}catch(I){if(S(v),I!==I+0)throw I;w(1,0)}}function gg(s,a,l,c,d,f,p,y,_){var b=j();try{return ou(s,a,l,c,d,f,p,y,_)}catch(v){if(S(b),v!==v+0)throw v;w(1,0)}}function wg(s,a,l,c,d,f,p,y,_){var b=j();try{return au(s,a,l,c,d,f,p,y,_)}catch(v){if(S(b),v!==v+0)throw v;w(1,0)}}function jg(s,a,l,c,d,f,p,y,_,b){var v=j();try{fu(s,a,l,c,d,f,p,y,_,b)}catch(I){if(S(v),I!==I+0)throw I;w(1,0)}}function Sg(s,a,l,c,d,f,p){var y=j();try{return _u(s,a,l,c,d,f,p)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function Ig(s,a,l,c,d,f,p,y,_,b){var v=j();try{bu(s,a,l,c,d,f,p,y,_,b)}catch(I){if(S(v),I!==I+0)throw I;w(1,0)}}function Cg(s,a,l,c,d,f,p,y,_,b){var v=j();try{vu(s,a,l,c,d,f,p,y,_,b)}catch(I){if(S(v),I!==I+0)throw I;w(1,0)}}function Ag(s,a,l,c,d,f,p){var y=j();try{return mu(s,a,l,c,d,f,p)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function Fg(s,a,l,c,d,f,p,y,_){var b=j();try{return yu(s,a,l,c,d,f,p,y,_)}catch(v){if(S(b),v!==v+0)throw v;w(1,0)}}function xg(s,a,l,c,d,f,p,y,_){var b=j();try{ju(s,a,l,c,d,f,p,y,_)}catch(v){if(S(b),v!==v+0)throw v;w(1,0)}}function Bg(s,a,l,c,d,f,p){var y=j();try{return hu(s,a,l,c,d,f,p)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function Tg(s,a,l,c,d,f,p,y,_){var b=j();try{Du(s,a,l,c,d,f,p,y,_)}catch(v){if(S(b),v!==v+0)throw v;w(1,0)}}function Dg(s,a,l,c,d,f,p,y,_,b){var v=j();try{return Eu(s,a,l,c,d,f,p,y,_,b)}catch(I){if(S(v),I!==I+0)throw I;w(1,0)}}function Eg(s,a,l,c,d,f,p){var y=j();try{ku(s,a,l,c,d,f,p)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function kg(s,a,l,c,d,f,p){var y=j();try{return Ou(s,a,l,c,d,f,p)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function Og(s,a,l,c,d,f,p,y,_,b,v){var I=j();try{Ru(s,a,l,c,d,f,p,y,_,b,v)}catch(A){if(S(I),A!==A+0)throw A;w(1,0)}}function Rg(s,a,l,c,d,f,p,y){var _=j();try{return $u(s,a,l,c,d,f,p,y)}catch(b){if(S(_),b!==b+0)throw b;w(1,0)}}function Mg(s,a,l,c,d,f,p,y,_,b,v){var I=j();try{Lu(s,a,l,c,d,f,p,y,_,b,v)}catch(A){if(S(I),A!==A+0)throw A;w(1,0)}}function Ug(s,a,l,c,d,f,p,y,_,b,v,I,A){var T=j();try{Nu(s,a,l,c,d,f,p,y,_,b,v,I,A)}catch(E){if(S(T),E!==E+0)throw E;w(1,0)}}function Lg(s,a,l,c,d,f,p,y,_,b,v,I,A){var T=j();try{Vu(s,a,l,c,d,f,p,y,_,b,v,I,A)}catch(E){if(S(T),E!==E+0)throw E;w(1,0)}}function Ng(s,a,l,c,d,f,p,y){var _=j();try{return Uu(s,a,l,c,d,f,p,y)}catch(b){if(S(_),b!==b+0)throw b;w(1,0)}}function Pg(s,a,l,c,d,f,p,y){var _=j();try{return Mu(s,a,l,c,d,f,p,y)}catch(b){if(S(_),b!==b+0)throw b;w(1,0)}}function Vg(s,a,l,c,d,f,p,y,_,b,v){var I=j();try{Hu(s,a,l,c,d,f,p,y,_,b,v)}catch(A){if(S(I),A!==A+0)throw A;w(1,0)}}function Hg(s,a,l,c,d,f,p,y,_,b,v,I,A,T,E,$){var ut=j();try{zu(s,a,l,c,d,f,p,y,_,b,v,I,A,T,E,$)}catch(wt){if(S(ut),wt!==wt+0)throw wt;w(1,0)}}function zg(s,a,l,c,d,f,p,y,_,b,v,I,A,T,E,$,ut,wt){var x=j();try{Wu(s,a,l,c,d,f,p,y,_,b,v,I,A,T,E,$,ut,wt)}catch(M){if(S(x),M!==M+0)throw M;w(1,0)}}function Wg(s,a,l,c,d,f,p,y,_,b,v,I){var A=j();try{Pu(s,a,l,c,d,f,p,y,_,b,v,I)}catch(T){if(S(A),T!==T+0)throw T;w(1,0)}}function $g(s,a,l,c,d,f,p,y,_,b,v,I,A,T,E,$,ut){var wt=j();try{Yu(s,a,l,c,d,f,p,y,_,b,v,I,A,T,E,$,ut)}catch(x){if(S(wt),x!==x+0)throw x;w(1,0)}}function Yg(s,a){var l=j();try{return Xu(s,a)}catch(c){if(S(l),c!==c+0)throw c;w(1,0)}}function Xg(s,a){var l=j();try{return Gu(s,a)}catch(c){if(S(l),c!==c+0)throw c;w(1,0)}}function Gg(s,a,l,c,d,f,p,y,_){var b=j();try{return qu(s,a,l,c,d,f,p,y,_)}catch(v){if(S(b),v!==v+0)throw v;w(1,0)}}function Kg(s,a,l,c,d,f,p,y,_,b,v){var I=j();try{return zd(s,a,l,c,d,f,p,y,_,b,v)}catch(A){if(S(I),A!==A+0)throw A;w(1,0)}}function Jg(s,a,l,c,d,f,p,y){var _=j();try{yd(s,a,l,c,d,f,p,y)}catch(b){if(S(_),b!==b+0)throw b;w(1,0)}}function qg(s,a,l,c,d,f,p){var y=j();try{return $d(s,a,l,c,d,f,p)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function Zg(s,a,l,c,d,f,p,y,_,b,v){var I=j();try{return Yd(s,a,l,c,d,f,p,y,_,b,v)}catch(A){if(S(I),A!==A+0)throw A;w(1,0)}}function Qg(s,a,l,c,d,f,p,y){var _=j();try{Zu(s,a,l,c,d,f,p,y)}catch(b){if(S(_),b!==b+0)throw b;w(1,0)}}function t0(s,a,l,c,d,f,p,y,_){var b=j();try{Qu(s,a,l,c,d,f,p,y,_)}catch(v){if(S(b),v!==v+0)throw v;w(1,0)}}function e0(s,a,l,c,d,f,p){var y=j();try{return rd(s,a,l,c,d,f,p)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function i0(s,a,l,c,d,f,p,y){var _=j();try{return rf(s,a,l,c,d,f,p,y)}catch(b){if(S(_),b!==b+0)throw b;w(1,0)}}function r0(s,a,l){var c=j();try{return ed(s,a,l)}catch(d){if(S(c),d!==d+0)throw d;w(1,0)}}function n0(s,a,l,c,d,f,p){var y=j();try{ad(s,a,l,c,d,f,p)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function s0(s,a,l,c,d,f,p,y,_,b,v,I){var A=j();try{ld(s,a,l,c,d,f,p,y,_,b,v,I)}catch(T){if(S(A),T!==T+0)throw T;w(1,0)}}function o0(s,a,l,c,d){var f=j();try{return od(s,a,l,c,d)}catch(p){if(S(f),p!==p+0)throw p;w(1,0)}}function a0(s,a,l,c,d){var f=j();try{nd(s,a,l,c,d)}catch(p){if(S(f),p!==p+0)throw p;w(1,0)}}function l0(s,a,l,c,d,f,p,y,_,b,v){var I=j();try{cd(s,a,l,c,d,f,p,y,_,b,v)}catch(A){if(S(I),A!==A+0)throw A;w(1,0)}}function c0(s,a,l,c,d,f,p,y,_,b,v,I,A,T,E){var $=j();try{td(s,a,l,c,d,f,p,y,_,b,v,I,A,T,E)}catch(ut){if(S($),ut!==ut+0)throw ut;w(1,0)}}function u0(s,a,l,c,d){var f=j();try{return id(s,a,l,c,d)}catch(p){if(S(f),p!==p+0)throw p;w(1,0)}}function d0(s,a,l,c,d,f,p,y,_,b,v,I){var A=j();try{return sd(s,a,l,c,d,f,p,y,_,b,v,I)}catch(T){if(S(A),T!==T+0)throw T;w(1,0)}}function f0(s,a,l,c,d,f,p,y,_){var b=j();try{ud(s,a,l,c,d,f,p,y,_)}catch(v){if(S(b),v!==v+0)throw v;w(1,0)}}function h0(s,a,l,c,d,f,p,y,_,b,v){var I=j();try{dd(s,a,l,c,d,f,p,y,_,b,v)}catch(A){if(S(I),A!==A+0)throw A;w(1,0)}}function p0(s,a,l,c,d,f,p,y){var _=j();try{return fd(s,a,l,c,d,f,p,y)}catch(b){if(S(_),b!==b+0)throw b;w(1,0)}}function y0(s,a,l,c,d,f,p){var y=j();try{return hd(s,a,l,c,d,f,p)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function _0(s,a,l,c){var d=j();try{return pd(s,a,l,c)}catch(f){if(S(d),f!==f+0)throw f;w(1,0)}}function m0(s,a,l,c,d,f,p,y){var _=j();try{return _d(s,a,l,c,d,f,p,y)}catch(b){if(S(_),b!==b+0)throw b;w(1,0)}}function b0(s,a,l,c,d,f,p,y,_,b,v,I,A){var T=j();try{return bd(s,a,l,c,d,f,p,y,_,b,v,I,A)}catch(E){if(S(T),E!==E+0)throw E;w(1,0)}}function v0(s,a,l,c,d,f,p,y,_,b){var v=j();try{return vd(s,a,l,c,d,f,p,y,_,b)}catch(I){if(S(v),I!==I+0)throw I;w(1,0)}}function g0(s,a,l,c,d,f,p,y,_,b,v){var I=j();try{gd(s,a,l,c,d,f,p,y,_,b,v)}catch(A){if(S(I),A!==A+0)throw A;w(1,0)}}function w0(s,a,l,c,d,f,p,y){var _=j();try{return wd(s,a,l,c,d,f,p,y)}catch(b){if(S(_),b!==b+0)throw b;w(1,0)}}function j0(s,a,l,c,d,f,p,y,_,b){var v=j();try{return jd(s,a,l,c,d,f,p,y,_,b)}catch(I){if(S(v),I!==I+0)throw I;w(1,0)}}function S0(s,a,l,c,d,f,p,y,_){var b=j();try{md(s,a,l,c,d,f,p,y,_)}catch(v){if(S(b),v!==v+0)throw v;w(1,0)}}function I0(s,a,l,c,d,f,p,y){var _=j();try{return Sd(s,a,l,c,d,f,p,y)}catch(b){if(S(_),b!==b+0)throw b;w(1,0)}}function C0(s,a,l,c,d,f,p,y,_){var b=j();try{return Ed(s,a,l,c,d,f,p,y,_)}catch(v){if(S(b),v!==v+0)throw v;w(1,0)}}function A0(s,a,l,c,d,f,p,y,_,b,v,I,A,T){var E=j();try{return kd(s,a,l,c,d,f,p,y,_,b,v,I,A,T)}catch($){if(S(E),$!==$+0)throw $;w(1,0)}}function F0(s,a,l,c,d,f,p){var y=j();try{return Fd(s,a,l,c,d,f,p)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function x0(s,a,l,c,d,f,p,y,_,b,v){var I=j();try{return Ad(s,a,l,c,d,f,p,y,_,b,v)}catch(A){if(S(I),A!==A+0)throw A;w(1,0)}}function B0(s,a,l,c,d,f,p){var y=j();try{return Id(s,a,l,c,d,f,p)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function T0(s,a,l,c,d,f,p){var y=j();try{return Cd(s,a,l,c,d,f,p)}catch(_){if(S(y),_!==_+0)throw _;w(1,0)}}function D0(s,a,l,c,d,f,p,y){var _=j();try{return vc(s,a,l,c,d,f,p,y)}catch(b){if(S(_),b!==b+0)throw b;w(1,0)}}function E0(s,a,l,c,d,f,p,y){var _=j();try{return xd(s,a,l,c,d,f,p,y)}catch(b){if(S(_),b!==b+0)throw b;w(1,0)}}function k0(s,a,l,c,d,f,p,y,_,b){var v=j();try{Bd(s,a,l,c,d,f,p,y,_,b)}catch(I){if(S(v),I!==I+0)throw I;w(1,0)}}function O0(s,a,l,c,d,f,p,y,_,b){var v=j();try{Td(s,a,l,c,d,f,p,y,_,b)}catch(I){if(S(v),I!==I+0)throw I;w(1,0)}}function R0(s,a,l,c,d,f){var p=j();try{return Dd(s,a,l,c,d,f)}catch(y){if(S(p),y!==y+0)throw y;w(1,0)}}function M0(s,a,l,c,d,f,p,y,_,b,v,I){var A=j();try{return Od(s,a,l,c,d,f,p,y,_,b,v,I)}catch(T){if(S(A),T!==T+0)throw T;w(1,0)}}function U0(s,a,l,c,d,f,p,y,_,b){var v=j();try{return Rd(s,a,l,c,d,f,p,y,_,b)}catch(I){if(S(v),I!==I+0)throw I;w(1,0)}}function L0(s,a,l,c,d,f,p,y,_,b,v,I){var A=j();try{return Md(s,a,l,c,d,f,p,y,_,b,v,I)}catch(T){if(S(A),T!==T+0)throw T;w(1,0)}}function N0(s,a,l,c,d,f,p,y,_,b,v){var I=j();try{return Ud(s,a,l,c,d,f,p,y,_,b,v)}catch(A){if(S(I),A!==A+0)throw A;w(1,0)}}function P0(s,a,l,c,d,f,p,y,_,b){var v=j();try{return Ld(s,a,l,c,d,f,p,y,_,b)}catch(I){if(S(v),I!==I+0)throw I;w(1,0)}}function V0(s,a,l,c,d,f,p,y,_,b){var v=j();try{return Nd(s,a,l,c,d,f,p,y,_,b)}catch(I){if(S(v),I!==I+0)throw I;w(1,0)}}function H0(s,a,l,c,d,f,p,y,_){var b=j();try{return Pd(s,a,l,c,d,f,p,y,_)}catch(v){if(S(b),v!==v+0)throw v;w(1,0)}}function z0(s,a,l,c,d,f,p,y,_,b){var v=j();try{return Vd(s,a,l,c,d,f,p,y,_,b)}catch(I){if(S(v),I!==I+0)throw I;w(1,0)}}function W0(s,a,l,c,d,f,p,y,_,b,v){var I=j();try{return Hd(s,a,l,c,d,f,p,y,_,b,v)}catch(A){if(S(I),A!==A+0)throw A;w(1,0)}}function $0(s,a,l,c,d,f,p,y,_,b){var v=j();try{Wd(s,a,l,c,d,f,p,y,_,b)}catch(I){if(S(v),I!==I+0)throw I;w(1,0)}}function Y0(s,a,l,c,d,f,p,y,_){var b=j();try{return Xd(s,a,l,c,d,f,p,y,_)}catch(v){if(S(b),v!==v+0)throw v;w(1,0)}}function X0(s,a,l,c,d,f,p,y,_,b,v,I){var A=j();try{return Gd(s,a,l,c,d,f,p,y,_,b,v,I)}catch(T){if(S(A),T!==T+0)throw T;w(1,0)}}function G0(s,a,l,c,d,f,p,y,_){var b=j();try{return Kd(s,a,l,c,d,f,p,y,_)}catch(v){if(S(b),v!==v+0)throw v;w(1,0)}}function K0(s,a,l,c,d,f,p,y,_,b,v,I,A){var T=j();try{Jd(s,a,l,c,d,f,p,y,_,b,v,I,A)}catch(E){if(S(T),E!==E+0)throw E;w(1,0)}}function J0(s,a,l,c,d,f,p,y,_){var b=j();try{wu(s,a,l,c,d,f,p,y,_)}catch(v){if(S(b),v!==v+0)throw v;w(1,0)}}function q0(s,a,l,c,d,f,p,y,_,b,v,I){var A=j();try{return Zd(s,a,l,c,d,f,p,y,_,b,v,I)}catch(T){if(S(A),T!==T+0)throw T;w(1,0)}}function Z0(s,a,l,c,d,f,p,y,_,b,v){var I=j();try{return qd(s,a,l,c,d,f,p,y,_,b,v)}catch(A){if(S(I),A!==A+0)throw A;w(1,0)}}function Q0(s,a,l,c,d,f,p,y,_){var b=j();try{return Qd(s,a,l,c,d,f,p,y,_)}catch(v){if(S(b),v!==v+0)throw v;w(1,0)}}function tw(s,a,l,c,d,f,p,y){var _=j();try{return tf(s,a,l,c,d,f,p,y)}catch(b){if(S(_),b!==b+0)throw b;w(1,0)}}function ew(s,a,l){var c=j();try{ef(s,a,l)}catch(d){if(S(c),d!==d+0)throw d;w(1,0)}}function iw(s,a,l,c,d,f,p,y,_,b){var v=j();try{Su(s,a,l,c,d,f,p,y,_,b)}catch(I){if(S(v),I!==I+0)throw I;w(1,0)}}function rw(s,a,l,c,d,f,p,y,_,b){var v=j();try{sf(s,a,l,c,d,f,p,y,_,b)}catch(I){if(S(v),I!==I+0)throw I;w(1,0)}}function nw(s,a,l,c,d,f,p,y,_){var b=j();try{of(s,a,l,c,d,f,p,y,_)}catch(v){if(S(b),v!==v+0)throw v;w(1,0)}}function sw(s,a,l,c,d,f,p,y,_){var b=j();try{af(s,a,l,c,d,f,p,y,_)}catch(v){if(S(b),v!==v+0)throw v;w(1,0)}}function ow(s,a,l,c,d,f,p,y){var _=j();try{lf(s,a,l,c,d,f,p,y)}catch(b){if(S(_),b!==b+0)throw b;w(1,0)}}function aw(s,a,l,c,d,f,p,y,_,b,v,I){var A=j();try{cf(s,a,l,c,d,f,p,y,_,b,v,I)}catch(T){if(S(A),T!==T+0)throw T;w(1,0)}}function lw(s,a,l,c,d,f){var p=j();try{return uf(s,a,l,c,d,f)}catch(y){if(S(p),y!==y+0)throw y;w(1,0)}}function cw(s,a,l,c,d,f,p,y,_,b){var v=j();try{ff(s,a,l,c,d,f,p,y,_,b)}catch(I){if(S(v),I!==I+0)throw I;w(1,0)}}function uw(s,a,l,c,d,f,p,y,_,b,v){var I=j();try{return pf(s,a,l,c,d,f,p,y,_,b,v)}catch(A){if(S(I),A!==A+0)throw A;w(1,0)}}function dw(s,a,l,c,d,f,p,y,_,b,v){var I=j();try{df(s,a,l,c,d,f,p,y,_,b,v)}catch(A){if(S(I),A!==A+0)throw A;w(1,0)}}function fw(s,a,l,c,d,f,p,y,_,b,v,I,A){var T=j();try{hf(s,a,l,c,d,f,p,y,_,b,v,I,A)}catch(E){if(S(T),E!==E+0)throw E;w(1,0)}}function hw(s,a,l,c,d,f,p,y,_,b,v,I,A){var T=j();try{yf(s,a,l,c,d,f,p,y,_,b,v,I,A)}catch(E){if(S(T),E!==E+0)throw E;w(1,0)}}function pw(s,a,l,c,d,f,p,y,_,b){var v=j();try{return _f(s,a,l,c,d,f,p,y,_,b)}catch(I){if(S(v),I!==I+0)throw I;w(1,0)}}function yw(s,a,l,c,d,f,p,y,_,b,v,I,A){var T=j();try{mf(s,a,l,c,d,f,p,y,_,b,v,I,A)}catch(E){if(S(T),E!==E+0)throw E;w(1,0)}}function _w(s,a,l,c,d,f,p,y,_){var b=j();try{Af(s,a,l,c,d,f,p,y,_)}catch(v){if(S(b),v!==v+0)throw v;w(1,0)}}function mw(s,a,l,c,d,f,p,y,_,b,v,I,A,T){var E=j();try{vf(s,a,l,c,d,f,p,y,_,b,v,I,A,T)}catch($){if(S(E),$!==$+0)throw $;w(1,0)}}function bw(s,a,l,c,d,f,p,y,_,b,v){var I=j();try{gf(s,a,l,c,d,f,p,y,_,b,v)}catch(A){if(S(I),A!==A+0)throw A;w(1,0)}}function vw(s,a,l,c,d,f,p,y,_){var b=j();try{bf(s,a,l,c,d,f,p,y,_)}catch(v){if(S(b),v!==v+0)throw v;w(1,0)}}function gw(s,a,l,c,d,f,p,y,_,b,v){var I=j();try{return wf(s,a,l,c,d,f,p,y,_,b,v)}catch(A){if(S(I),A!==A+0)throw A;w(1,0)}}function ww(s,a,l,c,d,f,p,y,_,b,v){var I=j();try{return If(s,a,l,c,d,f,p,y,_,b,v)}catch(A){if(S(I),A!==A+0)throw A;w(1,0)}}function jw(s,a,l,c,d,f,p,y,_,b){var v=j();try{Sf(s,a,l,c,d,f,p,y,_,b)}catch(I){if(S(v),I!==I+0)throw I;w(1,0)}}function Sw(s,a,l,c,d,f,p,y){var _=j();try{return jf(s,a,l,c,d,f,p,y)}catch(b){if(S(_),b!==b+0)throw b;w(1,0)}}function Iw(s,a,l,c,d,f,p,y,_,b,v,I){var A=j();try{return Cf(s,a,l,c,d,f,p,y,_,b,v,I)}catch(T){if(S(A),T!==T+0)throw T;w(1,0)}}e.ccall=q_;var vs;pn=function s(){vs||Ff(),vs||(pn=s)};function Cw(s){var a=e._main,l=0,c=0;try{var d=a(l,c);return G_(d,!0),d}catch(f){return K_(f)}}function Ff(s){if(s=s||u,pr>0||(ey(),pr>0))return;function a(){vs||(vs=!0,e.calledRun=!0,!Zt&&(iy(),ry(),r(e),e.onRuntimeInitialized&&e.onRuntimeInitialized(),xf&&Cw(s),ny()))}e.setStatus?(e.setStatus("Running..."),setTimeout(function(){setTimeout(function(){e.setStatus("")},1),a()},1)):a()}if(e.preInit)for(typeof e.preInit=="function"&&(e.preInit=[e.preInit]);e.preInit.length>0;)e.preInit.pop()();var xf=!0;return e.noInitialRun&&(xf=!1),Ff(),t.ready}})(),Vp=_I;var Qo=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=Lt.from(e);return console.assert(r.isSync()),console.assert(r.isFile()),new Rt(r)}async send(t){let e=this._bindings.startPendingQuery(this._conn,t);for(;e==null;)e=await new Promise((o,u)=>{try{o(this._bindings.pollPendingQuery(this._conn))}catch(h){u(h)}});let r=new ta(this._bindings,this._conn,e),n=Lt.from(r);return console.assert(n.isSync()),console.assert(n.isStream()),n}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 pl(this._bindings,this._conn,e)}createScalarFunction(t,e,r){this._bindings.createScalarFunction(this._conn,t,e,r)}insertArrowTable(t,e){let r=Jo(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)}},ta=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=this.bindings.fetchQueryResults(this.conn);return this._depleted=t.length==0,{done:this._depleted,value:t}}[Symbol.iterator](){return this}},pl=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=Lt.from(e);return console.assert(r.isSync()),console.assert(r.isFile()),new Rt(r)}send(...t){let e=this.bindings.sendPrepared(this.connectionId,this.statementId,t),r=new ta(this.bindings,this.connectionId,e),n=Lt.from(r);return console.assert(n.isSync()),console.assert(n.isStream()),n}};var Wp=new TextEncoder,Hp=new TextDecoder("utf-8");function yl(i,t,e){let r=Wp.encode(e),n=i._malloc(r.byteLength),o=i.HEAPU8.subarray(n,n+r.byteLength);o.set(r),i.HEAPF64[(t>>3)+0]=1,i.HEAPF64[(t>>3)+1]=n,i.HEAPF64[(t>>3)+2]=o.byteLength}function ml(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 _l(i,t,e,r){let n=i.HEAPU8.subarray(t,t+r*ml(e));switch(e){case"UINT8":return new Uint8Array(n.buffer,n.byteOffset,r);case"INT8":return new Int8Array(n.buffer,n.byteOffset,r);case"INT32":return new Int32Array(n.buffer,n.byteOffset,r);case"FLOAT":return new Float32Array(n.buffer,n.byteOffset,r);case"DOUBLE":return new Float64Array(n.buffer,n.byteOffset,r);case"VARCHAR":return new Float64Array(n.buffer,n.byteOffset,r);default:return new Array(0)}}function zp(i,t,e){let r=i.HEAPU8.subarray(t,t+e);return new Uint8Array(r.buffer,r.byteOffset,e)}function ea(i,t,e){let r=i.HEAPU8.subarray(t,t+e*8);return new Float64Array(r.buffer,r.byteOffset,e)}function $p(i,t,e,r,n,o,u,h){try{let m=i._udfFunctions.get(r);if(!m){yl(t,e,"Unknown UDF with id: "+r);return}let g=Hp.decode(t.HEAPU8.subarray(n,n+o)),F=JSON.parse(g),D=ea(t,u,h/8),B=lt=>{var ne;let Zt=null;switch(lt.validityBuffer!==void 0&&(Zt=zp(t,D[lt.validityBuffer],F.rows)),lt.physicalType){case"VARCHAR":{if(lt.dataBuffer===null||lt.dataBuffer===void 0)throw new Error("malformed data view, expected data buffer for VARCHAR argument");if(lt.lengthBuffer===null||lt.lengthBuffer===void 0)throw new Error("malformed data view, expected data length buffer for VARCHAR argument");let ue=_l(t,D[lt.dataBuffer],lt.physicalType,F.rows),Qt=[],Wt=ea(t,D[lt.lengthBuffer],F.rows);for(let dt=0;dt<F.rows;++dt){if(Zt!=null&&!Zt[dt]){Qt.push(null);continue}let me=t.HEAPU8.subarray(ue[dt],ue[dt]+Wt[dt]),Gi=Hp.decode(me);Qt.push(Gi)}return dt=>Qt[dt]}case"STRUCT":{let ue={},Qt=[];for(let Wt=0;Wt<(((ne=lt.children)==null?void 0:ne.length)||0);++Wt){let dt=lt.children[Wt],me=B(dt);Qt.push(Gi=>{ue[dt.name]=me(Gi)})}return Zt!=null?Wt=>{if(!Zt[Wt])return null;for(let dt of Qt)dt(Wt);return ue}:Wt=>{for(let dt of Qt)dt(Wt);return ue}}default:{if(lt.dataBuffer===void 0)throw new Error("malformed data view, expected data buffer for argument of type: "+lt.physicalType);let ue=_l(t,D[lt.dataBuffer],lt.physicalType,F.rows);return Zt!=null?Qt=>Zt[Qt]?ue[Qt]:null:Qt=>ue[Qt]}}},k=[];for(let lt=0;lt<F.args.length;++lt)k.push(B(F.args[lt]));let at=F.rows*ml(F.ret.physicalType),ct=t._malloc(at),gt=_l(t,ct,F.ret.physicalType,F.rows),Ot=t._malloc(F.rows),ce=zp(t,Ot,F.rows);if(gt.length==0||ce.length==0){yl(t,e,"Can't create physical arrays for result");return}let _e=gt;F.ret.physicalType=="VARCHAR"&&(_e=new Array(F.rows));let hr=[];for(let lt=0;lt<F.args.length;++lt)hr.push(null);for(let lt=0;lt<F.rows;++lt){for(let ne=0;ne<F.args.length;++ne)hr[ne]=k[ne](lt);let Zt=m.func(...hr);_e[lt]=Zt,ce[lt]=Zt==null?0:1}let dn=0;switch(F.ret.physicalType){case"VARCHAR":{let lt=new Array(0);dn=t._malloc(F.rows*ml("DOUBLE"));let Zt=ea(t,dn,F.rows),ne=0;for(let dt=0;dt<F.rows;++dt){let me=Wp.encode(_e[dt]||"");lt.push(me),Zt[dt]=me.length,ne+=me.length}let ue=t._malloc(ne),Qt=t.HEAPU8.subarray(ue,ue+ne),Wt=0;for(let dt=0;dt<F.rows;++dt){gt[dt]=Wt;let me=lt[dt];Qt.subarray(Wt,Wt+me.length).set(me),Wt+=me.length}}}let Ye=3*8,Xi=t._malloc(Ye),fn=ea(t,Xi,3);fn[0]=ct,fn[1]=Ot,fn[2]=dn,t.HEAPF64[(e>>3)+0]=0,t.HEAPF64[(e>>3)+1]=Xi,t.HEAPF64[(e>>3)+2]=0}catch(m){yl(t,e,m.toString())}}function bI(){let i=new TextDecoder;return t=>(typeof SharedArrayBuffer<"u"&&t.buffer instanceof SharedArrayBuffer&&(t=new Uint8Array(t)),i.decode(t))}var vI=bI();function Ai(i,t){console.error(`FAIL WITH: ${t}`),i.ccall("duckdb_web_fail_with",null,["string"],[t])}function Or(i,t,e){let r=i.HEAPU8.subarray(t,t+e),n=new Uint8Array(new ArrayBuffer(r.byteLength));return n.set(r),n}function tt(i,t,e){return vI(i.HEAPU8.subarray(t,t+e))}function yt(i,t,e,r){let n=i.stackSave(),o=i.stackAlloc(3*8);e.unshift("number"),r.unshift(o),i.ccall(t,null,e,r);let u=i.HEAPF64[(o>>3)+0],h=i.HEAPF64[(o>>3)+1],m=i.HEAPF64[(o>>3)+2];return i.stackRestore(n),[u,h,m]}function At(i){i.ccall("duckdb_web_clear_response",null,[],[])}var ia=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 gI=new TextEncoder;var ra=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),this)}open(t){let[e,r,n]=yt(this.mod,"duckdb_web_open",["string"],[JSON.stringify(t)]);if(e!==0)throw new Error(tt(this.mod,r,n));At(this.mod)}reset(){let[t,e,r]=yt(this.mod,"duckdb_web_reset",[],[]);if(t!==0)throw new Error(tt(this.mod,e,r));At(this.mod)}getVersion(){let[t,e,r]=yt(this.mod,"duckdb_web_get_version",[],[]);if(t!==0)throw new Error(tt(this.mod,e,r));let n=tt(this.mod,e,r);return At(this.mod),n}getFeatureFlags(){return this.mod.ccall("duckdb_web_get_feature_flags","number",[],[])}tokenize(t){let[e,r,n]=yt(this.mod,"duckdb_web_tokenize",["string"],[t]);if(e!==0)throw new Error(tt(this.mod,r,n));let o=tt(this.mod,r,n);return At(this.mod),JSON.parse(o)}connect(){let t=this.mod.ccall("duckdb_web_connect","number",[],[]);return new Qo(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,n,o]=yt(this.mod,"duckdb_web_query_run",["number","string"],[t,e]);if(r!==0)throw new Error(tt(this.mod,n,o));let u=Or(this.mod,n,o);return At(this.mod),u}startPendingQuery(t,e){let[r,n,o]=yt(this.mod,"duckdb_web_pending_query_start",["number","string"],[t,e]);if(r!==0)throw new Error(tt(this.mod,n,o));if(n==0)return null;let u=Or(this.mod,n,o);return At(this.mod),u}pollPendingQuery(t){let[e,r,n]=yt(this.mod,"duckdb_web_pending_query_poll",["number"],[t]);if(e!==0)throw new Error(tt(this.mod,r,n));if(r==0)return null;let o=Or(this.mod,r,n);return At(this.mod),o}cancelPendingQuery(t){return this.mod.ccall("duckdb_web_pending_query_cancel","boolean",["number"],[t])}fetchQueryResults(t){let[e,r,n]=yt(this.mod,"duckdb_web_query_fetch_results",["number"],[t]);if(e!==0)throw new Error(tt(this.mod,r,n));let o=Or(this.mod,r,n);return At(this.mod),o}getTableNames(t,e){let[r,n,o]=yt(this.mod,"duckdb_web_get_tablenames",["number","string"],[t,e]);if(r!==0)throw new Error(tt(this.mod,n,o));let u=tt(this.mod,n,o);return At(this.mod),JSON.parse(u)}createScalarFunction(t,e,r,n){let o={functionId:this._nextUDFId,name:e,returnType:un(r)},u={functionId:o.functionId,connectionId:t,name:e,returnType:r,func:n};this._nextUDFId+=1;let[h,m,g]=yt(this.mod,"duckdb_web_udf_scalar_create",["number","string"],[t,JSON.stringify(o)]);if(h!==0)throw new Error(tt(this.mod,m,g));if(At(this.mod),globalThis.DUCKDB_RUNTIME._udfFunctions=(globalThis.DUCKDB_RUNTIME._udfFunctions||new Map).set(u.functionId,u),this.pthread)for(let F of[...this.pthread.runningWorkers,...this.pthread.unusedWorkers])F.postMessage({cmd:"registerUDFFunction",udf:u})}createPrepared(t,e){let[r,n,o]=yt(this.mod,"duckdb_web_prepared_create",["number","string"],[t,e]);if(r!==0)throw new Error(tt(this.mod,n,o));return At(this.mod),n}closePrepared(t,e){let[r,n,o]=yt(this.mod,"duckdb_web_prepared_close",["number","number"],[t,e]);if(r!==0)throw new Error(tt(this.mod,n,o));At(this.mod)}runPrepared(t,e,r){let[n,o,u]=yt(this.mod,"duckdb_web_prepared_run",["number","number","string"],[t,e,JSON.stringify(r)]);if(n!==0)throw new Error(tt(this.mod,o,u));let h=Or(this.mod,o,u);return At(this.mod),h}sendPrepared(t,e,r){let[n,o,u]=yt(this.mod,"duckdb_web_prepared_send",["number","number","string"],[t,e,JSON.stringify(r)]);if(n!==0)throw new Error(tt(this.mod,o,u));let h=Or(this.mod,o,u);return At(this.mod),h}insertArrowFromIPCStream(t,e,r){if(e.length==0)return;let n=this.mod._malloc(e.length);this.mod.HEAPU8.subarray(n,n+e.length).set(e);let u=r?JSON.stringify(r):"",[h,m,g]=yt(this.mod,"duckdb_web_insert_arrow_from_ipc_stream",["number","number","number","string"],[t,n,e.length,u]);if(h!==0)throw new Error(tt(this.mod,m,g))}insertCSVFromPath(t,e,r){if(r.columns!==void 0){r.columnsFlat=[];for(let g in r.columns)r.columnsFlat.push(qo(g,r.columns[g]))}let n={...r};n.columns=n.columnsFlat,delete n.columnsFlat;let o=JSON.stringify(n),[u,h,m]=yt(this.mod,"duckdb_web_insert_csv_from_path",["number","string","string"],[t,e,o]);if(u!==0)throw new Error(tt(this.mod,h,m))}insertJSONFromPath(t,e,r){if(r.columns!==void 0){r.columnsFlat=[];for(let g in r.columns)r.columnsFlat.push(qo(g,r.columns[g]))}let n={...r};n.columns=n.columnsFlat,delete n.columnsFlat;let o=JSON.stringify(n),[u,h,m]=yt(this.mod,"duckdb_web_insert_json_from_path",["number","string","string"],[t,e,o]);if(u!==0)throw new Error(tt(this.mod,h,m))}globFiles(t){let[e,r,n]=yt(this.mod,"duckdb_web_fs_glob_file_infos",["string"],[t]);if(e!==0)throw new Error(tt(this.mod,r,n));let o=tt(this.mod,r,n);At(this.mod);let u=JSON.parse(o);return u==null?[]:u}registerFileURL(t,e,r,n=!1){e===void 0&&(e=t);let[o,u,h]=yt(this.mod,"duckdb_web_fs_register_file_url",["string","string"],[t,e,r,n]);if(o!==0)throw new Error(tt(this.mod,u,h));At(this.mod)}registerFileText(t,e){let r=gI.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[o,u,h]=yt(this.mod,"duckdb_web_fs_register_file_buffer",["string","number","number"],[t,r,e.length]);if(o!==0)throw new Error(tt(this.mod,u,h));At(this.mod)}registerFileHandle(t,e,r,n){let[o,u,h]=yt(this.mod,"duckdb_web_fs_register_file_url",["string","string","number","boolean"],[t,t,r,n]);if(o!==0)throw new Error(tt(this.mod,u,h));if(At(this.mod),globalThis.DUCKDB_RUNTIME._files=(globalThis.DUCKDB_RUNTIME._files||new Map).set(t,e),this.pthread){for(let m of this.pthread.runningWorkers)m.postMessage({cmd:"registerFileHandle",fileName:t,fileHandle:e});for(let m of this.pthread.unusedWorkers)m.postMessage({cmd:"dropFileHandle",fileName:t})}}dropFile(t){let[e,r,n]=yt(this.mod,"duckdb_web_fs_drop_file",["string"],[t]);if(e!==0)throw new Error(tt(this.mod,r,n));At(this.mod)}dropFiles(){let[t,e,r]=yt(this.mod,"duckdb_web_fs_drop_files",[],[]);if(t!==0)throw new Error(tt(this.mod,e,r));At(this.mod)}flushFiles(){this.mod.ccall("duckdb_web_flush_files",null,[],[])}copyFileToPath(t,e){let[r,n,o]=yt(this.mod,"duckdb_web_copy_file_to_path",["string","string"],[t,e]);if(r!==0)throw new Error(tt(this.mod,n,o));At(this.mod)}copyFileToBuffer(t){let[e,r,n]=yt(this.mod,"duckdb_web_copy_file_to_buffer",["string"],[t]);if(e!==0)throw new Error(tt(this.mod,r,n));let o=this.mod.HEAPU8.subarray(r,r+n),u=new Uint8Array(o.length);return u.set(o),At(this.mod),u}collectFileStatistics(t,e){let[r,n,o]=yt(this.mod,"duckdb_web_collect_file_stats",["string","boolean"],[t,e]);if(r!==0)throw new Error(tt(this.mod,n,o))}exportFileStatistics(t){let[e,r,n]=yt(this.mod,"duckdb_web_export_file_stats",["string"],[t]);if(e!==0)throw new Error(tt(this.mod,r,n));return new ia(this.mod.HEAPU8.subarray(r,r+n))}};var na=class extends ra{constructor(e,r,n,o){super(e,r);this.mainModuleURL=n,this.pthreadWorkerURL=o}locateFile(e,r){if(e.endsWith(".wasm"))return this.mainModuleURL;if(e.endsWith(".worker.js")){if(!this.pthreadWorkerURL)throw new Error("Missing DuckDB worker URL!");return this.pthreadWorkerURL}throw new Error(`WASM instantiation requested unexpected file: prefix=${r} path=${e}`)}instantiateWasm(e,r){globalThis.DUCKDB_RUNTIME=this._runtime;let n=this.onInstantiationProgress;if(WebAssembly.instantiateStreaming)if(typeof TransformStream=="function"){let u=(async()=>{var ct;let h=new Request(this.mainModuleURL),m=await fetch(h),g=m.headers.get("content-length"),F=g&&parseInt(g,10)||0,D=new Date,B={startedAt:D,updatedAt:D,bytesTotal:F||0,bytesLoaded:0},k={transform(gt,Ot){B.bytesLoaded+=gt.byteLength;let ce=new Date;if(ce.getTime()-B.updatedAt.getTime()<20){B.updatedAt=ce,Ot.enqueue(gt);return}for(let _e of n)_e(B);Ot.enqueue(gt)}},at=new TransformStream(k);return new Response((ct=m.body)==null?void 0:ct.pipeThrough(at),m)})();WebAssembly.instantiateStreaming(u,e).then(h=>{r(h.instance,h.module)})}else{console.warn("instantiating without progress handler since transform streams are unavailable");let o=new Request(this.mainModuleURL);WebAssembly.instantiateStreaming(fetch(o),e).then(u=>{r(u.instance,u.module)})}else if(typeof XMLHttpRequest=="function"){let o=new XMLHttpRequest,u=this.mainModuleURL,h=new Date,m={startedAt:h,updatedAt:h,bytesTotal:0,bytesLoaded:0};o.open("GET",u),o.responseType="arraybuffer",o.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())},o.onprogress=g=>{m.bytesTotal=g.total,m.bytesLoaded=g.loaded;let F=new Date;if(F.getTime()-m.updatedAt.getTime()<20){m.updatedAt=F;return}for(let D of n)D(m)},o.onload=()=>{WebAssembly.instantiate(o.response,e).then(g=>{r(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)})},o.send()}else console.warn("instantiating with manual fetch since streaming instantiation and xhrs are unavailable"),(async()=>{let u=new Request(this.mainModuleURL),m=await(await fetch(u)).arrayBuffer();WebAssembly.instantiate(m,e).then(g=>{r(g.instance,g.module)})})();return[]}};var sa=class extends na{constructor(t,e,r,n=null){super(t,e,r,n)}instantiateImpl(t){return Vp({...t,instantiateWasm:this.instantiateWasm.bind(this),locateFile:this.locateFile.bind(this)})}};var ur=Df(Yp()),Xp=function(i,t,e){var r;if((r=i==null?void 0:i.endpoint)!=null&&r.startsWith("http")){let n=`${i==null?void 0:i.endpoint}`,o=n.indexOf("://")+3;return n.substring(o)}else return i!=null&&i.endpoint?`${e}.${i==null?void 0:i.endpoint}`:`${e}.s3.amazonaws.com`};function wI(i,t,e){var n,o,u,h;let r=Gp(t);return{url:r.path,query:"",host:Xp(i,t,r.bucket),region:(n=i==null?void 0:i.region)!=null?n:"",service:"s3",method:e,accessKeyId:(o=i==null?void 0:i.accessKeyId)!=null?o:"",secretAccessKey:(u=i==null?void 0:i.secretAccessKey)!=null?u:"",sessionToken:(h=i==null?void 0:i.sessionToken)!=null?h:"",dateNow:new Date().toISOString().replace(/-/g,"").split("T")[0],datetimeNow:new Date().toISOString().replace(/-/g,"").replace(/:/g,"").split(".")[0]+"Z"}}function jI(i,t=!1){let e="0123456789ABCDEF",r="";for(let n=0;n<i.length;n++){let o=i[n];o>="A"&&o<="Z"||o>="a"&&o<="z"||o>="0"&&o<="9"||o=="_"||o=="-"||o=="~"||o=="."?r+=o:o=="/"?t?r+="%2F":r+=o:(r+="%",r+=e[o.charCodeAt(0)>>4],r+=e[o.charCodeAt(0)&15])}return r}function SI(i,t=null){var at;let e=(at=t==null?void 0:t.contentHash)!=null?at:"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 n="";t!=null&&t.contentType&&(n+="content-type;"),n+="host;x-amz-content-sha256;x-amz-date",i.sessionToken&&(n+=";x-amz-security-token");let o=i.method+`
12
+ `+jI(i.url)+`
13
13
  `+i.query;t!=null&&t.contentType&&(o+=`
14
14
  content-type:`+(t==null?void 0:t.contentType)),o+=`
15
15
  host:`+i.host+`
@@ -18,10 +18,10 @@ x-amz-date:`+i.datetimeNow,i.sessionToken&&i.sessionToken.length>0&&(o+=`
18
18
  x-amz-security-token:`+i.sessionToken),o+=`
19
19
 
20
20
  `+n+`
21
- `+e;let c=(0,lr.sha256)(o),p=`AWS4-HMAC-SHA256
21
+ `+e;let u=(0,ur.sha256)(o),h=`AWS4-HMAC-SHA256
22
22
  `+i.datetimeNow+`
23
23
  `+i.dateNow+"/"+i.region+"/"+i.service+`/aws4_request
24
- `+c,b="AWS4"+i.secretAccessKey,g=lr.sha256.hmac.arrayBuffer(b,i.dateNow),A=lr.sha256.hmac.arrayBuffer(g,i.region),T=lr.sha256.hmac.arrayBuffer(A,i.service),F=lr.sha256.hmac.arrayBuffer(T,"aws4_request"),k=lr.sha256.hmac(F,p);return r.set("Authorization","AWS4-HMAC-SHA256 Credential="+i.accessKeyId+"/"+i.dateNow+"/"+i.region+"/"+i.service+"/aws4_request, SignedHeaders="+n+", Signature="+k),r}var dI=function(i,t,e,r=null,n=null){let o=lI(i,t,e),c={contentType:r,contentHash:n?lr.sha256.hex(n):null};return uI(o,c)};function cr(i,t,e,r,n=null,o=null){((t==null?void 0:t.accessKeyId)||(t==null?void 0:t.sessionToken))&&(dI(t,e,r,n,o).forEach((p,b)=>{i.setRequestHeader(b,p)}),n&&i.setRequestHeader("content-type",n))}function zp(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 ur(i,t){var r;let e=zp(t);return(r=i==null?void 0:i.endpoint)!=null&&r.startsWith("http")?`${i==null?void 0:i.endpoint}/${e.bucket}`+e.path:"https://"+Hp(i,t,e.bucket)+e.path}var vt={_files:new Map,_fileInfoCache:new Map,_udfFunctions:new Map,_globalFileInfo:null,getFileInfo(i,t){try{let e=vt._fileInfoCache.get(t),[r,n,o]=ht(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(o===0)return e;let c=tt(i,n,o);St(i);let p=JSON.parse(c);if(p==null)return null;let b={...p,blob:null};return vt._fileInfoCache.set(t,b),b}catch(e){return null}},getGlobalFileInfo(i){var t;try{let[e,r,n]=ht(i,"duckdb_web_get_global_file_info",["number"],[((t=vt._globalFileInfo)==null?void 0:t.cacheEpoch)||0]);if(e!==0)return null;if(n===0)return vt._globalFileInfo;let o=tt(i,r,n);St(i);let c=JSON.parse(o);return c==null?null:(vt._globalFileInfo={...c,blob:null},vt._globalFileInfo)}catch(e){return null}},testPlatformFeature:(i,t)=>{switch(t){case 1:return typeof BigInt64Array<"u";default:return console.warn(`test for unknown feature: ${t}`),!1}},openFile:(i,t,e)=>{var r;try{vt._fileInfoCache.delete(t);let n=vt.getFileInfo(i,t);switch(n==null?void 0:n.dataProtocol){case 3:case 4:{if(e&1&&e&2)throw new Error(`Opening file ${n.fileName} failed: cannot open file with both read and write flags set`);if(e&32)throw new Error(`Opening file ${n.fileName} failed: appending to HTTP/S3 files is not supported`);if(e&2){let c=new XMLHttpRequest;if(n.dataProtocol==4?(c.open("HEAD",ur(n.s3Config,n.dataUrl),!1),cr(c,n.s3Config,n.dataUrl,"HEAD")):c.open("HEAD",n.dataUrl,!1),c.send(null),c.status!=200&&c.status!=404)throw new Error(`Opening file ${n.fileName} failed: Unexpected return status from server (${c.status})`);if(c.status==404&&!(e&8||e&16))throw new Error(`Opening file ${n.fileName} failed: Cannot write to non-existent file without FILE_FLAGS_FILE_CREATE or FILE_FLAGS_FILE_CREATE_NEW flag.`);let p=i._malloc(1),b=new Uint8Array;i.HEAPU8.set(b,p);let g=i._malloc(2*8);return i.HEAPF64[(g>>3)+0]=1,i.HEAPF64[(g>>3)+1]=p,g}else if(e!=1)throw new Error(`Opening file ${n.fileName} failed: unsupported file flags: ${e}`);let o=null;try{let c=new XMLHttpRequest;n.dataProtocol==4?(c.open("HEAD",ur(n.s3Config,n.dataUrl),!1),cr(c,n.s3Config,n.dataUrl,"HEAD")):c.open("HEAD",n.dataUrl,!1),c.setRequestHeader("Range","bytes=0-"),c.send(null);let p=c.getResponseHeader("Content-Length");if(c.status==206&&p!==null){let b=i._malloc(16);return i.HEAPF64[(b>>3)+0]=+p,i.HEAPF64[(b>>3)+1]=0,b}}catch(c){o=c,console.warn(`HEAD request with range header failed: ${c}`)}if(n.allowFullHttpReads){console.warn(`falling back to full HTTP read for: ${n.dataUrl}`);let c=new XMLHttpRequest;if(n.dataProtocol==4?(c.open("GET",ur(n.s3Config,n.dataUrl),!1),cr(c,n.s3Config,n.dataUrl,"GET")):c.open("GET",n.dataUrl,!1),c.responseType="arraybuffer",c.send(null),c.status==200){let p=i._malloc(c.response.byteLength),b=new Uint8Array(c.response,0,c.response.byteLength);i.HEAPU8.set(b,p);let g=i._malloc(2*8);return i.HEAPF64[(g>>3)+0]=c.response.byteLength,i.HEAPF64[(g>>3)+1]=p,g}}if(o!=null)throw new Error(`Reading file ${n.fileName} failed with error: ${o}`);return 0}case 1:{let o=(r=vt._files)==null?void 0:r.get(n.fileName);if(o){let b=i._malloc(16);return i.HEAPF64[(b>>3)+0]=o.size,i.HEAPF64[(b>>3)+1]=0,b}console.warn(`Buffering missing file: ${n.fileName}`);let c=i._malloc(2*8),p=i._malloc(1);return i.HEAPF64[(c>>3)+0]=1,i.HEAPF64[(c>>3)+1]=p,c}}}catch(n){console.error(n.toString()),Ii(i,n.toString())}return 0},glob:(i,t,e)=>{try{let r=tt(i,t,e);if(r.startsWith("http")||r.startsWith("s3://")){let n=new XMLHttpRequest;if(r.startsWith("s3://")){let o=vt.getGlobalFileInfo(i);n.open("HEAD",ur(o==null?void 0:o.s3Config,r),!1),cr(n,o==null?void 0:o.s3Config,r,"HEAD")}else n.open("HEAD",r,!1);if(n.send(null),n.status!=200&&n.status!==206){Ii(i,`HEAD request failed: ${r}`);return}i.ccall("duckdb_web_fs_glob_add_path",null,["string"],[r])}}catch(r){return Ii(i,r.toString()),0}},checkFile:(i,t,e)=>{try{let r=tt(i,t,e);if(r.startsWith("http")||r.startsWith("s3://")){let n=new XMLHttpRequest;if(r.startsWith("s3://")){let o=vt.getGlobalFileInfo(i);n.open("HEAD",ur(o==null?void 0:o.s3Config,r),!1),cr(n,o==null?void 0:o.s3Config,r,"HEAD")}else n.open("HEAD",r,!1);return n.send(null),n.status==206||n.status==200}}catch(r){return!1}return!1},syncFile:(i,t)=>{},closeFile:(i,t)=>{let e=vt.getFileInfo(i,t);switch(vt._fileInfoCache.delete(t),e==null?void 0:e.dataProtocol){case 3:case 4:break;case 1:return}},truncateFile:(i,t,e)=>{let r=vt.getFileInfo(i,t);switch(r==null?void 0:r.dataProtocol){case 3:Ii(i,"Cannot truncate a http file");return;case 4:Ii(i,"Cannot truncate an s3 file");return;case 1:Ii(i,"truncateFile not implemented");return}return 0},readFile(i,t,e,r,n){var o;try{let c=vt.getFileInfo(i,t);switch(c==null?void 0:c.dataProtocol){case 3:case 4:{if(!c.dataUrl)throw new Error(`Missing data URL for file ${t}`);try{let p=new XMLHttpRequest;if(c.dataProtocol==4?(p.open("GET",ur(c==null?void 0:c.s3Config,c.dataUrl),!1),cr(p,c==null?void 0:c.s3Config,c.dataUrl,"GET")):p.open("GET",c.dataUrl,!1),p.responseType="arraybuffer",p.setRequestHeader("Range",`bytes=${n}-${n+r-1}`),p.send(null),p.status==206||p.status==200&&r==p.response.byteLength&&n==0){let b=new Uint8Array(p.response,0,Math.min(p.response.byteLength,r));return i.HEAPU8.set(b,e),b.byteLength}else throw p.status==200?new Error(`Range request for ${c.dataUrl} did not return a partial response: ${p.status} "${p.statusText}"`):new Error(`Range request for ${c.dataUrl} did returned non-success status: ${p.status} "${p.statusText}"`)}catch(p){throw new Error(`Range request for ${c.dataUrl} failed with error: ${p}"`)}}case 1:{let p=(o=vt._files)==null?void 0:o.get(c.fileName);if(!p)throw new Error(`No handle available for file: ${c.fileName}`);let b=p.slice(n,n+r),g=new Uint8Array(new FileReaderSync().readAsArrayBuffer(b));return i.HEAPU8.set(g,e),g.byteLength}}return 0}catch(c){return Ii(i,c.toString()),0}},writeFile:(i,t,e,r,n)=>{let o=vt.getFileInfo(i,t);switch(o==null?void 0:o.dataProtocol){case 3:return Ii(i,"Cannot write to HTTP file"),0;case 4:{let c=i.HEAPU8.subarray(e,e+r),p=new XMLHttpRequest;return p.open("PUT",ur(o==null?void 0:o.s3Config,o.dataUrl),!1),cr(p,o==null?void 0:o.s3Config,o.dataUrl,"PUT","",c),p.send(c),r}case 1:return Ii(i,"writefile not implemented"),0}return 0},getLastFileModificationTime:(i,t)=>{var r;let e=vt.getFileInfo(i,t);switch(e==null?void 0:e.dataProtocol){case 1:{if(!((r=vt._files)==null?void 0:r.get(e.fileName)))throw Error(`No handle available for file: ${e.fileName}`);return 0}case 3:case 4:return new Date().getTime()}return 0},checkDirectory:(i,t,e)=>{let r=tt(i,t,e);return console.log(`checkDirectory: ${r}`),!1},createDirectory:(i,t,e)=>{let r=tt(i,t,e);console.log(`createDirectory: ${r}`)},removeDirectory:(i,t,e)=>{let r=tt(i,t,e);console.log(`removeDirectory: ${r}`)},listDirectoryEntries:(i,t,e)=>{let r=tt(i,t,e);return console.log(`listDirectoryEntries: ${r}`),!1},moveFile:(i,t,e,r,n)=>{var b,g;let o=tt(i,t,e),c=tt(i,r,n),p=(b=vt._files)==null?void 0:b.get(o);p!==void 0&&(vt._files.delete(p),vt._files.set(c,p));for(let[A,T]of((g=vt._fileInfoCache)==null?void 0:g.entries())||[])if(T.dataUrl==o){vt._fileInfoCache.delete(A);break}return!0},removeFile:(i,t,e)=>{},callScalarUDF:(i,t,e,r,n,o,c)=>{Pp(vt,i,t,e,r,n,o,c)}};var _l=class extends Go{postMessage(t,e){globalThis.postMessage(t,e)}async instantiate(t,e,r){return await new ea(this,vt,t,e).instantiate(r)}};function Wp(){let i=new _l;globalThis.onmessage=async t=>{await i.onMessage(t.data)}}Wp();return ww(fI);})();
24
+ `+u,m="AWS4"+i.secretAccessKey,g=ur.sha256.hmac.arrayBuffer(m,i.dateNow),F=ur.sha256.hmac.arrayBuffer(g,i.region),D=ur.sha256.hmac.arrayBuffer(F,i.service),B=ur.sha256.hmac.arrayBuffer(D,"aws4_request"),k=ur.sha256.hmac(B,h);return r.set("Authorization","AWS4-HMAC-SHA256 Credential="+i.accessKeyId+"/"+i.dateNow+"/"+i.region+"/"+i.service+"/aws4_request, SignedHeaders="+n+", Signature="+k),r}var II=function(i,t,e,r=null,n=null){let o=wI(i,t,e),u={contentType:r,contentHash:n?ur.sha256.hex(n):null};return SI(o,u)};function dr(i,t,e,r,n=null,o=null){((t==null?void 0:t.accessKeyId)||(t==null?void 0:t.sessionToken))&&(II(t,e,r,n,o).forEach((h,m)=>{i.setRequestHeader(m,h)}),n&&i.setRequestHeader("content-type",n))}function Gp(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 fr(i,t){var r;let e=Gp(t);return(r=i==null?void 0:i.endpoint)!=null&&r.startsWith("http")?`${i==null?void 0:i.endpoint}/${e.bucket}`+e.path:"https://"+Xp(i,t,e.bucket)+e.path}var _t={_files:new Map,_fileInfoCache:new Map,_udfFunctions:new Map,_globalFileInfo:null,getFileInfo(i,t){try{let e=_t._fileInfoCache.get(t),[r,n,o]=yt(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(o===0)return e;let u=tt(i,n,o);At(i);let h=JSON.parse(u);if(h==null)return null;let m={...h,blob:null};return _t._fileInfoCache.set(t,m),m}catch(e){return null}},getGlobalFileInfo(i){var t;try{let[e,r,n]=yt(i,"duckdb_web_get_global_file_info",["number"],[((t=_t._globalFileInfo)==null?void 0:t.cacheEpoch)||0]);if(e!==0)return null;if(n===0)return _t._globalFileInfo;let o=tt(i,r,n);At(i);let u=JSON.parse(o);return u==null?null:(_t._globalFileInfo={...u,blob:null},_t._globalFileInfo)}catch(e){return null}},testPlatformFeature:(i,t)=>{switch(t){case 1:return typeof BigInt64Array<"u";default:return console.warn(`test for unknown feature: ${t}`),!1}},getDefaultDataProtocol(i){return 2},openFile:(i,t,e)=>{var r;try{_t._fileInfoCache.delete(t);let n=_t.getFileInfo(i,t);switch(n==null?void 0:n.dataProtocol){case 4:case 5:{if(e&1&&e&2)throw new Error(`Opening file ${n.fileName} failed: cannot open file with both read and write flags set`);if(e&32)throw new Error(`Opening file ${n.fileName} failed: appending to HTTP/S3 files is not supported`);if(e&2){let u=new XMLHttpRequest;if(n.dataProtocol==5?(u.open("HEAD",fr(n.s3Config,n.dataUrl),!1),dr(u,n.s3Config,n.dataUrl,"HEAD")):u.open("HEAD",n.dataUrl,!1),u.send(null),u.status!=200&&u.status!=404)throw new Error(`Opening file ${n.fileName} failed: Unexpected return status from server (${u.status})`);if(u.status==404&&!(e&8||e&16))throw new Error(`Opening file ${n.fileName} failed: Cannot write to non-existent file without FILE_FLAGS_FILE_CREATE or FILE_FLAGS_FILE_CREATE_NEW flag.`);let h=i._malloc(1),m=new Uint8Array;i.HEAPU8.set(m,h);let g=i._malloc(2*8);return i.HEAPF64[(g>>3)+0]=1,i.HEAPF64[(g>>3)+1]=h,g}else if(e!=1)throw new Error(`Opening file ${n.fileName} failed: unsupported file flags: ${e}`);let o=null;try{let u=new XMLHttpRequest;n.dataProtocol==5?(u.open("HEAD",fr(n.s3Config,n.dataUrl),!1),dr(u,n.s3Config,n.dataUrl,"HEAD")):u.open("HEAD",n.dataUrl,!1),u.setRequestHeader("Range","bytes=0-"),u.send(null);let h=u.getResponseHeader("Content-Length");if(u.status==206&&h!==null){let m=i._malloc(16);return i.HEAPF64[(m>>3)+0]=+h,i.HEAPF64[(m>>3)+1]=0,m}}catch(u){o=u,console.warn(`HEAD request with range header failed: ${u}`)}if(n.allowFullHttpReads){console.warn(`falling back to full HTTP read for: ${n.dataUrl}`);let u=new XMLHttpRequest;if(n.dataProtocol==5?(u.open("GET",fr(n.s3Config,n.dataUrl),!1),dr(u,n.s3Config,n.dataUrl,"GET")):u.open("GET",n.dataUrl,!1),u.responseType="arraybuffer",u.send(null),u.status==200){let h=i._malloc(u.response.byteLength),m=new Uint8Array(u.response,0,u.response.byteLength);i.HEAPU8.set(m,h);let g=i._malloc(2*8);return i.HEAPF64[(g>>3)+0]=u.response.byteLength,i.HEAPF64[(g>>3)+1]=h,g}}if(o!=null)throw new Error(`Reading file ${n.fileName} failed with error: ${o}`);return 0}case 2:{let o=(r=_t._files)==null?void 0:r.get(n.fileName);if(o){let m=i._malloc(16);return i.HEAPF64[(m>>3)+0]=o.size,i.HEAPF64[(m>>3)+1]=0,m}console.warn(`Buffering missing file: ${n.fileName}`);let u=i._malloc(2*8),h=i._malloc(1);return i.HEAPF64[(u>>3)+0]=1,i.HEAPF64[(u>>3)+1]=h,u}}}catch(n){console.error(n.toString()),Ai(i,n.toString())}return 0},glob:(i,t,e)=>{try{let r=tt(i,t,e);if(r.startsWith("http")||r.startsWith("s3://")){let n=new XMLHttpRequest;if(r.startsWith("s3://")){let o=_t.getGlobalFileInfo(i);n.open("HEAD",fr(o==null?void 0:o.s3Config,r),!1),dr(n,o==null?void 0:o.s3Config,r,"HEAD")}else n.open("HEAD",r,!1);if(n.send(null),n.status!=200&&n.status!==206){Ai(i,`HEAD request failed: ${r}`);return}i.ccall("duckdb_web_fs_glob_add_path",null,["string"],[r])}}catch(r){return Ai(i,r.toString()),0}},checkFile:(i,t,e)=>{try{let r=tt(i,t,e);if(r.startsWith("http")||r.startsWith("s3://")){let n=new XMLHttpRequest;if(r.startsWith("s3://")){let o=_t.getGlobalFileInfo(i);n.open("HEAD",fr(o==null?void 0:o.s3Config,r),!1),dr(n,o==null?void 0:o.s3Config,r,"HEAD")}else n.open("HEAD",r,!1);return n.send(null),n.status==206||n.status==200}}catch(r){return!1}return!1},syncFile:(i,t)=>{},closeFile:(i,t)=>{var r;let e=_t.getFileInfo(i,t);switch(_t._fileInfoCache.delete(t),e==null?void 0:e.dataProtocol){case 0:case 4:case 5:break;case 1:case 2:return;case 3:{let n=(r=_t._files)==null?void 0:r.get(e.fileName);if(!n)throw new Error(`No OPFS access handle registered with name: ${e.fileName}`);return n.flush()}}},truncateFile:(i,t,e)=>{var n;let r=_t.getFileInfo(i,t);switch(r==null?void 0:r.dataProtocol){case 4:Ai(i,"Cannot truncate a http file");return;case 5:Ai(i,"Cannot truncate an s3 file");return;case 0:case 1:case 2:Ai(i,"truncateFile not implemented");return;case 3:{let o=(n=_t._files)==null?void 0:n.get(r.fileName);if(!o)throw new Error(`No OPFS access handle registered with name: ${r.fileName}`);return o.truncate(e)}}return 0},readFile(i,t,e,r,n){var o,u;try{let h=_t.getFileInfo(i,t);switch(h==null?void 0:h.dataProtocol){case 4:case 5:{if(!h.dataUrl)throw new Error(`Missing data URL for file ${t}`);try{let m=new XMLHttpRequest;if(h.dataProtocol==5?(m.open("GET",fr(h==null?void 0:h.s3Config,h.dataUrl),!1),dr(m,h==null?void 0:h.s3Config,h.dataUrl,"GET")):m.open("GET",h.dataUrl,!1),m.responseType="arraybuffer",m.setRequestHeader("Range",`bytes=${n}-${n+r-1}`),m.send(null),m.status==206||m.status==200&&r==m.response.byteLength&&n==0){let g=new Uint8Array(m.response,0,Math.min(m.response.byteLength,r));return i.HEAPU8.set(g,e),g.byteLength}else throw m.status==200?new Error(`Range request for ${h.dataUrl} did not return a partial response: ${m.status} "${m.statusText}"`):new Error(`Range request for ${h.dataUrl} did returned non-success status: ${m.status} "${m.statusText}"`)}catch(m){throw new Error(`Range request for ${h.dataUrl} failed with error: ${m}"`)}}case 2:{let m=(o=_t._files)==null?void 0:o.get(h.fileName);if(!m)throw new Error(`No HTML5 file registered with name: ${h.fileName}`);let g=m.slice(n,n+r),F=new Uint8Array(new FileReaderSync().readAsArrayBuffer(g));return i.HEAPU8.set(F,e),F.byteLength}case 3:{let m=(u=_t._files)==null?void 0:u.get(h.fileName);if(!m)throw new Error(`No OPFS access handle registered with name: ${h.fileName}`);let g=i.HEAPU8.subarray(e,e+r);return m.read(g,{at:n})}}return 0}catch(h){return Ai(i,h.toString()),0}},writeFile:(i,t,e,r,n)=>{var u;let o=_t.getFileInfo(i,t);switch(o==null?void 0:o.dataProtocol){case 4:return Ai(i,"Cannot write to HTTP file"),0;case 5:{let h=i.HEAPU8.subarray(e,e+r),m=new XMLHttpRequest;return m.open("PUT",fr(o==null?void 0:o.s3Config,o.dataUrl),!1),dr(m,o==null?void 0:o.s3Config,o.dataUrl,"PUT","",h),m.send(h),r}case 2:return Ai(i,"cannot write using the html5 file reader api"),0;case 3:{let h=(u=_t._files)==null?void 0:u.get(o.fileName);if(!h)throw new Error(`No OPFS access handle registered with name: ${o.fileName}`);let m=i.HEAPU8.subarray(e,e+r);return h.write(m,{at:n})}}return 0},getLastFileModificationTime:(i,t)=>{var r;let e=_t.getFileInfo(i,t);switch(e==null?void 0:e.dataProtocol){case 2:{if(!((r=_t._files)==null?void 0:r.get(e.fileName)))throw Error(`No handle available for file: ${e.fileName}`);return 0}case 4:case 5:return new Date().getTime()}return 0},checkDirectory:(i,t,e)=>{let r=tt(i,t,e);return console.log(`checkDirectory: ${r}`),!1},createDirectory:(i,t,e)=>{let r=tt(i,t,e);console.log(`createDirectory: ${r}`)},removeDirectory:(i,t,e)=>{let r=tt(i,t,e);console.log(`removeDirectory: ${r}`)},listDirectoryEntries:(i,t,e)=>{let r=tt(i,t,e);return console.log(`listDirectoryEntries: ${r}`),!1},moveFile:(i,t,e,r,n)=>{var m,g;let o=tt(i,t,e),u=tt(i,r,n),h=(m=_t._files)==null?void 0:m.get(o);h!==void 0&&(_t._files.delete(h),_t._files.set(u,h));for(let[F,D]of((g=_t._fileInfoCache)==null?void 0:g.entries())||[])if(D.dataUrl==o){_t._fileInfoCache.delete(F);break}return!0},removeFile:(i,t,e)=>{},callScalarUDF:(i,t,e,r,n,o,u)=>{$p(_t,i,t,e,r,n,o,u)}};var bl=class extends Zo{postMessage(t,e){globalThis.postMessage(t,e)}async instantiate(t,e,r){return await new sa(this,_t,t,e).instantiate(r)}};function Kp(){let i=new bl;globalThis.onmessage=async t=>{await i.onMessage(t.data)}}Kp();return Ow(CI);})();
25
25
  /**
26
26
  * [js-sha256]{@link https://github.com/emn178/js-sha256}
27
27
  *